From 8b6d09dea6117faf275292a0bb6ed66890ca1489 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 16:00:02 +0200 Subject: [PATCH 01/34] setup the repo for ai agents --- .claude/.gitignore | 8 ++++++ .claude/CLAUDE.md | 1 + .claude/settings.json | 18 +++++++++++++ AGENTS.md | 47 ++++++++++++++++++++++++++++++++++ Documents/ai/project/AGENTS.md | 5 ++++ Documents/ai/project/agenda.md | 37 ++++++++++++++++++++++++++ build.sh | 24 ----------------- 7 files changed, 116 insertions(+), 24 deletions(-) create mode 100644 .claude/.gitignore create mode 100644 .claude/CLAUDE.md create mode 100644 .claude/settings.json create mode 100644 AGENTS.md create mode 100644 Documents/ai/project/AGENTS.md create mode 100644 Documents/ai/project/agenda.md delete mode 100755 build.sh diff --git a/.claude/.gitignore b/.claude/.gitignore new file mode 100644 index 000000000..d4338d645 --- /dev/null +++ b/.claude/.gitignore @@ -0,0 +1,8 @@ +# ignore memory items that claude might write when you get mad at it +projects/ + +# ignore this high churn file that is written whenever you allow a tool use +settings.local.json + +# allow developers to write their own instructions here without checking them in +CLAUDE.local.md diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 000000000..00faa28c1 --- /dev/null +++ b/.claude/CLAUDE.md @@ -0,0 +1 @@ +Do not edit this file. Read and edit AGENTS.md instead. diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 000000000..89f051566 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,18 @@ +{ + "hooks": + { + "SessionStart": + [ + { + "hooks": + [ + { + "type": "command", + "command": "printf '{\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"Before doing any work in this session, read AGENTS.md.\"}}'", + "statusMessage": "Reading AGENTS.md..." + } + ] + } + ] + } +} diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..5d9c5e291 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,47 @@ +# mx + +A library for serializing and deserializing MusicXML in C++. The ./README.md file is useful. + +## Project Index + +Key paths in this repository: + +- `Sourcecode/` — Main C++ source tree (public API, core elements, implementation, tests) +- `Sourcecode/include/mx/api/` — Public API headers: `*Data` structs and `DocumentManager` entry point +- `Sourcecode/private/mx/api/` — Public API implementation backing the `include/mx/api` headers +- `Sourcecode/private/mx/core/` — Strongly-typed MusicXML element classes (mostly code-generated) +- `Sourcecode/private/mx/core/elements/` — Generated element classes, one pair per MusicXML element (1182 files) +- `Sourcecode/private/mx/impl/` — Conversion layer mapping the core DOM to the public API +- `Sourcecode/private/mx/ezxml/` — Embedded lightweight XML reader/writer used by the core +- `Sourcecode/private/mx/utility/` — Shared helpers (string, parsing, file system utilities) +- `Sourcecode/private/mxtest/` — Test suite (api, core, file, import, impl, control) +- `Sourcecode/private/cpul/` — Catch-based unit-test harness and test runner main +- `CodeGen/` — Rust tool that generates the core element classes from the MusicXML XSD +- `CodeGen/src/` — Generator source: XSD parsing, model, and C++ emission +- `Resources/` — MusicXML input files and expected-output suites for round-trip tests +- `Documents/` — MusicXML XSD specifications and developer notes +- `DevScripts/` — Ruby and shell scripts for one-off code maintenance +- `CMakeLists.txt` — CMake build configuration +- `Makefile` — Primary build-and-test entry point (wraps CMake; `make help` lists targets) +- `README.md` — Project overview, build instructions, and usage examples +- `Xcode/` — Xcode project and workspace files for macOS/iOS builds + +## Historical Context + +`Sourcecode/private/mx/core/` and `Sourcecode/private/mx/core/elements/` was originally "hand-generated" by human +brute-force using Ruby scripts which can still be found in `./DevScripts`. This was never a one-shot solution to +generating the code from the XSD spec. Rather, it was an iterative process, solving problems encountered one-at-a-time +until the XSD spec was entirely covered. As such, it is not viable for re-use at this time, but can be used to +understand the historical nature of how the types were first generated. + +## The Problem + +We are stuck somewhere around MusicXML 3.1 (or maybe 3.0) because we cannot reliably re-generate the types from a newer +version of the specification. MusicxML 4.0 has been out for a long time, and we want to support it. But we need to write +new code-gen tooling to reproduce the emission of the core types and then expose the new features in +`Sourcecode/include/mx/api/`. + +## The Project + +We are working on reverse engineering a new codegen system to regenerate mx/core for MusicXML 4.0. See the project +directory @./Documents/ai/project/AGENTS.md diff --git a/Documents/ai/project/AGENTS.md b/Documents/ai/project/AGENTS.md new file mode 100644 index 000000000..bad2b6d07 --- /dev/null +++ b/Documents/ai/project/AGENTS.md @@ -0,0 +1,5 @@ +# Project + +This is the directory for supporting MusicXML 4.0. + +./agenda.md is the TODO list of work items. diff --git a/Documents/ai/project/agenda.md b/Documents/ai/project/agenda.md new file mode 100644 index 000000000..bfa124981 --- /dev/null +++ b/Documents/ai/project/agenda.md @@ -0,0 +1,37 @@ +# Agenda + +This is the project plan for supporting MusicXML 4.0 + +## Phase 0: Prepare for AI Development + +- [x] Create a Makefile +- [ ] fix the line endind issues in markdown files like README.md +- [ ] Get .github CI modernized and working +- [ ] Put a fmt'er in place +- [ ] Put linters in place +- [ ] get a handle on .gitattributes and what should be done with it +- [ ] Put a check of Lints and Fmt's in place +- [ ] See how this now interacts with JetBrains CLion (which seems to create a `cmake-build-debug` directory) +- [ ] Codefy Change Quality Gates in AGENTS.md + +## Phase 1: Reverse Engineer Codegen + +- [ ] Design a process by which the AI agent can iteratively work on the codegen problem + +## Phase 2: Modernize or Improve the C++ + +Before we codegen 4.0, maybe we should improve what is being generated from the current MusicXML Spec for performance +and for new C++ features, e.g. enum variants etc. Can it be more optimal? + +## Phase 3: Analyze which features of MusicXML are inaccessible from mx/api + +## Phase 4: Generate MusicXML 4.0 Types + +## Phase 5: Surface MusicXML 4.0 Features to mxapi types + +## Random Ass TODOs + +Not related to the larger project plan: + +- [ ] Remove CircleCI Stuff +- [ ] Cleanup the Changelog \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index 9a064bc5f..000000000 --- a/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail -mx="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -bld="${mx}/build" - -echo "mx=${mx}" -echo "bld=${bld}" -procs=$1 - -mkdir -p "${bld}" -cd "${bld}" -cmake "${mx}" \ - -DMX_BUILD_TESTS=on \ - -DMX_BUILD_CORE_TESTS=on \ - -DMX_BUILD_EXAMPLES=on -make -C "${bld}" -j"${procs:=48}" -echo "Running mxread" -"${bld}/mxread" -echo "Running mxwrite" -"${bld}/mxwrite" -echo "Running mxhide" -"${bld}/mxhide" -echo "Running mxtest" -"${bld}/mxtest" From b8c2834492e0ec45c35589800e7ce57265c450ec Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 16:00:09 +0200 Subject: [PATCH 02/34] switch to using a makefile --- Makefile | 156 +++++ README.md | 1747 +++++++++++++++++++++++++++-------------------------- 2 files changed, 1036 insertions(+), 867 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..f44d8b37f --- /dev/null +++ b/Makefile @@ -0,0 +1,156 @@ +# mx build/test driver +# ============================================================================ +# +# This Makefile is a thin, portable convenience wrapper around CMake. It does +# not replace CMake; it just encodes the handful of build/test configurations +# this project actually uses so you don't have to remember the option combos. +# +# It assumes a POSIX shell and that `cmake` is on PATH. On Windows it is +# best-effort: install CMake plus GNU make and a POSIX shell (Git Bash, MSYS2, +# or WSL) and it works there too. The underlying compiler/generator can still +# be MSVC -- builds go through `cmake --build`, which is generator-agnostic. +# +# Requires CMake >= 3.13 (for `cmake -S/-B` and `--build --parallel`). +# +# ---------------------------------------------------------------------------- +# Build modes +# ---------------------------------------------------------------------------- +# +# The project exposes three CMake options: MX_BUILD_TESTS, MX_BUILD_CORE_TESTS, +# and MX_BUILD_EXAMPLES. Only three points on that matrix are workflows the +# project actually documents, so those are the three build targets: +# +# lib TESTS=off CORE=off EXAMPLES=off +# +# dev TESTS=on CORE=off EXAMPLES=on +# The README's "recommended configuration for development" +# +# core TESTS=on CORE=on EXAMPLES=on +# "if you make changes in the mx::core namespace" -- +# e.g. regenerating mx::core for a new MusicXML version. Slow compile. +# +# ---------------------------------------------------------------------------- +# Build directory layout +# ---------------------------------------------------------------------------- +# +# Each mode builds into build// with its own CMake cache and +# incremental state, e.g. build/dev/Debug, build/core/Debug. Because the modes +# do not share a directory, switching from `core` back to `dev` (or flipping +# BUILD_TYPE) never reconfigures and never recompiles the slow core tests. +# `build/` is already in .gitignore. +# +# ---------------------------------------------------------------------------- +# Knobs (environment / make variables -- these are overrides, not modes) +# ---------------------------------------------------------------------------- +# +# JOBS Parallel compile jobs. Auto-detected; override: JOBS=8 make dev +# BUILD_TYPE CMake build type, default Debug. Passed as -DCMAKE_BUILD_TYPE +# (single-config generators) AND --config (multi-config: MSVC, +# Xcode), so it is correct on every generator. +# GENERATOR CMake generator. Unset = CMake's platform default (Unix +# Makefiles on Linux/macOS, Visual Studio on Windows). Override: +# GENERATOR=Ninja make dev +# ARGS Forwarded to the mxtest (Catch2) binary, e.g. +# make test ARGS='[core]' or make test ARGS='--list-tests' +# +# ============================================================================ + +CMAKE ?= cmake +BUILD_TYPE ?= Debug +BUILD_ROOT := build + +# Portable CPU-count detection. Tried in order; the final echo always succeeds +# (Windows cmd/PowerShell exports NUMBER_OF_PROCESSORS; otherwise fall back 4). +JOBS ?= $(shell nproc 2>/dev/null \ + || sysctl -n hw.ncpu 2>/dev/null \ + || getconf _NPROCESSORS_ONLN 2>/dev/null \ + || echo "$${NUMBER_OF_PROCESSORS:-4}") + +# Optional -G flag. Generator names contain spaces, so quote when set. +ifneq ($(strip $(GENERATOR)),) +GEN_ARG := -G "$(GENERATOR)" +endif + +# build// for the given mode ($1). +mode_dir = $(BUILD_ROOT)/$(1)/$(BUILD_TYPE) + +# Configure + build a mode. $1 = mode name, then the three MX_BUILD_* values. +define cmake_build + $(CMAKE) -S . -B $(call mode_dir,$(1)) \ + -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \ + -DMX_BUILD_TESTS=$(2) \ + -DMX_BUILD_CORE_TESTS=$(3) \ + -DMX_BUILD_EXAMPLES=$(4) \ + $(GEN_ARG) + $(CMAKE) --build $(call mode_dir,$(1)) --parallel $(JOBS) --config $(BUILD_TYPE) +endef + +# Locate and run a built binary. CMake places it at / for +# single-config generators but //(.exe) for +# multi-config ones (MSVC, Xcode), so probe both. $1 = mode dir, $2 = binary +# name, $3 = extra args. +define run_bin + @d='$(1)'; b='$(2)'; found=''; bindir=''; \ + for p in "$$d/$$b" "$$d/$$b.exe" "$$d/$(BUILD_TYPE)/$$b" "$$d/$(BUILD_TYPE)/$$b.exe"; do \ + if [ -x "$$p" ]; then found="$$p"; bindir="$$(dirname $$p)"; break; fi; \ + done; \ + if [ -z "$$found" ]; then echo "error: $$b not found under $$d" >&2; exit 1; fi; \ + echo ">> $$found $(3)"; \ + cd "$$bindir" && "$$found" $(3) +endef + +.DEFAULT_GOAL := help +.PHONY: help lib dev core test test-core examples-run all clean + +help: + @echo 'mx build/test targets (see comments at the top of the Makefile for rationale):' + @echo '' + @echo ' make lib Build just the static library (no tests, no examples).' + @echo ' make dev Build tests (no slow core tests) + examples. Dev loop.' + @echo ' make core Build the full suite incl. slow mx::core tests.' + @echo '' + @echo ' make test Build dev, then run mxtest. ARGS= forwarded.' + @echo ' make test-core Build core, then run full mxtest. ARGS= forwarded.' + @echo ' make examples-run Build dev, then run mxread/mxwrite/mxhide.' + @echo ' make all Build core, run examples, run full mxtest.' + @echo '' + @echo ' make clean Remove the entire $(BUILD_ROOT)/ tree.' + @echo '' + @echo 'Knobs: JOBS (=$(JOBS)) BUILD_TYPE (=$(BUILD_TYPE)) GENERATOR ARGS' + @echo 'Layout: $(BUILD_ROOT)//$(BUILD_TYPE)/' + +# --- Compile-only targets --------------------------------------------------- + +lib: + $(call cmake_build,lib,off,off,off) + +dev: + $(call cmake_build,dev,on,off,on) + +core: + $(call cmake_build,core,on,on,on) + +# --- Run targets ------------------------------------------------------------ + +test: dev + $(call run_bin,$(call mode_dir,dev),mxtest,$(ARGS)) + +test-core: core + $(call run_bin,$(call mode_dir,core),mxtest,$(ARGS)) + +examples-run: dev + $(call run_bin,$(call mode_dir,dev),mxread,) + $(call run_bin,$(call mode_dir,dev),mxwrite,) + $(call run_bin,$(call mode_dir,dev),mxhide,) + +# Behavioral replacement for the old build.sh: full build + run everything. +all: core + $(call run_bin,$(call mode_dir,core),mxread,) + $(call run_bin,$(call mode_dir,core),mxwrite,) + $(call run_bin,$(call mode_dir,core),mxhide,) + $(call run_bin,$(call mode_dir,core),mxtest,$(ARGS)) + +# --- Housekeeping ----------------------------------------------------------- + +clean: + rm -rf $(BUILD_ROOT) diff --git a/README.md b/README.md index 2bcbbd1ea..6e9a75de9 100644 --- a/README.md +++ b/README.md @@ -1,867 +1,880 @@ -MusicXML Class Library -====================== - -- Author: Matthew James Briggs -- License: MIT -- Version: 1.0 -- Supported MusicXML Version: 3.0 -- Language: C++17 - ------------------------------------------ - -[![CircleCI](https://circleci.com/gh/webern/mx.svg?style=svg)](https://circleci.com/gh/webern/mx) - -## Introduction - -This project is a C++ library for working with MusicXML. - -# Build - -Building and running tests should be as simple as: - -``` -git clone https://github.com/webern/mx.git mx -mkdir build -cd build -cmake ../mx -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off -DMX_BUILD_EXAMPLES=on -make -j6 -./mxtest -``` - -### Cmake Options - -There are three `cmake` options: - -``` - -DMX_BUILD_TESTS=on - -DMX_BUILD_CORE_TESTS=off - -DMX_BUILD_EXAMPLES=on -``` - -The configuration shown above is the recommended configuration for development. -If you just need the lib then turn off all three of the `cmake` options. -The 'core tests' take a long time to compile. -You only need to run them if you make changes in the `mx::core` namespace. - -### Build Tenets - -* `mx` should not depend on any outside libraries (no deps). -* `mx` third-party code should be kept to a minimum. -* `mx` third-party code should be checked into the `mx` repo and compiled as part of the `mx` library. -* `mx` should not depened on any package manager, though it may be published into any package manager. - -### Using `mx` in a Cmake Project - -The following script demonstrates how you can start a new cmake project that uses `mx` by commiting its sourcecode into your project: - -```sh -#!/bin/bash -se -eou pipefail - -# this script demonstrates how to depend on mx by including it in your -# sourcecode tree. - -# if given, the first argument is a path to directory where the new -# project will be created. -REPO="${1:-/tmp/$(uuidgen)}" -echo "Creating a new project in: ${REPO}" - -# create a new git repository for your project -mkdir -p "${REPO}" -cd "${REPO}" -git init -# bring the mx sourcecode into your project into a temporary location -git clone https://github.com/webern/mx.git mxtemp - -# copy only what we need. all we need is the Sourcode directory, the -# cmake file, the license, and the .gitignore file (helpful since there -# is one generated file.) -mkdir mx -mv mxtemp/Sourcecode mx/Sourcecode -mv mxtemp/.gitignore mx/.gitignore -mv mxtemp/LICENSE.txt mx/LICENSE.txt -mv mxtemp/CMakeLists.txt mx/CMakeLists.txt -# we don't need the test code, either -rm -rf mx/Sourcecode/private/mxtest -rm -rf mxtemp - -# commit the mx sourcecode to our project repo -git add --all && git commit -m'mx sourcecode' - -# create a main.cpp file -cat <<- "EOF" > main.cpp -#include -#include "mx/api/ScoreData.h" -#include "mx/api/DocumentManager.h" - -int main () { - using namespace mx::api; - ScoreData score{}; - score.workTitle = "Hello World"; - NoteData note{}; - note.durationData.durationName = DurationName::quarter; - note.pitchData.step = Step::d; - VoiceData voiceData{}; - voiceData.notes.push_back(note); - StaffData staff{}; - staff.voices[0] = voiceData; - MeasureData measure{}; - measure.staves.push_back(staff); - PartData part{}; - part.measures.push_back(measure); - score.parts.push_back(part); - auto& mgr = DocumentManager::getInstance(); - const auto id = mgr.createFromScore(score); - mgr.writeToStream(id, std::cout); - mgr.destroyDocument(id); -} -EOF - -# create a cmake file -cat <<- "EOF" > CMakeLists.txt -cmake_minimum_required(VERSION 3.17) -project(my-musicxml-proj) -set(CMAKE_CXX_STANDARD 17) -set(CPP_VERSION 17) - -add_executable(my-musicxml-proj main.cpp) -add_subdirectory(mx) -target_link_libraries(my-musicxml-proj mx) -target_include_directories(my-musicxml-proj PRIVATE mx/Sourcecode/include) -EOF - -# create a .gitignore file to ignore a build directory -cat <<- "EOF" > .gitignore -build/ -EOF - -git add --all && git commit -m'musicxml hello world' - -# create a build directory -mkdir build - -# build your project -cd build -cmake .. && make -j10 -# run your executable -./my-musicxml-proj -``` - -### Xcode Project - -The Xcode project (checked-in to the repo) has targets for iOS and macOS frameworks and dylibs. -These are not specified in the cmake file. -Contributors are not required to keep the Xcode project up-to-date. -If you add, move or remove files from the codebase, it is likely that the Xcode CI run will fail. -This will not prevent a contribution from being merged, the maintainer will fix the project after-the-fact. - - -# Using `mx` - -## API - -The `mx::api` namespace is intended to be a simplified structural representation of MusicXML. -It should be more intuitive than manipulating the DOM representation directly. -In particular, voices and time positions are more explicitly managed. -Some complexities, on the other hand, are retained in `mx::api`, such as the need to manage beam starts and stops explicitly. - -#### Writing MusicXML with `mx::api` - -```C++ -#include -#include -#include -#include - -#include "mx/api/DocumentManager.h" -#include "mx/api/ScoreData.h" - -// set this to 1 if you want to see the xml in your console -#define MX_WRITE_THIS_TO_THE_CONSOLE 0 - -int main(int argc, const char * argv[]) -{ - using namespace mx::api; - const auto qticks = 4; - - // create a score - auto score = ScoreData{}; - score.workTitle = "Mx Example"; - score.composer = "Matthew James Briggs"; - score.copyright = "Copyright (c) 2019"; - score.ticksPerQuarter = qticks; - - // create a part - score.parts.emplace_back( PartData{} ); - auto& part = score.parts.back(); - - // give the part a name - part.name = "Flute"; - part.abbreviation = "Fl."; - part.displayName = "Flute"; - part.displayAbbreviation = "Fl."; - - // give the part an instrument - part.instrumentData.soundID = SoundID::windFlutesFlute; - part.instrumentData.midiData.channel = 1; - part.instrumentData.midiData.program = 74; - - // add a measure - part.measures.emplace_back( MeasureData{} ); - auto& measure = part.measures.back(); - measure.timeSignature.beats = 4; - measure.timeSignature.beatType = 4; - measure.timeSignature.isImplicit = false; - - // add a staff - measure.staves.emplace_back( StaffData{} ); - auto& staff = measure.staves.back(); - - // set the clef - auto clef = ClefData{}; - clef.setTreble(); - staff.clefs.emplace_back( clef ); - - // add a voice - staff.voices[0] = VoiceData{}; - auto& voice = staff.voices.at( 0 ); - - const auto quarter = qticks; - const auto half = qticks * 2; - const auto eighth = qticks / 2; - - // add a few notes - auto currentTime = 0; - auto note = NoteData{}; - note.pitchData.step = Step::d; - note.pitchData.alter = 1; - note.pitchData.octave = 5; - note.pitchData.accidental = Accidental::sharp; - note.durationData.durationName = DurationName::half; - note.durationData.durationTimeTicks = half; - note.tickTimePosition = currentTime; - voice.notes.push_back( note ); - - // advance our time - currentTime += half; - - note.pitchData.step = Step::e; - note.pitchData.alter = 0; - note.pitchData.octave = 5; - note.pitchData.accidental = Accidental::none; - note.durationData.durationName = DurationName::eighth; - note.durationData.durationTimeTicks = eighth; - note.tickTimePosition = currentTime; - // beams are handled explicitly in musicxml - note.beams.push_back( Beam::begin ); // start an eighth-note beam - voice.notes.push_back( note ); - currentTime += eighth; - - note.pitchData.step = Step::f; - note.pitchData.alter = 0; - note.pitchData.octave = 5; - note.pitchData.accidental = Accidental::none; - note.durationData.durationName = DurationName::eighth; - note.tickTimePosition = currentTime; - note.durationData.durationTimeTicks = eighth; - note.beams.clear(); - note.beams.push_back( Beam::end ); // end the eighth-note beam - voice.notes.push_back( note ); - currentTime += eighth; - - note.pitchData.step = Step::e; - note.pitchData.alter = 0; - note.pitchData.octave = 5; - note.pitchData.accidental = Accidental::none; - note.durationData.durationName = DurationName::quarter; - note.durationData.durationTimeTicks = quarter; - note.tickTimePosition = currentTime; - note.beams.clear(); - voice.notes.push_back( note ); - - // the document manager is the liaison between our score data and the MusicXML DOM. - // it completely hides the MusicXML DOM from us when using mx::api - auto& mgr = DocumentManager::getInstance(); - const auto documentID = mgr.createFromScore( score ); - - // write to the console - #if MX_WRITE_THIS_TO_THE_CONSOLE - mgr.writeToStream( documentID, std::cout ); - std::cout << std::endl; - #endif - - // write to a file - mgr.writeToFile( documentID, "./example.musicxml" ); - - // we need to explicitly delete the object held by the manager - mgr.destroyDocument( documentID ); - - return 0; -} -``` - -#### Reading MusicXML with `mx::api` - -```C++ -#include "mx/api/DocumentManager.h" -#include "mx/api/ScoreData.h" - -#include -#include -#include -#include - -#define MX_IS_A_SUCCESS 0 -#define MX_IS_A_FAILURE 1 - -constexpr const char* const xml = R"( - - - - - - Music - - - - - - 1 - - 0 - - - - G - 2 - - - - - C - 4 - - 4 - whole - - - - -)"; - -int main(int argc, const char * argv[]) -{ - using namespace mx::api; - - // create a reference to the singleton which holds documents in memory for us - auto& mgr = DocumentManager::getInstance(); - - // place the xml from above into a stream object - std::istringstream istr{ xml }; - - // ask the document manager to parse the xml into memory for us, returns a document ID. - const auto documentID = mgr.createFromStream( istr ); - - // get the structural representation of the score from the document manager - const auto score = mgr.getData( documentID ); - - // we need to explicitly destroy the document from memory - mgr.destroyDocument(documentID); - - // make sure we have exactly one part - if( score.parts.size() != 1 ) - { - return MX_IS_A_FAILURE; - } - - // drill down into the data structure to retrieve the note - const auto& part = score.parts.at( 0 ); - const auto& measure = part.measures.at( 0 ); - const auto& staff = measure.staves.at( 0 ); - const auto& voice = staff.voices.at( 0 ); - const auto& note = voice.notes.at( 0 ); - - if( note.durationData.durationName != DurationName::whole ) - { - return MX_IS_A_FAILURE; - } - - if( note.pitchData.step != Step::c ) - { - return MX_IS_A_FAILURE; - } - - return MX_IS_A_SUCCESS; -} -``` - -# Implementation Details - -The MusicXML classes in `mx::core` are tightly bound to the `musicxml.xsd` specification. -MusicXML can be challenging to use and the `mx::core` class structure mirrors the complexity of the MusicXML specification. -A simplified representation is available in `mx::api`. -It is possible to work with a subset of MusicXML using only `mx::api`, without delving into `mx::core`. - -##### Namespaces - -```C++ -using namespace mx::api; // an easier interface for reading and writing MusicXML -using namespace mx::core; // a direct representation of a musicxml document in C++ classes -using namespace mx::impl // the logic that translates between mx::api and mx::core -using namespace mx::utility // a typical catch-all for generic stuff like logging macros -using namespace ezxml; // generic serialization and deserialization of xml -``` - -##### `mx::api` - -The `mx::api` namespace is a set of 'plain old data' structs that represent a simplified model of MusicXML. -For example, here is the `ScoreData.h`, which represents the top level of the object heirarchy: - -```C++ -class ScoreData -{ -public: - MusicXmlVersion musicXmlVersion; - std::string musicXmlType; - std::string workTitle; - std::string workNumber; - std::string movementTitle; - std::string movementNumber; - std::string composer; - std::string lyricist; - std::string arranger; - std::string publisher; - std::string copyright; - EncodingData encoding; - std::vector pageTextItems; - DefaultsData defaults; - std::vector parts; - std::vector partGroups; - int ticksPerQuarter; - std::map layout; -}; -``` - -`mx::api` and `mx::core` are kept completely separate.\ -That is, `mx::api` data is serialized into `mx::core` data, which is then serialized into MusicXML. -The `mx::api` struct allow us to simplify things like specifying a note's tick time position, and allowing the serialization process to take care of details such as `` `` elements. - -##### `mx::core` - -The `mx::core` namespace contains the MusicXML representation objects such as elements and attributes. -`mx::core` was mostly generated from `musicxml.xsd` with plenty of intervention by hand. - -###### XML Choices and Groups - -In the `musicxml.xsd` there are many cases of `xs:choice` or `xs:group` being used. -These constructs are typically represented in the `mx::core` class structure the same way that they are found in the `musicxml.xsd` specification. -The interfaces in this namespace are relatively stable, however they are tightly bound to MusicXML's specification and thus they will change when it comes time to support a future version of MusicXML. - -##### `mx::impl` - -`mx::impl` is the translation layer between `mx::api` and `mx::core`. - -##### `mx::utility` - -This namespace is small. -It mostly contains macros and small, generic functions. - -##### `ezxml` - -The `ezxml` namespace contains generic XML DOM functionality. -Under the hood [pugixml](http://pugixml.org/) is being used. -See the XML DOM section for more information. -Note that, even though `ezxml` can stand alone as a useful abstraction, we build it as if it were entirely owned by the `mx` project. -Additionally, we check the `pugixml` library in and build it as if it were part of the `mx` project. -This is in keeping with the build tenets [above](#build-tenets) - -##### Partwise vs. Timewise -There are two types of MusicXML documents, `partwise` and `timewise`. -A partwise document consists of a set of parts which contain measures. -A timewise document consists of a set of measures which contain parts. -Partwise is used more often by MusicXML applications while Timewise documents seem to be rare or even nonresistant. -Nonetheless *MusicXML Class Library* implements both Timewise and Partwise. -The class `mx::core::Document` can hold *either* a Partwise *or* a Timewise score. -Note that it actually holds both, but only one or the other is 'active' (this is similar to how `xsd` `choice` constructs are handled). -You can check the inner document type with the getChoice function. -You can convert between Partwise and Timewise with the convertContents function. - -##### Elements -Each XML element is represented by a class which derives from ElementInterface. -Elements are created and used by way of shared pointers. -Each element comes with a set of using/typedef statements as well as a convenience function for making the shared pointers. - -##### Shared Pointers -Many elements contain other elements. -When they do, these data members will also be shared pointers. -Get/set functions will allow access to the data members by accepting and returning shared pointers. -If you attempt to set a data member to a nullptr, the setter function will silently do nothing. -Thus we can be reasonably assured our objects will never return nullptr. - -For example - -```C++ -std::shared_ptr foo; /* nullptr! */ -bar->setFoo( foo ); /* no-op because you passed a nullptr */ -auto x = bar->getFoo(); /* guaranteed not to be null */ -x->somefuntion(); /* OK to dereference without checking for nullptr */ -``` - -##### Optional Member Data -Many of the elements in MusicXML are optional. -In these cases there is a bool which indicates whether or not the element is present. -The bool serves as a flag indicating whether or not the optional element will be output when you stream out your MusicXML document. -The bool has no side-effect on the element who's presence/absence it represents. -So for example we may set some data: - -```C++ -foo->setValue( "hello" ); -bar->setFoo( foo ); -``` - -But in this example, if Foo is an optional member of Bar, then we must also set hasFoo to *true* or else foo will not be in the XML output. - -```C++ -bar->toStream(...); /* Foo is not in the output! */ -bar->setHasFoo( true ); -bar->toStream(...); /* Now we see hello in the output. */ -``` - -Also note that setting HasFoo to *false* does not mean that Foo's value is gone. - -```C++ -bar->setHasFoo( false ); /* The XML document no longer has a Foo */ -bar->getFoo()->getValue() == "hello"; /* True! The value still exists but is not present in the XML. */ -``` - -##### Optional Member Data with Unbounded Occurrences -Sometimes an element may contain zero, one, or many occurrences of another element. -For example - -```xml - -``` - -In this case there will be a collection of Key objects and the getter/setters will look like this, where `KeySet` is a typedef of `std::vector`. - -```C++ -const KeySet& getKeySet() const; -void addKey( const KeyPtr& value ); -void removeKey( const KeySetIterConst& value ); -void clearKeySet(); -KeyPtr getKey( const KeySetIterConst& setIterator ) const; -``` - -##### Required Member Data with Unbounded Occurrences -Sometimes an element is required, but you may optionally have more than one. -For example - -```xml - -``` - -In this case, minOccurs="1" (by default per XSD language rules). -The functions will look just like the previous example, but they will behave differently - -```C++ -const DirectionTypeSet& getDirectionTypeSet() const; -void addDirectionType( const DirectionTypePtr& value ); -void removeDirectionType( const DirectionTypeSetIterConst& value ); -void clearDirectionTypeSet(); -DirectionTypePtr getDirectionType( const DirectionTypeSetIterConst& setIterator ) const; -``` - -When the containing element is constructed, a single DirectionType will be default constructed and pushed onto the vector. -Thus you will have one default constructed DirectionType in the set upon construction. - -If you try to call removeDirectionType with only one DirectionType in the set (size==1) nothing will happen. -You will still have a single DirectionType in the collection. - -When you call clearDirectionTypeSet vector.clear() will be called but it will follow up by pushing a default constructed DirectionType onto the vector so you will still have size==1. - -As it turns out, this design choice tends to be annoying in practice. -On the upside, it does guarantee that your MusicXML document will be valid, even if you forget to add a required element. -The downside is that it means you have to deal with the fact that a default constructed element always exists in the set, so you must replace or remove the first element. -Furthermore, you cannot remove the existing element until another one has been added. -Here are the two patterns I have used for this (pseudocode). - -**Pattern 1:** Replace the first element by dereferencing the begin() iterator: - -```C++ -bool isFirstAdded = false; -for( auto stuffElement : stuffElementsIWantToAdd ) -{ - if( !isFirstAdded ) - { - *( myElementIWantToAddThemTo->getStuffSet().begin() ) = stuffElement; - isFirstAdded = true; - } - else - { - myElementIWantToAddThemTo->addStuff( stuffElement ); - } -} -``` - -**Pattern 2:** Remove the default element *After* adding a replacement: - -```C++ -bool isFirstAdded = false; -for( auto stuffElement : stuffIWantToAdd ) -{ - myElementIWantToAddThemTo->addStuff( stuffElement ); - if( !isFirstAdded ) - { - myElementIWantToAddThemTo->removeStuff( myElementIWantToAddThemTo->getStuffSet().cbegin() ) - isFirstAdded = true; - } -} -``` - -Pattern 1 always works, even if you're not sure whether or not the `minOccurs="1"` or `"0"`. -Pattern 2 only works when `minOccurs="1"`. -There are no cases where `minOccurs` is greater than 1. - -##### Member Data with Bounded maxOccurs -```xml - -``` -In this case if you call addBeam when there are already 8 beams in the vector, nothing will happen. - -##### xs:groups -For an xs:group there is usually a single 'element' class which represents the group of elements. -For example this XSD snippet: - -```xml - - - - - - -``` - -is represented by this class: - -```C++ -class EditorialGroup : public ElementInterface -{ -public: - EditorialGroup(); - - /* ... other stuff ... */ - - /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ - FootnotePtr getFootnote() const; - void setFootnote( const FootnotePtr& value ); - bool getHasFootnote() const; - void setHasFootnote( const bool value ); - - /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ - LevelPtr getLevel() const; - void setLevel( const LevelPtr& value ); - bool getHasLevel() const; - void setHasLevel( const bool value ); - - bool fromXElement( std::ostream& message, xml::XElement& xelement ); - -private: - FootnotePtr myFootnote; - bool myHasFootnote; - LevelPtr myLevel; - bool myHasLevel; -}; -``` - -##### xs:choices - -There are a few exceptions (mistakes) but for the most part, `xs:choice` constructs are represented by a class with a name ending in 'Choice'. -The element will have an enum named 'Choice' in the public scope of the class. -Each of the possible 'choices' will exist as data members of the class, but only one of them will be 'active' (was present in, or will be written to, XML). -For example, this xsd construct: - -```xml - - - - The pre-bend element indicates that this is a pre-bend rather than a normal bend or a release. - - - - - The release element indicates that this is a release rather than a normal bend or pre-bend. - - - -``` - -Is represented by this class: - -```C++ -class BendChoice : public ElementInterface -{ -public: - enum class Choice - { - preBend = 1, - release = 2 - }; - BendChoice(); - - /* ... other stuff ... */ - - BendChoice::Choice getChoice() const; - void setChoice( BendChoice::Choice value ); - - /* _________ PreBend minOccurs = 1, maxOccurs = 1 _________ */ - PreBendPtr getPreBend() const; - void setPreBend( const PreBendPtr& value ); - - /* _________ Release minOccurs = 1, maxOccurs = 1 _________ */ - ReleasePtr getRelease() const; - void setRelease( const ReleasePtr& value ); - - bool fromXElement( std::ostream& message, xml::XElement& xelement ); - -private: - Choice myChoice; - PreBendPtr myPreBend; - ReleasePtr myRelease; -}; -``` - -When `getChoice() == BendChoice::Choice::preBend` then we will see `` in the XML, but when `getChoice() == BendChoice::Choice::postBend` then we will see `` in the XML. - -### XML DOM (::ezxml::) - -Any XML document can be read and manipulated with the classes in the `::ezxml::` namespace. -Most notably, look at the following pure virtual interfaces XDoc, XElement, XAttribute. -Also look at the STL-compliant iterators XElementIterator and XAttributeIterator. - -These interfaces are designed to wrap any underlying XML DOM software so that `mx::core` does not care or know about the XML DOM code. -A set of implementation classes wrapping pugixml are provided, but if you need to use, say Xerces or RapidXML, you can look at the PugiElement, PugiDoc, etc classes and wrap whatever library you need. - -Here's how you can read a MusicXML document into `mx::core` classes by way of `::ezxml::`. - -```C++ -#include "mx/core/Document.h" -#include "mx/utility/Utility.h" -#include "functions.h" -#include "ezxml/XFactory.h" -#include "ezxml/XDoc.h" - -#include -#include -#include - -int main(int argc, const char *argv[]) -{ - // allocate the objects - mx::core::DocumentPtr mxDoc = makeDocument(); - ::ezxml::::XDocPtr xmlDoc = ::ezxml::::XFactory::makeXDoc(); - - // read a MusicXML file into the XML DOM structure - xmlDoc->loadFile( "music.xml" ); - - // create an ostream to receive any parsing messages - std::stringstream parseMessages; - - // convert the XML DOM into MusicXML Classes - bool isSuccess = mxDoc->fromXDoc( parseMessages, *xmlDoc ); - - if( !isSuccess ) - { - std::cout << "Parsing of the MusicXML document failed with the following message(s):" << std::endl; - std::cout << parseMessages.str() << std::endl; - return -1; - } - - // maybe the document was timewise document. if so, convert it to partwise - if( mxDoc->getChoice() == mx::core::DocumentChoice::timewise ) - { - mxDoc->convertContents(); - } - - // get the root - auto scorePartwise = mxDoc->getScorePartwise(); - - // change the title - scorePartwise->getScoreHeaderGroup()->setHasWork( true ); - scorePartwise->getScoreHeaderGroup()->getWork()->setHasWorkTitle( true ); - scorePartwise->getScoreHeaderGroup()->getWork()->getWorkTitle()->setValue( mx::core::XsString( "New Title" ) ); - - // write it back out to disk - mxDoc->toXDoc( *xmlDoc ); - xmlDoc->write( "newtitle.xml" ); - - return 0; -} -``` - -### Hello World using mx::core -On the MusicXML home page there is an example of a "Hello World" simple MusicXML file. -Here is a main function that would output this "Hello World" MusicXML example to std::cout. - -```C++ -#include -#include "DocumentPartwise.h" -#include "Elements.h" - -using namespace mx::core; -using namespace std; - -int main(int argc, const char * argv[]) -{ - auto doc = makeDocumentPartwise(); - auto s = doc->getScorePartwise(); - s->getAttributes()->hasVersion = true; - s->getAttributes()->version = XsToken( "3.0" ); - auto header = s->getScoreHeaderGroup(); - header->getPartList()->getScorePart()->getAttributes()->id = XsID( "P1" ); - header->getPartList()->getScorePart()->getPartName()->setValue( XsString( "Music" ) ); - auto part = *( s->getPartwisePartSet().cbegin() ); - part->getAttributes()->id = XsIDREF( "P1" ); - auto measure = *( part->getPartwiseMeasureSet().cbegin() ); - measure->getAttributes()->number = XsToken( "1" ); - auto propertiesChoice = makeMusicDataChoice(); - propertiesChoice->setChoice( MusicDataChoice::Choice::properties ); - auto properties = propertiesChoice->getProperties(); - properties->setHasDivisions( true ); - properties->getDivisions()->setValue( PositiveDivisionsValue( 1 ) ); - properties->addKey( makeKey() ); - auto time = makeTime(); - time->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - time->getTimeChoice()->getTimeSignature()->getBeats()->setValue( XsString( "4" ) ); - time->getTimeChoice()->getTimeSignature()->getBeatType()->setValue( XsString( "4" ) ); - properties->addTime( time ); - auto clef = makeClef(); - clef->getSign()->setValue( ClefSign::g ); - clef->setHasLine( true ); - clef->getLine()->setValue( StaffLine( 2 ) ); - properties->addClef( clef ); - measure->getMusicDataGroup()->addMusicDataChoice( propertiesChoice ); - auto noteData = makeMusicDataChoice(); - noteData->setChoice( MusicDataChoice::Choice::note ); - noteData->getNote()->getNoteChoice()->setChoice( NoteChoice::Choice::normal ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getStep()->setValue( StepEnum::c ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getOctave()->setValue( OctaveValue( 4 ) ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( PositiveDivisionsValue( 4 ) ); - noteData->getNote()->getType()->setValue( NoteTypeValue::whole ); - measure->getMusicDataGroup()->addMusicDataChoice( noteData ); - - doc->toStream( cout ); /* print Hello World MusicXML document to console */ - return 0; -} -``` - -### Unit Test Framework - -An executable program named mxtest is also included in the project. -mxtest utilizes the Catch2 test framework. -The core tests are slow to compile, see the [`cmake` options](#cmake-options) section for more info on how to skip compilation of the tests. +MusicXML Class Library +====================== + +- Author: Matthew James Briggs +- License: MIT +- Version: 1.0 +- Supported MusicXML Version: 3.0 +- Language: C++17 + +----------------------------------------- + +[![CircleCI](https://circleci.com/gh/webern/mx.svg?style=svg)](https://circleci.com/gh/webern/mx) + +## Introduction + +This project is a C++ library for working with MusicXML. + +# Build + +A top-level `Makefile` wraps CMake and encodes the build/test configurations this project uses. +It is a convenience layer, not a replacement for CMake. It needs `cmake` (>= 3.13) and a POSIX +shell. On Windows it is best-effort: install CMake plus GNU make and a POSIX shell (Git Bash, +MSYS2, or WSL); the underlying compiler can still be MSVC, since builds go through +`cmake --build`. + +Building and running tests should be as simple as: + +``` +git clone https://github.com/webern/mx.git mx +cd mx +make test +``` + +Run `make` (or `make help`) to list every target. + +### Build Modes + +There are three `cmake` options (`MX_BUILD_TESTS`, `MX_BUILD_CORE_TESTS`, `MX_BUILD_EXAMPLES`). +Only three combinations are useful workflows, exposed as three build targets: + +| Target | Builds | Notes | +|------------|---------------------------------------------------------|----------------------------------------------------| +| `make lib` | the static library only | fastest; use this if you just need the lib | +| `make dev` | tests (no core tests) + examples | recommended for development | +| `make core`| tests including the `mx::core` tests + examples | slow to compile; only needed for `mx::core` changes| + +The `core` tests take a long time to compile. You only need them if you make changes in the +`mx::core` namespace. + +Run targets build the needed mode first, then run binaries: `make test` (runs `mxtest`), +`make test-core` (full `mxtest`), `make examples-run` (runs the examples), and `make all` +(full build, examples, and full `mxtest`). `make clean` removes the build tree. + +Each mode builds into `build//` with its own cache and incremental state, so +switching modes never recompiles another mode's tree. Knobs: `JOBS` (parallelism, auto-detected), +`BUILD_TYPE` (default `Debug`), `GENERATOR` (default: CMake's platform default), and `ARGS` +(forwarded to `mxtest`, e.g. `make test ARGS='[core]'`). + +### Build Tenets + +* `mx` should not depend on any outside libraries (no deps). +* `mx` third-party code should be kept to a minimum. +* `mx` third-party code should be checked into the `mx` repo and compiled as part of the `mx` library. +* `mx` should not depened on any package manager, though it may be published into any package manager. + +### Using `mx` in a Cmake Project + +The following script demonstrates how you can start a new cmake project that uses `mx` by commiting its sourcecode into your project: + +```sh +#!/bin/bash +se -eou pipefail + +# this script demonstrates how to depend on mx by including it in your +# sourcecode tree. + +# if given, the first argument is a path to directory where the new +# project will be created. +REPO="${1:-/tmp/$(uuidgen)}" +echo "Creating a new project in: ${REPO}" + +# create a new git repository for your project +mkdir -p "${REPO}" +cd "${REPO}" +git init +# bring the mx sourcecode into your project into a temporary location +git clone https://github.com/webern/mx.git mxtemp + +# copy only what we need. all we need is the Sourcode directory, the +# cmake file, the license, and the .gitignore file (helpful since there +# is one generated file.) +mkdir mx +mv mxtemp/Sourcecode mx/Sourcecode +mv mxtemp/.gitignore mx/.gitignore +mv mxtemp/LICENSE.txt mx/LICENSE.txt +mv mxtemp/CMakeLists.txt mx/CMakeLists.txt +# we don't need the test code, either +rm -rf mx/Sourcecode/private/mxtest +rm -rf mxtemp + +# commit the mx sourcecode to our project repo +git add --all && git commit -m'mx sourcecode' + +# create a main.cpp file +cat <<- "EOF" > main.cpp +#include +#include "mx/api/ScoreData.h" +#include "mx/api/DocumentManager.h" + +int main () { + using namespace mx::api; + ScoreData score{}; + score.workTitle = "Hello World"; + NoteData note{}; + note.durationData.durationName = DurationName::quarter; + note.pitchData.step = Step::d; + VoiceData voiceData{}; + voiceData.notes.push_back(note); + StaffData staff{}; + staff.voices[0] = voiceData; + MeasureData measure{}; + measure.staves.push_back(staff); + PartData part{}; + part.measures.push_back(measure); + score.parts.push_back(part); + auto& mgr = DocumentManager::getInstance(); + const auto id = mgr.createFromScore(score); + mgr.writeToStream(id, std::cout); + mgr.destroyDocument(id); +} +EOF + +# create a cmake file +cat <<- "EOF" > CMakeLists.txt +cmake_minimum_required(VERSION 3.17) +project(my-musicxml-proj) +set(CMAKE_CXX_STANDARD 17) +set(CPP_VERSION 17) + +add_executable(my-musicxml-proj main.cpp) +add_subdirectory(mx) +target_link_libraries(my-musicxml-proj mx) +target_include_directories(my-musicxml-proj PRIVATE mx/Sourcecode/include) +EOF + +# create a .gitignore file to ignore a build directory +cat <<- "EOF" > .gitignore +build/ +EOF + +git add --all && git commit -m'musicxml hello world' + +# create a build directory +mkdir build + +# build your project +cd build +cmake .. && make -j10 +# run your executable +./my-musicxml-proj +``` + +### Xcode Project + +The Xcode project (checked-in to the repo) has targets for iOS and macOS frameworks and dylibs. +These are not specified in the cmake file. +Contributors are not required to keep the Xcode project up-to-date. +If you add, move or remove files from the codebase, it is likely that the Xcode CI run will fail. +This will not prevent a contribution from being merged, the maintainer will fix the project after-the-fact. + + +# Using `mx` + +## API + +The `mx::api` namespace is intended to be a simplified structural representation of MusicXML. +It should be more intuitive than manipulating the DOM representation directly. +In particular, voices and time positions are more explicitly managed. +Some complexities, on the other hand, are retained in `mx::api`, such as the need to manage beam starts and stops explicitly. + +#### Writing MusicXML with `mx::api` + +```C++ +#include +#include +#include +#include + +#include "mx/api/DocumentManager.h" +#include "mx/api/ScoreData.h" + +// set this to 1 if you want to see the xml in your console +#define MX_WRITE_THIS_TO_THE_CONSOLE 0 + +int main(int argc, const char * argv[]) +{ + using namespace mx::api; + const auto qticks = 4; + + // create a score + auto score = ScoreData{}; + score.workTitle = "Mx Example"; + score.composer = "Matthew James Briggs"; + score.copyright = "Copyright (c) 2019"; + score.ticksPerQuarter = qticks; + + // create a part + score.parts.emplace_back( PartData{} ); + auto& part = score.parts.back(); + + // give the part a name + part.name = "Flute"; + part.abbreviation = "Fl."; + part.displayName = "Flute"; + part.displayAbbreviation = "Fl."; + + // give the part an instrument + part.instrumentData.soundID = SoundID::windFlutesFlute; + part.instrumentData.midiData.channel = 1; + part.instrumentData.midiData.program = 74; + + // add a measure + part.measures.emplace_back( MeasureData{} ); + auto& measure = part.measures.back(); + measure.timeSignature.beats = 4; + measure.timeSignature.beatType = 4; + measure.timeSignature.isImplicit = false; + + // add a staff + measure.staves.emplace_back( StaffData{} ); + auto& staff = measure.staves.back(); + + // set the clef + auto clef = ClefData{}; + clef.setTreble(); + staff.clefs.emplace_back( clef ); + + // add a voice + staff.voices[0] = VoiceData{}; + auto& voice = staff.voices.at( 0 ); + + const auto quarter = qticks; + const auto half = qticks * 2; + const auto eighth = qticks / 2; + + // add a few notes + auto currentTime = 0; + auto note = NoteData{}; + note.pitchData.step = Step::d; + note.pitchData.alter = 1; + note.pitchData.octave = 5; + note.pitchData.accidental = Accidental::sharp; + note.durationData.durationName = DurationName::half; + note.durationData.durationTimeTicks = half; + note.tickTimePosition = currentTime; + voice.notes.push_back( note ); + + // advance our time + currentTime += half; + + note.pitchData.step = Step::e; + note.pitchData.alter = 0; + note.pitchData.octave = 5; + note.pitchData.accidental = Accidental::none; + note.durationData.durationName = DurationName::eighth; + note.durationData.durationTimeTicks = eighth; + note.tickTimePosition = currentTime; + // beams are handled explicitly in musicxml + note.beams.push_back( Beam::begin ); // start an eighth-note beam + voice.notes.push_back( note ); + currentTime += eighth; + + note.pitchData.step = Step::f; + note.pitchData.alter = 0; + note.pitchData.octave = 5; + note.pitchData.accidental = Accidental::none; + note.durationData.durationName = DurationName::eighth; + note.tickTimePosition = currentTime; + note.durationData.durationTimeTicks = eighth; + note.beams.clear(); + note.beams.push_back( Beam::end ); // end the eighth-note beam + voice.notes.push_back( note ); + currentTime += eighth; + + note.pitchData.step = Step::e; + note.pitchData.alter = 0; + note.pitchData.octave = 5; + note.pitchData.accidental = Accidental::none; + note.durationData.durationName = DurationName::quarter; + note.durationData.durationTimeTicks = quarter; + note.tickTimePosition = currentTime; + note.beams.clear(); + voice.notes.push_back( note ); + + // the document manager is the liaison between our score data and the MusicXML DOM. + // it completely hides the MusicXML DOM from us when using mx::api + auto& mgr = DocumentManager::getInstance(); + const auto documentID = mgr.createFromScore( score ); + + // write to the console + #if MX_WRITE_THIS_TO_THE_CONSOLE + mgr.writeToStream( documentID, std::cout ); + std::cout << std::endl; + #endif + + // write to a file + mgr.writeToFile( documentID, "./example.musicxml" ); + + // we need to explicitly delete the object held by the manager + mgr.destroyDocument( documentID ); + + return 0; +} +``` + +#### Reading MusicXML with `mx::api` + +```C++ +#include "mx/api/DocumentManager.h" +#include "mx/api/ScoreData.h" + +#include +#include +#include +#include + +#define MX_IS_A_SUCCESS 0 +#define MX_IS_A_FAILURE 1 + +constexpr const char* const xml = R"( + + + + + + Music + + + + + + 1 + + 0 + + + + G + 2 + + + + + C + 4 + + 4 + whole + + + + +)"; + +int main(int argc, const char * argv[]) +{ + using namespace mx::api; + + // create a reference to the singleton which holds documents in memory for us + auto& mgr = DocumentManager::getInstance(); + + // place the xml from above into a stream object + std::istringstream istr{ xml }; + + // ask the document manager to parse the xml into memory for us, returns a document ID. + const auto documentID = mgr.createFromStream( istr ); + + // get the structural representation of the score from the document manager + const auto score = mgr.getData( documentID ); + + // we need to explicitly destroy the document from memory + mgr.destroyDocument(documentID); + + // make sure we have exactly one part + if( score.parts.size() != 1 ) + { + return MX_IS_A_FAILURE; + } + + // drill down into the data structure to retrieve the note + const auto& part = score.parts.at( 0 ); + const auto& measure = part.measures.at( 0 ); + const auto& staff = measure.staves.at( 0 ); + const auto& voice = staff.voices.at( 0 ); + const auto& note = voice.notes.at( 0 ); + + if( note.durationData.durationName != DurationName::whole ) + { + return MX_IS_A_FAILURE; + } + + if( note.pitchData.step != Step::c ) + { + return MX_IS_A_FAILURE; + } + + return MX_IS_A_SUCCESS; +} +``` + +# Implementation Details + +The MusicXML classes in `mx::core` are tightly bound to the `musicxml.xsd` specification. +MusicXML can be challenging to use and the `mx::core` class structure mirrors the complexity of the MusicXML specification. +A simplified representation is available in `mx::api`. +It is possible to work with a subset of MusicXML using only `mx::api`, without delving into `mx::core`. + +##### Namespaces + +```C++ +using namespace mx::api; // an easier interface for reading and writing MusicXML +using namespace mx::core; // a direct representation of a musicxml document in C++ classes +using namespace mx::impl // the logic that translates between mx::api and mx::core +using namespace mx::utility // a typical catch-all for generic stuff like logging macros +using namespace ezxml; // generic serialization and deserialization of xml +``` + +##### `mx::api` + +The `mx::api` namespace is a set of 'plain old data' structs that represent a simplified model of MusicXML. +For example, here is the `ScoreData.h`, which represents the top level of the object heirarchy: + +```C++ +class ScoreData +{ +public: + MusicXmlVersion musicXmlVersion; + std::string musicXmlType; + std::string workTitle; + std::string workNumber; + std::string movementTitle; + std::string movementNumber; + std::string composer; + std::string lyricist; + std::string arranger; + std::string publisher; + std::string copyright; + EncodingData encoding; + std::vector pageTextItems; + DefaultsData defaults; + std::vector parts; + std::vector partGroups; + int ticksPerQuarter; + std::map layout; +}; +``` + +`mx::api` and `mx::core` are kept completely separate.\ +That is, `mx::api` data is serialized into `mx::core` data, which is then serialized into MusicXML. +The `mx::api` struct allow us to simplify things like specifying a note's tick time position, and allowing the serialization process to take care of details such as `` `` elements. + +##### `mx::core` + +The `mx::core` namespace contains the MusicXML representation objects such as elements and attributes. +`mx::core` was mostly generated from `musicxml.xsd` with plenty of intervention by hand. + +###### XML Choices and Groups + +In the `musicxml.xsd` there are many cases of `xs:choice` or `xs:group` being used. +These constructs are typically represented in the `mx::core` class structure the same way that they are found in the `musicxml.xsd` specification. +The interfaces in this namespace are relatively stable, however they are tightly bound to MusicXML's specification and thus they will change when it comes time to support a future version of MusicXML. + +##### `mx::impl` + +`mx::impl` is the translation layer between `mx::api` and `mx::core`. + +##### `mx::utility` + +This namespace is small. +It mostly contains macros and small, generic functions. + +##### `ezxml` + +The `ezxml` namespace contains generic XML DOM functionality. +Under the hood [pugixml](http://pugixml.org/) is being used. +See the XML DOM section for more information. +Note that, even though `ezxml` can stand alone as a useful abstraction, we build it as if it were entirely owned by the `mx` project. +Additionally, we check the `pugixml` library in and build it as if it were part of the `mx` project. +This is in keeping with the build tenets [above](#build-tenets) + +##### Partwise vs. Timewise +There are two types of MusicXML documents, `partwise` and `timewise`. +A partwise document consists of a set of parts which contain measures. +A timewise document consists of a set of measures which contain parts. +Partwise is used more often by MusicXML applications while Timewise documents seem to be rare or even nonresistant. +Nonetheless *MusicXML Class Library* implements both Timewise and Partwise. +The class `mx::core::Document` can hold *either* a Partwise *or* a Timewise score. +Note that it actually holds both, but only one or the other is 'active' (this is similar to how `xsd` `choice` constructs are handled). +You can check the inner document type with the getChoice function. +You can convert between Partwise and Timewise with the convertContents function. + +##### Elements +Each XML element is represented by a class which derives from ElementInterface. +Elements are created and used by way of shared pointers. +Each element comes with a set of using/typedef statements as well as a convenience function for making the shared pointers. + +##### Shared Pointers +Many elements contain other elements. +When they do, these data members will also be shared pointers. +Get/set functions will allow access to the data members by accepting and returning shared pointers. +If you attempt to set a data member to a nullptr, the setter function will silently do nothing. +Thus we can be reasonably assured our objects will never return nullptr. + +For example + +```C++ +std::shared_ptr foo; /* nullptr! */ +bar->setFoo( foo ); /* no-op because you passed a nullptr */ +auto x = bar->getFoo(); /* guaranteed not to be null */ +x->somefuntion(); /* OK to dereference without checking for nullptr */ +``` + +##### Optional Member Data +Many of the elements in MusicXML are optional. +In these cases there is a bool which indicates whether or not the element is present. +The bool serves as a flag indicating whether or not the optional element will be output when you stream out your MusicXML document. +The bool has no side-effect on the element who's presence/absence it represents. +So for example we may set some data: + +```C++ +foo->setValue( "hello" ); +bar->setFoo( foo ); +``` + +But in this example, if Foo is an optional member of Bar, then we must also set hasFoo to *true* or else foo will not be in the XML output. + +```C++ +bar->toStream(...); /* Foo is not in the output! */ +bar->setHasFoo( true ); +bar->toStream(...); /* Now we see hello in the output. */ +``` + +Also note that setting HasFoo to *false* does not mean that Foo's value is gone. + +```C++ +bar->setHasFoo( false ); /* The XML document no longer has a Foo */ +bar->getFoo()->getValue() == "hello"; /* True! The value still exists but is not present in the XML. */ +``` + +##### Optional Member Data with Unbounded Occurrences +Sometimes an element may contain zero, one, or many occurrences of another element. +For example + +```xml + +``` + +In this case there will be a collection of Key objects and the getter/setters will look like this, where `KeySet` is a typedef of `std::vector`. + +```C++ +const KeySet& getKeySet() const; +void addKey( const KeyPtr& value ); +void removeKey( const KeySetIterConst& value ); +void clearKeySet(); +KeyPtr getKey( const KeySetIterConst& setIterator ) const; +``` + +##### Required Member Data with Unbounded Occurrences +Sometimes an element is required, but you may optionally have more than one. +For example + +```xml + +``` + +In this case, minOccurs="1" (by default per XSD language rules). +The functions will look just like the previous example, but they will behave differently + +```C++ +const DirectionTypeSet& getDirectionTypeSet() const; +void addDirectionType( const DirectionTypePtr& value ); +void removeDirectionType( const DirectionTypeSetIterConst& value ); +void clearDirectionTypeSet(); +DirectionTypePtr getDirectionType( const DirectionTypeSetIterConst& setIterator ) const; +``` + +When the containing element is constructed, a single DirectionType will be default constructed and pushed onto the vector. +Thus you will have one default constructed DirectionType in the set upon construction. + +If you try to call removeDirectionType with only one DirectionType in the set (size==1) nothing will happen. +You will still have a single DirectionType in the collection. + +When you call clearDirectionTypeSet vector.clear() will be called but it will follow up by pushing a default constructed DirectionType onto the vector so you will still have size==1. + +As it turns out, this design choice tends to be annoying in practice. +On the upside, it does guarantee that your MusicXML document will be valid, even if you forget to add a required element. +The downside is that it means you have to deal with the fact that a default constructed element always exists in the set, so you must replace or remove the first element. +Furthermore, you cannot remove the existing element until another one has been added. +Here are the two patterns I have used for this (pseudocode). + +**Pattern 1:** Replace the first element by dereferencing the begin() iterator: + +```C++ +bool isFirstAdded = false; +for( auto stuffElement : stuffElementsIWantToAdd ) +{ + if( !isFirstAdded ) + { + *( myElementIWantToAddThemTo->getStuffSet().begin() ) = stuffElement; + isFirstAdded = true; + } + else + { + myElementIWantToAddThemTo->addStuff( stuffElement ); + } +} +``` + +**Pattern 2:** Remove the default element *After* adding a replacement: + +```C++ +bool isFirstAdded = false; +for( auto stuffElement : stuffIWantToAdd ) +{ + myElementIWantToAddThemTo->addStuff( stuffElement ); + if( !isFirstAdded ) + { + myElementIWantToAddThemTo->removeStuff( myElementIWantToAddThemTo->getStuffSet().cbegin() ) + isFirstAdded = true; + } +} +``` + +Pattern 1 always works, even if you're not sure whether or not the `minOccurs="1"` or `"0"`. +Pattern 2 only works when `minOccurs="1"`. +There are no cases where `minOccurs` is greater than 1. + +##### Member Data with Bounded maxOccurs +```xml + +``` +In this case if you call addBeam when there are already 8 beams in the vector, nothing will happen. + +##### xs:groups +For an xs:group there is usually a single 'element' class which represents the group of elements. +For example this XSD snippet: + +```xml + + + + + + +``` + +is represented by this class: + +```C++ +class EditorialGroup : public ElementInterface +{ +public: + EditorialGroup(); + + /* ... other stuff ... */ + + /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ + FootnotePtr getFootnote() const; + void setFootnote( const FootnotePtr& value ); + bool getHasFootnote() const; + void setHasFootnote( const bool value ); + + /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ + LevelPtr getLevel() const; + void setLevel( const LevelPtr& value ); + bool getHasLevel() const; + void setHasLevel( const bool value ); + + bool fromXElement( std::ostream& message, xml::XElement& xelement ); + +private: + FootnotePtr myFootnote; + bool myHasFootnote; + LevelPtr myLevel; + bool myHasLevel; +}; +``` + +##### xs:choices + +There are a few exceptions (mistakes) but for the most part, `xs:choice` constructs are represented by a class with a name ending in 'Choice'. +The element will have an enum named 'Choice' in the public scope of the class. +Each of the possible 'choices' will exist as data members of the class, but only one of them will be 'active' (was present in, or will be written to, XML). +For example, this xsd construct: + +```xml + + + + The pre-bend element indicates that this is a pre-bend rather than a normal bend or a release. + + + + + The release element indicates that this is a release rather than a normal bend or pre-bend. + + + +``` + +Is represented by this class: + +```C++ +class BendChoice : public ElementInterface +{ +public: + enum class Choice + { + preBend = 1, + release = 2 + }; + BendChoice(); + + /* ... other stuff ... */ + + BendChoice::Choice getChoice() const; + void setChoice( BendChoice::Choice value ); + + /* _________ PreBend minOccurs = 1, maxOccurs = 1 _________ */ + PreBendPtr getPreBend() const; + void setPreBend( const PreBendPtr& value ); + + /* _________ Release minOccurs = 1, maxOccurs = 1 _________ */ + ReleasePtr getRelease() const; + void setRelease( const ReleasePtr& value ); + + bool fromXElement( std::ostream& message, xml::XElement& xelement ); + +private: + Choice myChoice; + PreBendPtr myPreBend; + ReleasePtr myRelease; +}; +``` + +When `getChoice() == BendChoice::Choice::preBend` then we will see `` in the XML, but when `getChoice() == BendChoice::Choice::postBend` then we will see `` in the XML. + +### XML DOM (::ezxml::) + +Any XML document can be read and manipulated with the classes in the `::ezxml::` namespace. +Most notably, look at the following pure virtual interfaces XDoc, XElement, XAttribute. +Also look at the STL-compliant iterators XElementIterator and XAttributeIterator. + +These interfaces are designed to wrap any underlying XML DOM software so that `mx::core` does not care or know about the XML DOM code. +A set of implementation classes wrapping pugixml are provided, but if you need to use, say Xerces or RapidXML, you can look at the PugiElement, PugiDoc, etc classes and wrap whatever library you need. + +Here's how you can read a MusicXML document into `mx::core` classes by way of `::ezxml::`. + +```C++ +#include "mx/core/Document.h" +#include "mx/utility/Utility.h" +#include "functions.h" +#include "ezxml/XFactory.h" +#include "ezxml/XDoc.h" + +#include +#include +#include + +int main(int argc, const char *argv[]) +{ + // allocate the objects + mx::core::DocumentPtr mxDoc = makeDocument(); + ::ezxml::::XDocPtr xmlDoc = ::ezxml::::XFactory::makeXDoc(); + + // read a MusicXML file into the XML DOM structure + xmlDoc->loadFile( "music.xml" ); + + // create an ostream to receive any parsing messages + std::stringstream parseMessages; + + // convert the XML DOM into MusicXML Classes + bool isSuccess = mxDoc->fromXDoc( parseMessages, *xmlDoc ); + + if( !isSuccess ) + { + std::cout << "Parsing of the MusicXML document failed with the following message(s):" << std::endl; + std::cout << parseMessages.str() << std::endl; + return -1; + } + + // maybe the document was timewise document. if so, convert it to partwise + if( mxDoc->getChoice() == mx::core::DocumentChoice::timewise ) + { + mxDoc->convertContents(); + } + + // get the root + auto scorePartwise = mxDoc->getScorePartwise(); + + // change the title + scorePartwise->getScoreHeaderGroup()->setHasWork( true ); + scorePartwise->getScoreHeaderGroup()->getWork()->setHasWorkTitle( true ); + scorePartwise->getScoreHeaderGroup()->getWork()->getWorkTitle()->setValue( mx::core::XsString( "New Title" ) ); + + // write it back out to disk + mxDoc->toXDoc( *xmlDoc ); + xmlDoc->write( "newtitle.xml" ); + + return 0; +} +``` + +### Hello World using mx::core +On the MusicXML home page there is an example of a "Hello World" simple MusicXML file. +Here is a main function that would output this "Hello World" MusicXML example to std::cout. + +```C++ +#include +#include "DocumentPartwise.h" +#include "Elements.h" + +using namespace mx::core; +using namespace std; + +int main(int argc, const char * argv[]) +{ + auto doc = makeDocumentPartwise(); + auto s = doc->getScorePartwise(); + s->getAttributes()->hasVersion = true; + s->getAttributes()->version = XsToken( "3.0" ); + auto header = s->getScoreHeaderGroup(); + header->getPartList()->getScorePart()->getAttributes()->id = XsID( "P1" ); + header->getPartList()->getScorePart()->getPartName()->setValue( XsString( "Music" ) ); + auto part = *( s->getPartwisePartSet().cbegin() ); + part->getAttributes()->id = XsIDREF( "P1" ); + auto measure = *( part->getPartwiseMeasureSet().cbegin() ); + measure->getAttributes()->number = XsToken( "1" ); + auto propertiesChoice = makeMusicDataChoice(); + propertiesChoice->setChoice( MusicDataChoice::Choice::properties ); + auto properties = propertiesChoice->getProperties(); + properties->setHasDivisions( true ); + properties->getDivisions()->setValue( PositiveDivisionsValue( 1 ) ); + properties->addKey( makeKey() ); + auto time = makeTime(); + time->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); + time->getTimeChoice()->getTimeSignature()->getBeats()->setValue( XsString( "4" ) ); + time->getTimeChoice()->getTimeSignature()->getBeatType()->setValue( XsString( "4" ) ); + properties->addTime( time ); + auto clef = makeClef(); + clef->getSign()->setValue( ClefSign::g ); + clef->setHasLine( true ); + clef->getLine()->setValue( StaffLine( 2 ) ); + properties->addClef( clef ); + measure->getMusicDataGroup()->addMusicDataChoice( propertiesChoice ); + auto noteData = makeMusicDataChoice(); + noteData->setChoice( MusicDataChoice::Choice::note ); + noteData->getNote()->getNoteChoice()->setChoice( NoteChoice::Choice::normal ); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getStep()->setValue( StepEnum::c ); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getOctave()->setValue( OctaveValue( 4 ) ); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( PositiveDivisionsValue( 4 ) ); + noteData->getNote()->getType()->setValue( NoteTypeValue::whole ); + measure->getMusicDataGroup()->addMusicDataChoice( noteData ); + + doc->toStream( cout ); /* print Hello World MusicXML document to console */ + return 0; +} +``` + +### Unit Test Framework + +An executable program named mxtest is also included in the project. +mxtest utilizes the Catch2 test framework. +The core tests are slow to compile, see the [Build Modes](#build-modes) section for more info on how to skip compilation of the tests. From 43db2d0d94f429a03a261c77f059428deeee4a78 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 16:00:16 +0200 Subject: [PATCH 03/34] cleanup line endings --- .gitattributes | 130 ++++++++++++++++++++++++++----------------------- 1 file changed, 70 insertions(+), 60 deletions(-) diff --git a/.gitattributes b/.gitattributes index c6c7ba39e..bd2cb7b14 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,74 +1,84 @@ -# trying to preserve xml input files as-is -*.xml binary +# XML and XML-like files: preserve as-is (downloaded fixtures and spec files) +*.xml binary +*.xsd binary +*.musicxml binary +*.mxl binary -# seems like we shouldn't be changine xcode files -*.xc* binary +# Xcode project files: preserve as-is +*.xc* binary +*.pbxproj binary -# These files are text and should be normalized (Convert crlf => lf) -*.rb text -*.h text -*.cpp text -*.hpp text -*.c text -*.cc text -*.sh text -*.bat text -*.m text -*.mm text -*.swift text -*.php text -*.css text -*.js text -*.htm text -*.html text -*.txt text -*.ini text -*.inc text -.htaccess text +# Text files: normalize to LF +*.rb text eol=lf +*.h text eol=lf +*.cpp text eol=lf +*.hpp text eol=lf +*.c text eol=lf +*.cc text eol=lf +*.sh text eol=lf +*.m text eol=lf +*.mm text eol=lf +*.swift text eol=lf +*.css text eol=lf +*.js text eol=lf +*.htm text eol=lf +*.html text eol=lf +*.txt text eol=lf +*.ini text eol=lf +*.inc text eol=lf +*.md text eol=lf +*.json text eol=lf +*.toml text eol=lf +*.rs text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.cmake text eol=lf +*.lock text eol=lf +*.csv text eol=lf +*.plist text eol=lf +Makefile text eol=lf +.htaccess text eol=lf -# These files are binary and should be left untouched +# Binary files: leave untouched # (binary is a macro for -text -diff) -*.tiff binary -*.mxl binary -*.mp3 binary -*.wav binary -*.aiff binary -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.mov binary -*.mp4 binary -*.mp3 binary -*.flv binary -*.fla binary -*.swf binary -*.gz binary -*.zip binary -*.7z binary -*.ttf binary -*.musx -*.dorico +*.tiff binary +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.mp3 binary +*.wav binary +*.aiff binary +*.mov binary +*.mp4 binary +*.flv binary +*.fla binary +*.swf binary +*.gz binary +*.zip binary +*.7z binary +*.ttf binary +*.musx binary +*.dorico binary +*.sib binary +*.pdf binary +*.xlsx binary +*.webarchive binary -# Auto detect text files and perform LF normalization -# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ -# * text=auto +# Windows-only files: keep CRLF +*.sln text eol=crlf +*.vcxproj text eol=crlf +*.vsproj text eol=crlf +*.csproj text eol=crlf +*.bat text eol=crlf -# Documents +# Diff drivers for binary-ish document formats *.doc diff=astextplain *.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain *.dot diff=astextplain *.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain - -# Declare files that will always have CRLF line endings on checkout. -*.sln text eol=crlf -*.vcxproj text eol=crlf -*.vsproj text eol=crlf -*.csproj text eol=crlf From 26656089d6fb610297add0387ed015710789a073 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 16:53:28 +0200 Subject: [PATCH 04/34] design build and ci quality gates --- Documents/ai/project/AGENTS.md | 8 + Documents/ai/project/agenda.md | 9 +- Documents/ai/project/build-and-ci-design.md | 287 ++++++++++++++++++++ 3 files changed, 298 insertions(+), 6 deletions(-) create mode 100644 Documents/ai/project/build-and-ci-design.md diff --git a/Documents/ai/project/AGENTS.md b/Documents/ai/project/AGENTS.md index bad2b6d07..d9c64fd32 100644 --- a/Documents/ai/project/AGENTS.md +++ b/Documents/ai/project/AGENTS.md @@ -3,3 +3,11 @@ This is the directory for supporting MusicXML 4.0. ./agenda.md is the TODO list of work items. +./build-and-ci-design.md is the plan for how Makefile and CI targets will lint, build, test and fmt the code. + +## Note on mx/core/ + +The files in `Sourcecode/private/mx/core/` were originally machine-generated from the MusicXML XSD. +The codegen program no longer exists. These files are normal hand-edited source now and must pass all +quality gates. A future codegen rewrite will re-own them. Do not treat them as generated or +read-only. diff --git a/Documents/ai/project/agenda.md b/Documents/ai/project/agenda.md index bfa124981..88d70d618 100644 --- a/Documents/ai/project/agenda.md +++ b/Documents/ai/project/agenda.md @@ -5,12 +5,9 @@ This is the project plan for supporting MusicXML 4.0 ## Phase 0: Prepare for AI Development - [x] Create a Makefile -- [ ] fix the line endind issues in markdown files like README.md -- [ ] Get .github CI modernized and working -- [ ] Put a fmt'er in place -- [ ] Put linters in place -- [ ] get a handle on .gitattributes and what should be done with it -- [ ] Put a check of Lints and Fmt's in place +- [x] fix the line endind issues in markdown files like README.md +- [x] write build-and-ci-design.md +- [ ] implement changes per build-and-ci-design.md - [ ] See how this now interacts with JetBrains CLion (which seems to create a `cmake-build-debug` directory) - [ ] Codefy Change Quality Gates in AGENTS.md diff --git a/Documents/ai/project/build-and-ci-design.md b/Documents/ai/project/build-and-ci-design.md new file mode 100644 index 000000000..a690ebc22 --- /dev/null +++ b/Documents/ai/project/build-and-ci-design.md @@ -0,0 +1,287 @@ +# Build and CI Design + +## Overview + +This document describes the formatting, linting, compiler-warning enforcement, and CI pipeline for +mx. It also defines the quality gates that coding agents must satisfy when modifying `Sourcecode/`. + +The full implementation is delivered as the commit series at the end of this document. Each commit +leaves the repository in a buildable, coherent state. + +### Note on `mx/core/` + +The files in `Sourcecode/private/mx/core/` were originally machine-generated from the MusicXML XSD. +The codegen program no longer exists. These files are now treated as normal hand-edited source and +must pass all quality gates like any other code. A future codegen rewrite will re-own these files +and will be written to emit code that passes the linter from the start. + +* * * + +## Toolchain + +### Formatting: clang-format + +Style base: **Microsoft**. This is the closest standard clang-format style to the existing codebase: +4-space indent, Allman braces (opening `{` on its own line for namespaces, classes, and functions). +The one visible change from the historical style is the removal of spaces inside parentheses +(`func( arg )` becomes `func(arg)`). + +A `.clang-format` file at the repo root encodes this style. All C++ files under `Sourcecode/` are +formatted, including generated files in `mx/core/`. + +**Installation** + +| Platform | Command | +|----------|-------------------------------------| +| macOS | `brew install clang-format` | +| Linux | `sudo apt-get install clang-format` | +| Windows | Install LLVM from llvm.org | + +### Linting: clang-tidy + +clang-tidy reads `compile_commands.json` produced by CMake (`-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`). +This gives it the correct include paths, preprocessor defines, and C++ standard — catching real +issues rather than false positives from missing context. + +The `.clang-tidy` file at the repo root enables a conservative starter set of checks: + +| Check group | Purpose | +|--------------------------|-----------------------------------------------------------------| +| `bugprone-*` | Flags likely bugs (suspicious constructs, error-prone patterns) | +| `modernize-use-nullptr` | Replace `NULL`/`0` with `nullptr` | +| `modernize-use-override` | Add `override` to overriding virtual functions | +| `performance-*` | Common performance anti-patterns | + +The check set is intentionally narrow. It can be expanded as the codebase improves. + +**Installation** + +| Platform | Command | +|----------|-------------------------------------------| +| macOS | `brew install llvm` (includes clang-tidy) | +| Linux | `sudo apt-get install clang-tidy` | +| Windows | Install LLVM from llvm.org | + +### Compiler Warnings + +`CMakeLists.txt` adds `-Wall -Wextra` (GCC/Clang) or `/W4` (MSVC) to the `mx` target. `-Werror` is +intentionally omitted so that warnings can be addressed in a dedicated commit (4b) rather than +breaking the build immediately upon enabling them. Instead, `make check` treats any `warning:` line +in the build output as a failure. + +### CMake Version + +`CMakeLists.txt` requires CMake >= 3.13. The Makefile uses `-S`/`-B` and `--build --parallel`, both +of which require 3.13+. The `cmake_minimum_required` in `CMakeLists.txt` is bumped to match in +commit 4. + +* * * + +## Makefile Targets + +### check-tools + +A prerequisite target that verifies required tools are on `PATH`. It is a dependency of `fmt`, +`lint`, and `check`. If a tool is missing it prints a platform-appropriate install recommendation +and exits non-zero. + +```makefile +check-tools: + @command -v clang-format >/dev/null 2>&1 || \ + { echo "clang-format not found."; \ + echo " macOS: brew install clang-format"; \ + echo " Linux: sudo apt-get install clang-format"; \ + exit 1; } + @command -v clang-tidy >/dev/null 2>&1 || \ + { echo "clang-tidy not found."; \ + echo " macOS: brew install llvm"; \ + echo " Linux: sudo apt-get install clang-tidy"; \ + exit 1; } +``` + +### make fmt + +Formats all C++ source files under `Sourcecode/` in-place using clang-format. + +``` +make fmt +``` + +Depends on `check-tools`. This target modifies files; running it twice is a no-op. + +### make lint + +Runs clang-tidy against all C++ source files under `Sourcecode/`. Depends on `make dev` to ensure +`compile_commands.json` is current before linting. + +``` +make lint +``` + +Depends on `check-tools` and `dev`. + +### make check + +The full quality gate. Runs each sub-check in order and fails on the first violation: + +1. **fmt** - runs `clang-format --dry-run --Werror` on all files under `Sourcecode/`. Any + unformatted file is a failure. +2. **build** - runs `make dev`, capturing output. Any `warning:` line is a failure. +3. **lint** - runs clang-tidy using the `compile_commands.json` produced by step 2. Any warning is a + failure. + +``` +make check +``` + +CI runs `make check` on Linux and macOS. On Windows, `make check` runs steps 1 and 2 (fmt-check and +warning-grep) but skips clang-tidy because `compile_commands.json` is not produced by the Visual +Studio generator. MSVC's `/W4` provides adequate static analysis coverage on Windows. + +Developers can run `make check` locally to confirm their changes will pass before pushing. + +### Xcode Targets + +The Xcode project is generated by CMake and is not checked into the repository. `build/xcode/` is +added to `.gitignore`. Three Makefile targets cover the Xcode workflow, allowing developers to +replicate the CI Xcode job locally: + +| Target | What it does | +|--------------------|-----------------------------------------------| +| `make xcode-gen` | Runs `cmake -G Xcode -S . -B build/xcode` | +| `make xcode-build` | Builds the generated project via `xcodebuild` | +| `make xcode-test` | Runs tests via `xcodebuild test` | + +* * * + +## CI Design + +### File + +`.github/workflows/ci.yaml` - the primary workflow. The old `ccpp.yml` is renamed to +`ccpp.yml.archived` to preserve history without running it. + +### Triggers + +```yaml +on: + pull_request: + push: + branches: [master] +``` + +CI runs on every PR update and on every push to `master`. This ensures `master` is always verified +green, not just PRs. + +### Jobs + +All jobs invoke Makefile targets. This is deliberate: a developer can reproduce any CI job locally +by running the same `make` command. + +#### linux (required - quality gate + core tests) + +Runner: `ubuntu-latest` + +| Step | Command | +|-----------------|-------------------------------------------| +| Install tools | `apt-get install clang-format clang-tidy` | +| Quality gate | `make check` | +| Full test suite | `make test-core` | + +This is the deepest job. It enforces all quality gates (fmt, lint, compiler warnings) and runs the +complete test suite including the slow `mx::core` tests. + +#### macos (required - quality gate + tests) + +Runner: `macos-latest` + +| Step | Command | +|-----------------|----------------------------------| +| Install tools | `brew install clang-format llvm` | +| Quality gate | `make check` | +| Run tests | `make test` | +| Run examples | `make examples-run` | + +Runs `make check` (fmt, build with warning-grep, lint) followed by the test suite and examples. +Verifies macOS-specific build and runtime correctness. + +#### windows (advisory) + +Runner: `windows-latest` + +| Step | Command | +|-----------------|------------------------------------------------| +| Install make | `choco install make` | +| Install tools | Install LLVM (for clang-format) | +| Quality gate | `make check` (fmt-check + warning-grep, no lint) | +| Run tests | `make test` | + +Uses GNU make installed via Chocolatey. clang-tidy is skipped because the Visual Studio generator +does not produce `compile_commands.json`. MSVC `/W4` warnings are caught by the warning-grep step. + +#### xcode (advisory) + +Runner: `macos-latest` + +| Step | Command | +|------------------|--------------------| +| Generate project | `make xcode-gen` | +| Build | `make xcode-build` | +| Test | `make xcode-test` | + +Verifies the Xcode generator path separately from the Unix Makefiles build. + +### Caching + +All jobs cache their `build/` directory to avoid full rebuilds on every run. The cache key is: + +``` +${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} +``` + +If `CMakeLists.txt` or any source file changes, the cache is invalidated. A `.github/cache-bust` +file allows manual invalidation when needed. + +### Branch Protection + +The `master` branch requires the **linux** and **macos** jobs to pass before merge. The **windows** +and **xcode** jobs are advisory - failures are visible but do not block merge. Merge strategy: +regular merge commits (not squash). + +* * * + +## Quality Gates for Coding Agents + +When modifying any file under `Sourcecode/`, an agent must run: + +``` +make check +``` + +before considering the change complete. `make check` enforces: + +1. **Formatting** - all files must be formatted per `.clang-format`. Run `make fmt` to fix + formatting, then re-run `make check`. +2. **Linting** - all clang-tidy checks in `.clang-tidy` must pass with zero warnings. +3. **Compiler warnings** - the build must emit no `warning:` lines. + +If `check-tools` reports a missing tool, install it before running `make check`. The CI Linux and +macOS jobs are both authoritative gates. If the two platforms disagree on a warning (e.g. GCC emits +one that Clang does not, or vice versa), both must be fixed. + +* * * + +## Commit Series + +The following commits implement this design in order. Each commit leaves the repository in a +buildable, coherent state. + +| # | Commit message | What it does | +|----|---------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 1 | `add clang-format config and make fmt target` | Adds `.clang-format` (Microsoft style), `check-tools` prerequisite, and `make fmt` target to the Makefile. No files are reformatted yet. | +| 2 | `reformat Sourcecode/ with clang-format` | Applies `make fmt` to all of `Sourcecode/`. Pure formatting diff — no logic changes. | +| 3 | `add clang-tidy config and make lint target` | Adds `.clang-tidy`, enables `CMAKE_EXPORT_COMPILE_COMMANDS=ON` in CMake, adds `make lint` target. | +| 4 | `add compiler warnings and make check target` | Adds `-Wall -Wextra` / `/W4` to `CMakeLists.txt`, bumps `cmake_minimum_required` to 3.13, adds `make check` target combining fmt-check, build-warning grep, and lint. On Windows, `make check` skips lint. | +| 4b | `fix compiler and clang-tidy warnings` | Fixes all warnings surfaced by commit 4 across `Sourcecode/`, including the historically-generated files in `mx/core/` (which are normal source today - see Overview). | +| 5 | `modernize CI: new ci.yaml, archive old workflow` | Renames `ccpp.yml` to `ccpp.yml.archived`. Writes `ci.yaml` with linux/macos as required gates, windows/xcode as advisory. Adds Xcode targets, build caching, and `choco install make` for Windows. | +| 6 | `add quality gates to AGENTS.md` | Documents `make check` as the required pre-commit gate for agents modifying `Sourcecode/`. | From 0b619a59c1ef56e154eccfea6928f91263193dce Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 16:58:57 +0200 Subject: [PATCH 05/34] add clang-format config and make fmt target --- .clang-format | 2 ++ Makefile | 29 ++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..0d6bd9096 --- /dev/null +++ b/.clang-format @@ -0,0 +1,2 @@ +BasedOnStyle: Microsoft +ColumnLimit: 120 diff --git a/Makefile b/Makefile index f44d8b37f..ac2080320 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ define run_bin endef .DEFAULT_GOAL := help -.PHONY: help lib dev core test test-core examples-run all clean +.PHONY: help lib dev core test test-core examples-run all clean check-tools fmt help: @echo 'mx build/test targets (see comments at the top of the Makefile for rationale):' @@ -116,6 +116,8 @@ help: @echo '' @echo ' make clean Remove the entire $(BUILD_ROOT)/ tree.' @echo '' + @echo ' make fmt Format all C++ files under Sourcecode/.' + @echo '' @echo 'Knobs: JOBS (=$(JOBS)) BUILD_TYPE (=$(BUILD_TYPE)) GENERATOR ARGS' @echo 'Layout: $(BUILD_ROOT)//$(BUILD_TYPE)/' @@ -154,3 +156,28 @@ all: core clean: rm -rf $(BUILD_ROOT) + +# --- Quality targets -------------------------------------------------------- + +check-tools: + @command -v clang-format >/dev/null 2>&1 || \ + { echo "clang-format not found."; \ + echo " macOS: brew install clang-format"; \ + echo " Linux: sudo apt-get install clang-format"; \ + exit 1; } + @command -v clang-tidy >/dev/null 2>&1 || \ + { echo "clang-tidy not found."; \ + echo " macOS: brew install llvm"; \ + echo " Linux: sudo apt-get install clang-tidy"; \ + exit 1; } + +FIND_CPP := find Sourcecode \ + -path 'Sourcecode/private/cpul' -prune -o \ + -name 'pugixml.cpp' -prune -o \ + -name 'pugixml.hpp' -prune -o \ + -name 'pugiconfig.hpp' -prune -o \ + -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print + +fmt: check-tools + @$(FIND_CPP) | xargs clang-format -i + @echo "Formatted all C++ files under Sourcecode/" From c3a642627c3fd62ff10d9b8b4a8083f420ffc37b Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 17:27:20 +0200 Subject: [PATCH 06/34] reformat sourcecode with clang-format --- .clang-format | 1 + Sourcecode/include/mx/api/ApiCommon.h | 91 +- Sourcecode/include/mx/api/ApiEquality.h | 182 +- Sourcecode/include/mx/api/AppearanceData.h | 104 +- Sourcecode/include/mx/api/BarlineData.h | 105 +- Sourcecode/include/mx/api/ChordData.h | 303 +- Sourcecode/include/mx/api/ClefData.h | 134 +- Sourcecode/include/mx/api/CodaData.h | 43 +- Sourcecode/include/mx/api/ColorData.h | 56 +- Sourcecode/include/mx/api/CurveData.h | 314 +- Sourcecode/include/mx/api/DefaultsData.h | 210 +- Sourcecode/include/mx/api/DirectionData.h | 192 +- Sourcecode/include/mx/api/DocumentManager.h | 153 +- Sourcecode/include/mx/api/DurationData.h | 152 +- Sourcecode/include/mx/api/EncodingData.h | 156 +- Sourcecode/include/mx/api/FontData.h | 170 +- Sourcecode/include/mx/api/KeyComponent.h | 76 +- Sourcecode/include/mx/api/KeyData.h | 161 +- Sourcecode/include/mx/api/LayoutData.h | 154 +- Sourcecode/include/mx/api/LeftRight.h | 54 +- Sourcecode/include/mx/api/LineData.h | 117 +- Sourcecode/include/mx/api/LyricData.h | 28 +- Sourcecode/include/mx/api/MarginsData.h | 62 +- Sourcecode/include/mx/api/MarkData.h | 438 +- Sourcecode/include/mx/api/MeasureData.h | 184 +- Sourcecode/include/mx/api/MeasureLocation.h | 50 +- Sourcecode/include/mx/api/MiscData.h | 30 +- .../include/mx/api/NoteAttachmentData.h | 58 +- Sourcecode/include/mx/api/NoteData.h | 280 +- Sourcecode/include/mx/api/OttavaData.h | 61 +- Sourcecode/include/mx/api/PageData.h | 84 +- Sourcecode/include/mx/api/PageLayoutData.h | 58 +- Sourcecode/include/mx/api/PageMarginsData.h | 75 +- Sourcecode/include/mx/api/PageTextData.h | 51 +- Sourcecode/include/mx/api/PartData.h | 368 +- Sourcecode/include/mx/api/PartGroupData.h | 125 +- Sourcecode/include/mx/api/PitchData.h | 270 +- Sourcecode/include/mx/api/PositionData.h | 123 +- Sourcecode/include/mx/api/PrintData.h | 51 +- Sourcecode/include/mx/api/RehearsalData.h | 59 +- Sourcecode/include/mx/api/ScoreData.h | 138 +- Sourcecode/include/mx/api/SegnoData.h | 43 +- Sourcecode/include/mx/api/SizeData.h | 54 +- Sourcecode/include/mx/api/SoundID.h | 1804 +- Sourcecode/include/mx/api/SpannerData.h | 94 +- Sourcecode/include/mx/api/StaffData.h | 90 +- Sourcecode/include/mx/api/SystemData.h | 99 +- Sourcecode/include/mx/api/SystemLayoutData.h | 85 +- Sourcecode/include/mx/api/TempoData.h | 196 +- Sourcecode/include/mx/api/TimeSignatureData.h | 96 +- Sourcecode/include/mx/api/TransposeData.h | 130 +- Sourcecode/include/mx/api/TupletData.h | 171 +- Sourcecode/include/mx/api/Version.h | 50 +- Sourcecode/include/mx/api/VoiceData.h | 28 +- Sourcecode/include/mx/api/WedgeData.h | 123 +- Sourcecode/include/mx/api/WordsData.h | 54 +- Sourcecode/private/mx/api/AppearanceData.cpp | 19 +- Sourcecode/private/mx/api/ChordData.cpp | 43 +- Sourcecode/private/mx/api/ClefData.cpp | 255 +- Sourcecode/private/mx/api/DocumentManager.cpp | 420 +- Sourcecode/private/mx/api/DurationData.cpp | 24 +- Sourcecode/private/mx/api/EncodingData.cpp | 27 +- Sourcecode/private/mx/api/MarkData.cpp | 409 +- Sourcecode/private/mx/api/MeasureLocation.cpp | 73 +- Sourcecode/private/mx/api/NoteData.cpp | 35 +- Sourcecode/private/mx/api/PitchData.cpp | 74 +- Sourcecode/private/mx/api/ScoreData.cpp | 139 +- Sourcecode/private/mx/api/SoundID.cpp | 61 +- Sourcecode/private/mx/api/Version.cpp | 79 +- .../private/mx/core/AttributesInterface.cpp | 37 +- .../private/mx/core/AttributesInterface.h | 72 +- Sourcecode/private/mx/core/Color.cpp | 489 +- Sourcecode/private/mx/core/Color.h | 93 +- .../core/CommaSeparatedPositiveIntegers.cpp | 217 +- .../mx/core/CommaSeparatedPositiveIntegers.h | 55 +- .../private/mx/core/CommaSeparatedText.cpp | 180 +- .../private/mx/core/CommaSeparatedText.h | 57 +- Sourcecode/private/mx/core/Date.cpp | 1375 +- Sourcecode/private/mx/core/Date.h | 151 +- Sourcecode/private/mx/core/Decimals.cpp | 811 +- Sourcecode/private/mx/core/Decimals.h | 476 +- Sourcecode/private/mx/core/Document.cpp | 315 +- Sourcecode/private/mx/core/Document.h | 154 +- Sourcecode/private/mx/core/DocumentHeader.cpp | 283 +- Sourcecode/private/mx/core/DocumentHeader.h | 155 +- Sourcecode/private/mx/core/DocumentSpec.cpp | 251 +- Sourcecode/private/mx/core/DocumentSpec.h | 106 +- .../private/mx/core/ElementInterface.cpp | 491 +- Sourcecode/private/mx/core/ElementInterface.h | 95 +- Sourcecode/private/mx/core/Elements.h | 38 +- .../EmptyPrintObjectStyleAlignAttributes.cpp | 178 +- .../EmptyPrintObjectStyleAlignAttributes.h | 86 +- Sourcecode/private/mx/core/EndingNumber.h | 8 +- Sourcecode/private/mx/core/Enums.cpp | 11110 +++++---- Sourcecode/private/mx/core/Enums.h | 4068 ++-- Sourcecode/private/mx/core/EnumsBuiltin.cpp | 346 +- Sourcecode/private/mx/core/EnumsBuiltin.h | 103 +- Sourcecode/private/mx/core/FontSize.cpp | 235 +- Sourcecode/private/mx/core/FontSize.h | 54 +- Sourcecode/private/mx/core/ForwardDeclare.h | 48 +- Sourcecode/private/mx/core/FromString.h | 10 +- Sourcecode/private/mx/core/FromXElement.cpp | 1384 +- Sourcecode/private/mx/core/FromXElement.h | 685 +- Sourcecode/private/mx/core/Integers.cpp | 393 +- Sourcecode/private/mx/core/Integers.h | 457 +- Sourcecode/private/mx/core/NumberOrNormal.cpp | 293 +- Sourcecode/private/mx/core/NumberOrNormal.h | 66 +- Sourcecode/private/mx/core/PlaybackSound.h | 1792 +- .../mx/core/PositiveIntegerOrEmpty.cpp | 295 +- .../private/mx/core/PositiveIntegerOrEmpty.h | 66 +- .../private/mx/core/ProcessingInstruction.cpp | 122 +- .../private/mx/core/ProcessingInstruction.h | 78 +- .../private/mx/core/ScoreConversions.cpp | 263 +- Sourcecode/private/mx/core/ScoreConversions.h | 24 +- Sourcecode/private/mx/core/StringUtils.h | 106 +- Sourcecode/private/mx/core/TimeOnly.h | 8 +- Sourcecode/private/mx/core/UnusedParameter.h | 6 +- Sourcecode/private/mx/core/XlinkHref.h | 8 +- Sourcecode/private/mx/core/XlinkRole.h | 8 +- Sourcecode/private/mx/core/XlinkTitle.h | 8 +- Sourcecode/private/mx/core/XmlLang.h | 8 +- Sourcecode/private/mx/core/XsAnyUri.h | 8 +- Sourcecode/private/mx/core/XsID.cpp | 49 +- Sourcecode/private/mx/core/XsID.h | 22 +- Sourcecode/private/mx/core/XsIDREF.h | 8 +- Sourcecode/private/mx/core/XsNMToken.h | 8 +- Sourcecode/private/mx/core/XsString.cpp | 119 +- Sourcecode/private/mx/core/XsString.h | 43 +- Sourcecode/private/mx/core/XsToken.cpp | 32 +- Sourcecode/private/mx/core/XsToken.h | 22 +- Sourcecode/private/mx/core/YesNoNumber.cpp | 235 +- Sourcecode/private/mx/core/YesNoNumber.h | 56 +- .../private/mx/core/elements/Accent.cpp | 96 +- Sourcecode/private/mx/core/elements/Accent.h | 61 +- .../private/mx/core/elements/Accidental.cpp | 157 +- .../private/mx/core/elements/Accidental.h | 81 +- .../mx/core/elements/AccidentalAttributes.cpp | 189 +- .../mx/core/elements/AccidentalAttributes.h | 82 +- .../mx/core/elements/AccidentalMark.cpp | 143 +- .../private/mx/core/elements/AccidentalMark.h | 81 +- .../elements/AccidentalMarkAttributes.cpp | 148 +- .../core/elements/AccidentalMarkAttributes.h | 66 +- .../mx/core/elements/AccidentalText.cpp | 143 +- .../private/mx/core/elements/AccidentalText.h | 81 +- .../elements/AccidentalTextAttributes.cpp | 270 +- .../core/elements/AccidentalTextAttributes.h | 106 +- .../private/mx/core/elements/Accord.cpp | 245 +- Sourcecode/private/mx/core/elements/Accord.h | 87 +- .../mx/core/elements/AccordAttributes.cpp | 66 +- .../mx/core/elements/AccordAttributes.h | 34 +- .../mx/core/elements/AccordionHigh.cpp | 57 +- .../private/mx/core/elements/AccordionHigh.h | 49 +- .../private/mx/core/elements/AccordionLow.cpp | 57 +- .../private/mx/core/elements/AccordionLow.h | 49 +- .../mx/core/elements/AccordionMiddle.cpp | 107 +- .../mx/core/elements/AccordionMiddle.h | 73 +- .../core/elements/AccordionRegistration.cpp | 284 +- .../mx/core/elements/AccordionRegistration.h | 99 +- .../AccordionRegistrationAttributes.cpp | 169 +- .../AccordionRegistrationAttributes.h | 74 +- .../private/mx/core/elements/ActualNotes.cpp | 107 +- .../private/mx/core/elements/ActualNotes.h | 73 +- Sourcecode/private/mx/core/elements/Alter.cpp | 107 +- Sourcecode/private/mx/core/elements/Alter.h | 75 +- .../private/mx/core/elements/Appearance.cpp | 405 +- .../private/mx/core/elements/Appearance.h | 107 +- .../private/mx/core/elements/Arpeggiate.cpp | 96 +- .../private/mx/core/elements/Arpeggiate.h | 61 +- .../mx/core/elements/ArpeggiateAttributes.cpp | 125 +- .../mx/core/elements/ArpeggiateAttributes.h | 58 +- Sourcecode/private/mx/core/elements/Arrow.cpp | 231 +- Sourcecode/private/mx/core/elements/Arrow.h | 89 +- .../mx/core/elements/ArrowAttributes.cpp | 158 +- .../mx/core/elements/ArrowAttributes.h | 70 +- .../mx/core/elements/ArrowDirection.cpp | 105 +- .../private/mx/core/elements/ArrowDirection.h | 73 +- .../private/mx/core/elements/ArrowGroup.cpp | 183 +- .../private/mx/core/elements/ArrowGroup.h | 83 +- .../private/mx/core/elements/ArrowStyle.cpp | 105 +- .../private/mx/core/elements/ArrowStyle.h | 73 +- .../mx/core/elements/Articulations.cpp | 173 +- .../private/mx/core/elements/Articulations.h | 71 +- .../mx/core/elements/ArticulationsChoice.cpp | 869 +- .../mx/core/elements/ArticulationsChoice.h | 291 +- .../private/mx/core/elements/Artificial.cpp | 57 +- .../private/mx/core/elements/Artificial.h | 49 +- .../mx/core/elements/AttributesIterface.h | 26 +- .../private/mx/core/elements/Backup.cpp | 152 +- Sourcecode/private/mx/core/elements/Backup.h | 77 +- .../private/mx/core/elements/BarStyle.cpp | 141 +- .../private/mx/core/elements/BarStyle.h | 81 +- .../mx/core/elements/BarStyleAttributes.cpp | 66 +- .../mx/core/elements/BarStyleAttributes.h | 34 +- .../private/mx/core/elements/Barline.cpp | 577 +- Sourcecode/private/mx/core/elements/Barline.h | 199 +- .../mx/core/elements/BarlineAttributes.cpp | 94 +- .../mx/core/elements/BarlineAttributes.h | 46 +- Sourcecode/private/mx/core/elements/Barre.cpp | 96 +- Sourcecode/private/mx/core/elements/Barre.h | 61 +- .../mx/core/elements/BarreAttributes.cpp | 77 +- .../mx/core/elements/BarreAttributes.h | 34 +- .../private/mx/core/elements/BasePitch.cpp | 57 +- .../private/mx/core/elements/BasePitch.h | 49 +- Sourcecode/private/mx/core/elements/Bass.cpp | 176 +- Sourcecode/private/mx/core/elements/Bass.h | 83 +- .../private/mx/core/elements/BassAlter.cpp | 141 +- .../private/mx/core/elements/BassAlter.h | 83 +- .../mx/core/elements/BassAlterAttributes.cpp | 158 +- .../mx/core/elements/BassAlterAttributes.h | 70 +- .../private/mx/core/elements/BassStep.cpp | 141 +- .../private/mx/core/elements/BassStep.h | 81 +- .../mx/core/elements/BassStepAttributes.cpp | 148 +- .../mx/core/elements/BassStepAttributes.h | 66 +- Sourcecode/private/mx/core/elements/Beam.cpp | 141 +- Sourcecode/private/mx/core/elements/Beam.h | 81 +- .../mx/core/elements/BeamAttributes.cpp | 82 +- .../private/mx/core/elements/BeamAttributes.h | 42 +- .../private/mx/core/elements/BeatRepeat.cpp | 210 +- .../private/mx/core/elements/BeatRepeat.h | 89 +- .../mx/core/elements/BeatRepeatAttributes.cpp | 94 +- .../mx/core/elements/BeatRepeatAttributes.h | 42 +- .../private/mx/core/elements/BeatType.cpp | 107 +- .../private/mx/core/elements/BeatType.h | 73 +- .../private/mx/core/elements/BeatUnit.cpp | 105 +- .../private/mx/core/elements/BeatUnit.h | 73 +- .../private/mx/core/elements/BeatUnitDot.cpp | 57 +- .../private/mx/core/elements/BeatUnitDot.h | 45 +- .../mx/core/elements/BeatUnitGroup.cpp | 200 +- .../private/mx/core/elements/BeatUnitGroup.h | 81 +- .../private/mx/core/elements/BeatUnitPer.cpp | 142 +- .../private/mx/core/elements/BeatUnitPer.h | 69 +- .../BeatUnitPerOrNoteRelationNoteChoice.cpp | 166 +- .../BeatUnitPerOrNoteRelationNoteChoice.h | 83 +- .../private/mx/core/elements/Beater.cpp | 141 +- Sourcecode/private/mx/core/elements/Beater.h | 81 +- .../mx/core/elements/BeaterAttributes.cpp | 66 +- .../mx/core/elements/BeaterAttributes.h | 34 +- Sourcecode/private/mx/core/elements/Beats.cpp | 107 +- Sourcecode/private/mx/core/elements/Beats.h | 73 +- Sourcecode/private/mx/core/elements/Bend.cpp | 268 +- Sourcecode/private/mx/core/elements/Bend.h | 93 +- .../private/mx/core/elements/BendAlter.cpp | 107 +- .../private/mx/core/elements/BendAlter.h | 75 +- .../mx/core/elements/BendAttributes.cpp | 189 +- .../private/mx/core/elements/BendAttributes.h | 82 +- .../private/mx/core/elements/BendChoice.cpp | 160 +- .../private/mx/core/elements/BendChoice.h | 91 +- .../private/mx/core/elements/Bookmark.cpp | 96 +- .../private/mx/core/elements/Bookmark.h | 61 +- .../mx/core/elements/BookmarkAttributes.cpp | 104 +- .../mx/core/elements/BookmarkAttributes.h | 46 +- .../private/mx/core/elements/BottomMargin.cpp | 107 +- .../private/mx/core/elements/BottomMargin.h | 75 +- .../private/mx/core/elements/Bracket.cpp | 96 +- Sourcecode/private/mx/core/elements/Bracket.h | 61 +- .../mx/core/elements/BracketAttributes.cpp | 171 +- .../mx/core/elements/BracketAttributes.h | 83 +- .../private/mx/core/elements/BreathMark.cpp | 142 +- .../private/mx/core/elements/BreathMark.h | 81 +- .../mx/core/elements/BreathMarkAttributes.cpp | 148 +- .../mx/core/elements/BreathMarkAttributes.h | 66 +- .../private/mx/core/elements/Caesura.cpp | 96 +- Sourcecode/private/mx/core/elements/Caesura.h | 61 +- .../private/mx/core/elements/Cancel.cpp | 141 +- Sourcecode/private/mx/core/elements/Cancel.h | 81 +- .../mx/core/elements/CancelAttributes.cpp | 66 +- .../mx/core/elements/CancelAttributes.h | 34 +- Sourcecode/private/mx/core/elements/Capo.cpp | 107 +- Sourcecode/private/mx/core/elements/Capo.h | 73 +- Sourcecode/private/mx/core/elements/Chord.cpp | 57 +- Sourcecode/private/mx/core/elements/Chord.h | 49 +- .../private/mx/core/elements/Chromatic.cpp | 107 +- .../private/mx/core/elements/Chromatic.h | 75 +- .../mx/core/elements/CircularArrow.cpp | 105 +- .../private/mx/core/elements/CircularArrow.h | 73 +- Sourcecode/private/mx/core/elements/Clef.cpp | 260 +- Sourcecode/private/mx/core/elements/Clef.h | 93 +- .../mx/core/elements/ClefAttributes.cpp | 201 +- .../private/mx/core/elements/ClefAttributes.h | 86 +- .../mx/core/elements/ClefOctaveChange.cpp | 107 +- .../mx/core/elements/ClefOctaveChange.h | 73 +- Sourcecode/private/mx/core/elements/Coda.cpp | 96 +- Sourcecode/private/mx/core/elements/Coda.h | 55 +- .../private/mx/core/elements/Creator.cpp | 141 +- Sourcecode/private/mx/core/elements/Creator.h | 81 +- .../mx/core/elements/CreatorAttributes.cpp | 66 +- .../mx/core/elements/CreatorAttributes.h | 34 +- .../private/mx/core/elements/Credit.cpp | 510 +- Sourcecode/private/mx/core/elements/Credit.h | 126 +- .../mx/core/elements/CreditAttributes.cpp | 66 +- .../mx/core/elements/CreditAttributes.h | 34 +- .../private/mx/core/elements/CreditChoice.cpp | 237 +- .../private/mx/core/elements/CreditChoice.h | 97 +- .../private/mx/core/elements/CreditImage.cpp | 96 +- .../private/mx/core/elements/CreditImage.h | 61 +- .../core/elements/CreditImageAttributes.cpp | 148 +- .../mx/core/elements/CreditImageAttributes.h | 58 +- .../private/mx/core/elements/CreditType.cpp | 105 +- .../private/mx/core/elements/CreditType.h | 73 +- .../private/mx/core/elements/CreditWords.cpp | 142 +- .../private/mx/core/elements/CreditWords.h | 81 +- .../core/elements/CreditWordsAttributes.cpp | 290 +- .../mx/core/elements/CreditWordsAttributes.h | 114 +- .../mx/core/elements/CreditWordsGroup.cpp | 260 +- .../mx/core/elements/CreditWordsGroup.h | 89 +- Sourcecode/private/mx/core/elements/Cue.cpp | 57 +- Sourcecode/private/mx/core/elements/Cue.h | 49 +- .../private/mx/core/elements/CueNoteGroup.cpp | 148 +- .../private/mx/core/elements/CueNoteGroup.h | 89 +- Sourcecode/private/mx/core/elements/Damp.cpp | 96 +- Sourcecode/private/mx/core/elements/Damp.h | 55 +- .../private/mx/core/elements/DampAll.cpp | 96 +- Sourcecode/private/mx/core/elements/DampAll.h | 55 +- .../private/mx/core/elements/Dashes.cpp | 96 +- Sourcecode/private/mx/core/elements/Dashes.h | 61 +- .../mx/core/elements/DashesAttributes.cpp | 147 +- .../mx/core/elements/DashesAttributes.h | 62 +- .../private/mx/core/elements/Defaults.cpp | 492 +- .../private/mx/core/elements/Defaults.h | 173 +- .../private/mx/core/elements/Degree.cpp | 232 +- Sourcecode/private/mx/core/elements/Degree.h | 97 +- .../private/mx/core/elements/DegreeAlter.cpp | 142 +- .../private/mx/core/elements/DegreeAlter.h | 83 +- .../core/elements/DegreeAlterAttributes.cpp | 148 +- .../mx/core/elements/DegreeAlterAttributes.h | 66 +- .../mx/core/elements/DegreeAttributes.cpp | 66 +- .../mx/core/elements/DegreeAttributes.h | 34 +- .../private/mx/core/elements/DegreeType.cpp | 142 +- .../private/mx/core/elements/DegreeType.h | 81 +- .../mx/core/elements/DegreeTypeAttributes.cpp | 148 +- .../mx/core/elements/DegreeTypeAttributes.h | 66 +- .../private/mx/core/elements/DegreeValue.cpp | 142 +- .../private/mx/core/elements/DegreeValue.h | 81 +- .../core/elements/DegreeValueAttributes.cpp | 158 +- .../mx/core/elements/DegreeValueAttributes.h | 70 +- .../mx/core/elements/DelayedInvertedTurn.cpp | 97 +- .../mx/core/elements/DelayedInvertedTurn.h | 61 +- .../DelayedInvertedTurnAttributes.cpp | 239 +- .../elements/DelayedInvertedTurnAttributes.h | 98 +- .../private/mx/core/elements/DelayedTurn.cpp | 96 +- .../private/mx/core/elements/DelayedTurn.h | 61 +- .../core/elements/DelayedTurnAttributes.cpp | 239 +- .../mx/core/elements/DelayedTurnAttributes.h | 98 +- .../mx/core/elements/DetachedLegato.cpp | 96 +- .../private/mx/core/elements/DetachedLegato.h | 61 +- .../private/mx/core/elements/Diatonic.cpp | 107 +- .../private/mx/core/elements/Diatonic.h | 73 +- .../private/mx/core/elements/Direction.cpp | 1097 +- .../private/mx/core/elements/Direction.h | 162 +- .../mx/core/elements/DirectionAttributes.cpp | 75 +- .../mx/core/elements/DirectionAttributes.h | 38 +- .../mx/core/elements/DirectionType.cpp | 1233 +- .../private/mx/core/elements/DirectionType.h | 407 +- .../private/mx/core/elements/Directive.cpp | 135 +- .../private/mx/core/elements/Directive.h | 81 +- .../mx/core/elements/DirectiveAttributes.cpp | 153 +- .../mx/core/elements/DirectiveAttributes.h | 66 +- .../mx/core/elements/DisplayOctave.cpp | 107 +- .../private/mx/core/elements/DisplayOctave.h | 73 +- .../private/mx/core/elements/DisplayStep.cpp | 105 +- .../private/mx/core/elements/DisplayStep.h | 73 +- .../core/elements/DisplayStepOctaveGroup.cpp | 167 +- .../mx/core/elements/DisplayStepOctaveGroup.h | 77 +- .../private/mx/core/elements/DisplayText.cpp | 142 +- .../private/mx/core/elements/DisplayText.h | 81 +- .../core/elements/DisplayTextAttributes.cpp | 270 +- .../mx/core/elements/DisplayTextAttributes.h | 106 +- .../elements/DisplayTextOrAccidentalText.cpp | 186 +- .../elements/DisplayTextOrAccidentalText.h | 83 +- .../private/mx/core/elements/Distance.cpp | 141 +- .../private/mx/core/elements/Distance.h | 83 +- .../mx/core/elements/DistanceAttributes.cpp | 77 +- .../mx/core/elements/DistanceAttributes.h | 34 +- .../private/mx/core/elements/Divisions.cpp | 105 +- .../private/mx/core/elements/Divisions.h | 75 +- Sourcecode/private/mx/core/elements/Doit.cpp | 96 +- Sourcecode/private/mx/core/elements/Doit.h | 61 +- Sourcecode/private/mx/core/elements/Dot.cpp | 96 +- Sourcecode/private/mx/core/elements/Dot.h | 61 +- .../private/mx/core/elements/Double.cpp | 57 +- Sourcecode/private/mx/core/elements/Double.h | 49 +- .../private/mx/core/elements/DoubleTongue.cpp | 96 +- .../private/mx/core/elements/DoubleTongue.h | 61 +- .../private/mx/core/elements/DownBow.cpp | 96 +- Sourcecode/private/mx/core/elements/DownBow.h | 61 +- .../private/mx/core/elements/Duration.cpp | 107 +- .../private/mx/core/elements/Duration.h | 75 +- .../private/mx/core/elements/Dynamics.cpp | 173 +- .../private/mx/core/elements/Dynamics.h | 82 +- .../mx/core/elements/DynamicsAttributes.cpp | 210 +- .../mx/core/elements/DynamicsAttributes.h | 94 +- .../mx/core/elements/EditorialGroup.cpp | 174 +- .../private/mx/core/elements/EditorialGroup.h | 89 +- .../elements/EditorialVoiceDirectionGroup.cpp | 238 +- .../elements/EditorialVoiceDirectionGroup.h | 92 +- .../mx/core/elements/EditorialVoiceGroup.cpp | 237 +- .../mx/core/elements/EditorialVoiceGroup.h | 91 +- .../private/mx/core/elements/Effect.cpp | 105 +- Sourcecode/private/mx/core/elements/Effect.h | 73 +- .../private/mx/core/elements/Elevation.cpp | 107 +- .../private/mx/core/elements/Elevation.h | 75 +- .../private/mx/core/elements/Elision.cpp | 141 +- Sourcecode/private/mx/core/elements/Elision.h | 81 +- .../mx/core/elements/ElisionAttributes.cpp | 164 +- .../mx/core/elements/ElisionAttributes.h | 70 +- .../mx/core/elements/ElisionSyllabicGroup.cpp | 147 +- .../mx/core/elements/ElisionSyllabicGroup.h | 83 +- .../elements/ElisionSyllabicTextGroup.cpp | 148 +- .../core/elements/ElisionSyllabicTextGroup.h | 83 +- .../mx/core/elements/EmptyFontAttributes.cpp | 95 +- .../mx/core/elements/EmptyFontAttributes.h | 46 +- .../mx/core/elements/EmptyLineAttributes.cpp | 195 +- .../mx/core/elements/EmptyLineAttributes.h | 82 +- .../elements/EmptyPlacementAttributes.cpp | 148 +- .../core/elements/EmptyPlacementAttributes.h | 64 +- .../elements/EmptyTrillSoundAttributes.cpp | 229 +- .../core/elements/EmptyTrillSoundAttributes.h | 94 +- .../private/mx/core/elements/Encoder.cpp | 141 +- Sourcecode/private/mx/core/elements/Encoder.h | 81 +- .../mx/core/elements/EncoderAttributes.cpp | 66 +- .../mx/core/elements/EncoderAttributes.h | 34 +- .../private/mx/core/elements/Encoding.cpp | 178 +- .../private/mx/core/elements/Encoding.h | 69 +- .../mx/core/elements/EncodingChoice.cpp | 312 +- .../private/mx/core/elements/EncodingChoice.h | 137 +- .../private/mx/core/elements/EncodingDate.cpp | 107 +- .../private/mx/core/elements/EncodingDate.h | 75 +- .../mx/core/elements/EncodingDescription.cpp | 107 +- .../mx/core/elements/EncodingDescription.h | 73 +- .../private/mx/core/elements/EndLine.cpp | 57 +- Sourcecode/private/mx/core/elements/EndLine.h | 49 +- .../private/mx/core/elements/EndParagraph.cpp | 57 +- .../private/mx/core/elements/EndParagraph.h | 49 +- .../private/mx/core/elements/Ending.cpp | 141 +- Sourcecode/private/mx/core/elements/Ending.h | 81 +- .../mx/core/elements/EndingAttributes.cpp | 228 +- .../mx/core/elements/EndingAttributes.h | 86 +- .../private/mx/core/elements/Ensemble.cpp | 107 +- .../private/mx/core/elements/Ensemble.h | 73 +- .../private/mx/core/elements/Extend.cpp | 96 +- Sourcecode/private/mx/core/elements/Extend.h | 61 +- .../mx/core/elements/ExtendAttributes.cpp | 148 +- .../mx/core/elements/ExtendAttributes.h | 66 +- .../private/mx/core/elements/Eyeglasses.cpp | 96 +- .../private/mx/core/elements/Eyeglasses.h | 55 +- .../private/mx/core/elements/Falloff.cpp | 96 +- Sourcecode/private/mx/core/elements/Falloff.h | 61 +- .../private/mx/core/elements/Feature.cpp | 141 +- Sourcecode/private/mx/core/elements/Feature.h | 81 +- .../mx/core/elements/FeatureAttributes.cpp | 66 +- .../mx/core/elements/FeatureAttributes.h | 34 +- .../private/mx/core/elements/Fermata.cpp | 141 +- Sourcecode/private/mx/core/elements/Fermata.h | 81 +- .../mx/core/elements/FermataAttributes.cpp | 158 +- .../mx/core/elements/FermataAttributes.h | 70 +- .../private/mx/core/elements/Fifths.cpp | 107 +- Sourcecode/private/mx/core/elements/Fifths.h | 73 +- .../private/mx/core/elements/Figure.cpp | 319 +- Sourcecode/private/mx/core/elements/Figure.h | 107 +- .../private/mx/core/elements/FigureNumber.cpp | 142 +- .../private/mx/core/elements/FigureNumber.h | 81 +- .../core/elements/FigureNumberAttributes.cpp | 138 +- .../mx/core/elements/FigureNumberAttributes.h | 62 +- .../private/mx/core/elements/FiguredBass.cpp | 295 +- .../private/mx/core/elements/FiguredBass.h | 93 +- .../core/elements/FiguredBassAttributes.cpp | 202 +- .../mx/core/elements/FiguredBassAttributes.h | 86 +- .../private/mx/core/elements/Fingering.cpp | 141 +- .../private/mx/core/elements/Fingering.h | 81 +- .../mx/core/elements/FingeringAttributes.cpp | 170 +- .../mx/core/elements/FingeringAttributes.h | 74 +- .../private/mx/core/elements/Fingernails.cpp | 96 +- .../private/mx/core/elements/Fingernails.h | 61 +- .../private/mx/core/elements/FirstFret.cpp | 142 +- .../private/mx/core/elements/FirstFret.h | 81 +- .../mx/core/elements/FirstFretAttributes.cpp | 74 +- .../mx/core/elements/FirstFretAttributes.h | 38 +- .../private/mx/core/elements/Footnote.cpp | 141 +- .../private/mx/core/elements/Footnote.h | 81 +- .../mx/core/elements/FootnoteAttributes.cpp | 270 +- .../mx/core/elements/FootnoteAttributes.h | 106 +- .../private/mx/core/elements/Forward.cpp | 209 +- Sourcecode/private/mx/core/elements/Forward.h | 97 +- Sourcecode/private/mx/core/elements/Frame.cpp | 330 +- Sourcecode/private/mx/core/elements/Frame.h | 103 +- .../mx/core/elements/FrameAttributes.cpp | 156 +- .../mx/core/elements/FrameAttributes.h | 70 +- .../private/mx/core/elements/FrameFrets.cpp | 107 +- .../private/mx/core/elements/FrameFrets.h | 73 +- .../private/mx/core/elements/FrameNote.cpp | 273 +- .../private/mx/core/elements/FrameNote.h | 95 +- .../private/mx/core/elements/FrameStrings.cpp | 107 +- .../private/mx/core/elements/FrameStrings.h | 73 +- Sourcecode/private/mx/core/elements/Fret.cpp | 141 +- Sourcecode/private/mx/core/elements/Fret.h | 81 +- .../mx/core/elements/FretAttributes.cpp | 96 +- .../private/mx/core/elements/FretAttributes.h | 46 +- .../mx/core/elements/FullNoteGroup.cpp | 148 +- .../private/mx/core/elements/FullNoteGroup.h | 85 +- .../mx/core/elements/FullNoteTypeChoice.cpp | 225 +- .../mx/core/elements/FullNoteTypeChoice.h | 95 +- .../private/mx/core/elements/Function.cpp | 141 +- .../private/mx/core/elements/Function.h | 81 +- .../mx/core/elements/FunctionAttributes.cpp | 138 +- .../mx/core/elements/FunctionAttributes.h | 62 +- Sourcecode/private/mx/core/elements/Glass.cpp | 105 +- Sourcecode/private/mx/core/elements/Glass.h | 73 +- .../private/mx/core/elements/Glissando.cpp | 141 +- .../private/mx/core/elements/Glissando.h | 81 +- .../mx/core/elements/GlissandoAttributes.cpp | 200 +- .../mx/core/elements/GlissandoAttributes.h | 82 +- Sourcecode/private/mx/core/elements/Grace.cpp | 96 +- Sourcecode/private/mx/core/elements/Grace.h | 61 +- .../mx/core/elements/GraceAttributes.cpp | 96 +- .../mx/core/elements/GraceAttributes.h | 46 +- .../mx/core/elements/GraceNoteGroup.cpp | 197 +- .../private/mx/core/elements/GraceNoteGroup.h | 95 +- Sourcecode/private/mx/core/elements/Group.cpp | 107 +- Sourcecode/private/mx/core/elements/Group.h | 73 +- .../mx/core/elements/GroupAbbreviation.cpp | 142 +- .../mx/core/elements/GroupAbbreviation.h | 81 +- .../elements/GroupAbbreviationAttributes.cpp | 148 +- .../elements/GroupAbbreviationAttributes.h | 66 +- .../elements/GroupAbbreviationDisplay.cpp | 209 +- .../core/elements/GroupAbbreviationDisplay.h | 90 +- .../GroupAbbreviationDisplayAttributes.cpp | 66 +- .../GroupAbbreviationDisplayAttributes.h | 34 +- .../private/mx/core/elements/GroupBarline.cpp | 142 +- .../private/mx/core/elements/GroupBarline.h | 81 +- .../core/elements/GroupBarlineAttributes.cpp | 66 +- .../mx/core/elements/GroupBarlineAttributes.h | 34 +- .../private/mx/core/elements/GroupName.cpp | 141 +- .../private/mx/core/elements/GroupName.h | 81 +- .../mx/core/elements/GroupNameAttributes.cpp | 148 +- .../mx/core/elements/GroupNameAttributes.h | 66 +- .../mx/core/elements/GroupNameDisplay.cpp | 207 +- .../mx/core/elements/GroupNameDisplay.h | 84 +- .../elements/GroupNameDisplayAttributes.cpp | 66 +- .../elements/GroupNameDisplayAttributes.h | 34 +- .../private/mx/core/elements/GroupSymbol.cpp | 142 +- .../private/mx/core/elements/GroupSymbol.h | 81 +- .../core/elements/GroupSymbolAttributes.cpp | 94 +- .../mx/core/elements/GroupSymbolAttributes.h | 46 +- .../private/mx/core/elements/GroupTime.cpp | 57 +- .../private/mx/core/elements/GroupTime.h | 49 +- .../private/mx/core/elements/Grouping.cpp | 198 +- .../private/mx/core/elements/Grouping.h | 79 +- .../mx/core/elements/GroupingAttributes.cpp | 95 +- .../mx/core/elements/GroupingAttributes.h | 42 +- .../private/mx/core/elements/HammerOn.cpp | 141 +- .../private/mx/core/elements/HammerOn.h | 81 +- .../mx/core/elements/HammerOnAttributes.cpp | 180 +- .../mx/core/elements/HammerOnAttributes.h | 74 +- .../private/mx/core/elements/Handbell.cpp | 141 +- .../private/mx/core/elements/Handbell.h | 81 +- .../mx/core/elements/HandbellAttributes.cpp | 148 +- .../mx/core/elements/HandbellAttributes.h | 66 +- .../private/mx/core/elements/Harmonic.cpp | 267 +- .../private/mx/core/elements/Harmonic.h | 97 +- .../mx/core/elements/HarmonicAttributes.cpp | 169 +- .../mx/core/elements/HarmonicAttributes.h | 74 +- .../mx/core/elements/HarmonicInfoChoice.cpp | 209 +- .../mx/core/elements/HarmonicInfoChoice.h | 95 +- .../mx/core/elements/HarmonicTypeChoice.cpp | 155 +- .../mx/core/elements/HarmonicTypeChoice.h | 95 +- .../private/mx/core/elements/Harmony.cpp | 549 +- Sourcecode/private/mx/core/elements/Harmony.h | 149 +- .../mx/core/elements/HarmonyAttributes.cpp | 189 +- .../mx/core/elements/HarmonyAttributes.h | 82 +- .../mx/core/elements/HarmonyChordGroup.cpp | 369 +- .../mx/core/elements/HarmonyChordGroup.h | 157 +- .../private/mx/core/elements/HarpPedals.cpp | 195 +- .../private/mx/core/elements/HarpPedals.h | 79 +- .../mx/core/elements/HarpPedalsAttributes.cpp | 168 +- .../mx/core/elements/HarpPedalsAttributes.h | 74 +- Sourcecode/private/mx/core/elements/Heel.cpp | 98 +- Sourcecode/private/mx/core/elements/Heel.h | 61 +- .../mx/core/elements/HeelAttributes.cpp | 170 +- .../private/mx/core/elements/HeelAttributes.h | 74 +- Sourcecode/private/mx/core/elements/Hole.cpp | 260 +- Sourcecode/private/mx/core/elements/Hole.h | 93 +- .../mx/core/elements/HoleAttributes.cpp | 158 +- .../private/mx/core/elements/HoleAttributes.h | 70 +- .../private/mx/core/elements/HoleClosed.cpp | 140 +- .../private/mx/core/elements/HoleClosed.h | 81 +- .../mx/core/elements/HoleClosedAttributes.cpp | 67 +- .../mx/core/elements/HoleClosedAttributes.h | 34 +- .../private/mx/core/elements/HoleShape.cpp | 107 +- .../private/mx/core/elements/HoleShape.h | 73 +- .../private/mx/core/elements/HoleType.cpp | 107 +- .../private/mx/core/elements/HoleType.h | 73 +- .../private/mx/core/elements/Humming.cpp | 57 +- Sourcecode/private/mx/core/elements/Humming.h | 49 +- .../mx/core/elements/Identification.cpp | 480 +- .../private/mx/core/elements/Identification.h | 161 +- Sourcecode/private/mx/core/elements/Image.cpp | 96 +- Sourcecode/private/mx/core/elements/Image.h | 61 +- .../mx/core/elements/ImageAttributes.cpp | 148 +- .../mx/core/elements/ImageAttributes.h | 58 +- .../private/mx/core/elements/Instrument.cpp | 96 +- .../private/mx/core/elements/Instrument.h | 61 +- .../core/elements/InstrumentAbbreviation.cpp | 107 +- .../mx/core/elements/InstrumentAbbreviation.h | 73 +- .../mx/core/elements/InstrumentAttributes.cpp | 77 +- .../mx/core/elements/InstrumentAttributes.h | 34 +- .../mx/core/elements/InstrumentName.cpp | 107 +- .../private/mx/core/elements/InstrumentName.h | 73 +- .../mx/core/elements/InstrumentSound.cpp | 107 +- .../mx/core/elements/InstrumentSound.h | 65 +- .../private/mx/core/elements/Instruments.cpp | 107 +- .../private/mx/core/elements/Instruments.h | 73 +- .../mx/core/elements/Interchangeable.cpp | 248 +- .../mx/core/elements/Interchangeable.h | 87 +- .../elements/InterchangeableAttributes.cpp | 74 +- .../core/elements/InterchangeableAttributes.h | 38 +- .../private/mx/core/elements/Inversion.cpp | 142 +- .../private/mx/core/elements/Inversion.h | 81 +- .../mx/core/elements/InversionAttributes.cpp | 138 +- .../mx/core/elements/InversionAttributes.h | 62 +- .../mx/core/elements/InvertedMordent.cpp | 98 +- .../mx/core/elements/InvertedMordent.h | 61 +- .../elements/InvertedMordentAttributes.cpp | 271 +- .../core/elements/InvertedMordentAttributes.h | 110 +- .../private/mx/core/elements/InvertedTurn.cpp | 96 +- .../private/mx/core/elements/InvertedTurn.h | 61 +- .../core/elements/InvertedTurnAttributes.cpp | 239 +- .../mx/core/elements/InvertedTurnAttributes.h | 98 +- Sourcecode/private/mx/core/elements/Ipa.cpp | 107 +- Sourcecode/private/mx/core/elements/Ipa.h | 73 +- Sourcecode/private/mx/core/elements/Key.cpp | 438 +- Sourcecode/private/mx/core/elements/Key.h | 91 +- .../mx/core/elements/KeyAccidental.cpp | 105 +- .../private/mx/core/elements/KeyAccidental.h | 73 +- .../private/mx/core/elements/KeyAlter.cpp | 107 +- .../private/mx/core/elements/KeyAlter.h | 75 +- .../mx/core/elements/KeyAttributes.cpp | 168 +- .../private/mx/core/elements/KeyAttributes.h | 74 +- .../private/mx/core/elements/KeyChoice.cpp | 185 +- .../private/mx/core/elements/KeyChoice.h | 90 +- .../private/mx/core/elements/KeyOctave.cpp | 141 +- .../private/mx/core/elements/KeyOctave.h | 81 +- .../mx/core/elements/KeyOctaveAttributes.cpp | 86 +- .../mx/core/elements/KeyOctaveAttributes.h | 38 +- .../private/mx/core/elements/KeyStep.cpp | 107 +- Sourcecode/private/mx/core/elements/KeyStep.h | 73 +- Sourcecode/private/mx/core/elements/Kind.cpp | 141 +- Sourcecode/private/mx/core/elements/Kind.h | 81 +- .../mx/core/elements/KindAttributes.cpp | 204 +- .../private/mx/core/elements/KindAttributes.h | 86 +- .../private/mx/core/elements/Laughing.cpp | 57 +- .../private/mx/core/elements/Laughing.h | 49 +- .../private/mx/core/elements/LayoutGroup.cpp | 272 +- .../private/mx/core/elements/LayoutGroup.h | 93 +- .../private/mx/core/elements/LeftDivider.cpp | 96 +- .../private/mx/core/elements/LeftDivider.h | 55 +- .../private/mx/core/elements/LeftMargin.cpp | 107 +- .../private/mx/core/elements/LeftMargin.h | 75 +- Sourcecode/private/mx/core/elements/Level.cpp | 141 +- Sourcecode/private/mx/core/elements/Level.h | 81 +- .../mx/core/elements/LevelAttributes.cpp | 94 +- .../mx/core/elements/LevelAttributes.h | 46 +- Sourcecode/private/mx/core/elements/Line.cpp | 107 +- Sourcecode/private/mx/core/elements/Line.h | 73 +- .../private/mx/core/elements/LineWidth.cpp | 141 +- .../private/mx/core/elements/LineWidth.h | 83 +- .../mx/core/elements/LineWidthAttributes.cpp | 77 +- .../mx/core/elements/LineWidthAttributes.h | 34 +- Sourcecode/private/mx/core/elements/Link.cpp | 98 +- Sourcecode/private/mx/core/elements/Link.h | 61 +- .../mx/core/elements/LinkAttributes.cpp | 203 +- .../private/mx/core/elements/LinkAttributes.h | 82 +- Sourcecode/private/mx/core/elements/Lyric.cpp | 328 +- Sourcecode/private/mx/core/elements/Lyric.h | 103 +- .../mx/core/elements/LyricAttributes.cpp | 157 +- .../mx/core/elements/LyricAttributes.h | 70 +- .../private/mx/core/elements/LyricFont.cpp | 96 +- .../private/mx/core/elements/LyricFont.h | 61 +- .../mx/core/elements/LyricFontAttributes.cpp | 116 +- .../mx/core/elements/LyricFontAttributes.h | 54 +- .../mx/core/elements/LyricLanguage.cpp | 96 +- .../private/mx/core/elements/LyricLanguage.h | 61 +- .../core/elements/LyricLanguageAttributes.cpp | 99 +- .../core/elements/LyricLanguageAttributes.h | 42 +- .../mx/core/elements/LyricTextChoice.cpp | 246 +- .../mx/core/elements/LyricTextChoice.h | 103 +- .../mx/core/elements/MeasureAttributes.cpp | 108 +- .../mx/core/elements/MeasureAttributes.h | 46 +- .../mx/core/elements/MeasureDistance.cpp | 107 +- .../mx/core/elements/MeasureDistance.h | 75 +- .../mx/core/elements/MeasureLayout.cpp | 146 +- .../private/mx/core/elements/MeasureLayout.h | 71 +- .../mx/core/elements/MeasureNumbering.cpp | 143 +- .../mx/core/elements/MeasureNumbering.h | 81 +- .../elements/MeasureNumberingAttributes.cpp | 148 +- .../elements/MeasureNumberingAttributes.h | 66 +- .../mx/core/elements/MeasureRepeat.cpp | 142 +- .../private/mx/core/elements/MeasureRepeat.h | 81 +- .../core/elements/MeasureRepeatAttributes.cpp | 85 +- .../core/elements/MeasureRepeatAttributes.h | 38 +- .../private/mx/core/elements/MeasureStyle.cpp | 140 +- .../private/mx/core/elements/MeasureStyle.h | 69 +- .../core/elements/MeasureStyleAttributes.cpp | 116 +- .../mx/core/elements/MeasureStyleAttributes.h | 54 +- .../mx/core/elements/MeasureStyleChoice.cpp | 233 +- .../mx/core/elements/MeasureStyleChoice.h | 95 +- .../private/mx/core/elements/Membrane.cpp | 107 +- .../private/mx/core/elements/Membrane.h | 73 +- Sourcecode/private/mx/core/elements/Metal.cpp | 105 +- Sourcecode/private/mx/core/elements/Metal.h | 73 +- .../private/mx/core/elements/Metronome.cpp | 327 +- .../private/mx/core/elements/Metronome.h | 69 +- .../mx/core/elements/MetronomeAttributes.cpp | 190 +- .../mx/core/elements/MetronomeAttributes.h | 82 +- .../mx/core/elements/MetronomeBeam.cpp | 142 +- .../private/mx/core/elements/MetronomeBeam.h | 81 +- .../core/elements/MetronomeBeamAttributes.cpp | 66 +- .../core/elements/MetronomeBeamAttributes.h | 34 +- .../private/mx/core/elements/MetronomeDot.cpp | 57 +- .../private/mx/core/elements/MetronomeDot.h | 49 +- .../mx/core/elements/MetronomeNote.cpp | 335 +- .../private/mx/core/elements/MetronomeNote.h | 101 +- .../mx/core/elements/MetronomeRelation.cpp | 105 +- .../mx/core/elements/MetronomeRelation.h | 61 +- .../core/elements/MetronomeRelationGroup.cpp | 119 +- .../mx/core/elements/MetronomeRelationGroup.h | 77 +- .../mx/core/elements/MetronomeTuplet.cpp | 250 +- .../mx/core/elements/MetronomeTuplet.h | 88 +- .../elements/MetronomeTupletAttributes.cpp | 96 +- .../core/elements/MetronomeTupletAttributes.h | 42 +- .../mx/core/elements/MetronomeType.cpp | 105 +- .../private/mx/core/elements/MetronomeType.h | 73 +- .../private/mx/core/elements/MidiBank.cpp | 107 +- .../private/mx/core/elements/MidiBank.h | 73 +- .../private/mx/core/elements/MidiChannel.cpp | 107 +- .../private/mx/core/elements/MidiChannel.h | 73 +- .../private/mx/core/elements/MidiDevice.cpp | 141 +- .../private/mx/core/elements/MidiDevice.h | 81 +- .../mx/core/elements/MidiDeviceAttributes.cpp | 74 +- .../mx/core/elements/MidiDeviceAttributes.h | 38 +- .../elements/MidiDeviceInstrumentGroup.cpp | 180 +- .../core/elements/MidiDeviceInstrumentGroup.h | 89 +- .../mx/core/elements/MidiInstrument.cpp | 577 +- .../private/mx/core/elements/MidiInstrument.h | 205 +- .../elements/MidiInstrumentAttributes.cpp | 77 +- .../core/elements/MidiInstrumentAttributes.h | 34 +- .../private/mx/core/elements/MidiName.cpp | 107 +- .../private/mx/core/elements/MidiName.h | 71 +- .../private/mx/core/elements/MidiProgram.cpp | 107 +- .../private/mx/core/elements/MidiProgram.h | 73 +- .../mx/core/elements/MidiUnpitched.cpp | 107 +- .../private/mx/core/elements/MidiUnpitched.h | 73 +- .../private/mx/core/elements/Millimeters.cpp | 107 +- .../private/mx/core/elements/Millimeters.h | 75 +- .../mx/core/elements/Miscellaneous.cpp | 175 +- .../private/mx/core/elements/Miscellaneous.h | 71 +- .../mx/core/elements/MiscellaneousField.cpp | 142 +- .../mx/core/elements/MiscellaneousField.h | 81 +- .../elements/MiscellaneousFieldAttributes.cpp | 77 +- .../elements/MiscellaneousFieldAttributes.h | 34 +- Sourcecode/private/mx/core/elements/Mode.cpp | 107 +- Sourcecode/private/mx/core/elements/Mode.h | 73 +- .../private/mx/core/elements/Mordent.cpp | 98 +- Sourcecode/private/mx/core/elements/Mordent.h | 61 +- .../mx/core/elements/MordentAttributes.cpp | 270 +- .../mx/core/elements/MordentAttributes.h | 110 +- .../mx/core/elements/MovementNumber.cpp | 107 +- .../private/mx/core/elements/MovementNumber.h | 73 +- .../mx/core/elements/MovementTitle.cpp | 107 +- .../private/mx/core/elements/MovementTitle.h | 73 +- .../private/mx/core/elements/MultipleRest.cpp | 142 +- .../private/mx/core/elements/MultipleRest.h | 81 +- .../core/elements/MultipleRestAttributes.cpp | 66 +- .../mx/core/elements/MultipleRestAttributes.h | 34 +- .../mx/core/elements/MusicDataChoice.cpp | 613 +- .../mx/core/elements/MusicDataChoice.h | 251 +- .../mx/core/elements/MusicDataGroup.cpp | 142 +- .../private/mx/core/elements/MusicDataGroup.h | 71 +- .../private/mx/core/elements/MusicFont.cpp | 96 +- .../private/mx/core/elements/MusicFont.h | 61 +- Sourcecode/private/mx/core/elements/Mute.cpp | 105 +- Sourcecode/private/mx/core/elements/Mute.h | 73 +- .../private/mx/core/elements/Natural.cpp | 57 +- Sourcecode/private/mx/core/elements/Natural.h | 49 +- .../mx/core/elements/NonArpeggiate.cpp | 96 +- .../private/mx/core/elements/NonArpeggiate.h | 61 +- .../core/elements/NonArpeggiateAttributes.cpp | 136 +- .../core/elements/NonArpeggiateAttributes.h | 58 +- .../mx/core/elements/NonTraditionalKey.cpp | 225 +- .../mx/core/elements/NonTraditionalKey.h | 83 +- .../private/mx/core/elements/NormalDot.cpp | 57 +- .../private/mx/core/elements/NormalDot.h | 49 +- .../mx/core/elements/NormalNoteGroup.cpp | 192 +- .../mx/core/elements/NormalNoteGroup.h | 95 +- .../private/mx/core/elements/NormalNotes.cpp | 107 +- .../private/mx/core/elements/NormalNotes.h | 73 +- .../private/mx/core/elements/NormalType.cpp | 105 +- .../private/mx/core/elements/NormalType.h | 73 +- .../elements/NormalTypeNormalDotGroup.cpp | 217 +- .../core/elements/NormalTypeNormalDotGroup.h | 83 +- .../private/mx/core/elements/Notations.cpp | 429 +- .../private/mx/core/elements/Notations.h | 91 +- .../mx/core/elements/NotationsAttributes.cpp | 66 +- .../mx/core/elements/NotationsAttributes.h | 34 +- .../mx/core/elements/NotationsChoice.cpp | 531 +- .../mx/core/elements/NotationsChoice.h | 263 +- Sourcecode/private/mx/core/elements/Note.cpp | 1500 +- Sourcecode/private/mx/core/elements/Note.h | 349 +- .../mx/core/elements/NoteAttributes.cpp | 260 +- .../private/mx/core/elements/NoteAttributes.h | 106 +- .../private/mx/core/elements/NoteChoice.cpp | 184 +- .../private/mx/core/elements/NoteChoice.h | 93 +- .../mx/core/elements/NoteRelationNote.cpp | 208 +- .../mx/core/elements/NoteRelationNote.h | 87 +- .../private/mx/core/elements/NoteSize.cpp | 142 +- .../private/mx/core/elements/NoteSize.h | 83 +- .../mx/core/elements/NoteSizeAttributes.cpp | 77 +- .../mx/core/elements/NoteSizeAttributes.h | 34 +- .../private/mx/core/elements/Notehead.cpp | 141 +- .../private/mx/core/elements/Notehead.h | 81 +- .../mx/core/elements/NoteheadAttributes.cpp | 125 +- .../mx/core/elements/NoteheadAttributes.h | 58 +- .../private/mx/core/elements/NoteheadText.cpp | 200 +- .../private/mx/core/elements/NoteheadText.h | 75 +- .../mx/core/elements/NoteheadTextChoice.cpp | 215 +- .../mx/core/elements/NoteheadTextChoice.h | 98 +- .../private/mx/core/elements/Octave.cpp | 107 +- Sourcecode/private/mx/core/elements/Octave.h | 73 +- .../private/mx/core/elements/OctaveChange.cpp | 105 +- .../private/mx/core/elements/OctaveChange.h | 73 +- .../private/mx/core/elements/OctaveShift.cpp | 96 +- .../private/mx/core/elements/OctaveShift.h | 61 +- .../core/elements/OctaveShiftAttributes.cpp | 200 +- .../mx/core/elements/OctaveShiftAttributes.h | 82 +- .../private/mx/core/elements/Offset.cpp | 141 +- Sourcecode/private/mx/core/elements/Offset.h | 83 +- .../mx/core/elements/OffsetAttributes.cpp | 66 +- .../mx/core/elements/OffsetAttributes.h | 34 +- .../private/mx/core/elements/OpenString.cpp | 96 +- .../private/mx/core/elements/OpenString.h | 61 +- Sourcecode/private/mx/core/elements/Opus.cpp | 96 +- Sourcecode/private/mx/core/elements/Opus.h | 61 +- .../mx/core/elements/OpusAttributes.cpp | 130 +- .../private/mx/core/elements/OpusAttributes.h | 54 +- .../private/mx/core/elements/Ornaments.cpp | 295 +- .../private/mx/core/elements/Ornaments.h | 94 +- .../mx/core/elements/OrnamentsChoice.cpp | 731 +- .../mx/core/elements/OrnamentsChoice.h | 249 +- .../mx/core/elements/OtherAppearance.cpp | 142 +- .../mx/core/elements/OtherAppearance.h | 81 +- .../elements/OtherAppearanceAttributes.cpp | 77 +- .../core/elements/OtherAppearanceAttributes.h | 34 +- .../mx/core/elements/OtherArticulation.cpp | 142 +- .../mx/core/elements/OtherArticulation.h | 81 +- .../elements/OtherArticulationAttributes.cpp | 148 +- .../elements/OtherArticulationAttributes.h | 66 +- .../mx/core/elements/OtherDirection.cpp | 142 +- .../private/mx/core/elements/OtherDirection.h | 81 +- .../elements/OtherDirectionAttributes.cpp | 158 +- .../core/elements/OtherDirectionAttributes.h | 70 +- .../mx/core/elements/OtherNotation.cpp | 142 +- .../private/mx/core/elements/OtherNotation.h | 81 +- .../core/elements/OtherNotationAttributes.cpp | 190 +- .../core/elements/OtherNotationAttributes.h | 78 +- .../mx/core/elements/OtherOrnament.cpp | 142 +- .../private/mx/core/elements/OtherOrnament.h | 81 +- .../core/elements/OtherOrnamentAttributes.cpp | 148 +- .../core/elements/OtherOrnamentAttributes.h | 66 +- .../mx/core/elements/OtherPercussion.cpp | 107 +- .../mx/core/elements/OtherPercussion.h | 73 +- .../private/mx/core/elements/OtherPlay.cpp | 141 +- .../private/mx/core/elements/OtherPlay.h | 81 +- .../mx/core/elements/OtherPlayAttributes.cpp | 77 +- .../mx/core/elements/OtherPlayAttributes.h | 34 +- .../mx/core/elements/OtherTechnical.cpp | 142 +- .../private/mx/core/elements/OtherTechnical.h | 81 +- .../elements/OtherTechnicalAttributes.cpp | 148 +- .../core/elements/OtherTechnicalAttributes.h | 66 +- .../private/mx/core/elements/PageHeight.cpp | 107 +- .../private/mx/core/elements/PageHeight.h | 75 +- .../private/mx/core/elements/PageLayout.cpp | 241 +- .../private/mx/core/elements/PageLayout.h | 95 +- .../private/mx/core/elements/PageMargins.cpp | 274 +- .../private/mx/core/elements/PageMargins.h | 91 +- .../core/elements/PageMarginsAttributes.cpp | 66 +- .../mx/core/elements/PageMarginsAttributes.h | 34 +- .../private/mx/core/elements/PageWidth.cpp | 107 +- .../private/mx/core/elements/PageWidth.h | 75 +- Sourcecode/private/mx/core/elements/Pan.cpp | 107 +- Sourcecode/private/mx/core/elements/Pan.h | 75 +- .../mx/core/elements/PartAbbreviation.cpp | 142 +- .../mx/core/elements/PartAbbreviation.h | 81 +- .../elements/PartAbbreviationAttributes.cpp | 159 +- .../elements/PartAbbreviationAttributes.h | 70 +- .../core/elements/PartAbbreviationDisplay.cpp | 215 +- .../core/elements/PartAbbreviationDisplay.h | 82 +- .../PartAbbreviationDisplayAttributes.cpp | 66 +- .../PartAbbreviationDisplayAttributes.h | 34 +- .../mx/core/elements/PartAttributes.cpp | 77 +- .../private/mx/core/elements/PartAttributes.h | 34 +- .../private/mx/core/elements/PartGroup.cpp | 527 +- .../private/mx/core/elements/PartGroup.h | 199 +- .../mx/core/elements/PartGroupAttributes.cpp | 86 +- .../mx/core/elements/PartGroupAttributes.h | 38 +- .../mx/core/elements/PartGroupOrScorePart.cpp | 157 +- .../mx/core/elements/PartGroupOrScorePart.h | 95 +- .../private/mx/core/elements/PartList.cpp | 316 +- .../private/mx/core/elements/PartList.h | 87 +- .../private/mx/core/elements/PartName.cpp | 141 +- .../private/mx/core/elements/PartName.h | 81 +- .../mx/core/elements/PartNameAttributes.cpp | 169 +- .../mx/core/elements/PartNameAttributes.h | 74 +- .../mx/core/elements/PartNameDisplay.cpp | 213 +- .../mx/core/elements/PartNameDisplay.h | 82 +- .../elements/PartNameDisplayAttributes.cpp | 66 +- .../core/elements/PartNameDisplayAttributes.h | 34 +- .../private/mx/core/elements/PartSymbol.cpp | 142 +- .../private/mx/core/elements/PartSymbol.h | 81 +- .../mx/core/elements/PartSymbolAttributes.cpp | 114 +- .../mx/core/elements/PartSymbolAttributes.h | 54 +- .../mx/core/elements/PartwiseMeasure.cpp | 335 +- .../mx/core/elements/PartwiseMeasure.h | 75 +- .../private/mx/core/elements/PartwisePart.cpp | 226 +- .../private/mx/core/elements/PartwisePart.h | 79 +- Sourcecode/private/mx/core/elements/Pedal.cpp | 96 +- Sourcecode/private/mx/core/elements/Pedal.h | 61 +- .../private/mx/core/elements/PedalAlter.cpp | 107 +- .../private/mx/core/elements/PedalAlter.h | 75 +- .../mx/core/elements/PedalAttributes.cpp | 190 +- .../mx/core/elements/PedalAttributes.h | 78 +- .../private/mx/core/elements/PedalStep.cpp | 105 +- .../private/mx/core/elements/PedalStep.h | 73 +- .../private/mx/core/elements/PedalTuning.cpp | 161 +- .../private/mx/core/elements/PedalTuning.h | 77 +- .../private/mx/core/elements/PerMinute.cpp | 141 +- .../private/mx/core/elements/PerMinute.h | 81 +- .../mx/core/elements/PerMinuteAttributes.cpp | 96 +- .../mx/core/elements/PerMinuteAttributes.h | 46 +- .../elements/PerMinuteOrBeatUnitChoice.cpp | 172 +- .../core/elements/PerMinuteOrBeatUnitChoice.h | 83 +- .../private/mx/core/elements/Percussion.cpp | 133 +- .../private/mx/core/elements/Percussion.h | 69 +- .../mx/core/elements/PercussionAttributes.cpp | 180 +- .../mx/core/elements/PercussionAttributes.h | 78 +- .../mx/core/elements/PercussionChoice.cpp | 737 +- .../mx/core/elements/PercussionChoice.h | 245 +- Sourcecode/private/mx/core/elements/Pitch.cpp | 218 +- Sourcecode/private/mx/core/elements/Pitch.h | 95 +- .../private/mx/core/elements/Pitched.cpp | 107 +- Sourcecode/private/mx/core/elements/Pitched.h | 73 +- Sourcecode/private/mx/core/elements/Play.cpp | 341 +- Sourcecode/private/mx/core/elements/Play.h | 114 +- .../mx/core/elements/PlayAttributes.cpp | 66 +- .../private/mx/core/elements/PlayAttributes.h | 34 +- Sourcecode/private/mx/core/elements/Plop.cpp | 96 +- Sourcecode/private/mx/core/elements/Plop.h | 61 +- Sourcecode/private/mx/core/elements/Pluck.cpp | 141 +- Sourcecode/private/mx/core/elements/Pluck.h | 81 +- .../mx/core/elements/PluckAttributes.cpp | 148 +- .../mx/core/elements/PluckAttributes.h | 66 +- .../private/mx/core/elements/PreBend.cpp | 57 +- Sourcecode/private/mx/core/elements/PreBend.h | 49 +- .../private/mx/core/elements/Prefix.cpp | 141 +- Sourcecode/private/mx/core/elements/Prefix.h | 81 +- .../mx/core/elements/PrefixAttributes.cpp | 138 +- .../mx/core/elements/PrefixAttributes.h | 62 +- .../mx/core/elements/PrincipalVoice.cpp | 142 +- .../private/mx/core/elements/PrincipalVoice.h | 81 +- .../elements/PrincipalVoiceAttributes.cpp | 193 +- .../core/elements/PrincipalVoiceAttributes.h | 74 +- Sourcecode/private/mx/core/elements/Print.cpp | 370 +- Sourcecode/private/mx/core/elements/Print.h | 127 +- .../mx/core/elements/PrintAttributes.cpp | 104 +- .../mx/core/elements/PrintAttributes.h | 50 +- .../private/mx/core/elements/Properties.cpp | 876 +- .../private/mx/core/elements/Properties.h | 263 +- .../private/mx/core/elements/PullOff.cpp | 141 +- Sourcecode/private/mx/core/elements/PullOff.h | 81 +- .../mx/core/elements/PullOffAttributes.cpp | 180 +- .../mx/core/elements/PullOffAttributes.h | 74 +- .../private/mx/core/elements/Rehearsal.cpp | 141 +- .../private/mx/core/elements/Rehearsal.h | 81 +- .../mx/core/elements/RehearsalAttributes.cpp | 270 +- .../mx/core/elements/RehearsalAttributes.h | 106 +- .../private/mx/core/elements/Relation.cpp | 141 +- .../private/mx/core/elements/Relation.h | 81 +- .../mx/core/elements/RelationAttributes.cpp | 66 +- .../mx/core/elements/RelationAttributes.h | 34 +- .../private/mx/core/elements/Release.cpp | 57 +- Sourcecode/private/mx/core/elements/Release.h | 49 +- .../private/mx/core/elements/Repeat.cpp | 96 +- Sourcecode/private/mx/core/elements/Repeat.h | 61 +- .../mx/core/elements/RepeatAttributes.cpp | 96 +- .../mx/core/elements/RepeatAttributes.h | 42 +- Sourcecode/private/mx/core/elements/Rest.cpp | 172 +- Sourcecode/private/mx/core/elements/Rest.h | 79 +- .../mx/core/elements/RestAttributes.cpp | 66 +- .../private/mx/core/elements/RestAttributes.h | 34 +- .../private/mx/core/elements/RightDivider.cpp | 97 +- .../private/mx/core/elements/RightDivider.h | 55 +- .../private/mx/core/elements/RightMargin.cpp | 107 +- .../private/mx/core/elements/RightMargin.h | 75 +- .../private/mx/core/elements/Rights.cpp | 141 +- Sourcecode/private/mx/core/elements/Rights.h | 81 +- .../mx/core/elements/RightsAttributes.cpp | 66 +- .../mx/core/elements/RightsAttributes.h | 34 +- Sourcecode/private/mx/core/elements/Root.cpp | 176 +- Sourcecode/private/mx/core/elements/Root.h | 83 +- .../private/mx/core/elements/RootAlter.cpp | 141 +- .../private/mx/core/elements/RootAlter.h | 83 +- .../mx/core/elements/RootAlterAttributes.cpp | 158 +- .../mx/core/elements/RootAlterAttributes.h | 70 +- .../private/mx/core/elements/RootStep.cpp | 141 +- .../private/mx/core/elements/RootStep.h | 81 +- .../mx/core/elements/RootStepAttributes.cpp | 148 +- .../mx/core/elements/RootStepAttributes.h | 66 +- .../private/mx/core/elements/Scaling.cpp | 161 +- Sourcecode/private/mx/core/elements/Scaling.h | 77 +- .../private/mx/core/elements/Schleifer.cpp | 96 +- .../private/mx/core/elements/Schleifer.h | 61 +- Sourcecode/private/mx/core/elements/Scoop.cpp | 96 +- Sourcecode/private/mx/core/elements/Scoop.h | 61 +- .../private/mx/core/elements/Scordatura.cpp | 168 +- .../private/mx/core/elements/Scordatura.h | 71 +- .../mx/core/elements/ScoreHeaderGroup.cpp | 562 +- .../mx/core/elements/ScoreHeaderGroup.h | 173 +- .../mx/core/elements/ScoreInstrument.cpp | 393 +- .../mx/core/elements/ScoreInstrument.h | 125 +- .../elements/ScoreInstrumentAttributes.cpp | 77 +- .../core/elements/ScoreInstrumentAttributes.h | 34 +- .../private/mx/core/elements/ScorePart.cpp | 679 +- .../private/mx/core/elements/ScorePart.h | 211 +- .../mx/core/elements/ScorePartAttributes.cpp | 77 +- .../mx/core/elements/ScorePartAttributes.h | 34 +- .../mx/core/elements/ScorePartwise.cpp | 262 +- .../private/mx/core/elements/ScorePartwise.h | 91 +- .../core/elements/ScorePartwiseAttributes.cpp | 70 +- .../core/elements/ScorePartwiseAttributes.h | 32 +- .../mx/core/elements/ScoreTimewise.cpp | 267 +- .../private/mx/core/elements/ScoreTimewise.h | 89 +- .../core/elements/ScoreTimewiseAttributes.cpp | 69 +- .../core/elements/ScoreTimewiseAttributes.h | 34 +- Sourcecode/private/mx/core/elements/Segno.cpp | 96 +- Sourcecode/private/mx/core/elements/Segno.h | 55 +- .../private/mx/core/elements/SemiPitched.cpp | 105 +- .../private/mx/core/elements/SemiPitched.h | 73 +- .../private/mx/core/elements/SenzaMisura.cpp | 107 +- .../private/mx/core/elements/SenzaMisura.h | 73 +- Sourcecode/private/mx/core/elements/Shake.cpp | 96 +- Sourcecode/private/mx/core/elements/Shake.h | 61 +- Sourcecode/private/mx/core/elements/Sign.cpp | 105 +- Sourcecode/private/mx/core/elements/Sign.h | 73 +- Sourcecode/private/mx/core/elements/Slash.cpp | 209 +- Sourcecode/private/mx/core/elements/Slash.h | 89 +- .../mx/core/elements/SlashAttributes.cpp | 95 +- .../mx/core/elements/SlashAttributes.h | 42 +- .../private/mx/core/elements/SlashDot.cpp | 57 +- .../private/mx/core/elements/SlashDot.h | 49 +- .../private/mx/core/elements/SlashType.cpp | 105 +- .../private/mx/core/elements/SlashType.h | 73 +- Sourcecode/private/mx/core/elements/Slide.cpp | 141 +- Sourcecode/private/mx/core/elements/Slide.h | 81 +- .../mx/core/elements/SlideAttributes.cpp | 248 +- .../mx/core/elements/SlideAttributes.h | 98 +- Sourcecode/private/mx/core/elements/Slur.cpp | 96 +- Sourcecode/private/mx/core/elements/Slur.h | 61 +- .../mx/core/elements/SlurAttributes.cpp | 257 +- .../private/mx/core/elements/SlurAttributes.h | 146 +- .../mx/core/elements/SnapPizzicato.cpp | 96 +- .../private/mx/core/elements/SnapPizzicato.h | 61 +- .../private/mx/core/elements/Software.cpp | 107 +- .../private/mx/core/elements/Software.h | 73 +- Sourcecode/private/mx/core/elements/Solo.cpp | 57 +- Sourcecode/private/mx/core/elements/Solo.h | 49 +- .../mx/core/elements/SoloOrEnsembleChoice.cpp | 160 +- .../mx/core/elements/SoloOrEnsembleChoice.h | 95 +- Sourcecode/private/mx/core/elements/Sound.cpp | 291 +- Sourcecode/private/mx/core/elements/Sound.h | 99 +- .../mx/core/elements/SoundAttributes.cpp | 237 +- .../mx/core/elements/SoundAttributes.h | 98 +- .../mx/core/elements/SoundingPitch.cpp | 57 +- .../private/mx/core/elements/SoundingPitch.h | 49 +- .../private/mx/core/elements/Source.cpp | 107 +- Sourcecode/private/mx/core/elements/Source.h | 73 +- .../private/mx/core/elements/Spiccato.cpp | 96 +- .../private/mx/core/elements/Spiccato.h | 61 +- .../mx/core/elements/Staccatissimo.cpp | 96 +- .../private/mx/core/elements/Staccatissimo.h | 61 +- .../private/mx/core/elements/Staccato.cpp | 96 +- .../private/mx/core/elements/Staccato.h | 61 +- Sourcecode/private/mx/core/elements/Staff.cpp | 107 +- Sourcecode/private/mx/core/elements/Staff.h | 73 +- .../private/mx/core/elements/StaffDetails.cpp | 408 +- .../private/mx/core/elements/StaffDetails.h | 133 +- .../core/elements/StaffDetailsAttributes.cpp | 95 +- .../mx/core/elements/StaffDetailsAttributes.h | 46 +- .../mx/core/elements/StaffDistance.cpp | 107 +- .../private/mx/core/elements/StaffDistance.h | 75 +- .../private/mx/core/elements/StaffLayout.cpp | 173 +- .../private/mx/core/elements/StaffLayout.h | 79 +- .../core/elements/StaffLayoutAttributes.cpp | 66 +- .../mx/core/elements/StaffLayoutAttributes.h | 34 +- .../private/mx/core/elements/StaffLines.cpp | 107 +- .../private/mx/core/elements/StaffLines.h | 73 +- .../private/mx/core/elements/StaffSize.cpp | 107 +- .../private/mx/core/elements/StaffSize.h | 75 +- .../private/mx/core/elements/StaffTuning.cpp | 246 +- .../private/mx/core/elements/StaffTuning.h | 87 +- .../core/elements/StaffTuningAttributes.cpp | 66 +- .../mx/core/elements/StaffTuningAttributes.h | 34 +- .../private/mx/core/elements/StaffType.cpp | 107 +- .../private/mx/core/elements/StaffType.h | 73 +- .../private/mx/core/elements/Staves.cpp | 107 +- Sourcecode/private/mx/core/elements/Staves.h | 73 +- Sourcecode/private/mx/core/elements/Stem.cpp | 141 +- Sourcecode/private/mx/core/elements/Stem.h | 81 +- .../mx/core/elements/StemAttributes.cpp | 94 +- .../private/mx/core/elements/StemAttributes.h | 46 +- Sourcecode/private/mx/core/elements/Step.cpp | 105 +- Sourcecode/private/mx/core/elements/Step.h | 73 +- Sourcecode/private/mx/core/elements/Stick.cpp | 190 +- Sourcecode/private/mx/core/elements/Stick.h | 85 +- .../mx/core/elements/StickAttributes.cpp | 66 +- .../mx/core/elements/StickAttributes.h | 34 +- .../mx/core/elements/StickLocation.cpp | 105 +- .../private/mx/core/elements/StickLocation.h | 73 +- .../mx/core/elements/StickMaterial.cpp | 105 +- .../private/mx/core/elements/StickMaterial.h | 73 +- .../private/mx/core/elements/StickType.cpp | 105 +- .../private/mx/core/elements/StickType.h | 73 +- .../private/mx/core/elements/Stopped.cpp | 96 +- Sourcecode/private/mx/core/elements/Stopped.h | 61 +- .../private/mx/core/elements/Stress.cpp | 96 +- Sourcecode/private/mx/core/elements/Stress.h | 61 +- .../private/mx/core/elements/String.cpp | 137 +- Sourcecode/private/mx/core/elements/String.h | 82 +- .../mx/core/elements/StringAttributes.cpp | 158 +- .../mx/core/elements/StringAttributes.h | 70 +- .../private/mx/core/elements/StringMute.cpp | 96 +- .../private/mx/core/elements/StringMute.h | 61 +- .../mx/core/elements/StringMuteAttributes.cpp | 169 +- .../mx/core/elements/StringMuteAttributes.h | 70 +- .../private/mx/core/elements/StrongAccent.cpp | 98 +- .../private/mx/core/elements/StrongAccent.h | 61 +- .../core/elements/StrongAccentAttributes.cpp | 169 +- .../mx/core/elements/StrongAccentAttributes.h | 74 +- .../private/mx/core/elements/Suffix.cpp | 141 +- Sourcecode/private/mx/core/elements/Suffix.h | 81 +- .../mx/core/elements/SuffixAttributes.cpp | 138 +- .../mx/core/elements/SuffixAttributes.h | 62 +- .../private/mx/core/elements/Supports.cpp | 96 +- .../private/mx/core/elements/Supports.h | 61 +- .../mx/core/elements/SupportsAttributes.cpp | 117 +- .../mx/core/elements/SupportsAttributes.h | 46 +- .../private/mx/core/elements/Syllabic.cpp | 107 +- .../private/mx/core/elements/Syllabic.h | 73 +- .../mx/core/elements/SyllabicTextGroup.cpp | 279 +- .../mx/core/elements/SyllabicTextGroup.h | 102 +- .../mx/core/elements/SystemDistance.cpp | 105 +- .../private/mx/core/elements/SystemDistance.h | 75 +- .../mx/core/elements/SystemDividers.cpp | 163 +- .../private/mx/core/elements/SystemDividers.h | 77 +- .../private/mx/core/elements/SystemLayout.cpp | 315 +- .../private/mx/core/elements/SystemLayout.h | 105 +- .../mx/core/elements/SystemMargins.cpp | 163 +- .../private/mx/core/elements/SystemMargins.h | 77 +- Sourcecode/private/mx/core/elements/Tap.cpp | 141 +- Sourcecode/private/mx/core/elements/Tap.h | 81 +- .../mx/core/elements/TapAttributes.cpp | 148 +- .../private/mx/core/elements/TapAttributes.h | 66 +- .../private/mx/core/elements/Technical.cpp | 498 +- .../private/mx/core/elements/Technical.h | 71 +- .../mx/core/elements/TechnicalChoice.cpp | 914 +- .../mx/core/elements/TechnicalChoice.h | 403 +- .../private/mx/core/elements/Tenths.cpp | 107 +- Sourcecode/private/mx/core/elements/Tenths.h | 75 +- .../private/mx/core/elements/Tenuto.cpp | 96 +- Sourcecode/private/mx/core/elements/Tenuto.h | 61 +- Sourcecode/private/mx/core/elements/Text.cpp | 141 +- Sourcecode/private/mx/core/elements/Text.h | 81 +- .../mx/core/elements/TextAttributes.cpp | 164 +- .../private/mx/core/elements/TextAttributes.h | 70 +- .../mx/core/elements/ThumbPosition.cpp | 96 +- .../private/mx/core/elements/ThumbPosition.h | 61 +- Sourcecode/private/mx/core/elements/Tie.cpp | 96 +- Sourcecode/private/mx/core/elements/Tie.h | 61 +- .../mx/core/elements/TieAttributes.cpp | 85 +- .../private/mx/core/elements/TieAttributes.h | 38 +- Sourcecode/private/mx/core/elements/Tied.cpp | 96 +- Sourcecode/private/mx/core/elements/Tied.h | 61 +- .../mx/core/elements/TiedAttributes.cpp | 259 +- .../private/mx/core/elements/TiedAttributes.h | 104 +- Sourcecode/private/mx/core/elements/Time.cpp | 167 +- Sourcecode/private/mx/core/elements/Time.h | 69 +- .../mx/core/elements/TimeAttributes.cpp | 212 +- .../private/mx/core/elements/TimeAttributes.h | 90 +- .../private/mx/core/elements/TimeChoice.cpp | 210 +- .../private/mx/core/elements/TimeChoice.h | 97 +- .../mx/core/elements/TimeModification.cpp | 238 +- .../mx/core/elements/TimeModification.h | 95 +- .../TimeModificationNormalTypeNormalDot.cpp | 196 +- .../TimeModificationNormalTypeNormalDot.h | 83 +- .../private/mx/core/elements/TimeRelation.cpp | 105 +- .../private/mx/core/elements/TimeRelation.h | 73 +- .../mx/core/elements/TimeSignatureGroup.cpp | 175 +- .../mx/core/elements/TimeSignatureGroup.h | 83 +- .../mx/core/elements/TimewiseMeasure.cpp | 235 +- .../mx/core/elements/TimewiseMeasure.h | 79 +- .../private/mx/core/elements/TimewisePart.cpp | 305 +- .../private/mx/core/elements/TimewisePart.h | 73 +- .../private/mx/core/elements/Timpani.cpp | 57 +- Sourcecode/private/mx/core/elements/Timpani.h | 49 +- Sourcecode/private/mx/core/elements/Toe.cpp | 98 +- Sourcecode/private/mx/core/elements/Toe.h | 61 +- .../mx/core/elements/ToeAttributes.cpp | 170 +- .../private/mx/core/elements/ToeAttributes.h | 74 +- .../private/mx/core/elements/TopMargin.cpp | 107 +- .../private/mx/core/elements/TopMargin.h | 75 +- .../mx/core/elements/TopSystemDistance.cpp | 107 +- .../mx/core/elements/TopSystemDistance.h | 75 +- .../mx/core/elements/TouchingPitch.cpp | 57 +- .../private/mx/core/elements/TouchingPitch.h | 49 +- .../mx/core/elements/TraditionalKey.cpp | 233 +- .../private/mx/core/elements/TraditionalKey.h | 89 +- .../private/mx/core/elements/Transpose.cpp | 316 +- .../private/mx/core/elements/Transpose.h | 109 +- .../mx/core/elements/TransposeAttributes.cpp | 66 +- .../mx/core/elements/TransposeAttributes.h | 34 +- .../private/mx/core/elements/Tremolo.cpp | 141 +- Sourcecode/private/mx/core/elements/Tremolo.h | 81 +- .../mx/core/elements/TremoloAttributes.cpp | 159 +- .../mx/core/elements/TremoloAttributes.h | 70 +- .../private/mx/core/elements/TrillMark.cpp | 96 +- .../private/mx/core/elements/TrillMark.h | 61 +- .../private/mx/core/elements/TripleTongue.cpp | 96 +- .../private/mx/core/elements/TripleTongue.h | 61 +- .../private/mx/core/elements/TuningAlter.cpp | 107 +- .../private/mx/core/elements/TuningAlter.h | 75 +- .../private/mx/core/elements/TuningOctave.cpp | 107 +- .../private/mx/core/elements/TuningOctave.h | 73 +- .../private/mx/core/elements/TuningStep.cpp | 105 +- .../private/mx/core/elements/TuningStep.h | 73 +- .../private/mx/core/elements/Tuplet.cpp | 228 +- Sourcecode/private/mx/core/elements/Tuplet.h | 97 +- .../private/mx/core/elements/TupletActual.cpp | 287 +- .../private/mx/core/elements/TupletActual.h | 91 +- .../mx/core/elements/TupletAttributes.cpp | 179 +- .../mx/core/elements/TupletAttributes.h | 74 +- .../private/mx/core/elements/TupletDot.cpp | 96 +- .../private/mx/core/elements/TupletDot.h | 61 +- .../mx/core/elements/TupletDotAttributes.cpp | 95 +- .../mx/core/elements/TupletDotAttributes.h | 46 +- .../private/mx/core/elements/TupletNormal.cpp | 287 +- .../private/mx/core/elements/TupletNormal.h | 91 +- .../private/mx/core/elements/TupletNumber.cpp | 142 +- .../private/mx/core/elements/TupletNumber.h | 81 +- .../core/elements/TupletNumberAttributes.cpp | 96 +- .../mx/core/elements/TupletNumberAttributes.h | 46 +- .../private/mx/core/elements/TupletType.cpp | 142 +- .../private/mx/core/elements/TupletType.h | 81 +- .../mx/core/elements/TupletTypeAttributes.cpp | 96 +- .../mx/core/elements/TupletTypeAttributes.h | 46 +- Sourcecode/private/mx/core/elements/Turn.cpp | 96 +- Sourcecode/private/mx/core/elements/Turn.h | 61 +- .../mx/core/elements/TurnAttributes.cpp | 239 +- .../private/mx/core/elements/TurnAttributes.h | 98 +- Sourcecode/private/mx/core/elements/Type.cpp | 141 +- Sourcecode/private/mx/core/elements/Type.h | 81 +- .../mx/core/elements/TypeAttributes.cpp | 66 +- .../private/mx/core/elements/TypeAttributes.h | 34 +- .../private/mx/core/elements/Unpitched.cpp | 143 +- .../private/mx/core/elements/Unpitched.h | 71 +- .../private/mx/core/elements/Unstress.cpp | 96 +- .../private/mx/core/elements/Unstress.h | 61 +- Sourcecode/private/mx/core/elements/UpBow.cpp | 96 +- Sourcecode/private/mx/core/elements/UpBow.h | 61 +- .../private/mx/core/elements/VerticalTurn.cpp | 96 +- .../private/mx/core/elements/VerticalTurn.h | 61 +- .../mx/core/elements/VirtualInstrument.cpp | 201 +- .../mx/core/elements/VirtualInstrument.h | 89 +- .../mx/core/elements/VirtualLibrary.cpp | 107 +- .../private/mx/core/elements/VirtualLibrary.h | 73 +- .../private/mx/core/elements/VirtualName.cpp | 107 +- .../private/mx/core/elements/VirtualName.h | 73 +- Sourcecode/private/mx/core/elements/Voice.cpp | 107 +- Sourcecode/private/mx/core/elements/Voice.h | 73 +- .../private/mx/core/elements/Volume.cpp | 105 +- Sourcecode/private/mx/core/elements/Volume.h | 75 +- .../private/mx/core/elements/WavyLine.cpp | 96 +- .../private/mx/core/elements/WavyLine.h | 61 +- .../mx/core/elements/WavyLineAttributes.cpp | 211 +- .../mx/core/elements/WavyLineAttributes.h | 86 +- Sourcecode/private/mx/core/elements/Wedge.cpp | 96 +- Sourcecode/private/mx/core/elements/Wedge.h | 61 +- .../mx/core/elements/WedgeAttributes.cpp | 178 +- .../mx/core/elements/WedgeAttributes.h | 74 +- .../private/mx/core/elements/WithBar.cpp | 141 +- Sourcecode/private/mx/core/elements/WithBar.h | 81 +- .../mx/core/elements/WithBarAttributes.cpp | 148 +- .../mx/core/elements/WithBarAttributes.h | 66 +- Sourcecode/private/mx/core/elements/Wood.cpp | 107 +- Sourcecode/private/mx/core/elements/Wood.h | 73 +- .../private/mx/core/elements/WordFont.cpp | 96 +- .../private/mx/core/elements/WordFont.h | 61 +- Sourcecode/private/mx/core/elements/Words.cpp | 141 +- Sourcecode/private/mx/core/elements/Words.h | 81 +- .../mx/core/elements/WordsAttributes.cpp | 270 +- .../mx/core/elements/WordsAttributes.h | 106 +- Sourcecode/private/mx/core/elements/Work.cpp | 256 +- Sourcecode/private/mx/core/elements/Work.h | 91 +- .../private/mx/core/elements/WorkNumber.cpp | 107 +- .../private/mx/core/elements/WorkNumber.h | 73 +- .../private/mx/core/elements/WorkTitle.cpp | 107 +- .../private/mx/core/elements/WorkTitle.h | 73 +- Sourcecode/private/mx/examples/Hide.cpp | 8 +- Sourcecode/private/mx/examples/Read.cpp | 32 +- Sourcecode/private/mx/examples/Write.cpp | 50 +- .../mx/ezxml/src/include/ezxml/XAttribute.h | 42 +- .../src/include/ezxml/XAttributeIterImpl.h | 33 +- .../src/include/ezxml/XAttributeIterator.h | 82 +- .../private/mx/ezxml/src/include/ezxml/XDoc.h | 82 +- .../mx/ezxml/src/include/ezxml/XDocSpec.h | 169 +- .../mx/ezxml/src/include/ezxml/XElement.h | 214 +- .../src/include/ezxml/XElementIterImpl.h | 48 +- .../src/include/ezxml/XElementIterator.h | 92 +- .../mx/ezxml/src/include/ezxml/XFactory.h | 14 +- .../ezxml/src/include/ezxml/XForwardDeclare.h | 12 +- .../mx/ezxml/src/private/private/Parse.h | 114 +- .../src/private/private/PugiAttribute.cpp | 83 +- .../ezxml/src/private/private/PugiAttribute.h | 69 +- .../private/private/PugiAttributeIterImpl.cpp | 172 +- .../private/private/PugiAttributeIterImpl.h | 71 +- .../mx/ezxml/src/private/private/PugiDoc.cpp | 875 +- .../mx/ezxml/src/private/private/PugiDoc.h | 108 +- .../ezxml/src/private/private/PugiElement.cpp | 504 +- .../ezxml/src/private/private/PugiElement.h | 102 +- .../private/private/PugiElementIterImpl.cpp | 326 +- .../src/private/private/PugiElementIterImpl.h | 78 +- .../mx/ezxml/src/private/private/Throw.h | 58 +- .../private/private/XAttributeIterator.cpp | 171 +- .../src/private/private/XElementIterator.cpp | 211 +- .../mx/ezxml/src/private/private/XFactory.cpp | 19 +- .../mx/ezxml/src/private/private/XThrow.h | 4 +- .../mx/impl/AccidentalMarkFunctions.cpp | 46 +- .../private/mx/impl/AccidentalMarkFunctions.h | 42 +- .../private/mx/impl/ArpeggiateFunctions.cpp | 59 +- .../private/mx/impl/ArpeggiateFunctions.h | 42 +- .../mx/impl/ArticulationsFunctions.cpp | 255 +- .../private/mx/impl/ArticulationsFunctions.h | 60 +- Sourcecode/private/mx/impl/Converter.cpp | 4112 ++-- Sourcecode/private/mx/impl/Converter.h | 325 +- Sourcecode/private/mx/impl/Cursor.cpp | 102 +- Sourcecode/private/mx/impl/Cursor.h | 87 +- Sourcecode/private/mx/impl/CurveFunctions.h | 583 +- .../private/mx/impl/DirectionReader.cpp | 1264 +- Sourcecode/private/mx/impl/DirectionReader.h | 158 +- .../private/mx/impl/DirectionWriter.cpp | 839 +- Sourcecode/private/mx/impl/DirectionWriter.h | 64 +- Sourcecode/private/mx/impl/DynamicsReader.cpp | 45 +- Sourcecode/private/mx/impl/DynamicsReader.h | 60 +- Sourcecode/private/mx/impl/DynamicsWriter.cpp | 67 +- Sourcecode/private/mx/impl/DynamicsWriter.h | 55 +- .../private/mx/impl/EncodingFunctions.cpp | 293 +- .../private/mx/impl/EncodingFunctions.h | 12 +- .../private/mx/impl/FermataFunctions.cpp | 162 +- Sourcecode/private/mx/impl/FermataFunctions.h | 42 +- Sourcecode/private/mx/impl/FontFunctions.h | 517 +- .../private/mx/impl/LayoutFunctions.cpp | 728 +- Sourcecode/private/mx/impl/LayoutFunctions.h | 58 +- Sourcecode/private/mx/impl/LcmGcd.cpp | 186 +- Sourcecode/private/mx/impl/LcmGcd.h | 70 +- Sourcecode/private/mx/impl/LineFunctions.h | 199 +- Sourcecode/private/mx/impl/LyricType.cpp | 25 +- Sourcecode/private/mx/impl/LyricType.h | 30 +- .../private/mx/impl/MarkDataFunctions.h | 32 +- Sourcecode/private/mx/impl/MeasureCursor.h | 40 +- Sourcecode/private/mx/impl/MeasureReader.cpp | 1450 +- Sourcecode/private/mx/impl/MeasureReader.h | 205 +- Sourcecode/private/mx/impl/MeasureWriter.cpp | 1149 +- Sourcecode/private/mx/impl/MeasureWriter.h | 435 +- .../private/mx/impl/MetronomeReader.cpp | 182 +- Sourcecode/private/mx/impl/MetronomeReader.h | 97 +- .../mx/impl/NonArpeggiateFunctions.cpp | 35 +- .../private/mx/impl/NonArpeggiateFunctions.h | 42 +- .../private/mx/impl/NotationsWriter.cpp | 1146 +- Sourcecode/private/mx/impl/NotationsWriter.h | 86 +- Sourcecode/private/mx/impl/NoteFunctions.cpp | 583 +- Sourcecode/private/mx/impl/NoteFunctions.h | 86 +- Sourcecode/private/mx/impl/NoteReader.cpp | 683 +- Sourcecode/private/mx/impl/NoteReader.h | 398 +- Sourcecode/private/mx/impl/NoteWriter.cpp | 891 +- Sourcecode/private/mx/impl/NoteWriter.h | 105 +- .../private/mx/impl/OrnamentsFunctions.cpp | 322 +- .../private/mx/impl/OrnamentsFunctions.h | 58 +- .../private/mx/impl/PageTextFunctions.cpp | 138 +- .../private/mx/impl/PageTextFunctions.h | 20 +- Sourcecode/private/mx/impl/PartReader.cpp | 583 +- Sourcecode/private/mx/impl/PartReader.h | 120 +- Sourcecode/private/mx/impl/PartWriter.cpp | 431 +- Sourcecode/private/mx/impl/PartWriter.h | 81 +- .../private/mx/impl/PositionFunctions.h | 373 +- Sourcecode/private/mx/impl/PrintFunctions.h | 215 +- .../private/mx/impl/PropertiesWriter.cpp | 453 +- Sourcecode/private/mx/impl/PropertiesWriter.h | 105 +- Sourcecode/private/mx/impl/ScoreReader.cpp | 953 +- Sourcecode/private/mx/impl/ScoreReader.h | 99 +- Sourcecode/private/mx/impl/ScoreWriter.cpp | 597 +- Sourcecode/private/mx/impl/ScoreWriter.h | 96 +- Sourcecode/private/mx/impl/SlideFunctions.cpp | 64 +- Sourcecode/private/mx/impl/SlideFunctions.h | 42 +- Sourcecode/private/mx/impl/SpannerFunctions.h | 101 +- Sourcecode/private/mx/impl/StaffFunctions.cpp | 195 +- Sourcecode/private/mx/impl/StaffFunctions.h | 10 +- .../private/mx/impl/TechnicalFunctions.cpp | 269 +- .../private/mx/impl/TechnicalFunctions.h | 52 +- Sourcecode/private/mx/impl/TimeReader.cpp | 272 +- Sourcecode/private/mx/impl/TimeReader.h | 87 +- Sourcecode/private/mx/impl/TupletReader.cpp | 297 +- Sourcecode/private/mx/impl/TupletReader.h | 48 +- Sourcecode/private/mx/utility/Enum.h | 35 +- .../private/mx/utility/EnumWithString.h | 36 +- Sourcecode/private/mx/utility/JitAllocate.h | 20 +- Sourcecode/private/mx/utility/Lock.h | 10 +- .../private/mx/utility/OptionalMembers.h | 182 +- Sourcecode/private/mx/utility/Parse.h | 134 +- Sourcecode/private/mx/utility/Round.h | 15 +- Sourcecode/private/mx/utility/StringToInt.h | 30 +- Sourcecode/private/mx/utility/Throw.h | 73 +- .../mxtest/api/ApiChordSimpleScoreData.h | 147 +- .../private/mxtest/api/ApiChordSimpleTest.cpp | 36 +- .../private/mxtest/api/ApiK007aScoreData.h | 189 +- .../private/mxtest/api/ApiK007aTest.cpp | 42 +- .../private/mxtest/api/ApiK007cScoreData.h | 196 +- .../private/mxtest/api/ApiK007cTest.cpp | 42 +- .../mxtest/api/ApiK009bSlurScoreData.h | 247 +- .../private/mxtest/api/ApiK009bSlurTest.cpp | 42 +- .../mxtest/api/ApiK014aFermatasScoreData.h | 474 +- .../mxtest/api/ApiK014aFermatasTest.cpp | 42 +- .../mxtest/api/ApiK015aLayoutScoreData.h | 125 +- .../private/mxtest/api/ApiK015aLayoutTest.cpp | 19 +- .../mxtest/api/ApiK016aMiscScoreData.h | 36 +- .../private/mxtest/api/ApiK016aMiscTest.cpp | 42 +- .../mxtest/api/ApiLoadSurvivalTest.cpp | 61 +- .../private/mxtest/api/ApiLy43eScoreData.h | 866 +- .../private/mxtest/api/ApiLy43eTest.cpp | 47 +- .../mxtest/api/ApiMuAccidentals1ScoreData.h | 242 +- .../mxtest/api/ApiMuAccidentals1Test.cpp | 42 +- Sourcecode/private/mxtest/api/ApiTester.cpp | 181 +- Sourcecode/private/mxtest/api/ApiTester.h | 37 +- Sourcecode/private/mxtest/api/BombeTest.cpp | 39 +- .../private/mxtest/api/ChordApiTest.cpp | 332 +- .../mxtest/api/ChordDataSaveAndLoadTest.cpp | 365 +- .../private/mxtest/api/ChordTimeTest.cpp | 117 +- .../private/mxtest/api/DirectionDataTest.cpp | 138 +- .../mxtest/api/DocumentManagerTest.cpp | 108 +- .../private/mxtest/api/FreezingRoundTrip.cpp | 581 +- .../private/mxtest/api/FreezingTest.cpp | 2 +- Sourcecode/private/mxtest/api/KeyDataTest.cpp | 382 +- .../private/mxtest/api/MeasureDataTest.cpp | 103 +- .../private/mxtest/api/MetronomeApiTest.cpp | 48 +- Sourcecode/private/mxtest/api/MxlTest.cpp | 29 +- .../private/mxtest/api/NewSystemTest.cpp | 152 +- .../private/mxtest/api/NoteDataTest.cpp | 961 +- .../private/mxtest/api/PageDataTest.cpp | 318 +- .../private/mxtest/api/PitchDataTest.cpp | 350 +- Sourcecode/private/mxtest/api/RoundTrip.h | 56 +- .../private/mxtest/api/ScoreDataCreator.h | 21 +- Sourcecode/private/mxtest/api/SlurTest.cpp | 62 +- Sourcecode/private/mxtest/api/TestHelpers.h | 45 +- .../mxtest/api/TimeSignatureApiTest.cpp | 36 +- .../private/mxtest/api/TranspositionTest.cpp | 989 +- Sourcecode/private/mxtest/core/AccentTest.cpp | 56 +- .../mxtest/core/AccidentalMarkTest.cpp | 56 +- .../private/mxtest/core/AccidentalTest.cpp | 56 +- .../mxtest/core/AccidentalTextTest.cpp | 57 +- Sourcecode/private/mxtest/core/AccordTest.cpp | 184 +- Sourcecode/private/mxtest/core/AccordTest.h | 8 +- .../private/mxtest/core/AccordionHighTest.cpp | 41 +- .../private/mxtest/core/AccordionLowTest.cpp | 47 +- .../mxtest/core/AccordionMiddleTest.cpp | 48 +- .../mxtest/core/AccordionRegistrationTest.cpp | 54 +- .../private/mxtest/core/ActualNotesTest.cpp | 48 +- Sourcecode/private/mxtest/core/AlterTest.cpp | 48 +- .../private/mxtest/core/AppearanceTest.cpp | 253 +- .../private/mxtest/core/AppearanceTest.h | 8 +- .../private/mxtest/core/ArpeggiateTest.cpp | 62 +- .../mxtest/core/ArrowDirectionTest.cpp | 48 +- .../private/mxtest/core/ArrowStyleTest.cpp | 48 +- Sourcecode/private/mxtest/core/ArrowTest.cpp | 182 +- Sourcecode/private/mxtest/core/ArrowTest.h | 8 +- .../private/mxtest/core/ArticulationsTest.cpp | 230 +- .../private/mxtest/core/ArticulationsTest.h | 10 +- .../private/mxtest/core/ArtificialTest.cpp | 41 +- Sourcecode/private/mxtest/core/BackupTest.cpp | 166 +- Sourcecode/private/mxtest/core/BackupTest.h | 8 +- .../private/mxtest/core/BarStyleTest.cpp | 58 +- .../private/mxtest/core/BarlineTest.cpp | 177 +- Sourcecode/private/mxtest/core/BarlineTest.h | 8 +- Sourcecode/private/mxtest/core/BarreTest.cpp | 56 +- .../private/mxtest/core/BasePitchTest.cpp | 41 +- .../private/mxtest/core/BassAlterTest.cpp | 56 +- .../private/mxtest/core/BassStepTest.cpp | 58 +- Sourcecode/private/mxtest/core/BassTest.cpp | 173 +- Sourcecode/private/mxtest/core/BassTest.h | 8 +- Sourcecode/private/mxtest/core/BeamTest.cpp | 58 +- .../private/mxtest/core/BeatRepeatTest.cpp | 59 +- .../private/mxtest/core/BeatTypeTest.cpp | 48 +- .../private/mxtest/core/BeatUnitDotTest.cpp | 40 +- .../private/mxtest/core/BeatUnitTest.cpp | 48 +- Sourcecode/private/mxtest/core/BeaterTest.cpp | 56 +- Sourcecode/private/mxtest/core/BeatsTest.cpp | 48 +- .../private/mxtest/core/BendAlterTest.cpp | 48 +- .../private/mxtest/core/BendChoiceTest.cpp | 156 +- .../private/mxtest/core/BendChoiceTest.h | 8 +- Sourcecode/private/mxtest/core/BendTest.cpp | 203 +- Sourcecode/private/mxtest/core/BendTest.h | 8 +- .../private/mxtest/core/BookmarkTest.cpp | 62 +- .../private/mxtest/core/BottomMarginTest.cpp | 48 +- .../private/mxtest/core/BracketTest.cpp | 36 +- .../private/mxtest/core/BreathMarkTest.cpp | 58 +- .../private/mxtest/core/CaesuraTest.cpp | 60 +- Sourcecode/private/mxtest/core/CancelTest.cpp | 56 +- Sourcecode/private/mxtest/core/CapoTest.cpp | 48 +- Sourcecode/private/mxtest/core/ChordTest.cpp | 40 +- .../private/mxtest/core/ChromaticTest.cpp | 48 +- .../private/mxtest/core/CircularArrowTest.cpp | 48 +- .../mxtest/core/ClefOctaveChangeTest.cpp | 48 +- Sourcecode/private/mxtest/core/ClefTest.cpp | 56 +- Sourcecode/private/mxtest/core/CodaTest.cpp | 58 +- Sourcecode/private/mxtest/core/ColorTest.cpp | 223 +- .../private/mxtest/core/CreatorTest.cpp | 58 +- .../private/mxtest/core/CreditChoiceTest.cpp | 166 +- .../private/mxtest/core/CreditChoiceTest.h | 8 +- .../private/mxtest/core/CreditImageTest.cpp | 63 +- Sourcecode/private/mxtest/core/CreditTest.cpp | 247 +- Sourcecode/private/mxtest/core/CreditTest.h | 8 +- .../private/mxtest/core/CreditTypeTest.cpp | 48 +- .../mxtest/core/CreditWordsGroupTest.cpp | 202 +- .../mxtest/core/CreditWordsGroupTest.h | 8 +- .../private/mxtest/core/CreditWordsTest.cpp | 57 +- .../private/mxtest/core/CueNoteGroupTest.cpp | 173 +- .../private/mxtest/core/CueNoteGroupTest.h | 8 +- Sourcecode/private/mxtest/core/CueTest.cpp | 41 +- .../private/mxtest/core/DampAllTest.cpp | 58 +- Sourcecode/private/mxtest/core/DampTest.cpp | 58 +- Sourcecode/private/mxtest/core/DashesTest.cpp | 62 +- Sourcecode/private/mxtest/core/DateTest.cpp | 8099 +++---- .../private/mxtest/core/DecimalsTest.cpp | 808 +- .../private/mxtest/core/DefaultsTest.cpp | 256 +- Sourcecode/private/mxtest/core/DefaultsTest.h | 8 +- .../private/mxtest/core/DegreeAlterTest.cpp | 56 +- Sourcecode/private/mxtest/core/DegreeTest.cpp | 184 +- Sourcecode/private/mxtest/core/DegreeTest.h | 8 +- .../private/mxtest/core/DegreeTypeTest.cpp | 58 +- .../private/mxtest/core/DegreeValueTest.cpp | 58 +- .../mxtest/core/DelayedInvertedTurnTest.cpp | 60 +- .../private/mxtest/core/DelayedTurnTest.cpp | 60 +- .../mxtest/core/DetachedLegatoTest.cpp | 59 +- .../private/mxtest/core/DiatonicTest.cpp | 48 +- .../private/mxtest/core/DirectionTest.cpp | 304 +- .../private/mxtest/core/DirectionTest.h | 10 +- .../private/mxtest/core/DirectionTypeTest.cpp | 181 +- .../private/mxtest/core/DirectionTypeTest.h | 8 +- .../private/mxtest/core/DirectiveTest.cpp | 47 +- .../private/mxtest/core/DisplayOctaveTest.cpp | 48 +- .../core/DisplayStepOctaveGroupTest.cpp | 160 +- .../mxtest/core/DisplayStepOctaveGroupTest.h | 8 +- .../private/mxtest/core/DisplayStepTest.cpp | 48 +- .../private/mxtest/core/DisplayTextTest.cpp | 58 +- .../private/mxtest/core/DistanceTest.cpp | 58 +- .../private/mxtest/core/DivisionsTest.cpp | 48 +- .../mxtest/core/DocumentHeaderTest.cpp | 151 +- .../private/mxtest/core/DocumentHeaderTest.h | 4 +- .../core/DocumentPartwiseConvertTest.cpp | 12 +- .../mxtest/core/DocumentPartwiseCreate.cpp | 668 +- .../mxtest/core/DocumentPartwiseCreate.h | 53 +- .../mxtest/core/DocumentPartwiseTest.cpp | 150 +- .../mxtest/core/DocumentPartwiseTest.h | 8 +- .../core/DocumentTimewiseConvertTest.cpp | 12 +- .../mxtest/core/DocumentTimewiseCreate.cpp | 343 +- .../mxtest/core/DocumentTimewiseCreate.h | 33 +- .../mxtest/core/DocumentTimewiseTest.cpp | 152 +- .../mxtest/core/DocumentTimewiseTest.h | 8 +- Sourcecode/private/mxtest/core/DoitTest.cpp | 58 +- Sourcecode/private/mxtest/core/DotTest.cpp | 58 +- Sourcecode/private/mxtest/core/DoubleTest.cpp | 40 +- .../private/mxtest/core/DoubleTongueTest.cpp | 59 +- .../private/mxtest/core/DownBowTest.cpp | 58 +- .../private/mxtest/core/DurationTest.cpp | 48 +- .../private/mxtest/core/DynamicsTest.cpp | 25 +- .../mxtest/core/EditorialGroupTest.cpp | 162 +- .../private/mxtest/core/EditorialGroupTest.h | 8 +- .../mxtest/core/EditorialVoiceGroupTest.cpp | 174 +- .../mxtest/core/EditorialVoiceGroupTest.h | 8 +- Sourcecode/private/mxtest/core/EffectTest.cpp | 48 +- .../private/mxtest/core/ElevationTest.cpp | 48 +- .../mxtest/core/ElisionSyllabicGroupTest.cpp | 166 +- .../mxtest/core/ElisionSyllabicGroupTest.h | 8 +- .../core/ElisionSyllabicTextGroupTest.cpp | 174 +- .../core/ElisionSyllabicTextGroupTest.h | 8 +- .../private/mxtest/core/ElisionTest.cpp | 58 +- .../private/mxtest/core/EncoderTest.cpp | 58 +- .../private/mxtest/core/EncodingDateTest.cpp | 48 +- .../mxtest/core/EncodingDescriptionTest.cpp | 48 +- .../private/mxtest/core/EncodingTest.cpp | 182 +- Sourcecode/private/mxtest/core/EncodingTest.h | 8 +- .../private/mxtest/core/EndLineTest.cpp | 40 +- .../private/mxtest/core/EndParagraphTest.cpp | 41 +- Sourcecode/private/mxtest/core/EndingTest.cpp | 56 +- .../private/mxtest/core/EnsembleTest.cpp | 48 +- Sourcecode/private/mxtest/core/EnumsTest.cpp | 18598 ++++++++-------- Sourcecode/private/mxtest/core/ExtendTest.cpp | 60 +- .../private/mxtest/core/EyeglassesTest.cpp | 59 +- .../private/mxtest/core/FalloffTest.cpp | 59 +- .../private/mxtest/core/FeatureTest.cpp | 58 +- .../private/mxtest/core/FermataTest.cpp | 56 +- Sourcecode/private/mxtest/core/FifthsTest.cpp | 48 +- .../private/mxtest/core/FigureNumberTest.cpp | 56 +- Sourcecode/private/mxtest/core/FigureTest.cpp | 184 +- Sourcecode/private/mxtest/core/FigureTest.h | 8 +- .../private/mxtest/core/FiguredBassTest.cpp | 212 +- .../private/mxtest/core/FiguredBassTest.h | 8 +- .../private/mxtest/core/FingeringTest.cpp | 59 +- .../private/mxtest/core/FingernailsTest.cpp | 58 +- .../private/mxtest/core/FirstFretTest.cpp | 58 +- .../private/mxtest/core/FontSizeTest.cpp | 85 +- .../private/mxtest/core/FootnoteTest.cpp | 56 +- .../private/mxtest/core/ForwardTest.cpp | 174 +- Sourcecode/private/mxtest/core/ForwardTest.h | 8 +- .../private/mxtest/core/FrameFretsTest.cpp | 48 +- .../private/mxtest/core/FrameNoteTest.cpp | 69 +- .../private/mxtest/core/FrameStringsTest.cpp | 48 +- Sourcecode/private/mxtest/core/FrameTest.cpp | 103 +- Sourcecode/private/mxtest/core/FretTest.cpp | 56 +- .../private/mxtest/core/FullNoteGroupTest.cpp | 152 +- .../private/mxtest/core/FullNoteGroupTest.h | 8 +- .../mxtest/core/FullNoteTypeChoiceTest.cpp | 152 +- .../mxtest/core/FullNoteTypeChoiceTest.h | 8 +- .../private/mxtest/core/FunctionTest.cpp | 58 +- Sourcecode/private/mxtest/core/GlassTest.cpp | 48 +- .../private/mxtest/core/GlissandoTest.cpp | 58 +- .../mxtest/core/GraceNoteGroupTest.cpp | 175 +- .../private/mxtest/core/GraceNoteGroupTest.h | 8 +- Sourcecode/private/mxtest/core/GraceTest.cpp | 63 +- .../core/GroupAbbreviationDisplayTest.cpp | 176 +- .../core/GroupAbbreviationDisplayTest.h | 8 +- .../mxtest/core/GroupAbbreviationTest.cpp | 56 +- .../private/mxtest/core/GroupBarlineTest.cpp | 58 +- .../mxtest/core/GroupNameDisplayTest.cpp | 177 +- .../mxtest/core/GroupNameDisplayTest.h | 8 +- .../private/mxtest/core/GroupNameTest.cpp | 62 +- .../private/mxtest/core/GroupSymbolTest.cpp | 63 +- Sourcecode/private/mxtest/core/GroupTest.cpp | 48 +- .../private/mxtest/core/GroupTimeTest.cpp | 40 +- .../private/mxtest/core/GroupingTest.cpp | 188 +- Sourcecode/private/mxtest/core/GroupingTest.h | 8 +- .../private/mxtest/core/HammerOnTest.cpp | 56 +- .../private/mxtest/core/HandbellTest.cpp | 58 +- .../mxtest/core/HarmonicInfoChoiceTest.cpp | 148 +- .../mxtest/core/HarmonicInfoChoiceTest.h | 8 +- .../private/mxtest/core/HarmonicTest.cpp | 190 +- Sourcecode/private/mxtest/core/HarmonicTest.h | 8 +- .../mxtest/core/HarmonicTypeChoiceTest.cpp | 148 +- .../mxtest/core/HarmonicTypeChoiceTest.h | 8 +- .../mxtest/core/HarmonyChordGroupTest.cpp | 206 +- .../mxtest/core/HarmonyChordGroupTest.h | 8 +- .../private/mxtest/core/HarmonyTest.cpp | 240 +- Sourcecode/private/mxtest/core/HarmonyTest.h | 8 +- .../private/mxtest/core/HarpPedalsTest.cpp | 122 +- Sourcecode/private/mxtest/core/HeelTest.cpp | 161 +- Sourcecode/private/mxtest/core/HeelTest.h | 8 +- .../private/mxtest/core/HelloWorldExpected.h | 75 +- .../private/mxtest/core/HelloWorldTest.cpp | 6 +- .../private/mxtest/core/HelloWorldTest.h | 337 +- .../private/mxtest/core/HelperFunctions.h | 68 +- .../private/mxtest/core/HoleClosedTest.cpp | 56 +- .../private/mxtest/core/HoleShapeTest.cpp | 48 +- Sourcecode/private/mxtest/core/HoleTest.cpp | 191 +- Sourcecode/private/mxtest/core/HoleTest.h | 8 +- .../private/mxtest/core/HoleTypeTest.cpp | 48 +- .../private/mxtest/core/HummingTest.cpp | 41 +- .../mxtest/core/IdentificationTest.cpp | 262 +- .../private/mxtest/core/IdentificationTest.h | 8 +- Sourcecode/private/mxtest/core/ImageTest.cpp | 60 +- .../core/InstrumentAbbreviationTest.cpp | 48 +- .../mxtest/core/InstrumentNameTest.cpp | 48 +- .../mxtest/core/InstrumentSoundTest.cpp | 46 +- .../private/mxtest/core/InstrumentTest.cpp | 58 +- .../private/mxtest/core/InstrumentsTest.cpp | 48 +- .../private/mxtest/core/IntegersTest.cpp | 538 +- .../mxtest/core/InterchangeableTest.cpp | 65 +- .../private/mxtest/core/InversionTest.cpp | 56 +- .../mxtest/core/InvertedMordentTest.cpp | 161 +- .../private/mxtest/core/InvertedMordentTest.h | 8 +- .../private/mxtest/core/InvertedTurnTest.cpp | 60 +- Sourcecode/private/mxtest/core/IpaTest.cpp | 48 +- .../private/mxtest/core/KeyAccidentalTest.cpp | 48 +- .../private/mxtest/core/KeyAlterTest.cpp | 48 +- .../private/mxtest/core/KeyOctaveTest.cpp | 58 +- .../private/mxtest/core/KeyStepTest.cpp | 48 +- Sourcecode/private/mxtest/core/KeyTest.cpp | 70 +- Sourcecode/private/mxtest/core/KindTest.cpp | 63 +- .../private/mxtest/core/LaughingTest.cpp | 41 +- .../private/mxtest/core/LayoutGroupTest.cpp | 173 +- .../private/mxtest/core/LayoutGroupTest.h | 8 +- .../private/mxtest/core/LeftDividerTest.cpp | 59 +- .../private/mxtest/core/LeftMarginTest.cpp | 48 +- Sourcecode/private/mxtest/core/LevelTest.cpp | 56 +- Sourcecode/private/mxtest/core/LineTest.cpp | 48 +- .../private/mxtest/core/LineWidthTest.cpp | 58 +- Sourcecode/private/mxtest/core/LinkTest.cpp | 61 +- .../private/mxtest/core/LyricFontTest.cpp | 58 +- .../private/mxtest/core/LyricLanguageTest.cpp | 60 +- Sourcecode/private/mxtest/core/LyricTest.cpp | 206 +- Sourcecode/private/mxtest/core/LyricTest.h | 8 +- .../private/mxtest/core/LyricTextChoiceTest.h | 8 +- .../mxtest/core/LyricTextCoiceTest.cpp | 203 +- .../private/mxtest/core/MakeFunctionsTest.cpp | 5275 ++--- .../mxtest/core/MeasureDistanceTest.cpp | 48 +- .../private/mxtest/core/MeasureLayoutTest.cpp | 162 +- .../private/mxtest/core/MeasureLayoutTest.h | 8 +- .../mxtest/core/MeasureNumberingTest.cpp | 56 +- .../private/mxtest/core/MeasureRepeatTest.cpp | 58 +- .../private/mxtest/core/MeasureStyleTest.cpp | 117 +- .../private/mxtest/core/MembraneTest.cpp | 48 +- Sourcecode/private/mxtest/core/MetalTest.cpp | 48 +- .../private/mxtest/core/MetronomeBeamTest.cpp | 58 +- .../private/mxtest/core/MetronomeDotTest.cpp | 41 +- .../private/mxtest/core/MetronomeNoteTest.cpp | 87 +- .../mxtest/core/MetronomeRelationTest.cpp | 64 +- .../private/mxtest/core/MetronomeTest.cpp | 748 +- .../private/mxtest/core/MetronomeTest.h | 20 +- .../mxtest/core/MetronomeTupletTest.cpp | 74 +- .../private/mxtest/core/MetronomeTypeTest.cpp | 48 +- .../private/mxtest/core/MidiBankTest.cpp | 48 +- .../private/mxtest/core/MidiChannelTest.cpp | 48 +- .../private/mxtest/core/MidiDeviceTest.cpp | 60 +- .../mxtest/core/MidiInstrumentTest.cpp | 284 +- .../private/mxtest/core/MidiInstrumentTest.h | 8 +- .../private/mxtest/core/MidiNameTest.cpp | 48 +- .../private/mxtest/core/MidiProgramTest.cpp | 48 +- .../private/mxtest/core/MidiUnpitchedTest.cpp | 48 +- .../private/mxtest/core/MillimetersTest.cpp | 48 +- .../mxtest/core/MiscellaneousFieldTest.cpp | 59 +- .../private/mxtest/core/MiscellaneousTest.cpp | 178 +- .../private/mxtest/core/MiscellaneousTest.h | 8 +- Sourcecode/private/mxtest/core/ModeTest.cpp | 48 +- .../private/mxtest/core/MordentTest.cpp | 163 +- Sourcecode/private/mxtest/core/MordentTest.h | 8 +- .../mxtest/core/MovementNumberTest.cpp | 48 +- .../private/mxtest/core/MovementTitleTest.cpp | 48 +- .../private/mxtest/core/MultipleRestTest.cpp | 56 +- .../mxtest/core/MusicDataChoiceTest.cpp | 288 +- .../private/mxtest/core/MusicDataChoiceTest.h | 10 +- .../mxtest/core/MusicDataGroupTest.cpp | 382 +- .../private/mxtest/core/MusicDataGroupTest.h | 8 +- .../private/mxtest/core/MusicFontTest.cpp | 56 +- Sourcecode/private/mxtest/core/MuteTest.cpp | 48 +- .../private/mxtest/core/NaturalTest.cpp | 40 +- .../private/mxtest/core/NonArpeggiateTest.cpp | 62 +- .../private/mxtest/core/NormalDotTest.cpp | 40 +- .../mxtest/core/NormalNoteGroupTest.cpp | 182 +- .../private/mxtest/core/NormalNoteGroupTest.h | 8 +- .../private/mxtest/core/NormalNotesTest.cpp | 48 +- .../private/mxtest/core/NormalTypeTest.cpp | 48 +- .../mxtest/core/NotationsChoiceTest.cpp | 202 +- .../private/mxtest/core/NotationsChoiceTest.h | 10 +- .../private/mxtest/core/NotationsTest.cpp | 342 +- .../private/mxtest/core/NotationsTest.h | 8 +- .../private/mxtest/core/NoteChoiceTest.cpp | 159 +- .../private/mxtest/core/NoteChoiceTest.h | 8 +- .../private/mxtest/core/NoteSizeTest.cpp | 56 +- Sourcecode/private/mxtest/core/NoteTest.cpp | 322 +- Sourcecode/private/mxtest/core/NoteTest.h | 8 +- .../private/mxtest/core/NoteheadTest.cpp | 56 +- .../private/mxtest/core/NoteheadTextTest.cpp | 207 +- .../private/mxtest/core/NoteheadTextTest.h | 8 +- .../private/mxtest/core/NumberOrNormal.cpp | 85 +- .../private/mxtest/core/OctaveChangeTest.cpp | 48 +- .../private/mxtest/core/OctaveShiftTest.cpp | 62 +- Sourcecode/private/mxtest/core/OctaveTest.cpp | 48 +- Sourcecode/private/mxtest/core/OffsetTest.cpp | 56 +- .../private/mxtest/core/OpenStringTest.cpp | 58 +- Sourcecode/private/mxtest/core/OpusTest.cpp | 62 +- .../mxtest/core/OrnamentsChoiceTest.cpp | 157 +- .../private/mxtest/core/OrnamentsChoiceTest.h | 8 +- .../private/mxtest/core/OrnamentsTest.cpp | 198 +- .../private/mxtest/core/OrnamentsTest.h | 8 +- .../mxtest/core/OtherAppearanceTest.cpp | 58 +- .../mxtest/core/OtherArticulationTest.cpp | 56 +- .../mxtest/core/OtherDirectionTest.cpp | 56 +- .../private/mxtest/core/OtherNotationTest.cpp | 58 +- .../private/mxtest/core/OtherOrnamentTest.cpp | 60 +- .../mxtest/core/OtherPercussionTest.cpp | 48 +- .../private/mxtest/core/OtherPlayTest.cpp | 58 +- .../mxtest/core/OtherTechnicalTest.cpp | 57 +- .../private/mxtest/core/PageHeightTest.cpp | 48 +- .../private/mxtest/core/PageLayoutTest.cpp | 188 +- .../private/mxtest/core/PageLayoutTest.h | 8 +- .../private/mxtest/core/PageMarginsTest.cpp | 198 +- .../private/mxtest/core/PageMarginsTest.h | 8 +- .../private/mxtest/core/PageWidthTest.cpp | 48 +- Sourcecode/private/mxtest/core/PanTest.cpp | 48 +- .../core/PartAbbreviationDisplayTest.cpp | 174 +- .../mxtest/core/PartAbbreviationDisplayTest.h | 8 +- .../mxtest/core/PartAbbreviationTest.cpp | 56 +- .../mxtest/core/PartGroupOrScorePartTest.cpp | 152 +- .../mxtest/core/PartGroupOrScorePartTest.h | 8 +- .../private/mxtest/core/PartGroupTest.cpp | 258 +- .../private/mxtest/core/PartGroupTest.h | 8 +- .../private/mxtest/core/PartListTest.cpp | 202 +- Sourcecode/private/mxtest/core/PartListTest.h | 8 +- .../mxtest/core/PartNameDisplayTest.cpp | 258 +- .../private/mxtest/core/PartNameDisplayTest.h | 10 +- .../private/mxtest/core/PartNameTest.cpp | 56 +- .../private/mxtest/core/PartSymbolTest.cpp | 60 +- .../mxtest/core/PartwiseMeasureTest.cpp | 173 +- .../private/mxtest/core/PartwiseMeasureTest.h | 8 +- .../private/mxtest/core/PartwisePartTest.cpp | 186 +- .../private/mxtest/core/PartwisePartTest.h | 8 +- .../private/mxtest/core/PedalAlterTest.cpp | 48 +- .../private/mxtest/core/PedalStepTest.cpp | 48 +- Sourcecode/private/mxtest/core/PedalTest.cpp | 58 +- .../private/mxtest/core/PedalTuningTest.cpp | 59 +- .../private/mxtest/core/PerMinuteTest.cpp | 56 +- .../private/mxtest/core/PercussionTest.cpp | 215 +- .../private/mxtest/core/PercussionTest.h | 10 +- Sourcecode/private/mxtest/core/PitchTest.cpp | 176 +- Sourcecode/private/mxtest/core/PitchTest.h | 8 +- .../private/mxtest/core/PitchedTest.cpp | 48 +- Sourcecode/private/mxtest/core/PlayTest.cpp | 166 +- Sourcecode/private/mxtest/core/PlayTest.h | 8 +- Sourcecode/private/mxtest/core/PlopTest.cpp | 58 +- Sourcecode/private/mxtest/core/PluckTest.cpp | 56 +- .../core/PositiveIntegerOrEmptyTest.cpp | 85 +- .../private/mxtest/core/PreBendTest.cpp | 40 +- .../mxtest/core/PreciseDecimalTest.cpp | 132 +- Sourcecode/private/mxtest/core/PrefixTest.cpp | 58 +- .../mxtest/core/PrincipalVoiceTest.cpp | 57 +- Sourcecode/private/mxtest/core/PrintTest.cpp | 235 +- Sourcecode/private/mxtest/core/PrintTest.h | 8 +- .../private/mxtest/core/PropertiesTest.cpp | 464 +- .../private/mxtest/core/PropertiesTest.h | 8 +- .../private/mxtest/core/PullOffTest.cpp | 58 +- .../private/mxtest/core/RehearsalTest.cpp | 58 +- .../private/mxtest/core/RelationTest.cpp | 58 +- .../private/mxtest/core/ReleaseTest.cpp | 40 +- Sourcecode/private/mxtest/core/RepeatTest.cpp | 58 +- Sourcecode/private/mxtest/core/RestTest.cpp | 172 +- Sourcecode/private/mxtest/core/RestTest.h | 8 +- .../private/mxtest/core/RightDividerTest.cpp | 59 +- .../private/mxtest/core/RightMarginTest.cpp | 48 +- Sourcecode/private/mxtest/core/RightsTest.cpp | 58 +- .../private/mxtest/core/RootAlterTest.cpp | 56 +- .../private/mxtest/core/RootStepTest.cpp | 58 +- Sourcecode/private/mxtest/core/RootTest.cpp | 172 +- Sourcecode/private/mxtest/core/RootTest.h | 8 +- .../private/mxtest/core/ScalingTest.cpp | 172 +- Sourcecode/private/mxtest/core/ScalingTest.h | 8 +- .../private/mxtest/core/SchleiferTest.cpp | 58 +- Sourcecode/private/mxtest/core/ScoopTest.cpp | 58 +- .../private/mxtest/core/ScordaturaTest.cpp | 189 +- .../private/mxtest/core/ScordaturaTest.h | 8 +- .../mxtest/core/ScoreHeaderGroupTest.cpp | 186 +- .../mxtest/core/ScoreHeaderGroupTest.h | 8 +- .../mxtest/core/ScoreInstrumentTest.cpp | 207 +- .../private/mxtest/core/ScoreInstrumentTest.h | 8 +- .../private/mxtest/core/ScorePartTest.cpp | 352 +- .../private/mxtest/core/ScorePartTest.h | 8 +- .../private/mxtest/core/ScorePartwiseTest.cpp | 204 +- .../private/mxtest/core/ScorePartwiseTest.h | 8 +- .../private/mxtest/core/ScoreTimewiseTest.cpp | 203 +- .../private/mxtest/core/ScoreTimewiseTest.h | 8 +- Sourcecode/private/mxtest/core/SegnoTest.cpp | 56 +- .../private/mxtest/core/SemiPitchedTest.cpp | 48 +- .../private/mxtest/core/SenzaMisuraTest.cpp | 48 +- Sourcecode/private/mxtest/core/ShakeTest.cpp | 58 +- Sourcecode/private/mxtest/core/SignTest.cpp | 48 +- .../private/mxtest/core/SlashDotTest.cpp | 40 +- Sourcecode/private/mxtest/core/SlashTest.cpp | 59 +- .../private/mxtest/core/SlashTypeTest.cpp | 48 +- Sourcecode/private/mxtest/core/SlideTest.cpp | 63 +- Sourcecode/private/mxtest/core/SlurTest.cpp | 62 +- .../private/mxtest/core/SnapPizzicatoTest.cpp | 59 +- .../private/mxtest/core/SoftwareTest.cpp | 48 +- Sourcecode/private/mxtest/core/SoloTest.cpp | 40 +- Sourcecode/private/mxtest/core/SoundTest.cpp | 199 +- Sourcecode/private/mxtest/core/SoundTest.h | 8 +- .../private/mxtest/core/SoundingPitchTest.cpp | 40 +- Sourcecode/private/mxtest/core/SourceTest.cpp | 48 +- .../private/mxtest/core/SpiccatoTest.cpp | 58 +- .../private/mxtest/core/StaccatissimoTest.cpp | 59 +- .../private/mxtest/core/StaccatoTest.cpp | 58 +- .../private/mxtest/core/StaffDetailsTest.cpp | 99 +- .../private/mxtest/core/StaffDistanceTest.cpp | 48 +- .../private/mxtest/core/StaffLayoutTest.cpp | 168 +- .../private/mxtest/core/StaffLayoutTest.h | 8 +- .../private/mxtest/core/StaffLinesTest.cpp | 48 +- .../private/mxtest/core/StaffSizeTest.cpp | 48 +- Sourcecode/private/mxtest/core/StaffTest.cpp | 48 +- .../private/mxtest/core/StaffTuningTest.cpp | 69 +- .../private/mxtest/core/StaffTypeTest.cpp | 48 +- Sourcecode/private/mxtest/core/StavesTest.cpp | 48 +- Sourcecode/private/mxtest/core/StemTest.cpp | 58 +- Sourcecode/private/mxtest/core/StepTest.cpp | 48 +- .../private/mxtest/core/StickLocationTest.cpp | 48 +- .../private/mxtest/core/StickMaterialTest.cpp | 48 +- Sourcecode/private/mxtest/core/StickTest.cpp | 180 +- Sourcecode/private/mxtest/core/StickTest.h | 8 +- .../private/mxtest/core/StickTypeTest.cpp | 48 +- .../private/mxtest/core/StoppedTest.cpp | 58 +- Sourcecode/private/mxtest/core/StressTest.cpp | 58 +- .../private/mxtest/core/StringMuteTest.cpp | 60 +- Sourcecode/private/mxtest/core/StringTest.cpp | 45 +- .../private/mxtest/core/StringsTest.cpp | 442 +- .../private/mxtest/core/StrongAccentTest.cpp | 159 +- .../private/mxtest/core/StrongAccentTest.h | 8 +- Sourcecode/private/mxtest/core/SuffixTest.cpp | 58 +- .../private/mxtest/core/SupportsTest.cpp | 62 +- .../private/mxtest/core/SyllabicTest.cpp | 48 +- .../mxtest/core/SyllabicTextGroupTest.cpp | 187 +- .../mxtest/core/SyllabicTextGroupTest.h | 8 +- .../mxtest/core/SystemDistanceTest.cpp | 48 +- .../mxtest/core/SystemDividersTest.cpp | 175 +- .../private/mxtest/core/SystemDividersTest.h | 8 +- .../private/mxtest/core/SystemLayoutTest.cpp | 197 +- .../private/mxtest/core/SystemLayoutTest.h | 8 +- .../private/mxtest/core/SystemMarginsTest.cpp | 176 +- .../private/mxtest/core/SystemMarginsTest.h | 8 +- Sourcecode/private/mxtest/core/TapTest.cpp | 56 +- .../mxtest/core/TechnicalChoiceTest.cpp | 152 +- .../private/mxtest/core/TechnicalChoiceTest.h | 8 +- .../private/mxtest/core/TechnicalTest.cpp | 191 +- .../private/mxtest/core/TechnicalTest.h | 8 +- Sourcecode/private/mxtest/core/TenthsTest.cpp | 48 +- Sourcecode/private/mxtest/core/TenutoTest.cpp | 58 +- Sourcecode/private/mxtest/core/TextTest.cpp | 58 +- .../private/mxtest/core/ThumbPositionTest.cpp | 59 +- Sourcecode/private/mxtest/core/TieTest.cpp | 58 +- Sourcecode/private/mxtest/core/TiedTest.cpp | 62 +- .../mxtest/core/TimeModificationTest.cpp | 236 +- .../mxtest/core/TimeModificationTest.h | 10 +- .../private/mxtest/core/TimeRelationTest.cpp | 48 +- Sourcecode/private/mxtest/core/TimeTest.cpp | 89 +- .../mxtest/core/TimewiseMeasureTest.cpp | 188 +- .../private/mxtest/core/TimewiseMeasureTest.h | 8 +- .../private/mxtest/core/TimewisePartTest.cpp | 164 +- .../private/mxtest/core/TimewisePartTest.h | 8 +- .../private/mxtest/core/TimpaniTest.cpp | 40 +- Sourcecode/private/mxtest/core/ToeTest.cpp | 162 +- Sourcecode/private/mxtest/core/ToeTest.h | 8 +- .../private/mxtest/core/TopMarginTest.cpp | 48 +- .../mxtest/core/TopSystemDistanceTest.cpp | 48 +- .../private/mxtest/core/TouchingPitchTest.cpp | 47 +- .../private/mxtest/core/TransposeTest.cpp | 65 +- .../private/mxtest/core/TremoloTest.cpp | 56 +- .../private/mxtest/core/TrillMarkTest.cpp | 58 +- .../private/mxtest/core/TripleTongueTest.cpp | 59 +- .../private/mxtest/core/TuningAlterTest.cpp | 48 +- .../private/mxtest/core/TuningOctaveTest.cpp | 48 +- .../private/mxtest/core/TuningStepTest.cpp | 48 +- .../private/mxtest/core/TupletActualTest.cpp | 186 +- .../private/mxtest/core/TupletActualTest.h | 8 +- .../private/mxtest/core/TupletDotTest.cpp | 58 +- .../private/mxtest/core/TupletNormalTest.cpp | 178 +- .../private/mxtest/core/TupletNormalTest.h | 8 +- Sourcecode/private/mxtest/core/TupletTest.cpp | 190 +- Sourcecode/private/mxtest/core/TupletTest.h | 8 +- .../private/mxtest/core/TupletTypeTest.cpp | 57 +- Sourcecode/private/mxtest/core/TurnTest.cpp | 60 +- Sourcecode/private/mxtest/core/TypeTest.cpp | 56 +- .../private/mxtest/core/UnpitchedTest.cpp | 164 +- .../private/mxtest/core/UnpitchedTest.h | 8 +- .../private/mxtest/core/UnstressTest.cpp | 58 +- Sourcecode/private/mxtest/core/UpBowTest.cpp | 58 +- .../private/mxtest/core/VerticalTurnTest.cpp | 59 +- .../mxtest/core/VirtualInstrumentTest.cpp | 168 +- .../mxtest/core/VirtualInstrumentTest.h | 8 +- .../mxtest/core/VirtualLibraryTest.cpp | 48 +- .../private/mxtest/core/VirtualNameTest.cpp | 48 +- Sourcecode/private/mxtest/core/VoiceTest.cpp | 48 +- Sourcecode/private/mxtest/core/VolumeTest.cpp | 48 +- .../private/mxtest/core/WavyLineTest.cpp | 62 +- Sourcecode/private/mxtest/core/WedgeTest.cpp | 60 +- .../private/mxtest/core/WithBarTest.cpp | 58 +- Sourcecode/private/mxtest/core/WoodTest.cpp | 48 +- .../private/mxtest/core/WordFontTest.cpp | 56 +- Sourcecode/private/mxtest/core/WordsTest.cpp | 56 +- .../private/mxtest/core/WorkNumberTest.cpp | 48 +- Sourcecode/private/mxtest/core/WorkTest.cpp | 182 +- Sourcecode/private/mxtest/core/WorkTest.h | 8 +- .../private/mxtest/core/WorkTitleTest.cpp | 48 +- .../private/mxtest/core/YesNoNumberTest.cpp | 85 +- Sourcecode/private/mxtest/file/MxFile.h | 33 +- .../private/mxtest/file/MxFileRepository.h | 64 +- .../private/mxtest/file/MxFileRepositoy.cpp | 884 +- Sourcecode/private/mxtest/file/MxFileTest.cpp | 164 +- Sourcecode/private/mxtest/file/MxFileTest.h | 82 +- .../private/mxtest/file/MxFileTestGroup.h | 96 +- Sourcecode/private/mxtest/file/Path.h | 22 +- .../mxtest/file/StupidFileFunctions.cpp | 180 +- .../private/mxtest/file/StupidFileFunctions.h | 54 +- .../mxtest/impl/CurveFunctionsTest.cpp | 1042 +- .../mxtest/impl/DirectionReaderTest.cpp | 96 +- .../mxtest/impl/DirectionWriterTest.cpp | 36 +- .../mxtest/impl/MagicTemplatesTest.cpp | 4 +- .../private/mxtest/impl/MeasureWriterTest.cpp | 201 +- .../mxtest/impl/PositionFunctionsTest.cpp | 68 +- .../mxtest/impl/PrintFunctionsTest.cpp | 224 +- .../private/mxtest/impl/ScoreWriterTest.cpp | 7 +- .../private/mxtest/import/ChangeValues.cpp | 356 +- .../private/mxtest/import/ChangeValues.h | 95 +- .../private/mxtest/import/DecimalFields.h | 143 +- .../private/mxtest/import/ExpectedFiles.cpp | 586 +- .../private/mxtest/import/ExpectedFiles.h | 74 +- .../private/mxtest/import/ImportTest.cpp | 67 +- .../private/mxtest/import/ImportTestImpl.cpp | 757 +- .../private/mxtest/import/ImportTestImpl.h | 252 +- .../private/mxtest/import/SortAttributes.cpp | 66 +- .../private/mxtest/import/SortAttributes.h | 26 +- 2019 files changed, 149369 insertions(+), 147781 deletions(-) diff --git a/.clang-format b/.clang-format index 0d6bd9096..99067a0b6 100644 --- a/.clang-format +++ b/.clang-format @@ -1,2 +1,3 @@ BasedOnStyle: Microsoft ColumnLimit: 120 +SeparateDefinitionBlocks: Always diff --git a/Sourcecode/include/mx/api/ApiCommon.h b/Sourcecode/include/mx/api/ApiCommon.h index 6134cf969..fc4d3e513 100644 --- a/Sourcecode/include/mx/api/ApiCommon.h +++ b/Sourcecode/include/mx/api/ApiCommon.h @@ -10,48 +10,59 @@ namespace mx { - namespace api - { - using Double = long double; - using OptionalDouble = std::optional; - constexpr const Double MX_API_EQUALITY_EPSILON = 0.00000001; - - inline bool areSame( Double left, Double right ) - { - return ( std::abs( left - right ) < MX_API_EQUALITY_EPSILON ); - } - - constexpr int DEFAULT_TICKS_PER_QUARTER = 3 * 4 * 5 * 7; - constexpr int TICK_TIME_INFINITY = std::numeric_limits::max(); - - enum class Bool - { - unspecified, - yes, - no - }; - - inline bool toBool( Bool b ) { return b == Bool::yes; } - inline Bool fromBool( bool b ) { return b ? Bool::yes : Bool::no; } - inline bool isSpecified( Bool b ) { return b != Bool::unspecified; } - - enum class Placement - { - unspecified, - above, - below - }; - - enum class MeasureNumbering - { - unspecified, - none, - measure, - system - }; - } +namespace api +{ +using Double = long double; +using OptionalDouble = std::optional; +constexpr const Double MX_API_EQUALITY_EPSILON = 0.00000001; + +inline bool areSame(Double left, Double right) +{ + return (std::abs(left - right) < MX_API_EQUALITY_EPSILON); +} + +constexpr int DEFAULT_TICKS_PER_QUARTER = 3 * 4 * 5 * 7; +constexpr int TICK_TIME_INFINITY = std::numeric_limits::max(); + +enum class Bool +{ + unspecified, + yes, + no +}; + +inline bool toBool(Bool b) +{ + return b == Bool::yes; } +inline Bool fromBool(bool b) +{ + return b ? Bool::yes : Bool::no; +} + +inline bool isSpecified(Bool b) +{ + return b != Bool::unspecified; +} + +enum class Placement +{ + unspecified, + above, + below +}; + +enum class MeasureNumbering +{ + unspecified, + none, + measure, + system +}; +} // namespace api +} // namespace mx + // this defines inline equality comparison macros and functions // which are mainly used for test code to assert equality #include "mx/api/ApiEquality.h" diff --git a/Sourcecode/include/mx/api/ApiEquality.h b/Sourcecode/include/mx/api/ApiEquality.h index 5452b8b83..661f50a41 100644 --- a/Sourcecode/include/mx/api/ApiEquality.h +++ b/Sourcecode/include/mx/api/ApiEquality.h @@ -4,117 +4,123 @@ #pragma once #include +#include +#include #include #include -#include -#include // #define MX_DEBUG // shows traces to std::cout namespace mx { - namespace api +namespace api +{ +template inline bool areVectorsEqual(const std::vector &lhs, const std::vector &rhs) +{ + if (lhs.size() != rhs.size()) { - template - inline bool areVectorsEqual( const std::vector& lhs, const std::vector& rhs ) - { - if( lhs.size() != rhs.size() ) - { - return false; - } - auto lit = lhs.cbegin(); - auto rit = rhs.cbegin(); - auto leftend = lhs.cend(); - for( ; lit != leftend; ++lit, ++rit ) - { - if( *lit != *rit ) - { - return false; - } - } - return true; - } - - template - inline bool areIntMapsEqual( const std::map& lhs, const std::map& rhs ) - { - if( lhs.size() != rhs.size() ) - { - return false; - } - auto lit = lhs.cbegin(); - auto rit = rhs.cbegin(); - auto leftend = lhs.cend(); - for( ; lit != leftend; ++lit, ++rit ) - { - if( lit->first != rit->first || lit->second != rit->second ) - { - return false; - } - } - return true; - } - - template - inline bool areEqual( const T& lhs, const T& rhs ) + return false; + } + auto lit = lhs.cbegin(); + auto rit = rhs.cbegin(); + auto leftend = lhs.cend(); + for (; lit != leftend; ++lit, ++rit) + { + if (*lit != *rit) { - return lhs == rhs; + return false; } - - template <> - inline bool areEqual( const long double& lhs, const long double& rhs ) + } + return true; +} + +template inline bool areIntMapsEqual(const std::map &lhs, const std::map &rhs) +{ + if (lhs.size() != rhs.size()) + { + return false; + } + auto lit = lhs.cbegin(); + auto rit = rhs.cbegin(); + auto leftend = lhs.cend(); + for (; lit != leftend; ++lit, ++rit) + { + if (lit->first != rit->first || lit->second != rit->second) { - return areSame( lhs, rhs ); + return false; } + } + return true; +} + +template inline bool areEqual(const T &lhs, const T &rhs) +{ + return lhs == rhs; +} + +template <> inline bool areEqual(const long double &lhs, const long double &rhs) +{ + return areSame(lhs, rhs); +} #ifdef MX_DEBUG - inline void streamComparisonUnequalMessage( const char* const inClassName, const char* const inMemberName ) - { - std::cout << inClassName; - std::cout << " "; - std::cout << inMemberName; - std::cout << " members are not equal "; - std::cout << std::endl; - } +inline void streamComparisonUnequalMessage(const char *const inClassName, const char *const inMemberName) +{ + std::cout << inClassName; + std::cout << " "; + std::cout << inMemberName; + std::cout << " members are not equal "; + std::cout << std::endl; +} #endif #ifndef MX_API_UNUSED - #define MX_API_UNUSED( variable ) (void)variable; +#define MX_API_UNUSED(variable) (void)variable; #endif - + #ifdef MX_DEBUG - #define MX_SHOW_UNEQUAL( XtheCurrentClassName, XmxapiMemberName ) streamComparisonUnequalMessage( XtheCurrentClassName, XmxapiMemberName ); +#define MX_SHOW_UNEQUAL(XtheCurrentClassName, XmxapiMemberName) \ + streamComparisonUnequalMessage(XtheCurrentClassName, XmxapiMemberName); #else - #define MX_SHOW_UNEQUAL( XtheCurrentClassName, XmxapiMemberName ) { MX_API_UNUSED( XtheCurrentClassName ) } +#define MX_SHOW_UNEQUAL(XtheCurrentClassName, XmxapiMemberName) {MX_API_UNUSED(XtheCurrentClassName)} #endif -#define MXAPI_EQUALS_BEGIN( mxapiClassName ) \ - inline bool operator==( const mxapiClassName& lhs, const mxapiClassName& rhs ) \ - { \ - const char* const theCurrentClassName = #mxapiClassName; - -#define MXAPI_EQUALS_MEMBER( mxapiMemberName ) \ - if( ! ( lhs.mxapiMemberName == rhs.mxapiMemberName ) ) \ - { \ - MX_SHOW_UNEQUAL( theCurrentClassName, #mxapiMemberName ); \ - return false; \ - } +#define MXAPI_EQUALS_BEGIN(mxapiClassName) \ + inline bool operator==(const mxapiClassName &lhs, const mxapiClassName &rhs) \ + { \ + const char *const theCurrentClassName = #mxapiClassName; -#define MXAPI_DOUBLES_EQUALS_MEMBER( mxapiMemberName ) \ - if( std::abs( lhs.mxapiMemberName - rhs.mxapiMemberName ) > MX_API_EQUALITY_EPSILON ) \ - { \ - MX_SHOW_UNEQUAL( theCurrentClassName, #mxapiMemberName ); \ - return false; \ - } +#define MXAPI_EQUALS_MEMBER(mxapiMemberName) \ + if (!(lhs.mxapiMemberName == rhs.mxapiMemberName)) \ + { \ + MX_SHOW_UNEQUAL(theCurrentClassName, #mxapiMemberName); \ + return false; \ + } -#define MXAPI_EQUALS_END \ - return true; \ - }\ - -#define MXAPI_NOT_EQUALS_AND_VECTORS( mxapiClassName ) \ - inline bool operator!=( const mxapiClassName& lhs, const mxapiClassName& rhs ) { return !( lhs == rhs ); } \ - inline bool operator==( const std::vector& lhs, const std::vector& rhs ) { return areVectorsEqual( lhs, rhs ); } \ - inline bool operator!=( const std::vector& lhs, const std::vector& rhs ) { return !areVectorsEqual( lhs, rhs ); } \ +#define MXAPI_DOUBLES_EQUALS_MEMBER(mxapiMemberName) \ + if (std::abs(lhs.mxapiMemberName - rhs.mxapiMemberName) > MX_API_EQUALITY_EPSILON) \ + { \ + MX_SHOW_UNEQUAL(theCurrentClassName, #mxapiMemberName); \ + return false; \ + } +#define MXAPI_EQUALS_END \ + return true; \ } -} + +#define MXAPI_NOT_EQUALS_AND_VECTORS(mxapiClassName) \ + inline bool operator!=(const mxapiClassName &lhs, const mxapiClassName &rhs) \ + { \ + return !(lhs == rhs); \ + } \ + inline bool operator==(const std::vector &lhs, const std::vector &rhs) \ + { \ + return areVectorsEqual(lhs, rhs); \ + } \ + inline bool operator!=(const std::vector &lhs, const std::vector &rhs) \ + { \ + return !areVectorsEqual(lhs, rhs); \ + } + +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/AppearanceData.h b/Sourcecode/include/mx/api/AppearanceData.h index 6604d2ce0..3f6a34a2a 100644 --- a/Sourcecode/include/mx/api/AppearanceData.h +++ b/Sourcecode/include/mx/api/AppearanceData.h @@ -8,55 +8,55 @@ namespace mx { - namespace api - { - enum class AppearanceType - { - /// The line-width-type defines what type of line is being defined - /// in a line-width element. Values include beam, bracket, dashes, - /// enclosure, ending, extend, heavy barline, leger, light barline, - /// octave shift, pedal, slur middle, slur tip, staff, stem, tie middle, - /// tie tip, tuplet bracket, and wedge. This is left as a string so that - /// other application-specific types can be defined, but it is made a - /// separate type so that it can be redefined more strictly. - LineWidth, - - /// The note-size-type type indicates the type of note being defined - /// by a note-size element. The grace type is used for notes of cue - /// size that that include a grace element. The cue type is used for - /// all other notes with cue size, whether defined explicitly or - /// implicitly via a cue element. The large type is used for notes of - /// large size. - NoteSize, - - /// The distance-type defines what type of distance is being defined - /// in a distance element. Values include beam and hyphen. This is - /// left as a string so that other application-specific types can be - /// defined, but it is made a separate type so that it can be redefined - /// more strictly. - Distance, - - /// Anything goes - OtherAppearance, - }; - - class AppearanceData - { - public: - AppearanceData(); - - public: - AppearanceType appearanceType; - std::string appearanceSubType; - long double value; - }; - - MXAPI_EQUALS_BEGIN( AppearanceData ) - MXAPI_EQUALS_MEMBER( appearanceType ) - MXAPI_EQUALS_MEMBER( appearanceSubType ) - MXAPI_EQUALS_MEMBER( value ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( AppearanceData ); - - } -} +namespace api +{ +enum class AppearanceType +{ + /// The line-width-type defines what type of line is being defined + /// in a line-width element. Values include beam, bracket, dashes, + /// enclosure, ending, extend, heavy barline, leger, light barline, + /// octave shift, pedal, slur middle, slur tip, staff, stem, tie middle, + /// tie tip, tuplet bracket, and wedge. This is left as a string so that + /// other application-specific types can be defined, but it is made a + /// separate type so that it can be redefined more strictly. + LineWidth, + + /// The note-size-type type indicates the type of note being defined + /// by a note-size element. The grace type is used for notes of cue + /// size that that include a grace element. The cue type is used for + /// all other notes with cue size, whether defined explicitly or + /// implicitly via a cue element. The large type is used for notes of + /// large size. + NoteSize, + + /// The distance-type defines what type of distance is being defined + /// in a distance element. Values include beam and hyphen. This is + /// left as a string so that other application-specific types can be + /// defined, but it is made a separate type so that it can be redefined + /// more strictly. + Distance, + + /// Anything goes + OtherAppearance, +}; + +class AppearanceData +{ + public: + AppearanceData(); + + public: + AppearanceType appearanceType; + std::string appearanceSubType; + long double value; +}; + +MXAPI_EQUALS_BEGIN(AppearanceData) +MXAPI_EQUALS_MEMBER(appearanceType) +MXAPI_EQUALS_MEMBER(appearanceSubType) +MXAPI_EQUALS_MEMBER(value) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(AppearanceData); + +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/BarlineData.h b/Sourcecode/include/mx/api/BarlineData.h index 128a2466d..3219da10f 100644 --- a/Sourcecode/include/mx/api/BarlineData.h +++ b/Sourcecode/include/mx/api/BarlineData.h @@ -9,62 +9,57 @@ namespace mx { - namespace api - { +namespace api +{ + +enum class BarlineType +{ + unspecified, + unsupported, + none, + normal, + lightLight, + lightHeavy, + heavyLight, + dotted, + dashed, + heavy, + heavyHeavy +}; - enum class BarlineType - { - unspecified, - unsupported, - none, - normal, - lightLight, - lightHeavy, - heavyLight, - dotted, - dashed, - heavy, - heavyHeavy - }; - - enum class EndingType - { - none, - start, - stop, - discontinue - }; +enum class EndingType +{ + none, + start, + stop, + discontinue +}; +class BarlineData +{ + public: + int tickTimePosition; + BarlineType barlineType; + EndingType endingType; + int endingNumber; + bool repeat; + HorizontalAlignment location; - class BarlineData - { - public: - int tickTimePosition; - BarlineType barlineType; - EndingType endingType; - int endingNumber; - bool repeat; - HorizontalAlignment location; - - BarlineData() - : tickTimePosition{ 0 } - , barlineType{ BarlineType::normal } - , endingType{ EndingType::none } - , endingNumber { 0 } - , repeat { false } - , location{ HorizontalAlignment::unspecified } - { - } - }; - - MXAPI_EQUALS_BEGIN( BarlineData ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( barlineType ) - MXAPI_EQUALS_MEMBER( endingType ) - MXAPI_EQUALS_MEMBER( endingNumber ) - MXAPI_EQUALS_MEMBER( repeat ) - MXAPI_EQUALS_MEMBER( location ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( BarlineData ); + BarlineData() + : tickTimePosition{0}, barlineType{BarlineType::normal}, endingType{EndingType::none}, endingNumber{0}, + repeat{false}, location{HorizontalAlignment::unspecified} + { } -} +}; + +MXAPI_EQUALS_BEGIN(BarlineData) +MXAPI_EQUALS_MEMBER(tickTimePosition) +MXAPI_EQUALS_MEMBER(barlineType) +MXAPI_EQUALS_MEMBER(endingType) +MXAPI_EQUALS_MEMBER(endingNumber) +MXAPI_EQUALS_MEMBER(repeat) +MXAPI_EQUALS_MEMBER(location) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(BarlineData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/ChordData.h b/Sourcecode/include/mx/api/ChordData.h index c38208098..18ec0f78f 100644 --- a/Sourcecode/include/mx/api/ChordData.h +++ b/Sourcecode/include/mx/api/ChordData.h @@ -5,169 +5,174 @@ #pragma once #include "mx/api/ApiCommon.h" +#include "mx/api/MiscData.h" #include "mx/api/PitchData.h" #include "mx/api/PositionData.h" -#include "mx/api/MiscData.h" namespace mx { - namespace api - { - enum class ChordKind - { - unspecified, - major, - minor, - augmented, - diminished, - dominant, - majorSeventh, - minorSeventh, - diminishedSeventh, - augmentedSeventh, - halfDiminished, - majorMinor, - majorSixth, - minorSixth, - dominantNinth, - majorNinth, - minorNinth, - dominant11Th, - major11Th, - minor11Th, - dominant13Th, - major13Th, - minor13Th, - suspendedSecond, - suspendedFourth, - neapolitan, - italian, - french, - german, - pedal, - power, - tristan, - other, - none - }; +namespace api +{ +enum class ChordKind +{ + unspecified, + major, + minor, + augmented, + diminished, + dominant, + majorSeventh, + minorSeventh, + diminishedSeventh, + augmentedSeventh, + halfDiminished, + majorMinor, + majorSixth, + minorSixth, + dominantNinth, + majorNinth, + minorNinth, + dominant11Th, + major11Th, + minor11Th, + dominant13Th, + major13Th, + minor13Th, + suspendedSecond, + suspendedFourth, + neapolitan, + italian, + french, + german, + pedal, + power, + tristan, + other, + none +}; - enum class ExtensionType - { - add, - remove, - alter - }; +enum class ExtensionType +{ + add, + remove, + alter +}; - enum class ExtensionNumber - { - first, - second, - third, - fourth, - fifth, - sixth, - seventh, - ninth, - eleventh, - thirteenth, - }; +enum class ExtensionNumber +{ + first, + second, + third, + fourth, + fifth, + sixth, + seventh, + ninth, + eleventh, + thirteenth, +}; - enum class ExtensionAlter - { - none, - flat, - sharp, - doubleFlat, - doubleSharp - }; +enum class ExtensionAlter +{ + none, + flat, + sharp, + doubleFlat, + doubleSharp +}; - class Extension - { - public: - Extension(); +class Extension +{ + public: + Extension(); - ExtensionType extensionType; - ExtensionAlter extensionAlter; - ExtensionNumber extensionNumber; - Bool printObject; + ExtensionType extensionType; + ExtensionAlter extensionAlter; + ExtensionNumber extensionNumber; + Bool printObject; - inline int getAlterValue() const - { - switch( extensionAlter ) - { - case ExtensionAlter::none: return 0; - case ExtensionAlter::flat: return -1; - case ExtensionAlter::sharp: return 1; - case ExtensionAlter::doubleFlat: return -2; - case ExtensionAlter::doubleSharp: return 2; - } - return 0; - } + inline int getAlterValue() const + { + switch (extensionAlter) + { + case ExtensionAlter::none: + return 0; + case ExtensionAlter::flat: + return -1; + case ExtensionAlter::sharp: + return 1; + case ExtensionAlter::doubleFlat: + return -2; + case ExtensionAlter::doubleSharp: + return 2; + } + return 0; + } - inline void setAlterValue( int inAlterValue ) - { - if( inAlterValue <= -2 ) - { - extensionAlter = ExtensionAlter::doubleFlat; - } - else if ( inAlterValue == -1 ) - { - extensionAlter = ExtensionAlter::flat; - } - else if ( inAlterValue == 0 ) - { - extensionAlter = ExtensionAlter::none; - } - else if ( inAlterValue == 1 ) - { - extensionAlter = ExtensionAlter::sharp; - } - else if ( inAlterValue >= 2 ) - { - extensionAlter = ExtensionAlter::doubleSharp; - } - } - }; + inline void setAlterValue(int inAlterValue) + { + if (inAlterValue <= -2) + { + extensionAlter = ExtensionAlter::doubleFlat; + } + else if (inAlterValue == -1) + { + extensionAlter = ExtensionAlter::flat; + } + else if (inAlterValue == 0) + { + extensionAlter = ExtensionAlter::none; + } + else if (inAlterValue == 1) + { + extensionAlter = ExtensionAlter::sharp; + } + else if (inAlterValue >= 2) + { + extensionAlter = ExtensionAlter::doubleSharp; + } + } +}; - MXAPI_EQUALS_BEGIN( Extension ) - MXAPI_EQUALS_MEMBER( extensionType ) - MXAPI_EQUALS_MEMBER( extensionAlter ) - MXAPI_EQUALS_MEMBER( extensionNumber ) - MXAPI_EQUALS_MEMBER( printObject ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( Extension ); +MXAPI_EQUALS_BEGIN(Extension) +MXAPI_EQUALS_MEMBER(extensionType) +MXAPI_EQUALS_MEMBER(extensionAlter) +MXAPI_EQUALS_MEMBER(extensionNumber) +MXAPI_EQUALS_MEMBER(printObject) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(Extension); - class ChordData - { - public: - ChordData(); +class ChordData +{ + public: + ChordData(); - public: - Step root; - int rootAlter; - ChordKind chordKind; - std::string text; - Bool useSymbols; - Step bass; - int bassAlter; - std::vector extensions; - std::vector miscData; - PositionData positionData; - }; + public: + Step root; + int rootAlter; + ChordKind chordKind; + std::string text; + Bool useSymbols; + Step bass; + int bassAlter; + std::vector extensions; + std::vector miscData; + PositionData positionData; +}; - MXAPI_EQUALS_BEGIN( ChordData ) - MXAPI_EQUALS_MEMBER( root ) - MXAPI_EQUALS_MEMBER( rootAlter ) - MXAPI_EQUALS_MEMBER( chordKind ) - MXAPI_EQUALS_MEMBER( text ) - MXAPI_EQUALS_MEMBER( useSymbols ) - MXAPI_EQUALS_MEMBER( bass ) - MXAPI_EQUALS_MEMBER( bassAlter ) - MXAPI_EQUALS_MEMBER( extensions ) - MXAPI_EQUALS_MEMBER( miscData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( ChordData ); +MXAPI_EQUALS_BEGIN(ChordData) +MXAPI_EQUALS_MEMBER(root) +MXAPI_EQUALS_MEMBER(rootAlter) +MXAPI_EQUALS_MEMBER(chordKind) +MXAPI_EQUALS_MEMBER(text) +MXAPI_EQUALS_MEMBER(useSymbols) +MXAPI_EQUALS_MEMBER(bass) +MXAPI_EQUALS_MEMBER(bassAlter) +MXAPI_EQUALS_MEMBER(extensions) +MXAPI_EQUALS_MEMBER(miscData) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(ChordData); - } -} +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/ClefData.h b/Sourcecode/include/mx/api/ClefData.h index 51c0e8c13..aa7280383 100644 --- a/Sourcecode/include/mx/api/ClefData.h +++ b/Sourcecode/include/mx/api/ClefData.h @@ -8,73 +8,71 @@ namespace mx { - namespace api - { - enum class ClefSymbol - { - none, - g, - f, - c, - percussion, - tab, - jianpu - }; - - enum class ClefLocation - { - unspecified, - beforeBarline, - afterBarline, - midMeasure - }; - - constexpr ClefSymbol DEFAULT_CLEF_SYMBOL = ClefSymbol::g; - constexpr int DEFAULT_CLEF_LINE = 2; - constexpr int DEFAULT_CLEF_OCTAVE_CHANGE = 0; - +namespace api +{ +enum class ClefSymbol +{ + none, + g, + f, + c, + percussion, + tab, + jianpu +}; + +enum class ClefLocation +{ + unspecified, + beforeBarline, + afterBarline, + midMeasure +}; + +constexpr ClefSymbol DEFAULT_CLEF_SYMBOL = ClefSymbol::g; +constexpr int DEFAULT_CLEF_LINE = 2; +constexpr int DEFAULT_CLEF_OCTAVE_CHANGE = 0; + +class ClefData +{ + public: + ClefData(); + + // int staffIndex; + ClefSymbol symbol; + int line; + int octaveChange; + int tickTimePosition; + ClefLocation location; + std::string toString() const; + + // convenience - set symbol, line and octave for common clefs + void setTreble(); + void setBass(); + void setAlto(); + void setTenor(); + void setBaritone(); + void setSoprano(); + void setMezzoSoprano(); - class ClefData - { - public: - - ClefData(); - - //int staffIndex; - ClefSymbol symbol; - int line; - int octaveChange; - int tickTimePosition; - ClefLocation location; - std::string toString() const; - - // convenience - set symbol, line and octave for common clefs - void setTreble(); - void setBass(); - void setAlto(); - void setTenor(); - void setBaritone(); - void setSoprano(); - void setMezzoSoprano(); - - // convenience - check symbol, line and octave for common clefs - bool isTreble() const; - bool isBass() const; - bool isAlto() const; - bool isTenor() const; - bool isBaritone() const; - bool isSoprano() const; - bool isMezzoSoprano() const; - }; + // convenience - check symbol, line and octave for common clefs + bool isTreble() const; + bool isBass() const; + bool isAlto() const; + bool isTenor() const; + bool isBaritone() const; + bool isSoprano() const; + bool isMezzoSoprano() const; +}; - MXAPI_EQUALS_BEGIN( ClefData ) - //MXAPI_EQUALS_MEMBER( staffIndex ) - MXAPI_EQUALS_MEMBER( symbol ) - MXAPI_EQUALS_MEMBER( line ) - MXAPI_EQUALS_MEMBER( octaveChange ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( location ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( ClefData ); - } -} +MXAPI_EQUALS_BEGIN(ClefData) +// MXAPI_EQUALS_MEMBER( staffIndex ) +MXAPI_EQUALS_MEMBER(symbol) +MXAPI_EQUALS_MEMBER(line) +MXAPI_EQUALS_MEMBER(octaveChange) +MXAPI_EQUALS_MEMBER(tickTimePosition) +MXAPI_EQUALS_MEMBER(location) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(ClefData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/CodaData.h b/Sourcecode/include/mx/api/CodaData.h index 48af431e7..f1553f38d 100644 --- a/Sourcecode/include/mx/api/CodaData.h +++ b/Sourcecode/include/mx/api/CodaData.h @@ -10,28 +10,25 @@ namespace mx { - namespace api - { - class CodaData - { - public: - PositionData positionData; - bool isColorSpecified; - ColorData colorData; +namespace api +{ +class CodaData +{ + public: + PositionData positionData; + bool isColorSpecified; + ColorData colorData; - CodaData() - : positionData{} - , isColorSpecified{ false } - , colorData{} - { - } - }; - - MXAPI_EQUALS_BEGIN( CodaData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CodaData ); + CodaData() : positionData{}, isColorSpecified{false}, colorData{} + { } -} +}; + +MXAPI_EQUALS_BEGIN(CodaData) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(isColorSpecified) +MXAPI_EQUALS_MEMBER(colorData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(CodaData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/ColorData.h b/Sourcecode/include/mx/api/ColorData.h index 541d5f3bf..f6f20df66 100644 --- a/Sourcecode/include/mx/api/ColorData.h +++ b/Sourcecode/include/mx/api/ColorData.h @@ -8,35 +8,33 @@ namespace mx { - namespace api +namespace api +{ +struct ColorData +{ + uint8_t red; + uint8_t green; + uint8_t blue; + bool isAlphaSpecified; + uint8_t alpha; + + inline bool isBlack() { - struct ColorData - { - uint8_t red; - uint8_t green; - uint8_t blue; - bool isAlphaSpecified; - uint8_t alpha; + return (red == 255 && green == 255 && blue == 255) && ((!isAlphaSpecified) || (alpha == 255)); + } - inline bool isBlack() { return ( red == 255 && green == 255 && blue == 255 ) && ( ( !isAlphaSpecified ) || ( alpha == 255 ) ); } - ColorData() - : red{ 255 } - , green{ 255 } - , blue{ 255 } - , isAlphaSpecified{ false } - , alpha{ 255 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( ColorData ) - MXAPI_EQUALS_MEMBER( red ) - MXAPI_EQUALS_MEMBER( green ) - MXAPI_EQUALS_MEMBER( blue ) - MXAPI_EQUALS_MEMBER( isAlphaSpecified ) - MXAPI_EQUALS_MEMBER( alpha ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( ColorData ); + ColorData() : red{255}, green{255}, blue{255}, isAlphaSpecified{false}, alpha{255} + { } -} +}; + +MXAPI_EQUALS_BEGIN(ColorData) +MXAPI_EQUALS_MEMBER(red) +MXAPI_EQUALS_MEMBER(green) +MXAPI_EQUALS_MEMBER(blue) +MXAPI_EQUALS_MEMBER(isAlphaSpecified) +MXAPI_EQUALS_MEMBER(alpha) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(ColorData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/CurveData.h b/Sourcecode/include/mx/api/CurveData.h index 7bed4adaf..36ff913bd 100644 --- a/Sourcecode/include/mx/api/CurveData.h +++ b/Sourcecode/include/mx/api/CurveData.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/api/LineData.h" -#include "mx/api/ColorData.h" #include "mx/api/ApiCommon.h" +#include "mx/api/ColorData.h" +#include "mx/api/LineData.h" #include "mx/api/PositionData.h" // MusicXML Documentation for Bezier Attributes Group @@ -24,7 +24,7 @@ // incoming bezier point for slurs and ties with types of stop or continue. // The attributes bezier-offset2, bezier-x2, and bezier-y2 are only valid // with slurs of type continue, and describe the outgoing bezier point. -// +// // The bezier-offset and bezier-offset2 attributes are measured in terms of // musical divisions, like the offset element. These are the recommended // attributes for specifying horizontal position. The other attributes are @@ -39,174 +39,144 @@ namespace mx { - namespace api +namespace api +{ +enum class CurveType +{ + unspecified, + slur, + tie +}; + +enum class CurveOrientation +{ + unspecified, + overhand, + underhand +}; + +struct CurvePoints +{ + // positionData represents a point along the curve. + // either the endpoint in the case of starts and stops, + // or the continuation points in the case of a 'continue'. + // only the following PositionData fields are supported: + // defaultX, defaultY, relativeX, relativeY, placement + PositionData positionData; + + bool isBezierXSpecified; + long double bezierX; + + bool isBezierYSpecified; + long double bezierY; + + bool isBezierOffsetSpecified; + int bezierOffset; + + // convenience, check if any of the available fields + // are specified. + inline bool isSpecified() const { - enum class CurveType - { - unspecified, - slur, - tie - }; - - enum class CurveOrientation - { - unspecified, - overhand, - underhand - }; - - struct CurvePoints - { - // positionData represents a point along the curve. - // either the endpoint in the case of starts and stops, - // or the continuation points in the case of a 'continue'. - // only the following PositionData fields are supported: - // defaultX, defaultY, relativeX, relativeY, placement - PositionData positionData; - - bool isBezierXSpecified; - long double bezierX; - - bool isBezierYSpecified; - long double bezierY; - - bool isBezierOffsetSpecified; - int bezierOffset; - - // convenience, check if any of the available fields - // are specified. - inline bool isSpecified() const - { - return positionData.isDefaultXSpecified - || positionData.isDefaultYSpecified - || isBezierXSpecified - || isBezierYSpecified - || isBezierOffsetSpecified; - } - - CurvePoints() - : positionData{} - , isBezierXSpecified{ false } - , bezierX{ 0.0 } - , isBezierYSpecified{ false } - , bezierY{ 0.0 } - , isBezierOffsetSpecified{ false } - , bezierOffset{ 0 } - { - - } - }; - - struct CurveStart - { - CurveType curveType; - int numberLevel; - CurvePoints curvePoints; - CurveOrientation curveOrientation; - Placement placement; - LineData lineData; - bool isColorSpecified; - ColorData colorData; - - CurveStart( CurveType inCurveType ) - : curveType{ inCurveType } - , numberLevel{ -1 } - , curvePoints{} - , curveOrientation{ CurveOrientation::unspecified } - , placement{ Placement::unspecified } - , lineData{} - , isColorSpecified{ false } - , colorData{} - { - - } - }; - - - struct CurveContinue - { - CurveType curveType; - int numberLevel; - CurvePoints curvePoints; - bool isBezierX2Specified; - long double bezierX2; - bool isBezierY2Specified; - long double bezierY2; - bool isBezierOffset2Specified; - long double bezierOffset2; - - CurveContinue( CurveType inCurveType ) - : curveType{ inCurveType } - , numberLevel{ -1 } - , curvePoints{} - , isBezierX2Specified{ false } - , bezierX2{ 0.0 } - , isBezierY2Specified{ false } - , bezierY2{ 0.0 } - , isBezierOffset2Specified{ false } - , bezierOffset2{ 0.0 } - { - - } - }; - - - struct CurveStop - { - CurveType curveType; - int numberLevel; - CurvePoints curvePoints; - - CurveStop( CurveType inCurveType ) - : curveType{ inCurveType } - , numberLevel{ -1 } - , curvePoints{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( CurvePoints ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isBezierXSpecified ) - MXAPI_EQUALS_MEMBER( bezierX ) - MXAPI_EQUALS_MEMBER( isBezierYSpecified ) - MXAPI_EQUALS_MEMBER( bezierY ) - MXAPI_EQUALS_MEMBER( isBezierOffsetSpecified ) - MXAPI_EQUALS_MEMBER( bezierOffset ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CurvePoints ); - - MXAPI_EQUALS_BEGIN( CurveStart ) - MXAPI_EQUALS_MEMBER( curveType ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( curvePoints ) - MXAPI_EQUALS_MEMBER( curveOrientation ) - MXAPI_EQUALS_MEMBER( placement ) - MXAPI_EQUALS_MEMBER( lineData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CurveStart ); - - MXAPI_EQUALS_BEGIN( CurveContinue ) - MXAPI_EQUALS_MEMBER( curveType ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( curvePoints ) - MXAPI_EQUALS_MEMBER( isBezierX2Specified ) - MXAPI_EQUALS_MEMBER( bezierX2 ) - MXAPI_EQUALS_MEMBER( isBezierY2Specified ) - MXAPI_EQUALS_MEMBER( bezierY2 ) - MXAPI_EQUALS_MEMBER( isBezierOffset2Specified ) - MXAPI_EQUALS_MEMBER( bezierOffset2 ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CurveContinue ); - - MXAPI_EQUALS_BEGIN( CurveStop ) - MXAPI_EQUALS_MEMBER( curveType ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( curvePoints ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CurveStop ); + return positionData.isDefaultXSpecified || positionData.isDefaultYSpecified || isBezierXSpecified || + isBezierYSpecified || isBezierOffsetSpecified; } -} + + CurvePoints() + : positionData{}, isBezierXSpecified{false}, bezierX{0.0}, isBezierYSpecified{false}, bezierY{0.0}, + isBezierOffsetSpecified{false}, bezierOffset{0} + { + } +}; + +struct CurveStart +{ + CurveType curveType; + int numberLevel; + CurvePoints curvePoints; + CurveOrientation curveOrientation; + Placement placement; + LineData lineData; + bool isColorSpecified; + ColorData colorData; + + CurveStart(CurveType inCurveType) + : curveType{inCurveType}, numberLevel{-1}, curvePoints{}, curveOrientation{CurveOrientation::unspecified}, + placement{Placement::unspecified}, lineData{}, isColorSpecified{false}, colorData{} + { + } +}; + +struct CurveContinue +{ + CurveType curveType; + int numberLevel; + CurvePoints curvePoints; + bool isBezierX2Specified; + long double bezierX2; + bool isBezierY2Specified; + long double bezierY2; + bool isBezierOffset2Specified; + long double bezierOffset2; + + CurveContinue(CurveType inCurveType) + : curveType{inCurveType}, numberLevel{-1}, curvePoints{}, isBezierX2Specified{false}, bezierX2{0.0}, + isBezierY2Specified{false}, bezierY2{0.0}, isBezierOffset2Specified{false}, bezierOffset2{0.0} + { + } +}; + +struct CurveStop +{ + CurveType curveType; + int numberLevel; + CurvePoints curvePoints; + + CurveStop(CurveType inCurveType) : curveType{inCurveType}, numberLevel{-1}, curvePoints{} + { + } +}; + +MXAPI_EQUALS_BEGIN(CurvePoints) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(isBezierXSpecified) +MXAPI_EQUALS_MEMBER(bezierX) +MXAPI_EQUALS_MEMBER(isBezierYSpecified) +MXAPI_EQUALS_MEMBER(bezierY) +MXAPI_EQUALS_MEMBER(isBezierOffsetSpecified) +MXAPI_EQUALS_MEMBER(bezierOffset) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(CurvePoints); + +MXAPI_EQUALS_BEGIN(CurveStart) +MXAPI_EQUALS_MEMBER(curveType) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(curvePoints) +MXAPI_EQUALS_MEMBER(curveOrientation) +MXAPI_EQUALS_MEMBER(placement) +MXAPI_EQUALS_MEMBER(lineData) +MXAPI_EQUALS_MEMBER(isColorSpecified) +MXAPI_EQUALS_MEMBER(colorData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(CurveStart); + +MXAPI_EQUALS_BEGIN(CurveContinue) +MXAPI_EQUALS_MEMBER(curveType) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(curvePoints) +MXAPI_EQUALS_MEMBER(isBezierX2Specified) +MXAPI_EQUALS_MEMBER(bezierX2) +MXAPI_EQUALS_MEMBER(isBezierY2Specified) +MXAPI_EQUALS_MEMBER(bezierY2) +MXAPI_EQUALS_MEMBER(isBezierOffset2Specified) +MXAPI_EQUALS_MEMBER(bezierOffset2) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(CurveContinue); + +MXAPI_EQUALS_BEGIN(CurveStop) +MXAPI_EQUALS_MEMBER(curveType) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(curvePoints) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(CurveStop); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/DefaultsData.h b/Sourcecode/include/mx/api/DefaultsData.h index 81f254f1a..f429be994 100644 --- a/Sourcecode/include/mx/api/DefaultsData.h +++ b/Sourcecode/include/mx/api/DefaultsData.h @@ -14,120 +14,114 @@ namespace mx { - namespace api - { - /// Corresponds to the `` element which is part of the - /// `ScoreHeaderGroup`. Sets the global defaults for the score such as - /// page size, system spacing, and the all-important `` and - /// `` values. - class DefaultsData - { - public: - - /// Sets the standard staff size for the score, in millimeters. - /// However, it does not work the way you might expect. The - /// millimeters value cannot be specified independently of the - /// tenths value (below). The tenths value says, basically, how - /// many tenths of a staff space we are specifying for the scaling - /// for. The simplest way to understand this is to set tenths to 40, - /// by which you are saying the scale you are providing is for 40 - /// tenths of a staff space, which is the same as 4 staff spaces, - /// with is the same as a normal staff. So if you set tenths to 40, - /// then millimeters will specify the size of your staff. - /// - /// Here's an example, if I create a default document with Finale - /// and export it to MusicXML, it writes this: - /// - /// - /// - /// - /// 7.2319 - /// 40 - /// ... - /// - /// - /// - /// In this example, Finale is saying that the size of the staff is - /// 7.2319 millimeters. - /// - /// Please note: we plan to provide types for specifying tenths and - /// millimeters in the future and this field will experience a - /// breaking change: https://github.com/webern/mx/issues/99 - /// - /// Here is the documentation from MusicXML: - /// - /// The millimeters type is a number representing millimeters. This - /// is used in the scaling element to provide a default scaling from - /// tenths to physical units. - Double scalingMillimeters; +namespace api +{ +/// Corresponds to the `` element which is part of the +/// `ScoreHeaderGroup`. Sets the global defaults for the score such as +/// page size, system spacing, and the all-important `` and +/// `` values. +class DefaultsData +{ + public: + /// Sets the standard staff size for the score, in millimeters. + /// However, it does not work the way you might expect. The + /// millimeters value cannot be specified independently of the + /// tenths value (below). The tenths value says, basically, how + /// many tenths of a staff space we are specifying for the scaling + /// for. The simplest way to understand this is to set tenths to 40, + /// by which you are saying the scale you are providing is for 40 + /// tenths of a staff space, which is the same as 4 staff spaces, + /// with is the same as a normal staff. So if you set tenths to 40, + /// then millimeters will specify the size of your staff. + /// + /// Here's an example, if I create a default document with Finale + /// and export it to MusicXML, it writes this: + /// + /// + /// + /// + /// 7.2319 + /// 40 + /// ... + /// + /// + /// + /// In this example, Finale is saying that the size of the staff is + /// 7.2319 millimeters. + /// + /// Please note: we plan to provide types for specifying tenths and + /// millimeters in the future and this field will experience a + /// breaking change: https://github.com/webern/mx/issues/99 + /// + /// Here is the documentation from MusicXML: + /// + /// The millimeters type is a number representing millimeters. This + /// is used in the scaling element to provide a default scaling from + /// tenths to physical units. + Double scalingMillimeters; - /// All measurements in the score are in 'tenths', which is one - /// tenth of a staff space. In other words, the size of a staff - /// space is 10 `tenths`. - /// - /// Please note: we plan to provide types for specifying tenths and - /// millimeters in the future and this field will experience a - /// breaking change: https://github.com/webern/mx/issues/99 - /// - /// Here is the documentation from MusicXML: - /// - /// The tenths type is a number representing tenths of interline - /// staff space (positive or negative). Both integer and decimal - /// values are allowed, such as 5 for a half space and 2.5 for a - /// quarter space. Interline space is measured from the middle of a - /// staff line. - /// - /// Distances in a MusicXML file are measured in tenths of staff - /// space. Tenths are then scaled to millimeters within the scaling - /// element, used in the defaults element at the start of a score. - /// Individual staves can apply a scaling factor to adjust staff - /// size. When a MusicXML element or attribute refers to tenths, it - /// means the global tenths defined by the scaling element, not the - /// local tenths as adjusted by the staff-size element. - Double scalingTenths; + /// All measurements in the score are in 'tenths', which is one + /// tenth of a staff space. In other words, the size of a staff + /// space is 10 `tenths`. + /// + /// Please note: we plan to provide types for specifying tenths and + /// millimeters in the future and this field will experience a + /// breaking change: https://github.com/webern/mx/issues/99 + /// + /// Here is the documentation from MusicXML: + /// + /// The tenths type is a number representing tenths of interline + /// staff space (positive or negative). Both integer and decimal + /// values are allowed, such as 5 for a half space and 2.5 for a + /// quarter space. Interline space is measured from the middle of a + /// staff line. + /// + /// Distances in a MusicXML file are measured in tenths of staff + /// space. Tenths are then scaled to millimeters within the scaling + /// element, used in the defaults element at the start of a score. + /// Individual staves can apply a scaling factor to adjust staff + /// size. When a MusicXML element or attribute refers to tenths, it + /// means the global tenths defined by the scaling element, not the + /// local tenths as adjusted by the staff-size element. + Double scalingTenths; - inline Double tenthsPerMillimeter() const - { - return scalingTenths / scalingMillimeters; - } + inline Double tenthsPerMillimeter() const + { + return scalingTenths / scalingMillimeters; + } - inline Double tenthsPerInch() const - { - return tenthsPerMillimeter() * 25.4; - } + inline Double tenthsPerInch() const + { + return tenthsPerMillimeter() * 25.4; + } - /// Page layout. Note all members of PageLayoutData are optional. - PageLayoutData pageLayout; + /// Page layout. Note all members of PageLayoutData are optional. + PageLayoutData pageLayout; - /// System layout. Note all members of SystemLayoutData are optional. - SystemLayoutData systemLayout; + /// System layout. Note all members of SystemLayoutData are optional. + SystemLayoutData systemLayout; - std::vector appearance; + std::vector appearance; - // TODO - this appears not to be used anywhere, please do not use - /// Measure numbering setting, at the global level, will be stated - /// in first measure's tag. This can can be overridden by a - /// value in the Measure. - MeasureNumbering measureNumbering; - - DefaultsData() - : scalingMillimeters{ -1.0 } - , scalingTenths{ -1.0 } - , pageLayout{} - , systemLayout{} - , appearance{} - , measureNumbering{ MeasureNumbering::unspecified } - { + // TODO - this appears not to be used anywhere, please do not use + /// Measure numbering setting, at the global level, will be stated + /// in first measure's tag. This can can be overridden by a + /// value in the Measure. + MeasureNumbering measureNumbering; - } - }; - - MXAPI_EQUALS_BEGIN( DefaultsData ) - MXAPI_EQUALS_MEMBER( pageLayout ) - MXAPI_EQUALS_MEMBER( systemLayout ) - MXAPI_EQUALS_MEMBER( appearance ) - MXAPI_EQUALS_MEMBER( measureNumbering ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( DefaultsData ); + DefaultsData() + : scalingMillimeters{-1.0}, scalingTenths{-1.0}, pageLayout{}, systemLayout{}, appearance{}, + measureNumbering{MeasureNumbering::unspecified} + { } -} +}; + +MXAPI_EQUALS_BEGIN(DefaultsData) +MXAPI_EQUALS_MEMBER(pageLayout) +MXAPI_EQUALS_MEMBER(systemLayout) +MXAPI_EQUALS_MEMBER(appearance) +MXAPI_EQUALS_MEMBER(measureNumbering) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(DefaultsData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/DirectionData.h b/Sourcecode/include/mx/api/DirectionData.h index 2a660267b..82c17fbbe 100644 --- a/Sourcecode/include/mx/api/DirectionData.h +++ b/Sourcecode/include/mx/api/DirectionData.h @@ -17,112 +17,94 @@ namespace mx { - namespace api - { +namespace api +{ + +// MusicXML Documentation: A direction is a musical indication that is not attached to a specific +// note. Two or more may be combined to indicate starts and stops of wedges, dashes, etc. +// +// By default, a series of direction-type elements and a series of child elements of a direction- +// type within a single direction element follow one another in sequence visually. For a series of +// direction-type children, non-positional formatting attributes are carried over from the +// previous element by default. +struct DirectionData +{ + int tickTimePosition; + Placement placement; + + // mx::api will place the DirectionData element in the correct place by using an offset element. + // MusicXML Documentation: An offset is represented in terms of divisions, and indicates where + // the direction will appear relative to the current musical location. This affects the visual + // appearance of the direction. If the sound attribute is "yes", then the offset affects + // playback too. If the sound attribute is "no", then any sound associated with the direction + // takes effect at the current location. The sound attribute is "no" by default for + // compatibility with earlier versions of the MusicXML format. If an element within a + // direction includes a default-x attribute, the offset value will be ignored when determining + // the appearance of that element. + + // voice value of -1 means unspecified + int voice; - // MusicXML Documentation: A direction is a musical indication that is not attached to a specific - // note. Two or more may be combined to indicate starts and stops of wedges, dashes, etc. - // - // By default, a series of direction-type elements and a series of child elements of a direction- - // type within a single direction element follow one another in sequence visually. For a series of - // direction-type children, non-positional formatting attributes are carried over from the - // previous element by default. - struct DirectionData - { - int tickTimePosition; - Placement placement; + // Direction elements are placed inside the StaffData object in mx api. This would mean that + // they are alyways assigned to a staff, however MusicXML makes the staff element optional. + // in the case that we want a direction element to have no element then me must place + // the direction on staffIndex = 0 and set isStaffValueSpecified. otherwise the we will + // assume that the element is present with a value of staffIndex + 1. This bool is + // only relevant for Directions placed on staff zero, it is otherwise ignored. + bool isStaffValueSpecified; - // mx::api will place the DirectionData element in the correct place by using an offset element. - // MusicXML Documentation: An offset is represented in terms of divisions, and indicates where - // the direction will appear relative to the current musical location. This affects the visual - // appearance of the direction. If the sound attribute is "yes", then the offset affects - // playback too. If the sound attribute is "no", then any sound associated with the direction - // takes effect at the current location. The sound attribute is "no" by default for - // compatibility with earlier versions of the MusicXML format. If an element within a - // direction includes a default-x attribute, the offset value will be ignored when determining - // the appearance of that element. + // TODO - sound element - // voice value of -1 means unspecified - int voice; - - // Direction elements are placed inside the StaffData object in mx api. This would mean that - // they are alyways assigned to a staff, however MusicXML makes the staff element optional. - // in the case that we want a direction element to have no element then me must place - // the direction on staffIndex = 0 and set isStaffValueSpecified. otherwise the we will - // assume that the element is present with a value of staffIndex + 1. This bool is - // only relevant for Directions placed on staff zero, it is otherwise ignored. - bool isStaffValueSpecified; - - // TODO - sound element - - std::vector tempos; - std::vector marks; - std::vector wedgeStarts; - std::vector wedgeStops; - std::vector ottavaStarts; - std::vector ottavaStops; - std::vector bracketStarts; - std::vector bracketStops; - std::vector words; - std::vector chords; - std::vector segnos; - std::vector codas; - std::vector rehearsals; - - DirectionData() - : tickTimePosition{ 0 } - , placement{ Placement::unspecified } - , voice{ -1 } - , isStaffValueSpecified{ true } - , marks{} - , wedgeStarts{} - , wedgeStops{} - , ottavaStarts{} - , ottavaStops{} - , bracketStarts{} - , bracketStops{} - , words{} - , chords{} - , segnos{} - { - - } - }; - - inline bool isDirectionDataEmpty( const DirectionData& directionData ) - { - return directionData.tempos.size() == 0 && - directionData.marks.size() == 0 && - directionData.wedgeStarts.size() == 0 && - directionData.wedgeStops.size() == 0 && - directionData.bracketStarts.size() == 0 && - directionData.bracketStops.size() == 0 && - directionData.tempos.size() == 0 && - directionData.ottavaStarts.size() == 0 && - directionData.ottavaStops.size() == 0 && - directionData.words.size() == 0 && - directionData.segnos.size() == 0 && - directionData.codas.size() == 0; - } - - MXAPI_EQUALS_BEGIN( DirectionData ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( placement ) - MXAPI_EQUALS_MEMBER( voice ) - MXAPI_EQUALS_MEMBER( isStaffValueSpecified ) - MXAPI_EQUALS_MEMBER( tempos ) - MXAPI_EQUALS_MEMBER( marks ) - MXAPI_EQUALS_MEMBER( wedgeStarts ) - MXAPI_EQUALS_MEMBER( wedgeStops ) - MXAPI_EQUALS_MEMBER( ottavaStarts ) - MXAPI_EQUALS_MEMBER( ottavaStops ) - MXAPI_EQUALS_MEMBER( bracketStarts ) - MXAPI_EQUALS_MEMBER( bracketStops ) - MXAPI_EQUALS_MEMBER( words ) - MXAPI_EQUALS_MEMBER( chords ) - MXAPI_EQUALS_MEMBER( segnos ) - MXAPI_EQUALS_MEMBER( codas ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( DirectionData ); - } + std::vector tempos; + std::vector marks; + std::vector wedgeStarts; + std::vector wedgeStops; + std::vector ottavaStarts; + std::vector ottavaStops; + std::vector bracketStarts; + std::vector bracketStops; + std::vector words; + std::vector chords; + std::vector segnos; + std::vector codas; + std::vector rehearsals; + + DirectionData() + : tickTimePosition{0}, placement{Placement::unspecified}, voice{-1}, isStaffValueSpecified{true}, marks{}, + wedgeStarts{}, wedgeStops{}, ottavaStarts{}, ottavaStops{}, bracketStarts{}, bracketStops{}, words{}, + chords{}, segnos{} + { + } +}; + +inline bool isDirectionDataEmpty(const DirectionData &directionData) +{ + return directionData.tempos.size() == 0 && directionData.marks.size() == 0 && + directionData.wedgeStarts.size() == 0 && directionData.wedgeStops.size() == 0 && + directionData.bracketStarts.size() == 0 && directionData.bracketStops.size() == 0 && + directionData.tempos.size() == 0 && directionData.ottavaStarts.size() == 0 && + directionData.ottavaStops.size() == 0 && directionData.words.size() == 0 && + directionData.segnos.size() == 0 && directionData.codas.size() == 0; } + +MXAPI_EQUALS_BEGIN(DirectionData) +MXAPI_EQUALS_MEMBER(tickTimePosition) +MXAPI_EQUALS_MEMBER(placement) +MXAPI_EQUALS_MEMBER(voice) +MXAPI_EQUALS_MEMBER(isStaffValueSpecified) +MXAPI_EQUALS_MEMBER(tempos) +MXAPI_EQUALS_MEMBER(marks) +MXAPI_EQUALS_MEMBER(wedgeStarts) +MXAPI_EQUALS_MEMBER(wedgeStops) +MXAPI_EQUALS_MEMBER(ottavaStarts) +MXAPI_EQUALS_MEMBER(ottavaStops) +MXAPI_EQUALS_MEMBER(bracketStarts) +MXAPI_EQUALS_MEMBER(bracketStops) +MXAPI_EQUALS_MEMBER(words) +MXAPI_EQUALS_MEMBER(chords) +MXAPI_EQUALS_MEMBER(segnos) +MXAPI_EQUALS_MEMBER(codas) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(DirectionData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/DocumentManager.h b/Sourcecode/include/mx/api/DocumentManager.h index 19cceb47c..586933230 100644 --- a/Sourcecode/include/mx/api/DocumentManager.h +++ b/Sourcecode/include/mx/api/DocumentManager.h @@ -6,88 +6,79 @@ #include "mx/api/ScoreData.h" -#include #include +#include namespace mx { - namespace core - { - class Document; - using DocumentPtr = std::shared_ptr; - } - - namespace api - { - class DocumentManager - { - public: - DocumentManager( const DocumentManager& other ) = delete; - DocumentManager( DocumentManager&& other ) = delete; - DocumentManager& operator=( const DocumentManager& other ) = delete; - DocumentManager& operator=( DocumentManager&& other ) = delete; - ~DocumentManager(); - - // this class is a singleton, get it like this - // auto& docMngr = DocumentManager::getInstance() - static DocumentManager& getInstance(); - - - // creates a MusicXML document from a file - // and returns the document's ID number, -1 if error - int createFromFile( const std::string& filePath ); - - - // creates a MusicXML document from a character stream - // and returns the document's ID number, -1 if error - int createFromStream( std::istream& stream ); - - - // creates a MusicXML document from a Score structure - // and returns the document's ID number, -1 if error - int createFromScore( const ScoreData& score ); - - - // saves an existing MusicXML document to a - // file, -1 if error - void writeToFile( int documentId, const std::string& filePath ) const; - - - // saves an existing MusicXML document to a - // character stream, -1 if error - void writeToStream( int documentId, std::ostream& stream ) const; - - - // retreives the data from an existing document - // and returns it in the Score structure. if id - // does not exist, returns a default Score object - ScoreData getData( int documentId ) const; - - - // destroys the shared_ptr which is holding the document - // internally and stops tracking ownership of the document - void destroyDocument( int documentId ); - - - // avoid using this function if possible, only use this function - // if your requirements are not met by the Score structure - // note: returns a nullptr if the documentId is bad. if you - // hold a DocumentPtr and call destroyDocument then the - // DocumentManager will no longer know about the object, but the - // object will still exist - mx::core::DocumentPtr getDocument( int documentId ) const; - - // returns a unique number and increments the unique number - // generator. this is here as an aid to any client code that - // needs unique numbers since DocumentManager is already a - // thread-locking singleton, it can easily implement this. - int getUniqueId(); - - private: - DocumentManager(); - class Impl; - std::unique_ptr myImpl; - - }; - } -} +namespace core +{ +class Document; +using DocumentPtr = std::shared_ptr; +} // namespace core + +namespace api +{ +class DocumentManager +{ + public: + DocumentManager(const DocumentManager &other) = delete; + DocumentManager(DocumentManager &&other) = delete; + DocumentManager &operator=(const DocumentManager &other) = delete; + DocumentManager &operator=(DocumentManager &&other) = delete; + ~DocumentManager(); + + // this class is a singleton, get it like this + // auto& docMngr = DocumentManager::getInstance() + static DocumentManager &getInstance(); + + // creates a MusicXML document from a file + // and returns the document's ID number, -1 if error + int createFromFile(const std::string &filePath); + + // creates a MusicXML document from a character stream + // and returns the document's ID number, -1 if error + int createFromStream(std::istream &stream); + + // creates a MusicXML document from a Score structure + // and returns the document's ID number, -1 if error + int createFromScore(const ScoreData &score); + + // saves an existing MusicXML document to a + // file, -1 if error + void writeToFile(int documentId, const std::string &filePath) const; + + // saves an existing MusicXML document to a + // character stream, -1 if error + void writeToStream(int documentId, std::ostream &stream) const; + + // retreives the data from an existing document + // and returns it in the Score structure. if id + // does not exist, returns a default Score object + ScoreData getData(int documentId) const; + + // destroys the shared_ptr which is holding the document + // internally and stops tracking ownership of the document + void destroyDocument(int documentId); + + // avoid using this function if possible, only use this function + // if your requirements are not met by the Score structure + // note: returns a nullptr if the documentId is bad. if you + // hold a DocumentPtr and call destroyDocument then the + // DocumentManager will no longer know about the object, but the + // object will still exist + mx::core::DocumentPtr getDocument(int documentId) const; + + // returns a unique number and increments the unique number + // generator. this is here as an aid to any client code that + // needs unique numbers since DocumentManager is already a + // thread-locking singleton, it can easily implement this. + int getUniqueId(); + + private: + DocumentManager(); + class Impl; + std::unique_ptr myImpl; +}; +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/DurationData.h b/Sourcecode/include/mx/api/DurationData.h index d63a0b36b..c4704cf29 100644 --- a/Sourcecode/include/mx/api/DurationData.h +++ b/Sourcecode/include/mx/api/DurationData.h @@ -4,88 +4,88 @@ #pragma once -#include "mx/api/PrintData.h" -#include "mx/api/PositionData.h" -#include "mx/api/MarkData.h" #include "mx/api/CurveData.h" +#include "mx/api/MarkData.h" +#include "mx/api/PositionData.h" +#include "mx/api/PrintData.h" namespace mx { - namespace api - { - enum class DurationName - { - unspecified, - maxima, - longa, - breve, - whole, - half, - quarter, - eighth, - dur16th, - dur32nd, - dur64th, - dur128th, - dur256th, - dur512th, - dur1024th - }; - - - constexpr long double DUR_QUARTERS_VALUE_MAXIMA = 32.0L; - constexpr long double DUR_QUARTERS_VALUE_LONGA = 16.0L; - constexpr long double DUR_QUARTERS_VALUE_BREVE = 8.0L; - constexpr long double DUR_QUARTERS_VALUE_WHOLE = 4.0L; - constexpr long double DUR_QUARTERS_VALUE_HALF = 2.0L; - constexpr long double DUR_QUARTERS_VALUE_QUARTER = 1.0L; - constexpr long double DUR_QUARTERS_VALUE_EIGHTH = 1.0L / 2.0L; - constexpr long double DUR_QUARTERS_VALUE_16TH = 1.0L / 4.0L; - constexpr long double DUR_QUARTERS_VALUE_32ND = 1.0L / 8.0L; - constexpr long double DUR_QUARTERS_VALUE_64TH = 1.0L / 16.0L; - constexpr long double DUR_QUARTERS_VALUE_128TH = 1.0L / 32.0L; - constexpr long double DUR_QUARTERS_VALUE_256TH = 1.0L / 64.0L; - constexpr long double DUR_QUARTERS_VALUE_512TH = 1.0L / 128.0L; - constexpr long double DUR_QUARTERS_VALUE_1024TH = 1.0L / 256.0L; - - inline long double applyDots( long double inUnDottedValue, int inNumDots ) - { - long double outValue = inUnDottedValue; - long double valueToAdd = inUnDottedValue / 0.5; +namespace api +{ +enum class DurationName +{ + unspecified, + maxima, + longa, + breve, + whole, + half, + quarter, + eighth, + dur16th, + dur32nd, + dur64th, + dur128th, + dur256th, + dur512th, + dur1024th +}; - for( int i = 0; i < inNumDots; ++i ) - { - outValue += valueToAdd; - valueToAdd /= 0.5; - } +constexpr long double DUR_QUARTERS_VALUE_MAXIMA = 32.0L; +constexpr long double DUR_QUARTERS_VALUE_LONGA = 16.0L; +constexpr long double DUR_QUARTERS_VALUE_BREVE = 8.0L; +constexpr long double DUR_QUARTERS_VALUE_WHOLE = 4.0L; +constexpr long double DUR_QUARTERS_VALUE_HALF = 2.0L; +constexpr long double DUR_QUARTERS_VALUE_QUARTER = 1.0L; +constexpr long double DUR_QUARTERS_VALUE_EIGHTH = 1.0L / 2.0L; +constexpr long double DUR_QUARTERS_VALUE_16TH = 1.0L / 4.0L; +constexpr long double DUR_QUARTERS_VALUE_32ND = 1.0L / 8.0L; +constexpr long double DUR_QUARTERS_VALUE_64TH = 1.0L / 16.0L; +constexpr long double DUR_QUARTERS_VALUE_128TH = 1.0L / 32.0L; +constexpr long double DUR_QUARTERS_VALUE_256TH = 1.0L / 64.0L; +constexpr long double DUR_QUARTERS_VALUE_512TH = 1.0L / 128.0L; +constexpr long double DUR_QUARTERS_VALUE_1024TH = 1.0L / 256.0L; - return outValue; - } - - struct DurationData - { - DurationData(); +inline long double applyDots(long double inUnDottedValue, int inNumDots) +{ + long double outValue = inUnDottedValue; + long double valueToAdd = inUnDottedValue / 0.5; - DurationName durationName; // i.e. quarter, eighth etc - int durationDots; // dots - int durationTimeTicks; // length of the note denominated in ticksPerQuarter - bool isTied; // affects sound only. is the note combined sound-wise with the following note of the same pitch - int timeModificationActualNotes; // i.e. for a triplet this would be 3 - int timeModificationNormalNotes; // i.e. for a triplet this would be 2 - api::DurationName timeModificationNormalType; // use this if the time modification ratio involves a different durationName than the main 'durationName' - int timeModificationNormalTypeDots; // in case the time modification ratio involves a dotted type - }; - - MXAPI_EQUALS_BEGIN( DurationData ) - MXAPI_EQUALS_MEMBER( durationName ) - MXAPI_EQUALS_MEMBER( durationDots ) - MXAPI_EQUALS_MEMBER( durationTimeTicks ) - MXAPI_EQUALS_MEMBER( isTied ) - MXAPI_EQUALS_MEMBER( timeModificationActualNotes ) - MXAPI_EQUALS_MEMBER( timeModificationNormalNotes ) - MXAPI_EQUALS_MEMBER( timeModificationNormalType ) - MXAPI_EQUALS_MEMBER( timeModificationNormalTypeDots ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( DurationData ); + for (int i = 0; i < inNumDots; ++i) + { + outValue += valueToAdd; + valueToAdd /= 0.5; } + + return outValue; } + +struct DurationData +{ + DurationData(); + + DurationName durationName; // i.e. quarter, eighth etc + int durationDots; // dots + int durationTimeTicks; // length of the note denominated in ticksPerQuarter + bool isTied; // affects sound only. is the note combined sound-wise with the following note of the same pitch + int timeModificationActualNotes; // i.e. for a triplet this would be 3 + int timeModificationNormalNotes; // i.e. for a triplet this would be 2 + api::DurationName timeModificationNormalType; // use this if the time modification ratio involves a different + // durationName than the main 'durationName' + int timeModificationNormalTypeDots; // in case the time modification ratio involves a dotted type +}; + +MXAPI_EQUALS_BEGIN(DurationData) +MXAPI_EQUALS_MEMBER(durationName) +MXAPI_EQUALS_MEMBER(durationDots) +MXAPI_EQUALS_MEMBER(durationTimeTicks) +MXAPI_EQUALS_MEMBER(isTied) +MXAPI_EQUALS_MEMBER(timeModificationActualNotes) +MXAPI_EQUALS_MEMBER(timeModificationNormalNotes) +MXAPI_EQUALS_MEMBER(timeModificationNormalType) +MXAPI_EQUALS_MEMBER(timeModificationNormalTypeDots) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(DurationData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/EncodingData.h b/Sourcecode/include/mx/api/EncodingData.h index bafd4fdf0..4fd7c3229 100644 --- a/Sourcecode/include/mx/api/EncodingData.h +++ b/Sourcecode/include/mx/api/EncodingData.h @@ -11,90 +11,86 @@ namespace mx { - namespace api +namespace api +{ +class SupportedItem +{ + public: + std::string elementName; + std::string attributeName; + std::string specificValue; + bool isSupported; + + SupportedItem() : elementName(), attributeName(), specificValue(), isSupported(true) + { + } +}; + +class MiscellaneousField +{ + public: + std::string key; + std::string value; + + MiscellaneousField(std::string inKey, std::string inValue) : key{inKey}, value{inValue} { - class SupportedItem - { - public: - std::string elementName; - std::string attributeName; - std::string specificValue; - bool isSupported; + } +}; + +class EncodingDate +{ + public: + int year; + int month; + int day; + + EncodingDate() : year(-1), month(-1), day(-1) + { + } - SupportedItem() - : elementName() - , attributeName() - , specificValue() - , isSupported(true) - { + static EncodingDate today(); +}; - } - }; +class EncodingData +{ + public: + EncodingDate encodingDate; + std::string encoder; + std::string encodingDescription; + std::vector software; + std::vector supportedItems; + std::vector miscelaneousFields; +}; - class MiscellaneousField - { - public: - std::string key; - std::string value; +MXAPI_EQUALS_BEGIN(SupportedItem) +MXAPI_EQUALS_MEMBER(elementName) +MXAPI_EQUALS_MEMBER(attributeName) +MXAPI_EQUALS_MEMBER(specificValue) +MXAPI_EQUALS_MEMBER(isSupported) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(SupportedItem); - MiscellaneousField( std::string inKey, std::string inValue ) - : key{ inKey } - , value{ inValue } - { +MXAPI_EQUALS_BEGIN(MiscellaneousField) +MXAPI_EQUALS_MEMBER(key) +MXAPI_EQUALS_MEMBER(value) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(MiscellaneousField); - } - }; - - class EncodingDate - { - public: - int year; - int month; - int day; - EncodingDate() : year(-1), month(-1), day(-1) {} - static EncodingDate today(); - }; - - class EncodingData - { - public: - EncodingDate encodingDate; - std::string encoder; - std::string encodingDescription; - std::vector software; - std::vector supportedItems; - std::vector miscelaneousFields; - }; - - MXAPI_EQUALS_BEGIN( SupportedItem ) - MXAPI_EQUALS_MEMBER( elementName ) - MXAPI_EQUALS_MEMBER( attributeName ) - MXAPI_EQUALS_MEMBER( specificValue ) - MXAPI_EQUALS_MEMBER( isSupported ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SupportedItem ); +MXAPI_EQUALS_BEGIN(EncodingDate) +MXAPI_EQUALS_MEMBER(year) +MXAPI_EQUALS_MEMBER(month) +MXAPI_EQUALS_MEMBER(day) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(EncodingDate); - MXAPI_EQUALS_BEGIN( MiscellaneousField ) - MXAPI_EQUALS_MEMBER( key ) - MXAPI_EQUALS_MEMBER( value ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MiscellaneousField ); - - MXAPI_EQUALS_BEGIN( EncodingDate ) - MXAPI_EQUALS_MEMBER( year ) - MXAPI_EQUALS_MEMBER( month ) - MXAPI_EQUALS_MEMBER( day ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( EncodingDate ); - - MXAPI_EQUALS_BEGIN( EncodingData ) - MXAPI_EQUALS_MEMBER( encodingDate ) - MXAPI_EQUALS_MEMBER( encoder ) - MXAPI_EQUALS_MEMBER( encodingDescription ) - MXAPI_EQUALS_MEMBER( software ) - MXAPI_EQUALS_MEMBER( supportedItems ) - MXAPI_EQUALS_MEMBER( miscelaneousFields ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( EncodingData ); - } -} +MXAPI_EQUALS_BEGIN(EncodingData) +MXAPI_EQUALS_MEMBER(encodingDate) +MXAPI_EQUALS_MEMBER(encoder) +MXAPI_EQUALS_MEMBER(encodingDescription) +MXAPI_EQUALS_MEMBER(software) +MXAPI_EQUALS_MEMBER(supportedItems) +MXAPI_EQUALS_MEMBER(miscelaneousFields) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(EncodingData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/FontData.h b/Sourcecode/include/mx/api/FontData.h index 4ce5697c3..fd43b7c2d 100644 --- a/Sourcecode/include/mx/api/FontData.h +++ b/Sourcecode/include/mx/api/FontData.h @@ -5,104 +5,92 @@ #pragma once #include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" #include "mx/api/FontData.h" +#include "mx/api/PositionData.h" #include #include namespace mx { - namespace api +namespace api +{ + +enum class FontSizeType +{ + unspecified, + css, + point +}; + +enum class CssSize +{ + unspecified, + xxSmall, + xSmall, + small, + medium, + large, + xLarge, + xxLarge +}; + +enum class FontStyle +{ + unspecified, + normal, + italic +}; + +enum class FontWeight +{ + unspecified, + normal, + bold +}; + +struct FontData +{ + + // fontSizeType indicates which fontSize field + // is in use. if css, then use the fontSizeCss + // field, if point then use fontSizePoint + FontSizeType sizeType; + long double sizePoint; + CssSize sizeCss; + + FontStyle style; + FontWeight weight; + + std::vector fontFamily; + + int underline; + int overline; + int lineThrough; + + FontData() + : sizeType{FontSizeType::unspecified}, sizePoint{-1.0L}, sizeCss{CssSize::unspecified}, + style{FontStyle::unspecified}, weight{FontWeight::unspecified}, fontFamily{}, underline{0}, overline{0}, + lineThrough{0} { - - enum class FontSizeType - { - unspecified, - css, - point - }; - - - enum class CssSize - { - unspecified, - xxSmall, - xSmall, - small, - medium, - large, - xLarge, - xxLarge - }; - - - enum class FontStyle - { - unspecified, - normal, - italic - }; - - - enum class FontWeight - { - unspecified, - normal, - bold - }; - - - struct FontData - { - - // fontSizeType indicates which fontSize field - // is in use. if css, then use the fontSizeCss - // field, if point then use fontSizePoint - FontSizeType sizeType; - long double sizePoint; - CssSize sizeCss; - - FontStyle style; - FontWeight weight; - - std::vector fontFamily; - - int underline; - int overline; - int lineThrough; - - FontData() - : sizeType{ FontSizeType::unspecified } - , sizePoint{ -1.0L } - , sizeCss{ CssSize::unspecified } - , style{ FontStyle::unspecified } - , weight{ FontWeight::unspecified } - , fontFamily{} - , underline{ 0 } - , overline{ 0 } - , lineThrough{ 0 } - { - - } - }; - - - MXAPI_EQUALS_BEGIN( FontData ) - MXAPI_EQUALS_MEMBER( sizeType ) - MXAPI_EQUALS_MEMBER( sizePoint ) - MXAPI_EQUALS_MEMBER( sizeCss ) - MXAPI_EQUALS_MEMBER( style ) - MXAPI_EQUALS_MEMBER( weight ) - if( ! areVectorsEqual( lhs.fontFamily, rhs.fontFamily ) ) - { - MX_SHOW_UNEQUAL( "FontData", "fontFamily" ); - return false; - } - MXAPI_EQUALS_MEMBER( underline ) - MXAPI_EQUALS_MEMBER( overline ) - MXAPI_EQUALS_MEMBER( lineThrough ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( FontData ); } +}; + +MXAPI_EQUALS_BEGIN(FontData) +MXAPI_EQUALS_MEMBER(sizeType) +MXAPI_EQUALS_MEMBER(sizePoint) +MXAPI_EQUALS_MEMBER(sizeCss) +MXAPI_EQUALS_MEMBER(style) +MXAPI_EQUALS_MEMBER(weight) +if (!areVectorsEqual(lhs.fontFamily, rhs.fontFamily)) +{ + MX_SHOW_UNEQUAL("FontData", "fontFamily"); + return false; } +MXAPI_EQUALS_MEMBER(underline) +MXAPI_EQUALS_MEMBER(overline) +MXAPI_EQUALS_MEMBER(lineThrough) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(FontData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/KeyComponent.h b/Sourcecode/include/mx/api/KeyComponent.h index 7a2891baa..8355e4f48 100644 --- a/Sourcecode/include/mx/api/KeyComponent.h +++ b/Sourcecode/include/mx/api/KeyComponent.h @@ -8,53 +8,43 @@ namespace mx { - namespace api - { - - // KeyComponent is only used for non-traditional key signatures. It facilitates specifying the - // exact accidentals that are found in the key signature. - struct KeyComponent - { - // The note name that is to be altered by the key signature. - Step step; - - // The amount that notes of this note name should be altered, in semitones. - int alter; - - // Additional amount that notes of this note name should be altered, in cents. If alter = 1 and cents = 25.1 - // then the note is altered by 1.251 semitones in total. - double cents; - - // The accidental to display for this note name. - Accidental accidental; - - KeyComponent() - : step{} - , alter{} - , cents{} - , accidental{} - { +namespace api +{ - } +// KeyComponent is only used for non-traditional key signatures. It facilitates specifying the +// exact accidentals that are found in the key signature. +struct KeyComponent +{ + // The note name that is to be altered by the key signature. + Step step; - KeyComponent( Step inStep, int inAlter, double inCents, Accidental inAccidental ) - : step{ inStep } - , alter{ inAlter } - , cents{ inCents } - , accidental{ inAccidental } - { + // The amount that notes of this note name should be altered, in semitones. + int alter; - } - }; + // Additional amount that notes of this note name should be altered, in cents. If alter = 1 and cents = 25.1 + // then the note is altered by 1.251 semitones in total. + double cents; + // The accidental to display for this note name. + Accidental accidental; - MXAPI_EQUALS_BEGIN( KeyComponent ) - MXAPI_EQUALS_MEMBER( step ) - MXAPI_EQUALS_MEMBER( alter ) - MXAPI_EQUALS_MEMBER( cents ) - MXAPI_EQUALS_MEMBER( accidental ) - MXAPI_EQUALS_END; + KeyComponent() : step{}, alter{}, cents{}, accidental{} + { + } - MXAPI_NOT_EQUALS_AND_VECTORS( KeyComponent ); + KeyComponent(Step inStep, int inAlter, double inCents, Accidental inAccidental) + : step{inStep}, alter{inAlter}, cents{inCents}, accidental{inAccidental} + { } -} +}; + +MXAPI_EQUALS_BEGIN(KeyComponent) +MXAPI_EQUALS_MEMBER(step) +MXAPI_EQUALS_MEMBER(alter) +MXAPI_EQUALS_MEMBER(cents) +MXAPI_EQUALS_MEMBER(accidental) +MXAPI_EQUALS_END; + +MXAPI_NOT_EQUALS_AND_VECTORS(KeyComponent); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/KeyData.h b/Sourcecode/include/mx/api/KeyData.h index 64464c60a..d7f585f60 100644 --- a/Sourcecode/include/mx/api/KeyData.h +++ b/Sourcecode/include/mx/api/KeyData.h @@ -7,97 +7,90 @@ namespace mx { - namespace api - { - enum class KeyMode - { - unspecified, // a mode value was not provided - unsupported, // a mode value was provided but is not supported - major, - minor - }; - - // KeyData represents a key signature. It can be in one of two configurations. Either you specify - // 'fifths' and 'mode', or you can create a custom key signature by adding items to the customKey - // vector. If anything is found in the customKey vector, then fifths and mode will be ignored. - // - // Example, a traditional key signature (D Major): - // KeyData key; - // key.fifths = 2; // (i.e. 2 sharps) - // key.mode = KeyMode::major; // (optional) - // - // Example, a traditional key signature (G Minor): - // KeyData key; - // key.fifths = -2; // (i.e. 2 flats) - // key.mode = KeyMode::minor; // (optional) - // - // If you want to create a custom time signature, you can do so like this. Here we are creating a - // key where C's are sharp and D's are one-quarter-tone sharp. See KeyComponent for details. - // - // KeyComponent cSharp{ Step::c, 1, 0.0, Accidental::sharp }; - // KeyComponent dQuarterTone{ Step::d, 0, 50.0, Accidental:quarterSharp }; - // KeyData key; - // key.nonTraditional.push_back( cSharp ); - // key.nonTraditional.push_back( dQuarterTone ); - // - struct KeyData - { - // From MusicXML Specification: - // The fifths type represents the number of flats or sharps in a - // traditional key signature. Negative numbers are used for flats - // and positive numbers for sharps, reflecting the key's - // placement within the circle of fifths (hence the type name). - int fifths; +namespace api +{ +enum class KeyMode +{ + unspecified, // a mode value was not provided + unsupported, // a mode value was provided but is not supported + major, + minor +}; - // From MusicXML Specification: - // A cancel element indicates that the old key signature should be - // cancelled before the new one appears. This will always happen - // when changing to C major or A minor and need not be specified - // then. The cancel value matches the fifths value of the cancelled - // key signature (e.g., a cancel of -2 will provide an explicit - // cancellation for changing from B flat major to F major). The - // optional location attribute indicates whether the cancellation - // appears relative to the new key signature. - int cancel; +// KeyData represents a key signature. It can be in one of two configurations. Either you specify +// 'fifths' and 'mode', or you can create a custom key signature by adding items to the customKey +// vector. If anything is found in the customKey vector, then fifths and mode will be ignored. +// +// Example, a traditional key signature (D Major): +// KeyData key; +// key.fifths = 2; // (i.e. 2 sharps) +// key.mode = KeyMode::major; // (optional) +// +// Example, a traditional key signature (G Minor): +// KeyData key; +// key.fifths = -2; // (i.e. 2 flats) +// key.mode = KeyMode::minor; // (optional) +// +// If you want to create a custom time signature, you can do so like this. Here we are creating a +// key where C's are sharp and D's are one-quarter-tone sharp. See KeyComponent for details. +// +// KeyComponent cSharp{ Step::c, 1, 0.0, Accidental::sharp }; +// KeyComponent dQuarterTone{ Step::d, 0, 50.0, Accidental:quarterSharp }; +// KeyData key; +// key.nonTraditional.push_back( cSharp ); +// key.nonTraditional.push_back( dQuarterTone ); +// +struct KeyData +{ + // From MusicXML Specification: + // The fifths type represents the number of flats or sharps in a + // traditional key signature. Negative numbers are used for flats + // and positive numbers for sharps, reflecting the key's + // placement within the circle of fifths (hence the type name). + int fifths; - // Mode specifies whether the key is major or minor. It is optional. - KeyMode mode; + // From MusicXML Specification: + // A cancel element indicates that the old key signature should be + // cancelled before the new one appears. This will always happen + // when changing to C major or A minor and need not be specified + // then. The cancel value matches the fifths value of the cancelled + // key signature (e.g., a cancel of -2 will provide an explicit + // cancellation for changing from B flat major to F major). The + // optional location attribute indicates whether the cancellation + // appears relative to the new key signature. + int cancel; - // Supports changing the key somewhere other than at the start of a measure. - int tickTimePosition; + // Mode specifies whether the key is major or minor. It is optional. + KeyMode mode; - // this value is optional. -1 means unspecified. when value is - // unspecified it means that the key signature applies to all staves - // within the part - int staffIndex; + // Supports changing the key somewhere other than at the start of a measure. + int tickTimePosition; - // TODO support position data and/or other attributes + // this value is optional. -1 means unspecified. when value is + // unspecified it means that the key signature applies to all staves + // within the part + int staffIndex; - // Supports the creation of customized, non-traditional key signatures by specifying the exact note - // alterations. When custom is non-empty, then fifths and mode are ignored. - std::vector nonTraditional; + // TODO support position data and/or other attributes - KeyData() - : fifths{ 0 } - , cancel{ 0 } - , mode{ KeyMode::unspecified } - , tickTimePosition{ 0 } - , staffIndex{ -1 } - , nonTraditional{} - { + // Supports the creation of customized, non-traditional key signatures by specifying the exact note + // alterations. When custom is non-empty, then fifths and mode are ignored. + std::vector nonTraditional; - } - }; + KeyData() : fifths{0}, cancel{0}, mode{KeyMode::unspecified}, tickTimePosition{0}, staffIndex{-1}, nonTraditional{} + { + } +}; - MXAPI_EQUALS_BEGIN( KeyData ) - MXAPI_EQUALS_MEMBER( fifths ) - MXAPI_EQUALS_MEMBER( cancel ) - MXAPI_EQUALS_MEMBER( mode ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( staffIndex ) - MXAPI_EQUALS_MEMBER( nonTraditional ) - MXAPI_EQUALS_END; +MXAPI_EQUALS_BEGIN(KeyData) +MXAPI_EQUALS_MEMBER(fifths) +MXAPI_EQUALS_MEMBER(cancel) +MXAPI_EQUALS_MEMBER(mode) +MXAPI_EQUALS_MEMBER(tickTimePosition) +MXAPI_EQUALS_MEMBER(staffIndex) +MXAPI_EQUALS_MEMBER(nonTraditional) +MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( KeyData ); - } -} +MXAPI_NOT_EQUALS_AND_VECTORS(KeyData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/LayoutData.h b/Sourcecode/include/mx/api/LayoutData.h index 6d1ad5a37..0d975af1c 100644 --- a/Sourcecode/include/mx/api/LayoutData.h +++ b/Sourcecode/include/mx/api/LayoutData.h @@ -13,94 +13,88 @@ namespace mx { - namespace api - { - /// LayoutData represents the page and system layout instructions that - /// are found in the element. These are held in `ScoreData` in a - /// map where the key is the measure index. For example, to start a new - /// page at measure index 39: - /// `score.layout.emplace( 39, LayoutData{ true, true } );`, where the - /// constructor `LayoutData{ true, true }` is a constructor indicating - /// that both a new system and a new page are indicated. - class LayoutData - { - public: - /// System information, such as whether a system break should occur. - /// Note: all members are optional. - SystemData system; - - /// Page information, such as whether a page break should occur. - /// Note: all members are optional. - PageData page; - - /// Convenience constructor for the use case where we only care - /// about specifying system breaks and page breaks. That is, if you - /// do not need to fuss with margins or spacing and only want to - /// indicate the start of a new system or page, you can use this - /// constructor. The first bool indicates that a new system should - /// start. The second bool indicates that a new page should also - /// start. For example: `LayoutData{ true }` produces - /// `` and `LayoutData{ true, true }` - /// produces `` - inline explicit LayoutData( bool inNewSystem, bool inNewPage = false ) - : system{ inNewSystem ? Bool::yes : Bool::unspecified } - , page{ inNewPage ? Bool::yes : Bool::unspecified } - { - - } +namespace api +{ +/// LayoutData represents the page and system layout instructions that +/// are found in the element. These are held in `ScoreData` in a +/// map where the key is the measure index. For example, to start a new +/// page at measure index 39: +/// `score.layout.emplace( 39, LayoutData{ true, true } );`, where the +/// constructor `LayoutData{ true, true }` is a constructor indicating +/// that both a new system and a new page are indicated. +class LayoutData +{ + public: + /// System information, such as whether a system break should occur. + /// Note: all members are optional. + SystemData system; - /// The default constructor does not specify any page or system - /// details. i.e. a default constructed object will not produce a - /// `` element. - inline LayoutData() - : LayoutData{ SystemData{}, PageData{} } - { + /// Page information, such as whether a page break should occur. + /// Note: all members are optional. + PageData page; - } + /// Convenience constructor for the use case where we only care + /// about specifying system breaks and page breaks. That is, if you + /// do not need to fuss with margins or spacing and only want to + /// indicate the start of a new system or page, you can use this + /// constructor. The first bool indicates that a new system should + /// start. The second bool indicates that a new page should also + /// start. For example: `LayoutData{ true }` produces + /// `` and `LayoutData{ true, true }` + /// produces `` + inline explicit LayoutData(bool inNewSystem, bool inNewPage = false) + : system{inNewSystem ? Bool::yes : Bool::unspecified}, page{inNewPage ? Bool::yes : Bool::unspecified} + { + } - /// The explicit constructor takes fully constructed members. - inline explicit LayoutData( SystemData inSystem, PageData inPage ) - : system{ std::move( inSystem ) } - , page{ std::move( inPage ) } - { + /// The default constructor does not specify any page or system + /// details. i.e. a default constructed object will not produce a + /// `` element. + inline LayoutData() : LayoutData{SystemData{}, PageData{}} + { + } - } + /// The explicit constructor takes fully constructed members. + inline explicit LayoutData(SystemData inSystem, PageData inPage) + : system{std::move(inSystem)}, page{std::move(inPage)} + { + } - /// Tells us whether any members have been specified or not. - inline bool isUsed() const { return system.isUsed() || page.isUsed(); } - }; + /// Tells us whether any members have been specified or not. + inline bool isUsed() const + { + return system.isUsed() || page.isUsed(); + } +}; - MXAPI_EQUALS_BEGIN( LayoutData ) - MXAPI_EQUALS_MEMBER( system ) - MXAPI_EQUALS_MEMBER( page ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( LayoutData ); +MXAPI_EQUALS_BEGIN(LayoutData) +MXAPI_EQUALS_MEMBER(system) +MXAPI_EQUALS_MEMBER(page) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(LayoutData); - inline bool operator==( - const std::map& a, - const std::map& b - ) +inline bool operator==(const std::map &a, const std::map &b) +{ + if (a.size() != b.size()) + { + return false; + } + auto ai = a.cbegin(); + auto bi = b.cbegin(); + const auto aend = a.cend(); + const auto bend = b.cend(); + for (; ai != aend && bi != bend; ++ai, ++bi) + { + if (ai->first != bi->first) + { + return false; + } + if (ai->second != bi->second) { - if( a.size() != b.size() ) - { - return false; - } - auto ai = a.cbegin(); - auto bi = b.cbegin(); - const auto aend = a.cend(); - const auto bend = b.cend(); - for( ; ai != aend && bi != bend; ++ai, ++bi ) - { - if( ai->first != bi->first ) - { - return false; - } - if( ai->second != bi->second ) - { - return false; - } - } - return true; + return false; } } + return true; } +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/LeftRight.h b/Sourcecode/include/mx/api/LeftRight.h index e2c5b949a..7ec9f3e0a 100644 --- a/Sourcecode/include/mx/api/LeftRight.h +++ b/Sourcecode/include/mx/api/LeftRight.h @@ -13,37 +13,31 @@ namespace mx { - namespace api - { - /// Represents left and right measurements, in tenths, that are inseparable. - class LeftRight - { - public: - - /// Left measurement, in tenths. - Double left; - - /// Right measurement, in tenths. - Double right; - - inline explicit LeftRight( Double inLeft, Double inRight ) - : left{ inLeft } - , right{ inRight } - { - - } +namespace api +{ +/// Represents left and right measurements, in tenths, that are inseparable. +class LeftRight +{ + public: + /// Left measurement, in tenths. + Double left; - LeftRight() - : LeftRight{ 0.0, 0.0 } - { + /// Right measurement, in tenths. + Double right; - } - }; + inline explicit LeftRight(Double inLeft, Double inRight) : left{inLeft}, right{inRight} + { + } - MXAPI_EQUALS_BEGIN( LeftRight ) - MXAPI_EQUALS_MEMBER( left ) - MXAPI_EQUALS_MEMBER( right ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( LeftRight ); + LeftRight() : LeftRight{0.0, 0.0} + { } -} +}; + +MXAPI_EQUALS_BEGIN(LeftRight) +MXAPI_EQUALS_MEMBER(left) +MXAPI_EQUALS_MEMBER(right) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(LeftRight); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/LineData.h b/Sourcecode/include/mx/api/LineData.h index 0e940c58a..e136ae93e 100644 --- a/Sourcecode/include/mx/api/LineData.h +++ b/Sourcecode/include/mx/api/LineData.h @@ -8,69 +8,60 @@ namespace mx { - namespace api +namespace api +{ +enum class LineType +{ + unspecified, + solid, + dashed, + dotted, + wavy +}; + +enum class LineHook +{ + unspecified, + down, + up, + both, + arrow, + none +}; + +struct LineData +{ + LineType lineType; + LineHook lineHook; + bool isStopLengthSpecified; + long double endLength; + bool isDashLengthSpecified; + long double dashLength; + bool isSpaceLengthSpecified; + long double spaceLength; + + inline bool isSpecified() const { - enum class LineType - { - unspecified, - solid, - dashed, - dotted, - wavy - }; + return lineType != LineType::unspecified || isDashLengthSpecified || isSpaceLengthSpecified; + } - enum class LineHook - { - unspecified, - down, - up, - both, - arrow, - none - }; - - struct LineData - { - LineType lineType; - LineHook lineHook; - bool isStopLengthSpecified; - long double endLength; - bool isDashLengthSpecified; - long double dashLength; - bool isSpaceLengthSpecified; - long double spaceLength; - - inline bool isSpecified() const - { - return lineType != LineType::unspecified || - isDashLengthSpecified || - isSpaceLengthSpecified; - } - - LineData() - : lineType{ LineType::unspecified } - , lineHook{ LineHook::unspecified } - , isStopLengthSpecified{ false } - , endLength{ 0.0 } - , isDashLengthSpecified{ false } - , dashLength{ 0.0 } - , isSpaceLengthSpecified{ false } - , spaceLength{ 0.0 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( LineData ) - MXAPI_EQUALS_MEMBER( lineType ) - MXAPI_EQUALS_MEMBER( lineHook ) - MXAPI_EQUALS_MEMBER( isStopLengthSpecified ) - MXAPI_EQUALS_MEMBER( endLength ) - MXAPI_EQUALS_MEMBER( isDashLengthSpecified ) - MXAPI_EQUALS_MEMBER( dashLength ) - MXAPI_EQUALS_MEMBER( isSpaceLengthSpecified ) - MXAPI_EQUALS_MEMBER( spaceLength ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( LineData ); + LineData() + : lineType{LineType::unspecified}, lineHook{LineHook::unspecified}, isStopLengthSpecified{false}, + endLength{0.0}, isDashLengthSpecified{false}, dashLength{0.0}, isSpaceLengthSpecified{false}, spaceLength{0.0} + { } -} +}; + +MXAPI_EQUALS_BEGIN(LineData) +MXAPI_EQUALS_MEMBER(lineType) +MXAPI_EQUALS_MEMBER(lineHook) +MXAPI_EQUALS_MEMBER(isStopLengthSpecified) +MXAPI_EQUALS_MEMBER(endLength) +MXAPI_EQUALS_MEMBER(isDashLengthSpecified) +MXAPI_EQUALS_MEMBER(dashLength) +MXAPI_EQUALS_MEMBER(isSpaceLengthSpecified) +MXAPI_EQUALS_MEMBER(spaceLength) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(LineData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/LyricData.h b/Sourcecode/include/mx/api/LyricData.h index 877f58757..525f449ed 100644 --- a/Sourcecode/include/mx/api/LyricData.h +++ b/Sourcecode/include/mx/api/LyricData.h @@ -8,18 +8,20 @@ namespace mx { - namespace api +namespace api +{ +class LyricData +{ + public: + LyricData() { - class LyricData - { - public: - LyricData() {} - - std::string text; - }; - - MXAPI_EQUALS_BEGIN( LyricData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( LyricData ); } -} + + std::string text; +}; + +MXAPI_EQUALS_BEGIN(LyricData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(LyricData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/MarginsData.h b/Sourcecode/include/mx/api/MarginsData.h index 8f72cfcfd..7bdd55733 100644 --- a/Sourcecode/include/mx/api/MarginsData.h +++ b/Sourcecode/include/mx/api/MarginsData.h @@ -11,40 +11,34 @@ namespace mx { - namespace api +namespace api +{ + +/// Left, right, top, bottom. Measurements are in tenths. +class MarginsData +{ + public: + Double left; + Double right; + Double top; + Double bottom; + + inline MarginsData() : MarginsData{0.0, 0.0, 0.0, 0.0} { + } - /// Left, right, top, bottom. Measurements are in tenths. - class MarginsData - { - public: - Double left; - Double right; - Double top; - Double bottom; - - inline MarginsData() - : MarginsData{ 0.0, 0.0, 0.0, 0.0 } - { - - } - - inline explicit MarginsData( Double inLeft, Double inRight, Double inTop, Double inBottom ) - : left{ inLeft } - , right{ inRight } - , top{ inTop } - , bottom{ inBottom } - { - - } - }; - - MXAPI_EQUALS_BEGIN( MarginsData ) - MXAPI_EQUALS_MEMBER( left ) - MXAPI_EQUALS_MEMBER( right ) - MXAPI_EQUALS_MEMBER( top ) - MXAPI_EQUALS_MEMBER( bottom ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MarginsData ); + inline explicit MarginsData(Double inLeft, Double inRight, Double inTop, Double inBottom) + : left{inLeft}, right{inRight}, top{inTop}, bottom{inBottom} + { } -} +}; + +MXAPI_EQUALS_BEGIN(MarginsData) +MXAPI_EQUALS_MEMBER(left) +MXAPI_EQUALS_MEMBER(right) +MXAPI_EQUALS_MEMBER(top) +MXAPI_EQUALS_MEMBER(bottom) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(MarginsData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/MarkData.h b/Sourcecode/include/mx/api/MarkData.h index f94ef8bf5..c6af60e02 100644 --- a/Sourcecode/include/mx/api/MarkData.h +++ b/Sourcecode/include/mx/api/MarkData.h @@ -11,222 +11,222 @@ namespace mx { - namespace api - { - enum class MarkType - { - unspecified, - - // articulations - accent, - strongAccent, // marcato - staccato, - tenuto, - detachedLegato, // tenuto with dot - staccatissimo, - spiccato, // ? using "StaccatissimoWedge" - scoop, - plop, - doit, - falloff, - breathMark, - caesura, - stress, - unstress, - otherArticulation, - - // dynamics - p, - pp, - ppp, - pppp, - ppppp, - pppppp, - f, - ff, - fff, - ffff, - fffff, - ffffff, - mp, - mf, - sf, - sfp, - sfpp, - fp, - rf, - rfz, - sfz, - sffz, - fz, - otherDynamics, - unknownDynamics, - - // ornaments - trillMark, - turn, - delayedTurn, - invertedTurn, - delayedInvertedTurn, - verticalTurn, - shake, - wavyLine, - mordent, - invertedMordent, - schleifer, - tremoloSingleOne, ///< A tremolo on a single note (a glyph, not a spanner) with 1 slash - tremoloSingleTwo, ///< A tremolo on a single note (a glyph, not a spanner) with 2 slashes - tremoloSingleThree, ///< A tremolo on a single note (a glyph, not a spanner) with 3 slashes - tremoloSingleFour, ///< A tremolo on a single note (a glyph, not a spanner) with 4 slashes - tremoloSingleFive, ///< A tremolo on a single note (a glyph, not a spanner) with 5 slashes - otherOrnament, ///< MusicXML's 'other-ornament' value - unknownOrnament, ///< Error state - - // accidental marks - accidentalMarkSharp, - accidentalMarkNatural, - accidentalMarkFlat, - accidentalMarkDoubleSharp, - accidentalMarkSharpSharp, - accidentalMarkFlatFlat, - accidentalMarkNaturalSharp, - accidentalMarkNaturalFlat, - accidentalMarkQuarterFlat, - accidentalMarkQuarterSharp, - accidentalMarkThreeQuartersFlat, - accidentalMarkThreeQuartersSharp, - accidentalMarkSharpDown, - accidentalMarkSharpUp, - accidentalMarkNaturalDown, - accidentalMarkNaturalUp, - accidentalMarkFlatDown, - accidentalMarkFlatUp, - accidentalMarkTripleSharp, - accidentalMarkTripleFlat, - accidentalMarkSlashQuarterSharp, - accidentalMarkSlashSharp, - accidentalMarkSlashFlat, - accidentalMarkDoubleSlashFlat, - accidentalMarkSharp1, - accidentalMarkSharp2, - accidentalMarkSharp3, - accidentalMarkSharp5, - accidentalMarkFlat1, - accidentalMarkFlat2, - accidentalMarkFlat3, - accidentalMarkFlat4, - accidentalMarkSori, - accidentalMarkKoron, - accidentalUnknown, - - // technical - upBow, - downBow, - harmonic, - openString, - thumbPosition, - // fingering, - // pluck, - doubleTongue, - tripleTongue, - stopped, - snapPizzicato, - // fret, - // string_, - // hammerOn, - // pullOff, - // bend, - // tap, - heel, - toe, - fingernails, - // hole, - // arrow, - // handbell, - otherTechnical, - unknownTechnical, - - // fermata - fermata, // - fermataNormal, // normal - fermataAngled, // angled - fermataSquare, // square - - // sadly, in MusicXML we do not have an 'above' 'below' attribute for the fermata. - // instead it has an attribute 'type' that is either 'upright' or 'inverted'. - // it appears that implementations interpret 'upright' to mean the 'normal' or - // correct orientation and 'inverted' to mean that the fermata should be 'flipped' - // from its correct orientation. in otherwords the implementation has to figure - // out if the fermata is above or below the note on its own (using its own - // algorithm combined with any default-y and relative-y values). this mess is - // going to be beyond the scope of the MusicXML Class Library at this time. You - // cause the fermata 'type' attribute to be set using the enum values below, but - // it's not possible for this library to calculate the correct fermata glyph. - fermataUpright, // - fermataNormalUpright, // normal - fermataAngledUpright, // angled - fermataSquareUpright, // square - fermataInverted, // - fermataNormalInverted, // normal - fermataAngledInverted, // angled - fermataSquareInverted, // square - unknownFermata, // bad state, unknown type, error - - pedal, // the typical piano pedal mark - damp, // the typical piano end-pedal mark - - // arpeggiate - arpeggiate, - arpeggiateDown, - arpeggiateUp, - - // nonArpeggiate - nonArpeggiate, - - // these are cust additions that will be written to, and read from, the - // other-articulations (or other-*) elements. - customErrorUnknown, // used to represent an error when parsing from a string - customAccentTenuto, - }; - - static constexpr const char* const markStringCustomErrorUnknown = ""; - static constexpr const char* const markStringCustomAccentTenuto = "gjhsldjhglskdjhfg"; - - bool isMarkOrnament( MarkType ); - bool isMarkPedal( MarkType ); - bool isMarkTechnical( MarkType ); - bool isMarkArticulation( MarkType ); - bool isMarkTremolo( MarkType ); - bool isMarkDynamic( MarkType ); - bool isMarkFermata( MarkType ); - bool isMarkArpeggiate( MarkType ); - bool isMarkNonArpeggiate( MarkType ); - - bool isMarkCustom( MarkType ); - std::string getCustomMarkName( MarkType ); - MarkType getMarkTypeFromCustomString( const std::string& ); - int numTremoloSlashes( MarkType ); - - struct MarkData - { - MarkType markType; - std::string name; - int tickTimePosition; - PrintData printData; - PositionData positionData; - - MarkData(); - MarkData( MarkType inMarkType ); - MarkData( Placement inPlacement, MarkType inMarkType ); - }; - - MXAPI_EQUALS_BEGIN( MarkData ) - MXAPI_EQUALS_MEMBER( markType ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( printData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MarkData ); - } -} +namespace api +{ +enum class MarkType +{ + unspecified, + + // articulations + accent, + strongAccent, // marcato + staccato, + tenuto, + detachedLegato, // tenuto with dot + staccatissimo, + spiccato, // ? using "StaccatissimoWedge" + scoop, + plop, + doit, + falloff, + breathMark, + caesura, + stress, + unstress, + otherArticulation, + + // dynamics + p, + pp, + ppp, + pppp, + ppppp, + pppppp, + f, + ff, + fff, + ffff, + fffff, + ffffff, + mp, + mf, + sf, + sfp, + sfpp, + fp, + rf, + rfz, + sfz, + sffz, + fz, + otherDynamics, + unknownDynamics, + + // ornaments + trillMark, + turn, + delayedTurn, + invertedTurn, + delayedInvertedTurn, + verticalTurn, + shake, + wavyLine, + mordent, + invertedMordent, + schleifer, + tremoloSingleOne, ///< A tremolo on a single note (a glyph, not a spanner) with 1 slash + tremoloSingleTwo, ///< A tremolo on a single note (a glyph, not a spanner) with 2 slashes + tremoloSingleThree, ///< A tremolo on a single note (a glyph, not a spanner) with 3 slashes + tremoloSingleFour, ///< A tremolo on a single note (a glyph, not a spanner) with 4 slashes + tremoloSingleFive, ///< A tremolo on a single note (a glyph, not a spanner) with 5 slashes + otherOrnament, ///< MusicXML's 'other-ornament' value + unknownOrnament, ///< Error state + + // accidental marks + accidentalMarkSharp, + accidentalMarkNatural, + accidentalMarkFlat, + accidentalMarkDoubleSharp, + accidentalMarkSharpSharp, + accidentalMarkFlatFlat, + accidentalMarkNaturalSharp, + accidentalMarkNaturalFlat, + accidentalMarkQuarterFlat, + accidentalMarkQuarterSharp, + accidentalMarkThreeQuartersFlat, + accidentalMarkThreeQuartersSharp, + accidentalMarkSharpDown, + accidentalMarkSharpUp, + accidentalMarkNaturalDown, + accidentalMarkNaturalUp, + accidentalMarkFlatDown, + accidentalMarkFlatUp, + accidentalMarkTripleSharp, + accidentalMarkTripleFlat, + accidentalMarkSlashQuarterSharp, + accidentalMarkSlashSharp, + accidentalMarkSlashFlat, + accidentalMarkDoubleSlashFlat, + accidentalMarkSharp1, + accidentalMarkSharp2, + accidentalMarkSharp3, + accidentalMarkSharp5, + accidentalMarkFlat1, + accidentalMarkFlat2, + accidentalMarkFlat3, + accidentalMarkFlat4, + accidentalMarkSori, + accidentalMarkKoron, + accidentalUnknown, + + // technical + upBow, + downBow, + harmonic, + openString, + thumbPosition, + // fingering, + // pluck, + doubleTongue, + tripleTongue, + stopped, + snapPizzicato, + // fret, + // string_, + // hammerOn, + // pullOff, + // bend, + // tap, + heel, + toe, + fingernails, + // hole, + // arrow, + // handbell, + otherTechnical, + unknownTechnical, + + // fermata + fermata, // + fermataNormal, // normal + fermataAngled, // angled + fermataSquare, // square + + // sadly, in MusicXML we do not have an 'above' 'below' attribute for the fermata. + // instead it has an attribute 'type' that is either 'upright' or 'inverted'. + // it appears that implementations interpret 'upright' to mean the 'normal' or + // correct orientation and 'inverted' to mean that the fermata should be 'flipped' + // from its correct orientation. in otherwords the implementation has to figure + // out if the fermata is above or below the note on its own (using its own + // algorithm combined with any default-y and relative-y values). this mess is + // going to be beyond the scope of the MusicXML Class Library at this time. You + // cause the fermata 'type' attribute to be set using the enum values below, but + // it's not possible for this library to calculate the correct fermata glyph. + fermataUpright, // + fermataNormalUpright, // normal + fermataAngledUpright, // angled + fermataSquareUpright, // square + fermataInverted, // + fermataNormalInverted, // normal + fermataAngledInverted, // angled + fermataSquareInverted, // square + unknownFermata, // bad state, unknown type, error + + pedal, // the typical piano pedal mark + damp, // the typical piano end-pedal mark + + // arpeggiate + arpeggiate, + arpeggiateDown, + arpeggiateUp, + + // nonArpeggiate + nonArpeggiate, + + // these are cust additions that will be written to, and read from, the + // other-articulations (or other-*) elements. + customErrorUnknown, // used to represent an error when parsing from a string + customAccentTenuto, +}; + +static constexpr const char *const markStringCustomErrorUnknown = ""; +static constexpr const char *const markStringCustomAccentTenuto = "gjhsldjhglskdjhfg"; + +bool isMarkOrnament(MarkType); +bool isMarkPedal(MarkType); +bool isMarkTechnical(MarkType); +bool isMarkArticulation(MarkType); +bool isMarkTremolo(MarkType); +bool isMarkDynamic(MarkType); +bool isMarkFermata(MarkType); +bool isMarkArpeggiate(MarkType); +bool isMarkNonArpeggiate(MarkType); + +bool isMarkCustom(MarkType); +std::string getCustomMarkName(MarkType); +MarkType getMarkTypeFromCustomString(const std::string &); +int numTremoloSlashes(MarkType); + +struct MarkData +{ + MarkType markType; + std::string name; + int tickTimePosition; + PrintData printData; + PositionData positionData; + + MarkData(); + MarkData(MarkType inMarkType); + MarkData(Placement inPlacement, MarkType inMarkType); +}; + +MXAPI_EQUALS_BEGIN(MarkData) +MXAPI_EQUALS_MEMBER(markType) +MXAPI_EQUALS_MEMBER(name) +MXAPI_EQUALS_MEMBER(tickTimePosition) +MXAPI_EQUALS_MEMBER(printData) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(MarkData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/MeasureData.h b/Sourcecode/include/mx/api/MeasureData.h index 2621f22a0..0dc31a69e 100644 --- a/Sourcecode/include/mx/api/MeasureData.h +++ b/Sourcecode/include/mx/api/MeasureData.h @@ -17,104 +17,96 @@ namespace mx { - namespace api - { - /// This typedef help readability in a few places such as the layout map in ScoreData. - using MeasureIndex = int; +namespace api +{ +/// This typedef help readability in a few places such as the layout map in ScoreData. +using MeasureIndex = int; + +class MeasureData +{ + public: + // this is the notes and other music data + std::vector staves; + + TimeSignatureData timeSignature; - class MeasureData - { - public: - - // this is the notes and other music data - std::vector staves; - - TimeSignatureData timeSignature; + // an empty measureNumber indicates a normal + // measure number (i.e. the measure's + // index + 1). only read or write to + // this field when handling overridden + // measure numbers + // + // MusicXML Documentation: + // In partwise files, the number attribute + // should be the same for measures in + // different parts that share the same left + // barline. While the number attribute is + // often numeric, it does not have to be. + // Non-numeric values are typically used + // together with the implicit or non- + // controlling attributes being set to "yes". + // For a pickup measure, the number attribute + // is typically set to "0" and the implicit + // attribute is typically set to "yes". + // Further details about measure numbering + // can be defined using the measure-numbering + // element. + std::string number; - // an empty measureNumber indicates a normal - // measure number (i.e. the measure's - // index + 1). only read or write to - // this field when handling overridden - // measure numbers - // - // MusicXML Documentation: - // In partwise files, the number attribute - // should be the same for measures in - // different parts that share the same left - // barline. While the number attribute is - // often numeric, it does not have to be. - // Non-numeric values are typically used - // together with the implicit or non- - // controlling attributes being set to "yes". - // For a pickup measure, the number attribute - // is typically set to "0" and the implicit - // attribute is typically set to "yes". - // Further details about measure numbering - // can be defined using the measure-numbering - // element. - std::string number; + // The measure-numbering-value type + // describes how measure numbers are + // displayed on this part: no numbers, + // numbers every measure, or numbers + // every system. + // + MeasureNumbering measureNumbering; - // The measure-numbering-value type - // describes how measure numbers are - // displayed on this part: no numbers, - // numbers every measure, or numbers - // every system. - // - MeasureNumbering measureNumbering; - - // a number greater than zero indicates that - // this measure is the beginning of a mult- - // measure rest that will last for the - // indicated number of measures. following - // measures will be affected by this. - int multiMeasureRest; - - // The implicit attribute is set to "yes" for - // measures where the measure number should - // never appear, such as pickup measures and - // the last half of mid-measure repeats. The - // value is "no" if not specified. - Bool implicit; - - // The non-controlling attribute is intended for - // use in multimetric music like the Don Giovanni - // minuet. If set to "yes", the left barline in - // this measure does not coincide with the left - // barline of measures in other parts. The value - // is "no" if not specified. - Bool nonControlling; - - // a width value less than 0 means 'unspecified' - long double width; - std::vector keys; - std::vector barlines; + // a number greater than zero indicates that + // this measure is the beginning of a mult- + // measure rest that will last for the + // indicated number of measures. following + // measures will be affected by this. + int multiMeasureRest; - MeasureData() - : staves{} - , timeSignature{} - , number{} - , measureNumbering{ MeasureNumbering::unspecified } - , multiMeasureRest{ -1 } - , implicit{ Bool::unspecified } - , nonControlling{ Bool::unspecified } - , width{ -1.0 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( MeasureData ) - MXAPI_EQUALS_MEMBER( staves ) - MXAPI_EQUALS_MEMBER( timeSignature ) - MXAPI_EQUALS_MEMBER( number ) - MXAPI_EQUALS_MEMBER( measureNumbering ) - MXAPI_EQUALS_MEMBER( multiMeasureRest ) - MXAPI_EQUALS_MEMBER( implicit ) - MXAPI_EQUALS_MEMBER( nonControlling ) - MXAPI_EQUALS_MEMBER( width ) - MXAPI_EQUALS_MEMBER( keys ) - MXAPI_EQUALS_MEMBER( barlines ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MeasureData ); + // The implicit attribute is set to "yes" for + // measures where the measure number should + // never appear, such as pickup measures and + // the last half of mid-measure repeats. The + // value is "no" if not specified. + Bool implicit; + + // The non-controlling attribute is intended for + // use in multimetric music like the Don Giovanni + // minuet. If set to "yes", the left barline in + // this measure does not coincide with the left + // barline of measures in other parts. The value + // is "no" if not specified. + Bool nonControlling; + + // a width value less than 0 means 'unspecified' + long double width; + std::vector keys; + std::vector barlines; + + MeasureData() + : staves{}, timeSignature{}, number{}, measureNumbering{MeasureNumbering::unspecified}, multiMeasureRest{-1}, + implicit{Bool::unspecified}, nonControlling{Bool::unspecified}, width{-1.0} + { } -} +}; + +MXAPI_EQUALS_BEGIN(MeasureData) +MXAPI_EQUALS_MEMBER(staves) +MXAPI_EQUALS_MEMBER(timeSignature) +MXAPI_EQUALS_MEMBER(number) +MXAPI_EQUALS_MEMBER(measureNumbering) +MXAPI_EQUALS_MEMBER(multiMeasureRest) +MXAPI_EQUALS_MEMBER(implicit) +MXAPI_EQUALS_MEMBER(nonControlling) +MXAPI_EQUALS_MEMBER(width) +MXAPI_EQUALS_MEMBER(keys) +MXAPI_EQUALS_MEMBER(barlines) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(MeasureData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/MeasureLocation.h b/Sourcecode/include/mx/api/MeasureLocation.h index d5076e526..e58c948dc 100644 --- a/Sourcecode/include/mx/api/MeasureLocation.h +++ b/Sourcecode/include/mx/api/MeasureLocation.h @@ -8,29 +8,27 @@ namespace mx { - namespace api - { - class ScoreData; - - class MeasureLocation - { - public: - - MeasureLocation(); - - int partIndex; - int staffIndex; - int measureIndex; - - bool isValid( const ScoreData& scoreData ) const; - - }; - - MXAPI_EQUALS_BEGIN( MeasureLocation ) - MXAPI_EQUALS_MEMBER( partIndex ) - MXAPI_EQUALS_MEMBER( staffIndex ) - MXAPI_EQUALS_MEMBER( measureIndex ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MeasureLocation ); - } -} +namespace api +{ +class ScoreData; + +class MeasureLocation +{ + public: + MeasureLocation(); + + int partIndex; + int staffIndex; + int measureIndex; + + bool isValid(const ScoreData &scoreData) const; +}; + +MXAPI_EQUALS_BEGIN(MeasureLocation) +MXAPI_EQUALS_MEMBER(partIndex) +MXAPI_EQUALS_MEMBER(staffIndex) +MXAPI_EQUALS_MEMBER(measureIndex) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(MeasureLocation); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/MiscData.h b/Sourcecode/include/mx/api/MiscData.h index 77a8faaaa..a26659a7e 100644 --- a/Sourcecode/include/mx/api/MiscData.h +++ b/Sourcecode/include/mx/api/MiscData.h @@ -10,19 +10,19 @@ namespace mx { - namespace api - { - class MiscData - { - public: - std::string name; - std::string data; - }; +namespace api +{ +class MiscData +{ + public: + std::string name; + std::string data; +}; - MXAPI_EQUALS_BEGIN( MiscData ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( data ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MiscData ); - } -} +MXAPI_EQUALS_BEGIN(MiscData) +MXAPI_EQUALS_MEMBER(name) +MXAPI_EQUALS_MEMBER(data) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(MiscData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/NoteAttachmentData.h b/Sourcecode/include/mx/api/NoteAttachmentData.h index 7dfd4c25f..a09dac921 100644 --- a/Sourcecode/include/mx/api/NoteAttachmentData.h +++ b/Sourcecode/include/mx/api/NoteAttachmentData.h @@ -4,37 +4,37 @@ #pragma once -#include "mx/api/MarkData.h" #include "mx/api/CurveData.h" +#include "mx/api/MarkData.h" #include "mx/api/TupletData.h" namespace mx { - namespace api - { - class NoteAttachmentData - { - public: - std::vector marks; - std::vector curveStarts; - std::vector curveContinuations; - std::vector curveStops; - std::vector tupletStarts; - std::vector tupletStops; - //std::vector spannerStarts; - //std::vector spannerStops; - }; - - MXAPI_EQUALS_BEGIN( NoteAttachmentData ) - MXAPI_EQUALS_MEMBER( marks ) - MXAPI_EQUALS_MEMBER( curveStarts ) - MXAPI_EQUALS_MEMBER( curveContinuations ) - MXAPI_EQUALS_MEMBER( curveStops ) - MXAPI_EQUALS_MEMBER( tupletStarts ) - MXAPI_EQUALS_MEMBER( tupletStops ) - //MXAPI_EQUALS_MEMBER( spannerStarts ) - //MXAPI_EQUALS_MEMBER( spannerStops ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( NoteAttachmentData ); - } -} +namespace api +{ +class NoteAttachmentData +{ + public: + std::vector marks; + std::vector curveStarts; + std::vector curveContinuations; + std::vector curveStops; + std::vector tupletStarts; + std::vector tupletStops; + // std::vector spannerStarts; + // std::vector spannerStops; +}; + +MXAPI_EQUALS_BEGIN(NoteAttachmentData) +MXAPI_EQUALS_MEMBER(marks) +MXAPI_EQUALS_MEMBER(curveStarts) +MXAPI_EQUALS_MEMBER(curveContinuations) +MXAPI_EQUALS_MEMBER(curveStops) +MXAPI_EQUALS_MEMBER(tupletStarts) +MXAPI_EQUALS_MEMBER(tupletStops) +// MXAPI_EQUALS_MEMBER( spannerStarts ) +// MXAPI_EQUALS_MEMBER( spannerStops ) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(NoteAttachmentData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/NoteData.h b/Sourcecode/include/mx/api/NoteData.h index 1c1539b02..35df719c3 100644 --- a/Sourcecode/include/mx/api/NoteData.h +++ b/Sourcecode/include/mx/api/NoteData.h @@ -4,151 +4,149 @@ #pragma once -#include "mx/api/PrintData.h" -#include "mx/api/PositionData.h" #include "mx/api/DurationData.h" -#include "mx/api/PitchData.h" #include "mx/api/NoteAttachmentData.h" +#include "mx/api/PitchData.h" +#include "mx/api/PositionData.h" +#include "mx/api/PrintData.h" #include - namespace mx { - namespace api - { - enum class NoteType - { - normal, - grace, - cue - }; - - enum class Notehead - { - slash, - triangle, - diamond, - square, - cross, - x, - circleX, - invertedTriangle, - arrowDown, - arrowUp, - slashed, - backSlashed, - normal, - cluster, - circleDot, - leftTriangle, - rectangle, - none, - do_, - re, - mi, - fa, - faUp, - so, - la, - ti - }; - - enum class Beam - { - unspecified, - begin, - end, - extend, - forwardBroken, - backwardBroken - }; - - enum class Stem - { - unspecified, - up, - down, - none, - both - }; - - class NoteData - { - public: - - NoteData(); - - bool isRest; // if isRest is true then isUnpitched can be ignored - bool isMeasureRest; // only valid if isRest is true - bool isUnpitched; // only relevant if isRest is false - bool isDisplayStepOctaveSpecified; // MusicXML can optionally specify display step and octave for rests and unpitched notes - - // This does *not* indicate the presence of absence of a tag. Instead isChord - // denotes whether or not the note is a member of a chord. This is translated from/to - // MusicXML's usage rules (the first note of a chord does *not* have a - // tag, but subsequent chord notes do have the tag). - bool isChord; - - // This is separate from the tie curves themselves. This - // states that the note should be tied but noteAttachment.curve - // items are needed to draw the ties visibly - bool isTieStart; - bool isTieStop; - - NoteType noteType; // normal, cue, grace - Notehead notehead; - PitchData pitchData; // step, alter, octave, accidental, etc - int userRequestedVoiceNumber; - Stem stem; - - // the time location of the note, within the measure, denominated in ticksPerQuarter which - // is defined in ScoreData. in each measure, the note with tickTimePosition 0 is located at - // the start of the measure. if ScoreData defines ticksPerQuarter as N, then the note - // located at tickTimePosition N will be located one quarter note after the start of the - // measure. MusicXML's and tags will be automatically placed into the - // MusicXML as required to facilitate the correct timing of notes based on their - // tickTimePosition values. - int tickTimePosition; - DurationData durationData; - - std::vector beams; - PositionData positionData; - PrintData printData; - - NoteAttachmentData noteAttachmentData; - - // these strings will be stuffed into the editorial element - // preceded by the string ##misc-data##. for example if you have the - // strings Bob, Cat, Hello then we will get: - // ##misc-data##Bob,Cat,Hello - // similarly when parsing if we see ##misc-data## in this element, it - // will be parsed into these strings. do not use commas in your misc - // data strings as these are the delimiter - std::vector miscData; - }; - - - MXAPI_EQUALS_BEGIN( NoteData ) - MXAPI_EQUALS_MEMBER( isRest ) - MXAPI_EQUALS_MEMBER( isMeasureRest ) - MXAPI_EQUALS_MEMBER( isUnpitched ) - MXAPI_EQUALS_MEMBER( isDisplayStepOctaveSpecified ) - MXAPI_EQUALS_MEMBER( isChord ) - MXAPI_EQUALS_MEMBER( isTieStart ) - MXAPI_EQUALS_MEMBER( isTieStop ) - MXAPI_EQUALS_MEMBER( noteType ) - MXAPI_EQUALS_MEMBER( pitchData ) - MXAPI_EQUALS_MEMBER( userRequestedVoiceNumber ) - MXAPI_EQUALS_MEMBER( stem ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( durationData ) - MXAPI_EQUALS_MEMBER( beams ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( printData ) - MXAPI_EQUALS_MEMBER( noteAttachmentData ) - MXAPI_EQUALS_MEMBER( miscData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( NoteData ); - } -} +namespace api +{ +enum class NoteType +{ + normal, + grace, + cue +}; + +enum class Notehead +{ + slash, + triangle, + diamond, + square, + cross, + x, + circleX, + invertedTriangle, + arrowDown, + arrowUp, + slashed, + backSlashed, + normal, + cluster, + circleDot, + leftTriangle, + rectangle, + none, + do_, + re, + mi, + fa, + faUp, + so, + la, + ti +}; + +enum class Beam +{ + unspecified, + begin, + end, + extend, + forwardBroken, + backwardBroken +}; + +enum class Stem +{ + unspecified, + up, + down, + none, + both +}; + +class NoteData +{ + public: + NoteData(); + + bool isRest; // if isRest is true then isUnpitched can be ignored + bool isMeasureRest; // only valid if isRest is true + bool isUnpitched; // only relevant if isRest is false + bool isDisplayStepOctaveSpecified; // MusicXML can optionally specify display step and octave for rests and + // unpitched notes + + // This does *not* indicate the presence of absence of a tag. Instead isChord + // denotes whether or not the note is a member of a chord. This is translated from/to + // MusicXML's usage rules (the first note of a chord does *not* have a + // tag, but subsequent chord notes do have the tag). + bool isChord; + + // This is separate from the tie curves themselves. This + // states that the note should be tied but noteAttachment.curve + // items are needed to draw the ties visibly + bool isTieStart; + bool isTieStop; + + NoteType noteType; // normal, cue, grace + Notehead notehead; + PitchData pitchData; // step, alter, octave, accidental, etc + int userRequestedVoiceNumber; + Stem stem; + + // the time location of the note, within the measure, denominated in ticksPerQuarter which + // is defined in ScoreData. in each measure, the note with tickTimePosition 0 is located at + // the start of the measure. if ScoreData defines ticksPerQuarter as N, then the note + // located at tickTimePosition N will be located one quarter note after the start of the + // measure. MusicXML's and tags will be automatically placed into the + // MusicXML as required to facilitate the correct timing of notes based on their + // tickTimePosition values. + int tickTimePosition; + DurationData durationData; + + std::vector beams; + PositionData positionData; + PrintData printData; + + NoteAttachmentData noteAttachmentData; + + // these strings will be stuffed into the editorial element + // preceded by the string ##misc-data##. for example if you have the + // strings Bob, Cat, Hello then we will get: + // ##misc-data##Bob,Cat,Hello + // similarly when parsing if we see ##misc-data## in this element, it + // will be parsed into these strings. do not use commas in your misc + // data strings as these are the delimiter + std::vector miscData; +}; + +MXAPI_EQUALS_BEGIN(NoteData) +MXAPI_EQUALS_MEMBER(isRest) +MXAPI_EQUALS_MEMBER(isMeasureRest) +MXAPI_EQUALS_MEMBER(isUnpitched) +MXAPI_EQUALS_MEMBER(isDisplayStepOctaveSpecified) +MXAPI_EQUALS_MEMBER(isChord) +MXAPI_EQUALS_MEMBER(isTieStart) +MXAPI_EQUALS_MEMBER(isTieStop) +MXAPI_EQUALS_MEMBER(noteType) +MXAPI_EQUALS_MEMBER(pitchData) +MXAPI_EQUALS_MEMBER(userRequestedVoiceNumber) +MXAPI_EQUALS_MEMBER(stem) +MXAPI_EQUALS_MEMBER(tickTimePosition) +MXAPI_EQUALS_MEMBER(durationData) +MXAPI_EQUALS_MEMBER(beams) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(printData) +MXAPI_EQUALS_MEMBER(noteAttachmentData) +MXAPI_EQUALS_MEMBER(miscData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(NoteData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/OttavaData.h b/Sourcecode/include/mx/api/OttavaData.h index 67a154b4f..367125010 100644 --- a/Sourcecode/include/mx/api/OttavaData.h +++ b/Sourcecode/include/mx/api/OttavaData.h @@ -7,37 +7,34 @@ namespace mx { - namespace api - { - enum class OttavaType - { - unspecified, - o8va, // octave up - o8vb, // octave down - o15ma, // 2 octaves up - o15mb // 2 octaves down - }; +namespace api +{ +enum class OttavaType +{ + unspecified, + o8va, // octave up + o8vb, // octave down + o15ma, // 2 octaves up + o15mb // 2 octaves down +}; + +class OttavaStart +{ + public: + SpannerStart spannerStart; + OttavaType ottavaType; - class OttavaStart - { - public: - SpannerStart spannerStart; - OttavaType ottavaType; - - OttavaStart() - : spannerStart{} - , ottavaType{ OttavaType::unspecified } - { - - } - }; - - // SpannerStop is used for OttavaStops - - MXAPI_EQUALS_BEGIN( OttavaStart ) - MXAPI_EQUALS_MEMBER( spannerStart ) - MXAPI_EQUALS_MEMBER( ottavaType ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( OttavaStart ); + OttavaStart() : spannerStart{}, ottavaType{OttavaType::unspecified} + { } -} +}; + +// SpannerStop is used for OttavaStops + +MXAPI_EQUALS_BEGIN(OttavaStart) +MXAPI_EQUALS_MEMBER(spannerStart) +MXAPI_EQUALS_MEMBER(ottavaType) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(OttavaStart); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PageData.h b/Sourcecode/include/mx/api/PageData.h index 9a4cd843a..cfe1be972 100644 --- a/Sourcecode/include/mx/api/PageData.h +++ b/Sourcecode/include/mx/api/PageData.h @@ -13,50 +13,44 @@ namespace mx { - namespace api +namespace api +{ +/// PageData allows the specification of a new page, or the prevention of a new page, along with the ability +/// to change the page layout settings. In the score these are stored in a map where the map key is the measure +/// index of where the PageData takes effect in the score. +class PageData +{ + public: + inline explicit PageData(Bool inNewPage = Bool::unspecified, PageLayoutData inPageLayoutData = PageLayoutData{}, + std::optional inPageNumber = std::nullopt) + : newPage{inNewPage}, pageLayoutData{inPageLayoutData}, pageNumber{std::move(inPageNumber)} + { + } + + /// `yes` will cause a page break at the specified measure index or system index. `no` indicates that a + /// page break should be avoided. 'unspecified' means that no page-break attribute will be shown. + Bool newPage; + + /// Optionally change the page layout settings starting with this page (and continuing thereafter). The + /// default constructed PageLayoutData will not affect page layout. Page layout information will only be + /// written if you set one or more of its optional values. + PageLayoutData pageLayoutData; + + /// The displayed page number. std::nullopt indicates the absence of a page-number attribute. + std::optional pageNumber; + + /// Indicates whether any values have been assigned. + inline bool isUsed() const { - /// PageData allows the specification of a new page, or the prevention of a new page, along with the ability - /// to change the page layout settings. In the score these are stored in a map where the map key is the measure - /// index of where the PageData takes effect in the score. - class PageData - { - public: - inline explicit PageData( - Bool inNewPage = Bool::unspecified, - PageLayoutData inPageLayoutData = PageLayoutData{}, - std::optional inPageNumber = std::nullopt - ) - : newPage{ inNewPage } - , pageLayoutData{ inPageLayoutData } - , pageNumber{ std::move( inPageNumber ) } - { - - } - - /// `yes` will cause a page break at the specified measure index or system index. `no` indicates that a - /// page break should be avoided. 'unspecified' means that no page-break attribute will be shown. - Bool newPage; - - /// Optionally change the page layout settings starting with this page (and continuing thereafter). The - /// default constructed PageLayoutData will not affect page layout. Page layout information will only be - /// written if you set one or more of its optional values. - PageLayoutData pageLayoutData; - - /// The displayed page number. std::nullopt indicates the absence of a page-number attribute. - std::optional pageNumber; - - /// Indicates whether any values have been assigned. - inline bool isUsed() const - { - return isSpecified( newPage ) || pageLayoutData.isUsed() || pageNumber; - } - }; - - MXAPI_EQUALS_BEGIN( PageData ) - MXAPI_EQUALS_MEMBER( newPage ) - MXAPI_EQUALS_MEMBER( pageLayoutData ) - MXAPI_EQUALS_MEMBER( pageNumber ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PageData ); + return isSpecified(newPage) || pageLayoutData.isUsed() || pageNumber; } -} +}; + +MXAPI_EQUALS_BEGIN(PageData) +MXAPI_EQUALS_MEMBER(newPage) +MXAPI_EQUALS_MEMBER(pageLayoutData) +MXAPI_EQUALS_MEMBER(pageNumber) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PageData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PageLayoutData.h b/Sourcecode/include/mx/api/PageLayoutData.h index 353740746..16f882540 100644 --- a/Sourcecode/include/mx/api/PageLayoutData.h +++ b/Sourcecode/include/mx/api/PageLayoutData.h @@ -14,36 +14,32 @@ namespace mx { - namespace api +namespace api +{ +/// PageLayoutData allows for the setting of page sizes and margins. +class PageLayoutData +{ + public: + /// Page size, in tenths. + std::optional size; + + /// Page margin data (note all members of PageMarginsData are optional). + PageMarginsData margins; + + PageLayoutData() : size(std::nullopt), margins{} + { + } + + inline bool isUsed() const { - /// PageLayoutData allows for the setting of page sizes and margins. - class PageLayoutData - { - public: - - /// Page size, in tenths. - std::optional size; - - /// Page margin data (note all members of PageMarginsData are optional). - PageMarginsData margins; - - PageLayoutData() - : size( std::nullopt ) - , margins{} - { - - } - - inline bool isUsed() const - { - return size || margins.isUsed(); - } - }; - - MXAPI_EQUALS_BEGIN( PageLayoutData ) - MXAPI_EQUALS_MEMBER( size ) - MXAPI_EQUALS_MEMBER( margins ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PageLayoutData ); + return size || margins.isUsed(); } -} +}; + +MXAPI_EQUALS_BEGIN(PageLayoutData) +MXAPI_EQUALS_MEMBER(size) +MXAPI_EQUALS_MEMBER(margins) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PageLayoutData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PageMarginsData.h b/Sourcecode/include/mx/api/PageMarginsData.h index 89146ab8c..d132227d9 100644 --- a/Sourcecode/include/mx/api/PageMarginsData.h +++ b/Sourcecode/include/mx/api/PageMarginsData.h @@ -13,45 +13,42 @@ namespace mx { - namespace api +namespace api +{ + +/// Page margins are specified separately for odd and even pages. If odd and even pages have the same values, +/// then then a type of "both" will be used in the produced MusicXML. All values are optional. +class PageMarginsData +{ + public: + /// Margins for odd pages. + std::optional odd; + + /// Margins for even pages. + std::optional even; + + PageMarginsData() : odd{std::nullopt}, even{std::nullopt} { + } - /// Page margins are specified separately for odd and even pages. If odd and even pages have the same values, - /// then then a type of "both" will be used in the produced MusicXML. All values are optional. - class PageMarginsData - { - public: - /// Margins for odd pages. - std::optional odd; - - /// Margins for even pages. - std::optional even; - - PageMarginsData() - : odd{ std::nullopt } - , even{ std::nullopt } - { - - } - - /// Returns true if any values have been specified. If false, then PageMarginsData can be ignored. - inline bool isUsed() const - { - return odd || even; - } - - /// Returns true if the odd page margins are equal to the even page margins (i.e. if a 'both' attribute - /// type can be used in MusicXML). - inline bool same() const - { - return odd == even; - } - }; - - MXAPI_EQUALS_BEGIN( PageMarginsData ) - MXAPI_EQUALS_MEMBER( odd ) - MXAPI_EQUALS_MEMBER( even ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PageMarginsData ); + /// Returns true if any values have been specified. If false, then PageMarginsData can be ignored. + inline bool isUsed() const + { + return odd || even; + } + + /// Returns true if the odd page margins are equal to the even page margins (i.e. if a 'both' attribute + /// type can be used in MusicXML). + inline bool same() const + { + return odd == even; } -} +}; + +MXAPI_EQUALS_BEGIN(PageMarginsData) +MXAPI_EQUALS_MEMBER(odd) +MXAPI_EQUALS_MEMBER(even) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PageMarginsData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PageTextData.h b/Sourcecode/include/mx/api/PageTextData.h index 80e02411e..ba53bb18f 100644 --- a/Sourcecode/include/mx/api/PageTextData.h +++ b/Sourcecode/include/mx/api/PageTextData.h @@ -5,36 +5,37 @@ #pragma once #include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" #include "mx/api/FontData.h" +#include "mx/api/PositionData.h" #include #include namespace mx { - namespace api - { - - // distance values are in 'tenths' governed by the 'scaling' values +namespace api +{ + +// distance values are in 'tenths' governed by the 'scaling' values + +class PageTextData +{ + public: + std::string text; + int pageNumber; + PositionData positionData; + FontData fontData; + std::string description; // e.g. 'composer', 'page number', 'title', etc., this is metadata which does not appear on + // the printed page +}; - class PageTextData - { - public: - std::string text; - int pageNumber; - PositionData positionData; - FontData fontData; - std::string description; // e.g. 'composer', 'page number', 'title', etc., this is metadata which does not appear on the printed page - }; - - MXAPI_EQUALS_BEGIN( PageTextData ) - MXAPI_EQUALS_MEMBER( text ) - MXAPI_EQUALS_MEMBER( pageNumber ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( fontData ) - MXAPI_EQUALS_MEMBER( description ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PageTextData ); - } -} +MXAPI_EQUALS_BEGIN(PageTextData) +MXAPI_EQUALS_MEMBER(text) +MXAPI_EQUALS_MEMBER(pageNumber) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(fontData) +MXAPI_EQUALS_MEMBER(description) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PageTextData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PartData.h b/Sourcecode/include/mx/api/PartData.h index 25b3c8e6e..2914693aa 100644 --- a/Sourcecode/include/mx/api/PartData.h +++ b/Sourcecode/include/mx/api/PartData.h @@ -14,210 +14,192 @@ namespace mx { - namespace api +namespace api +{ +enum class SoloOrEnsemble +{ + unspecified, + solo, + ensemble +}; + +struct MidiData +{ + std::string virtualLibrary; + std::string virtualName; + std::string device; + std::string name; + + // -1 indicates absence of value + int bank; + + // -1 indicates absence of value + int channel; + + // -1 indicates absence of value + int program; + + // -1 indicates absence of value + int unpitched; + + // percent, valid range 0.0 to 100.0 + long double volume; + bool isVolumeSpecified; + + // rotation degrees, valid range -180.0 to +180.0 + long double pan; + bool isPanSpecified; + + // rotation degrees, valid range -180.0 to +180.0 + long double elevation; + bool isElevationSpecified; + + MidiData() + : virtualLibrary{}, virtualName{}, device{}, name{}, bank{-1}, channel{-1}, program{-1}, unpitched{-1}, + volume{0.0}, isVolumeSpecified{false}, pan{0.0}, isPanSpecified{false}, elevation{0.0}, + isElevationSpecified{false} { - enum class SoloOrEnsemble - { - unspecified, - solo, - ensemble - }; - - struct MidiData - { - std::string virtualLibrary; - std::string virtualName; - std::string device; - std::string name; - - // -1 indicates absence of value - int bank; - - // -1 indicates absence of value - int channel; - - // -1 indicates absence of value - int program; - - // -1 indicates absence of value - int unpitched; - - // percent, valid range 0.0 to 100.0 - long double volume; - bool isVolumeSpecified; - - // rotation degrees, valid range -180.0 to +180.0 - long double pan; - bool isPanSpecified; - - // rotation degrees, valid range -180.0 to +180.0 - long double elevation; - bool isElevationSpecified; - - MidiData() - : virtualLibrary{} - , virtualName{} - , device{} - , name{} - , bank{ -1 } - , channel{ -1 } - , program{ -1 } - , unpitched{ -1 } - , volume{ 0.0 } - , isVolumeSpecified{ false } - , pan{ 0.0 } - , isPanSpecified{ false } - , elevation{ 0.0 } - , isElevationSpecified{ false } - { - - } - }; + } +}; + +struct InstrumentData +{ + std::string uniqueId; + std::string name; + std::string abbreviation; + SoundID soundID; + SoloOrEnsemble soloOrEnsemble; + MidiData midiData; + + InstrumentData() + : uniqueId{}, name{}, abbreviation{}, soundID{SoundID::unspecified}, + soloOrEnsemble{SoloOrEnsemble::unspecified}, midiData{} + { + } +}; + +class PartData +{ + public: + std::string uniqueId; + + // because the MuscXML specification says this "Formatting + // attributes for the part-name element are deprecated in + // Version 2.0 in favor of the new part-name-display and + // part-abbreviation-display elements" the name will always + // be written with 'print-object="no". You must populate + // the displayName field in order to have a name displayed. + std::string name; + + // because the MuscXML specification says this "Formatting + // attributes for the part-name element are deprecated in + // Version 2.0 in favor of the new part-name-display and + // part-abbreviation-display elements" the abbreviation + // will always be written with 'print-object="no". You + // must populate the displayAbbreviation field in order to + // have an abbreviation displayed. + std::string abbreviation; + + std::string displayName; + PrintData displayNamePrintData; + PositionData displayNamePositionData; + + std::string displayAbbreviation; + PrintData displayAbbreviationPrintData; + PositionData displayAbbreviationPositionData; + + InstrumentData instrumentData; + + /// The initial transposition for the part. If the music entered into the part is not in + /// concert pitch, then this field is used to specify the transposition that is in- + /// effect. Note, MusicXML encodes transposition in the measure data, not in the part + /// data. Here we offer a convient way to set the transposition in the first measure of + /// the part. Subsequent transposition changes are not currently supported by mx::api. + std::optional transposition; + + std::vector measures; + + inline int getNumStaves() const + { + int numStaves = 0; - struct InstrumentData + for (const auto &measure : measures) { - std::string uniqueId; - std::string name; - std::string abbreviation; - SoundID soundID; - SoloOrEnsemble soloOrEnsemble; - MidiData midiData; - - InstrumentData() - : uniqueId{} - , name{} - , abbreviation{} - , soundID{ SoundID::unspecified } - , soloOrEnsemble{ SoloOrEnsemble::unspecified } - , midiData{} + int temp = static_cast(measure.staves.size()); + if (temp > numStaves) { - + numStaves = temp; } - }; - - class PartData + } + + return numStaves; + } + + inline int getMaxVoice() const + { + int maxVoice = 0; + + for (const auto &measure : measures) { - public: - std::string uniqueId; - - // because the MuscXML specification says this "Formatting - // attributes for the part-name element are deprecated in - // Version 2.0 in favor of the new part-name-display and - // part-abbreviation-display elements" the name will always - // be written with 'print-object="no". You must populate - // the displayName field in order to have a name displayed. - std::string name; - - // because the MuscXML specification says this "Formatting - // attributes for the part-name element are deprecated in - // Version 2.0 in favor of the new part-name-display and - // part-abbreviation-display elements" the abbreviation - // will always be written with 'print-object="no". You - // must populate the displayAbbreviation field in order to - // have an abbreviation displayed. - std::string abbreviation; - - std::string displayName; - PrintData displayNamePrintData; - PositionData displayNamePositionData; - - std::string displayAbbreviation; - PrintData displayAbbreviationPrintData; - PositionData displayAbbreviationPositionData; - - InstrumentData instrumentData; - - /// The initial transposition for the part. If the music entered into the part is not in - /// concert pitch, then this field is used to specify the transposition that is in- - /// effect. Note, MusicXML encodes transposition in the measure data, not in the part - /// data. Here we offer a convient way to set the transposition in the first measure of - /// the part. Subsequent transposition changes are not currently supported by mx::api. - std::optional transposition; - - std::vector measures; - - inline int getNumStaves() const + for (const auto &staff : measure.staves) { - int numStaves = 0; - - for( const auto& measure : measures ) + for (const auto &voice : staff.voices) { - int temp = static_cast( measure.staves.size() ); - if( temp > numStaves ) + int temp = static_cast(voice.first); + if (temp > maxVoice) { - numStaves = temp; + maxVoice = temp; } } - - return numStaves; } + } - inline int getMaxVoice() const - { - int maxVoice = 0; - - for( const auto& measure : measures ) - { - for( const auto& staff : measure.staves ) - { - for( const auto& voice : staff.voices ) - { - int temp = static_cast( voice.first ); - if( temp > maxVoice ) - { - maxVoice = temp; - } - } - - } - } - - return maxVoice; - } - }; - - MXAPI_EQUALS_BEGIN( MidiData ) - MXAPI_EQUALS_MEMBER( virtualLibrary ) - MXAPI_EQUALS_MEMBER( virtualName ) - MXAPI_EQUALS_MEMBER( device ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( bank ) - MXAPI_EQUALS_MEMBER( channel ) - MXAPI_EQUALS_MEMBER( program ) - MXAPI_EQUALS_MEMBER( unpitched ) - MXAPI_EQUALS_MEMBER( volume ) - MXAPI_EQUALS_MEMBER( isVolumeSpecified ) - MXAPI_EQUALS_MEMBER( pan ) - MXAPI_EQUALS_MEMBER( isPanSpecified ) - MXAPI_EQUALS_MEMBER( elevation ) - MXAPI_EQUALS_MEMBER( isElevationSpecified ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MidiData ); - - MXAPI_EQUALS_BEGIN( InstrumentData ) - MXAPI_EQUALS_MEMBER( uniqueId ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( abbreviation ) - MXAPI_EQUALS_MEMBER( soundID ) - MXAPI_EQUALS_MEMBER( soloOrEnsemble ) - MXAPI_EQUALS_MEMBER( midiData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( InstrumentData ); - - MXAPI_EQUALS_BEGIN( PartData ) - MXAPI_EQUALS_MEMBER( uniqueId ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( abbreviation ) - MXAPI_EQUALS_MEMBER( displayName ) - MXAPI_EQUALS_MEMBER( displayNamePrintData ) - MXAPI_EQUALS_MEMBER( displayNamePositionData ) - MXAPI_EQUALS_MEMBER( displayAbbreviation ) - MXAPI_EQUALS_MEMBER( displayAbbreviationPrintData ) - MXAPI_EQUALS_MEMBER( displayAbbreviationPositionData ) - MXAPI_EQUALS_MEMBER( instrumentData ) - MXAPI_EQUALS_MEMBER( transposition ) - MXAPI_EQUALS_MEMBER( measures ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PartData ); + return maxVoice; } -} +}; + +MXAPI_EQUALS_BEGIN(MidiData) +MXAPI_EQUALS_MEMBER(virtualLibrary) +MXAPI_EQUALS_MEMBER(virtualName) +MXAPI_EQUALS_MEMBER(device) +MXAPI_EQUALS_MEMBER(name) +MXAPI_EQUALS_MEMBER(bank) +MXAPI_EQUALS_MEMBER(channel) +MXAPI_EQUALS_MEMBER(program) +MXAPI_EQUALS_MEMBER(unpitched) +MXAPI_EQUALS_MEMBER(volume) +MXAPI_EQUALS_MEMBER(isVolumeSpecified) +MXAPI_EQUALS_MEMBER(pan) +MXAPI_EQUALS_MEMBER(isPanSpecified) +MXAPI_EQUALS_MEMBER(elevation) +MXAPI_EQUALS_MEMBER(isElevationSpecified) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(MidiData); + +MXAPI_EQUALS_BEGIN(InstrumentData) +MXAPI_EQUALS_MEMBER(uniqueId) +MXAPI_EQUALS_MEMBER(name) +MXAPI_EQUALS_MEMBER(abbreviation) +MXAPI_EQUALS_MEMBER(soundID) +MXAPI_EQUALS_MEMBER(soloOrEnsemble) +MXAPI_EQUALS_MEMBER(midiData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(InstrumentData); + +MXAPI_EQUALS_BEGIN(PartData) +MXAPI_EQUALS_MEMBER(uniqueId) +MXAPI_EQUALS_MEMBER(name) +MXAPI_EQUALS_MEMBER(abbreviation) +MXAPI_EQUALS_MEMBER(displayName) +MXAPI_EQUALS_MEMBER(displayNamePrintData) +MXAPI_EQUALS_MEMBER(displayNamePositionData) +MXAPI_EQUALS_MEMBER(displayAbbreviation) +MXAPI_EQUALS_MEMBER(displayAbbreviationPrintData) +MXAPI_EQUALS_MEMBER(displayAbbreviationPositionData) +MXAPI_EQUALS_MEMBER(instrumentData) +MXAPI_EQUALS_MEMBER(transposition) +MXAPI_EQUALS_MEMBER(measures) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PartData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PartGroupData.h b/Sourcecode/include/mx/api/PartGroupData.h index 42c7e66de..b1719abcf 100644 --- a/Sourcecode/include/mx/api/PartGroupData.h +++ b/Sourcecode/include/mx/api/PartGroupData.h @@ -9,70 +9,65 @@ namespace mx { - namespace api - { - enum class BracketType - { - unspecified, - none, - brace, - line, - bracket, - square - }; +namespace api +{ +enum class BracketType +{ + unspecified, + none, + brace, + line, + bracket, + square +}; + +// The part-group element indicates groupings of parts in the score, usually indicated +// by braces and brackets. Braces that are used for multi-staff parts should be defined +// in the attributes element for that part. The part-group start element appears before +// the first score-part in the group. The part-group stop element appears after the +// last score-part in the group. + +// The number attribute is used to distinguish overlapping and nested part-groups, not +// the sequence of groups. As with parts, groups can have a name and abbreviation. +// Values for the child elements are ignored at the stop of a group. + +// A part-group element is not needed for a single multi-staff part. By default, multi- +// staff parts include a brace symbol and (if appropriate given the bar-style) common +// barlines. The symbol formatting for a multi-staff part can be more fully specified +// using the part-symbol element. - // The part-group element indicates groupings of parts in the score, usually indicated - // by braces and brackets. Braces that are used for multi-staff parts should be defined - // in the attributes element for that part. The part-group start element appears before - // the first score-part in the group. The part-group stop element appears after the - // last score-part in the group. - - // The number attribute is used to distinguish overlapping and nested part-groups, not - // the sequence of groups. As with parts, groups can have a name and abbreviation. - // Values for the child elements are ignored at the stop of a group. - - // A part-group element is not needed for a single multi-staff part. By default, multi- - // staff parts include a brace symbol and (if appropriate given the bar-style) common - // barlines. The symbol formatting for a multi-staff part can be more fully specified - // using the part-symbol element. - - class PartGroupData - { - public: - int firstPartIndex; - int lastPartIndex; - std::string name; - std::string displayName; - std::string abbreviation; - std::string displayAbbreviation; - BracketType bracketType; - // TODO - group barline - // TODO - group time - // TODO - group editorial - - // The number attribute is used to distinguish overlapping - // and nested part-groups, not the sequence of groups. - // -1 indicates the absence of a number attribute - int number; - - PartGroupData() - : firstPartIndex{ -1 } - , lastPartIndex{ -1 } - , name{} - , number{ -1 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( PartGroupData ) - MXAPI_EQUALS_MEMBER( firstPartIndex ) - MXAPI_EQUALS_MEMBER( lastPartIndex ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( displayName ) - MXAPI_EQUALS_MEMBER( abbreviation ) - MXAPI_EQUALS_MEMBER( displayAbbreviation ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PartGroupData ); +class PartGroupData +{ + public: + int firstPartIndex; + int lastPartIndex; + std::string name; + std::string displayName; + std::string abbreviation; + std::string displayAbbreviation; + BracketType bracketType; + // TODO - group barline + // TODO - group time + // TODO - group editorial + + // The number attribute is used to distinguish overlapping + // and nested part-groups, not the sequence of groups. + // -1 indicates the absence of a number attribute + int number; + + PartGroupData() : firstPartIndex{-1}, lastPartIndex{-1}, name{}, number{-1} + { } -} +}; + +MXAPI_EQUALS_BEGIN(PartGroupData) +MXAPI_EQUALS_MEMBER(firstPartIndex) +MXAPI_EQUALS_MEMBER(lastPartIndex) +MXAPI_EQUALS_MEMBER(name) +MXAPI_EQUALS_MEMBER(displayName) +MXAPI_EQUALS_MEMBER(abbreviation) +MXAPI_EQUALS_MEMBER(displayAbbreviation) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PartGroupData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PitchData.h b/Sourcecode/include/mx/api/PitchData.h index ee8441b4e..fa81ed60e 100644 --- a/Sourcecode/include/mx/api/PitchData.h +++ b/Sourcecode/include/mx/api/PitchData.h @@ -8,146 +8,134 @@ namespace mx { - namespace api +namespace api +{ +enum class Step +{ + c = 0, + d = 1, + e = 2, + f = 3, + g = 4, + a = 5, + b = 6, + unspecified = -1 +}; + +enum class Accidental +{ + // none means the note does not have an accidental + none, + + // the rest of these values map to the musicxml specification + sharp, + natural, + flat, + doubleSharp, + sharpSharp, + flatFlat, + naturalSharp, + naturalFlat, + quarterFlat, + quarterSharp, + threeQuartersFlat, + threeQuartersSharp, + sharpDown, + sharpUp, + naturalDown, + naturalUp, + flatDown, + flatUp, + tripleSharp, + tripleFlat, + slashQuarterSharp, + slashSharp, + slashFlat, + doubleSlashFlat, + sharp1, + sharp2, + sharp3, + sharp5, + flat1, + flat2, + flat3, + flat4, + sori, + koron +}; + +struct PitchData +{ + // default construction is middle c (c4) + PitchData(); + + constexpr explicit PitchData(Step inStep, int inAlter = 0, int inOctave = 4, + Accidental inAccidental = Accidental::none, + + // less-often used params last + double inCents = 0.0, bool inIsAccidentalParenthetical = false, + bool inIsAccidentalCautionary = false, bool inIsAccidentalEditorial = false, + bool inIsAccidentalBracketed = false) + : step{inStep}, alter{inAlter}, cents{inCents}, accidental{inAccidental}, + isAccidentalParenthetical{inIsAccidentalParenthetical}, isAccidentalCautionary{inIsAccidentalCautionary}, + isAccidentalEditorial{inIsAccidentalEditorial}, isAccidentalBracketed{inIsAccidentalBracketed}, + octave{inOctave} { - enum class Step - { - c = 0, - d = 1, - e = 2, - f = 3, - g = 4, - a = 5, - b = 6, - unspecified = -1 - }; - - enum class Accidental - { - // none means the note does not have an accidental - none, - - // the rest of these values map to the musicxml specification - sharp, - natural, - flat, - doubleSharp, - sharpSharp, - flatFlat, - naturalSharp, - naturalFlat, - quarterFlat, - quarterSharp, - threeQuartersFlat, - threeQuartersSharp, - sharpDown, - sharpUp, - naturalDown, - naturalUp, - flatDown, - flatUp, - tripleSharp, - tripleFlat, - slashQuarterSharp, - slashSharp, - slashFlat, - doubleSlashFlat, - sharp1, - sharp2, - sharp3, - sharp5, - flat1, - flat2, - flat3, - flat4, - sori, - koron - }; - - struct PitchData - { - // default construction is middle c (c4) - PitchData(); - - constexpr explicit PitchData( - Step inStep, - int inAlter = 0, - int inOctave = 4, - Accidental inAccidental = Accidental::none, - - // less-often used params last - double inCents = 0.0, - bool inIsAccidentalParenthetical = false, - bool inIsAccidentalCautionary = false, - bool inIsAccidentalEditorial = false, - bool inIsAccidentalBracketed = false - ) - : step{ inStep } - , alter{ inAlter } - , cents{ inCents } - , accidental{ inAccidental } - , isAccidentalParenthetical{ inIsAccidentalParenthetical } - , isAccidentalCautionary{ inIsAccidentalCautionary } - , isAccidentalEditorial{ inIsAccidentalEditorial } - , isAccidentalBracketed{ inIsAccidentalBracketed } - , octave{ inOctave } - { - - } - - // the note name. i.e. c, d, e, f, g, a, b - Step step; - - // the alteration (number of semitones of pitch distance) from the step. for example, if step is 'c' and - // alter is 1, then the sounding pitch is c#. if step is 'd' and alter is -2, then the sounding pitch is - // 'c' (i.e. d double flat). alter only affects the sounding pitch of the note. accidentals are applied - // independently. alter is always required to produce the correct sounding pitch, regardless of key - // signature or accidentals. - int alter; - - // additional alteration to the sounding pitch (in hundredths of a semitone). the MusicXML alter value is - // a floating point number to facilitate microtonal music. however for mx::api we wanted the simplicity of - // dealing with integrals for the more common case on non-microtonal music. in order to still support - // microtones without resorting to a floating-point alter value, we break out microtonal adjustments to a - // separate 'cents' field, which will be added to the alter integral: - // = (double)alter + (cents / 100.0) - double cents; - - // in MusicXML, the accidental is completely independent of the sounding pitch and is only present when you - // actually want to show the accidental in the notated music. i.e. accidental is purely visual. for example, - // if you have a measure consisting of repeated c# notes, you would typically notate this with an accidental - // on the first note only. the rest of the notes of the measure would be 'sharped' by virtue of the first - // note's sharp. in MusicXML, the first note should have an accidental of 'sharp' and an alter of '1', and - // the remaining notes of the measure should have an accidental of 'none' and an alter of '1'. - Accidental accidental; - bool isAccidentalParenthetical; - bool isAccidentalCautionary; - bool isAccidentalEditorial; - bool isAccidentalBracketed; - - // which octave the note is located in. middle c is in octave 4. - int octave; - - // automatically set the Accidental enum value by parsing the alter value (does not consider the value of - // cents). this is a convenience function that simply adds the correct accidental given the current value - // of alter. for example, if alter is 1, then showAccidental will set the accidental field to 'sharp'. - void showAccidental(); - - // set the accidental value to 'none' and clear out the other accidental-related values - void hideAccidental(); - }; - - MXAPI_EQUALS_BEGIN( PitchData ) - MXAPI_EQUALS_MEMBER( step ) - MXAPI_EQUALS_MEMBER( alter ) - MXAPI_DOUBLES_EQUALS_MEMBER( cents ) - MXAPI_EQUALS_MEMBER( accidental ) - MXAPI_EQUALS_MEMBER( isAccidentalParenthetical ) - MXAPI_EQUALS_MEMBER( isAccidentalCautionary ) - MXAPI_EQUALS_MEMBER( isAccidentalEditorial ) - MXAPI_EQUALS_MEMBER( isAccidentalBracketed ) - MXAPI_EQUALS_MEMBER( octave ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PitchData ); } -} + + // the note name. i.e. c, d, e, f, g, a, b + Step step; + + // the alteration (number of semitones of pitch distance) from the step. for example, if step is 'c' and + // alter is 1, then the sounding pitch is c#. if step is 'd' and alter is -2, then the sounding pitch is + // 'c' (i.e. d double flat). alter only affects the sounding pitch of the note. accidentals are applied + // independently. alter is always required to produce the correct sounding pitch, regardless of key + // signature or accidentals. + int alter; + + // additional alteration to the sounding pitch (in hundredths of a semitone). the MusicXML alter value is + // a floating point number to facilitate microtonal music. however for mx::api we wanted the simplicity of + // dealing with integrals for the more common case on non-microtonal music. in order to still support + // microtones without resorting to a floating-point alter value, we break out microtonal adjustments to a + // separate 'cents' field, which will be added to the alter integral: + // = (double)alter + (cents / 100.0) + double cents; + + // in MusicXML, the accidental is completely independent of the sounding pitch and is only present when you + // actually want to show the accidental in the notated music. i.e. accidental is purely visual. for example, + // if you have a measure consisting of repeated c# notes, you would typically notate this with an accidental + // on the first note only. the rest of the notes of the measure would be 'sharped' by virtue of the first + // note's sharp. in MusicXML, the first note should have an accidental of 'sharp' and an alter of '1', and + // the remaining notes of the measure should have an accidental of 'none' and an alter of '1'. + Accidental accidental; + bool isAccidentalParenthetical; + bool isAccidentalCautionary; + bool isAccidentalEditorial; + bool isAccidentalBracketed; + + // which octave the note is located in. middle c is in octave 4. + int octave; + + // automatically set the Accidental enum value by parsing the alter value (does not consider the value of + // cents). this is a convenience function that simply adds the correct accidental given the current value + // of alter. for example, if alter is 1, then showAccidental will set the accidental field to 'sharp'. + void showAccidental(); + + // set the accidental value to 'none' and clear out the other accidental-related values + void hideAccidental(); +}; + +MXAPI_EQUALS_BEGIN(PitchData) +MXAPI_EQUALS_MEMBER(step) +MXAPI_EQUALS_MEMBER(alter) +MXAPI_DOUBLES_EQUALS_MEMBER(cents) +MXAPI_EQUALS_MEMBER(accidental) +MXAPI_EQUALS_MEMBER(isAccidentalParenthetical) +MXAPI_EQUALS_MEMBER(isAccidentalCautionary) +MXAPI_EQUALS_MEMBER(isAccidentalEditorial) +MXAPI_EQUALS_MEMBER(isAccidentalBracketed) +MXAPI_EQUALS_MEMBER(octave) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PitchData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PositionData.h b/Sourcecode/include/mx/api/PositionData.h index 1fb9176fe..5f7f5abcc 100644 --- a/Sourcecode/include/mx/api/PositionData.h +++ b/Sourcecode/include/mx/api/PositionData.h @@ -70,76 +70,65 @@ namespace mx { - namespace api - { - // all distance values are in 'tenths' - - enum class VerticalAlignment - { - unspecified, - top, - middle, - bottom, - baseline - }; - - enum class HorizontalAlignment - { - unspecified, - left, - center, - right - }; +namespace api +{ +// all distance values are in 'tenths' - class PositionData - { - public: +enum class VerticalAlignment +{ + unspecified, + top, + middle, + bottom, + baseline +}; - // decimal values are in 'tenths' +enum class HorizontalAlignment +{ + unspecified, + left, + center, + right +}; - long double defaultX; - bool isDefaultXSpecified; - long double defaultY; - bool isDefaultYSpecified; - long double relativeX; - bool isRelativeXSpecified; - long double relativeY; - bool isRelativeYSpecified; - Placement placement; - VerticalAlignment verticalAlignment; - HorizontalAlignment horizontalAlignmnet; +class PositionData +{ + public: + // decimal values are in 'tenths' - PositionData() - : defaultX( 0.0 ) - , isDefaultXSpecified( false ) - , defaultY( 0.0 ) - , isDefaultYSpecified( false ) - , relativeX( 0.0 ) - , isRelativeXSpecified( false ) - , relativeY( 0.0 ) - , isRelativeYSpecified( false ) - , placement( Placement::unspecified ) - , verticalAlignment( VerticalAlignment::unspecified ) - , horizontalAlignmnet( HorizontalAlignment::unspecified ) - { + long double defaultX; + bool isDefaultXSpecified; + long double defaultY; + bool isDefaultYSpecified; + long double relativeX; + bool isRelativeXSpecified; + long double relativeY; + bool isRelativeYSpecified; + Placement placement; + VerticalAlignment verticalAlignment; + HorizontalAlignment horizontalAlignmnet; - } - }; - - - MXAPI_EQUALS_BEGIN( PositionData ) - MXAPI_DOUBLES_EQUALS_MEMBER( defaultX ) - MXAPI_EQUALS_MEMBER( isDefaultXSpecified ) - MXAPI_DOUBLES_EQUALS_MEMBER( defaultY ) - MXAPI_EQUALS_MEMBER( isDefaultYSpecified ) - MXAPI_DOUBLES_EQUALS_MEMBER( relativeX ) - MXAPI_EQUALS_MEMBER( isRelativeXSpecified ) - MXAPI_DOUBLES_EQUALS_MEMBER( relativeY ) - MXAPI_EQUALS_MEMBER( isRelativeYSpecified ) - MXAPI_EQUALS_MEMBER( placement ) - MXAPI_EQUALS_MEMBER( verticalAlignment ) - MXAPI_EQUALS_MEMBER( horizontalAlignmnet ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PositionData ); + PositionData() + : defaultX(0.0), isDefaultXSpecified(false), defaultY(0.0), isDefaultYSpecified(false), relativeX(0.0), + isRelativeXSpecified(false), relativeY(0.0), isRelativeYSpecified(false), placement(Placement::unspecified), + verticalAlignment(VerticalAlignment::unspecified), horizontalAlignmnet(HorizontalAlignment::unspecified) + { } -} +}; + +MXAPI_EQUALS_BEGIN(PositionData) +MXAPI_DOUBLES_EQUALS_MEMBER(defaultX) +MXAPI_EQUALS_MEMBER(isDefaultXSpecified) +MXAPI_DOUBLES_EQUALS_MEMBER(defaultY) +MXAPI_EQUALS_MEMBER(isDefaultYSpecified) +MXAPI_DOUBLES_EQUALS_MEMBER(relativeX) +MXAPI_EQUALS_MEMBER(isRelativeXSpecified) +MXAPI_DOUBLES_EQUALS_MEMBER(relativeY) +MXAPI_EQUALS_MEMBER(isRelativeYSpecified) +MXAPI_EQUALS_MEMBER(placement) +MXAPI_EQUALS_MEMBER(verticalAlignment) +MXAPI_EQUALS_MEMBER(horizontalAlignmnet) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PositionData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/PrintData.h b/Sourcecode/include/mx/api/PrintData.h index ef0cb056e..60be073c5 100644 --- a/Sourcecode/include/mx/api/PrintData.h +++ b/Sourcecode/include/mx/api/PrintData.h @@ -5,37 +5,32 @@ #pragma once #include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" -#include "mx/api/FontData.h" #include "mx/api/ColorData.h" +#include "mx/api/FontData.h" +#include "mx/api/PositionData.h" namespace mx { - namespace api - { - struct PrintData - { - Bool printObject; - FontData fontData; - bool isColorSpecified; - ColorData color; +namespace api +{ +struct PrintData +{ + Bool printObject; + FontData fontData; + bool isColorSpecified; + ColorData color; - PrintData() - : printObject{ Bool::unspecified } - , fontData{} - , isColorSpecified{ false } - , color{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( PrintData ) - MXAPI_EQUALS_MEMBER( printObject ) - MXAPI_EQUALS_MEMBER( fontData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( color ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PrintData ); + PrintData() : printObject{Bool::unspecified}, fontData{}, isColorSpecified{false}, color{} + { } -} +}; + +MXAPI_EQUALS_BEGIN(PrintData) +MXAPI_EQUALS_MEMBER(printObject) +MXAPI_EQUALS_MEMBER(fontData) +MXAPI_EQUALS_MEMBER(isColorSpecified) +MXAPI_EQUALS_MEMBER(color) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(PrintData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/RehearsalData.h b/Sourcecode/include/mx/api/RehearsalData.h index 4d21bc563..309382b35 100644 --- a/Sourcecode/include/mx/api/RehearsalData.h +++ b/Sourcecode/include/mx/api/RehearsalData.h @@ -10,37 +10,32 @@ namespace mx { - namespace api +namespace api +{ +class RehearsalData +{ + public: + std::string text; + PositionData positionData; + bool isColorSpecified; + ColorData colorData; + FontData fontData; + + // Additional data about enclosing shape is available + // but not supported at this time. + + RehearsalData() : text{}, positionData{}, isColorSpecified{false}, colorData{}, fontData{} { - class RehearsalData - { - public: - std::string text; - PositionData positionData; - bool isColorSpecified; - ColorData colorData; - FontData fontData; - - // Additional data about enclosing shape is available - // but not supported at this time. - - RehearsalData() - : text{} - , positionData{} - , isColorSpecified{ false } - , colorData{} - , fontData{} - { - } - }; - - MXAPI_EQUALS_BEGIN( RehearsalData ) - MXAPI_EQUALS_MEMBER( text ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_MEMBER( fontData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( RehearsalData ); } -} +}; + +MXAPI_EQUALS_BEGIN(RehearsalData) +MXAPI_EQUALS_MEMBER(text) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(isColorSpecified) +MXAPI_EQUALS_MEMBER(colorData) +MXAPI_EQUALS_MEMBER(fontData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(RehearsalData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/ScoreData.h b/Sourcecode/include/mx/api/ScoreData.h index 7e824e8e8..290d6f087 100644 --- a/Sourcecode/include/mx/api/ScoreData.h +++ b/Sourcecode/include/mx/api/ScoreData.h @@ -19,77 +19,77 @@ namespace mx { - namespace api - { - enum class MusicXmlVersion - { - unspecified, - ThreePointZero, - }; +namespace api +{ +enum class MusicXmlVersion +{ + unspecified, + ThreePointZero, +}; + +class ScoreData +{ + public: + ScoreData(); + MusicXmlVersion musicXmlVersion; + std::string musicXmlType; + std::string workTitle; + std::string workNumber; + std::string movementTitle; + std::string movementNumber; + std::string composer; + std::string lyricist; + std::string arranger; + std::string publisher; + std::string copyright; + EncodingData encoding; + std::vector pageTextItems; + + /// Specifies the scaling factor (`tenths` and `millimeters`), the default page sizes and margins, and the + /// default system spacing and margins. Corresponds to the `` MusicXML element. (Note this field + /// used to be named `layout` and was renamed to `defaults` in v0.5.0.) + DefaultsData defaults; + std::vector parts; + std::vector partGroups; + int ticksPerQuarter; - class ScoreData - { - public: - ScoreData(); - MusicXmlVersion musicXmlVersion; - std::string musicXmlType; - std::string workTitle; - std::string workNumber; - std::string movementTitle; - std::string movementNumber; - std::string composer; - std::string lyricist; - std::string arranger; - std::string publisher; - std::string copyright; - EncodingData encoding; - std::vector pageTextItems; + /// Specifies page breaks, system breaks, and changes to system and page layout. Global/default page and + /// system layout settings should be set in `defaults`. MeasureIndex is the index of the measure in which + /// the layout/break is applied. For example, a newPage at MeasureIndex 10 indicates that measure index 10 + /// will be the first measure on a new page. `layout` corresponds to the `` MusicXML element. (Note: + /// prior to v0.5.0 we had `std::set systems`. The `layout` map replaces `systems`.) + std::map layout; - /// Specifies the scaling factor (`tenths` and `millimeters`), the default page sizes and margins, and the - /// default system spacing and margins. Corresponds to the `` MusicXML element. (Note this field - /// used to be named `layout` and was renamed to `defaults` in v0.5.0.) - DefaultsData defaults; - std::vector parts; - std::vector partGroups; - int ticksPerQuarter; + int getNumMeasures() const; + int getNumStavesPerSystem() const; - /// Specifies page breaks, system breaks, and changes to system and page layout. Global/default page and - /// system layout settings should be set in `defaults`. MeasureIndex is the index of the measure in which - /// the layout/break is applied. For example, a newPage at MeasureIndex 10 indicates that measure index 10 - /// will be the first measure on a new page. `layout` corresponds to the `` MusicXML element. (Note: - /// prior to v0.5.0 we had `std::set systems`. The `layout` map replaces `systems`.) - std::map layout; + /// sorts all of the events, directions, etc. + /// it is good to call this before writing to xml. + void sort(); +}; - int getNumMeasures() const; - int getNumStavesPerSystem() const; +std::vector::iterator findPart(std::vector &inParts, const std::string &inPartId); - /// sorts all of the events, directions, etc. - /// it is good to call this before writing to xml. - void sort(); - }; - - std::vector::iterator findPart( std::vector& inParts, const std::string& inPartId ); - - MXAPI_EQUALS_BEGIN( ScoreData ) - MXAPI_EQUALS_MEMBER( musicXmlVersion ) - MXAPI_EQUALS_MEMBER( musicXmlType ) - MXAPI_EQUALS_MEMBER( workTitle ) - MXAPI_EQUALS_MEMBER( workNumber ) - MXAPI_EQUALS_MEMBER( movementTitle ) - MXAPI_EQUALS_MEMBER( movementNumber ) - MXAPI_EQUALS_MEMBER( composer ) - MXAPI_EQUALS_MEMBER( lyricist ) - MXAPI_EQUALS_MEMBER( arranger ) - MXAPI_EQUALS_MEMBER( publisher ) - MXAPI_EQUALS_MEMBER( copyright ) - MXAPI_EQUALS_MEMBER( encoding ) - MXAPI_EQUALS_MEMBER( pageTextItems ) - MXAPI_EQUALS_MEMBER( defaults ) - MXAPI_EQUALS_MEMBER( parts ) - MXAPI_EQUALS_MEMBER( partGroups ) - MXAPI_EQUALS_MEMBER( ticksPerQuarter ) - MXAPI_EQUALS_MEMBER( layout ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( ScoreData ); - } -} +MXAPI_EQUALS_BEGIN(ScoreData) +MXAPI_EQUALS_MEMBER(musicXmlVersion) +MXAPI_EQUALS_MEMBER(musicXmlType) +MXAPI_EQUALS_MEMBER(workTitle) +MXAPI_EQUALS_MEMBER(workNumber) +MXAPI_EQUALS_MEMBER(movementTitle) +MXAPI_EQUALS_MEMBER(movementNumber) +MXAPI_EQUALS_MEMBER(composer) +MXAPI_EQUALS_MEMBER(lyricist) +MXAPI_EQUALS_MEMBER(arranger) +MXAPI_EQUALS_MEMBER(publisher) +MXAPI_EQUALS_MEMBER(copyright) +MXAPI_EQUALS_MEMBER(encoding) +MXAPI_EQUALS_MEMBER(pageTextItems) +MXAPI_EQUALS_MEMBER(defaults) +MXAPI_EQUALS_MEMBER(parts) +MXAPI_EQUALS_MEMBER(partGroups) +MXAPI_EQUALS_MEMBER(ticksPerQuarter) +MXAPI_EQUALS_MEMBER(layout) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(ScoreData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/SegnoData.h b/Sourcecode/include/mx/api/SegnoData.h index 592b01fd4..eb72bdee0 100644 --- a/Sourcecode/include/mx/api/SegnoData.h +++ b/Sourcecode/include/mx/api/SegnoData.h @@ -10,28 +10,25 @@ namespace mx { - namespace api - { - class SegnoData - { - public: - PositionData positionData; - bool isColorSpecified; - ColorData colorData; +namespace api +{ +class SegnoData +{ + public: + PositionData positionData; + bool isColorSpecified; + ColorData colorData; - SegnoData() - : positionData{} - , isColorSpecified{ false } - , colorData{} - { - } - }; - - MXAPI_EQUALS_BEGIN( SegnoData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SegnoData ); + SegnoData() : positionData{}, isColorSpecified{false}, colorData{} + { } -} +}; + +MXAPI_EQUALS_BEGIN(SegnoData) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(isColorSpecified) +MXAPI_EQUALS_MEMBER(colorData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(SegnoData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/SizeData.h b/Sourcecode/include/mx/api/SizeData.h index d8d117210..705b6ec3d 100644 --- a/Sourcecode/include/mx/api/SizeData.h +++ b/Sourcecode/include/mx/api/SizeData.h @@ -13,37 +13,33 @@ namespace mx { - namespace api { - - /// A separate class is used for page size (and other sizes) because both of its members, height and width are - /// required when either is present. i.e. they are inseparable. - class SizeData { - public: - - /// Page height in tenths. - Double height; - - /// Page width in tenths. - Double width; - - inline explicit SizeData( Double inHeight, Double inWidth ) - : height{ inHeight } - , width{ inWidth } - { +namespace api +{ - } +/// A separate class is used for page size (and other sizes) because both of its members, height and width are +/// required when either is present. i.e. they are inseparable. +class SizeData +{ + public: + /// Page height in tenths. + Double height; - inline SizeData() - : SizeData{ 0.0, 0.0 } - { + /// Page width in tenths. + Double width; - } - }; + inline explicit SizeData(Double inHeight, Double inWidth) : height{inHeight}, width{inWidth} + { + } - MXAPI_EQUALS_BEGIN( SizeData ) - MXAPI_EQUALS_MEMBER( height ) - MXAPI_EQUALS_MEMBER( width ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SizeData ); + inline SizeData() : SizeData{0.0, 0.0} + { } -} +}; + +MXAPI_EQUALS_BEGIN(SizeData) +MXAPI_EQUALS_MEMBER(height) +MXAPI_EQUALS_MEMBER(width) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(SizeData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/SoundID.h b/Sourcecode/include/mx/api/SoundID.h index cd420abc0..85da8d0fc 100644 --- a/Sourcecode/include/mx/api/SoundID.h +++ b/Sourcecode/include/mx/api/SoundID.h @@ -6,910 +6,910 @@ #include -//#include "mx/api/ApiCommon.h" -//#include "mx/api/PositionData.h" -//#include "mx/api/ColorData.h" -//#include "mx/api/FontData.h" +// #include "mx/api/ApiCommon.h" +// #include "mx/api/PositionData.h" +// #include "mx/api/ColorData.h" +// #include "mx/api/FontData.h" namespace mx { - namespace api - { - enum class SoundID; +namespace api +{ +enum class SoundID; - std::string SoundIDToString( SoundID inSoundID ); - SoundID SoundIDFromString( const std::string& inString ); +std::string SoundIDToString(SoundID inSoundID); +SoundID SoundIDFromString(const std::string &inString); - enum class SoundID - { - unspecified, - errorBadString, - brassAlphorn, - brassAltoHorn, - brassBaritoneHorn, - brassBugle, - brassBugleAlto, - brassBugleBaritone, - brassBugleContrabass, - brassBugleEuphoniumBugle, - brassBugleMellophoneBugle, - brassBugleSoprano, - brassCimbasso, - brassConchShell, - brassCornet, - brassCornetSoprano, - brassCornett, - brassCornettTenor, - brassCornettino, - brassDidgeridoo, - brassEuphonium, - brassFiscorn, - brassFlugelhorn, - brassFrenchHorn, - brassGroup, - brassGroupSynth, - brassHelicon, - brassHoragai, - brassKuhlohorn, - brassMellophone, - brassNaturalHorn, - brassOphicleide, - brassPosthorn, - brassRagDung, - brassSackbutt, - brassSackbuttAlto, - brassSackbuttBass, - brassSackbuttTenor, - brassSaxhorn, - brassSerpent, - brassShofar, - brassSousaphone, - brassTrombone, - brassTromboneAlto, - brassTromboneBass, - brassTromboneContrabass, - brassTromboneTenor, - brassTrumpet, - brassTrumpetBaroque, - brassTrumpetBass, - brassTrumpetBflat, - brassTrumpetC, - brassTrumpetD, - brassTrumpetPiccolo, - brassTrumpetPocket, - brassTrumpetSlide, - brassTrumpetTenor, - brassTuba, - brassTubaBass, - brassTubaSubcontrabass, - brassViennaHorn, - brassVuvuzela, - brassWagnerTuba, - drumApentemma, - drumAshiko, - drumAtabaque, - drumAtoke, - drumAtsimevu, - drumAxatse, - drumBassDrum, - drumBata, - drumBataItotele, - drumBataIya, - drumBataOkonkolo, - drumBendir, - drumBodhran, - drumBombo, - drumBongo, - drumBougarabou, - drumBuffaloDrum, - drumCajon, - drumChenda, - drumChuDaiko, - drumConga, - drumCuica, - drumDabakan, - drumDaff, - drumDafli, - drumDaibyosi, - drumDamroo, - drumDarabuka, - drumDef, - drumDhol, - drumDholak, - drumDjembe, - drumDoira, - drumDondo, - drumDounDounBa, - drumDuff, - drumDumbek, - drumFontomfrom, - drumFrameDrum, - drumFrameDrumArabian, - drumGeduk, - drumGhatam, - drumGome, - drumGroup, - drumGroupChinese, - drumGroupEwe, - drumGroupIndian, - drumGroupSet, - drumHandDrum, - drumHiraDaiko, - drumIbo, - drumIgihumurizo, - drumInyahura, - drumIshakwe, - drumJangGu, - drumKagan, - drumKakko, - drumKanjira, - drumKendhang, - drumKendhangAgeng, - drumKendhangCiblon, - drumKenkeni, - drumKhol, - drumKickDrum, - drumKidi, - drumKoDaiko, - drumKpanlogo, - drumKudum, - drumLambeg, - drumLionDrum, - drumLogDrum, - drumLogDrumAfrican, - drumLogDrumNative, - drumLogDrumNigerian, - drumMadal, - drumMaddale, - drumMridangam, - drumNaal, - drumNagadoDaiko, - drumNagara, - drumNaqara, - drumODaiko, - drumOkawa, - drumOkedoDaiko, - drumPahuHula, - drumPakhawaj, - drumPandeiro, - drumPandero, - drumPowwow, - drumPueblo, - drumRepinique, - drumRiq, - drumRototom, - drumSabar, - drumSakara, - drumSampho, - drumSangban, - drumShimeDaiko, - drumSlitDrum, - drumSlitDrumKrin, - drumSnareDrum, - drumSnareDrumElectric, - drumSogo, - drumSurdo, - drumTabla, - drumTablaBayan, - drumTablaDayan, - drumTaiko, - drumTalking, - drumTama, - drumTamborita, - drumTambourine, - drumTamte, - drumTangku, - drumTanTan, - drumTaphon, - drumTar, - drumTasha, - drumTenorDrum, - drumTeponaxtli, - drumThavil, - drumTheBox, - drumTimbale, - drumTimpani, - drumTinaja, - drumToere, - drumTombak, - drumTomTom, - drumTomTomSynth, - drumTsuzumi, - drumTumbak, - drumUchiwaDaiko, - drumUdaku, - drumUdu, - drumZarb, - effectAeolianHarp, - effectAirHorn, - effectApplause, - effectBassStringSlap, - effectBird, - effectBirdNightingale, - effectBirdTweet, - effectBreath, - effectBubble, - effectBullroarer, - effectBurst, - effectCar, - effectCarCrash, - effectCarEngine, - effectCarPass, - effectCarStop, - effectCrickets, - effectDog, - effectDoorCreak, - effectDoorSlam, - effectExplosion, - effectFluteKeyClick, - effectFootsteps, - effectFrogs, - effectGuitarCutting, - effectGuitarFret, - effectGunshot, - effectHandClap, - effectHeartbeat, - effectHelicopter, - effectHighQ, - effectHorseGallop, - effectJetPlane, - effectLaserGun, - effectLaugh, - effectLionsRoar, - effectMachineGun, - effectMarchingMachine, - effectMetronomeBell, - effectMetronomeClick, - effectPat, - effectPunch, - effectRain, - effectScratch, - effectScream, - effectSeashore, - effectSiren, - effectSlap, - effectSnap, - effectStamp, - effectStarship, - effectStream, - effectTelephoneRing, - effectThunder, - effectTrain, - effectTrashCan, - effectWhip, - effectWhistle, - effectWhistleMouthSiren, - effectWhistlePolice, - effectWhistleSlide, - effectWhistleTrain, - effectWind, - keyboardAccordion, - keyboardBandoneon, - keyboardCelesta, - keyboardClavichord, - keyboardClavichordSynth, - keyboardConcertina, - keyboardFortepiano, - keyboardHarmonium, - keyboardHarpsichord, - keyboardOndesMartenot, - keyboardOrgan, - keyboardOrganDrawbar, - keyboardOrganPercussive, - keyboardOrganPipe, - keyboardOrganReed, - keyboardOrganRotary, - keyboardPiano, - keyboardPianoElectric, - keyboardPianoGrand, - keyboardPianoHonkyTonk, - keyboardPianoPrepared, - keyboardPianoToy, - keyboardPianoUpright, - keyboardVirginal, - metalAdodo, - metalAnvil, - metalBabendil, - metalBellsAgogo, - metalBellsAlmglocken, - metalBellsBellPlate, - metalBellsBellTree, - metalBellsCarillon, - metalBellsChimes, - metalBellsChimta, - metalBellsChippli, - metalBellsChurch, - metalBellsCowbell, - metalBellsDawuro, - metalBellsGankokwe, - metalBellsGhungroo, - metalBellsHatheli, - metalBellsJingleBell, - metalBellsKhartal, - metalBellsMarkTree, - metalBellsSistrum, - metalBellsSleighBells, - metalBellsTemple, - metalBellsTibetan, - metalBellsTinklebell, - metalBellsTrychel, - metalBellsWindChimes, - metalBellsZills, - metalBerimbau, - metalBrakeDrums, - metalCrotales, - metalCymbalBo, - metalCymbalCengCeng, - metalCymbalChabara, - metalCymbalChinese, - metalCymbalChing, - metalCymbalClash, - metalCymbalCrash, - metalCymbalFinger, - metalCymbalHand, - metalCymbalKesi, - metalCymbalManjeera, - metalCymbalReverse, - metalCymbalRide, - metalCymbalSizzle, - metalCymbalSplash, - metalCymbalSuspended, - metalCymbalTebyoshi, - metalCymbalTibetan, - metalCymbalTingsha, - metalFlexatone, - metalGong, - metalGongAgeng, - metalGongAgung, - metalGongChanchiki, - metalGongChinese, - metalGongGandingan, - metalGongKempul, - metalGongKempyang, - metalGongKetuk, - metalGongKkwenggwari, - metalGongLuo, - metalGongSinging, - metalGongThai, - metalGuira, - metalHang, - metalHiHat, - metalJawHarp, - metalKengong, - metalMurchang, - metalMusicalSaw, - metalSingingBowl, - metalSpoons, - metalSteelDrums, - metalTamtam, - metalThundersheet, - metalTriangle, - metalWashboard, - pitchedPercussionAngklung, - pitchedPercussionBalafon, - pitchedPercussionBellLyre, - pitchedPercussionBells, - pitchedPercussionBianqing, - pitchedPercussionBianzhong, - pitchedPercussionBonang, - pitchedPercussionCimbalom, - pitchedPercussionCrystalGlasses, - pitchedPercussionDanTamThapLuc, - pitchedPercussionFangxiang, - pitchedPercussionGandinganAKayo, - pitchedPercussionGangsa, - pitchedPercussionGender, - pitchedPercussionGiying, - pitchedPercussionGlassHarmonica, - pitchedPercussionGlockenspiel, - pitchedPercussionGlockenspielAlto, - pitchedPercussionGlockenspielSoprano, - pitchedPercussionGyil, - pitchedPercussionHammerDulcimer, - pitchedPercussionHandbells, - pitchedPercussionKalimba, - pitchedPercussionKantil, - pitchedPercussionKhim, - pitchedPercussionKulintang, - pitchedPercussionKulintangAKayo, - pitchedPercussionKulintangATiniok, - pitchedPercussionLikembe, - pitchedPercussionLuntang, - pitchedPercussionMarimba, - pitchedPercussionMarimbaBass, - pitchedPercussionMbira, - pitchedPercussionMbiraArray, - pitchedPercussionMetallophone, - pitchedPercussionMetallophoneAlto, - pitchedPercussionMetallophoneBass, - pitchedPercussionMetallophoneSoprano, - pitchedPercussionMusicBox, - pitchedPercussionPelogPanerus, - pitchedPercussionPemade, - pitchedPercussionPenyacah, - pitchedPercussionRanatEk, - pitchedPercussionRanatEkLek, - pitchedPercussionRanatThum, - pitchedPercussionRanatThumLek, - pitchedPercussionReyong, - pitchedPercussionSanza, - pitchedPercussionSaronBarung, - pitchedPercussionSaronDemong, - pitchedPercussionSaronPanerus, - pitchedPercussionSlendroPanerus, - pitchedPercussionSlentem, - pitchedPercussionTsymbaly, - pitchedPercussionTubes, - pitchedPercussionTubularBells, - pitchedPercussionVibraphone, - pitchedPercussionXylophone, - pitchedPercussionXylophoneAlto, - pitchedPercussionXylophoneBass, - pitchedPercussionXylophoneSoprano, - pitchedPercussionXylorimba, - pitchedPercussionYangqin, - pluckArchlute, - pluckAutoharp, - pluckBaglama, - pluckBajo, - pluckBalalaika, - pluckBalalaikaAlto, - pluckBalalaikaBass, - pluckBalalaikaContrabass, - pluckBalalaikaPiccolo, - pluckBalalaikaPrima, - pluckBalalaikaSecunda, - pluckBandola, - pluckBandura, - pluckBandurria, - pluckBanjo, - pluckBanjoTenor, - pluckBanjolele, - pluckBarbat, - pluckBass, - pluckBassAcoustic, - pluckBassBolon, - pluckBassElectric, - pluckBassFretless, - pluckBassGuitarron, - pluckBassSynth, - pluckBassSynthLead, - pluckBassWashtub, - pluckBassWhamola, - pluckBegena, - pluckBiwa, - pluckBordonua, - pluckBouzouki, - pluckBouzoukiIrish, - pluckCelticHarp, - pluckCharango, - pluckChitarraBattente, - pluckCithara, - pluckCittern, - pluckCuatro, - pluckDanBau, - pluckDanNguyet, - pluckDanTranh, - pluckDanTyBa, - pluckDiddleyBow, - pluckDomra, - pluckDomu, - pluckDulcimer, - pluckDutar, - pluckDuxianqin, - pluckEktara, - pluckGeomungo, - pluckGottuvadhyam, - pluckGuitar, - pluckGuitarAcoustic, - pluckGuitarElectric, - pluckGuitarNylonString, - pluckGuitarPedalSteel, - pluckGuitarPortuguese, - pluckGuitarRequinto, - pluckGuitarResonator, - pluckGuitarSteelString, - pluckGuitjo, - pluckGuitjoDoubleNeck, - pluckGuqin, - pluckGuzheng, - pluckGuzhengChoazhou, - pluckHarp, - pluckHarpGuitar, - pluckHuapanguera, - pluckJaranaHuasteca, - pluckJaranaJarocha, - pluckJaranaJarochaMosquito, - pluckJaranaJarochaPrimera, - pluckJaranaJarochaSegunda, - pluckJaranaJarochaTercera, - pluckKabosy, - pluckKantele, - pluckKanun, - pluckKayagum, - pluckKobza, - pluckKomuz, - pluckKora, - pluckKoto, - pluckKutiyapi, - pluckLangeleik, - pluckLaud, - pluckLute, - pluckLyre, - pluckMandobass, - pluckMandocello, - pluckMandola, - pluckMandolin, - pluckMandolinOctave, - pluckMandora, - pluckMandore, - pluckMarovany, - pluckMusicalBow, - pluckNgoni, - pluckOud, - pluckPipa, - pluckPsaltery, - pluckRuan, - pluckSallaneh, - pluckSanshin, - pluckSantoor, - pluckSanxian, - pluckSarod, - pluckSaung, - pluckSaz, - pluckSe, - pluckSetar, - pluckShamisen, - pluckSitar, - pluckSynth, - pluckSynthCharang, - pluckSynthChiff, - pluckSynthStick, - pluckTambura, - pluckTamburaBulgarian, - pluckTamburaFemale, - pluckTamburaMale, - pluckTar, - pluckTheorbo, - pluckTimple, - pluckTiple, - pluckTres, - pluckUkulele, - pluckUkuleleTenor, - pluckValiha, - pluckVeena, - pluckVeenaMohan, - pluckVeenaRudra, - pluckVeenaVichitra, - pluckVihuela, - pluckVihuelaMexican, - pluckXalam, - pluckYueqin, - pluckZither, - pluckZitherOvertone, - rattleAfoxe, - rattleBirds, - rattleCabasa, - rattleCaxixi, - rattleCog, - rattleGanza, - rattleHosho, - rattleJawbone, - rattleKayamba, - rattleKpokoKpoko, - rattleLavaStones, - rattleMaraca, - rattleRainStick, - rattleRatchet, - rattleRattle, - rattleShaker, - rattleShakerEgg, - rattleShekere, - rattleSistre, - rattleTelevi, - rattleVibraslap, - rattleWasembe, - stringsAjaeng, - stringsArpeggione, - stringsBaryton, - stringsCello, - stringsCelloPiccolo, - stringsContrabass, - stringsCrwth, - stringsDanGao, - stringsDihu, - stringsErhu, - stringsErxian, - stringsEsraj, - stringsFiddle, - stringsFiddleHardanger, - stringsGadulka, - stringsGaohu, - stringsGehu, - stringsGroup, - stringsGroupSynth, - stringsHaegeum, - stringsHurdyGurdy, - stringsIgil, - stringsKamancha, - stringsKokyu, - stringsLaruan, - stringsLeiqin, - stringsLirone, - stringsLyraByzantine, - stringsLyraCretan, - stringsMorinKhuur, - stringsNyckelharpa, - stringsOctobass, - stringsRebab, - stringsRebec, - stringsSarangi, - stringsStrohViolin, - stringsTrombaMarina, - stringsVielle, - stringsViol, - stringsViolAlto, - stringsViolBass, - stringsViolTenor, - stringsViolTreble, - stringsViolViolone, - stringsViola, - stringsViolaDamore, - stringsViolin, - stringsViolonoPiccolo, - stringsViolotta, - stringsYayliTanbur, - stringsYazheng, - stringsZhonghu, - synthEffects, - synthEffectsAtmosphere, - synthEffectsBrightness, - synthEffectsCrystal, - synthEffectsEchoes, - synthEffectsGoblins, - synthEffectsRain, - synthEffectsSciFi, - synthEffectsSoundtrack, - synthGroup, - synthGroupFifths, - synthGroupOrchestra, - synthPad, - synthPadBowed, - synthPadChoir, - synthPadHalo, - synthPadMetallic, - synthPadPolysynth, - synthPadSweep, - synthPadWarm, - synthTheremin, - synthToneSawtooth, - synthToneSine, - synthToneSquare, - voiceAa, - voiceAlto, - voiceAw, - voiceBaritone, - voiceBass, - voiceChild, - voiceCountertenor, - voiceDoo, - voiceEe, - voiceFemale, - voiceKazoo, - voiceMale, - voiceMezzoSoprano, - voiceMm, - voiceOo, - voicePercussion, - voicePercussionBeatbox, - voiceSoprano, - voiceSynth, - voiceTalkBox, - voiceTenor, - voiceVocals, - windFlutesBansuri, - windFlutesBlownBottle, - windFlutesCalliope, - windFlutesDanso, - windFlutesDiZi, - windFlutesDvojnice, - windFlutesFife, - windFlutesFlageolet, - windFlutesFlute, - windFlutesFluteAlto, - windFlutesFluteBass, - windFlutesFluteContraAlto, - windFlutesFluteContrabass, - windFlutesFluteDoubleContrabass, - windFlutesFluteIrish, - windFlutesFlutePiccolo, - windFlutesFluteSubcontrabass, - windFlutesFujara, - windFlutesGemshorn, - windFlutesHocchiku, - windFlutesHun, - windFlutesKaval, - windFlutesKawala, - windFlutesKhlui, - windFlutesKnotweed, - windFlutesKoncovkaAlto, - windFlutesKoudi, - windFlutesNey, - windFlutesNohkan, - windFlutesNose, - windFlutesOcarina, - windFlutesOvertoneTenor, - windFlutesPalendag, - windFlutesPanpipes, - windFlutesQuena, - windFlutesRecorder, - windFlutesRecorderAlto, - windFlutesRecorderBass, - windFlutesRecorderContrabass, - windFlutesRecorderDescant, - windFlutesRecorderGarklein, - windFlutesRecorderGreatBass, - windFlutesRecorderSopranino, - windFlutesRecorderSoprano, - windFlutesRecorderTenor, - windFlutesRyuteki, - windFlutesShakuhachi, - windFlutesShepherdsPipe, - windFlutesShinobue, - windFlutesShvi, - windFlutesSuling, - windFlutesTarka, - windFlutesTumpong, - windFlutesVenu, - windFlutesWhistle, - windFlutesWhistleAlto, - windFlutesWhistleLowIrish, - windFlutesWhistleShiva, - windFlutesWhistleSlide, - windFlutesWhistleTin, - windFlutesWhistleTinBflat, - windFlutesWhistleTinD, - windFlutesXiao, - windFlutesXun, - windGroup, - windJug, - windPipesBagpipes, - windPipesGaida, - windPipesHighland, - windPipesUilleann, - windPungi, - windReedAlbogue, - windReedAlboka, - windReedAlgaita, - windReedArghul, - windReedBassetHorn, - windReedBassoon, - windReedBawu, - windReedBifora, - windReedBombarde, - windReedChalumeau, - windReedClarinet, - windReedClarinetA, - windReedClarinetAlto, - windReedClarinetBass, - windReedClarinetBasset, - windReedClarinetBflat, - windReedClarinetContraAlto, - windReedClarinetContrabass, - windReedClarinetEflat, - windReedClarinetPiccoloAflat, - windReedClarinetteDamour, - windReedContrabass, - windReedContrabassoon, - windReedCornamuse, - windReedCromorne, - windReedCrumhorn, - windReedCrumhornAlto, - windReedCrumhornBass, - windReedCrumhornGreatBass, - windReedCrumhornSoprano, - windReedCrumhornTenor, - windReedDiple, - windReedDiplica, - windReedDuduk, - windReedDulcian, - windReedDulzaina, - windReedEnglishHorn, - windReedGuanzi, - windReedHarmonica, - windReedHarmonicaBass, - windReedHeckelClarina, - windReedHeckelphone, - windReedHeckelphonePiccolo, - windReedHeckelphoneClarinet, - windReedHichiriki, - windReedHirtenschalmei, - windReedHne, - windReedHornpipe, - windReedHouguan, - windReedHulusi, - windReedJogiBaja, - windReedKenBau, - windReedKhaenMouthOrgan, - windReedLauneddas, - windReedMaqrunah, - windReedMelodica, - windReedMijwiz, - windReedMizmar, - windReedNadaswaram, - windReedOboe, - windReedOboeBass, - windReedOboePiccolo, - windReedOboeDaCaccia, - windReedOboeDamore, - windReedOctavin, - windReedPi, - windReedPibgorn, - windReedPiri, - windReedRackett, - windReedRauschpfeife, - windReedRhaita, - windReedRothphone, - windReedSarrusaphone, - windReedSaxonette, - windReedSaxophone, - windReedSaxophoneAlto, - windReedSaxophoneAulochrome, - windReedSaxophoneBaritone, - windReedSaxophoneBass, - windReedSaxophoneContrabass, - windReedSaxophoneMelody, - windReedSaxophoneMezzoSoprano, - windReedSaxophoneSopranino, - windReedSaxophoneSopranissimo, - windReedSaxophoneSoprano, - windReedSaxophoneSubcontrabass, - windReedSaxophoneTenor, - windReedShawm, - windReedShenai, - windReedSheng, - windReedSipsi, - windReedSopila, - windReedSorna, - windReedSralai, - windReedSuona, - windReedSurnai, - windReedTaepyeongso, - windReedTarogato, - windReedTarogatoAncient, - windReedTrompetaChina, - windReedTubax, - windReedXaphoon, - windReedZhaleika, - windReedZurla, - windReedZurna, - woodAgogoBlock, - woodAgungATamlang, - woodAhoko, - woodBones, - woodCastanets, - woodClaves, - woodDrumSticks, - woodGourd, - woodGraniteBlock, - woodGuban, - woodGuiro, - woodHyoushigi, - woodIpu, - woodJamBlock, - woodKaekeeke, - woodKagul, - woodKalaau, - woodKashiklar, - woodKubing, - woodPanClappers, - woodSandBlock, - woodSlapstick, - woodStirDrum, - woodTempleBlock, - woodTicTocBlock, - woodTonetang, - woodWoodBlock, - }; - } -} +enum class SoundID +{ + unspecified, + errorBadString, + brassAlphorn, + brassAltoHorn, + brassBaritoneHorn, + brassBugle, + brassBugleAlto, + brassBugleBaritone, + brassBugleContrabass, + brassBugleEuphoniumBugle, + brassBugleMellophoneBugle, + brassBugleSoprano, + brassCimbasso, + brassConchShell, + brassCornet, + brassCornetSoprano, + brassCornett, + brassCornettTenor, + brassCornettino, + brassDidgeridoo, + brassEuphonium, + brassFiscorn, + brassFlugelhorn, + brassFrenchHorn, + brassGroup, + brassGroupSynth, + brassHelicon, + brassHoragai, + brassKuhlohorn, + brassMellophone, + brassNaturalHorn, + brassOphicleide, + brassPosthorn, + brassRagDung, + brassSackbutt, + brassSackbuttAlto, + brassSackbuttBass, + brassSackbuttTenor, + brassSaxhorn, + brassSerpent, + brassShofar, + brassSousaphone, + brassTrombone, + brassTromboneAlto, + brassTromboneBass, + brassTromboneContrabass, + brassTromboneTenor, + brassTrumpet, + brassTrumpetBaroque, + brassTrumpetBass, + brassTrumpetBflat, + brassTrumpetC, + brassTrumpetD, + brassTrumpetPiccolo, + brassTrumpetPocket, + brassTrumpetSlide, + brassTrumpetTenor, + brassTuba, + brassTubaBass, + brassTubaSubcontrabass, + brassViennaHorn, + brassVuvuzela, + brassWagnerTuba, + drumApentemma, + drumAshiko, + drumAtabaque, + drumAtoke, + drumAtsimevu, + drumAxatse, + drumBassDrum, + drumBata, + drumBataItotele, + drumBataIya, + drumBataOkonkolo, + drumBendir, + drumBodhran, + drumBombo, + drumBongo, + drumBougarabou, + drumBuffaloDrum, + drumCajon, + drumChenda, + drumChuDaiko, + drumConga, + drumCuica, + drumDabakan, + drumDaff, + drumDafli, + drumDaibyosi, + drumDamroo, + drumDarabuka, + drumDef, + drumDhol, + drumDholak, + drumDjembe, + drumDoira, + drumDondo, + drumDounDounBa, + drumDuff, + drumDumbek, + drumFontomfrom, + drumFrameDrum, + drumFrameDrumArabian, + drumGeduk, + drumGhatam, + drumGome, + drumGroup, + drumGroupChinese, + drumGroupEwe, + drumGroupIndian, + drumGroupSet, + drumHandDrum, + drumHiraDaiko, + drumIbo, + drumIgihumurizo, + drumInyahura, + drumIshakwe, + drumJangGu, + drumKagan, + drumKakko, + drumKanjira, + drumKendhang, + drumKendhangAgeng, + drumKendhangCiblon, + drumKenkeni, + drumKhol, + drumKickDrum, + drumKidi, + drumKoDaiko, + drumKpanlogo, + drumKudum, + drumLambeg, + drumLionDrum, + drumLogDrum, + drumLogDrumAfrican, + drumLogDrumNative, + drumLogDrumNigerian, + drumMadal, + drumMaddale, + drumMridangam, + drumNaal, + drumNagadoDaiko, + drumNagara, + drumNaqara, + drumODaiko, + drumOkawa, + drumOkedoDaiko, + drumPahuHula, + drumPakhawaj, + drumPandeiro, + drumPandero, + drumPowwow, + drumPueblo, + drumRepinique, + drumRiq, + drumRototom, + drumSabar, + drumSakara, + drumSampho, + drumSangban, + drumShimeDaiko, + drumSlitDrum, + drumSlitDrumKrin, + drumSnareDrum, + drumSnareDrumElectric, + drumSogo, + drumSurdo, + drumTabla, + drumTablaBayan, + drumTablaDayan, + drumTaiko, + drumTalking, + drumTama, + drumTamborita, + drumTambourine, + drumTamte, + drumTangku, + drumTanTan, + drumTaphon, + drumTar, + drumTasha, + drumTenorDrum, + drumTeponaxtli, + drumThavil, + drumTheBox, + drumTimbale, + drumTimpani, + drumTinaja, + drumToere, + drumTombak, + drumTomTom, + drumTomTomSynth, + drumTsuzumi, + drumTumbak, + drumUchiwaDaiko, + drumUdaku, + drumUdu, + drumZarb, + effectAeolianHarp, + effectAirHorn, + effectApplause, + effectBassStringSlap, + effectBird, + effectBirdNightingale, + effectBirdTweet, + effectBreath, + effectBubble, + effectBullroarer, + effectBurst, + effectCar, + effectCarCrash, + effectCarEngine, + effectCarPass, + effectCarStop, + effectCrickets, + effectDog, + effectDoorCreak, + effectDoorSlam, + effectExplosion, + effectFluteKeyClick, + effectFootsteps, + effectFrogs, + effectGuitarCutting, + effectGuitarFret, + effectGunshot, + effectHandClap, + effectHeartbeat, + effectHelicopter, + effectHighQ, + effectHorseGallop, + effectJetPlane, + effectLaserGun, + effectLaugh, + effectLionsRoar, + effectMachineGun, + effectMarchingMachine, + effectMetronomeBell, + effectMetronomeClick, + effectPat, + effectPunch, + effectRain, + effectScratch, + effectScream, + effectSeashore, + effectSiren, + effectSlap, + effectSnap, + effectStamp, + effectStarship, + effectStream, + effectTelephoneRing, + effectThunder, + effectTrain, + effectTrashCan, + effectWhip, + effectWhistle, + effectWhistleMouthSiren, + effectWhistlePolice, + effectWhistleSlide, + effectWhistleTrain, + effectWind, + keyboardAccordion, + keyboardBandoneon, + keyboardCelesta, + keyboardClavichord, + keyboardClavichordSynth, + keyboardConcertina, + keyboardFortepiano, + keyboardHarmonium, + keyboardHarpsichord, + keyboardOndesMartenot, + keyboardOrgan, + keyboardOrganDrawbar, + keyboardOrganPercussive, + keyboardOrganPipe, + keyboardOrganReed, + keyboardOrganRotary, + keyboardPiano, + keyboardPianoElectric, + keyboardPianoGrand, + keyboardPianoHonkyTonk, + keyboardPianoPrepared, + keyboardPianoToy, + keyboardPianoUpright, + keyboardVirginal, + metalAdodo, + metalAnvil, + metalBabendil, + metalBellsAgogo, + metalBellsAlmglocken, + metalBellsBellPlate, + metalBellsBellTree, + metalBellsCarillon, + metalBellsChimes, + metalBellsChimta, + metalBellsChippli, + metalBellsChurch, + metalBellsCowbell, + metalBellsDawuro, + metalBellsGankokwe, + metalBellsGhungroo, + metalBellsHatheli, + metalBellsJingleBell, + metalBellsKhartal, + metalBellsMarkTree, + metalBellsSistrum, + metalBellsSleighBells, + metalBellsTemple, + metalBellsTibetan, + metalBellsTinklebell, + metalBellsTrychel, + metalBellsWindChimes, + metalBellsZills, + metalBerimbau, + metalBrakeDrums, + metalCrotales, + metalCymbalBo, + metalCymbalCengCeng, + metalCymbalChabara, + metalCymbalChinese, + metalCymbalChing, + metalCymbalClash, + metalCymbalCrash, + metalCymbalFinger, + metalCymbalHand, + metalCymbalKesi, + metalCymbalManjeera, + metalCymbalReverse, + metalCymbalRide, + metalCymbalSizzle, + metalCymbalSplash, + metalCymbalSuspended, + metalCymbalTebyoshi, + metalCymbalTibetan, + metalCymbalTingsha, + metalFlexatone, + metalGong, + metalGongAgeng, + metalGongAgung, + metalGongChanchiki, + metalGongChinese, + metalGongGandingan, + metalGongKempul, + metalGongKempyang, + metalGongKetuk, + metalGongKkwenggwari, + metalGongLuo, + metalGongSinging, + metalGongThai, + metalGuira, + metalHang, + metalHiHat, + metalJawHarp, + metalKengong, + metalMurchang, + metalMusicalSaw, + metalSingingBowl, + metalSpoons, + metalSteelDrums, + metalTamtam, + metalThundersheet, + metalTriangle, + metalWashboard, + pitchedPercussionAngklung, + pitchedPercussionBalafon, + pitchedPercussionBellLyre, + pitchedPercussionBells, + pitchedPercussionBianqing, + pitchedPercussionBianzhong, + pitchedPercussionBonang, + pitchedPercussionCimbalom, + pitchedPercussionCrystalGlasses, + pitchedPercussionDanTamThapLuc, + pitchedPercussionFangxiang, + pitchedPercussionGandinganAKayo, + pitchedPercussionGangsa, + pitchedPercussionGender, + pitchedPercussionGiying, + pitchedPercussionGlassHarmonica, + pitchedPercussionGlockenspiel, + pitchedPercussionGlockenspielAlto, + pitchedPercussionGlockenspielSoprano, + pitchedPercussionGyil, + pitchedPercussionHammerDulcimer, + pitchedPercussionHandbells, + pitchedPercussionKalimba, + pitchedPercussionKantil, + pitchedPercussionKhim, + pitchedPercussionKulintang, + pitchedPercussionKulintangAKayo, + pitchedPercussionKulintangATiniok, + pitchedPercussionLikembe, + pitchedPercussionLuntang, + pitchedPercussionMarimba, + pitchedPercussionMarimbaBass, + pitchedPercussionMbira, + pitchedPercussionMbiraArray, + pitchedPercussionMetallophone, + pitchedPercussionMetallophoneAlto, + pitchedPercussionMetallophoneBass, + pitchedPercussionMetallophoneSoprano, + pitchedPercussionMusicBox, + pitchedPercussionPelogPanerus, + pitchedPercussionPemade, + pitchedPercussionPenyacah, + pitchedPercussionRanatEk, + pitchedPercussionRanatEkLek, + pitchedPercussionRanatThum, + pitchedPercussionRanatThumLek, + pitchedPercussionReyong, + pitchedPercussionSanza, + pitchedPercussionSaronBarung, + pitchedPercussionSaronDemong, + pitchedPercussionSaronPanerus, + pitchedPercussionSlendroPanerus, + pitchedPercussionSlentem, + pitchedPercussionTsymbaly, + pitchedPercussionTubes, + pitchedPercussionTubularBells, + pitchedPercussionVibraphone, + pitchedPercussionXylophone, + pitchedPercussionXylophoneAlto, + pitchedPercussionXylophoneBass, + pitchedPercussionXylophoneSoprano, + pitchedPercussionXylorimba, + pitchedPercussionYangqin, + pluckArchlute, + pluckAutoharp, + pluckBaglama, + pluckBajo, + pluckBalalaika, + pluckBalalaikaAlto, + pluckBalalaikaBass, + pluckBalalaikaContrabass, + pluckBalalaikaPiccolo, + pluckBalalaikaPrima, + pluckBalalaikaSecunda, + pluckBandola, + pluckBandura, + pluckBandurria, + pluckBanjo, + pluckBanjoTenor, + pluckBanjolele, + pluckBarbat, + pluckBass, + pluckBassAcoustic, + pluckBassBolon, + pluckBassElectric, + pluckBassFretless, + pluckBassGuitarron, + pluckBassSynth, + pluckBassSynthLead, + pluckBassWashtub, + pluckBassWhamola, + pluckBegena, + pluckBiwa, + pluckBordonua, + pluckBouzouki, + pluckBouzoukiIrish, + pluckCelticHarp, + pluckCharango, + pluckChitarraBattente, + pluckCithara, + pluckCittern, + pluckCuatro, + pluckDanBau, + pluckDanNguyet, + pluckDanTranh, + pluckDanTyBa, + pluckDiddleyBow, + pluckDomra, + pluckDomu, + pluckDulcimer, + pluckDutar, + pluckDuxianqin, + pluckEktara, + pluckGeomungo, + pluckGottuvadhyam, + pluckGuitar, + pluckGuitarAcoustic, + pluckGuitarElectric, + pluckGuitarNylonString, + pluckGuitarPedalSteel, + pluckGuitarPortuguese, + pluckGuitarRequinto, + pluckGuitarResonator, + pluckGuitarSteelString, + pluckGuitjo, + pluckGuitjoDoubleNeck, + pluckGuqin, + pluckGuzheng, + pluckGuzhengChoazhou, + pluckHarp, + pluckHarpGuitar, + pluckHuapanguera, + pluckJaranaHuasteca, + pluckJaranaJarocha, + pluckJaranaJarochaMosquito, + pluckJaranaJarochaPrimera, + pluckJaranaJarochaSegunda, + pluckJaranaJarochaTercera, + pluckKabosy, + pluckKantele, + pluckKanun, + pluckKayagum, + pluckKobza, + pluckKomuz, + pluckKora, + pluckKoto, + pluckKutiyapi, + pluckLangeleik, + pluckLaud, + pluckLute, + pluckLyre, + pluckMandobass, + pluckMandocello, + pluckMandola, + pluckMandolin, + pluckMandolinOctave, + pluckMandora, + pluckMandore, + pluckMarovany, + pluckMusicalBow, + pluckNgoni, + pluckOud, + pluckPipa, + pluckPsaltery, + pluckRuan, + pluckSallaneh, + pluckSanshin, + pluckSantoor, + pluckSanxian, + pluckSarod, + pluckSaung, + pluckSaz, + pluckSe, + pluckSetar, + pluckShamisen, + pluckSitar, + pluckSynth, + pluckSynthCharang, + pluckSynthChiff, + pluckSynthStick, + pluckTambura, + pluckTamburaBulgarian, + pluckTamburaFemale, + pluckTamburaMale, + pluckTar, + pluckTheorbo, + pluckTimple, + pluckTiple, + pluckTres, + pluckUkulele, + pluckUkuleleTenor, + pluckValiha, + pluckVeena, + pluckVeenaMohan, + pluckVeenaRudra, + pluckVeenaVichitra, + pluckVihuela, + pluckVihuelaMexican, + pluckXalam, + pluckYueqin, + pluckZither, + pluckZitherOvertone, + rattleAfoxe, + rattleBirds, + rattleCabasa, + rattleCaxixi, + rattleCog, + rattleGanza, + rattleHosho, + rattleJawbone, + rattleKayamba, + rattleKpokoKpoko, + rattleLavaStones, + rattleMaraca, + rattleRainStick, + rattleRatchet, + rattleRattle, + rattleShaker, + rattleShakerEgg, + rattleShekere, + rattleSistre, + rattleTelevi, + rattleVibraslap, + rattleWasembe, + stringsAjaeng, + stringsArpeggione, + stringsBaryton, + stringsCello, + stringsCelloPiccolo, + stringsContrabass, + stringsCrwth, + stringsDanGao, + stringsDihu, + stringsErhu, + stringsErxian, + stringsEsraj, + stringsFiddle, + stringsFiddleHardanger, + stringsGadulka, + stringsGaohu, + stringsGehu, + stringsGroup, + stringsGroupSynth, + stringsHaegeum, + stringsHurdyGurdy, + stringsIgil, + stringsKamancha, + stringsKokyu, + stringsLaruan, + stringsLeiqin, + stringsLirone, + stringsLyraByzantine, + stringsLyraCretan, + stringsMorinKhuur, + stringsNyckelharpa, + stringsOctobass, + stringsRebab, + stringsRebec, + stringsSarangi, + stringsStrohViolin, + stringsTrombaMarina, + stringsVielle, + stringsViol, + stringsViolAlto, + stringsViolBass, + stringsViolTenor, + stringsViolTreble, + stringsViolViolone, + stringsViola, + stringsViolaDamore, + stringsViolin, + stringsViolonoPiccolo, + stringsViolotta, + stringsYayliTanbur, + stringsYazheng, + stringsZhonghu, + synthEffects, + synthEffectsAtmosphere, + synthEffectsBrightness, + synthEffectsCrystal, + synthEffectsEchoes, + synthEffectsGoblins, + synthEffectsRain, + synthEffectsSciFi, + synthEffectsSoundtrack, + synthGroup, + synthGroupFifths, + synthGroupOrchestra, + synthPad, + synthPadBowed, + synthPadChoir, + synthPadHalo, + synthPadMetallic, + synthPadPolysynth, + synthPadSweep, + synthPadWarm, + synthTheremin, + synthToneSawtooth, + synthToneSine, + synthToneSquare, + voiceAa, + voiceAlto, + voiceAw, + voiceBaritone, + voiceBass, + voiceChild, + voiceCountertenor, + voiceDoo, + voiceEe, + voiceFemale, + voiceKazoo, + voiceMale, + voiceMezzoSoprano, + voiceMm, + voiceOo, + voicePercussion, + voicePercussionBeatbox, + voiceSoprano, + voiceSynth, + voiceTalkBox, + voiceTenor, + voiceVocals, + windFlutesBansuri, + windFlutesBlownBottle, + windFlutesCalliope, + windFlutesDanso, + windFlutesDiZi, + windFlutesDvojnice, + windFlutesFife, + windFlutesFlageolet, + windFlutesFlute, + windFlutesFluteAlto, + windFlutesFluteBass, + windFlutesFluteContraAlto, + windFlutesFluteContrabass, + windFlutesFluteDoubleContrabass, + windFlutesFluteIrish, + windFlutesFlutePiccolo, + windFlutesFluteSubcontrabass, + windFlutesFujara, + windFlutesGemshorn, + windFlutesHocchiku, + windFlutesHun, + windFlutesKaval, + windFlutesKawala, + windFlutesKhlui, + windFlutesKnotweed, + windFlutesKoncovkaAlto, + windFlutesKoudi, + windFlutesNey, + windFlutesNohkan, + windFlutesNose, + windFlutesOcarina, + windFlutesOvertoneTenor, + windFlutesPalendag, + windFlutesPanpipes, + windFlutesQuena, + windFlutesRecorder, + windFlutesRecorderAlto, + windFlutesRecorderBass, + windFlutesRecorderContrabass, + windFlutesRecorderDescant, + windFlutesRecorderGarklein, + windFlutesRecorderGreatBass, + windFlutesRecorderSopranino, + windFlutesRecorderSoprano, + windFlutesRecorderTenor, + windFlutesRyuteki, + windFlutesShakuhachi, + windFlutesShepherdsPipe, + windFlutesShinobue, + windFlutesShvi, + windFlutesSuling, + windFlutesTarka, + windFlutesTumpong, + windFlutesVenu, + windFlutesWhistle, + windFlutesWhistleAlto, + windFlutesWhistleLowIrish, + windFlutesWhistleShiva, + windFlutesWhistleSlide, + windFlutesWhistleTin, + windFlutesWhistleTinBflat, + windFlutesWhistleTinD, + windFlutesXiao, + windFlutesXun, + windGroup, + windJug, + windPipesBagpipes, + windPipesGaida, + windPipesHighland, + windPipesUilleann, + windPungi, + windReedAlbogue, + windReedAlboka, + windReedAlgaita, + windReedArghul, + windReedBassetHorn, + windReedBassoon, + windReedBawu, + windReedBifora, + windReedBombarde, + windReedChalumeau, + windReedClarinet, + windReedClarinetA, + windReedClarinetAlto, + windReedClarinetBass, + windReedClarinetBasset, + windReedClarinetBflat, + windReedClarinetContraAlto, + windReedClarinetContrabass, + windReedClarinetEflat, + windReedClarinetPiccoloAflat, + windReedClarinetteDamour, + windReedContrabass, + windReedContrabassoon, + windReedCornamuse, + windReedCromorne, + windReedCrumhorn, + windReedCrumhornAlto, + windReedCrumhornBass, + windReedCrumhornGreatBass, + windReedCrumhornSoprano, + windReedCrumhornTenor, + windReedDiple, + windReedDiplica, + windReedDuduk, + windReedDulcian, + windReedDulzaina, + windReedEnglishHorn, + windReedGuanzi, + windReedHarmonica, + windReedHarmonicaBass, + windReedHeckelClarina, + windReedHeckelphone, + windReedHeckelphonePiccolo, + windReedHeckelphoneClarinet, + windReedHichiriki, + windReedHirtenschalmei, + windReedHne, + windReedHornpipe, + windReedHouguan, + windReedHulusi, + windReedJogiBaja, + windReedKenBau, + windReedKhaenMouthOrgan, + windReedLauneddas, + windReedMaqrunah, + windReedMelodica, + windReedMijwiz, + windReedMizmar, + windReedNadaswaram, + windReedOboe, + windReedOboeBass, + windReedOboePiccolo, + windReedOboeDaCaccia, + windReedOboeDamore, + windReedOctavin, + windReedPi, + windReedPibgorn, + windReedPiri, + windReedRackett, + windReedRauschpfeife, + windReedRhaita, + windReedRothphone, + windReedSarrusaphone, + windReedSaxonette, + windReedSaxophone, + windReedSaxophoneAlto, + windReedSaxophoneAulochrome, + windReedSaxophoneBaritone, + windReedSaxophoneBass, + windReedSaxophoneContrabass, + windReedSaxophoneMelody, + windReedSaxophoneMezzoSoprano, + windReedSaxophoneSopranino, + windReedSaxophoneSopranissimo, + windReedSaxophoneSoprano, + windReedSaxophoneSubcontrabass, + windReedSaxophoneTenor, + windReedShawm, + windReedShenai, + windReedSheng, + windReedSipsi, + windReedSopila, + windReedSorna, + windReedSralai, + windReedSuona, + windReedSurnai, + windReedTaepyeongso, + windReedTarogato, + windReedTarogatoAncient, + windReedTrompetaChina, + windReedTubax, + windReedXaphoon, + windReedZhaleika, + windReedZurla, + windReedZurna, + woodAgogoBlock, + woodAgungATamlang, + woodAhoko, + woodBones, + woodCastanets, + woodClaves, + woodDrumSticks, + woodGourd, + woodGraniteBlock, + woodGuban, + woodGuiro, + woodHyoushigi, + woodIpu, + woodJamBlock, + woodKaekeeke, + woodKagul, + woodKalaau, + woodKashiklar, + woodKubing, + woodPanClappers, + woodSandBlock, + woodSlapstick, + woodStirDrum, + woodTempleBlock, + woodTicTocBlock, + woodTonetang, + woodWoodBlock, +}; +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/SpannerData.h b/Sourcecode/include/mx/api/SpannerData.h index 34bd891e2..452a215e1 100644 --- a/Sourcecode/include/mx/api/SpannerData.h +++ b/Sourcecode/include/mx/api/SpannerData.h @@ -4,65 +4,55 @@ #pragma once +#include "mx/api/LineData.h" #include "mx/api/PositionData.h" #include "mx/api/PrintData.h" -#include "mx/api/LineData.h" #include namespace mx { - namespace api +namespace api +{ + +struct SpannerStart +{ + int numberLevel; + int tickTimePosition; + PositionData positionData; + PrintData printData; + LineData lineData; + + SpannerStart() : numberLevel{-1}, tickTimePosition{0}, positionData{}, printData{}, lineData{} { + } +}; + +struct SpannerStop +{ + int numberLevel; + int tickTimePosition; + PositionData positionData; - struct SpannerStart - { - int numberLevel; - int tickTimePosition; - PositionData positionData; - PrintData printData; - LineData lineData; - - SpannerStart() - : numberLevel{ -1 } - , tickTimePosition{ 0 } - , positionData{} - , printData{} - , lineData{} - { - - } - }; - - struct SpannerStop - { - int numberLevel; - int tickTimePosition; - PositionData positionData; - - SpannerStop() - : numberLevel{ -1 } - , tickTimePosition{ 0 } - , positionData{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( SpannerStart ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( printData ) - MXAPI_EQUALS_MEMBER( lineData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SpannerStart ); - - MXAPI_EQUALS_BEGIN( SpannerStop ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SpannerStop ); + SpannerStop() : numberLevel{-1}, tickTimePosition{0}, positionData{} + { } -} +}; + +MXAPI_EQUALS_BEGIN(SpannerStart) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(tickTimePosition) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(printData) +MXAPI_EQUALS_MEMBER(lineData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(SpannerStart); + +MXAPI_EQUALS_BEGIN(SpannerStop) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(tickTimePosition) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(SpannerStop); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/StaffData.h b/Sourcecode/include/mx/api/StaffData.h index e852f4831..90986d2a2 100644 --- a/Sourcecode/include/mx/api/StaffData.h +++ b/Sourcecode/include/mx/api/StaffData.h @@ -5,63 +5,63 @@ #pragma once #include "mx/api/ClefData.h" -#include "mx/api/VoiceData.h" #include "mx/api/DirectionData.h" #include "mx/api/KeyData.h" +#include "mx/api/VoiceData.h" #include namespace mx { - namespace api - { - class StaffData - { - public: - std::vector clefs; +namespace api +{ +class StaffData +{ + public: + std::vector clefs; - // for the use case where key signatures - // must differ per staff, use this vector. - // otherwise use the keys vector in - // MeasureData to apply a key to all staves - std::vector keys; - std::vector directions; - std::map voices; - }; - - inline bool voicesAreEqual( const std::map& l, const std::map& r ) + // for the use case where key signatures + // must differ per staff, use this vector. + // otherwise use the keys vector in + // MeasureData to apply a key to all staves + std::vector keys; + std::vector directions; + std::map voices; +}; + +inline bool voicesAreEqual(const std::map &l, const std::map &r) +{ + if (l.size() != r.size()) + { + return false; + } + auto li = l.cbegin(); + auto ri = r.cbegin(); + auto le = l.cend(); + for (; li != le; ++li, ++ri) + { + if (li->first != ri->first) { - if( l.size() != r.size() ) - { - return false; - } - auto li = l.cbegin(); - auto ri = r.cbegin(); - auto le = l.cend(); - for( ; li != le; ++li, ++ri ) - { - if( li->first != ri->first ) - { - return false; - } - else if ( li->second != ri->second ) - { - return false; - } - } - return true; + return false; } - - MXAPI_EQUALS_BEGIN( StaffData ) - MXAPI_EQUALS_MEMBER( clefs ) - MXAPI_EQUALS_MEMBER( keys ) - MXAPI_EQUALS_MEMBER( directions ) - if( !( voicesAreEqual( lhs.voices, rhs.voices ) ) ) + else if (li->second != ri->second) { - MX_SHOW_UNEQUAL( "StaffData", "voices" ); return false; } - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( StaffData ); } + return true; +} + +MXAPI_EQUALS_BEGIN(StaffData) +MXAPI_EQUALS_MEMBER(clefs) +MXAPI_EQUALS_MEMBER(keys) +MXAPI_EQUALS_MEMBER(directions) +if (!(voicesAreEqual(lhs.voices, rhs.voices))) +{ + MX_SHOW_UNEQUAL("StaffData", "voices"); + return false; } +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(StaffData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/SystemData.h b/Sourcecode/include/mx/api/SystemData.h index c78d08f28..3d56fdec2 100644 --- a/Sourcecode/include/mx/api/SystemData.h +++ b/Sourcecode/include/mx/api/SystemData.h @@ -9,55 +9,54 @@ namespace mx { - namespace api +namespace api +{ +// TODO - the documentation below if from MusicXML XSD and not very helpful for our case, improve documentation. +// A system is a group of staves that are read and played simultaneously. +// System layout includes left and right margins and the vertical distance +// from the previous system. The system distance is measured from the +// bottom line of the previous system to the top line of the current +// system. It is ignored for the first system on a page. The top system +// distance is measured from the page's top margin to the top line of the +// first system. It is ignored for all but the first system on a page. +// +// Sometimes the sum of measure widths in a system may not equal the system +// width specified by the layout elements due to roundoff or other errors. +// The behavior when reading MusicXML files in these cases is application- +// dependent. For instance, applications may find that the system layout +// data is more reliable than the sum of the measure widths, and adjust the +// measure widths accordingly. +class SystemData +{ + public: + /// Should this measure be at the start of a new system, i.e. + Bool newSystem; + + /// System layout. Note, all members of SystemLayoutData are optional. + SystemLayoutData layout; + + /// Returns true if any of the members of SystemData have values. + inline bool isUsed() const + { + return newSystem != Bool::unspecified || layout.isUsed(); + } + + /// Explicit constructor. + inline explicit SystemData(Bool inSystemBreak, SystemLayoutData inLayout = SystemLayoutData{}) + : newSystem{inSystemBreak}, layout{std::move(inLayout)} + { + } + + /// Default constructor. + SystemData() : SystemData{Bool::unspecified} { - // TODO - the documentation below if from MusicXML XSD and not very helpful for our case, improve documentation. - // A system is a group of staves that are read and played simultaneously. - // System layout includes left and right margins and the vertical distance - // from the previous system. The system distance is measured from the - // bottom line of the previous system to the top line of the current - // system. It is ignored for the first system on a page. The top system - // distance is measured from the page's top margin to the top line of the - // first system. It is ignored for all but the first system on a page. - // - // Sometimes the sum of measure widths in a system may not equal the system - // width specified by the layout elements due to roundoff or other errors. - // The behavior when reading MusicXML files in these cases is application- - // dependent. For instance, applications may find that the system layout - // data is more reliable than the sum of the measure widths, and adjust the - // measure widths accordingly. - class SystemData - { - public: - /// Should this measure be at the start of a new system, i.e. - Bool newSystem; - - /// System layout. Note, all members of SystemLayoutData are optional. - SystemLayoutData layout; - - /// Returns true if any of the members of SystemData have values. - inline bool isUsed() const { return newSystem != Bool::unspecified || layout.isUsed(); } - - /// Explicit constructor. - inline explicit SystemData( Bool inSystemBreak, SystemLayoutData inLayout = SystemLayoutData{} ) - : newSystem{ inSystemBreak } - , layout{ std::move( inLayout ) } - { - - } - - /// Default constructor. - SystemData() - : SystemData{ Bool::unspecified } - { - - } - }; - - MXAPI_EQUALS_BEGIN( SystemData ) - MXAPI_EQUALS_MEMBER( newSystem ) - MXAPI_EQUALS_MEMBER( layout ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SystemData ); } -} +}; + +MXAPI_EQUALS_BEGIN(SystemData) +MXAPI_EQUALS_MEMBER(newSystem) +MXAPI_EQUALS_MEMBER(layout) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(SystemData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/SystemLayoutData.h b/Sourcecode/include/mx/api/SystemLayoutData.h index 9529b28d7..8d4801b99 100644 --- a/Sourcecode/include/mx/api/SystemLayoutData.h +++ b/Sourcecode/include/mx/api/SystemLayoutData.h @@ -14,49 +14,46 @@ namespace mx { - namespace api +namespace api +{ +/// Margins and spacing for staff systems. +class SystemLayoutData +{ + public: + /// The left and right margins for the system, in tenths. + std::optional margins; + + /// Distance from bottom line of one system to top line of next system, in tenths. + OptionalDouble systemDistance; + + /// Distance from the top margin of the page to the top line of the first staff on the page, in tenths. + OptionalDouble topSystemDistance; + + /// the space between staves within the same system, in tenths. + OptionalDouble staffDistance; + + /// Returns true if any of the members have values. + inline bool isUsed() const + { + return margins || systemDistance || topSystemDistance || staffDistance; + } + + explicit inline SystemLayoutData(std::optional inMargins = std::nullopt, + OptionalDouble inSystemDistance = std::nullopt, + OptionalDouble inTopSystemDistance = std::nullopt, + OptionalDouble inStaffDistance = std::nullopt) + : margins(inMargins), systemDistance(inSystemDistance), topSystemDistance{inTopSystemDistance}, + staffDistance(inStaffDistance) { - /// Margins and spacing for staff systems. - class SystemLayoutData - { - public: - - /// The left and right margins for the system, in tenths. - std::optional margins; - - /// Distance from bottom line of one system to top line of next system, in tenths. - OptionalDouble systemDistance; - - /// Distance from the top margin of the page to the top line of the first staff on the page, in tenths. - OptionalDouble topSystemDistance; - - /// the space between staves within the same system, in tenths. - OptionalDouble staffDistance; - - /// Returns true if any of the members have values. - inline bool isUsed() const { return margins || systemDistance || topSystemDistance || staffDistance; } - - explicit inline SystemLayoutData( - std::optional inMargins = std::nullopt, - OptionalDouble inSystemDistance = std::nullopt, - OptionalDouble inTopSystemDistance = std::nullopt, - OptionalDouble inStaffDistance = std::nullopt - ) - : margins( inMargins ) - , systemDistance( inSystemDistance ) - , topSystemDistance{ inTopSystemDistance } - , staffDistance( inStaffDistance ) - { - - } - }; - - MXAPI_EQUALS_BEGIN( SystemLayoutData ) - MXAPI_EQUALS_MEMBER( margins ) - MXAPI_EQUALS_MEMBER( systemDistance ) - MXAPI_EQUALS_MEMBER( topSystemDistance ) - MXAPI_EQUALS_MEMBER( staffDistance ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SystemLayoutData ); } -} +}; + +MXAPI_EQUALS_BEGIN(SystemLayoutData) +MXAPI_EQUALS_MEMBER(margins) +MXAPI_EQUALS_MEMBER(systemDistance) +MXAPI_EQUALS_MEMBER(topSystemDistance) +MXAPI_EQUALS_MEMBER(staffDistance) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(SystemLayoutData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/TempoData.h b/Sourcecode/include/mx/api/TempoData.h index 5349baa20..965e238f0 100644 --- a/Sourcecode/include/mx/api/TempoData.h +++ b/Sourcecode/include/mx/api/TempoData.h @@ -3,113 +3,105 @@ // Distributed under the MIT License #pragma once -#include "mx/api/PrintData.h" -#include "mx/api/PositionData.h" #include "mx/api/DurationData.h" +#include "mx/api/PositionData.h" +#include "mx/api/PrintData.h" namespace mx { - namespace api +namespace api +{ +enum class TempoType +{ + unspecified, + beatsPerMinute, + metricModulation, + tempoText +}; + +struct BeatsPerMinute +{ + DurationName durationName; + int dots; + int beatsPerMinute; + + BeatsPerMinute() : durationName{DurationName::unspecified}, dots{-1}, beatsPerMinute{-1} { - enum class TempoType - { - unspecified, - beatsPerMinute, - metricModulation, - tempoText - }; - - struct BeatsPerMinute - { - DurationName durationName; - int dots; - int beatsPerMinute; - - BeatsPerMinute() - : durationName{ DurationName::unspecified } - , dots{ -1 } - , beatsPerMinute{ -1 } - { - - } - }; - - struct MetricModulation - { - DurationName leftDurationName; - int leftDots; - DurationName rightDurationName; - int rightDots; - BeatsPerMinute playbackBeatsPerMinute; + } +}; - MetricModulation() - : leftDurationName{ DurationName::unspecified } - , leftDots{ -1 } - , rightDurationName{ DurationName::unspecified } - , rightDots{ -1 } - , playbackBeatsPerMinute{} - { - - } - }; - - struct TempoText - { - std::string tempoText; - BeatsPerMinute playbackBeatsPerMinute; - }; - - class TempoData - { - public: - int tickTime; - Bool isParenthetical; - PrintData printData; - PositionData positionData; - TempoType tempoType; - - // only used when tempoType is 'beatsPerMinute' - BeatsPerMinute beatsPerMinute; - - // only used when tempoType is 'metricModulation' - MetricModulation metricModulation; - - // only used when tempoType is 'tempoText' - TempoText tempoText; - }; +struct MetricModulation +{ + DurationName leftDurationName; + int leftDots; + DurationName rightDurationName; + int rightDots; + BeatsPerMinute playbackBeatsPerMinute; - MXAPI_EQUALS_BEGIN( BeatsPerMinute ) - MXAPI_EQUALS_MEMBER( durationName ) - MXAPI_EQUALS_MEMBER( dots ) - MXAPI_EQUALS_MEMBER( beatsPerMinute ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( BeatsPerMinute ); - - MXAPI_EQUALS_BEGIN( MetricModulation ) - MXAPI_EQUALS_MEMBER( leftDurationName ) - MXAPI_EQUALS_MEMBER( leftDots ) - MXAPI_EQUALS_MEMBER( rightDurationName ) - MXAPI_EQUALS_MEMBER( rightDots ) - MXAPI_EQUALS_MEMBER( playbackBeatsPerMinute ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MetricModulation ); - - MXAPI_EQUALS_BEGIN( TempoText ) - MXAPI_EQUALS_MEMBER( tempoText ) - MXAPI_EQUALS_MEMBER( playbackBeatsPerMinute ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TempoText ); - - MXAPI_EQUALS_BEGIN( TempoData ) - MXAPI_EQUALS_MEMBER( tickTime ) - MXAPI_EQUALS_MEMBER( isParenthetical ) - MXAPI_EQUALS_MEMBER( printData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( tempoType ) - MXAPI_EQUALS_MEMBER( beatsPerMinute ) - MXAPI_EQUALS_MEMBER( metricModulation ) - MXAPI_EQUALS_MEMBER( tempoText ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TempoData ); + MetricModulation() + : leftDurationName{DurationName::unspecified}, leftDots{-1}, rightDurationName{DurationName::unspecified}, + rightDots{-1}, playbackBeatsPerMinute{} + { } -} +}; + +struct TempoText +{ + std::string tempoText; + BeatsPerMinute playbackBeatsPerMinute; +}; + +class TempoData +{ + public: + int tickTime; + Bool isParenthetical; + PrintData printData; + PositionData positionData; + TempoType tempoType; + + // only used when tempoType is 'beatsPerMinute' + BeatsPerMinute beatsPerMinute; + + // only used when tempoType is 'metricModulation' + MetricModulation metricModulation; + + // only used when tempoType is 'tempoText' + TempoText tempoText; +}; + +MXAPI_EQUALS_BEGIN(BeatsPerMinute) +MXAPI_EQUALS_MEMBER(durationName) +MXAPI_EQUALS_MEMBER(dots) +MXAPI_EQUALS_MEMBER(beatsPerMinute) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(BeatsPerMinute); + +MXAPI_EQUALS_BEGIN(MetricModulation) +MXAPI_EQUALS_MEMBER(leftDurationName) +MXAPI_EQUALS_MEMBER(leftDots) +MXAPI_EQUALS_MEMBER(rightDurationName) +MXAPI_EQUALS_MEMBER(rightDots) +MXAPI_EQUALS_MEMBER(playbackBeatsPerMinute) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(MetricModulation); + +MXAPI_EQUALS_BEGIN(TempoText) +MXAPI_EQUALS_MEMBER(tempoText) +MXAPI_EQUALS_MEMBER(playbackBeatsPerMinute) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(TempoText); + +MXAPI_EQUALS_BEGIN(TempoData) +MXAPI_EQUALS_MEMBER(tickTime) +MXAPI_EQUALS_MEMBER(isParenthetical) +MXAPI_EQUALS_MEMBER(printData) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(tempoType) +MXAPI_EQUALS_MEMBER(beatsPerMinute) +MXAPI_EQUALS_MEMBER(metricModulation) +MXAPI_EQUALS_MEMBER(tempoText) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(TempoData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/TimeSignatureData.h b/Sourcecode/include/mx/api/TimeSignatureData.h index 90a9c2280..c52ee4a1d 100644 --- a/Sourcecode/include/mx/api/TimeSignatureData.h +++ b/Sourcecode/include/mx/api/TimeSignatureData.h @@ -10,60 +10,52 @@ namespace mx { - namespace api - { - enum class TimeSignatureSymbol - { - unspecified, - common, - cut - }; +namespace api +{ +enum class TimeSignatureSymbol +{ + unspecified, + common, + cut +}; + +class TimeSignatureData +{ + public: + // common, cut + TimeSignatureSymbol symbol; - class TimeSignatureData - { - public: - - // common, cut - TimeSignatureSymbol symbol; - - // the top number of the time signature, e.g. '5' in a '5/4' signature - int beats; - - // the bottom number of the time signature, e.g. '4' in a '5/4' signature - int beatType; - - // a time signature is implicit when it is not specified by the musicxml - bool isImplicit; - - // use this to hide a time sigature with Bool::no. If a time signature is - // implicit, the 'display' field will be ignored - Bool display; + // the top number of the time signature, e.g. '5' in a '5/4' signature + int beats; - inline bool isEqualTo( const TimeSignatureData& other ) const - { - return ( beats == other.beats ) - && ( beatType == other.beatType ) - && ( symbol == other.symbol ); - } + // the bottom number of the time signature, e.g. '4' in a '5/4' signature + int beatType; - TimeSignatureData() - : symbol{ TimeSignatureSymbol::unspecified } - , beats{ 4 } - , beatType{ 4 } - , isImplicit{ true } - , display{ Bool::unspecified } - { + // a time signature is implicit when it is not specified by the musicxml + bool isImplicit; - } - }; - - MXAPI_EQUALS_BEGIN( TimeSignatureData ) - MXAPI_EQUALS_MEMBER( symbol ) - MXAPI_EQUALS_MEMBER( beats ) - MXAPI_EQUALS_MEMBER( beatType ) - MXAPI_EQUALS_MEMBER( isImplicit ) - MXAPI_EQUALS_MEMBER( display ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TimeSignatureData ); + // use this to hide a time sigature with Bool::no. If a time signature is + // implicit, the 'display' field will be ignored + Bool display; + + inline bool isEqualTo(const TimeSignatureData &other) const + { + return (beats == other.beats) && (beatType == other.beatType) && (symbol == other.symbol); + } + + TimeSignatureData() + : symbol{TimeSignatureSymbol::unspecified}, beats{4}, beatType{4}, isImplicit{true}, display{Bool::unspecified} + { } -} +}; + +MXAPI_EQUALS_BEGIN(TimeSignatureData) +MXAPI_EQUALS_MEMBER(symbol) +MXAPI_EQUALS_MEMBER(beats) +MXAPI_EQUALS_MEMBER(beatType) +MXAPI_EQUALS_MEMBER(isImplicit) +MXAPI_EQUALS_MEMBER(display) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(TimeSignatureData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/TransposeData.h b/Sourcecode/include/mx/api/TransposeData.h index d1a7aa7ca..8177ad613 100644 --- a/Sourcecode/include/mx/api/TransposeData.h +++ b/Sourcecode/include/mx/api/TransposeData.h @@ -8,75 +8,73 @@ namespace mx { - namespace api +namespace api +{ +/// TransposeData is used to instruments for whom the music has been transposed. The +/// transposition is specified by naming the directional diatonic interval between the +/// written pitch and the sounding pitch. For example when C4 is written for Bb Clarinet, +/// the sounding pitch is Bb3 which is a major second lower. The transposition for Bb +/// Clarinet is thus 'down a major second'. There may be cases where such a transposition +/// would produce a painful key signature, and engravers may choose to notate the Bb +/// Clarinet in A# instead. In that case the interval is 'down a diminished third'. +/// +/// In order to distinguish between intervals that are enharmonically equivalent (having +/// the same number of semitones), two values are needed. TransposeData encodes the +/// diatonic interval by providing the number of chromatic steps and the number of diatonic +/// steps where the number of 'diatonic' steps is the number of steps via letter names (or +/// piano white notes). +/// +/// Some examples may help. Clarinet in Bb transposes down a major second, which is two +/// semitones, so `chromatic = -2`. In order to distinguish this from, say A#, or Cbb, we +/// need additional information, so we specify `diatonic = -1`. That is, we want the letter +/// to be B, and B is one letter lower than C. +/// +/// Here is a table of some common transpositions and their TransposeData equivalents. +/// |---------------------|--------------------|----------|---------| +/// | Name | Interval | Chromatic| Diatonic| +/// |---------------------|--------------------|----------|---------| +/// | Glockenspiel | Up two Octaves | 24 | 14 | +/// | Piccolo | Up an Octave | 12 | 7 | +/// | Clarient in Bb | Down a Major Second| -2 | -1 | +/// | French Horn in F | Down a Fifth | -7 | -4 | +/// | Alto Saxophone in Eb| Down a Major Sixth | -9 | -5 | +/// | Bass Clarinet in Bb | Down a Major Ninth | -14 | -8 | +/// |---------------------|--------------------|----------|---------| +/// +/// Note that MusicXML encodes this slightly differently. In MusicXML required (but not +/// enforced) that chromatic should be >= -11 and <= 11, and that diatonic should be +/// <= -6 and >= 6. An additional `` element is used for intervals beyond +/// that range. Additionally, the `` element is optional in MusicXML, but is +/// required in TransposeData. +class TransposeData +{ + public: + TransposeData() : TransposeData{0, 0} { - /// TransposeData is used to instruments for whom the music has been transposed. The - /// transposition is specified by naming the directional diatonic interval between the - /// written pitch and the sounding pitch. For example when C4 is written for Bb Clarinet, - /// the sounding pitch is Bb3 which is a major second lower. The transposition for Bb - /// Clarinet is thus 'down a major second'. There may be cases where such a transposition - /// would produce a painful key signature, and engravers may choose to notate the Bb - /// Clarinet in A# instead. In that case the interval is 'down a diminished third'. - /// - /// In order to distinguish between intervals that are enharmonically equivalent (having - /// the same number of semitones), two values are needed. TransposeData encodes the - /// diatonic interval by providing the number of chromatic steps and the number of diatonic - /// steps where the number of 'diatonic' steps is the number of steps via letter names (or - /// piano white notes). - /// - /// Some examples may help. Clarinet in Bb transposes down a major second, which is two - /// semitones, so `chromatic = -2`. In order to distinguish this from, say A#, or Cbb, we - /// need additional information, so we specify `diatonic = -1`. That is, we want the letter - /// to be B, and B is one letter lower than C. - /// - /// Here is a table of some common transpositions and their TransposeData equivalents. - /// |---------------------|--------------------|----------|---------| - /// | Name | Interval | Chromatic| Diatonic| - /// |---------------------|--------------------|----------|---------| - /// | Glockenspiel | Up two Octaves | 24 | 14 | - /// | Piccolo | Up an Octave | 12 | 7 | - /// | Clarient in Bb | Down a Major Second| -2 | -1 | - /// | French Horn in F | Down a Fifth | -7 | -4 | - /// | Alto Saxophone in Eb| Down a Major Sixth | -9 | -5 | - /// | Bass Clarinet in Bb | Down a Major Ninth | -14 | -8 | - /// |---------------------|--------------------|----------|---------| - /// - /// Note that MusicXML encodes this slightly differently. In MusicXML required (but not - /// enforced) that chromatic should be >= -11 and <= 11, and that diatonic should be - /// <= -6 and >= 6. An additional `` element is used for intervals beyond - /// that range. Additionally, the `` element is optional in MusicXML, but is - /// required in TransposeData. - class TransposeData - { - public: - TransposeData() - : TransposeData{ 0, 0 } - { - - } - - TransposeData( int inChromatic, int inHarmonic ) - : chromatic{ inChromatic } - , diatonic{ inHarmonic } - { - - } + } - /// The number of semitones in the interval. - int chromatic; + TransposeData(int inChromatic, int inHarmonic) : chromatic{inChromatic}, diatonic{inHarmonic} + { + } - /// The number of diatonic steps in the interval - int diatonic; + /// The number of semitones in the interval. + int chromatic; - /// If both chromatic and diatonic are zero, then TransposeData is unused (i.e. it need - /// not be encoded in the MusicXML output). - inline bool isUsed() const { return chromatic != 0 || diatonic != 0; } - }; + /// The number of diatonic steps in the interval + int diatonic; - MXAPI_EQUALS_BEGIN( TransposeData ) - MXAPI_EQUALS_MEMBER( chromatic ) - MXAPI_EQUALS_MEMBER( diatonic ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TransposeData ); + /// If both chromatic and diatonic are zero, then TransposeData is unused (i.e. it need + /// not be encoded in the MusicXML output). + inline bool isUsed() const + { + return chromatic != 0 || diatonic != 0; } -} +}; + +MXAPI_EQUALS_BEGIN(TransposeData) +MXAPI_EQUALS_MEMBER(chromatic) +MXAPI_EQUALS_MEMBER(diatonic) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(TransposeData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/TupletData.h b/Sourcecode/include/mx/api/TupletData.h index b902d3664..64a823739 100644 --- a/Sourcecode/include/mx/api/TupletData.h +++ b/Sourcecode/include/mx/api/TupletData.h @@ -5,101 +5,88 @@ #pragma once #include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" -#include "mx/api/LineData.h" #include "mx/api/DurationData.h" +#include "mx/api/LineData.h" +#include "mx/api/PositionData.h" namespace mx { - namespace api +namespace api +{ +// in the tuplet ratio, for example 2:3 for +// triplets, the 'actual' part of the ratio +// is the '2' and the 'normal' part of the +// ratio is the '3' + +class TupletStart +{ + public: + // used to id when nested + // -1 means unspecified + int numberLevel; + + PositionData positionData; + + int actualNumber; + DurationName actualDurationName; + int actualDots; + + int normalNumber; + DurationName normalDurationName; + int normalDots; + + // show the number of notes in the tuplet + // description ratio, for example 3 for triplets + Bool showActualNumber; + + // show the number of 'normal' notes in the + // tuplet ratio, for example the 2 in 3:2 for + // a triplet or the 4 in 5:4 for quintuplet + Bool showNormalNumber; + + Bool bracket; + + TupletStart() + : numberLevel{-1}, positionData{}, actualNumber{-1}, actualDurationName{api::DurationName::unspecified}, + actualDots{-1}, normalNumber{-1}, normalDurationName{api::DurationName::unspecified}, normalDots{-1}, + showActualNumber{Bool::unspecified}, showNormalNumber{Bool::unspecified}, bracket{Bool::unspecified} + { + } +}; + +class TupletStop +{ + public: + // used to id when nested + // -1 means unspecified + int numberLevel; + + PositionData positionData; + + TupletStop() : numberLevel{-1}, positionData{} { - // in the tuplet ratio, for example 2:3 for - // triplets, the 'actual' part of the ratio - // is the '2' and the 'normal' part of the - // ratio is the '3' - - class TupletStart - { - public: - - // used to id when nested - // -1 means unspecified - int numberLevel; - - PositionData positionData; - - int actualNumber; - DurationName actualDurationName; - int actualDots; - - int normalNumber; - DurationName normalDurationName; - int normalDots; - - // show the number of notes in the tuplet - // description ratio, for example 3 for triplets - Bool showActualNumber; - - // show the number of 'normal' notes in the - // tuplet ratio, for example the 2 in 3:2 for - // a triplet or the 4 in 5:4 for quintuplet - Bool showNormalNumber; - - Bool bracket; - - TupletStart() - : numberLevel{ -1 } - , positionData{} - , actualNumber{ -1 } - , actualDurationName{ api::DurationName::unspecified } - , actualDots{ -1 } - , normalNumber{ -1 } - , normalDurationName{ api::DurationName::unspecified } - , normalDots{ -1 } - , showActualNumber{ Bool::unspecified } - , showNormalNumber{ Bool::unspecified } - , bracket{ Bool::unspecified } - { - - } - }; - - class TupletStop - { - public: - // used to id when nested - // -1 means unspecified - int numberLevel; - - PositionData positionData; - - TupletStop() - : numberLevel{ -1 } - , positionData{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( TupletStart ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( actualNumber ) - MXAPI_EQUALS_MEMBER( actualDurationName ) - MXAPI_EQUALS_MEMBER( actualDots ) - MXAPI_EQUALS_MEMBER( normalNumber ) - MXAPI_EQUALS_MEMBER( normalDurationName ) - MXAPI_EQUALS_MEMBER( normalDots ) - MXAPI_EQUALS_MEMBER( showActualNumber ) - MXAPI_EQUALS_MEMBER( showNormalNumber ) - MXAPI_EQUALS_MEMBER( bracket ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TupletStart ); - - MXAPI_EQUALS_BEGIN( TupletStop ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TupletStop ); } -} +}; + +MXAPI_EQUALS_BEGIN(TupletStart) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(actualNumber) +MXAPI_EQUALS_MEMBER(actualDurationName) +MXAPI_EQUALS_MEMBER(actualDots) +MXAPI_EQUALS_MEMBER(normalNumber) +MXAPI_EQUALS_MEMBER(normalDurationName) +MXAPI_EQUALS_MEMBER(normalDots) +MXAPI_EQUALS_MEMBER(showActualNumber) +MXAPI_EQUALS_MEMBER(showNormalNumber) +MXAPI_EQUALS_MEMBER(bracket) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(TupletStart); + +MXAPI_EQUALS_BEGIN(TupletStop) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(TupletStop); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/Version.h b/Sourcecode/include/mx/api/Version.h index e499362fd..def678238 100644 --- a/Sourcecode/include/mx/api/Version.h +++ b/Sourcecode/include/mx/api/Version.h @@ -9,30 +9,30 @@ namespace mx { - namespace api - { - /// @brief TODO - /// - /// @detailed TODO - /// - class Version - { - public: - static int getVersionMajor(); - static int getVersionMinor(); - static int getVersionPatch(); - static const std::string& getString(); +namespace api +{ +/// @brief TODO +/// +/// @detailed TODO +/// +class Version +{ + public: + static int getVersionMajor(); + static int getVersionMinor(); + static int getVersionPatch(); + static const std::string &getString(); - private: - int myMajor; - int myMinor; - int myPatch; - int myBuild; - std::string myString; + private: + int myMajor; + int myMinor; + int myPatch; + int myBuild; + std::string myString; - private: - Version(); - static const Version& getInstance(); - }; - } -} + private: + Version(); + static const Version &getInstance(); +}; +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/VoiceData.h b/Sourcecode/include/mx/api/VoiceData.h index fc281958f..b919edfe8 100644 --- a/Sourcecode/include/mx/api/VoiceData.h +++ b/Sourcecode/include/mx/api/VoiceData.h @@ -11,19 +11,19 @@ namespace mx { - namespace api - { - class VoiceData - { - public: - std::vector notes; - }; +namespace api +{ +class VoiceData +{ + public: + std::vector notes; +}; - - inline bool operator==( const VoiceData& lhs, const VoiceData& rhs ) - { - return areVectorsEqual( lhs.notes, rhs.notes ); - } - MXAPI_NOT_EQUALS_AND_VECTORS( VoiceData ); - } +inline bool operator==(const VoiceData &lhs, const VoiceData &rhs) +{ + return areVectorsEqual(lhs.notes, rhs.notes); } + +MXAPI_NOT_EQUALS_AND_VECTORS(VoiceData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/WedgeData.h b/Sourcecode/include/mx/api/WedgeData.h index 198042e29..e26b081e1 100644 --- a/Sourcecode/include/mx/api/WedgeData.h +++ b/Sourcecode/include/mx/api/WedgeData.h @@ -5,78 +5,67 @@ #pragma once #include "mx/api/ApiCommon.h" +#include "mx/api/ColorData.h" #include "mx/api/LineData.h" #include "mx/api/PositionData.h" -#include "mx/api/ColorData.h" namespace mx { - namespace api +namespace api +{ +enum class WedgeType +{ + unspecified, + crescendo, + diminuendo +}; + +struct WedgeStart +{ + int numberLevel; + WedgeType wedgeType; + bool isSpreadSpecified; + long double spread; + LineData lineData; + PositionData positionData; + ColorData colorData; + + WedgeStart() + : numberLevel{-1}, wedgeType{WedgeType::unspecified}, isSpreadSpecified{false}, spread{0.0}, lineData{}, + positionData{}, colorData{} { - enum class WedgeType - { - unspecified, - crescendo, - diminuendo - }; + } +}; + +struct WedgeStop +{ + int numberLevel; + PositionData positionData; + bool isSpreadSpecified; + long double spread; - struct WedgeStart - { - int numberLevel; - WedgeType wedgeType; - bool isSpreadSpecified; - long double spread; - LineData lineData; - PositionData positionData; - ColorData colorData; - - WedgeStart() - : numberLevel{ -1 } - , wedgeType{ WedgeType::unspecified } - , isSpreadSpecified{ false } - , spread{ 0.0 } - , lineData{} - , positionData{} - , colorData{} - { - - } - }; - - struct WedgeStop - { - int numberLevel; - PositionData positionData; - bool isSpreadSpecified; - long double spread; - - WedgeStop() - : numberLevel{ -1 } - , positionData{} - , isSpreadSpecified{ false } - , spread{ 0.0 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( WedgeStart ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( wedgeType ) - MXAPI_EQUALS_MEMBER( isSpreadSpecified ) - MXAPI_EQUALS_MEMBER( spread ) - MXAPI_EQUALS_MEMBER( lineData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( WedgeStart ); - - MXAPI_EQUALS_BEGIN( WedgeStop ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isSpreadSpecified ) - MXAPI_EQUALS_MEMBER( spread ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( WedgeStop ); + WedgeStop() : numberLevel{-1}, positionData{}, isSpreadSpecified{false}, spread{0.0} + { } -} +}; + +MXAPI_EQUALS_BEGIN(WedgeStart) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(wedgeType) +MXAPI_EQUALS_MEMBER(isSpreadSpecified) +MXAPI_EQUALS_MEMBER(spread) +MXAPI_EQUALS_MEMBER(lineData) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(colorData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(WedgeStart); + +MXAPI_EQUALS_BEGIN(WedgeStop) +MXAPI_EQUALS_MEMBER(numberLevel) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(isSpreadSpecified) +MXAPI_EQUALS_MEMBER(spread) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(WedgeStop); +} // namespace api +} // namespace mx diff --git a/Sourcecode/include/mx/api/WordsData.h b/Sourcecode/include/mx/api/WordsData.h index 33362d491..ba80f32e8 100644 --- a/Sourcecode/include/mx/api/WordsData.h +++ b/Sourcecode/include/mx/api/WordsData.h @@ -5,40 +5,34 @@ #pragma once #include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" #include "mx/api/ColorData.h" #include "mx/api/FontData.h" +#include "mx/api/PositionData.h" namespace mx { - namespace api - { - class WordsData - { - public: - std::string text; - PositionData positionData; - FontData fontData; - bool isColorSpecified; - ColorData colorData; - - WordsData() - : text{} - , positionData{} - , fontData{} - , isColorSpecified{ false } - , colorData{} - { +namespace api +{ +class WordsData +{ + public: + std::string text; + PositionData positionData; + FontData fontData; + bool isColorSpecified; + ColorData colorData; - } - }; - - MXAPI_EQUALS_BEGIN( WordsData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( fontData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( WordsData ); + WordsData() : text{}, positionData{}, fontData{}, isColorSpecified{false}, colorData{} + { } -} +}; + +MXAPI_EQUALS_BEGIN(WordsData) +MXAPI_EQUALS_MEMBER(positionData) +MXAPI_EQUALS_MEMBER(fontData) +MXAPI_EQUALS_MEMBER(isColorSpecified) +MXAPI_EQUALS_MEMBER(colorData) +MXAPI_EQUALS_END; +MXAPI_NOT_EQUALS_AND_VECTORS(WordsData); +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/AppearanceData.cpp b/Sourcecode/private/mx/api/AppearanceData.cpp index ebe106c00..4b2f6c574 100644 --- a/Sourcecode/private/mx/api/AppearanceData.cpp +++ b/Sourcecode/private/mx/api/AppearanceData.cpp @@ -6,29 +6,24 @@ namespace mx { - namespace api - { +namespace api +{ //////////////////////////////////////////////////////////////////////////////// // CTOR AND COPY /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - AppearanceData::AppearanceData() - : appearanceType{ AppearanceType::LineWidth } - , appearanceSubType{ "beam" } - , value{ 0.0 } - { - - } +AppearanceData::AppearanceData() : appearanceType{AppearanceType::LineWidth}, appearanceSubType{"beam"}, value{0.0} +{ +} //////////////////////////////////////////////////////////////////////////////// // PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// // PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - } -} +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/ChordData.cpp b/Sourcecode/private/mx/api/ChordData.cpp index ad8531f96..67345bf4d 100644 --- a/Sourcecode/private/mx/api/ChordData.cpp +++ b/Sourcecode/private/mx/api/ChordData.cpp @@ -6,47 +6,32 @@ namespace mx { - namespace api - { +namespace api +{ //////////////////////////////////////////////////////////////////////////////// // CTOR AND COPY /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - Extension::Extension() - : extensionType{ ExtensionType::add } - , extensionAlter{ ExtensionAlter::none } - , extensionNumber{ ExtensionNumber::first } - , printObject{ Bool::unspecified } - { - - } - - - ChordData::ChordData() - : root{ Step::c } - , rootAlter{ 0 } - , chordKind{ ChordKind::unspecified } - , text{} - , useSymbols{ Bool::unspecified } - , bass{ Step::unspecified } - , bassAlter{ 0 } - , extensions{} - , miscData{} - , positionData{} - { +Extension::Extension() + : extensionType{ExtensionType::add}, extensionAlter{ExtensionAlter::none}, extensionNumber{ExtensionNumber::first}, + printObject{Bool::unspecified} +{ +} - } +ChordData::ChordData() + : root{Step::c}, rootAlter{0}, chordKind{ChordKind::unspecified}, text{}, useSymbols{Bool::unspecified}, + bass{Step::unspecified}, bassAlter{0}, extensions{}, miscData{}, positionData{} +{ +} //////////////////////////////////////////////////////////////////////////////// // PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////////////// // PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - } -} +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/ClefData.cpp b/Sourcecode/private/mx/api/ClefData.cpp index 440bad23c..ca0f202ad 100644 --- a/Sourcecode/private/mx/api/ClefData.cpp +++ b/Sourcecode/private/mx/api/ClefData.cpp @@ -7,135 +7,132 @@ namespace mx { - namespace api +namespace api +{ +ClefData::ClefData() + : symbol{DEFAULT_CLEF_SYMBOL}, line{DEFAULT_CLEF_LINE}, octaveChange{DEFAULT_CLEF_OCTAVE_CHANGE}, + tickTimePosition{0}, location{ClefLocation::unspecified} +{ +} + +std::string ClefData::toString() const +{ + std::stringstream ss; + ss << "Symbol "; + switch (symbol) { - ClefData::ClefData() - : symbol{ DEFAULT_CLEF_SYMBOL } - , line{ DEFAULT_CLEF_LINE } - , octaveChange{ DEFAULT_CLEF_OCTAVE_CHANGE } - , tickTimePosition{ 0 } - , location{ ClefLocation::unspecified } - { - - } - - - std::string ClefData::toString() const - { - std::stringstream ss; - ss << "Symbol "; - switch(symbol) - { - case ClefSymbol::g: ss << "G"; break; - case ClefSymbol::f: ss << "F"; break; - case ClefSymbol::c: ss << "C"; break; - case ClefSymbol::percussion: ss << "Percussion"; break; - case ClefSymbol::tab: ss << "Tab"; break; - case ClefSymbol::jianpu: ss << "Jianpu"; break; - case ClefSymbol::none: ss << "None"; break; - default: ss << "Unknown"; break; - } - ss << ", Line " << line; - ss << ", OctaveChange " << octaveChange; - return ss.str(); - } - - - void ClefData::setTreble() - { - symbol = ClefSymbol::g; - line = 2; - octaveChange = 0; - } - - - void ClefData::setBass() - { - symbol = ClefSymbol::f; - line = 4; - octaveChange = 0; - } - - - void ClefData::setAlto() - { - symbol = ClefSymbol::c; - line = 3; - octaveChange = 0; - } - - - void ClefData::setTenor() - { - symbol = ClefSymbol::c; - line = 4; - octaveChange = 0; - } - - - void ClefData::setBaritone() - { - symbol = ClefSymbol::c; - line = 5; - octaveChange = 0; - } - - - void ClefData::setSoprano() - { - symbol = ClefSymbol::c; - line = 0; - octaveChange = 0; - } - - - void ClefData::setMezzoSoprano() - { - symbol = ClefSymbol::c; - line = 1; - octaveChange = 0; - } - - - bool ClefData::isTreble() const - { - return ( symbol == ClefSymbol::g ) && ( line == 2 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isBass() const - { - return ( symbol == ClefSymbol::f ) && ( line == 4 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isAlto() const - { - return ( symbol == ClefSymbol::c ) && ( line == 3 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isTenor() const - { - return ( symbol == ClefSymbol::c ) && ( line == 4 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isBaritone() const - { - return ( symbol == ClefSymbol::c ) && ( line == 5 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isSoprano() const - { - return ( symbol == ClefSymbol::c ) && ( line == 0 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isMezzoSoprano() const - { - return ( symbol == ClefSymbol::c ) && ( line == 1 ) && ( octaveChange == 0 ); - } + case ClefSymbol::g: + ss << "G"; + break; + case ClefSymbol::f: + ss << "F"; + break; + case ClefSymbol::c: + ss << "C"; + break; + case ClefSymbol::percussion: + ss << "Percussion"; + break; + case ClefSymbol::tab: + ss << "Tab"; + break; + case ClefSymbol::jianpu: + ss << "Jianpu"; + break; + case ClefSymbol::none: + ss << "None"; + break; + default: + ss << "Unknown"; + break; } + ss << ", Line " << line; + ss << ", OctaveChange " << octaveChange; + return ss.str(); +} + +void ClefData::setTreble() +{ + symbol = ClefSymbol::g; + line = 2; + octaveChange = 0; +} + +void ClefData::setBass() +{ + symbol = ClefSymbol::f; + line = 4; + octaveChange = 0; +} + +void ClefData::setAlto() +{ + symbol = ClefSymbol::c; + line = 3; + octaveChange = 0; +} + +void ClefData::setTenor() +{ + symbol = ClefSymbol::c; + line = 4; + octaveChange = 0; +} + +void ClefData::setBaritone() +{ + symbol = ClefSymbol::c; + line = 5; + octaveChange = 0; +} + +void ClefData::setSoprano() +{ + symbol = ClefSymbol::c; + line = 0; + octaveChange = 0; +} + +void ClefData::setMezzoSoprano() +{ + symbol = ClefSymbol::c; + line = 1; + octaveChange = 0; +} + +bool ClefData::isTreble() const +{ + return (symbol == ClefSymbol::g) && (line == 2) && (octaveChange == 0); +} + +bool ClefData::isBass() const +{ + return (symbol == ClefSymbol::f) && (line == 4) && (octaveChange == 0); +} + +bool ClefData::isAlto() const +{ + return (symbol == ClefSymbol::c) && (line == 3) && (octaveChange == 0); +} + +bool ClefData::isTenor() const +{ + return (symbol == ClefSymbol::c) && (line == 4) && (octaveChange == 0); +} + +bool ClefData::isBaritone() const +{ + return (symbol == ClefSymbol::c) && (line == 5) && (octaveChange == 0); +} + +bool ClefData::isSoprano() const +{ + return (symbol == ClefSymbol::c) && (line == 0) && (octaveChange == 0); +} + +bool ClefData::isMezzoSoprano() const +{ + return (symbol == ClefSymbol::c) && (line == 1) && (octaveChange == 0); } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/DocumentManager.cpp b/Sourcecode/private/mx/api/DocumentManager.cpp index a206ce09f..14e440d18 100644 --- a/Sourcecode/private/mx/api/DocumentManager.cpp +++ b/Sourcecode/private/mx/api/DocumentManager.cpp @@ -3,245 +3,227 @@ // Distributed under the MIT License #include "mx/api/DocumentManager.h" +#include "ezxml/XFactory.h" +#include "mx/core/Document.h" #include "mx/impl/ScoreReader.h" #include "mx/impl/ScoreWriter.h" -#include "mx/core/Document.h" -#include "ezxml/XFactory.h" #include "mx/utility/Throw.h" #define LOCK_DOCUMENT_MANAGER std::lock_guard lock(myImpl->myMutex); namespace mx { - namespace api +namespace api +{ +using DocumentMap = std::map; + +class DocumentManager::Impl +{ + public: + std::mutex myMutex; + int myCurrentId; + DocumentMap myMap; + int myCurrentUniqueId; + + Impl() : myMutex{}, myCurrentId{0}, myMap{}, myCurrentUniqueId{1000000} { - using DocumentMap = std::map; - class DocumentManager::Impl - { - public: - std::mutex myMutex; - int myCurrentId; - DocumentMap myMap; - int myCurrentUniqueId; - - Impl() - : myMutex{} - , myCurrentId{0} - , myMap{} - , myCurrentUniqueId{1000000} - { + } +}; - } - }; - - DocumentManager::DocumentManager() - : myImpl{ new DocumentManager::Impl() } - { - myImpl->myCurrentId = 1; - } - - - DocumentManager::~DocumentManager() - { - - } - - - DocumentManager& DocumentManager::getInstance() - { - static DocumentManager instance; - return instance; - } - - - int DocumentManager::createFromFile( const std::string& filePath ) - { - auto xdoc = ::ezxml::XFactory::makeXDoc(); +DocumentManager::DocumentManager() : myImpl{new DocumentManager::Impl()} +{ + myImpl->myCurrentId = 1; +} - try - { - xdoc->loadFile( filePath ); - } - catch ( std::exception& e ) - { - const std::string originalMessage = e.what(); - - const auto fileExtension = []( const std::string& filePath ) - { - const auto dotPos = filePath.find_last_of( '.' ); - if( dotPos == std::string::npos || dotPos == filePath.size() - 1 ) - { - return std::string{ "" }; - } - - return filePath.substr( dotPos + 1 ); - }; - - if ( ( originalMessage.find( "status_no_document_element" ) != std::string::npos) && - fileExtension( filePath ) == "mxl" ) - { - std::stringstream ss; - ss << "it looks like you are trying to parse a compressed musicxml file, which is currently " - << "unsupported. https://github.com/webern/mx/issues/66 (" - << originalMessage << ")"; - MX_THROW( ss.str() ); - } - - throw e; - } +DocumentManager::~DocumentManager() +{ +} - auto mxdoc = mx::core::makeDocument(); - std::stringstream messages; - auto isSuccess = mxdoc->fromXDoc( messages, *xdoc ); - - if( !isSuccess ) - { - MX_THROW( messages.str() ); - } - - LOCK_DOCUMENT_MANAGER - myImpl->myMap[myImpl->myCurrentId] = std::move( mxdoc ); - return myImpl->myCurrentId++; - } - - - int DocumentManager::createFromStream( std::istream& stream ) - { - auto xdoc = ::ezxml::XFactory::makeXDoc(); - xdoc->loadStream( stream ); - auto mxdoc = mx::core::makeDocument(); - - std::stringstream messages; - auto isSuccess = mxdoc->fromXDoc( messages, *xdoc ); - - if( !isSuccess ) - { - MX_THROW( messages.str() ); - } - - LOCK_DOCUMENT_MANAGER - myImpl->myMap[myImpl->myCurrentId] = std::move( mxdoc ); - return myImpl->myCurrentId++; - } - - - int DocumentManager::createFromScore( const ScoreData& score ) - { - impl::ScoreWriter writer{ score }; - auto scorePartwise = writer.getScorePartwise(); - auto mxdoc = core::makeDocument(); - mxdoc->setChoice( core::DocumentChoice::partwise ); - mxdoc->setScorePartwise( scorePartwise ); - - if( score.musicXmlType == "timewise" ) - { - mxdoc->convertContents(); - } - - LOCK_DOCUMENT_MANAGER - myImpl->myMap[myImpl->myCurrentId] = std::move( mxdoc ); - return myImpl->myCurrentId++; - } - - - void DocumentManager::writeToFile( int documentId, const std::string& filePath ) const - { - LOCK_DOCUMENT_MANAGER - - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return; - } - - auto xdoc = ::ezxml::XFactory::makeXDoc(); - it->second->toXDoc( *xdoc ); - xdoc->saveFile( filePath ); - } - - - void DocumentManager::writeToStream( int documentId, std::ostream& stream ) const - { - LOCK_DOCUMENT_MANAGER - - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return; - } - - auto xdoc = ::ezxml::XFactory::makeXDoc(); - it->second->toXDoc( *xdoc ); - xdoc->saveStream( stream ); - } +DocumentManager &DocumentManager::getInstance() +{ + static DocumentManager instance; + return instance; +} - - ScoreData DocumentManager::getData( int documentId ) const - { - LOCK_DOCUMENT_MANAGER - - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return ScoreData{}; - } - - bool wasTimewise = false; +int DocumentManager::createFromFile(const std::string &filePath) +{ + auto xdoc = ::ezxml::XFactory::makeXDoc(); + + try + { + xdoc->loadFile(filePath); + } + catch (std::exception &e) + { + const std::string originalMessage = e.what(); - if( it->second->getChoice() == core::DocumentChoice::timewise ) + const auto fileExtension = [](const std::string &filePath) { + const auto dotPos = filePath.find_last_of('.'); + if (dotPos == std::string::npos || dotPos == filePath.size() - 1) { - wasTimewise = true; - it->second->convertContents(); + return std::string{""}; } - impl::ScoreReader reader{ *it->second->getScorePartwise() }; - auto score = reader.getScoreData(); + return filePath.substr(dotPos + 1); + }; - if( wasTimewise ) - { - score.musicXmlType = "timewise"; - it->second->convertContents(); - } - return score; - } - - - void DocumentManager::destroyDocument( int documentId ) + if ((originalMessage.find("status_no_document_element") != std::string::npos) && + fileExtension(filePath) == "mxl") { - LOCK_DOCUMENT_MANAGER - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return; - } - - myImpl->myMap.erase( it ); - } - - - mx::core::DocumentPtr DocumentManager::getDocument( int documentId ) const - { - LOCK_DOCUMENT_MANAGER - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return mx::core::DocumentPtr{}; - } - - return it->second; + std::stringstream ss; + ss << "it looks like you are trying to parse a compressed musicxml file, which is currently " + << "unsupported. https://github.com/webern/mx/issues/66 (" << originalMessage << ")"; + MX_THROW(ss.str()); } - int DocumentManager::getUniqueId() - { - LOCK_DOCUMENT_MANAGER - int returnValue = myImpl->myCurrentUniqueId; - ++myImpl->myCurrentUniqueId; - return returnValue; - } + throw e; } + + auto mxdoc = mx::core::makeDocument(); + std::stringstream messages; + auto isSuccess = mxdoc->fromXDoc(messages, *xdoc); + + if (!isSuccess) + { + MX_THROW(messages.str()); + } + + LOCK_DOCUMENT_MANAGER + myImpl->myMap[myImpl->myCurrentId] = std::move(mxdoc); + return myImpl->myCurrentId++; +} + +int DocumentManager::createFromStream(std::istream &stream) +{ + auto xdoc = ::ezxml::XFactory::makeXDoc(); + xdoc->loadStream(stream); + auto mxdoc = mx::core::makeDocument(); + + std::stringstream messages; + auto isSuccess = mxdoc->fromXDoc(messages, *xdoc); + + if (!isSuccess) + { + MX_THROW(messages.str()); + } + + LOCK_DOCUMENT_MANAGER + myImpl->myMap[myImpl->myCurrentId] = std::move(mxdoc); + return myImpl->myCurrentId++; +} + +int DocumentManager::createFromScore(const ScoreData &score) +{ + impl::ScoreWriter writer{score}; + auto scorePartwise = writer.getScorePartwise(); + auto mxdoc = core::makeDocument(); + mxdoc->setChoice(core::DocumentChoice::partwise); + mxdoc->setScorePartwise(scorePartwise); + + if (score.musicXmlType == "timewise") + { + mxdoc->convertContents(); + } + + LOCK_DOCUMENT_MANAGER + myImpl->myMap[myImpl->myCurrentId] = std::move(mxdoc); + return myImpl->myCurrentId++; +} + +void DocumentManager::writeToFile(int documentId, const std::string &filePath) const +{ + LOCK_DOCUMENT_MANAGER + + const DocumentMap::const_iterator it = myImpl->myMap.find(documentId); + + if (it == myImpl->myMap.cend()) + { + return; + } + + auto xdoc = ::ezxml::XFactory::makeXDoc(); + it->second->toXDoc(*xdoc); + xdoc->saveFile(filePath); +} + +void DocumentManager::writeToStream(int documentId, std::ostream &stream) const +{ + LOCK_DOCUMENT_MANAGER + + const DocumentMap::const_iterator it = myImpl->myMap.find(documentId); + + if (it == myImpl->myMap.cend()) + { + return; + } + + auto xdoc = ::ezxml::XFactory::makeXDoc(); + it->second->toXDoc(*xdoc); + xdoc->saveStream(stream); +} + +ScoreData DocumentManager::getData(int documentId) const +{ + LOCK_DOCUMENT_MANAGER + + const DocumentMap::const_iterator it = myImpl->myMap.find(documentId); + + if (it == myImpl->myMap.cend()) + { + return ScoreData{}; + } + + bool wasTimewise = false; + + if (it->second->getChoice() == core::DocumentChoice::timewise) + { + wasTimewise = true; + it->second->convertContents(); + } + + impl::ScoreReader reader{*it->second->getScorePartwise()}; + auto score = reader.getScoreData(); + + if (wasTimewise) + { + score.musicXmlType = "timewise"; + it->second->convertContents(); + } + return score; +} + +void DocumentManager::destroyDocument(int documentId) +{ + LOCK_DOCUMENT_MANAGER + const DocumentMap::const_iterator it = myImpl->myMap.find(documentId); + + if (it == myImpl->myMap.cend()) + { + return; + } + + myImpl->myMap.erase(it); +} + +mx::core::DocumentPtr DocumentManager::getDocument(int documentId) const +{ + LOCK_DOCUMENT_MANAGER + const DocumentMap::const_iterator it = myImpl->myMap.find(documentId); + + if (it == myImpl->myMap.cend()) + { + return mx::core::DocumentPtr{}; + } + + return it->second; +} + +int DocumentManager::getUniqueId() +{ + LOCK_DOCUMENT_MANAGER + int returnValue = myImpl->myCurrentUniqueId; + ++myImpl->myCurrentUniqueId; + return returnValue; } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/DurationData.cpp b/Sourcecode/private/mx/api/DurationData.cpp index 13d67667e..23de31a79 100644 --- a/Sourcecode/private/mx/api/DurationData.cpp +++ b/Sourcecode/private/mx/api/DurationData.cpp @@ -6,19 +6,13 @@ namespace mx { - namespace api - { - DurationData::DurationData() - : durationName{ DurationName::unspecified } - , durationDots{ 0 } - , durationTimeTicks{ 1 } - , isTied{ false } - , timeModificationActualNotes{ 1 } - , timeModificationNormalNotes{ 1 } - , timeModificationNormalType{ api::DurationName::unspecified } - , timeModificationNormalTypeDots{ 0 } - { - - } - } +namespace api +{ +DurationData::DurationData() + : durationName{DurationName::unspecified}, durationDots{0}, durationTimeTicks{1}, isTied{false}, + timeModificationActualNotes{1}, timeModificationNormalNotes{1}, + timeModificationNormalType{api::DurationName::unspecified}, timeModificationNormalTypeDots{0} +{ } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/EncodingData.cpp b/Sourcecode/private/mx/api/EncodingData.cpp index 72e480dff..5e2bb08a9 100644 --- a/Sourcecode/private/mx/api/EncodingData.cpp +++ b/Sourcecode/private/mx/api/EncodingData.cpp @@ -7,31 +7,30 @@ namespace mx { - namespace api - { +namespace api +{ //////////////////////////////////////////////////////////////////////////////// // CTOR AND COPY /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - EncodingDate EncodingDate::today() - { - const auto d = mx::core::Date::today(); - mx::api::EncodingDate result{}; - result.year = d.getYear(); - result.month = d.getMonth(); - result.day = d.getDay(); - return result; - } +EncodingDate EncodingDate::today() +{ + const auto d = mx::core::Date::today(); + mx::api::EncodingDate result{}; + result.year = d.getYear(); + result.month = d.getMonth(); + result.day = d.getDay(); + return result; +} //////////////////////////////////////////////////////////////////////////////// // PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// // PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - } -} +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/MarkData.cpp b/Sourcecode/private/mx/api/MarkData.cpp index 892015e49..6617667c0 100644 --- a/Sourcecode/private/mx/api/MarkData.cpp +++ b/Sourcecode/private/mx/api/MarkData.cpp @@ -3,267 +3,186 @@ // Distributed under the MIT License #include "mx/api/MarkData.h" -#include "mx/impl/Converter.h" #include "mx/core/Enums.h" +#include "mx/impl/Converter.h" namespace mx { - namespace api +namespace api +{ +bool isMarkDynamic(MarkType markType) +{ + return (markType == MarkType::p) || (markType == MarkType::p) || (markType == MarkType::pp) || + (markType == MarkType::ppp) || (markType == MarkType::pppp) || (markType == MarkType::ppppp) || + (markType == MarkType::pppppp) || (markType == MarkType::f) || (markType == MarkType::ff) || + (markType == MarkType::fff) || (markType == MarkType::ffff) || (markType == MarkType::fffff) || + (markType == MarkType::ffffff) || (markType == MarkType::mp) || (markType == MarkType::mf) || + (markType == MarkType::sf) || (markType == MarkType::sfp) || (markType == MarkType::sfpp) || + (markType == MarkType::fp) || (markType == MarkType::rf) || (markType == MarkType::rfz) || + (markType == MarkType::sfz) || (markType == MarkType::sffz) || (markType == MarkType::fz) || + (markType == MarkType::otherDynamics); +} + +bool isMarkArpeggiate(MarkType markType) +{ + return (markType == MarkType::arpeggiate) || (markType == MarkType::arpeggiateDown) || + (markType == MarkType::arpeggiateUp); +} + +bool isMarkArticulation(MarkType markType) +{ + return (markType == MarkType::accent) || (markType == MarkType::strongAccent) || (markType == MarkType::staccato) || + (markType == MarkType::tenuto) || (markType == MarkType::detachedLegato) || + (markType == MarkType::staccatissimo) || (markType == MarkType::spiccato) || (markType == MarkType::scoop) || + (markType == MarkType::plop) || (markType == MarkType::doit) || (markType == MarkType::falloff) || + (markType == MarkType::breathMark) || (markType == MarkType::caesura) || (markType == MarkType::stress) || + (markType == MarkType::unstress) || (markType == MarkType::otherArticulation); +} + +bool isMarkOrnament(MarkType markType) +{ + return (markType == MarkType::trillMark) || (markType == MarkType::turn) || (markType == MarkType::delayedTurn) || + (markType == MarkType::invertedTurn) || (markType == MarkType::delayedInvertedTurn) || + (markType == MarkType::verticalTurn) || (markType == MarkType::shake) || (markType == MarkType::wavyLine) || + (markType == MarkType::mordent) || (markType == MarkType::invertedMordent) || + (markType == MarkType::schleifer) || (markType == MarkType::tremoloSingleOne) || + (markType == MarkType::tremoloSingleTwo) || (markType == MarkType::tremoloSingleThree) || + (markType == MarkType::tremoloSingleFour) || (markType == MarkType::tremoloSingleFive) || + (markType == MarkType::otherOrnament) || (markType == MarkType::unknownOrnament); +} + +bool isMarkFermata(MarkType markType) +{ + return (markType == MarkType::fermata) || (markType == MarkType::fermataNormal) || + (markType == MarkType::fermataAngled) || (markType == MarkType::fermataSquare) || + (markType == MarkType::fermataUpright) || (markType == MarkType::fermataNormalUpright) || + (markType == MarkType::fermataAngledUpright) || (markType == MarkType::fermataSquareUpright) || + (markType == MarkType::fermataInverted) || (markType == MarkType::fermataNormalInverted) || + (markType == MarkType::fermataAngledInverted) || (markType == MarkType::fermataSquareInverted); +} + +bool isMarkNonArpeggiate(MarkType markType) +{ + return (markType == MarkType::nonArpeggiate); +} + +bool isMarkPedal(MarkType markType) +{ + return (markType == MarkType::pedal) || (markType == MarkType::damp); +} + +bool isMarkTechnical(MarkType markType) +{ + return (markType == MarkType::upBow) || (markType == MarkType::downBow) || (markType == MarkType::harmonic) || + (markType == MarkType::openString) || (markType == MarkType::thumbPosition) || + (markType == MarkType::doubleTongue) || (markType == MarkType::tripleTongue) || + (markType == MarkType::stopped) || (markType == MarkType::snapPizzicato) || (markType == MarkType::heel) || + (markType == MarkType::toe) || (markType == MarkType::fingernails) || (markType == MarkType::otherTechnical); +} + +bool isMarkTremolo(MarkType markType) +{ + return (markType == MarkType::tremoloSingleOne) || (markType == MarkType::tremoloSingleTwo) || + (markType == MarkType::tremoloSingleThree) || (markType == MarkType::tremoloSingleFour) || + (markType == MarkType::tremoloSingleFive); +} + +bool isMarkCustom(MarkType markType) +{ + return (markType == MarkType::customAccentTenuto); +} + +std::string getCustomMarkName(MarkType markType) +{ + switch (markType) { - bool isMarkDynamic( MarkType markType ) - { - return ( markType == MarkType::p ) || - ( markType == MarkType::p ) || - ( markType == MarkType::pp ) || - ( markType == MarkType::ppp ) || - ( markType == MarkType::pppp ) || - ( markType == MarkType::ppppp ) || - ( markType == MarkType::pppppp ) || - ( markType == MarkType::f ) || - ( markType == MarkType::ff ) || - ( markType == MarkType::fff ) || - ( markType == MarkType::ffff ) || - ( markType == MarkType::fffff ) || - ( markType == MarkType::ffffff ) || - ( markType == MarkType::mp ) || - ( markType == MarkType::mf ) || - ( markType == MarkType::sf ) || - ( markType == MarkType::sfp ) || - ( markType == MarkType::sfpp ) || - ( markType == MarkType::fp ) || - ( markType == MarkType::rf ) || - ( markType == MarkType::rfz ) || - ( markType == MarkType::sfz ) || - ( markType == MarkType::sffz ) || - ( markType == MarkType::fz ) || - ( markType == MarkType::otherDynamics ); - } - - bool isMarkArpeggiate( MarkType markType ) - { - return ( markType == MarkType::arpeggiate ) || - ( markType == MarkType::arpeggiateDown ) || - ( markType == MarkType::arpeggiateUp ); - } - - bool isMarkArticulation( MarkType markType ) - { - return ( markType == MarkType::accent ) || - ( markType == MarkType::strongAccent ) || - ( markType == MarkType::staccato ) || - ( markType == MarkType::tenuto ) || - ( markType == MarkType::detachedLegato ) || - ( markType == MarkType::staccatissimo ) || - ( markType == MarkType::spiccato ) || - ( markType == MarkType::scoop ) || - ( markType == MarkType::plop ) || - ( markType == MarkType::doit ) || - ( markType == MarkType::falloff ) || - ( markType == MarkType::breathMark ) || - ( markType == MarkType::caesura ) || - ( markType == MarkType::stress ) || - ( markType == MarkType::unstress ) || - ( markType == MarkType::otherArticulation ); - } + case MarkType::customAccentTenuto: + return markStringCustomAccentTenuto; + default: + break; + } + return ""; +} - bool isMarkOrnament( MarkType markType ) - { - return ( markType == MarkType::trillMark ) || - ( markType == MarkType::turn ) || - ( markType == MarkType::delayedTurn ) || - ( markType == MarkType::invertedTurn ) || - ( markType == MarkType::delayedInvertedTurn ) || - ( markType == MarkType::verticalTurn ) || - ( markType == MarkType::shake ) || - ( markType == MarkType::wavyLine ) || - ( markType == MarkType::mordent ) || - ( markType == MarkType::invertedMordent ) || - ( markType == MarkType::schleifer ) || - ( markType == MarkType::tremoloSingleOne ) || - ( markType == MarkType::tremoloSingleTwo ) || - ( markType == MarkType::tremoloSingleThree ) || - ( markType == MarkType::tremoloSingleFour ) || - ( markType == MarkType::tremoloSingleFive ) || - ( markType == MarkType::otherOrnament ) || - ( markType == MarkType::unknownOrnament ); - } - - - bool isMarkFermata( MarkType markType ) - { - return ( markType == MarkType::fermata ) || - ( markType == MarkType::fermataNormal ) || - ( markType == MarkType::fermataAngled ) || - ( markType == MarkType::fermataSquare ) || - ( markType == MarkType::fermataUpright ) || - ( markType == MarkType::fermataNormalUpright ) || - ( markType == MarkType::fermataAngledUpright ) || - ( markType == MarkType::fermataSquareUpright ) || - ( markType == MarkType::fermataInverted ) || - ( markType == MarkType::fermataNormalInverted ) || - ( markType == MarkType::fermataAngledInverted ) || - ( markType == MarkType::fermataSquareInverted ); - } - - - bool isMarkNonArpeggiate( MarkType markType ) - { - return ( markType == MarkType::nonArpeggiate ); - } +MarkType getMarkTypeFromCustomString(const std::string &inString) +{ + if (inString == markStringCustomAccentTenuto) + { + return api::MarkType::customAccentTenuto; + } - - bool isMarkPedal( MarkType markType ) - { - return ( markType == MarkType::pedal ) || - ( markType == MarkType::damp ); - } - - - bool isMarkTechnical( MarkType markType ) - { - return ( markType == MarkType::upBow ) || - ( markType == MarkType::downBow ) || - ( markType == MarkType::harmonic ) || - ( markType == MarkType::openString ) || - ( markType == MarkType::thumbPosition ) || - ( markType == MarkType::doubleTongue ) || - ( markType == MarkType::tripleTongue ) || - ( markType == MarkType::stopped ) || - ( markType == MarkType::snapPizzicato ) || - ( markType == MarkType::heel ) || - ( markType == MarkType::toe ) || - ( markType == MarkType::fingernails ) || - ( markType == MarkType::otherTechnical ); - } + return api::MarkType::customErrorUnknown; +} +int numTremoloSlashes(MarkType markType) +{ + if (markType == MarkType::tremoloSingleOne) + { + return 1; + } - bool isMarkTremolo( MarkType markType ) - { - return ( markType == MarkType::tremoloSingleOne ) || - ( markType == MarkType::tremoloSingleTwo ) || - ( markType == MarkType::tremoloSingleThree ) || - ( markType == MarkType::tremoloSingleFour ) || - ( markType == MarkType::tremoloSingleFive ); - } - - - bool isMarkCustom( MarkType markType ) - { - return ( markType == MarkType::customAccentTenuto ); - } - - - std::string getCustomMarkName( MarkType markType ) - { - switch ( markType ) - { - case MarkType::customAccentTenuto: - return markStringCustomAccentTenuto; - default: - break; - } - - return ""; - } - - - MarkType getMarkTypeFromCustomString( const std::string& inString ) - { - if( inString == markStringCustomAccentTenuto ) { - return api::MarkType::customAccentTenuto; - } - - return api::MarkType::customErrorUnknown; - } - + if (markType == MarkType::tremoloSingleTwo) + { + return 2; + } - int numTremoloSlashes( MarkType markType ) - { - if( markType == MarkType::tremoloSingleOne ) - { - return 1; - } + if (markType == MarkType::tremoloSingleThree) + { + return 3; + } - if( markType == MarkType::tremoloSingleTwo ) - { - return 2; - } + if (markType == MarkType::tremoloSingleFour) + { + return 4; + } - if( markType == MarkType::tremoloSingleThree ) - { - return 3; - } + if (markType == MarkType::tremoloSingleFive) + { + return 5; + } - if( markType == MarkType::tremoloSingleFour ) - { - return 4; - } + return -1; +} - if( markType == MarkType::tremoloSingleFive ) - { - return 5; - } +MarkData::MarkData() : markType(MarkType::unspecified), name{}, tickTimePosition{0}, printData{}, positionData{} +{ +} - return -1; - } +MarkData::MarkData(MarkType inMarkType) : markType(inMarkType), name{}, tickTimePosition{0}, printData{}, positionData{} +{ + impl::Converter converter; + if (isMarkDynamic(markType)) + { + name = mx::core::toString(converter.convertDynamic(markType)); + } + else if (isMarkArticulation(markType)) + { + name = "articulation"; + } + else if (isMarkFermata(markType)) + { + name = mx::core::toString(converter.convertFermata(markType)); + } +} - - MarkData::MarkData() - : markType( MarkType::unspecified ) - , name{} - , tickTimePosition{ 0 } - , printData{} - , positionData{} - { - - } - - - MarkData::MarkData( MarkType inMarkType ) - : markType( inMarkType ) - , name{} - , tickTimePosition{ 0 } - , printData{} - , positionData{} - { - impl::Converter converter; - if( isMarkDynamic( markType ) ) - { - name = mx::core::toString( converter.convertDynamic( markType ) ); - } - else if( isMarkArticulation( markType ) ) - { - name = "articulation"; - } - else if( isMarkFermata( markType ) ) - { - name = mx::core::toString( converter.convertFermata( markType ) ); - } - } - - - MarkData::MarkData( Placement inPlacement, MarkType inMarkType ) - : markType( inMarkType ) - , name{} - , tickTimePosition{ 0 } - , printData{} - , positionData{} - { - positionData.placement = inPlacement; - impl::Converter converter; - if( isMarkDynamic( markType ) ) - { - name = mx::core::toString( converter.convertDynamic( markType ) ); - } - else if( isMarkArticulation( markType ) ) - { - name = "articulation"; - } - else if( isMarkFermata( markType ) ) - { - name = mx::core::toString( converter.convertFermata( markType ) ); - } - } +MarkData::MarkData(Placement inPlacement, MarkType inMarkType) + : markType(inMarkType), name{}, tickTimePosition{0}, printData{}, positionData{} +{ + positionData.placement = inPlacement; + impl::Converter converter; + if (isMarkDynamic(markType)) + { + name = mx::core::toString(converter.convertDynamic(markType)); + } + else if (isMarkArticulation(markType)) + { + name = "articulation"; + } + else if (isMarkFermata(markType)) + { + name = mx::core::toString(converter.convertFermata(markType)); } } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/MeasureLocation.cpp b/Sourcecode/private/mx/api/MeasureLocation.cpp index ed40c2ef9..69818d576 100644 --- a/Sourcecode/private/mx/api/MeasureLocation.cpp +++ b/Sourcecode/private/mx/api/MeasureLocation.cpp @@ -4,47 +4,42 @@ #include "mx/api/MeasureLocation.h" #include "mx/api/ScoreData.h" + namespace mx { - namespace api +namespace api +{ +MeasureLocation::MeasureLocation() : partIndex{0}, staffIndex{0}, measureIndex{0} +{ +} + +bool MeasureLocation::isValid(const ScoreData &scoreData) const +{ + if (partIndex < 0 || staffIndex < 0 || measureIndex < 0) + { + return false; + } + + if (static_cast(partIndex) > scoreData.parts.size() - 1) { - MeasureLocation::MeasureLocation() - : partIndex{ 0 } - , staffIndex{ 0 } - , measureIndex{ 0 } - { - - } - - bool MeasureLocation::isValid( const ScoreData& scoreData ) const - { - if( partIndex < 0 || - staffIndex < 0 || - measureIndex < 0 ) - { - return false; - } - - if( static_cast( partIndex ) > scoreData.parts.size() - 1 ) - { - return false; - } - - const auto& part = scoreData.parts.at( static_cast( partIndex ) ); - - if( static_cast( measureIndex) > part.measures.size() - 1 ) - { - return false; - } - - const auto& measure = part.measures.at( static_cast( measureIndex ) ); - - if( static_cast( staffIndex ) > measure.staves.size() - 1 ) - { - return false; - } - - return true; - } + return false; } + + const auto &part = scoreData.parts.at(static_cast(partIndex)); + + if (static_cast(measureIndex) > part.measures.size() - 1) + { + return false; + } + + const auto &measure = part.measures.at(static_cast(measureIndex)); + + if (static_cast(staffIndex) > measure.staves.size() - 1) + { + return false; + } + + return true; } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/NoteData.cpp b/Sourcecode/private/mx/api/NoteData.cpp index 954163695..5e7027da3 100644 --- a/Sourcecode/private/mx/api/NoteData.cpp +++ b/Sourcecode/private/mx/api/NoteData.cpp @@ -6,29 +6,14 @@ namespace mx { - namespace api - { - NoteData::NoteData() - : isRest{ false } - , isMeasureRest{ false } - , isUnpitched{ false } - , isDisplayStepOctaveSpecified{ false } - , isChord{ false } - , isTieStart{ false } - , isTieStop{ false } - , noteType{ NoteType::normal } - , notehead{ Notehead::normal } - , pitchData{} - , userRequestedVoiceNumber{ -1 } - , stem{ Stem::unspecified } - , tickTimePosition{ 0 } - , durationData{} - , beams{} - , positionData{} - , printData{} - , noteAttachmentData{} - { - - } - } +namespace api +{ +NoteData::NoteData() + : isRest{false}, isMeasureRest{false}, isUnpitched{false}, isDisplayStepOctaveSpecified{false}, isChord{false}, + isTieStart{false}, isTieStop{false}, noteType{NoteType::normal}, notehead{Notehead::normal}, pitchData{}, + userRequestedVoiceNumber{-1}, stem{Stem::unspecified}, tickTimePosition{0}, durationData{}, beams{}, + positionData{}, printData{}, noteAttachmentData{} +{ } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/PitchData.cpp b/Sourcecode/private/mx/api/PitchData.cpp index 078dad7b6..31105214c 100644 --- a/Sourcecode/private/mx/api/PitchData.cpp +++ b/Sourcecode/private/mx/api/PitchData.cpp @@ -6,37 +6,49 @@ namespace mx { - namespace api - { - PitchData::PitchData() - : PitchData{ Step::c } - { - - } +namespace api +{ +PitchData::PitchData() : PitchData{Step::c} +{ +} - void PitchData::showAccidental() - { - switch( alter ) - { - case -3: accidental = Accidental::tripleFlat; break; - case -2: accidental = Accidental::flatFlat; break; - case -1: accidental = Accidental::flat; break; - case 0: accidental = Accidental::natural; break; - case 1: accidental = Accidental::sharp; break; - case 2: accidental = Accidental::doubleSharp; break; - case 3: accidental = Accidental::tripleSharp; break; - default: accidental = Accidental::none; - } - } - - - void PitchData::hideAccidental() - { - accidental = Accidental::none; - isAccidentalBracketed = false; - isAccidentalCautionary = false; - isAccidentalEditorial = false; - isAccidentalParenthetical = false; - } +void PitchData::showAccidental() +{ + switch (alter) + { + case -3: + accidental = Accidental::tripleFlat; + break; + case -2: + accidental = Accidental::flatFlat; + break; + case -1: + accidental = Accidental::flat; + break; + case 0: + accidental = Accidental::natural; + break; + case 1: + accidental = Accidental::sharp; + break; + case 2: + accidental = Accidental::doubleSharp; + break; + case 3: + accidental = Accidental::tripleSharp; + break; + default: + accidental = Accidental::none; } } + +void PitchData::hideAccidental() +{ + accidental = Accidental::none; + isAccidentalBracketed = false; + isAccidentalCautionary = false; + isAccidentalEditorial = false; + isAccidentalParenthetical = false; +} +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/ScoreData.cpp b/Sourcecode/private/mx/api/ScoreData.cpp index 912f0d014..1d37238b7 100644 --- a/Sourcecode/private/mx/api/ScoreData.cpp +++ b/Sourcecode/private/mx/api/ScoreData.cpp @@ -6,109 +6,84 @@ namespace mx { - namespace api - { - - ScoreData::ScoreData() - : musicXmlVersion{ api::MusicXmlVersion::unspecified } - , musicXmlType{ "partwise" } - , workTitle{} - , workNumber{} - , movementTitle{} - , movementNumber{} - , composer{} - , lyricist{} - , copyright{} - , encoding{} - , pageTextItems{} - , defaults{} - , parts{} - , partGroups{} - , ticksPerQuarter{ DEFAULT_TICKS_PER_QUARTER } - { - - } +namespace api +{ +ScoreData::ScoreData() + : musicXmlVersion{api::MusicXmlVersion::unspecified}, musicXmlType{"partwise"}, workTitle{}, workNumber{}, + movementTitle{}, movementNumber{}, composer{}, lyricist{}, copyright{}, encoding{}, pageTextItems{}, defaults{}, + parts{}, partGroups{}, ticksPerQuarter{DEFAULT_TICKS_PER_QUARTER} +{ +} +int ScoreData::getNumMeasures() const +{ + int numMeasures = 0; - int ScoreData::getNumMeasures() const + for (const auto &part : parts) + { + int temp = static_cast(part.measures.size()); + if (temp > numMeasures) { - int numMeasures = 0; - - for( const auto& part : parts ) - { - int temp = static_cast( part.measures.size() ); - if( temp > numMeasures ) - { - numMeasures = temp; - } - } - - return numMeasures; + numMeasures = temp; } + } + return numMeasures; +} +int ScoreData::getNumStavesPerSystem() const +{ + int numStaves = 0; - int ScoreData::getNumStavesPerSystem() const - { - int numStaves = 0; - - for( const auto& p : parts ) - { - numStaves += p.getNumStaves(); - } - - return numStaves; - } + for (const auto &p : parts) + { + numStaves += p.getNumStaves(); + } + return numStaves; +} - void ScoreData::sort() +void ScoreData::sort() +{ + for (auto &part : parts) + { + for (auto &measure : part.measures) { - for( auto& part : parts ) + for (auto &staff : measure.staves) { - for( auto& measure : part.measures ) - { - for ( auto& staff : measure.staves ) - { - const auto clefCompare = [&]( ClefData& inLeft, ClefData& inRight ) - { - return inLeft.tickTimePosition < inRight.tickTimePosition; - }; + const auto clefCompare = [&](ClefData &inLeft, ClefData &inRight) { + return inLeft.tickTimePosition < inRight.tickTimePosition; + }; - std::sort( std::begin( staff.clefs ), std::end( staff.clefs ), clefCompare ); + std::sort(std::begin(staff.clefs), std::end(staff.clefs), clefCompare); - const auto directionCompare = [&]( DirectionData& inLeft, DirectionData& inRight ) - { - return inLeft.tickTimePosition < inRight.tickTimePosition; - }; + const auto directionCompare = [&](DirectionData &inLeft, DirectionData &inRight) { + return inLeft.tickTimePosition < inRight.tickTimePosition; + }; - std::sort( std::begin( staff.directions ), std::end( staff.directions ), directionCompare ); + std::sort(std::begin(staff.directions), std::end(staff.directions), directionCompare); - for ( auto& voice : staff.voices ) - { - const auto noteCompare = [&]( NoteData& inLeft, NoteData& inRight ) - { - return inLeft.tickTimePosition < inRight.tickTimePosition; - }; + for (auto &voice : staff.voices) + { + const auto noteCompare = [&](NoteData &inLeft, NoteData &inRight) { + return inLeft.tickTimePosition < inRight.tickTimePosition; + }; - std::sort( std::begin( voice.second.notes ), std::end( voice.second.notes ), noteCompare ); - } - } + std::sort(std::begin(voice.second.notes), std::end(voice.second.notes), noteCompare); } } } + } +} +std::vector::iterator findPart(std::vector &inParts, const std::string &inPartId) +{ + auto predicate = [&inPartId](const PartData &partData) { return inPartId == partData.uniqueId; }; - std::vector::iterator findPart( std::vector& inParts, const std::string& inPartId ) - { - auto predicate = [&inPartId] ( const PartData& partData ) - { - return inPartId == partData.uniqueId; - }; - - auto it = std::find_if( inParts.begin(), inParts.end(), predicate ); - return it; - } - } + auto it = std::find_if(inParts.begin(), inParts.end(), predicate); + return it; } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/SoundID.cpp b/Sourcecode/private/mx/api/SoundID.cpp index b16656ca7..e23e59d8e 100644 --- a/Sourcecode/private/mx/api/SoundID.cpp +++ b/Sourcecode/private/mx/api/SoundID.cpp @@ -8,40 +8,39 @@ namespace mx { - namespace api +namespace api +{ +std::string SoundIDToString(SoundID inSoundID) +{ + if (inSoundID == SoundID::unspecified) { - std::string SoundIDToString( SoundID inSoundID ) - { - if( inSoundID == SoundID::unspecified ) - { - return "unspecified"; - } - else if( inSoundID == SoundID::errorBadString ) - { - return "error.bad.string"; - } - - impl::Converter c; - return core::PlaybackSoundToString( c.convert( inSoundID ) ); - } - + return "unspecified"; + } + else if (inSoundID == SoundID::errorBadString) + { + return "error.bad.string"; + } - SoundID SoundIDFromString( const std::string& inString ) - { - SoundID result = SoundID::keyboardPiano; + impl::Converter c; + return core::PlaybackSoundToString(c.convert(inSoundID)); +} - try - { - const auto p = core::PlaybackSoundFromString( inString ); - impl::Converter c; - result = c.convert( p ); - } - catch (...) - { - result = SoundID::errorBadString; - } +SoundID SoundIDFromString(const std::string &inString) +{ + SoundID result = SoundID::keyboardPiano; - return result; - } + try + { + const auto p = core::PlaybackSoundFromString(inString); + impl::Converter c; + result = c.convert(p); } + catch (...) + { + result = SoundID::errorBadString; + } + + return result; } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/api/Version.cpp b/Sourcecode/private/mx/api/Version.cpp index ad61597a6..7cacdd3e2 100644 --- a/Sourcecode/private/mx/api/Version.cpp +++ b/Sourcecode/private/mx/api/Version.cpp @@ -8,65 +8,50 @@ namespace mx { - namespace api - { +namespace api +{ //////////////////////////////////////////////////////////////////////////////// // PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - int - Version::getVersionMajor() - { - return getInstance().myMajor; - } - - - int - Version::getVersionMinor() - { - return getInstance().myMinor; - } - +int Version::getVersionMajor() +{ + return getInstance().myMajor; +} - int - Version::getVersionPatch() - { - return getInstance().myPatch; - } +int Version::getVersionMinor() +{ + return getInstance().myMinor; +} +int Version::getVersionPatch() +{ + return getInstance().myPatch; +} - const std::string& - Version::getString() - { - return getInstance().myString; - } +const std::string &Version::getString() +{ + return getInstance().myString; +} //////////////////////////////////////////////////////////////////////////////// // PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - Version::Version() - : myMajor{ MX_VERSION_MAJOR } - , myMinor{ MX_VERSION_MINOR } - , myPatch{ MX_VERSION_PATCH } - , myBuild{ MX_VERSION_BUILD } - , myString{} - { - std::stringstream ss; - ss << - myMajor << "." << - myMinor << "." << - myPatch << " (" << - myBuild << ")"; - myString = ss.str(); - } +Version::Version() + : myMajor{MX_VERSION_MAJOR}, myMinor{MX_VERSION_MINOR}, myPatch{MX_VERSION_PATCH}, myBuild{MX_VERSION_BUILD}, + myString{} +{ + std::stringstream ss; + ss << myMajor << "." << myMinor << "." << myPatch << " (" << myBuild << ")"; + myString = ss.str(); +} - const Version& - Version::getInstance() - { - const static Version v; - return v; - } - } +const Version &Version::getInstance() +{ + const static Version v; + return v; } +} // namespace api +} // namespace mx diff --git a/Sourcecode/private/mx/core/AttributesInterface.cpp b/Sourcecode/private/mx/core/AttributesInterface.cpp index ad2ffc3a3..f735b9577 100644 --- a/Sourcecode/private/mx/core/AttributesInterface.cpp +++ b/Sourcecode/private/mx/core/AttributesInterface.cpp @@ -6,25 +6,26 @@ namespace mx { - namespace core - { - bool AttributesInterface::hasValues() const { return false; } - std::ostream& AttributesInterface::toStream( std::ostream& os ) const - { - return os; - } - +namespace core +{ +bool AttributesInterface::hasValues() const +{ + return false; +} - std::ostream& operator<<( std::ostream& os, const AttributesInterface& value ) - { - return value.toStream( os ); - } +std::ostream &AttributesInterface::toStream(std::ostream &os) const +{ + return os; +} +std::ostream &operator<<(std::ostream &os, const AttributesInterface &value) +{ + return value.toStream(os); +} - bool - AttributesInterface::fromXElement( std::ostream& message, ::ezxml::XElement& xelement ) - { - return this->fromXElementImpl( message, xelement ); - } - } +bool AttributesInterface::fromXElement(std::ostream &message, ::ezxml::XElement &xelement) +{ + return this->fromXElementImpl(message, xelement); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/AttributesInterface.h b/Sourcecode/private/mx/core/AttributesInterface.h index ff21d60e9..99e28bd90 100644 --- a/Sourcecode/private/mx/core/AttributesInterface.h +++ b/Sourcecode/private/mx/core/AttributesInterface.h @@ -11,45 +11,45 @@ namespace ezxml { - class XElement; +class XElement; } -namespace mx +namespace mx { - namespace core +namespace core +{ +struct AttributesInterface; +using AttributesPtr = std::shared_ptr; +using AttributesUPtr = std::unique_ptr; + +struct AttributesInterface +{ + virtual ~AttributesInterface() + { + } + + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + virtual bool fromXElement(std::ostream &message, ::ezxml::XElement &xelement) final; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) = 0; +}; + +std::ostream &operator<<(std::ostream &os, const AttributesInterface &value); + +template +std::ostream &streamAttribute(std::ostream &os, const T &value, const char *attributeName, const bool isPresent) +{ + if (isPresent) { - struct AttributesInterface; - using AttributesPtr = std::shared_ptr; - using AttributesUPtr = std::unique_ptr; - - struct AttributesInterface - { - virtual ~AttributesInterface() {} - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - virtual bool fromXElement( std::ostream& message, ::ezxml::XElement& xelement ) final; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) = 0; - }; - - std::ostream& operator<<( std::ostream& os, const AttributesInterface& value ); - - template - std::ostream& streamAttribute( std::ostream& os, - const T& value, - const char* attributeName, - const bool isPresent ) - { - if ( isPresent ) - { - os << " "; - os << attributeName; - os << "=\""; - os << value; - os << "\""; - } - return os; - } + os << " "; + os << attributeName; + os << "=\""; + os << value; + os << "\""; } + return os; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Color.cpp b/Sourcecode/private/mx/core/Color.cpp index 6f1f60d4c..c6910574e 100644 --- a/Sourcecode/private/mx/core/Color.cpp +++ b/Sourcecode/private/mx/core/Color.cpp @@ -3,265 +3,268 @@ // Distributed under the MIT License #include "mx/core/Color.h" -#include #include +#include namespace mx { - namespace core +namespace core +{ +class Color::impl +{ + public: + impl(const IntType alpha, const IntType red, const IntType green, const IntType blue) + : myAlpha(alpha), myRed(red), myGreen(green), myBlue(blue), myColorType(Color::ColorType::ARGB) { - class Color::impl - { - public: - impl( const IntType alpha, - const IntType red, - const IntType green, - const IntType blue ) - :myAlpha( alpha ) - ,myRed( red ) - ,myGreen( green ) - ,myBlue( blue ) - ,myColorType( Color::ColorType::ARGB ) - {} - - impl( const IntType red, - const IntType green, - const IntType blue ) - :myAlpha(255 ) - ,myRed( red ) - ,myGreen( green ) - ,myBlue( blue ) - ,myColorType( Color::ColorType::RGB ) - {} - - impl() - :myAlpha( 255 ) - ,myRed( 255 ) - ,myGreen( 255 ) - ,myBlue( 255 ) - ,myColorType( ColorType::RGB ) - {} - - IntType getAlpha() const - { - return (short)myAlpha.getValue(); - } - IntType getRed() const - { - return (IntType)myRed.getValue(); - } - IntType getGreen() const - { - return (IntType)myGreen.getValue(); - } - IntType getBlue() const - { - return (IntType)myBlue.getValue(); - } - ColorType getColorType() const - { - return myColorType; - } - - void setAlpha( const IntType value ) - { - myAlpha.setValue( value ); - myColorType = Color::ColorType::ARGB; - } - void setRed( const IntType value ) - { - myRed.setValue( value ); - } - void setGreen( const IntType value ) - { - myGreen.setValue( value ); - } - void setBlue( const IntType value ) - { - myBlue.setValue( value ); - } - void setColorType( const ColorType value ) - { - myColorType = value; - if ( myColorType == Color::ColorType::RGB ) - { - myAlpha.setValue( 255 ); - } - } - void parse( const std::string& value ) - { - if ( value.length() != 7 && - value.length() != 9 ) - { - return; // bad input - } - auto c = value.cbegin(); - if ( *c != '#' ) - { - return; // bad input - } - if ( value.substr( 1, value.length()-1).find_first_not_of( "ABCDEF0123456789" ) - != std::string::npos ) - { - return; // bad input - } - Color::ColorType colortype = Color::ColorType::RGB; - IntType alpha = 255; - IntType red = 255; - IntType green = 255; - IntType blue = 255; - if ( value.length() == 9 ) - { - colortype = Color::ColorType::ARGB; - alpha = getInt( value, 1 ); - red = getInt( value, 3 ); - green = getInt( value, 5 ); - blue = getInt( value, 7 ); - } - else if ( value.length() == 7 ) - { - colortype = Color::ColorType::RGB; - alpha = 255; - red = getInt( value, 1 ); - green = getInt( value, 3 ); - blue = getInt( value, 5 ); - } - setAlpha( alpha ); - setRed( red ); - setGreen( green ); - setBlue( blue ); - setColorType( colortype ); - } - - private: - Byte myAlpha; - Byte myRed; - Byte myGreen; - Byte myBlue; - Color::ColorType myColorType; - IntType getInt( const std::string& str, int startpos ) - { - IntType val = 0; - std::stringstream ss( str.substr( static_cast( startpos ), 2 ) ); - ss << std::hex; - ss << std::uppercase; - ss >> val; - return val; - } - }; - - - Color::Color( const IntType alpha, - const IntType red, - const IntType green, - const IntType blue ) - :myImpl( new Color::impl( alpha, red, green, blue ) ) - {} - - Color::Color( const IntType red, - const IntType green, - const IntType blue ) - :myImpl( new Color::impl( red, green, blue ) ) - {} - - Color::Color() - :myImpl( new Color::impl() ) - {} - - Color::Color( const std::string& value ) - :myImpl( new Color::impl() ) - { myImpl->parse( value ); } - - Color::~Color() {} - - Color::Color( const Color& other ) - :myImpl( new Color::impl( *other.myImpl ) ) - {} - - Color::Color( Color&& other ) - :myImpl( std::move( other.myImpl ) ) - {} - - Color& Color::operator=( const Color& other ) - { - this->myImpl = std::unique_ptr( new Color::impl( *other.myImpl ) ); - return *this; - } - - IntType Color::getAlpha() const - { - return myImpl->getAlpha(); - } - IntType Color::getRed() const - { - return myImpl->getRed(); - } - IntType Color::getGreen() const - { - return myImpl->getGreen(); - } - IntType Color::getBlue() const - { - return myImpl->getBlue(); - } - Color::ColorType Color::getColorType() const - { - return myImpl->getColorType(); - } - void Color::setAlpha( const IntType value ) - { - myImpl->setAlpha( value ); - } - void Color::setRed( const IntType value ) - { - myImpl->setRed( value ); - } - void Color::setGreen( const IntType value ) - { - myImpl->setGreen( value ); - } - void Color::setBlue( const IntType value ) + } + + impl(const IntType red, const IntType green, const IntType blue) + : myAlpha(255), myRed(red), myGreen(green), myBlue(blue), myColorType(Color::ColorType::RGB) + { + } + + impl() : myAlpha(255), myRed(255), myGreen(255), myBlue(255), myColorType(ColorType::RGB) + { + } + + IntType getAlpha() const + { + return (short)myAlpha.getValue(); + } + + IntType getRed() const + { + return (IntType)myRed.getValue(); + } + + IntType getGreen() const + { + return (IntType)myGreen.getValue(); + } + + IntType getBlue() const + { + return (IntType)myBlue.getValue(); + } + + ColorType getColorType() const + { + return myColorType; + } + + void setAlpha(const IntType value) + { + myAlpha.setValue(value); + myColorType = Color::ColorType::ARGB; + } + + void setRed(const IntType value) + { + myRed.setValue(value); + } + + void setGreen(const IntType value) + { + myGreen.setValue(value); + } + + void setBlue(const IntType value) + { + myBlue.setValue(value); + } + + void setColorType(const ColorType value) + { + myColorType = value; + if (myColorType == Color::ColorType::RGB) { - myImpl->setBlue( value ); + myAlpha.setValue(255); } - void Color::setColorType( const Color::ColorType value ) + } + + void parse(const std::string &value) + { + if (value.length() != 7 && value.length() != 9) { - myImpl->setColorType( value ); + return; // bad input } - void Color::parse( const std::string& value ) + auto c = value.cbegin(); + if (*c != '#') { - myImpl->parse( value ); + return; // bad input } - - std::string toString( const Color& value ) + if (value.substr(1, value.length() - 1).find_first_not_of("ABCDEF0123456789") != std::string::npos) { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); + return; // bad input } - std::ostream& toStream( std::ostream& os, const Color& value ) + Color::ColorType colortype = Color::ColorType::RGB; + IntType alpha = 255; + IntType red = 255; + IntType green = 255; + IntType blue = 255; + if (value.length() == 9) { - auto flagsval = os.flags(); - auto fillval = os.fill(); - auto widthval = os.width(); - os << "#"; - - if ( value.getColorType() == Color::ColorType::ARGB ) - { - os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getAlpha(); - } - os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getRed(); - os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getGreen(); - os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getBlue(); - os.flags( flagsval ); - os.width( widthval ); - os.flags( flagsval ); - os.fill( fillval ); - return os; + colortype = Color::ColorType::ARGB; + alpha = getInt(value, 1); + red = getInt(value, 3); + green = getInt(value, 5); + blue = getInt(value, 7); } - std::ostream& operator<<( std::ostream& os, const Color& value ) + else if (value.length() == 7) { - return toStream( os, value ); + colortype = Color::ColorType::RGB; + alpha = 255; + red = getInt(value, 1); + green = getInt(value, 3); + blue = getInt(value, 5); } + setAlpha(alpha); + setRed(red); + setGreen(green); + setBlue(blue); + setColorType(colortype); + } + + private: + Byte myAlpha; + Byte myRed; + Byte myGreen; + Byte myBlue; + Color::ColorType myColorType; + + IntType getInt(const std::string &str, int startpos) + { + IntType val = 0; + std::stringstream ss(str.substr(static_cast(startpos), 2)); + ss << std::hex; + ss << std::uppercase; + ss >> val; + return val; + } +}; + +Color::Color(const IntType alpha, const IntType red, const IntType green, const IntType blue) + : myImpl(new Color::impl(alpha, red, green, blue)) +{ +} + +Color::Color(const IntType red, const IntType green, const IntType blue) : myImpl(new Color::impl(red, green, blue)) +{ +} + +Color::Color() : myImpl(new Color::impl()) +{ +} + +Color::Color(const std::string &value) : myImpl(new Color::impl()) +{ + myImpl->parse(value); +} + +Color::~Color() +{ +} + +Color::Color(const Color &other) : myImpl(new Color::impl(*other.myImpl)) +{ +} + +Color::Color(Color &&other) : myImpl(std::move(other.myImpl)) +{ +} + +Color &Color::operator=(const Color &other) +{ + this->myImpl = std::unique_ptr(new Color::impl(*other.myImpl)); + return *this; +} + +IntType Color::getAlpha() const +{ + return myImpl->getAlpha(); +} + +IntType Color::getRed() const +{ + return myImpl->getRed(); +} + +IntType Color::getGreen() const +{ + return myImpl->getGreen(); +} + +IntType Color::getBlue() const +{ + return myImpl->getBlue(); +} + +Color::ColorType Color::getColorType() const +{ + return myImpl->getColorType(); +} + +void Color::setAlpha(const IntType value) +{ + myImpl->setAlpha(value); +} + +void Color::setRed(const IntType value) +{ + myImpl->setRed(value); +} + +void Color::setGreen(const IntType value) +{ + myImpl->setGreen(value); +} + +void Color::setBlue(const IntType value) +{ + myImpl->setBlue(value); +} + +void Color::setColorType(const Color::ColorType value) +{ + myImpl->setColorType(value); +} + +void Color::parse(const std::string &value) +{ + myImpl->parse(value); +} + +std::string toString(const Color &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +std::ostream &toStream(std::ostream &os, const Color &value) +{ + auto flagsval = os.flags(); + auto fillval = os.fill(); + auto widthval = os.width(); + os << "#"; + + if (value.getColorType() == Color::ColorType::ARGB) + { + os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getAlpha(); } + os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getRed(); + os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getGreen(); + os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getBlue(); + os.flags(flagsval); + os.width(widthval); + os.flags(flagsval); + os.fill(fillval); + return os; +} + +std::ostream &operator<<(std::ostream &os, const Color &value) +{ + return toStream(os, value); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Color.h b/Sourcecode/private/mx/core/Color.h index b632cc0e1..ab3515f86 100644 --- a/Sourcecode/private/mx/core/Color.h +++ b/Sourcecode/private/mx/core/Color.h @@ -4,58 +4,53 @@ #pragma once -#include #include "mx/core/Integers.h" +#include #include namespace mx { - namespace core +namespace core +{ +class Color +{ + public: + enum class ColorType { - class Color - { - public: - enum class ColorType - { - RGB = 0, - ARGB = 1 - }; - explicit Color( const IntType alpha, - const IntType red, - const IntType green, - const IntType blue); - explicit Color( const IntType red, - const IntType green, - const IntType blue); - explicit Color( const std::string& value ); - Color(); - virtual ~Color(); - Color( const Color& other ); - Color( Color&& other ); - Color& operator=( const Color& other ); - - IntType getAlpha() const; - IntType getRed() const; - IntType getGreen() const; - IntType getBlue() const; - ColorType getColorType() const; - - void setAlpha( IntType value ); - void setRed( const IntType value ); - void setGreen( const IntType value ); - void setBlue( const IntType value ); - void setColorType( const ColorType value ); - - void parse( const std::string& value ); - - private: - class impl; - std::unique_ptr myImpl; - }; - - std::string toString( const Color& value ); - std::ostream& toStream( std::ostream& os, const Color& value ); - std::ostream& operator<<( std::ostream& os, const Color& value ); - - } -} + RGB = 0, + ARGB = 1 + }; + explicit Color(const IntType alpha, const IntType red, const IntType green, const IntType blue); + explicit Color(const IntType red, const IntType green, const IntType blue); + explicit Color(const std::string &value); + Color(); + virtual ~Color(); + Color(const Color &other); + Color(Color &&other); + Color &operator=(const Color &other); + + IntType getAlpha() const; + IntType getRed() const; + IntType getGreen() const; + IntType getBlue() const; + ColorType getColorType() const; + + void setAlpha(IntType value); + void setRed(const IntType value); + void setGreen(const IntType value); + void setBlue(const IntType value); + void setColorType(const ColorType value); + + void parse(const std::string &value); + + private: + class impl; + std::unique_ptr myImpl; +}; + +std::string toString(const Color &value); +std::ostream &toStream(std::ostream &os, const Color &value); +std::ostream &operator<<(std::ostream &os, const Color &value); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp b/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp index a7c62c958..d21c91a7c 100644 --- a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp +++ b/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp @@ -7,144 +7,125 @@ namespace mx { - namespace core - { - inline std::set copyPositives( const std::set& input ) - { - std::set output; - std::copy_if( input.cbegin(), input.cend(), std::inserter( output, output.begin() ), - [](const int i){ return i > 0; } ); - return output; - } +namespace core +{ +inline std::set copyPositives(const std::set &input) +{ + std::set output; + std::copy_if(input.cbegin(), input.cend(), std::inserter(output, output.begin()), + [](const int i) { return i > 0; }); + return output; +} - CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers() - :myValues() - ,myIsSpacingDesired( false ) - { +CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers() : myValues(), myIsSpacingDesired(false) +{ +} - } - - - CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers( const StringType& value ) - :myValues() - ,myIsSpacingDesired(false) - { - parse( value ); - } - - - CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers( const std::set& values ) - :myValues() - { - setValues( values ); - } - - - const std::set& CommaSeparatedListOfPositiveIntegers::getValues() const - { - return myValues; - } +CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers(const StringType &value) + : myValues(), myIsSpacingDesired(false) +{ + parse(value); +} +CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers(const std::set &values) : myValues() +{ + setValues(values); +} - std::set::iterator CommaSeparatedListOfPositiveIntegers::getValuesBegin() - { - return myValues.begin(); - } +const std::set &CommaSeparatedListOfPositiveIntegers::getValues() const +{ + return myValues; +} +std::set::iterator CommaSeparatedListOfPositiveIntegers::getValuesBegin() +{ + return myValues.begin(); +} - std::set::iterator CommaSeparatedListOfPositiveIntegers::getValuesEnd() - { - return myValues.end(); - } +std::set::iterator CommaSeparatedListOfPositiveIntegers::getValuesEnd() +{ + return myValues.end(); +} +std::set::const_iterator CommaSeparatedListOfPositiveIntegers::getValuesBeginConst() const +{ + return myValues.cbegin(); +} - std::set::const_iterator CommaSeparatedListOfPositiveIntegers::getValuesBeginConst() const - { - return myValues.cbegin(); - } +std::set::const_iterator CommaSeparatedListOfPositiveIntegers::getValuesEndConst() const +{ + return myValues.cend(); +} +void CommaSeparatedListOfPositiveIntegers::setValues(const std::set &values) +{ + myValues = copyPositives(values); +} - std::set::const_iterator CommaSeparatedListOfPositiveIntegers::getValuesEndConst() const - { - return myValues.cend(); - } - - - void CommaSeparatedListOfPositiveIntegers::setValues( const std::set& values ) - { - myValues = copyPositives( values ); - } - - - void CommaSeparatedListOfPositiveIntegers::parse( const StringType& commaSeparatedText ) +void CommaSeparatedListOfPositiveIntegers::parse(const StringType &commaSeparatedText) +{ + StringType cleaned = onlyAllow(commaSeparatedText, "", "1234567890,-"); + myValues.clear(); + std::istringstream iss(cleaned); + std::string token; + while (std::getline(iss, token, ',')) + { + if (token.length() > 0) { - StringType cleaned = onlyAllow( commaSeparatedText, "", "1234567890,-" ); - myValues.clear(); - std::istringstream iss( cleaned ); - std::string token; - while( std::getline( iss, token, ',' ) ) + std::stringstream ss(token); + int value = 1; + ss >> value; + if (value > 0) { - if ( token.length() > 0 ) - { - std::stringstream ss( token ); - int value = 1; - ss >> value; - if ( value > 0 ) - { - myValues.insert( value ); - } - } + myValues.insert(value); } } - - - void CommaSeparatedListOfPositiveIntegers::setUseSpaceBetweenItems( bool value ) - { - myIsSpacingDesired = value; - } - - - bool CommaSeparatedListOfPositiveIntegers::getUseSpaceBetweenItems() const - { - return myIsSpacingDesired; - } - + } +} - std::ostream& toStream( std::ostream& os, const CommaSeparatedListOfPositiveIntegers& value ) - { - bool isfirst = true; - for ( auto x : value.getValues() ) - { - if( isfirst ) - { - os << x; - isfirst = false; - } - else - { - os << ","; - if( value.getUseSpaceBetweenItems() ) - { - os << " "; - } - os << x; - } - } - return os; - } +void CommaSeparatedListOfPositiveIntegers::setUseSpaceBetweenItems(bool value) +{ + myIsSpacingDesired = value; +} +bool CommaSeparatedListOfPositiveIntegers::getUseSpaceBetweenItems() const +{ + return myIsSpacingDesired; +} - std::ostream& operator<<( std::ostream& os, const CommaSeparatedListOfPositiveIntegers& value ) +std::ostream &toStream(std::ostream &os, const CommaSeparatedListOfPositiveIntegers &value) +{ + bool isfirst = true; + for (auto x : value.getValues()) + { + if (isfirst) { - return toStream( os, value ); + os << x; + isfirst = false; } - - - StringType toString( const CommaSeparatedListOfPositiveIntegers& value ) + else { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); + os << ","; + if (value.getUseSpaceBetweenItems()) + { + os << " "; + } + os << x; } } + return os; +} + +std::ostream &operator<<(std::ostream &os, const CommaSeparatedListOfPositiveIntegers &value) +{ + return toStream(os, value); +} + +StringType toString(const CommaSeparatedListOfPositiveIntegers &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h b/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h index a757de090..ddb637347 100644 --- a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h +++ b/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h @@ -10,30 +10,31 @@ namespace mx { - namespace core - { - class CommaSeparatedListOfPositiveIntegers - { - public: - CommaSeparatedListOfPositiveIntegers(); - CommaSeparatedListOfPositiveIntegers( const StringType& value ); - CommaSeparatedListOfPositiveIntegers( const std::set& values ); - const std::set& getValues() const; - std::set::iterator getValuesBegin(); - std::set::iterator getValuesEnd(); - std::set::const_iterator getValuesBeginConst() const; - std::set::const_iterator getValuesEndConst() const; - void setValues( const std::set& values ); - void parse( const StringType& commaSeparatedText ); - void setUseSpaceBetweenItems( bool value ); - bool getUseSpaceBetweenItems() const; - private: - std::set myValues; - bool myIsSpacingDesired; - }; - - StringType toString( const CommaSeparatedListOfPositiveIntegers& value ); - std::ostream& toStream( std::ostream& os, const CommaSeparatedListOfPositiveIntegers& value ); - std::ostream& operator<<( std::ostream& os, const CommaSeparatedListOfPositiveIntegers& value ); - } -} +namespace core +{ +class CommaSeparatedListOfPositiveIntegers +{ + public: + CommaSeparatedListOfPositiveIntegers(); + CommaSeparatedListOfPositiveIntegers(const StringType &value); + CommaSeparatedListOfPositiveIntegers(const std::set &values); + const std::set &getValues() const; + std::set::iterator getValuesBegin(); + std::set::iterator getValuesEnd(); + std::set::const_iterator getValuesBeginConst() const; + std::set::const_iterator getValuesEndConst() const; + void setValues(const std::set &values); + void parse(const StringType &commaSeparatedText); + void setUseSpaceBetweenItems(bool value); + bool getUseSpaceBetweenItems() const; + + private: + std::set myValues; + bool myIsSpacingDesired; +}; + +StringType toString(const CommaSeparatedListOfPositiveIntegers &value); +std::ostream &toStream(std::ostream &os, const CommaSeparatedListOfPositiveIntegers &value); +std::ostream &operator<<(std::ostream &os, const CommaSeparatedListOfPositiveIntegers &value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/CommaSeparatedText.cpp b/Sourcecode/private/mx/core/CommaSeparatedText.cpp index df95e2d61..a99a7150b 100644 --- a/Sourcecode/private/mx/core/CommaSeparatedText.cpp +++ b/Sourcecode/private/mx/core/CommaSeparatedText.cpp @@ -9,115 +9,97 @@ namespace mx { - namespace core +namespace core +{ +CommaSeparatedText::CommaSeparatedText() : myValues() +{ +} + +CommaSeparatedText::CommaSeparatedText(const XsTokenSet &values) : myValues(values) +{ +} + +CommaSeparatedText::CommaSeparatedText(const StringType &value) : myValues() +{ + this->parse(value); +} + +void CommaSeparatedText::parse(const StringType &commaSeparatedText) +{ + myValues.clear(); + std::istringstream iss(commaSeparatedText); + std::string token; + + while (std::getline(iss, token, ',')) { - CommaSeparatedText::CommaSeparatedText() - :myValues() - { + myValues.push_back(XsToken(token)); + } +} - } - - - CommaSeparatedText::CommaSeparatedText( const XsTokenSet& values ) - :myValues( values ) - { +const XsTokenSet &CommaSeparatedText::getValues() const +{ + return myValues; +} - } - - - CommaSeparatedText::CommaSeparatedText( const StringType& value ) - :myValues() - { - this->parse( value ); - } - - - void CommaSeparatedText::parse( const StringType& commaSeparatedText ) - { - myValues.clear(); - std::istringstream iss( commaSeparatedText ); - std::string token; - - while( std::getline( iss, token, ',' ) ) - { - myValues.push_back( XsToken( token ) ); - } - } - - - const XsTokenSet& CommaSeparatedText::getValues() const - { - return myValues; - } - - - void CommaSeparatedText::setValues( const XsTokenSet& values ) - { - myValues = values; - } +void CommaSeparatedText::setValues(const XsTokenSet &values) +{ + myValues = values; +} + +void CommaSeparatedText::addValue(const XsToken &value) +{ + myValues.emplace_back(value); +} +XsTokenSetIter CommaSeparatedText::getValuesBegin() +{ + return myValues.begin(); +} - void CommaSeparatedText::addValue( const XsToken& value ) - { - myValues.emplace_back( value ); - } - - - XsTokenSetIter CommaSeparatedText::getValuesBegin() - { - return myValues.begin(); - } - - - XsTokenSetIter CommaSeparatedText::getValuesEnd() - { - return myValues.end(); - } - - - XsTokenSetIterConst CommaSeparatedText::getValuesBeginConst() const - { - return myValues.cbegin(); - } - - - XsTokenSetIterConst CommaSeparatedText::getValuesEndConst() const - { - return myValues.cend(); - } - - - std::ostream& toStream( std::ostream& os, const CommaSeparatedText& value ) - { - bool isfirst = true; - for ( auto x : value.getValues() ) - { - if( isfirst ) - { - toStream( os, x ); - isfirst = false; - } - else - { - os << ","; - toStream( os, x ); - } - } - return os; - } +XsTokenSetIter CommaSeparatedText::getValuesEnd() +{ + return myValues.end(); +} + +XsTokenSetIterConst CommaSeparatedText::getValuesBeginConst() const +{ + return myValues.cbegin(); +} +XsTokenSetIterConst CommaSeparatedText::getValuesEndConst() const +{ + return myValues.cend(); +} - std::ostream& operator<<( std::ostream& os, const CommaSeparatedText& value ) +std::ostream &toStream(std::ostream &os, const CommaSeparatedText &value) +{ + bool isfirst = true; + for (auto x : value.getValues()) + { + if (isfirst) { - return toStream( os, value ); + toStream(os, x); + isfirst = false; } - - - StringType toString( const CommaSeparatedText& value ) + else { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); + os << ","; + toStream(os, x); } } + return os; +} + +std::ostream &operator<<(std::ostream &os, const CommaSeparatedText &value) +{ + return toStream(os, value); +} + +StringType toString(const CommaSeparatedText &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/CommaSeparatedText.h b/Sourcecode/private/mx/core/CommaSeparatedText.h index 85379049d..39a2a408b 100644 --- a/Sourcecode/private/mx/core/CommaSeparatedText.h +++ b/Sourcecode/private/mx/core/CommaSeparatedText.h @@ -9,34 +9,33 @@ namespace mx { - namespace core - { - using XsTokenSet = std::vector; - using XsTokenSetIter = XsTokenSet::iterator; - using XsTokenSetIterConst = XsTokenSet::const_iterator; +namespace core +{ +using XsTokenSet = std::vector; +using XsTokenSetIter = XsTokenSet::iterator; +using XsTokenSetIterConst = XsTokenSet::const_iterator; + +class CommaSeparatedText +{ + public: + CommaSeparatedText(); + CommaSeparatedText(const StringType &value); + CommaSeparatedText(const XsTokenSet &values); + const XsTokenSet &getValues() const; + XsTokenSetIter getValuesBegin(); + XsTokenSetIter getValuesEnd(); + XsTokenSetIterConst getValuesBeginConst() const; + XsTokenSetIterConst getValuesEndConst() const; + void addValue(const XsToken &value); + void setValues(const XsTokenSet &values); + void parse(const StringType &commaSeparatedText); - class CommaSeparatedText - { - public: - CommaSeparatedText(); - CommaSeparatedText( const StringType& value ); - CommaSeparatedText( const XsTokenSet& values ); - const XsTokenSet& getValues() const; - XsTokenSetIter getValuesBegin(); - XsTokenSetIter getValuesEnd(); - XsTokenSetIterConst getValuesBeginConst() const; - XsTokenSetIterConst getValuesEndConst() const; - void addValue( const XsToken& value ); - void setValues( const XsTokenSet& values ); - void parse( const StringType& commaSeparatedText ); - - private: - XsTokenSet myValues; - - }; + private: + XsTokenSet myValues; +}; - StringType toString( const CommaSeparatedText& value ); - std::ostream& toStream( std::ostream& os, const CommaSeparatedText& value ); - std::ostream& operator<<( std::ostream& os, const CommaSeparatedText& value ); - } -} +StringType toString(const CommaSeparatedText &value); +std::ostream &toStream(std::ostream &os, const CommaSeparatedText &value); +std::ostream &operator<<(std::ostream &os, const CommaSeparatedText &value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Date.cpp b/Sourcecode/private/mx/core/Date.cpp index 2f7b27073..5d795e2b4 100644 --- a/Sourcecode/private/mx/core/Date.cpp +++ b/Sourcecode/private/mx/core/Date.cpp @@ -3,820 +3,799 @@ // Distributed under the MIT License #include "mx/core/Date.h" -#include #include +#include namespace { - std::ostream& zeroPad( int value, int width, std::ostream& os ) - { - char prev_fillch = os.fill ('0'); - std::streamsize prev_width = os.width( width ); - os << value; - os.fill( prev_fillch ); - os.width( prev_width ); - return os; - } +std::ostream &zeroPad(int value, int width, std::ostream &os) +{ + char prev_fillch = os.fill('0'); + std::streamsize prev_width = os.width(width); + os << value; + os.fill(prev_fillch); + os.width(prev_width); + return os; } +} // namespace namespace mx { - namespace core +namespace core +{ +class Date::impl +{ + public: + impl(int year_in, int month_in, int day_in) : myYear(1900), myMonth(1), myDay(1) { - class Date::impl - { - public: - impl( int year_in, int month_in, int day_in ) - :myYear( 1900 ) - ,myMonth( 1 ) - ,myDay( 1 ) - { - setYear( year_in ); - setMonth( month_in ); - setDay( day_in ); - } - - impl() - :myYear( 1900 ) - ,myMonth( 1 ) - ,myDay( 1 ) - {} - - impl( const std::string& yyyy_mm_dd ) - :myYear( 1900 ) - ,myMonth( 1 ) - ,myDay( 1 ) - { parseString( yyyy_mm_dd ); } - - ~impl() {} - - public: - void setYear( int value ) - { - myYear = constrainToRange( value, 1, 9999 ); - setDay( getDay() ); - } - - - void setMonth( int value ) - { - myMonth = constrainToRange( value, 1, 12 ); - setDay( getDay() ); - } - - - void setDay( int value ) - { - myDay = constrainToRange( value, 1, daysInMonth( getMonth(), getYear() ) ); - } - - - bool setValue( int year_in, int month_in, int day_in ) - { - if ( isDateValid( year_in, month_in, day_in ) ) - { - setYear( year_in ); - setMonth( month_in ); - setDay( day_in ); - return true; - } - return false; - } - - - bool isLeapYear( int year_in ) const - { - /* per Wikipedia - - Pseudocode to determine whether a year is a leap year - or not in either the Gregorian calendar since 1582 or - in the proleptic Gregorian calendar between 1 and 1582: - - if year is divisible by 400 then - is_leap_year - else if year is divisible by 100 then - not_leap_year - else if year is divisible by 4 then - is_leap_year - else - not_leap_year - - */ - if( year_in < 1 || year_in > 9999 ) // error, unacceptable year - return false; - else if ( year_in % 400 == 0 ) // is leapyear per wikipedia - return true; - else if ( year_in % 100 == 0 ) // is NOT a leapyear per wikipedia - return false; - else if ( year_in % 4 == 0 ) // is leapyear per wikipedia - return true; - else - return false; // is not leapyear per wikipedia - } - - - bool parse( const std::string value_in ) - { - return parseString( value_in ); - } - - - bool parseString( const std::string& value_in ) - { - if ( isStringFormatValid( value_in ) ) - { - int year = -1; - int month = -1; - int day = -1; - if ( parseStringYear( value_in, year ) - && parseStringMonth( value_in, month ) - && parseStringDay( value_in, day ) ) - { - if ( day <= daysInMonth( month, year ) ) - { - setValue( year, month, day ); - return true; - } - } - } - return false; - } // parseString - - - bool parseStringYear( const std::string& value_in, int& year_out ) - { - year_out = -1; - std::stringstream( value_in.substr( 0, 4 ) ) >> year_out; - bool success = false; - if ( year_out >= 1 && year_out <= 9999 ) - { - success = true; - } - return success; - } //parseStringYear + setYear(year_in); + setMonth(month_in); + setDay(day_in); + } + impl() : myYear(1900), myMonth(1), myDay(1) + { + } - bool parseStringMonth( const std::string& value_in, int& month_out ) - { - month_out = -1; - std::stringstream( value_in.substr( 5, 2 ) ) >> month_out; - bool success = false; - if ( month_out >= 1 && month_out <= 12 ) - { - success = true; - } - return success; - } //parseStringMonth + impl(const std::string &yyyy_mm_dd) : myYear(1900), myMonth(1), myDay(1) + { + parseString(yyyy_mm_dd); + } + ~impl() + { + } - bool parseStringDay( const std::string& value_in, int& day_out ) - { - day_out = -1; - std::stringstream( value_in.substr( 8, 2 ) ) >> day_out; - bool success = false; - if ( day_out >= 1 && day_out <= 31 ) - { - success = true; - } - return success; - } //parseStringDay + public: + void setYear(int value) + { + myYear = constrainToRange(value, 1, 9999); + setDay(getDay()); + } + void setMonth(int value) + { + myMonth = constrainToRange(value, 1, 12); + setDay(getDay()); + } - bool isStringFormatValid( const std::string& value_in ) const - { - int length = (int)value_in.size(); - if ( length != 10 ) - { - return false; - } - else - { - for ( size_t i = 0; i < static_cast( length ); ++i ) - { - if ( ( i <= 3 ) && ! isdigit( value_in[i] ) ) - { - return false; - } - else if ( ( i >= 5 && i <= 6 ) && ! isdigit( value_in[i] ) ) - { - return false; - } - else if ( ( i >= 8 && i <= 9 ) && ! isdigit( value_in[i] ) ) - { - return false; - } - else if ( ( i == 4 || i == 7 ) && ! ( value_in[i] == '-' ) ) - { - return false; - } - } - } - return true; - } + void setDay(int value) + { + myDay = constrainToRange(value, 1, daysInMonth(getMonth(), getYear())); + } + bool setValue(int year_in, int month_in, int day_in) + { + if (isDateValid(year_in, month_in, day_in)) + { + setYear(year_in); + setMonth(month_in); + setDay(day_in); + return true; + } + return false; + } - int daysInMonth( int month_in, int year_in ) const - { - if ( isLeapYear( year_in ) ) - { - return MONTHDAYS[1][constrainToRange( month_in, 1, 12 )]; - } - else - { - return MONTHDAYS[0][constrainToRange( month_in, 1, 12 )]; - } - } + bool isLeapYear(int year_in) const + { + /* per Wikipedia + + Pseudocode to determine whether a year is a leap year + or not in either the Gregorian calendar since 1582 or + in the proleptic Gregorian calendar between 1 and 1582: + + if year is divisible by 400 then + is_leap_year + else if year is divisible by 100 then + not_leap_year + else if year is divisible by 4 then + is_leap_year + else + not_leap_year + + */ + if (year_in < 1 || year_in > 9999) // error, unacceptable year + return false; + else if (year_in % 400 == 0) // is leapyear per wikipedia + return true; + else if (year_in % 100 == 0) // is NOT a leapyear per wikipedia + return false; + else if (year_in % 4 == 0) // is leapyear per wikipedia + return true; + else + return false; // is not leapyear per wikipedia + } + bool parse(const std::string value_in) + { + return parseString(value_in); + } - int constrainToRange( int value_in, int minimumValue, int maximumValue ) const + bool parseString(const std::string &value_in) + { + if (isStringFormatValid(value_in)) + { + int year = -1; + int month = -1; + int day = -1; + if (parseStringYear(value_in, year) && parseStringMonth(value_in, month) && parseStringDay(value_in, day)) { - if ( value_in < minimumValue ) + if (day <= daysInMonth(month, year)) { - return minimumValue; - } - if ( value_in > maximumValue ) - { - return maximumValue; + setValue(year, month, day); + return true; } - return value_in; - } - - - int getYear() const - { - return myYear; - } - - - int getDay() const - { - return myDay; - - } - - - int getMonth() const - { - return myMonth; } + } + return false; + } // parseString + bool parseStringYear(const std::string &value_in, int &year_out) + { + year_out = -1; + std::stringstream(value_in.substr(0, 4)) >> year_out; + bool success = false; + if (year_out >= 1 && year_out <= 9999) + { + success = true; + } + return success; + } // parseStringYear - int getWeekday() const - { - // returns sequential day of the week 1 for Sunday, 2 for Monday ... 7 for Saturday - // this implements Zeller's Congruence - // algorithm: http://en.wikipedia.org/wiki/Zeller%27s_congruence - // implementation: http://ideone.com/CkDGvY - int h,q,m,k,j,day,month,year; - day = getDay(); - month = getMonth(); - year = getYear(); - if(month==1) - { - month = 13; - year--; - } - if(month==2) - { - month = 14; - year--; - } - q = day; - m = month; - k = year % 100; - j = year / 100; - h = q + 13*(m+1)/5 + k + k/4 + j/4 + 5*j; - h = h % 7; - - // Zeller's Congruence returns 0 for Saturday - // Convert this to 7 so that... - // 1 = Sunday - // 2 = Monday - // 3 = Tuesday - // 4 = Wednesday - // 5 = Thursday - // 6 = Friday - // 7 = Saturday - if (h==0) - { - h=7; - } - return h; - } + bool parseStringMonth(const std::string &value_in, int &month_out) + { + month_out = -1; + std::stringstream(value_in.substr(5, 2)) >> month_out; + bool success = false; + if (month_out >= 1 && month_out <= 12) + { + success = true; + } + return success; + } // parseStringMonth + bool parseStringDay(const std::string &value_in, int &day_out) + { + day_out = -1; + std::stringstream(value_in.substr(8, 2)) >> day_out; + bool success = false; + if (day_out >= 1 && day_out <= 31) + { + success = true; + } + return success; + } // parseStringDay - bool isDateValid( int year_in, int month_in, int day_in ) const + bool isStringFormatValid(const std::string &value_in) const + { + int length = (int)value_in.size(); + if (length != 10) + { + return false; + } + else + { + for (size_t i = 0; i < static_cast(length); ++i) { - if ( year_in < 1 ) - { - return false; - } - else if ( year_in > 9999 ) + if ((i <= 3) && !isdigit(value_in[i])) { return false; } - else if ( month_in < 1 ) + else if ((i >= 5 && i <= 6) && !isdigit(value_in[i])) { return false; } - else if ( month_in > 12 ) + else if ((i >= 8 && i <= 9) && !isdigit(value_in[i])) { return false; } - else if ( day_in < 1 ) + else if ((i == 4 || i == 7) && !(value_in[i] == '-')) { return false; } - else if ( day_in > daysInMonth( month_in, year_in ) ) - { - return false; - } - else - { - return true; - } - } - - - bool equal( const Date& other_in ) const - { - return compare( other_in ) == 0; } + } + return true; + } + int daysInMonth(int month_in, int year_in) const + { + if (isLeapYear(year_in)) + { + return MONTHDAYS[1][constrainToRange(month_in, 1, 12)]; + } + else + { + return MONTHDAYS[0][constrainToRange(month_in, 1, 12)]; + } + } - bool notEqual( const Date& other_in ) const - { - return compare( other_in ) != 0; - } + int constrainToRange(int value_in, int minimumValue, int maximumValue) const + { + if (value_in < minimumValue) + { + return minimumValue; + } + if (value_in > maximumValue) + { + return maximumValue; + } + return value_in; + } + int getYear() const + { + return myYear; + } - bool greaterThan( const Date& other_in ) const - { - int temp = 999; - temp = compare( other_in ); - return temp > 0; - } + int getDay() const + { + return myDay; + } + int getMonth() const + { + return myMonth; + } - bool greaterThanOrEqual( const Date& other_in ) const - { - return compare( other_in ) >= 0; - } + int getWeekday() const + { + // returns sequential day of the week 1 for Sunday, 2 for Monday ... 7 for Saturday + // this implements Zeller's Congruence + // algorithm: http://en.wikipedia.org/wiki/Zeller%27s_congruence + // implementation: http://ideone.com/CkDGvY + int h, q, m, k, j, day, month, year; + day = getDay(); + month = getMonth(); + year = getYear(); + if (month == 1) + { + month = 13; + year--; + } + if (month == 2) + { + month = 14; + year--; + } + q = day; + m = month; + k = year % 100; + j = year / 100; + h = q + 13 * (m + 1) / 5 + k + k / 4 + j / 4 + 5 * j; + h = h % 7; + + // Zeller's Congruence returns 0 for Saturday + // Convert this to 7 so that... + // 1 = Sunday + // 2 = Monday + // 3 = Tuesday + // 4 = Wednesday + // 5 = Thursday + // 6 = Friday + // 7 = Saturday + if (h == 0) + { + h = 7; + } + return h; + } + bool isDateValid(int year_in, int month_in, int day_in) const + { + if (year_in < 1) + { + return false; + } + else if (year_in > 9999) + { + return false; + } + else if (month_in < 1) + { + return false; + } + else if (month_in > 12) + { + return false; + } + else if (day_in < 1) + { + return false; + } + else if (day_in > daysInMonth(month_in, year_in)) + { + return false; + } + else + { + return true; + } + } - bool lessThan( const Date& other_in ) const - { - return compare( other_in ) < 0; - } + bool equal(const Date &other_in) const + { + return compare(other_in) == 0; + } + bool notEqual(const Date &other_in) const + { + return compare(other_in) != 0; + } - bool lessThanOrEqual( const Date& other_in ) const - { - return compare( other_in ) <= 0; - } + bool greaterThan(const Date &other_in) const + { + int temp = 999; + temp = compare(other_in); + return temp > 0; + } + bool greaterThanOrEqual(const Date &other_in) const + { + return compare(other_in) >= 0; + } - void addDays( int days ) - { - if (days == 0) - { - return; - } - else if ( days > 0 ) - { - for ( int i = 0; i < days; i++) - { - if ( equal( Date( 9999, 12, 31 ) ) ) - { - return; - } - else if ( getMonth() == 12 && getDay() == 31 ) - { - setYear( getYear() + 1 ); - setMonth( 1 ); - setDay( 1 ); - } - else if ( getDay() == daysInMonth( getMonth(), getYear() ) ) - { - setMonth( getMonth() + 1 ); - setDay( 1 ); - } - else - { - setDay( getDay() + 1 ); - } - } - } - else if ( days < 0 ) - { - for ( int i = 0; i > days; i-- ) - { - if ( equal( Date( 1, 1, 1 ) ) ) - { - return; - } - else if ( getMonth() == 1 && getDay() == 1 ) - { - setYear( getYear() - 1 ); - setMonth( 12 ); - setDay( 31 ); - } - else if ( getDay() == 1 ) - { - setMonth( getMonth() - 1 ); - setDay( daysInMonth( getMonth(), getYear() ) ); - } - else - { - setDay( getDay() - 1 ); - } - } - } - } + bool lessThan(const Date &other_in) const + { + return compare(other_in) < 0; + } + bool lessThanOrEqual(const Date &other_in) const + { + return compare(other_in) <= 0; + } - void addMonths( int months ) + void addDays(int days) + { + if (days == 0) + { + return; + } + else if (days > 0) + { + for (int i = 0; i < days; i++) { - - // modulus math is hard to understand when negative numbers are involved - // store the sign of 'months' as an int and make months positive - int direction = 1; - if (months < 0) - { - direction = -1; - months *= -1; - } - - // remember what day value we had to start with - int day_was = getDay(); - - // figure out how many years to add - // note: int/int truncates - int new_year = getYear() + ( direction * ( months / 12 ) ); - // if the year goes out of bounds, return min/max date - - // figure out how many months to add - int new_month = getMonth() + ( direction * ( months % 12 ) ); - - // if new_month equals 0 then direction must be -1 - // the actual month should be December of the previous year. - if ( new_month == 0 ) - { - --new_year; - setMonth( 12 ); - } - // if new_month < 0 then direction must be -1 - // and, we know we didn't subtract more than -11 - // so we can figure out the correct month by - // adding 12 and moving to the previous year - else if ( new_month < 0 ) - { - --new_year; - setMonth( new_month + 12); - } - // if new_month > 12, we know we did not add more than 11 - // so we can add a year and take the mod of new_month; - else if ( new_month > 12 ) - { - ++new_year; - setMonth( new_month % 12 ); - } - else + if (equal(Date(9999, 12, 31))) { - setMonth( new_month ); - } - - // does the day fit within the month? - int daysover = day_was - daysInMonth( getMonth(), new_year ); - - // If the day is out of bounds we need to correct it. - // This implements the rules followed by Microsoft Excel 2010 - // and also by Google Docs (as of 2013) and Sql Server 2012 - // if the target date has a day value to high for the target - // month, then adjust the day value to the maximum day value - // available in the target month - if ( daysover > 0 ) - { - // jump to the last day of the month - setYear( new_year ); - setDay( daysInMonth( getMonth(), getYear() ) ); - } - else - { - setYear( new_year ); - setDay( day_was ); // restore the correct day value + return; } - - // check for out-of-bounds year value - if ( new_year < 1 ) + else if (getMonth() == 12 && getDay() == 31) { - setYear( 1 ); - setMonth( 1 ); - setDay( 1 ); + setYear(getYear() + 1); + setMonth(1); + setDay(1); } - else if ( new_year > 9999 ) + else if (getDay() == daysInMonth(getMonth(), getYear())) { - setYear( 9999 ); - setMonth( 12 ); - setDay( 31 ); + setMonth(getMonth() + 1); + setDay(1); } else { - setYear( new_year ); + setDay(getDay() + 1); } } - - - void addYears( int years ) - { - int new_year = getYear() + years; - //year( ( year() + years ) ); - - // if day was a leap day and the new year is not a leap year - // month/day need to be moved to March 1 instead of Feb 29 - if ( getMonth() == 2 && getDay() == 29 && !isLeapYear( new_year ) ) - { - setDay( 1 ); - setMonth( 3 ); - } - setYear( new_year ); - } - - private: - int myYear; - int myMonth; - int myDay; - - void setInitialValue( int year_in, int month_in, int day_in ) + } + else if (days < 0) + { + for (int i = 0; i > days; i--) { - if ( isDateValid( year_in, month_in, day_in ) ) + if (equal(Date(1, 1, 1))) { - setValue( year_in, month_in, day_in ); - } - else - { - setValue( 1900, 1, 1 ); + return; } - } - - - int compare( const Date& other ) const - { - if ( this->getYear() > other.getYear() ) + else if (getMonth() == 1 && getDay() == 1) { - return 1; + setYear(getYear() - 1); + setMonth(12); + setDay(31); } - else if ( this->getYear() < other.getYear() ) + else if (getDay() == 1) { - return -1; + setMonth(getMonth() - 1); + setDay(daysInMonth(getMonth(), getYear())); } else { - if ( this->getMonth() > other.getMonth() ) - { - return 1; - } - else if ( this->getMonth() < other.getMonth() ) - { - return -1; - } - else - { - if ( this->getDay() > other.getDay() ) - { - return 1; - } - else if ( this->getDay() < other.getDay() ) - { - return -1; - } - } + setDay(getDay() - 1); } - return 0; } - - public: - const static std::string myXmlTypeName; - const static std::string myClassName; - const static std::string myDocumentation; - const static int myXsdID; - const static int MONTHDAYS [2][13]; - - - }; // struct Date::impl - - - const int Date::impl::MONTHDAYS [2][13] = - { - {0,31,28,31,30,31,30,31,31,30,31,30,31} // 0 = Not a leap year - , - {0,31,29,31,30,31,30,31,31,30,31,30,31} // 1 = Leap year - }; - - /* Date ---------------------------------------------------------------- */ - - /* Constructor, Destructor, Copy, Assignment ------------------------------------------ */ - - Date::Date( int year_in, int month_in, int day_in ) - :myImpl( new impl( year_in, month_in, day_in ) ) - {} - - Date::Date() - :myImpl( new impl() ) - {} - - Date::Date( const std::string& yyyy_mm_dd ) - :myImpl( new impl( yyyy_mm_dd ) ) - {} - - Date::~Date() {} - - Date::Date( const Date& other ) - :myImpl( new impl( other.myImpl->getYear(), - other.myImpl->getMonth(), - other.myImpl->getDay() ) ) - {} - - - Date::Date( Date&& other ) - :myImpl( std::move( other.myImpl ) ) - {} - - Date& Date::operator=( const Date& other ) - { - this->myImpl = std::unique_ptr( new impl( other.myImpl->getYear(), - other.myImpl->getMonth(), - other.myImpl->getDay() ) ); - return *this; - } - Date& Date::operator=( Date&& other ) - { - myImpl = std::move( other.myImpl ); - return *this; } + } - Date Date::today() - { - std::time_t t = std::time( 0 ); - struct tm* now = std::localtime( &t ); - const int y = static_cast( now->tm_year + 1900 ); - const int m = static_cast( now->tm_mon + 1 ); - const int d = static_cast( now->tm_mday ); - return Date{ y, m, d }; - } + void addMonths(int months) + { - /* Getters ---------------------------------------------------------------------------- */ - - /** Returns the year as an int. **/ - int Date::getYear() const - { - return myImpl->getYear(); - } - - /** Returns the month as an int. **/ - int Date::getMonth() const - { - return myImpl->getMonth(); - } - - /** Returns the day as an int. **/ - int Date::getDay() const - { - return myImpl->getDay(); - } - - /** Returns true if the contained year is a leap year **/ - bool Date::isLeapYear() const - { - return myImpl->isLeapYear( getYear() ); - } - - /** Returns true if the passed year is a leap year **/ - bool Date::isLeapYear( int year_in ) const - { - return myImpl->isLeapYear( year_in ); - } - - /** Returns the number of days in the current month **/ - int Date::daysInMonth() const + // modulus math is hard to understand when negative numbers are involved + // store the sign of 'months' as an int and make months positive + int direction = 1; + if (months < 0) { - return myImpl->daysInMonth( getMonth(), getYear() ); + direction = -1; + months *= -1; } - - /** Returns the number of days in the passed month/year **/ - int Date::daysIntMonth( int month_in, int year_in ) const - { - return myImpl->daysInMonth( month_in, year_in ); - } - int Date::getWeekday() const - { - return myImpl->getWeekday(); - } - bool Date::setValue( int year_in, int month_in, int day_in ) - { - return myImpl->setValue( year_in, month_in, day_in ); - } - void Date::setYear( int year_in ) - { - myImpl->setYear( year_in ); - } - void Date::setMonth( int month_in ) - { - myImpl->setMonth( month_in ); - } - void Date::setDay( int day_in ) + + // remember what day value we had to start with + int day_was = getDay(); + + // figure out how many years to add + // note: int/int truncates + int new_year = getYear() + (direction * (months / 12)); + // if the year goes out of bounds, return min/max date + + // figure out how many months to add + int new_month = getMonth() + (direction * (months % 12)); + + // if new_month equals 0 then direction must be -1 + // the actual month should be December of the previous year. + if (new_month == 0) { - myImpl->setDay( day_in ); + --new_year; + setMonth(12); } - bool Date::parse( const std::string& value_in ) + // if new_month < 0 then direction must be -1 + // and, we know we didn't subtract more than -11 + // so we can figure out the correct month by + // adding 12 and moving to the previous year + else if (new_month < 0) { - return myImpl->parse( value_in ); + --new_year; + setMonth(new_month + 12); } - bool Date::operator==( const Date& other_in ) const + // if new_month > 12, we know we did not add more than 11 + // so we can add a year and take the mod of new_month; + else if (new_month > 12) { - return myImpl->equal( other_in ); + ++new_year; + setMonth(new_month % 12); } - bool Date::operator!=( const Date& other_in ) const + else { - return myImpl->notEqual( other_in ); + setMonth(new_month); } - bool Date::operator>( const Date& other_in ) const + + // does the day fit within the month? + int daysover = day_was - daysInMonth(getMonth(), new_year); + + // If the day is out of bounds we need to correct it. + // This implements the rules followed by Microsoft Excel 2010 + // and also by Google Docs (as of 2013) and Sql Server 2012 + // if the target date has a day value to high for the target + // month, then adjust the day value to the maximum day value + // available in the target month + if (daysover > 0) { - return myImpl->greaterThan( other_in ); + // jump to the last day of the month + setYear(new_year); + setDay(daysInMonth(getMonth(), getYear())); } - bool Date::operator<( const Date& other_in ) const + else { - return myImpl->lessThan( other_in ); + setYear(new_year); + setDay(day_was); // restore the correct day value } - bool Date::operator>=( const Date& other_in ) const + + // check for out-of-bounds year value + if (new_year < 1) { - return myImpl->greaterThanOrEqual( other_in ); + setYear(1); + setMonth(1); + setDay(1); } - bool Date::operator<=( const Date& other_in ) const + else if (new_year > 9999) { - return myImpl->lessThanOrEqual( other_in ); + setYear(9999); + setMonth(12); + setDay(31); } - Date& Date::operator++() + else { - myImpl->addDays( 1 ); - return *this; + setYear(new_year); } - Date Date::operator++( int ) + } + + void addYears(int years) + { + int new_year = getYear() + years; + // year( ( year() + years ) ); + + // if day was a leap day and the new year is not a leap year + // month/day need to be moved to March 1 instead of Feb 29 + if (getMonth() == 2 && getDay() == 29 && !isLeapYear(new_year)) { - Date temp( *this ); - myImpl->addDays( 1 ); - return temp; + setDay(1); + setMonth(3); } - Date& Date::operator--() + setYear(new_year); + } + + private: + int myYear; + int myMonth; + int myDay; + + void setInitialValue(int year_in, int month_in, int day_in) + { + if (isDateValid(year_in, month_in, day_in)) { - myImpl->addDays( -1 ); - return *this; + setValue(year_in, month_in, day_in); } - Date Date::operator--( int ) + else { - Date temp( *this ); - myImpl->addDays( -1 ); - return temp; + setValue(1900, 1, 1); } - Date& Date::addDays( int days_in ) + } + + int compare(const Date &other) const + { + if (this->getYear() > other.getYear()) { - myImpl->addDays( days_in ); - return *this; + return 1; } - Date& Date::addMonths( int months_in ) + else if (this->getYear() < other.getYear()) { - myImpl->addMonths( months_in ); - return *this; + return -1; } - Date& Date::addYears( int years_in ) + else { - myImpl->addYears( years_in ); - return *this; + if (this->getMonth() > other.getMonth()) + { + return 1; + } + else if (this->getMonth() < other.getMonth()) + { + return -1; + } + else + { + if (this->getDay() > other.getDay()) + { + return 1; + } + else if (this->getDay() < other.getDay()) + { + return -1; + } + } } + return 0; + } + public: + const static std::string myXmlTypeName; + const static std::string myClassName; + const static std::string myDocumentation; + const static int myXsdID; + const static int MONTHDAYS[2][13]; - std::string toString( const Date& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } +}; // struct Date::impl +const int Date::impl::MONTHDAYS[2][13] = { + {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} // 0 = Not a leap year + , + {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} // 1 = Leap year +}; - std::ostream& toStream( std::ostream& os, const Date& value ) - { - zeroPad( value.getYear(), 4, os ); - os << "-"; - zeroPad( value.getMonth(), 2, os ); - os << "-"; - zeroPad( value.getDay(), 2, os ); - return os; - } +/* Date ---------------------------------------------------------------- */ +/* Constructor, Destructor, Copy, Assignment ------------------------------------------ */ - std::ostream& operator<<( std::ostream& os, const Date& value ) - { - return toStream( os, value ); - } - } +Date::Date(int year_in, int month_in, int day_in) : myImpl(new impl(year_in, month_in, day_in)) +{ +} + +Date::Date() : myImpl(new impl()) +{ +} + +Date::Date(const std::string &yyyy_mm_dd) : myImpl(new impl(yyyy_mm_dd)) +{ +} + +Date::~Date() +{ +} + +Date::Date(const Date &other) + : myImpl(new impl(other.myImpl->getYear(), other.myImpl->getMonth(), other.myImpl->getDay())) +{ +} + +Date::Date(Date &&other) : myImpl(std::move(other.myImpl)) +{ +} + +Date &Date::operator=(const Date &other) +{ + this->myImpl = + std::unique_ptr(new impl(other.myImpl->getYear(), other.myImpl->getMonth(), other.myImpl->getDay())); + return *this; +} + +Date &Date::operator=(Date &&other) +{ + myImpl = std::move(other.myImpl); + return *this; +} + +Date Date::today() +{ + std::time_t t = std::time(0); + struct tm *now = std::localtime(&t); + const int y = static_cast(now->tm_year + 1900); + const int m = static_cast(now->tm_mon + 1); + const int d = static_cast(now->tm_mday); + return Date{y, m, d}; +} + +/* Getters ---------------------------------------------------------------------------- */ + +/** Returns the year as an int. **/ +int Date::getYear() const +{ + return myImpl->getYear(); +} + +/** Returns the month as an int. **/ +int Date::getMonth() const +{ + return myImpl->getMonth(); +} + +/** Returns the day as an int. **/ +int Date::getDay() const +{ + return myImpl->getDay(); +} + +/** Returns true if the contained year is a leap year **/ +bool Date::isLeapYear() const +{ + return myImpl->isLeapYear(getYear()); +} + +/** Returns true if the passed year is a leap year **/ +bool Date::isLeapYear(int year_in) const +{ + return myImpl->isLeapYear(year_in); +} + +/** Returns the number of days in the current month **/ +int Date::daysInMonth() const +{ + return myImpl->daysInMonth(getMonth(), getYear()); +} + +/** Returns the number of days in the passed month/year **/ +int Date::daysIntMonth(int month_in, int year_in) const +{ + return myImpl->daysInMonth(month_in, year_in); +} + +int Date::getWeekday() const +{ + return myImpl->getWeekday(); +} + +bool Date::setValue(int year_in, int month_in, int day_in) +{ + return myImpl->setValue(year_in, month_in, day_in); +} + +void Date::setYear(int year_in) +{ + myImpl->setYear(year_in); +} + +void Date::setMonth(int month_in) +{ + myImpl->setMonth(month_in); +} + +void Date::setDay(int day_in) +{ + myImpl->setDay(day_in); +} + +bool Date::parse(const std::string &value_in) +{ + return myImpl->parse(value_in); +} + +bool Date::operator==(const Date &other_in) const +{ + return myImpl->equal(other_in); +} + +bool Date::operator!=(const Date &other_in) const +{ + return myImpl->notEqual(other_in); +} + +bool Date::operator>(const Date &other_in) const +{ + return myImpl->greaterThan(other_in); +} + +bool Date::operator<(const Date &other_in) const +{ + return myImpl->lessThan(other_in); +} + +bool Date::operator>=(const Date &other_in) const +{ + return myImpl->greaterThanOrEqual(other_in); +} + +bool Date::operator<=(const Date &other_in) const +{ + return myImpl->lessThanOrEqual(other_in); +} + +Date &Date::operator++() +{ + myImpl->addDays(1); + return *this; +} + +Date Date::operator++(int) +{ + Date temp(*this); + myImpl->addDays(1); + return temp; +} + +Date &Date::operator--() +{ + myImpl->addDays(-1); + return *this; +} + +Date Date::operator--(int) +{ + Date temp(*this); + myImpl->addDays(-1); + return temp; +} + +Date &Date::addDays(int days_in) +{ + myImpl->addDays(days_in); + return *this; +} + +Date &Date::addMonths(int months_in) +{ + myImpl->addMonths(months_in); + return *this; +} + +Date &Date::addYears(int years_in) +{ + myImpl->addYears(years_in); + return *this; +} + +std::string toString(const Date &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +std::ostream &toStream(std::ostream &os, const Date &value) +{ + zeroPad(value.getYear(), 4, os); + os << "-"; + zeroPad(value.getMonth(), 2, os); + os << "-"; + zeroPad(value.getDay(), 2, os); + return os; +} + +std::ostream &operator<<(std::ostream &os, const Date &value) +{ + return toStream(os, value); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Date.h b/Sourcecode/private/mx/core/Date.h index 2f44af252..acfcc98e7 100644 --- a/Sourcecode/private/mx/core/Date.h +++ b/Sourcecode/private/mx/core/Date.h @@ -9,80 +9,77 @@ namespace mx { - namespace core - { - class Date - { - public: - Date( int year_in, int month_in, int day_in ); - Date(); // defaults to 1900-01-01 - Date( const std::string& yyyy_mm_dd ); // e.g. "2014-07-01" - virtual ~Date(); - Date( const Date& other ); - Date( Date&& other ); - Date& operator=( const Date& other ); - Date& operator=( Date&& other ); - - static Date today(); - - /** Returns the year as an int. **/ - int getYear() const; - - /** Returns the month as an int. **/ - int getMonth() const; - - /** Returns the day as an int. **/ - int getDay() const; - - /** Returns true if the contained year is a leap year **/ - bool isLeapYear() const; - - /** Returns true if the passed year is a leap year **/ - bool isLeapYear( int year_in ) const; - - /** Returns the number of days in the current month **/ - int daysInMonth() const; - - /** Returns the number of days in the given month/year **/ - int daysIntMonth( int month_in, int year_in ) const; - - /* gets the day of the week where 1 = Sunday, 2 = Monday, - 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, - 7 = Saturday */ - int getWeekday() const; - - bool setValue( int year_in, int month_in, int day_in ); - void setYear( int year_in ); - void setMonth( int month_in ); - void setDay( int day_in ); - bool parse( const std::string& value_in ); - - - bool operator==( const Date& other_in ) const; - bool operator!=( const Date& other_in ) const; - bool operator>( const Date& other_in ) const; - bool operator<( const Date& other_in ) const; - bool operator>=( const Date& other_in ) const; - bool operator<=( const Date& other_in ) const; - - - Date& operator++(); - Date operator++( int ); - Date& operator--(); - Date operator--( int ); - - Date& addDays( int days_in ); - Date& addMonths( int months_in ); - Date& addYears( int years_in ); - - private: - class impl; - std::unique_ptr myImpl; - - }; - - std::string toString( const Date& value ); - std::ostream& toStream( std::ostream& os, const Date& value ); - std::ostream& operator<<( std::ostream& os, const Date& value ); - } -} +namespace core +{ +class Date +{ + public: + Date(int year_in, int month_in, int day_in); + Date(); // defaults to 1900-01-01 + Date(const std::string &yyyy_mm_dd); // e.g. "2014-07-01" + virtual ~Date(); + Date(const Date &other); + Date(Date &&other); + Date &operator=(const Date &other); + Date &operator=(Date &&other); + + static Date today(); + + /** Returns the year as an int. **/ + int getYear() const; + + /** Returns the month as an int. **/ + int getMonth() const; + + /** Returns the day as an int. **/ + int getDay() const; + + /** Returns true if the contained year is a leap year **/ + bool isLeapYear() const; + + /** Returns true if the passed year is a leap year **/ + bool isLeapYear(int year_in) const; + + /** Returns the number of days in the current month **/ + int daysInMonth() const; + + /** Returns the number of days in the given month/year **/ + int daysIntMonth(int month_in, int year_in) const; + + /* gets the day of the week where 1 = Sunday, 2 = Monday, + 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, + 7 = Saturday */ + int getWeekday() const; + + bool setValue(int year_in, int month_in, int day_in); + void setYear(int year_in); + void setMonth(int month_in); + void setDay(int day_in); + bool parse(const std::string &value_in); + + bool operator==(const Date &other_in) const; + bool operator!=(const Date &other_in) const; + bool operator>(const Date &other_in) const; + bool operator<(const Date &other_in) const; + bool operator>=(const Date &other_in) const; + bool operator<=(const Date &other_in) const; + + Date &operator++(); + Date operator++(int); + Date &operator--(); + Date operator--(int); + + Date &addDays(int days_in); + Date &addMonths(int months_in); + Date &addYears(int years_in); + + private: + class impl; + std::unique_ptr myImpl; +}; + +std::string toString(const Date &value); +std::ostream &toStream(std::ostream &os, const Date &value); +std::ostream &operator<<(std::ostream &os, const Date &value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Decimals.cpp b/Sourcecode/private/mx/core/Decimals.cpp index eb11eb81d..fae92571c 100644 --- a/Sourcecode/private/mx/core/Decimals.cpp +++ b/Sourcecode/private/mx/core/Decimals.cpp @@ -14,538 +14,475 @@ namespace mx { - namespace core - { - PreciseDecimal::PreciseDecimal( short inMaxIntegerDigits, short inMaxDecimalDigits, DecimalType inValue ) - : myIsNegative{ inValue < 0.0 } - , myInteger{ 0 } - , myDecimal{ 0 } - , myMaxIntegerDigits{ DEFAULT_MAX_INTEGER_DIGITS } - , myMaxDecimalDigits{ DEFAULT_MAX_DECIMAL_DIGITS } - { - setMaxIntegerDigits( inMaxIntegerDigits ); - setMaxDecimalDigits( inMaxDecimalDigits ); - setMaxExpressibleNumber(); - setValue( inValue ); - } - - PreciseDecimal::PreciseDecimal( short inMaxIntegerDigits, short inMaxDecimalDigits ) - : PreciseDecimal{ inMaxIntegerDigits, inMaxDecimalDigits, 0.0 } - { - - } +namespace core +{ +PreciseDecimal::PreciseDecimal(short inMaxIntegerDigits, short inMaxDecimalDigits, DecimalType inValue) + : myIsNegative{inValue < 0.0}, myInteger{0}, myDecimal{0}, myMaxIntegerDigits{DEFAULT_MAX_INTEGER_DIGITS}, + myMaxDecimalDigits{DEFAULT_MAX_DECIMAL_DIGITS} +{ + setMaxIntegerDigits(inMaxIntegerDigits); + setMaxDecimalDigits(inMaxDecimalDigits); + setMaxExpressibleNumber(); + setValue(inValue); +} - PreciseDecimal::PreciseDecimal( DecimalType inValue ) - : PreciseDecimal{ DEFAULT_MAX_INTEGER_DIGITS, DEFAULT_MAX_DECIMAL_DIGITS, inValue } - { +PreciseDecimal::PreciseDecimal(short inMaxIntegerDigits, short inMaxDecimalDigits) + : PreciseDecimal{inMaxIntegerDigits, inMaxDecimalDigits, 0.0} +{ +} - } +PreciseDecimal::PreciseDecimal(DecimalType inValue) + : PreciseDecimal{DEFAULT_MAX_INTEGER_DIGITS, DEFAULT_MAX_DECIMAL_DIGITS, inValue} +{ +} - PreciseDecimal::PreciseDecimal() - : PreciseDecimal{ DEFAULT_MAX_INTEGER_DIGITS, DEFAULT_MAX_DECIMAL_DIGITS, 0.0 } - { +PreciseDecimal::PreciseDecimal() : PreciseDecimal{DEFAULT_MAX_INTEGER_DIGITS, DEFAULT_MAX_DECIMAL_DIGITS, 0.0} +{ +} - } +DecimalType PreciseDecimal::getValue() const +{ + return express(myInteger, myDecimal, myMaxDecimalDigits, myIsNegative); +} - DecimalType PreciseDecimal::getValue() const - { - return express( myInteger, myDecimal, myMaxDecimalDigits, myIsNegative ); - } +static constexpr const long double POINT_FIVE = 0.4999999; - static constexpr const long double POINT_FIVE = 0.4999999; +void PreciseDecimal::setValue(DecimalType inValue) +{ + if (inValue < 0) + { + myIsNegative = true; + inValue *= -1; + } + else + { + myIsNegative = false; + } - void PreciseDecimal::setValue( DecimalType inValue ) - { - if ( inValue < 0 ) - { - myIsNegative = true; - inValue *= -1; - } - else - { - myIsNegative = false; - } - - const auto integer = static_cast( inValue ); - const bool isTooBig = integer > myMaxExpressibleInteger; - - if( isTooBig ) - { - myInteger = myMaxExpressibleInteger; - myDecimal = myMaxExpressibleDecimal; - return; - } - - const DecimalType decimalPartAsFloat = inValue - static_cast( integer ); - const auto powerMultiplierAsFloat = std::pow( static_cast( 10 ), static_cast( getMaxDecimalDigits() ) ); - const auto powerMultiplier = static_cast( std::ceil( powerMultiplierAsFloat - POINT_FIVE ) ); - const auto decimalDigitsShifted = decimalPartAsFloat * static_cast( powerMultiplier ); - const auto decimalDigits = static_cast( std::ceil( decimalDigitsShifted - POINT_FIVE ) ); - - if( decimalDigits > myMaxExpressibleDecimal ) - { - myInteger = integer + 1; - myDecimal = 0; - return; - } - - myInteger = integer; - myDecimal = decimalDigits; - } + const auto integer = static_cast(inValue); + const bool isTooBig = integer > myMaxExpressibleInteger; - short PreciseDecimal::getMaxIntegerDigits() const - { - return myMaxIntegerDigits; - } + if (isTooBig) + { + myInteger = myMaxExpressibleInteger; + myDecimal = myMaxExpressibleDecimal; + return; + } - short PreciseDecimal::getMaxDecimalDigits() const - { - return myMaxDecimalDigits; - } + const DecimalType decimalPartAsFloat = inValue - static_cast(integer); + const auto powerMultiplierAsFloat = + std::pow(static_cast(10), static_cast(getMaxDecimalDigits())); + const auto powerMultiplier = static_cast(std::ceil(powerMultiplierAsFloat - POINT_FIVE)); + const auto decimalDigitsShifted = decimalPartAsFloat * static_cast(powerMultiplier); + const auto decimalDigits = static_cast(std::ceil(decimalDigitsShifted - POINT_FIVE)); - DecimalType PreciseDecimal::getMaxExpressibleNumber() const - { - return express( myMaxExpressibleInteger, myMaxExpressibleDecimal, myMaxDecimalDigits, myIsNegative ); - } + if (decimalDigits > myMaxExpressibleDecimal) + { + myInteger = integer + 1; + myDecimal = 0; + return; + } - DecimalType PreciseDecimal::getMinExpressibleNumber() const - { - return -1 * getMaxExpressibleNumber(); - } + myInteger = integer; + myDecimal = decimalDigits; +} - std::ostream& PreciseDecimal::toStream( std::ostream& os ) const - { - if( myInteger == 0 && myDecimal == 0 ) - { - os << "0"; - return os; - } - - if( myIsNegative ) - { - os << "-"; - } - - os << myInteger; - - if( myDecimal == 0 ) - { - return os; - } - - os << "."; - - auto decIntStr = std::to_string( myDecimal ); - std::stringstream ss; - - bool isNonZeroReached = false; - - for ( auto c = decIntStr.crbegin(); - c != decIntStr.crend(); - ++c ) - { - if( *c == '0' && !isNonZeroReached ) - { - continue; - } - - isNonZeroReached = true; - ss << *c; - } - - const auto backwards = ss.str(); - - short digits = 0; - decltype( myDecimal ) tens = 1; - - for( int i = 0; i <= myMaxDecimalDigits; ++i ) - { - ++digits; - tens *= 10; - const auto r = myDecimal / tens; - - if( r < 1 ) - { - break; - } - } - - short leadingZeros = myMaxDecimalDigits - digits; - - for ( short i = 0; i < leadingZeros; ++i ) - { - os << "0"; - } - - for ( auto c = backwards.crbegin(); - c != backwards.crend(); - ++c ) - { - os << *c; - } - - return os; - } +short PreciseDecimal::getMaxIntegerDigits() const +{ + return myMaxIntegerDigits; +} - std::string PreciseDecimal::toString() const - { - std::stringstream ss; - toStream( ss ); - return ss.str(); - } +short PreciseDecimal::getMaxDecimalDigits() const +{ + return myMaxDecimalDigits; +} - void PreciseDecimal::setMaxIntegerDigits( short inNumDigits ) - { - if( inNumDigits < 1 ) - { - myMaxIntegerDigits = 1; - return; - } - - if( inNumDigits > MAX_STORAGE_TYPE_DIGITS ) - { - myMaxIntegerDigits = MAX_STORAGE_TYPE_DIGITS; - return; - } - - myMaxIntegerDigits = inNumDigits; - } +DecimalType PreciseDecimal::getMaxExpressibleNumber() const +{ + return express(myMaxExpressibleInteger, myMaxExpressibleDecimal, myMaxDecimalDigits, myIsNegative); +} - void PreciseDecimal::setMaxDecimalDigits( short inNumDigits ) - { - if( inNumDigits < 1 ) - { - myMaxDecimalDigits = 1; - return; - } - - if( inNumDigits > MAX_STORAGE_TYPE_DIGITS ) - { - myMaxDecimalDigits = MAX_STORAGE_TYPE_DIGITS; - return; - } - - myMaxDecimalDigits = inNumDigits; - } +DecimalType PreciseDecimal::getMinExpressibleNumber() const +{ + return -1 * getMaxExpressibleNumber(); +} - decltype( PreciseDecimal::myInteger ) PreciseDecimal::findMax( short inNumDigits ) - { - decltype( myInteger ) mult = 0; - decltype( myInteger ) result = 0; +std::ostream &PreciseDecimal::toStream(std::ostream &os) const +{ + if (myInteger == 0 && myDecimal == 0) + { + os << "0"; + return os; + } - for( short i = 0; i < inNumDigits; ++i ) - { - mult = static_cast( std::ceil( std::pow( 10, i ) - 0.5) ); - const auto add = mult * 9; - result += add; - } + if (myIsNegative) + { + os << "-"; + } - return result; - } + os << myInteger; - void PreciseDecimal::setMaxExpressibleInteger() - { - myMaxExpressibleInteger = findMax( getMaxIntegerDigits() ); - } + if (myDecimal == 0) + { + return os; + } - void PreciseDecimal::setMaxExpressibleDecimal() - { - myMaxExpressibleDecimal = findMax( getMaxDecimalDigits() ); - } + os << "."; - void PreciseDecimal::setMaxExpressibleNumber() - { - setMaxExpressibleInteger(); - setMaxExpressibleDecimal(); - } + auto decIntStr = std::to_string(myDecimal); + std::stringstream ss; - DecimalType PreciseDecimal::express( uint64_t inInteger, uint64_t inDecimal, short inMaxDecimalDigits, bool inIsNegative ) - { - const auto integer = static_cast( inInteger ); - const auto decimalPartAsFloat = static_cast( inDecimal ); - const auto powerMultiplierAsFloat = std::pow( static_cast( 10 ), static_cast( inMaxDecimalDigits ) ); - const auto powerMultiplier = static_cast( std::ceil( powerMultiplierAsFloat - 0.5 ) ); - const auto decimal = decimalPartAsFloat / powerMultiplier; - auto result = integer + decimal; - - if( inIsNegative ) - { - result *= -1; - } - - return result; - } + bool isNonZeroReached = false; - Decimal::Decimal( DecimalType value ) - : myValue{ 19, DEFAULT_PRECISION, value } + for (auto c = decIntStr.crbegin(); c != decIntStr.crend(); ++c) + { + if (*c == '0' && !isNonZeroReached) { - + continue; } - Decimal::Decimal() - : Decimal{ 0.0 } - { - - } + isNonZeroReached = true; + ss << *c; + } - DecimalType Decimal::getValue() const - { - return myValue.getValue(); - } + const auto backwards = ss.str(); - void Decimal::setValue( DecimalType value ) - { - myValue.setValue( value ); - } + short digits = 0; + decltype(myDecimal) tens = 1; - bool Decimal::parse( const std::string& value ) - { - std::stringstream ss( value ); - DecimalType temp = 0; - if ( ( ss >> temp ).fail() || !( ss >> std::ws ).eof()) - { - return false; - } - setValue( temp ); - return true; - } + for (int i = 0; i <= myMaxDecimalDigits; ++i) + { + ++digits; + tens *= 10; + const auto r = myDecimal / tens; - std::string Decimal::toString() const + if (r < 1) { - return myValue.toString(); + break; } + } + short leadingZeros = myMaxDecimalDigits - digits; - std::ostream& Decimal::toStream( std::ostream& os ) const - { - return myValue.toStream( os ); - } - + for (short i = 0; i < leadingZeros; ++i) + { + os << "0"; + } - std::string toString( const Decimal& value, unsigned int precision ) - { - MX_UNUSED( precision ); - return value.toString(); - } + for (auto c = backwards.crbegin(); c != backwards.crend(); ++c) + { + os << *c; + } + return os; +} - std::ostream& toStream( std::ostream& os, const Decimal& value, unsigned int precision ) - { - MX_UNUSED( precision ); - return value.toStream( os ); - } +std::string PreciseDecimal::toString() const +{ + std::stringstream ss; + toStream(ss); + return ss.str(); +} - std::string toString( const Decimal& value, unsigned short precision ) - { - MX_UNUSED( precision ); - return value.toString(); - } +void PreciseDecimal::setMaxIntegerDigits(short inNumDigits) +{ + if (inNumDigits < 1) + { + myMaxIntegerDigits = 1; + return; + } - std::ostream& toStream( std::ostream& os, const Decimal& value, unsigned short precision ) - { - MX_UNUSED( precision ); - return value.toStream( os ); - } + if (inNumDigits > MAX_STORAGE_TYPE_DIGITS) + { + myMaxIntegerDigits = MAX_STORAGE_TYPE_DIGITS; + return; + } - std::ostream& operator<<( std::ostream& os, const Decimal& value ) - { - return value.toStream( os ); - } + myMaxIntegerDigits = inNumDigits; +} - DecimalType minExclusive( DecimalType min, DecimalType val ) - { - if( val <= min ) - { - return min + NON_ZERO_AMOUNT; - } +void PreciseDecimal::setMaxDecimalDigits(short inNumDigits) +{ + if (inNumDigits < 1) + { + myMaxDecimalDigits = 1; + return; + } - return val; - } + if (inNumDigits > MAX_STORAGE_TYPE_DIGITS) + { + myMaxDecimalDigits = MAX_STORAGE_TYPE_DIGITS; + return; + } - DecimalType minInclusive( DecimalType min, DecimalType val ) - { - if( val < min ) - { - return min; - } + myMaxDecimalDigits = inNumDigits; +} - return val; - } +decltype(PreciseDecimal::myInteger) PreciseDecimal::findMax(short inNumDigits) +{ + decltype(myInteger) mult = 0; + decltype(myInteger) result = 0; - DecimalType maxExclusive( DecimalType max, DecimalType val ) - { - if( val >= max ) - { - return max - NON_ZERO_AMOUNT; - } + for (short i = 0; i < inNumDigits; ++i) + { + mult = static_cast(std::ceil(std::pow(10, i) - 0.5)); + const auto add = mult * 9; + result += add; + } - return val; - } + return result; +} - DecimalType maxInclusive( DecimalType max, DecimalType val ) - { - if( val > max ) - { - return max; - } +void PreciseDecimal::setMaxExpressibleInteger() +{ + myMaxExpressibleInteger = findMax(getMaxIntegerDigits()); +} - return val; - } +void PreciseDecimal::setMaxExpressibleDecimal() +{ + myMaxExpressibleDecimal = findMax(getMaxDecimalDigits()); +} - DecimalType noOp( DecimalType value ) - { - return value; - } +void PreciseDecimal::setMaxExpressibleNumber() +{ + setMaxExpressibleInteger(); + setMaxExpressibleDecimal(); +} - DecimalRange::DecimalRange( DecimalClamp min, DecimalClamp max, DecimalType value ) - : Decimal{ min( max( value ) ) } - , myMinClamp{ min } - , myMaxClamp{ max } - { +DecimalType PreciseDecimal::express(uint64_t inInteger, uint64_t inDecimal, short inMaxDecimalDigits, bool inIsNegative) +{ + const auto integer = static_cast(inInteger); + const auto decimalPartAsFloat = static_cast(inDecimal); + const auto powerMultiplierAsFloat = + std::pow(static_cast(10), static_cast(inMaxDecimalDigits)); + const auto powerMultiplier = static_cast(std::ceil(powerMultiplierAsFloat - 0.5)); + const auto decimal = decimalPartAsFloat / powerMultiplier; + auto result = integer + decimal; + + if (inIsNegative) + { + result *= -1; + } - } + return result; +} - void DecimalRange::setValue( DecimalType value ) - { - Decimal::setValue( myMinClamp( myMaxClamp( value ) ) ); - } +Decimal::Decimal(DecimalType value) : myValue{19, DEFAULT_PRECISION, value} +{ +} -#define MXMINEX( minbound ) DecimalClamp( []( DecimalType value ){ return minExclusive( minbound, value ); } ) -#define MXMAXEX( maxbound ) DecimalClamp( []( DecimalType value ){ return maxExclusive( maxbound, value ); } ) -#define MXMININ( minbound ) DecimalClamp( []( DecimalType value ){ return minInclusive( minbound, value ); } ) -#define MXMAXIN( maxbound ) DecimalClamp( []( DecimalType value ){ return maxInclusive( maxbound, value ); } ) -#define MX_NOOP DecimalClamp( noOp ) +Decimal::Decimal() : Decimal{0.0} +{ +} - DivisionsValue::DivisionsValue( DecimalType value ) - : DecimalRange{ MX_NOOP, MX_NOOP, value } - { +DecimalType Decimal::getValue() const +{ + return myValue.getValue(); +} - } +void Decimal::setValue(DecimalType value) +{ + myValue.setValue(value); +} - DivisionsValue::DivisionsValue() - : DivisionsValue{ 0.0 } - { +bool Decimal::parse(const std::string &value) +{ + std::stringstream ss(value); + DecimalType temp = 0; + if ((ss >> temp).fail() || !(ss >> std::ws).eof()) + { + return false; + } + setValue(temp); + return true; +} - } +std::string Decimal::toString() const +{ + return myValue.toString(); +} - MillimetersValue::MillimetersValue( DecimalType value ) - : DecimalRange{ MX_NOOP, MX_NOOP, value } - { +std::ostream &Decimal::toStream(std::ostream &os) const +{ + return myValue.toStream(os); +} - } +std::string toString(const Decimal &value, unsigned int precision) +{ + MX_UNUSED(precision); + return value.toString(); +} - MillimetersValue::MillimetersValue() - : MillimetersValue{ 0.0 } - { +std::ostream &toStream(std::ostream &os, const Decimal &value, unsigned int precision) +{ + MX_UNUSED(precision); + return value.toStream(os); +} - } +std::string toString(const Decimal &value, unsigned short precision) +{ + MX_UNUSED(precision); + return value.toString(); +} - NonNegativeDecimal::NonNegativeDecimal( DecimalType value ) - : DecimalRange{ MXMININ( 0 ), MX_NOOP, value } - { +std::ostream &toStream(std::ostream &os, const Decimal &value, unsigned short precision) +{ + MX_UNUSED(precision); + return value.toStream(os); +} - } +std::ostream &operator<<(std::ostream &os, const Decimal &value) +{ + return value.toStream(os); +} - NonNegativeDecimal::NonNegativeDecimal() - : NonNegativeDecimal{ 0.0 } - { +DecimalType minExclusive(DecimalType min, DecimalType val) +{ + if (val <= min) + { + return min + NON_ZERO_AMOUNT; + } - } + return val; +} - Percent::Percent( DecimalType value ) - : DecimalRange{ MXMININ( 0 ), MXMAXIN( 100 ), value } - { +DecimalType minInclusive(DecimalType min, DecimalType val) +{ + if (val < min) + { + return min; + } - } + return val; +} - Percent::Percent() - : Percent{ 0.0 } - { +DecimalType maxExclusive(DecimalType max, DecimalType val) +{ + if (val >= max) + { + return max - NON_ZERO_AMOUNT; + } - } + return val; +} - PositiveDecimal::PositiveDecimal( DecimalType value ) - : DecimalRange{ MXMINEX( 0 ), MX_NOOP, value } - { +DecimalType maxInclusive(DecimalType max, DecimalType val) +{ + if (val > max) + { + return max; + } - } + return val; +} - PositiveDecimal::PositiveDecimal() - : PositiveDecimal{ 1 } - { +DecimalType noOp(DecimalType value) +{ + return value; +} - } +DecimalRange::DecimalRange(DecimalClamp min, DecimalClamp max, DecimalType value) + : Decimal{min(max(value))}, myMinClamp{min}, myMaxClamp{max} +{ +} - PositiveDivisions::PositiveDivisions( DecimalType value ) - : DecimalRange{ MXMINEX( 0 ), MX_NOOP, value } - { +void DecimalRange::setValue(DecimalType value) +{ + Decimal::setValue(myMinClamp(myMaxClamp(value))); +} - } +#define MXMINEX(minbound) DecimalClamp([](DecimalType value) { return minExclusive(minbound, value); }) +#define MXMAXEX(maxbound) DecimalClamp([](DecimalType value) { return maxExclusive(maxbound, value); }) +#define MXMININ(minbound) DecimalClamp([](DecimalType value) { return minInclusive(minbound, value); }) +#define MXMAXIN(maxbound) DecimalClamp([](DecimalType value) { return maxInclusive(maxbound, value); }) +#define MX_NOOP DecimalClamp(noOp) - PositiveDivisions::PositiveDivisions() - : PositiveDivisions{ 1 } - { +DivisionsValue::DivisionsValue(DecimalType value) : DecimalRange{MX_NOOP, MX_NOOP, value} +{ +} - } +DivisionsValue::DivisionsValue() : DivisionsValue{0.0} +{ +} - PositiveDivisionsValue::PositiveDivisionsValue( DecimalType value ) - : DecimalRange{ MXMINEX( 0 ), MX_NOOP, value } - { +MillimetersValue::MillimetersValue(DecimalType value) : DecimalRange{MX_NOOP, MX_NOOP, value} +{ +} - } +MillimetersValue::MillimetersValue() : MillimetersValue{0.0} +{ +} - PositiveDivisionsValue::PositiveDivisionsValue() - : PositiveDivisionsValue{ 1 } - { +NonNegativeDecimal::NonNegativeDecimal(DecimalType value) : DecimalRange{MXMININ(0), MX_NOOP, value} +{ +} - } +NonNegativeDecimal::NonNegativeDecimal() : NonNegativeDecimal{0.0} +{ +} - RotationDegrees::RotationDegrees( DecimalType value ) - : DecimalRange{ MXMININ( -180 ), MXMAXIN( 180 ), value } - { +Percent::Percent(DecimalType value) : DecimalRange{MXMININ(0), MXMAXIN(100), value} +{ +} - } +Percent::Percent() : Percent{0.0} +{ +} - RotationDegrees::RotationDegrees() - : RotationDegrees{ 0.0 } - { +PositiveDecimal::PositiveDecimal(DecimalType value) : DecimalRange{MXMINEX(0), MX_NOOP, value} +{ +} - } +PositiveDecimal::PositiveDecimal() : PositiveDecimal{1} +{ +} - Semitones::Semitones( DecimalType value ) - : DecimalRange{ MX_NOOP, MX_NOOP, value } - { +PositiveDivisions::PositiveDivisions(DecimalType value) : DecimalRange{MXMINEX(0), MX_NOOP, value} +{ +} - } +PositiveDivisions::PositiveDivisions() : PositiveDivisions{1} +{ +} - Semitones::Semitones() - : Semitones{ 0.0 } - { +PositiveDivisionsValue::PositiveDivisionsValue(DecimalType value) : DecimalRange{MXMINEX(0), MX_NOOP, value} +{ +} - } +PositiveDivisionsValue::PositiveDivisionsValue() : PositiveDivisionsValue{1} +{ +} - TenthsValue::TenthsValue( DecimalType value ) - : DecimalRange{ MX_NOOP, MX_NOOP, value } - { +RotationDegrees::RotationDegrees(DecimalType value) : DecimalRange{MXMININ(-180), MXMAXIN(180), value} +{ +} - } +RotationDegrees::RotationDegrees() : RotationDegrees{0.0} +{ +} - TenthsValue::TenthsValue() - : TenthsValue{ 0.0 } - { +Semitones::Semitones(DecimalType value) : DecimalRange{MX_NOOP, MX_NOOP, value} +{ +} - } +Semitones::Semitones() : Semitones{0.0} +{ +} - TrillBeats::TrillBeats( DecimalType value ) - : DecimalRange{ MXMININ( 2 ), MX_NOOP, value } - { +TenthsValue::TenthsValue(DecimalType value) : DecimalRange{MX_NOOP, MX_NOOP, value} +{ +} - } +TenthsValue::TenthsValue() : TenthsValue{0.0} +{ +} - TrillBeats::TrillBeats() - : TrillBeats{ 2 } - { +TrillBeats::TrillBeats(DecimalType value) : DecimalRange{MXMININ(2), MX_NOOP, value} +{ +} - } - } +TrillBeats::TrillBeats() : TrillBeats{2} +{ } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Decimals.h b/Sourcecode/private/mx/core/Decimals.h index edde5e489..76f0b9361 100644 --- a/Sourcecode/private/mx/core/Decimals.h +++ b/Sourcecode/private/mx/core/Decimals.h @@ -4,246 +4,248 @@ #pragma once -#include #include #include +#include #include namespace mx { - namespace core - { - /// The type we use for non-integral numbers in this library. - using DecimalType = long double; - constexpr const DecimalType DecimalMin = std::numeric_limits::min(); - constexpr const DecimalType DecimalMax = std::numeric_limits::max(); - - /// Decimals will be rounded to this number of places. - constexpr const unsigned short DEFAULT_PRECISION = 6; - - /// When a Decimal's range is Exclusive and you try to assign a number - /// that is out-of-range, this amount will be added to the exclusive - /// minimum. For example if a Decimal is constrained to be a positive - /// number, and you try to assign the value 0, the value will be set to - /// NON_ZERO_AMOUNT instead. - constexpr const DecimalType NON_ZERO_AMOUNT = 0.000001; - - using DecimalType = long double; - - /// @brief A precision representation of a decimal number - /// - /// @detailed Represents a decimal number with precision. Clamps - /// if an attempt is made to assign an unrepresentable number. - /// Rounds input values to the given MaxDecimalDigits or if a - /// change in precision would lead to data loss. Precision can - /// be changed at runtime. A number such as 123.4567 would require - /// a minimum precision setting of MaxIntegerDigits = 3, - /// MaxDecimalDigits = 4. - /// - class PreciseDecimal - { - public: - PreciseDecimal( short inMaxIntegerDigits, short inMaxDecimalDigits, DecimalType inValue ); - PreciseDecimal( short inMaxIntegerDigits, short inMaxDecimalDigits ); - PreciseDecimal( DecimalType inValue); - PreciseDecimal(); - DecimalType getValue() const; - void setValue( DecimalType inValue ); - short getMaxIntegerDigits() const; - short getMaxDecimalDigits() const; - DecimalType getMaxExpressibleNumber() const; - DecimalType getMinExpressibleNumber() const; - std::ostream& toStream( std::ostream& os ) const; - std::string toString() const; - - private: - bool myIsNegative; - uint64_t myInteger; - uint64_t myDecimal; - short myMaxIntegerDigits; - short myMaxDecimalDigits; - uint64_t myMaxExpressibleInteger; - uint64_t myMaxExpressibleDecimal; - - private: - void setMaxIntegerDigits( short inNumDigits ); - void setMaxDecimalDigits( short inNumDigits ); - static decltype( myInteger ) findMax( short inNumDigits ); - void setMaxExpressibleInteger(); - void setMaxExpressibleDecimal(); - void setMaxExpressibleNumber(); - static DecimalType express( uint64_t inInteger, uint64_t inDecimal, short inMaxDecimalDigits, bool inIsNegative ); - - private: - static constexpr const short DEFAULT_MAX_INTEGER_DIGITS = 10; - static constexpr const short DEFAULT_MAX_DECIMAL_DIGITS = 6; - static constexpr const short MAX_STORAGE_TYPE_DIGITS = 19; - static constexpr const uint64_t MAX_STORAGE_TYPE_VALUE = 9999999999999999999ULL; - }; - - class Decimal - { - public: - Decimal(); - explicit Decimal( DecimalType value ); - virtual ~Decimal() = default; - Decimal( const Decimal& ) = default; - Decimal( Decimal&& ) = default; - Decimal& operator=( const Decimal& ) = default; - Decimal& operator=( Decimal&& ) = default; - DecimalType getValue() const; - virtual void setValue( DecimalType value ); - bool parse( const std::string& value ); - std::string toString() const; - std::ostream& toStream( std::ostream& os ) const; - private: - PreciseDecimal myValue; - }; - - std::string toString( const Decimal& value, unsigned short precision = DEFAULT_PRECISION ); - std::ostream& toStream( std::ostream& os, const Decimal& value, unsigned short precision = DEFAULT_PRECISION ); - std::ostream& operator<<( std::ostream& os, const Decimal& value ); - - /// This type is an implementation detail. It represent a function that - /// clamps a DecimalType to a range. - using DecimalClamp = std::function; - - /// A 'clamped', or 'ranged' Decimal where the value of min and max are - /// governed by the DecimalClamp functions. - class DecimalRange : public Decimal - { - public: - explicit DecimalRange( DecimalClamp min, DecimalClamp max, DecimalType value ); - virtual void setValue( DecimalType value ); - private: - DecimalClamp myMinClamp; - DecimalClamp myMaxClamp; - }; - - /// The divisions type is used to express values in terms of the musical divisions defined - /// by the divisions element. It is preferred that these be integer values both for MIDI - /// interoperability and to avoid roundoff errors. - /// - /// Range: min=None, max=None - class DivisionsValue : public DecimalRange - { - public: - explicit DivisionsValue( DecimalType value ); - DivisionsValue(); - }; - - /// The millimeters type is a number representing millimeters. This is used in the scaling - /// element to provide a default scaling from tenths to physical units. - /// - /// Range: min=None, max=None - class MillimetersValue : public DecimalRange - { - public: - explicit MillimetersValue( DecimalType value ); - MillimetersValue(); - }; - - /// The non-negative-decimal type specifies a non-negative decimal value. - /// - /// Range: min=Inclusive(0), max=None - class NonNegativeDecimal : public DecimalRange - { - public: - explicit NonNegativeDecimal( DecimalType value ); - NonNegativeDecimal(); - }; - - /// The percent type specifies a percentage from 0 to 100. - /// - /// Range: min=Inclusive(0), max=Inclusive(100) - class Percent : public DecimalRange - { - public: - explicit Percent( DecimalType value ); - Percent(); - }; - - /// The positive-decimal type specifies a positive decimal value. - /// - /// Range: min=Exclusive(0), max=None - class PositiveDecimal : public DecimalRange - { - public: - explicit PositiveDecimal( DecimalType value ); - PositiveDecimal(); - }; - - /// The positive-divisions type restricts divisions values to positive numbers. - /// - /// Range: min=Exclusive(0), max=None - class PositiveDivisions : public DecimalRange - { - public: - explicit PositiveDivisions( DecimalType value ); - PositiveDivisions(); - }; - - /// TODO - this needs to be properly generated - /// - /// Range: min=Exclusive(0), max=None - class PositiveDivisionsValue : public DecimalRange - { - public: - explicit PositiveDivisionsValue( DecimalType value ); - PositiveDivisionsValue(); - }; - - /// The rotation-degrees type specifies rotation, pan, and elevation values in degrees. - /// Values range from -180 to 180. - /// - /// Range: min=Inclusive(-180), max=Inclusive(180) - class RotationDegrees : public DecimalRange - { - public: - explicit RotationDegrees( DecimalType value ); - RotationDegrees(); - }; - - /// The semitones type is a number representing semitones, used for chromatic alteration. A - /// value of -1 corresponds to a flat and a value of 1 to a sharp. Decimal values like 0.5 - /// (quarter tone sharp) are used for microtones. - /// - /// Range: min=None, max=None - class Semitones : public DecimalRange - { - public: - explicit Semitones( DecimalType value ); - Semitones(); - }; - - /// The tenths type is a number representing tenths of interline staff space (positive or - /// negative). Both integer and decimal values are allowed, such as 5 for a half space and - /// 2.5 for a quarter space. Interline space is measured from the middle of a staff line. - /// - /// Distances in a MusicXML file are measured in tenths of staff space. Tenths are then - /// scaled to millimeters within the scaling element, used in the defaults element at the - /// start of a score. Individual staves can apply a scaling factor to adjust staff size. - /// When a MusicXML element or attribute refers to tenths, it means the global tenths - /// defined by the scaling element, not the local tenths as adjusted by the staff-size - /// element. - /// - /// Range: min=None, max=None - class TenthsValue : public DecimalRange - { - public: - explicit TenthsValue( DecimalType value ); - TenthsValue(); - }; - - /// The trill-beats type specifies the beats used in a trill-sound or bend-sound attribute - /// group. It is a decimal value with a minimum value of 2. - /// - /// Range: min=Inclusive(2), max=None - class TrillBeats : public DecimalRange - { - public: - explicit TrillBeats( DecimalType value ); - TrillBeats(); - }; - } -} +namespace core +{ +/// The type we use for non-integral numbers in this library. +using DecimalType = long double; +constexpr const DecimalType DecimalMin = std::numeric_limits::min(); +constexpr const DecimalType DecimalMax = std::numeric_limits::max(); + +/// Decimals will be rounded to this number of places. +constexpr const unsigned short DEFAULT_PRECISION = 6; + +/// When a Decimal's range is Exclusive and you try to assign a number +/// that is out-of-range, this amount will be added to the exclusive +/// minimum. For example if a Decimal is constrained to be a positive +/// number, and you try to assign the value 0, the value will be set to +/// NON_ZERO_AMOUNT instead. +constexpr const DecimalType NON_ZERO_AMOUNT = 0.000001; + +using DecimalType = long double; + +/// @brief A precision representation of a decimal number +/// +/// @detailed Represents a decimal number with precision. Clamps +/// if an attempt is made to assign an unrepresentable number. +/// Rounds input values to the given MaxDecimalDigits or if a +/// change in precision would lead to data loss. Precision can +/// be changed at runtime. A number such as 123.4567 would require +/// a minimum precision setting of MaxIntegerDigits = 3, +/// MaxDecimalDigits = 4. +/// +class PreciseDecimal +{ + public: + PreciseDecimal(short inMaxIntegerDigits, short inMaxDecimalDigits, DecimalType inValue); + PreciseDecimal(short inMaxIntegerDigits, short inMaxDecimalDigits); + PreciseDecimal(DecimalType inValue); + PreciseDecimal(); + DecimalType getValue() const; + void setValue(DecimalType inValue); + short getMaxIntegerDigits() const; + short getMaxDecimalDigits() const; + DecimalType getMaxExpressibleNumber() const; + DecimalType getMinExpressibleNumber() const; + std::ostream &toStream(std::ostream &os) const; + std::string toString() const; + + private: + bool myIsNegative; + uint64_t myInteger; + uint64_t myDecimal; + short myMaxIntegerDigits; + short myMaxDecimalDigits; + uint64_t myMaxExpressibleInteger; + uint64_t myMaxExpressibleDecimal; + + private: + void setMaxIntegerDigits(short inNumDigits); + void setMaxDecimalDigits(short inNumDigits); + static decltype(myInteger) findMax(short inNumDigits); + void setMaxExpressibleInteger(); + void setMaxExpressibleDecimal(); + void setMaxExpressibleNumber(); + static DecimalType express(uint64_t inInteger, uint64_t inDecimal, short inMaxDecimalDigits, bool inIsNegative); + + private: + static constexpr const short DEFAULT_MAX_INTEGER_DIGITS = 10; + static constexpr const short DEFAULT_MAX_DECIMAL_DIGITS = 6; + static constexpr const short MAX_STORAGE_TYPE_DIGITS = 19; + static constexpr const uint64_t MAX_STORAGE_TYPE_VALUE = 9999999999999999999ULL; +}; + +class Decimal +{ + public: + Decimal(); + explicit Decimal(DecimalType value); + virtual ~Decimal() = default; + Decimal(const Decimal &) = default; + Decimal(Decimal &&) = default; + Decimal &operator=(const Decimal &) = default; + Decimal &operator=(Decimal &&) = default; + DecimalType getValue() const; + virtual void setValue(DecimalType value); + bool parse(const std::string &value); + std::string toString() const; + std::ostream &toStream(std::ostream &os) const; + + private: + PreciseDecimal myValue; +}; + +std::string toString(const Decimal &value, unsigned short precision = DEFAULT_PRECISION); +std::ostream &toStream(std::ostream &os, const Decimal &value, unsigned short precision = DEFAULT_PRECISION); +std::ostream &operator<<(std::ostream &os, const Decimal &value); + +/// This type is an implementation detail. It represent a function that +/// clamps a DecimalType to a range. +using DecimalClamp = std::function; + +/// A 'clamped', or 'ranged' Decimal where the value of min and max are +/// governed by the DecimalClamp functions. +class DecimalRange : public Decimal +{ + public: + explicit DecimalRange(DecimalClamp min, DecimalClamp max, DecimalType value); + virtual void setValue(DecimalType value); + + private: + DecimalClamp myMinClamp; + DecimalClamp myMaxClamp; +}; + +/// The divisions type is used to express values in terms of the musical divisions defined +/// by the divisions element. It is preferred that these be integer values both for MIDI +/// interoperability and to avoid roundoff errors. +/// +/// Range: min=None, max=None +class DivisionsValue : public DecimalRange +{ + public: + explicit DivisionsValue(DecimalType value); + DivisionsValue(); +}; + +/// The millimeters type is a number representing millimeters. This is used in the scaling +/// element to provide a default scaling from tenths to physical units. +/// +/// Range: min=None, max=None +class MillimetersValue : public DecimalRange +{ + public: + explicit MillimetersValue(DecimalType value); + MillimetersValue(); +}; + +/// The non-negative-decimal type specifies a non-negative decimal value. +/// +/// Range: min=Inclusive(0), max=None +class NonNegativeDecimal : public DecimalRange +{ + public: + explicit NonNegativeDecimal(DecimalType value); + NonNegativeDecimal(); +}; + +/// The percent type specifies a percentage from 0 to 100. +/// +/// Range: min=Inclusive(0), max=Inclusive(100) +class Percent : public DecimalRange +{ + public: + explicit Percent(DecimalType value); + Percent(); +}; + +/// The positive-decimal type specifies a positive decimal value. +/// +/// Range: min=Exclusive(0), max=None +class PositiveDecimal : public DecimalRange +{ + public: + explicit PositiveDecimal(DecimalType value); + PositiveDecimal(); +}; + +/// The positive-divisions type restricts divisions values to positive numbers. +/// +/// Range: min=Exclusive(0), max=None +class PositiveDivisions : public DecimalRange +{ + public: + explicit PositiveDivisions(DecimalType value); + PositiveDivisions(); +}; + +/// TODO - this needs to be properly generated +/// +/// Range: min=Exclusive(0), max=None +class PositiveDivisionsValue : public DecimalRange +{ + public: + explicit PositiveDivisionsValue(DecimalType value); + PositiveDivisionsValue(); +}; + +/// The rotation-degrees type specifies rotation, pan, and elevation values in degrees. +/// Values range from -180 to 180. +/// +/// Range: min=Inclusive(-180), max=Inclusive(180) +class RotationDegrees : public DecimalRange +{ + public: + explicit RotationDegrees(DecimalType value); + RotationDegrees(); +}; + +/// The semitones type is a number representing semitones, used for chromatic alteration. A +/// value of -1 corresponds to a flat and a value of 1 to a sharp. Decimal values like 0.5 +/// (quarter tone sharp) are used for microtones. +/// +/// Range: min=None, max=None +class Semitones : public DecimalRange +{ + public: + explicit Semitones(DecimalType value); + Semitones(); +}; + +/// The tenths type is a number representing tenths of interline staff space (positive or +/// negative). Both integer and decimal values are allowed, such as 5 for a half space and +/// 2.5 for a quarter space. Interline space is measured from the middle of a staff line. +/// +/// Distances in a MusicXML file are measured in tenths of staff space. Tenths are then +/// scaled to millimeters within the scaling element, used in the defaults element at the +/// start of a score. Individual staves can apply a scaling factor to adjust staff size. +/// When a MusicXML element or attribute refers to tenths, it means the global tenths +/// defined by the scaling element, not the local tenths as adjusted by the staff-size +/// element. +/// +/// Range: min=None, max=None +class TenthsValue : public DecimalRange +{ + public: + explicit TenthsValue(DecimalType value); + TenthsValue(); +}; + +/// The trill-beats type specifies the beats used in a trill-sound or bend-sound attribute +/// group. It is a decimal value with a minimum value of 2. +/// +/// Range: min=Inclusive(2), max=None +class TrillBeats : public DecimalRange +{ + public: + explicit TrillBeats(DecimalType value); + TrillBeats(); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Document.cpp b/Sourcecode/private/mx/core/Document.cpp index c369e54ca..3006feb5a 100644 --- a/Sourcecode/private/mx/core/Document.cpp +++ b/Sourcecode/private/mx/core/Document.cpp @@ -3,182 +3,157 @@ // Distributed under the MIT License #include "mx/core/Document.h" -#include "ezxml/XFactory.h" #include "ezxml/XAttribute.h" -#include "ezxml/XElementIterator.h" #include "ezxml/XAttributeIterator.h" +#include "ezxml/XElementIterator.h" +#include "ezxml/XFactory.h" #include "mx/core/ScoreConversions.h" namespace mx { - namespace core +namespace core +{ + +DocumentPtr makeDocument() +{ + return std::make_shared(); +} + +DocumentPtr makeDocument(DocumentChoice choice) +{ + return std::make_shared(choice); +} + +Document::Document() + : myChoice(DEFAULT_DOCUMENT_CHOICE), myScorePartwise(makeScorePartwise()), myScoreTimewise(makeScoreTimewise()) +{ +} + +Document::Document(DocumentChoice choice) + : myChoice(choice), myScorePartwise(makeScorePartwise()), myScoreTimewise(makeScoreTimewise()) +{ +} + +void Document::setChoice(DocumentChoice choice) +{ + myChoice = choice; +} + +DocumentChoice Document::getChoice() const +{ + return myChoice; +} + +void Document::convertContents() +{ + switch (myChoice) + { + case DocumentChoice::partwise: { + myScoreTimewise = partwiseTimewise(myScorePartwise); + myScorePartwise = makeScorePartwise(); + myChoice = DocumentChoice::timewise; + } + break; + case DocumentChoice::timewise: { + myScorePartwise = timewisePartwise(myScoreTimewise); + myScoreTimewise = makeScoreTimewise(); + myChoice = DocumentChoice::partwise; + } + break; + default: + break; + } +} + +ScorePartwisePtr Document::getScorePartwise() const +{ + return myScorePartwise; +} + +void Document::setScorePartwise(const ScorePartwisePtr &value) +{ + if (value) + { + myScorePartwise = value; + } +} + +ScoreTimewisePtr Document::getScoreTimewise() const +{ + return myScoreTimewise; +} + +void Document::setScoreTimewise(const ScoreTimewisePtr &value) +{ + if (value) + { + myScoreTimewise = value; + } +} + +std::ostream &Document::toStream(std::ostream &os) const +{ + os << DEFAULT_XML_DECLARATION << std::endl; + switch (myChoice) + { + case DocumentChoice::partwise: { + os << "" << std::endl; + myScorePartwise->toStream(os, 0); + } + break; + case DocumentChoice::timewise: { + os << "" << std::endl; + myScoreTimewise->toStream(os, 0); + } + break; + default: + MX_THROW("myChoice had a bad value") + } + return os; +} + +void Document::toXDoc(::ezxml::XDoc &outXDoc) const +{ + std::stringstream ss; + toStream(ss); + std::istringstream is(ss.str()); + + outXDoc.loadStream(is); + switch (myChoice) { - - DocumentPtr makeDocument() - { - return std::make_shared(); - } - - - DocumentPtr makeDocument( DocumentChoice choice ) - { - return std::make_shared( choice ); - } - - - Document::Document() - : myChoice( DEFAULT_DOCUMENT_CHOICE ) - , myScorePartwise( makeScorePartwise() ) - , myScoreTimewise( makeScoreTimewise() ) - { - - } - - - Document::Document( DocumentChoice choice ) - : myChoice( choice ) - , myScorePartwise( makeScorePartwise() ) - , myScoreTimewise( makeScoreTimewise() ) - { - - } - - - void Document::setChoice( DocumentChoice choice ) - { - myChoice = choice; - } - - - DocumentChoice Document::getChoice() const - { - return myChoice; - } - - - void Document::convertContents() - { - switch ( myChoice ) - { - case DocumentChoice::partwise: - { - myScoreTimewise = partwiseTimewise( myScorePartwise ); - myScorePartwise = makeScorePartwise(); - myChoice = DocumentChoice::timewise; - } - break; - case DocumentChoice::timewise: - { - myScorePartwise = timewisePartwise( myScoreTimewise ); - myScoreTimewise = makeScoreTimewise(); - myChoice = DocumentChoice::partwise; - } - break; - default: - break; - } - } - - - ScorePartwisePtr Document::getScorePartwise() const - { - return myScorePartwise; - } - - - void Document::setScorePartwise( const ScorePartwisePtr& value ) - { - if( value ) - { - myScorePartwise = value; - } - } - - - ScoreTimewisePtr Document::getScoreTimewise() const - { - return myScoreTimewise; - } - - - void Document::setScoreTimewise( const ScoreTimewisePtr& value ) - { - if( value ) - { - myScoreTimewise = value; - } - } - - - std::ostream& Document::toStream( std::ostream& os ) const - { - os << DEFAULT_XML_DECLARATION << std::endl; - switch ( myChoice ) - { - case DocumentChoice::partwise: - { - os << "" << std::endl; - myScorePartwise->toStream( os, 0 ); - } - break; - case DocumentChoice::timewise: - { - os << "" << std::endl; - myScoreTimewise->toStream( os, 0 ); - } - break; - default: - MX_THROW( "myChoice had a bad value" ) - } - return os; - } - - - void Document::toXDoc( ::ezxml::XDoc& outXDoc ) const - { - std::stringstream ss; - toStream( ss ); - std::istringstream is( ss.str() ); - - outXDoc.loadStream( is ); - switch ( myChoice ) - { - case DocumentChoice::partwise: - { - outXDoc.setDoctypeValue( DOCTYPE_VALUE_SCORE_PARTWISE ); - } - break; - case DocumentChoice::timewise: - { - outXDoc.setDoctypeValue( DOCTYPE_VALUE_SCORE_TIMEWISE ); - } - break; - default: - MX_THROW( "myChoice had a bad value" ) - } - } - - - bool Document::fromXDoc( std::ostream& messages, const ::ezxml::XDoc& inXDoc ) - { - auto root = inXDoc.getRoot(); - if( inXDoc.getRoot()->getName() == "score-partwise" ) - { - myChoice = DocumentChoice::partwise; - myScorePartwise = makeScorePartwise(); - return myScorePartwise->fromXElement( messages, *root ); - } - else if( inXDoc.getRoot()->getName() == "score-timewise" ) - { - myChoice = DocumentChoice::timewise; - myScoreTimewise = makeScoreTimewise(); - return myScoreTimewise->fromXElement( messages, *root ); - } - else - { - MX_THROW( "bad input - could not find the score-timewise or score-partwise node" ); - } - } - + case DocumentChoice::partwise: { + outXDoc.setDoctypeValue(DOCTYPE_VALUE_SCORE_PARTWISE); + } + break; + case DocumentChoice::timewise: { + outXDoc.setDoctypeValue(DOCTYPE_VALUE_SCORE_TIMEWISE); + } + break; + default: + MX_THROW("myChoice had a bad value") } } + +bool Document::fromXDoc(std::ostream &messages, const ::ezxml::XDoc &inXDoc) +{ + auto root = inXDoc.getRoot(); + if (inXDoc.getRoot()->getName() == "score-partwise") + { + myChoice = DocumentChoice::partwise; + myScorePartwise = makeScorePartwise(); + return myScorePartwise->fromXElement(messages, *root); + } + else if (inXDoc.getRoot()->getName() == "score-timewise") + { + myChoice = DocumentChoice::timewise; + myScoreTimewise = makeScoreTimewise(); + return myScoreTimewise->fromXElement(messages, *root); + } + else + { + MX_THROW("bad input - could not find the score-timewise or score-partwise node"); + } +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Document.h b/Sourcecode/private/mx/core/Document.h index 403e674b1..471181eb7 100644 --- a/Sourcecode/private/mx/core/Document.h +++ b/Sourcecode/private/mx/core/Document.h @@ -4,91 +4,95 @@ #pragma once +#include "mx/core/Elements.h" #include #include -#include "mx/core/Elements.h" // Forward Declarations ///////////////////////////////////////////////////// namespace ezxml { - class XDoc; - using XDocPtr = std::shared_ptr; -} +class XDoc; +using XDocPtr = std::shared_ptr; +} // namespace ezxml namespace mx { - namespace core - { - class Document; - using DocumentPtr = std::shared_ptr; - - class ScorePartwise; - using ScorePartwisePtr = std::shared_ptr; - - class ScoreTimewise; - using ScoreTimewisePtr = std::shared_ptr; - } +namespace core +{ +class Document; +using DocumentPtr = std::shared_ptr; + +class ScorePartwise; +using ScorePartwisePtr = std::shared_ptr; + +class ScoreTimewise; +using ScoreTimewisePtr = std::shared_ptr; +} // namespace core //////////////////////////////////////////////////////////////////////////// - namespace core - { - constexpr const char* const DEFAULT_XML_DECLARATION = ""; - constexpr const char* const DOCTYPE_VALUE_SCORE_PARTWISE = "score-partwise PUBLIC \"-//Recordare//DTD MusicXML 3.0 Partwise//EN\" \"http://www.musicxml.org/dtds/partwise.dtd\""; - constexpr const char* const DOCTYPE_VALUE_SCORE_TIMEWISE = "score-timewise PUBLIC \"-//Recordare//DTD MusicXML 3.0 Timewise//EN\" \"http://www.musicxml.org/dtds/timewise.dtd\""; - - enum class DocumentChoice - { - partwise, - timewise - }; - - constexpr const DocumentChoice DEFAULT_DOCUMENT_CHOICE = DocumentChoice::partwise; - - DocumentPtr makeDocument(); - DocumentPtr makeDocument( DocumentChoice choice ); - - class Document - { - public: - Document(); - Document( DocumentChoice choice ); - - // indicates which type of musicxml document is held - // setting the choice does not alter the contents of - // ScorePartwise or ScoreTimewise object, is just - // indicates which object is being used and which - // object will be written during toStream/toXDoc - void setChoice( DocumentChoice choice ); - DocumentChoice getChoice() const; - - // switches the DocumentChoice from partwise to - // timewise or vice versa and converts the contents - // over to the new type. For example if choice is - // currently partwise and there is data in the - // ScorePartwise object, the choice will be changed - // to timewise, the ScoreTimewise object will be - // populated from the contents of ScorePartwise, - // and ScorePartwise will become empty - void convertContents(); - - // you should use these functions if choice == partwise - ScorePartwisePtr getScorePartwise() const; - void setScorePartwise( const ScorePartwisePtr& value ); - - // you should use these functions if choice == timewise - ScoreTimewisePtr getScoreTimewise() const; - void setScoreTimewise( const ScoreTimewisePtr& value ); - - std::ostream& toStream( std::ostream& os ) const; - void toXDoc( ::ezxml::XDoc& outXDoc ) const; - bool fromXDoc( std::ostream& messages, const ::ezxml::XDoc& inXDoc ); - - private: - DocumentChoice myChoice; - ScorePartwisePtr myScorePartwise; - ScoreTimewisePtr myScoreTimewise; - }; - } -} +namespace core +{ +constexpr const char *const DEFAULT_XML_DECLARATION = ""; +constexpr const char *const DOCTYPE_VALUE_SCORE_PARTWISE = + "score-partwise PUBLIC \"-//Recordare//DTD MusicXML 3.0 Partwise//EN\" " + "\"http://www.musicxml.org/dtds/partwise.dtd\""; +constexpr const char *const DOCTYPE_VALUE_SCORE_TIMEWISE = + "score-timewise PUBLIC \"-//Recordare//DTD MusicXML 3.0 Timewise//EN\" " + "\"http://www.musicxml.org/dtds/timewise.dtd\""; + +enum class DocumentChoice +{ + partwise, + timewise +}; + +constexpr const DocumentChoice DEFAULT_DOCUMENT_CHOICE = DocumentChoice::partwise; + +DocumentPtr makeDocument(); +DocumentPtr makeDocument(DocumentChoice choice); + +class Document +{ + public: + Document(); + Document(DocumentChoice choice); + + // indicates which type of musicxml document is held + // setting the choice does not alter the contents of + // ScorePartwise or ScoreTimewise object, is just + // indicates which object is being used and which + // object will be written during toStream/toXDoc + void setChoice(DocumentChoice choice); + DocumentChoice getChoice() const; + + // switches the DocumentChoice from partwise to + // timewise or vice versa and converts the contents + // over to the new type. For example if choice is + // currently partwise and there is data in the + // ScorePartwise object, the choice will be changed + // to timewise, the ScoreTimewise object will be + // populated from the contents of ScorePartwise, + // and ScorePartwise will become empty + void convertContents(); + + // you should use these functions if choice == partwise + ScorePartwisePtr getScorePartwise() const; + void setScorePartwise(const ScorePartwisePtr &value); + + // you should use these functions if choice == timewise + ScoreTimewisePtr getScoreTimewise() const; + void setScoreTimewise(const ScoreTimewisePtr &value); + + std::ostream &toStream(std::ostream &os) const; + void toXDoc(::ezxml::XDoc &outXDoc) const; + bool fromXDoc(std::ostream &messages, const ::ezxml::XDoc &inXDoc); + + private: + DocumentChoice myChoice; + ScorePartwisePtr myScorePartwise; + ScoreTimewisePtr myScoreTimewise; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/DocumentHeader.cpp b/Sourcecode/private/mx/core/DocumentHeader.cpp index 8a07c5e00..c05b9339d 100644 --- a/Sourcecode/private/mx/core/DocumentHeader.cpp +++ b/Sourcecode/private/mx/core/DocumentHeader.cpp @@ -6,151 +6,148 @@ namespace mx { - namespace core +namespace core +{ +std::ostream &stream(std::ostream &os, const DocumentType value) +{ + switch (value) + { + case DocumentType::partwise: { + os << "score-partwise"; + } + break; + case DocumentType::timewise: { + os << "score-timewise"; + } + break; + default: + break; + } + return os; +} + +std::ostream &stream(std::ostream &os, const XmlVersion value) +{ + switch (value) { - std::ostream& stream( std::ostream& os, const DocumentType value ) - { - switch ( value ) - { - case DocumentType::partwise: - { - os << "score-partwise"; - } - break; - case DocumentType::timewise: - { - os << "score-timewise"; - } - break; - default: - break; - } - return os; - } - - std::ostream& stream( std::ostream& os, const XmlVersion value ) - { - switch ( value ) - { - case XmlVersion::onePointZero: - { - os << "1.0"; - } - break; - default: - break; - } - return os; - } - - std::ostream& stream( std::ostream& os, const DocumentEncoding value ) - { - switch ( value ) - { - case DocumentEncoding::utfEight: - { - os << "UTF-8"; - } - break; - default: - break; - } - return os; - } - - std::ostream& stream( std::ostream& os, const MusicXmlVersion value ) - { - switch ( value ) - { - case MusicXmlVersion::ThreePointZero: - { - os << "3.0"; - } - break; - default: - break; - } - return os; - } - + case XmlVersion::onePointZero: { + os << "1.0"; + } + break; + default: + break; + } + return os; +} + +std::ostream &stream(std::ostream &os, const DocumentEncoding value) +{ + switch (value) + { + case DocumentEncoding::utfEight: { + os << "UTF-8"; + } + break; + default: + break; + } + return os; +} + +std::ostream &stream(std::ostream &os, const MusicXmlVersion value) +{ + switch (value) + { + case MusicXmlVersion::ThreePointZero: { + os << "3.0"; + } + break; + default: + break; + } + return os; +} + #ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - DocumentSpecifications::DocumentSpecifications() - :xmlVersion( kDefaultXmlVersion ) - ,documentEncoding( kDefaultDocumentEncoding ) - ,documentType( kDefaultDocumentType ) - ,musicXmlVersion( kDefaultMusicXmlVersion ) - {} +constexpr +#endif + DocumentSpecifications::DocumentSpecifications() + : xmlVersion(kDefaultXmlVersion), documentEncoding(kDefaultDocumentEncoding), documentType(kDefaultDocumentType), + musicXmlVersion(kDefaultMusicXmlVersion) +{ +} - DocumentHeader::DocumentHeader() - :mySpecs( DocumentSpecifications{} ) - {} - - DocumentHeader::~DocumentHeader() {} - - DocumentHeader::DocumentHeader( const DocumentSpecifications& specs ) - :mySpecs( specs ) - {} - - DocumentType DocumentHeader::getDocumentType() const - { - return mySpecs.documentType; - } - - void DocumentHeader::setDocumentType( const DocumentType value ) - { - mySpecs.documentType = value; - } - - std::ostream& DocumentHeader::toStream( std::ostream& os ) const - { - os << R"()"; - os << std::endl; - - os << R"()"; - return os; - } - - DocumentHeaderPtr makeDocumentHeader() - { - return std::make_shared(); - } - DocumentHeaderPtr makeDocumentHeader( const DocumentSpecifications& specs ) - { - return std::make_shared( specs ); - } +DocumentHeader::DocumentHeader() : mySpecs(DocumentSpecifications{}) +{ +} + +DocumentHeader::~DocumentHeader() +{ +} + +DocumentHeader::DocumentHeader(const DocumentSpecifications &specs) : mySpecs(specs) +{ +} + +DocumentType DocumentHeader::getDocumentType() const +{ + return mySpecs.documentType; +} + +void DocumentHeader::setDocumentType(const DocumentType value) +{ + mySpecs.documentType = value; +} + +std::ostream &DocumentHeader::toStream(std::ostream &os) const +{ + os << R"()"; + os << std::endl; + + os << R"()"; + return os; +} + +DocumentHeaderPtr makeDocumentHeader() +{ + return std::make_shared(); +} + +DocumentHeaderPtr makeDocumentHeader(const DocumentSpecifications &specs) +{ + return std::make_shared(specs); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/DocumentHeader.h b/Sourcecode/private/mx/core/DocumentHeader.h index c32b38b77..116294160 100644 --- a/Sourcecode/private/mx/core/DocumentHeader.h +++ b/Sourcecode/private/mx/core/DocumentHeader.h @@ -9,85 +9,86 @@ namespace mx { - namespace core - { - enum class DocumentType - { - partwise = 1, - timewise = 2 - }; +namespace core +{ +enum class DocumentType +{ + partwise = 1, + timewise = 2 +}; #ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - const DocumentType kDefaultDocumentType = DocumentType::partwise; - std::ostream& stream( std::ostream& os, const DocumentType value ); - - enum class XmlVersion - { - onePointZero = 1 - }; +constexpr +#endif + const DocumentType kDefaultDocumentType = DocumentType::partwise; +std::ostream &stream(std::ostream &os, const DocumentType value); + +enum class XmlVersion +{ + onePointZero = 1 +}; #ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - const XmlVersion kDefaultXmlVersion = XmlVersion::onePointZero; - std::ostream& stream( std::ostream& os, const XmlVersion value ); - - enum class DocumentEncoding - { - utfEight = 1 - }; +constexpr +#endif + const XmlVersion kDefaultXmlVersion = XmlVersion::onePointZero; +std::ostream &stream(std::ostream &os, const XmlVersion value); + +enum class DocumentEncoding +{ + utfEight = 1 +}; #ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - const DocumentEncoding kDefaultDocumentEncoding = DocumentEncoding::utfEight; - std::ostream& stream( std::ostream& os, const DocumentEncoding value ); - - enum class MusicXmlVersion - { - ThreePointZero = 1 - }; +constexpr +#endif + const DocumentEncoding kDefaultDocumentEncoding = DocumentEncoding::utfEight; +std::ostream &stream(std::ostream &os, const DocumentEncoding value); + +enum class MusicXmlVersion +{ + ThreePointZero = 1 +}; #ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - const MusicXmlVersion kDefaultMusicXmlVersion = MusicXmlVersion::ThreePointZero; - std::ostream& stream( std::ostream& os, const MusicXmlVersion value ); - - struct DocumentSpecifications - { +constexpr +#endif + const MusicXmlVersion kDefaultMusicXmlVersion = MusicXmlVersion::ThreePointZero; +std::ostream &stream(std::ostream &os, const MusicXmlVersion value); + +struct DocumentSpecifications +{ #ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - DocumentSpecifications(); - XmlVersion xmlVersion; - DocumentEncoding documentEncoding; - DocumentType documentType; - MusicXmlVersion musicXmlVersion; - }; - - /* this class is basically a stub - it could come in handy for forward - compatibility later */ - class DocumentHeader; - using DocumentHeaderPtr = std::shared_ptr; - DocumentHeaderPtr makeDocumentHeader(); - DocumentHeaderPtr makeDocumentHeader( const DocumentSpecifications& specs ); - - class DocumentHeader - { - public: - DocumentHeader(); - DocumentHeader( const DocumentSpecifications& specs ); - virtual ~DocumentHeader(); - virtual std::ostream& toStream( std::ostream& os ) const; - // XmlVersion getXmlVersion() const; - // void setXmlVersion( const XmlVersion value ); - // DocumentEncoding getDocumentEncoding() const; - // void setDocumentEncoding( const DocumentEncoding value ); - DocumentType getDocumentType() const; - void setDocumentType( const DocumentType value ); - private: - DocumentSpecifications mySpecs; - }; - - } -} + constexpr +#endif + DocumentSpecifications(); + XmlVersion xmlVersion; + DocumentEncoding documentEncoding; + DocumentType documentType; + MusicXmlVersion musicXmlVersion; +}; + +/* this class is basically a stub + it could come in handy for forward + compatibility later */ +class DocumentHeader; +using DocumentHeaderPtr = std::shared_ptr; +DocumentHeaderPtr makeDocumentHeader(); +DocumentHeaderPtr makeDocumentHeader(const DocumentSpecifications &specs); + +class DocumentHeader +{ + public: + DocumentHeader(); + DocumentHeader(const DocumentSpecifications &specs); + virtual ~DocumentHeader(); + virtual std::ostream &toStream(std::ostream &os) const; + // XmlVersion getXmlVersion() const; + // void setXmlVersion( const XmlVersion value ); + // DocumentEncoding getDocumentEncoding() const; + // void setDocumentEncoding( const DocumentEncoding value ); + DocumentType getDocumentType() const; + void setDocumentType(const DocumentType value); + + private: + DocumentSpecifications mySpecs; +}; + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/DocumentSpec.cpp b/Sourcecode/private/mx/core/DocumentSpec.cpp index f02c0cc69..e156e1e03 100644 --- a/Sourcecode/private/mx/core/DocumentSpec.cpp +++ b/Sourcecode/private/mx/core/DocumentSpec.cpp @@ -3,143 +3,132 @@ // Distributed under the MIT License #include "mx/core/DocumentSpec.h" -#include "mx/utility/Parse.h" #include "mx/core/UnusedParameter.h" +#include "mx/utility/Parse.h" #include namespace mx { - namespace core +namespace core +{ +std::ostream &toStream(std::ostream &os, const DocumentChoice value) +{ + switch (value) + { + case DocumentChoice::partwise: + os << "partwise"; + break; + case DocumentChoice::timewise: + os << "timewise"; + default: + os << "error"; + break; + } + return os; +} + +std::string toString(const DocumentChoice value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +DocumentChoice parseDocumentChoice(const std::string &str) +{ + if (utility::compareCaseInsensitive(str, "partwise")) { - std::ostream& toStream( std::ostream& os, const DocumentChoice value ) - { - switch ( value ) - { - case DocumentChoice::partwise: - os << "partwise"; - break; - case DocumentChoice::timewise: - os << "timewise"; - default: - os << "error"; - break; - } - return os; - } - - - std::string toString( const DocumentChoice value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - - DocumentChoice parseDocumentChoice( const std::string& str ) - { - if( utility::compareCaseInsensitive( str, "partwise" ) ) - { - return DocumentChoice::partwise; - } - else if ( utility::compareCaseInsensitive( str, "timewise" ) ) - { - return DocumentChoice::timewise; - } - return DEFAULT_DOCUMENT_CHOICE; - } - - - std::ostream& toStream( std::ostream& os, const MusicXmlVersion value ) - { - switch ( value ) - { - case MusicXmlVersion::unknown: - os << "unknown"; - break; - case MusicXmlVersion::threePointZero: - os << "3.0"; - default: - os << "error"; - break; - } - return os; - } - - - std::string toString( const MusicXmlVersion value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - - MusicXmlVersion parseMusicXmlVersion( const std::string& str ) - { - if( utility::compareCaseInsensitive( str, "3.0" ) ) - { - return MusicXmlVersion::threePointZero; - } - return DEFAULT_MUSIC_XML_VERSION; - } + return DocumentChoice::partwise; + } + else if (utility::compareCaseInsensitive(str, "timewise")) + { + return DocumentChoice::timewise; + } + return DEFAULT_DOCUMENT_CHOICE; +} - - std::ostream& toStream( std::ostream& os, const SpecificationType value ) - { - switch ( value ) - { - case SpecificationType::unknown: - os << "unknown"; - break; - case SpecificationType::dtd: - os << "dtd"; - case SpecificationType::xsd: - os << "xsd"; - default: - os << "error"; - break; - } - return os; - } - - - std::string toString( const SpecificationType value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - - SpecificationType parseSpecificationType( const std::string& str ) - { - if( utility::compareCaseInsensitive( str, "dtd" ) ) - { - return SpecificationType::dtd; - } - else if( utility::compareCaseInsensitive( str, "xsd" ) ) - { - return SpecificationType::dtd; - } - return DEFAULT_SPECIFICATION_TYPE; - } - - - DocumentSpec::DocumentSpec() - // : xmlVersion( DEFAULT_XML_VERSION ) - //, encoding( DEFAULT_ENCODING ) - //, documentChoice( DEFAULT_DOCUMENT_CHOICE ) - //, musicXmlVersion( DEFAULT_MUSIC_XML_VERSION ) - { - - } - - - DocumentSpec parseDocumentSpec( const ::ezxml::XDocCPtr& doc ) - { - MX_UNUSED( doc ); - throw std::runtime_error( "not implemented" ); - } +std::ostream &toStream(std::ostream &os, const MusicXmlVersion value) +{ + switch (value) + { + case MusicXmlVersion::unknown: + os << "unknown"; + break; + case MusicXmlVersion::threePointZero: + os << "3.0"; + default: + os << "error"; + break; } + return os; +} + +std::string toString(const MusicXmlVersion value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +MusicXmlVersion parseMusicXmlVersion(const std::string &str) +{ + if (utility::compareCaseInsensitive(str, "3.0")) + { + return MusicXmlVersion::threePointZero; + } + return DEFAULT_MUSIC_XML_VERSION; +} + +std::ostream &toStream(std::ostream &os, const SpecificationType value) +{ + switch (value) + { + case SpecificationType::unknown: + os << "unknown"; + break; + case SpecificationType::dtd: + os << "dtd"; + case SpecificationType::xsd: + os << "xsd"; + default: + os << "error"; + break; + } + return os; +} + +std::string toString(const SpecificationType value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +SpecificationType parseSpecificationType(const std::string &str) +{ + if (utility::compareCaseInsensitive(str, "dtd")) + { + return SpecificationType::dtd; + } + else if (utility::compareCaseInsensitive(str, "xsd")) + { + return SpecificationType::dtd; + } + return DEFAULT_SPECIFICATION_TYPE; +} + +DocumentSpec::DocumentSpec() +// : xmlVersion( DEFAULT_XML_VERSION ) +//, encoding( DEFAULT_ENCODING ) +//, documentChoice( DEFAULT_DOCUMENT_CHOICE ) +//, musicXmlVersion( DEFAULT_MUSIC_XML_VERSION ) +{ +} + +DocumentSpec parseDocumentSpec(const ::ezxml::XDocCPtr &doc) +{ + MX_UNUSED(doc); + throw std::runtime_error("not implemented"); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/DocumentSpec.h b/Sourcecode/private/mx/core/DocumentSpec.h index 99f689233..109c4628c 100644 --- a/Sourcecode/private/mx/core/DocumentSpec.h +++ b/Sourcecode/private/mx/core/DocumentSpec.h @@ -4,67 +4,65 @@ #pragma once +#include #include #include -#include namespace ezxml { - class XDoc; - using XDocCPtr = std::shared_ptr; -} +class XDoc; +using XDocCPtr = std::shared_ptr; +} // namespace ezxml namespace mx { - namespace core - { +namespace core +{ + +enum DocumentChoice +{ + partwise, + timewise +}; + +const DocumentChoice DEFAULT_DOCUMENT_CHOICE = DocumentChoice::partwise; +std::ostream &toStream(std::ostream &os, const DocumentChoice value); +std::string toString(const DocumentChoice value); +DocumentChoice parseDocumentChoice(const std::string &str); + +enum class MusicXmlVersion +{ + unknown, + threePointZero +}; + +const MusicXmlVersion DEFAULT_MUSIC_XML_VERSION = MusicXmlVersion::threePointZero; +std::ostream &toStream(std::ostream &os, const MusicXmlVersion value); +std::string toString(const MusicXmlVersion value); +MusicXmlVersion parseMusicXmlVersion(const std::string &str); + +enum class SpecificationType +{ + unknown, + dtd, + xsd +}; + +const SpecificationType DEFAULT_SPECIFICATION_TYPE = SpecificationType::xsd; +std::ostream &toStream(std::ostream &os, const SpecificationType value); +std::string toString(const SpecificationType value); +SpecificationType parseSpecificationType(const std::string &str); + +struct DocumentSpec +{ + DocumentSpec(); + // XmlVersion xmlVersion; + // Encoding encoding; + DocumentChoice documentChoice; + MusicXmlVersion musicXmlVersion; +}; - enum DocumentChoice - { - partwise, - timewise - }; - - const DocumentChoice DEFAULT_DOCUMENT_CHOICE = DocumentChoice::partwise; - std::ostream& toStream( std::ostream& os, const DocumentChoice value ); - std::string toString( const DocumentChoice value ); - DocumentChoice parseDocumentChoice( const std::string& str ); - - - - enum class MusicXmlVersion - { - unknown, - threePointZero - }; +DocumentSpec parseDocumentSpec(const ::ezxml::XDocCPtr &doc); - const MusicXmlVersion DEFAULT_MUSIC_XML_VERSION = MusicXmlVersion::threePointZero; - std::ostream& toStream( std::ostream& os, const MusicXmlVersion value ); - std::string toString( const MusicXmlVersion value ); - MusicXmlVersion parseMusicXmlVersion( const std::string& str ); - - enum class SpecificationType - { - unknown, - dtd, - xsd - }; - - const SpecificationType DEFAULT_SPECIFICATION_TYPE = SpecificationType::xsd; - std::ostream& toStream( std::ostream& os, const SpecificationType value ); - std::string toString( const SpecificationType value ); - SpecificationType parseSpecificationType( const std::string& str ); - - struct DocumentSpec - { - DocumentSpec(); - //XmlVersion xmlVersion; - //Encoding encoding; - DocumentChoice documentChoice; - MusicXmlVersion musicXmlVersion; - }; - - DocumentSpec parseDocumentSpec( const ::ezxml::XDocCPtr& doc ); - - } -} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/ElementInterface.cpp b/Sourcecode/private/mx/core/ElementInterface.cpp index 6c11eec25..77b870f40 100644 --- a/Sourcecode/private/mx/core/ElementInterface.cpp +++ b/Sourcecode/private/mx/core/ElementInterface.cpp @@ -10,313 +10,296 @@ namespace mx { - namespace core - { - const char* INDENT = " "; - - ElementInterface::ElementInterface() - { +namespace core +{ +const char *INDENT = " "; - } - - ElementInterface::~ElementInterface() - { +ElementInterface::ElementInterface() +{ +} - } - - - std::ostream& ElementInterface::streamOpenTag( std::ostream& os ) const - { - os << "<"; - this->streamName( os ); - if ( hasAttributes() ) - { - streamAttributes( os ); - } - os << ">"; - return os; - } +ElementInterface::~ElementInterface() +{ +} +std::ostream &ElementInterface::streamOpenTag(std::ostream &os) const +{ + os << "<"; + this->streamName(os); + if (hasAttributes()) + { + streamAttributes(os); + } + os << ">"; + return os; +} - std::ostream& ElementInterface::streamCloseTag( std::ostream& os ) const - { - os << "streamName( os ); - os << ">"; - return os; - } +std::ostream &ElementInterface::streamCloseTag(std::ostream &os) const +{ + os << "streamName(os); + os << ">"; + return os; +} +std::ostream &ElementInterface::streamSelfCloseTag(std::ostream &os) const +{ + os << "<"; + this->streamName(os); + if (hasAttributes()) + { + streamAttributes(os); + } + os << "/>"; + return os; +} - std::ostream& ElementInterface::streamSelfCloseTag( std::ostream& os ) const - { - os << "<"; - this->streamName( os ); - if ( hasAttributes() ) - { - streamAttributes( os ); - } - os << "/>"; - return os; - } - bool ElementInterface::hasContents() const - { - std::stringstream ss; - bool discard; - streamContents( ss, 0, discard ); - return ( ss.str() ).length() > 0; - } +bool ElementInterface::hasContents() const +{ + std::stringstream ss; + bool discard; + streamContents(ss, 0, discard); + return (ss.str()).length() > 0; +} +std::ostream &ElementInterface::toStream(std::ostream &os, const int indentLevel) const +{ + indent(os, indentLevel); - std::ostream& ElementInterface::toStream( std::ostream& os, const int indentLevel ) const - { - indent( os, indentLevel ); + if (myProcessingInstructions.empty()) + { + return streamWithoutProcessingInstructions(os, indentLevel); + } + else + { + std::stringstream ss; + streamWithoutProcessingInstructions(ss, 0); + const auto xml = ss.str(); + std::istringstream iss{xml}; + const auto xdoc = ::ezxml::XFactory::makeXDoc(); + xdoc->loadStream(iss); + const auto root = xdoc->getRoot(); + const bool hasChildren = root->getType() == ::ezxml::XElementType::element && root->begin() != root->end(); + streamWithProcessingInstructions(os, indentLevel, hasChildren); + } - if( myProcessingInstructions.empty() ) - { - return streamWithoutProcessingInstructions( os, indentLevel ); - } - else - { - std::stringstream ss; - streamWithoutProcessingInstructions( ss, 0 ); - const auto xml = ss.str(); - std::istringstream iss{ xml }; - const auto xdoc = ::ezxml::XFactory::makeXDoc(); - xdoc->loadStream( iss ); - const auto root = xdoc->getRoot(); - const bool hasChildren = root->getType() == ::ezxml::XElementType::element && root->begin() != root->end(); - streamWithProcessingInstructions( os, indentLevel, hasChildren ); - } + return os; +} - return os; - } - - - const std::string ElementInterface::getElementName() const - { - std::stringstream ss; - this->streamName( ss ); - return ss.str(); - } +const std::string ElementInterface::getElementName() const +{ + std::stringstream ss; + this->streamName(ss); + return ss.str(); +} +std::ostream &indent(std::ostream &os, const int indentLevel) +{ + for (int i = 0; i < indentLevel; ++i) + { + os << INDENT; + } + return os; +} - std::ostream& indent( std::ostream& os, const int indentLevel ) - { - for ( int i = 0; i < indentLevel; ++i ) - { - os << INDENT; - } - return os; - } - - - bool ElementInterface::hasAttributes() const - { - return false; - } +bool ElementInterface::hasAttributes() const +{ + return false; +} +bool ElementInterface::fromXElement(std::ostream &message, ::ezxml::XElement &xelement) +{ + if (xelement.getIsProcessingInstruction()) + { + const auto next = xelement.getNextSibling(); - bool ElementInterface::fromXElement( std::ostream& message, ::ezxml::XElement& xelement ) + if (next) { - if( xelement.getIsProcessingInstruction() ) - { - const auto next = xelement.getNextSibling(); + return this->fromXElement(message, *next); + } + } - if( next ) - { - return this->fromXElement( message, *next ); - } - } - - const bool result = this->fromXElementImpl( message, xelement ); + const bool result = this->fromXElementImpl(message, xelement); - // check for processing instructions - - if( xelement.getType() == ezxml::XElementType::element ) - { - auto childIter = xelement.beginWithProcessingInstructions(); - const auto childEnd = xelement.end(); - - while( childIter != childEnd && childIter->getIsProcessingInstruction() ) - { - // inexplicably, the following line caused a bad address crash on msvc - // ProcessingInstruction pi{ childIter->getName(), childIter->getValue() }; - // surely this is an msvc compiler bug? prove me wrong. anyway, we store - // the getName() and getValue() results in short-lived variables to work - // around the windows issue. - auto name = childIter->getName(); - auto value = childIter->getValue(); - ProcessingInstruction pi{ name, value }; - pi.setIsChild( true ); - addProcessingInstruction( std::move( pi ) ); - ++childIter; - } - } - - auto lookahead = xelement.getNextSibling(); - - while( lookahead != nullptr && lookahead->getIsProcessingInstruction() ) - { - ProcessingInstruction pi{ lookahead->getName(), lookahead->getValue() }; - pi.setIsChild( false ); - addProcessingInstruction( std::move( pi ) ); - lookahead = lookahead->getNextSibling(); - } - - return result; - } + // check for processing instructions + if (xelement.getType() == ezxml::XElementType::element) + { + auto childIter = xelement.beginWithProcessingInstructions(); + const auto childEnd = xelement.end(); - const ProcessingInstructions& ElementInterface::getProcessingInstructions() const + while (childIter != childEnd && childIter->getIsProcessingInstruction()) { - return myProcessingInstructions; + // inexplicably, the following line caused a bad address crash on msvc + // ProcessingInstruction pi{ childIter->getName(), childIter->getValue() }; + // surely this is an msvc compiler bug? prove me wrong. anyway, we store + // the getName() and getValue() results in short-lived variables to work + // around the windows issue. + auto name = childIter->getName(); + auto value = childIter->getValue(); + ProcessingInstruction pi{name, value}; + pi.setIsChild(true); + addProcessingInstruction(std::move(pi)); + ++childIter; } + } + auto lookahead = xelement.getNextSibling(); - void ElementInterface::clearProcessingInstructions() - { - myProcessingInstructions.clear(); - } + while (lookahead != nullptr && lookahead->getIsProcessingInstruction()) + { + ProcessingInstruction pi{lookahead->getName(), lookahead->getValue()}; + pi.setIsChild(false); + addProcessingInstruction(std::move(pi)); + lookahead = lookahead->getNextSibling(); + } + return result; +} - void ElementInterface::addProcessingInstruction( ProcessingInstruction inProcessingInstruction ) - { - myProcessingInstructions.emplace_back( std::move( inProcessingInstruction ) ); - } +const ProcessingInstructions &ElementInterface::getProcessingInstructions() const +{ + return myProcessingInstructions; +} +void ElementInterface::clearProcessingInstructions() +{ + myProcessingInstructions.clear(); +} - std::ostream& operator<<( std::ostream& os, const ElementInterface& value ) - { - return value.toStream( os, 0 ); - } +void ElementInterface::addProcessingInstruction(ProcessingInstruction inProcessingInstruction) +{ + myProcessingInstructions.emplace_back(std::move(inProcessingInstruction)); +} +std::ostream &operator<<(std::ostream &os, const ElementInterface &value) +{ + return value.toStream(os, 0); +} - std::ostream& ElementInterface::writeChildProcessingInstructions( std::ostream& os, const int indentLevel ) const - { - bool isFirst = true; +std::ostream &ElementInterface::writeChildProcessingInstructions(std::ostream &os, const int indentLevel) const +{ + bool isFirst = true; - for( const auto& pi : myProcessingInstructions ) + for (const auto &pi : myProcessingInstructions) + { + if (pi.getIsChild()) + { + if (!isFirst) { - if( pi.getIsChild() ) - { - if (!isFirst) - { - os << std::endl; - } - indent( os, indentLevel + 1 ); - pi.toStream( os ); - isFirst = false; - } + os << std::endl; } - - return os; + indent(os, indentLevel + 1); + pi.toStream(os); + isFirst = false; } + } + return os; +} - std::ostream& ElementInterface::writeSiblingProcessingInstructions( std::ostream& os, const int indentLevel ) const - { - bool isFirst = true; +std::ostream &ElementInterface::writeSiblingProcessingInstructions(std::ostream &os, const int indentLevel) const +{ + bool isFirst = true; - for( const auto& pi : myProcessingInstructions ) + for (const auto &pi : myProcessingInstructions) + { + if (!pi.getIsChild()) + { + if (!isFirst) { - if( !pi.getIsChild() ) - { - if (!isFirst) - { - os << std::endl; - } - indent( os, indentLevel ); - pi.toStream( os ); - isFirst = false; - } + os << std::endl; } - - return os; + indent(os, indentLevel); + pi.toStream(os); + isFirst = false; } + } + return os; +} + +std::ostream &ElementInterface::writeAllProcessingInstructions(std::ostream &os, const int indentLevel) const +{ + bool isFirst = true; - std::ostream& ElementInterface::writeAllProcessingInstructions( std::ostream& os, const int indentLevel ) const + for (const auto &pi : myProcessingInstructions) + { + if (!isFirst) { - bool isFirst = true; + os << std::endl; + } + indent(os, indentLevel); + pi.toStream(os); + isFirst = false; + } - for( const auto& pi : myProcessingInstructions ) - { - if (!isFirst) - { - os << std::endl; - } - indent( os, indentLevel ); - pi.toStream( os ); - isFirst = false; - } + return os; +} - return os; +std::ostream &ElementInterface::streamWithoutProcessingInstructions(std::ostream &os, const int indentLevel) const +{ + const bool isSelfClosing = !hasContents(); + + if (!isSelfClosing) + { + streamOpenTag(os); + bool isOneLineOnly = false; + streamContents(os, indentLevel, isOneLineOnly); + if (!isOneLineOnly) + { + indent(os, indentLevel); } + streamCloseTag(os); + } + else + { + streamSelfCloseTag(os); + } + return os; +} + +std::ostream &ElementInterface::streamWithProcessingInstructions(std::ostream &os, const int indentLevel, + const bool inHasChildren) const +{ + const bool isSelfClosing = !hasContents(); + if (!isSelfClosing) + { + streamOpenTag(os); + bool isOneLineOnly = false; - std::ostream& ElementInterface::streamWithoutProcessingInstructions( std::ostream& os, const int indentLevel ) const + if (inHasChildren) { - const bool isSelfClosing = !hasContents(); - - if ( !isSelfClosing ) - { - streamOpenTag( os ); - bool isOneLineOnly = false; - streamContents( os, indentLevel, isOneLineOnly ); - if ( !isOneLineOnly ) - { - indent( os, indentLevel ); - } - streamCloseTag( os ); - } - else - { - streamSelfCloseTag( os ); - } - return os; + writeChildProcessingInstructions(os, indentLevel); } + streamContents(os, indentLevel, isOneLineOnly); - std::ostream& ElementInterface::streamWithProcessingInstructions( std::ostream& os, const int indentLevel, const bool inHasChildren ) const + if (!isOneLineOnly) { - const bool isSelfClosing = !hasContents(); + indent(os, indentLevel); + } + streamCloseTag(os); - if ( !isSelfClosing ) - { - streamOpenTag( os ); - bool isOneLineOnly = false; - - if( inHasChildren ) - { - writeChildProcessingInstructions( os, indentLevel ); - } - - streamContents( os, indentLevel, isOneLineOnly ); - - if ( !isOneLineOnly ) - { - indent( os, indentLevel ); - } - streamCloseTag( os ); - - if( inHasChildren ) - { - os << std::endl; - writeSiblingProcessingInstructions( os, indentLevel ); - } - else - { - os << std::endl; - writeAllProcessingInstructions( os, indentLevel ); - } - } - else - { - streamSelfCloseTag( os ); - os << std::endl; - writeAllProcessingInstructions( os, indentLevel ); - } - return os; + if (inHasChildren) + { + os << std::endl; + writeSiblingProcessingInstructions(os, indentLevel); } + else + { + os << std::endl; + writeAllProcessingInstructions(os, indentLevel); + } + } + else + { + streamSelfCloseTag(os); + os << std::endl; + writeAllProcessingInstructions(os, indentLevel); } + return os; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/ElementInterface.h b/Sourcecode/private/mx/core/ElementInterface.h index 3c25364c5..976811f8d 100644 --- a/Sourcecode/private/mx/core/ElementInterface.h +++ b/Sourcecode/private/mx/core/ElementInterface.h @@ -4,61 +4,62 @@ #pragma once -#include -#include -#include "mx/core/UnusedParameter.h" #include "mx/core/AttributesInterface.h" #include "mx/core/ProcessingInstruction.h" +#include "mx/core/UnusedParameter.h" +#include +#include namespace ezxml { - class XElement; +class XElement; } namespace mx { - namespace core - { - // This will be used by toStream to indent the XML tree - extern const char* INDENT; - - class ElementInterface; - using ElementPtr = std::shared_ptr; - using ElementUPtr = std::unique_ptr; - - class ElementInterface - { - public: - ElementInterface(); - virtual ~ElementInterface(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const = 0; - virtual std::ostream& streamName( std::ostream& os ) const = 0; - virtual bool hasContents() const = 0; // if this returns false then self-closing tag will be created - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const = 0; - virtual std::ostream& streamOpenTag( std::ostream& os ) const; - virtual std::ostream& streamCloseTag( std::ostream& os ) const; - virtual std::ostream& streamSelfCloseTag( std::ostream& os ) const; - virtual std::ostream& toStream( std::ostream& os, const int indentLevel ) const; - virtual const std::string getElementName() const; - virtual bool fromXElement( std::ostream& message, ezxml::XElement& xelement ) final; - virtual const ProcessingInstructions& getProcessingInstructions() const final; - virtual void clearProcessingInstructions() final; - virtual void addProcessingInstruction( ProcessingInstruction inProcessingInstruction ) final; +namespace core +{ +// This will be used by toStream to indent the XML tree +extern const char *INDENT; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) = 0; +class ElementInterface; +using ElementPtr = std::shared_ptr; +using ElementUPtr = std::unique_ptr; - private: - ProcessingInstructions myProcessingInstructions; - std::ostream& writeChildProcessingInstructions( std::ostream& os, const int indentLevel ) const; - std::ostream& writeSiblingProcessingInstructions( std::ostream& os, const int indentLevel ) const; - std::ostream& writeAllProcessingInstructions( std::ostream& os, const int indentLevel ) const; - std::ostream& streamWithoutProcessingInstructions( std::ostream& os, const int indentLevel ) const; - std::ostream& streamWithProcessingInstructions( std::ostream& os, const int indentLevel, const bool inHasChildren ) const; - }; - - std::ostream& indent( std::ostream& os, const int indentLevel ); - std::ostream& operator<<( std::ostream& os, const ElementInterface& value ); - } -} +class ElementInterface +{ + public: + ElementInterface(); + virtual ~ElementInterface(); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const = 0; + virtual std::ostream &streamName(std::ostream &os) const = 0; + virtual bool hasContents() const = 0; // if this returns false then self-closing tag will be created + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const = 0; + virtual std::ostream &streamOpenTag(std::ostream &os) const; + virtual std::ostream &streamCloseTag(std::ostream &os) const; + virtual std::ostream &streamSelfCloseTag(std::ostream &os) const; + virtual std::ostream &toStream(std::ostream &os, const int indentLevel) const; + virtual const std::string getElementName() const; + virtual bool fromXElement(std::ostream &message, ezxml::XElement &xelement) final; + virtual const ProcessingInstructions &getProcessingInstructions() const final; + virtual void clearProcessingInstructions() final; + virtual void addProcessingInstruction(ProcessingInstruction inProcessingInstruction) final; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) = 0; + + private: + ProcessingInstructions myProcessingInstructions; + std::ostream &writeChildProcessingInstructions(std::ostream &os, const int indentLevel) const; + std::ostream &writeSiblingProcessingInstructions(std::ostream &os, const int indentLevel) const; + std::ostream &writeAllProcessingInstructions(std::ostream &os, const int indentLevel) const; + std::ostream &streamWithoutProcessingInstructions(std::ostream &os, const int indentLevel) const; + std::ostream &streamWithProcessingInstructions(std::ostream &os, const int indentLevel, + const bool inHasChildren) const; +}; + +std::ostream &indent(std::ostream &os, const int indentLevel); +std::ostream &operator<<(std::ostream &os, const ElementInterface &value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Elements.h b/Sourcecode/private/mx/core/Elements.h index 5e6d09077..55c29c6c2 100644 --- a/Sourcecode/private/mx/core/Elements.h +++ b/Sourcecode/private/mx/core/Elements.h @@ -32,12 +32,12 @@ #include "mx/core/elements/Artificial.h" #include "mx/core/elements/AttributesIterface.h" #include "mx/core/elements/Backup.h" +#include "mx/core/elements/BarStyle.h" +#include "mx/core/elements/BarStyleAttributes.h" #include "mx/core/elements/Barline.h" #include "mx/core/elements/BarlineAttributes.h" #include "mx/core/elements/Barre.h" #include "mx/core/elements/BarreAttributes.h" -#include "mx/core/elements/BarStyle.h" -#include "mx/core/elements/BarStyleAttributes.h" #include "mx/core/elements/BasePitch.h" #include "mx/core/elements/Bass.h" #include "mx/core/elements/BassAlter.h" @@ -46,17 +46,17 @@ #include "mx/core/elements/BassStepAttributes.h" #include "mx/core/elements/Beam.h" #include "mx/core/elements/BeamAttributes.h" -#include "mx/core/elements/Beater.h" -#include "mx/core/elements/BeaterAttributes.h" #include "mx/core/elements/BeatRepeat.h" #include "mx/core/elements/BeatRepeatAttributes.h" -#include "mx/core/elements/Beats.h" #include "mx/core/elements/BeatType.h" #include "mx/core/elements/BeatUnit.h" #include "mx/core/elements/BeatUnitDot.h" #include "mx/core/elements/BeatUnitGroup.h" #include "mx/core/elements/BeatUnitPer.h" #include "mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h" +#include "mx/core/elements/Beater.h" +#include "mx/core/elements/BeaterAttributes.h" +#include "mx/core/elements/Beats.h" #include "mx/core/elements/Bend.h" #include "mx/core/elements/BendAlter.h" #include "mx/core/elements/BendAttributes.h" @@ -134,8 +134,8 @@ #include "mx/core/elements/Dynamics.h" #include "mx/core/elements/DynamicsAttributes.h" #include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/EditorialVoiceGroup.h" #include "mx/core/elements/EditorialVoiceDirectionGroup.h" +#include "mx/core/elements/EditorialVoiceGroup.h" #include "mx/core/elements/Effect.h" #include "mx/core/elements/Elevation.h" #include "mx/core/elements/Elision.h" @@ -152,10 +152,10 @@ #include "mx/core/elements/EncodingChoice.h" #include "mx/core/elements/EncodingDate.h" #include "mx/core/elements/EncodingDescription.h" -#include "mx/core/elements/Ending.h" -#include "mx/core/elements/EndingAttributes.h" #include "mx/core/elements/EndLine.h" #include "mx/core/elements/EndParagraph.h" +#include "mx/core/elements/Ending.h" +#include "mx/core/elements/EndingAttributes.h" #include "mx/core/elements/Ensemble.h" #include "mx/core/elements/Extend.h" #include "mx/core/elements/ExtendAttributes.h" @@ -167,10 +167,10 @@ #include "mx/core/elements/FermataAttributes.h" #include "mx/core/elements/Fifths.h" #include "mx/core/elements/Figure.h" -#include "mx/core/elements/FiguredBass.h" -#include "mx/core/elements/FiguredBassAttributes.h" #include "mx/core/elements/FigureNumber.h" #include "mx/core/elements/FigureNumberAttributes.h" +#include "mx/core/elements/FiguredBass.h" +#include "mx/core/elements/FiguredBassAttributes.h" #include "mx/core/elements/Fingering.h" #include "mx/core/elements/FingeringAttributes.h" #include "mx/core/elements/Fingernails.h" @@ -203,8 +203,6 @@ #include "mx/core/elements/GroupAbbreviationDisplayAttributes.h" #include "mx/core/elements/GroupBarline.h" #include "mx/core/elements/GroupBarlineAttributes.h" -#include "mx/core/elements/Grouping.h" -#include "mx/core/elements/GroupingAttributes.h" #include "mx/core/elements/GroupName.h" #include "mx/core/elements/GroupNameAttributes.h" #include "mx/core/elements/GroupNameDisplay.h" @@ -212,6 +210,8 @@ #include "mx/core/elements/GroupSymbol.h" #include "mx/core/elements/GroupSymbolAttributes.h" #include "mx/core/elements/GroupTime.h" +#include "mx/core/elements/Grouping.h" +#include "mx/core/elements/GroupingAttributes.h" #include "mx/core/elements/HammerOn.h" #include "mx/core/elements/HammerOnAttributes.h" #include "mx/core/elements/Handbell.h" @@ -241,8 +241,8 @@ #include "mx/core/elements/InstrumentAbbreviation.h" #include "mx/core/elements/InstrumentAttributes.h" #include "mx/core/elements/InstrumentName.h" -#include "mx/core/elements/Instruments.h" #include "mx/core/elements/InstrumentSound.h" +#include "mx/core/elements/Instruments.h" #include "mx/core/elements/Interchangeable.h" #include "mx/core/elements/InterchangeableAttributes.h" #include "mx/core/elements/Inversion.h" @@ -343,13 +343,13 @@ #include "mx/core/elements/Note.h" #include "mx/core/elements/NoteAttributes.h" #include "mx/core/elements/NoteChoice.h" +#include "mx/core/elements/NoteRelationNote.h" +#include "mx/core/elements/NoteSize.h" +#include "mx/core/elements/NoteSizeAttributes.h" #include "mx/core/elements/Notehead.h" #include "mx/core/elements/NoteheadAttributes.h" #include "mx/core/elements/NoteheadText.h" #include "mx/core/elements/NoteheadTextChoice.h" -#include "mx/core/elements/NoteRelationNote.h" -#include "mx/core/elements/NoteSize.h" -#include "mx/core/elements/NoteSizeAttributes.h" #include "mx/core/elements/Octave.h" #include "mx/core/elements/OctaveChange.h" #include "mx/core/elements/OctaveShift.h" @@ -404,12 +404,12 @@ #include "mx/core/elements/PedalAttributes.h" #include "mx/core/elements/PedalStep.h" #include "mx/core/elements/PedalTuning.h" -#include "mx/core/elements/Percussion.h" -#include "mx/core/elements/PercussionAttributes.h" -#include "mx/core/elements/PercussionChoice.h" #include "mx/core/elements/PerMinute.h" #include "mx/core/elements/PerMinuteAttributes.h" #include "mx/core/elements/PerMinuteOrBeatUnitChoice.h" +#include "mx/core/elements/Percussion.h" +#include "mx/core/elements/PercussionAttributes.h" +#include "mx/core/elements/PercussionChoice.h" #include "mx/core/elements/Pitch.h" #include "mx/core/elements/Pitched.h" #include "mx/core/elements/Play.h" diff --git a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp b/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp index 6521a894a..0c2faa32d 100644 --- a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp +++ b/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp @@ -7,101 +7,105 @@ namespace mx { - namespace core +namespace core +{ +EmptyPrintObjectStyleAlignAttributes::EmptyPrintObjectStyleAlignAttributes() + : printObject(YesNo::yes), defaultX(0.0), defaultY(0.0), relativeX(0.0), relativeY(0.0), fontFamily(""), + fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), fontWeight(FontWeight::bold), color(255, 255, 255), + halign(LeftCenterRight::center), valign(Valign::top), hasPrintObject(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasColor(false), hasHalign(false), hasValign(false) +{ +} + +bool EmptyPrintObjectStyleAlignAttributes::hasValues() const +{ + return hasPrintObject || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight || hasColor || hasHalign || hasValign; +} + +std::ostream &EmptyPrintObjectStyleAlignAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - EmptyPrintObjectStyleAlignAttributes::EmptyPrintObjectStyleAlignAttributes() - :printObject( YesNo::yes ) - ,defaultX( 0.0 ) - ,defaultY( 0.0 ) - ,relativeX( 0.0 ) - ,relativeY( 0.0 ) - ,fontFamily( "" ) - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::bold ) - ,color( 255, 255, 255 ) - ,halign( LeftCenterRight::center ) - ,valign( Valign::top ) - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - {} + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, valign, "valign", hasValign); + } + return os; +} + +bool EmptyPrintObjectStyleAlignAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "EmptyPrintObjectStyleAlignAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool EmptyPrintObjectStyleAlignAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - return hasPrintObject - || hasDefaultX - || hasDefaultY - || hasRelativeX - || hasRelativeY - || hasFontFamily - || hasFontStyle - || hasFontSize - || hasFontWeight - || hasColor - || hasHalign - || hasValign; + continue; } - - - std::ostream& EmptyPrintObjectStyleAlignAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - } - return os; + continue; } - - - bool EmptyPrintObjectStyleAlignAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "EmptyPrintObjectStyleAlignAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, valign, hasValign, "valign", &parseValign)) + { + continue; } } + + MX_RETURN_IS_SUCCESS; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h b/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h index 1001e67b2..1d80e2566 100644 --- a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h +++ b/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h @@ -4,53 +4,53 @@ #pragma once #include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" +#include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" +#include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" -#include "mx/core/Color.h" namespace mx { - namespace core - { - struct EmptyPrintObjectStyleAlignAttributes; - using EmptyPrintObjectStyleAlignAttributesPtr = std::shared_ptr; - - struct EmptyPrintObjectStyleAlignAttributes : public AttributesInterface - { - public: - EmptyPrintObjectStyleAlignAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; +namespace core +{ +struct EmptyPrintObjectStyleAlignAttributes; +using EmptyPrintObjectStyleAlignAttributesPtr = std::shared_ptr; + +struct EmptyPrintObjectStyleAlignAttributes : public AttributesInterface +{ + public: + EmptyPrintObjectStyleAlignAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + + YesNo printObject; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + LeftCenterRight halign; + Valign valign; + + bool hasPrintObject; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasHalign; + bool hasValign; - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/EndingNumber.h b/Sourcecode/private/mx/core/EndingNumber.h index ca22aa1ea..cdd9d9694 100644 --- a/Sourcecode/private/mx/core/EndingNumber.h +++ b/Sourcecode/private/mx/core/EndingNumber.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using EndingNumber = CommaSeparatedListOfPositiveIntegers; - } +namespace core +{ +using EndingNumber = CommaSeparatedListOfPositiveIntegers; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/Enums.cpp b/Sourcecode/private/mx/core/Enums.cpp index cbc51eaa1..1e93f59d4 100644 --- a/Sourcecode/private/mx/core/Enums.cpp +++ b/Sourcecode/private/mx/core/Enums.cpp @@ -10,4156 +10,6964 @@ namespace mx { - namespace core - { - /// AboveBelow ///////////////////////////////////////////////////////////////////////////// - - AboveBelow parseAboveBelow( const std::string& value ) - { - const auto opt = tryParseAboveBelow( value ); - return opt.value_or( AboveBelow::above ); - } - - std::optional tryParseAboveBelow( const std::string& value ) - { - if( value == "above" ) { return AboveBelow::above; } - else if( value == "below" ) { return AboveBelow::below; } - return std::optional{}; - } - - std::string toString( const AboveBelow value ) - { - switch ( value ) - { - case AboveBelow::above: { return "above"; } - case AboveBelow::below: { return "below"; } - default: break; - } - return "above"; - } - - std::ostream& toStream( std::ostream& os, const AboveBelow value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const AboveBelow value ) - { - return toStream( os, value ); - } - - /// AccidentalValue //////////////////////////////////////////////////////////////////////// - - AccidentalValue parseAccidentalValue( const std::string& value ) - { - const auto opt = tryParseAccidentalValue( value ); - return opt.value_or( AccidentalValue::sharp ); - } - - std::optional tryParseAccidentalValue( const std::string& value ) - { - if( value == "sharp" ) { return AccidentalValue::sharp; } - else if( value == "natural" ) { return AccidentalValue::natural; } - else if( value == "flat" ) { return AccidentalValue::flat; } - else if( value == "double-sharp" ) { return AccidentalValue::doubleSharp; } - else if( value == "sharp-sharp" ) { return AccidentalValue::sharpSharp; } - else if( value == "flat-flat" ) { return AccidentalValue::flatFlat; } - else if( value == "natural-sharp" ) { return AccidentalValue::naturalSharp; } - else if( value == "natural-flat" ) { return AccidentalValue::naturalFlat; } - else if( value == "quarter-flat" ) { return AccidentalValue::quarterFlat; } - else if( value == "quarter-sharp" ) { return AccidentalValue::quarterSharp; } - else if( value == "three-quarters-flat" ) { return AccidentalValue::threeQuartersFlat; } - else if( value == "three-quarters-sharp" ) { return AccidentalValue::threeQuartersSharp; } - else if( value == "sharp-down" ) { return AccidentalValue::sharpDown; } - else if( value == "sharp-up" ) { return AccidentalValue::sharpUp; } - else if( value == "natural-down" ) { return AccidentalValue::naturalDown; } - else if( value == "natural-up" ) { return AccidentalValue::naturalUp; } - else if( value == "flat-down" ) { return AccidentalValue::flatDown; } - else if( value == "flat-up" ) { return AccidentalValue::flatUp; } - else if( value == "triple-sharp" ) { return AccidentalValue::tripleSharp; } - else if( value == "triple-flat" ) { return AccidentalValue::tripleFlat; } - else if( value == "slash-quarter-sharp" ) { return AccidentalValue::slashQuarterSharp; } - else if( value == "slash-sharp" ) { return AccidentalValue::slashSharp; } - else if( value == "slash-flat" ) { return AccidentalValue::slashFlat; } - else if( value == "double-slash-flat" ) { return AccidentalValue::doubleSlashFlat; } - else if( value == "sharp-1" ) { return AccidentalValue::sharp1; } - else if( value == "sharp-2" ) { return AccidentalValue::sharp2; } - else if( value == "sharp-3" ) { return AccidentalValue::sharp3; } - else if( value == "sharp-5" ) { return AccidentalValue::sharp5; } - else if( value == "flat-1" ) { return AccidentalValue::flat1; } - else if( value == "flat-2" ) { return AccidentalValue::flat2; } - else if( value == "flat-3" ) { return AccidentalValue::flat3; } - else if( value == "flat-4" ) { return AccidentalValue::flat4; } - else if( value == "sori" ) { return AccidentalValue::sori; } - else if( value == "koron" ) { return AccidentalValue::koron; } - return std::optional{}; - } - - std::string toString( const AccidentalValue value ) - { - switch ( value ) - { - case AccidentalValue::sharp: { return "sharp"; } - case AccidentalValue::natural: { return "natural"; } - case AccidentalValue::flat: { return "flat"; } - case AccidentalValue::doubleSharp: { return "double-sharp"; } - case AccidentalValue::sharpSharp: { return "sharp-sharp"; } - case AccidentalValue::flatFlat: { return "flat-flat"; } - case AccidentalValue::naturalSharp: { return "natural-sharp"; } - case AccidentalValue::naturalFlat: { return "natural-flat"; } - case AccidentalValue::quarterFlat: { return "quarter-flat"; } - case AccidentalValue::quarterSharp: { return "quarter-sharp"; } - case AccidentalValue::threeQuartersFlat: { return "three-quarters-flat"; } - case AccidentalValue::threeQuartersSharp: { return "three-quarters-sharp"; } - case AccidentalValue::sharpDown: { return "sharp-down"; } - case AccidentalValue::sharpUp: { return "sharp-up"; } - case AccidentalValue::naturalDown: { return "natural-down"; } - case AccidentalValue::naturalUp: { return "natural-up"; } - case AccidentalValue::flatDown: { return "flat-down"; } - case AccidentalValue::flatUp: { return "flat-up"; } - case AccidentalValue::tripleSharp: { return "triple-sharp"; } - case AccidentalValue::tripleFlat: { return "triple-flat"; } - case AccidentalValue::slashQuarterSharp: { return "slash-quarter-sharp"; } - case AccidentalValue::slashSharp: { return "slash-sharp"; } - case AccidentalValue::slashFlat: { return "slash-flat"; } - case AccidentalValue::doubleSlashFlat: { return "double-slash-flat"; } - case AccidentalValue::sharp1: { return "sharp-1"; } - case AccidentalValue::sharp2: { return "sharp-2"; } - case AccidentalValue::sharp3: { return "sharp-3"; } - case AccidentalValue::sharp5: { return "sharp-5"; } - case AccidentalValue::flat1: { return "flat-1"; } - case AccidentalValue::flat2: { return "flat-2"; } - case AccidentalValue::flat3: { return "flat-3"; } - case AccidentalValue::flat4: { return "flat-4"; } - case AccidentalValue::sori: { return "sori"; } - case AccidentalValue::koron: { return "koron"; } - default: break; - } - return "sharp"; - } - - std::ostream& toStream( std::ostream& os, const AccidentalValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const AccidentalValue value ) - { - return toStream( os, value ); - } - - /// ArrowDirectionEnum ///////////////////////////////////////////////////////////////////// - - ArrowDirectionEnum parseArrowDirectionEnum( const std::string& value ) - { - const auto opt = tryParseArrowDirectionEnum( value ); - return opt.value_or( ArrowDirectionEnum::left ); - } - - std::optional tryParseArrowDirectionEnum( const std::string& value ) - { - if( value == "left" ) { return ArrowDirectionEnum::left; } - else if( value == "up" ) { return ArrowDirectionEnum::up; } - else if( value == "right" ) { return ArrowDirectionEnum::right; } - else if( value == "down" ) { return ArrowDirectionEnum::down; } - else if( value == "northwest" ) { return ArrowDirectionEnum::northwest; } - else if( value == "northeast" ) { return ArrowDirectionEnum::northeast; } - else if( value == "southeast" ) { return ArrowDirectionEnum::southeast; } - else if( value == "southwest" ) { return ArrowDirectionEnum::southwest; } - else if( value == "left right" ) { return ArrowDirectionEnum::leftRight; } - else if( value == "up down" ) { return ArrowDirectionEnum::upDown; } - else if( value == "northwest southeast" ) { return ArrowDirectionEnum::northwestSoutheast; } - else if( value == "northeast southwest" ) { return ArrowDirectionEnum::northeastSouthwest; } - else if( value == "other" ) { return ArrowDirectionEnum::other; } - return std::optional{}; - } - - std::string toString( const ArrowDirectionEnum value ) - { - switch ( value ) - { - case ArrowDirectionEnum::left: { return "left"; } - case ArrowDirectionEnum::up: { return "up"; } - case ArrowDirectionEnum::right: { return "right"; } - case ArrowDirectionEnum::down: { return "down"; } - case ArrowDirectionEnum::northwest: { return "northwest"; } - case ArrowDirectionEnum::northeast: { return "northeast"; } - case ArrowDirectionEnum::southeast: { return "southeast"; } - case ArrowDirectionEnum::southwest: { return "southwest"; } - case ArrowDirectionEnum::leftRight: { return "left right"; } - case ArrowDirectionEnum::upDown: { return "up down"; } - case ArrowDirectionEnum::northwestSoutheast: { return "northwest southeast"; } - case ArrowDirectionEnum::northeastSouthwest: { return "northeast southwest"; } - case ArrowDirectionEnum::other: { return "other"; } - default: break; - } - return "left"; - } - - std::ostream& toStream( std::ostream& os, const ArrowDirectionEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ArrowDirectionEnum value ) - { - return toStream( os, value ); - } - - /// ArrowStyleEnum ///////////////////////////////////////////////////////////////////////// - - ArrowStyleEnum parseArrowStyleEnum( const std::string& value ) - { - const auto opt = tryParseArrowStyleEnum( value ); - return opt.value_or( ArrowStyleEnum::single ); - } - - std::optional tryParseArrowStyleEnum( const std::string& value ) - { - if( value == "single" ) { return ArrowStyleEnum::single; } - else if( value == "double" ) { return ArrowStyleEnum::double_; } - else if( value == "filled" ) { return ArrowStyleEnum::filled; } - else if( value == "hollow" ) { return ArrowStyleEnum::hollow; } - else if( value == "paired" ) { return ArrowStyleEnum::paired; } - else if( value == "combined" ) { return ArrowStyleEnum::combined; } - else if( value == "other" ) { return ArrowStyleEnum::other; } - return std::optional{}; - } - - std::string toString( const ArrowStyleEnum value ) - { - switch ( value ) - { - case ArrowStyleEnum::single: { return "single"; } - case ArrowStyleEnum::double_: { return "double"; } - case ArrowStyleEnum::filled: { return "filled"; } - case ArrowStyleEnum::hollow: { return "hollow"; } - case ArrowStyleEnum::paired: { return "paired"; } - case ArrowStyleEnum::combined: { return "combined"; } - case ArrowStyleEnum::other: { return "other"; } - default: break; - } - return "single"; - } - - std::ostream& toStream( std::ostream& os, const ArrowStyleEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ArrowStyleEnum value ) - { - return toStream( os, value ); - } - - /// BackwardForward //////////////////////////////////////////////////////////////////////// - - BackwardForward parseBackwardForward( const std::string& value ) - { - const auto opt = tryParseBackwardForward( value ); - return opt.value_or( BackwardForward::backward ); - } - - std::optional tryParseBackwardForward( const std::string& value ) - { - if( value == "backward" ) { return BackwardForward::backward; } - else if( value == "forward" ) { return BackwardForward::forward; } - return std::optional{}; - } - - std::string toString( const BackwardForward value ) - { - switch ( value ) - { - case BackwardForward::backward: { return "backward"; } - case BackwardForward::forward: { return "forward"; } - default: break; - } - return "backward"; - } - - std::ostream& toStream( std::ostream& os, const BackwardForward value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BackwardForward value ) - { - return toStream( os, value ); - } - - /// BarStyleEnum /////////////////////////////////////////////////////////////////////////// - - BarStyleEnum parseBarStyleEnum( const std::string& value ) - { - const auto opt = tryParseBarStyleEnum( value ); - return opt.value_or( BarStyleEnum::regular ); - } - - std::optional tryParseBarStyleEnum( const std::string& value ) - { - if( value == "regular" ) { return BarStyleEnum::regular; } - else if( value == "dotted" ) { return BarStyleEnum::dotted; } - else if( value == "dashed" ) { return BarStyleEnum::dashed; } - else if( value == "heavy" ) { return BarStyleEnum::heavy; } - else if( value == "light-light" ) { return BarStyleEnum::lightLight; } - else if( value == "light-heavy" ) { return BarStyleEnum::lightHeavy; } - else if( value == "heavy-light" ) { return BarStyleEnum::heavyLight; } - else if( value == "heavy-heavy" ) { return BarStyleEnum::heavyHeavy; } - else if( value == "tick" ) { return BarStyleEnum::tick; } - else if( value == "short" ) { return BarStyleEnum::short_; } - else if( value == "none" ) { return BarStyleEnum::none; } - return std::optional{}; - } - - std::string toString( const BarStyleEnum value ) - { - switch ( value ) - { - case BarStyleEnum::regular: { return "regular"; } - case BarStyleEnum::dotted: { return "dotted"; } - case BarStyleEnum::dashed: { return "dashed"; } - case BarStyleEnum::heavy: { return "heavy"; } - case BarStyleEnum::lightLight: { return "light-light"; } - case BarStyleEnum::lightHeavy: { return "light-heavy"; } - case BarStyleEnum::heavyLight: { return "heavy-light"; } - case BarStyleEnum::heavyHeavy: { return "heavy-heavy"; } - case BarStyleEnum::tick: { return "tick"; } - case BarStyleEnum::short_: { return "short"; } - case BarStyleEnum::none: { return "none"; } - default: break; - } - return "regular"; - } - - std::ostream& toStream( std::ostream& os, const BarStyleEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BarStyleEnum value ) - { - return toStream( os, value ); - } - - /// BeamValue ////////////////////////////////////////////////////////////////////////////// - - BeamValue parseBeamValue( const std::string& value ) - { - const auto opt = tryParseBeamValue( value ); - return opt.value_or( BeamValue::begin ); - } - - std::optional tryParseBeamValue( const std::string& value ) - { - if( value == "begin" ) { return BeamValue::begin; } - else if( value == "continue" ) { return BeamValue::continue_; } - else if( value == "end" ) { return BeamValue::end; } - else if( value == "forward hook" ) { return BeamValue::forwardHook; } - else if( value == "backward hook" ) { return BeamValue::backwardHook; } - return std::optional{}; - } - - std::string toString( const BeamValue value ) - { - switch ( value ) - { - case BeamValue::begin: { return "begin"; } - case BeamValue::continue_: { return "continue"; } - case BeamValue::end: { return "end"; } - case BeamValue::forwardHook: { return "forward hook"; } - case BeamValue::backwardHook: { return "backward hook"; } - default: break; - } - return "begin"; - } - - std::ostream& toStream( std::ostream& os, const BeamValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BeamValue value ) - { - return toStream( os, value ); - } - - /// BeaterValue //////////////////////////////////////////////////////////////////////////// - - BeaterValue parseBeaterValue( const std::string& value ) - { - const auto opt = tryParseBeaterValue( value ); - return opt.value_or( BeaterValue::bow ); - } - - std::optional tryParseBeaterValue( const std::string& value ) - { - if( value == "bow" ) { return BeaterValue::bow; } - else if( value == "chime hammer" ) { return BeaterValue::chimeHammer; } - else if( value == "coin" ) { return BeaterValue::coin; } - else if( value == "finger" ) { return BeaterValue::finger; } - else if( value == "fingernail" ) { return BeaterValue::fingernail; } - else if( value == "fist" ) { return BeaterValue::fist; } - else if( value == "guiro scraper" ) { return BeaterValue::guiroScraper; } - else if( value == "hammer" ) { return BeaterValue::hammer; } - else if( value == "hand" ) { return BeaterValue::hand; } - else if( value == "jazz stick" ) { return BeaterValue::jazzStick; } - else if( value == "knitting needle" ) { return BeaterValue::knittingNeedle; } - else if( value == "metal hammer" ) { return BeaterValue::metalHammer; } - else if( value == "snare stick" ) { return BeaterValue::snareStick; } - else if( value == "spoon mallet" ) { return BeaterValue::spoonMallet; } - else if( value == "triangle beater" ) { return BeaterValue::triangleBeater; } - else if( value == "triangle beater plain" ) { return BeaterValue::triangleBeaterPlain; } - else if( value == "wire brush" ) { return BeaterValue::wireBrush; } - return std::optional{}; - } - - std::string toString( const BeaterValue value ) - { - switch ( value ) - { - case BeaterValue::bow: { return "bow"; } - case BeaterValue::chimeHammer: { return "chime hammer"; } - case BeaterValue::coin: { return "coin"; } - case BeaterValue::finger: { return "finger"; } - case BeaterValue::fingernail: { return "fingernail"; } - case BeaterValue::fist: { return "fist"; } - case BeaterValue::guiroScraper: { return "guiro scraper"; } - case BeaterValue::hammer: { return "hammer"; } - case BeaterValue::hand: { return "hand"; } - case BeaterValue::jazzStick: { return "jazz stick"; } - case BeaterValue::knittingNeedle: { return "knitting needle"; } - case BeaterValue::metalHammer: { return "metal hammer"; } - case BeaterValue::snareStick: { return "snare stick"; } - case BeaterValue::spoonMallet: { return "spoon mallet"; } - case BeaterValue::triangleBeater: { return "triangle beater"; } - case BeaterValue::triangleBeaterPlain: { return "triangle beater plain"; } - case BeaterValue::wireBrush: { return "wire brush"; } - default: break; - } - return "bow"; - } - - std::ostream& toStream( std::ostream& os, const BeaterValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BeaterValue value ) - { - return toStream( os, value ); - } - - /// BreathMarkValue //////////////////////////////////////////////////////////////////////// - - BreathMarkValue parseBreathMarkValue( const std::string& value ) - { - const auto opt = tryParseBreathMarkValue( value ); - return opt.value_or( BreathMarkValue::emptystring ); - } - - std::optional tryParseBreathMarkValue( const std::string& value ) - { - if( value == "" ) { return BreathMarkValue::emptystring; } - else if( value == "comma" ) { return BreathMarkValue::comma; } - else if( value == "tick" ) { return BreathMarkValue::tick; } - return std::optional{}; - } - - std::string toString( const BreathMarkValue value ) - { - switch ( value ) - { - case BreathMarkValue::emptystring: { return ""; } - case BreathMarkValue::comma: { return "comma"; } - case BreathMarkValue::tick: { return "tick"; } - default: break; - } - return ""; - } - - std::ostream& toStream( std::ostream& os, const BreathMarkValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BreathMarkValue value ) - { - return toStream( os, value ); - } - - /// CancelLocation ///////////////////////////////////////////////////////////////////////// - - CancelLocation parseCancelLocation( const std::string& value ) - { - const auto opt = tryParseCancelLocation( value ); - return opt.value_or( CancelLocation::left ); - } - - std::optional tryParseCancelLocation( const std::string& value ) - { - if( value == "left" ) { return CancelLocation::left; } - else if( value == "right" ) { return CancelLocation::right; } - else if( value == "before-barline" ) { return CancelLocation::beforeBarline; } - return std::optional{}; - } - - std::string toString( const CancelLocation value ) - { - switch ( value ) - { - case CancelLocation::left: { return "left"; } - case CancelLocation::right: { return "right"; } - case CancelLocation::beforeBarline: { return "before-barline"; } - default: break; - } - return "left"; - } - - std::ostream& toStream( std::ostream& os, const CancelLocation value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const CancelLocation value ) - { - return toStream( os, value ); - } - - /// CircularArrowEnum ////////////////////////////////////////////////////////////////////// - - CircularArrowEnum parseCircularArrowEnum( const std::string& value ) - { - const auto opt = tryParseCircularArrowEnum( value ); - return opt.value_or( CircularArrowEnum::clockwise ); - } - - std::optional tryParseCircularArrowEnum( const std::string& value ) - { - if( value == "clockwise" ) { return CircularArrowEnum::clockwise; } - else if( value == "anticlockwise" ) { return CircularArrowEnum::anticlockwise; } - return std::optional{}; - } - - std::string toString( const CircularArrowEnum value ) - { - switch ( value ) - { - case CircularArrowEnum::clockwise: { return "clockwise"; } - case CircularArrowEnum::anticlockwise: { return "anticlockwise"; } - default: break; - } - return "clockwise"; - } - - std::ostream& toStream( std::ostream& os, const CircularArrowEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const CircularArrowEnum value ) - { - return toStream( os, value ); - } - - /// ClefSign /////////////////////////////////////////////////////////////////////////////// - - ClefSign parseClefSign( const std::string& value ) - { - const auto opt = tryParseClefSign( value ); - return opt.value_or( ClefSign::g ); - } - - std::optional tryParseClefSign( const std::string& value ) - { - if( value == "G" ) { return ClefSign::g; } - else if( value == "F" ) { return ClefSign::f; } - else if( value == "C" ) { return ClefSign::c; } - else if( value == "percussion" ) { return ClefSign::percussion; } - else if( value == "TAB" ) { return ClefSign::tab; } - else if( value == "jianpu" ) { return ClefSign::jianpu; } - else if( value == "none" ) { return ClefSign::none; } - return std::optional{}; - } - - std::string toString( const ClefSign value ) - { - switch ( value ) - { - case ClefSign::g: { return "G"; } - case ClefSign::f: { return "F"; } - case ClefSign::c: { return "C"; } - case ClefSign::percussion: { return "percussion"; } - case ClefSign::tab: { return "TAB"; } - case ClefSign::jianpu: { return "jianpu"; } - case ClefSign::none: { return "none"; } - default: break; - } - return "G"; - } - - std::ostream& toStream( std::ostream& os, const ClefSign value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ClefSign value ) - { - return toStream( os, value ); - } - - /// CssFontSize //////////////////////////////////////////////////////////////////////////// - - CssFontSize parseCssFontSize( const std::string& value ) - { - const auto opt = tryParseCssFontSize( value ); - return opt.value_or( CssFontSize::xxSmall ); - } - - std::optional tryParseCssFontSize( const std::string& value ) - { - if( value == "xx-small" ) { return CssFontSize::xxSmall; } - else if( value == "x-small" ) { return CssFontSize::xSmall; } - else if( value == "small" ) { return CssFontSize::small; } - else if( value == "medium" ) { return CssFontSize::medium; } - else if( value == "large" ) { return CssFontSize::large; } - else if( value == "x-large" ) { return CssFontSize::xLarge; } - else if( value == "xx-large" ) { return CssFontSize::xxLarge; } - return std::optional{}; - } - - std::string toString( const CssFontSize value ) - { - switch ( value ) - { - case CssFontSize::xxSmall: { return "xx-small"; } - case CssFontSize::xSmall: { return "x-small"; } - case CssFontSize::small: { return "small"; } - case CssFontSize::medium: { return "medium"; } - case CssFontSize::large: { return "large"; } - case CssFontSize::xLarge: { return "x-large"; } - case CssFontSize::xxLarge: { return "xx-large"; } - default: break; - } - return "xx-small"; - } - - std::ostream& toStream( std::ostream& os, const CssFontSize value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const CssFontSize value ) - { - return toStream( os, value ); - } - - /// DegreeSymbolValue ////////////////////////////////////////////////////////////////////// - - DegreeSymbolValue parseDegreeSymbolValue( const std::string& value ) - { - const auto opt = tryParseDegreeSymbolValue( value ); - return opt.value_or( DegreeSymbolValue::major ); - } - - std::optional tryParseDegreeSymbolValue( const std::string& value ) - { - if( value == "major" ) { return DegreeSymbolValue::major; } - else if( value == "minor" ) { return DegreeSymbolValue::minor; } - else if( value == "augmented" ) { return DegreeSymbolValue::augmented; } - else if( value == "diminished" ) { return DegreeSymbolValue::diminished; } - else if( value == "half-diminished" ) { return DegreeSymbolValue::halfDiminished; } - return std::optional{}; - } - - std::string toString( const DegreeSymbolValue value ) - { - switch ( value ) - { - case DegreeSymbolValue::major: { return "major"; } - case DegreeSymbolValue::minor: { return "minor"; } - case DegreeSymbolValue::augmented: { return "augmented"; } - case DegreeSymbolValue::diminished: { return "diminished"; } - case DegreeSymbolValue::halfDiminished: { return "half-diminished"; } - default: break; - } - return "major"; - } - - std::ostream& toStream( std::ostream& os, const DegreeSymbolValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DegreeSymbolValue value ) - { - return toStream( os, value ); - } - - /// DegreeTypeValue //////////////////////////////////////////////////////////////////////// - - DegreeTypeValue parseDegreeTypeValue( const std::string& value ) - { - const auto opt = tryParseDegreeTypeValue( value ); - return opt.value_or( DegreeTypeValue::add ); - } - - std::optional tryParseDegreeTypeValue( const std::string& value ) - { - if( value == "add" ) { return DegreeTypeValue::add; } - else if( value == "alter" ) { return DegreeTypeValue::alter; } - else if( value == "subtract" ) { return DegreeTypeValue::subtract; } - return std::optional{}; - } - - std::string toString( const DegreeTypeValue value ) - { - switch ( value ) - { - case DegreeTypeValue::add: { return "add"; } - case DegreeTypeValue::alter: { return "alter"; } - case DegreeTypeValue::subtract: { return "subtract"; } - default: break; - } - return "add"; - } - - std::ostream& toStream( std::ostream& os, const DegreeTypeValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DegreeTypeValue value ) - { - return toStream( os, value ); - } - - /// DistanceTypeEnum /////////////////////////////////////////////////////////////////////// - - DistanceTypeEnum parseDistanceTypeEnum( const std::string& value ) - { - const auto opt = tryParseDistanceTypeEnum( value ); - return opt.value_or( DistanceTypeEnum::beam ); - } - - std::optional tryParseDistanceTypeEnum( const std::string& value ) - { - if( value == "beam" ) { return DistanceTypeEnum::beam; } - else if( value == "hyphen" ) { return DistanceTypeEnum::hyphen; } - else if( value == "other" ) { return DistanceTypeEnum::other; } - return std::optional{}; - } - - std::string toString( const DistanceTypeEnum value ) - { - switch ( value ) - { - case DistanceTypeEnum::beam: { return "beam"; } - case DistanceTypeEnum::hyphen: { return "hyphen"; } - default: break; - } - return "other"; - } - - std::ostream& toStream( std::ostream& os, const DistanceTypeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DistanceTypeEnum value ) - { - return toStream( os, value ); - } - - DistanceType::DistanceType( const DistanceTypeEnum value ) - : myEnum( value ) - , myCustomValue( "" ) - { - setValue( value ); - } - - DistanceType::DistanceType( const std::string& value ) - : myEnum( DistanceTypeEnum::other ) - , myCustomValue( value ) - { - setValue( value ); - } - - DistanceType::DistanceType() - : myEnum( DistanceTypeEnum::beam ) - , myCustomValue( "" ) - { - setValue( DistanceTypeEnum::beam ); - } - - DistanceTypeEnum DistanceType::getValue() const - { - return myEnum; - } - - std::string DistanceType::getValueString() const - { - if ( myEnum != DistanceTypeEnum::other ) - { - return toString( myEnum ); - } - - else - { - return myCustomValue; - } - } - - void DistanceType::setValue( const DistanceTypeEnum value ) - { - myEnum = value; - if( value != DistanceTypeEnum::other && !myCustomValue.empty() ) - { - myCustomValue = ""; - } - } - - void DistanceType::setValue( const std::string& value ) - { - const auto temp = tryParseDistanceTypeEnum( value ); - if ( temp ) - { - myEnum = temp.value(); - myCustomValue = ""; - } - else - { - setValue( DistanceTypeEnum::other ); - myCustomValue = value; - } - } - - DistanceType parseDistanceType( const std::string& value ) - { - return DistanceType( value ); - } - - std::string toString( const DistanceType& value ) - { - return value.getValueString(); - } - - std::ostream& toStream( std::ostream& os, const DistanceType& value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DistanceType& value ) - { - return toStream( os, value ); - } - - /// DynamicsEnum /////////////////////////////////////////////////////////////////////////// - - DynamicsEnum parseDynamicsEnum( const std::string& value ) - { - const auto opt = tryParseDynamicsEnum( value ); - return opt.value_or( DynamicsEnum::mf ); - } - - std::optional tryParseDynamicsEnum( const std::string& value ) - { - if( value == "p" ) { return DynamicsEnum::p; } - else if( value == "pp" ) { return DynamicsEnum::pp; } - else if( value == "ppp" ) { return DynamicsEnum::ppp; } - else if( value == "pppp" ) { return DynamicsEnum::pppp; } - else if( value == "ppppp" ) { return DynamicsEnum::ppppp; } - else if( value == "pppppp" ) { return DynamicsEnum::pppppp; } - else if( value == "f" ) { return DynamicsEnum::f; } - else if( value == "ff" ) { return DynamicsEnum::ff; } - else if( value == "fff" ) { return DynamicsEnum::fff; } - else if( value == "ffff" ) { return DynamicsEnum::ffff; } - else if( value == "fffff" ) { return DynamicsEnum::fffff; } - else if( value == "ffffff" ) { return DynamicsEnum::ffffff; } - else if( value == "mp" ) { return DynamicsEnum::mp; } - else if( value == "mf" ) { return DynamicsEnum::mf; } - else if( value == "sf" ) { return DynamicsEnum::sf; } - else if( value == "sfp" ) { return DynamicsEnum::sfp; } - else if( value == "sfpp" ) { return DynamicsEnum::sfpp; } - else if( value == "fp" ) { return DynamicsEnum::fp; } - else if( value == "rf" ) { return DynamicsEnum::rf; } - else if( value == "rfz" ) { return DynamicsEnum::rfz; } - else if( value == "sfz" ) { return DynamicsEnum::sfz; } - else if( value == "sffz" ) { return DynamicsEnum::sffz; } - else if( value == "fz" ) { return DynamicsEnum::fz; } - else if( value == "other-dynamics" ) { return DynamicsEnum::otherDynamics; } - return std::optional{}; - } - - std::string toString( const DynamicsEnum value ) - { - switch ( value ) - { - case DynamicsEnum::p: { return "p"; } - case DynamicsEnum::pp: { return "pp"; } - case DynamicsEnum::ppp: { return "ppp"; } - case DynamicsEnum::pppp: { return "pppp"; } - case DynamicsEnum::ppppp: { return "ppppp"; } - case DynamicsEnum::pppppp: { return "pppppp"; } - case DynamicsEnum::f: { return "f"; } - case DynamicsEnum::ff: { return "ff"; } - case DynamicsEnum::fff: { return "fff"; } - case DynamicsEnum::ffff: { return "ffff"; } - case DynamicsEnum::fffff: { return "fffff"; } - case DynamicsEnum::ffffff: { return "ffffff"; } - case DynamicsEnum::mp: { return "mp"; } - case DynamicsEnum::mf: { return "mf"; } - case DynamicsEnum::sf: { return "sf"; } - case DynamicsEnum::sfp: { return "sfp"; } - case DynamicsEnum::sfpp: { return "sfpp"; } - case DynamicsEnum::fp: { return "fp"; } - case DynamicsEnum::rf: { return "rf"; } - case DynamicsEnum::rfz: { return "rfz"; } - case DynamicsEnum::sfz: { return "sfz"; } - case DynamicsEnum::sffz: { return "sffz"; } - case DynamicsEnum::fz: { return "fz"; } - default: break; - } - return "other-dynamics"; - } - - std::ostream& toStream( std::ostream& os, const DynamicsEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DynamicsEnum value ) - { - return toStream( os, value ); - } - - DynamicsValue::DynamicsValue( const DynamicsEnum value ) - : myEnum( value ) - , myCustomValue( "" ) - { - setValue( value ); - } - - DynamicsValue::DynamicsValue( const std::string& value ) - : myEnum( DynamicsEnum::otherDynamics ) - , myCustomValue( value ) - { - setValue( value ); - } - - DynamicsValue::DynamicsValue() - : myEnum( DynamicsEnum::mf ) - , myCustomValue( "" ) - { - setValue( DynamicsEnum::mf ); - } - - DynamicsEnum DynamicsValue::getValue() const - { - return myEnum; - } - - std::string DynamicsValue::getValueString() const - { - if ( myEnum != DynamicsEnum::otherDynamics ) - { - return toString( myEnum ); - } - - else - { - return myCustomValue; - } - } - - void DynamicsValue::setValue( const DynamicsEnum value ) - { - myEnum = value; - if( value != DynamicsEnum::otherDynamics && !myCustomValue.empty() ) - { - myCustomValue = ""; - } - } - - void DynamicsValue::setValue( const std::string& value ) - { - const auto temp = tryParseDynamicsEnum( value ); - if ( temp ) - { - myEnum = temp.value(); - myCustomValue = ""; - } - else - { - setValue( DynamicsEnum::otherDynamics ); - myCustomValue = value; - } - } - - DynamicsValue parseDynamicsValue( const std::string& value ) - { - return DynamicsValue( value ); - } - - std::string toString( const DynamicsValue& value ) - { - return value.getValueString(); - } - - std::ostream& toStream( std::ostream& os, const DynamicsValue& value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DynamicsValue& value ) - { - return toStream( os, value ); - } - - /// EffectEnum ///////////////////////////////////////////////////////////////////////////// - - EffectEnum parseEffectEnum( const std::string& value ) - { - const auto opt = tryParseEffectEnum( value ); - return opt.value_or( EffectEnum::anvil ); - } - - std::optional tryParseEffectEnum( const std::string& value ) - { - if( value == "anvil" ) { return EffectEnum::anvil; } - else if( value == "auto horn" ) { return EffectEnum::autoHorn; } - else if( value == "bird whistle" ) { return EffectEnum::birdWhistle; } - else if( value == "cannon" ) { return EffectEnum::cannon; } - else if( value == "duck call" ) { return EffectEnum::duckCall; } - else if( value == "gun shot" ) { return EffectEnum::gunShot; } - else if( value == "klaxon horn" ) { return EffectEnum::klaxonHorn; } - else if( value == "lions roar" ) { return EffectEnum::lionsRoar; } - else if( value == "police whistle" ) { return EffectEnum::policeWhistle; } - else if( value == "siren" ) { return EffectEnum::siren; } - else if( value == "slide whistle" ) { return EffectEnum::slideWhistle; } - else if( value == "thunder sheet" ) { return EffectEnum::thunderSheet; } - else if( value == "wind machine" ) { return EffectEnum::windMachine; } - else if( value == "wind whistle" ) { return EffectEnum::windWhistle; } - return std::optional{}; - } - - std::string toString( const EffectEnum value ) - { - switch ( value ) - { - case EffectEnum::anvil: { return "anvil"; } - case EffectEnum::autoHorn: { return "auto horn"; } - case EffectEnum::birdWhistle: { return "bird whistle"; } - case EffectEnum::cannon: { return "cannon"; } - case EffectEnum::duckCall: { return "duck call"; } - case EffectEnum::gunShot: { return "gun shot"; } - case EffectEnum::klaxonHorn: { return "klaxon horn"; } - case EffectEnum::lionsRoar: { return "lions roar"; } - case EffectEnum::policeWhistle: { return "police whistle"; } - case EffectEnum::siren: { return "siren"; } - case EffectEnum::slideWhistle: { return "slide whistle"; } - case EffectEnum::thunderSheet: { return "thunder sheet"; } - case EffectEnum::windMachine: { return "wind machine"; } - case EffectEnum::windWhistle: { return "wind whistle"; } - default: break; - } - return "anvil"; - } - - std::ostream& toStream( std::ostream& os, const EffectEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const EffectEnum value ) - { - return toStream( os, value ); - } - - /// EnclosureShape ///////////////////////////////////////////////////////////////////////// - - EnclosureShape parseEnclosureShape( const std::string& value ) - { - const auto opt = tryParseEnclosureShape( value ); - return opt.value_or( EnclosureShape::rectangle ); - } - - std::optional tryParseEnclosureShape( const std::string& value ) - { - if( value == "rectangle" ) { return EnclosureShape::rectangle; } - else if( value == "square" ) { return EnclosureShape::square; } - else if( value == "oval" ) { return EnclosureShape::oval; } - else if( value == "circle" ) { return EnclosureShape::circle; } - else if( value == "bracket" ) { return EnclosureShape::bracket; } - else if( value == "triangle" ) { return EnclosureShape::triangle; } - else if( value == "diamond" ) { return EnclosureShape::diamond; } - else if( value == "none" ) { return EnclosureShape::none; } - return std::optional{}; - } - - std::string toString( const EnclosureShape value ) - { - switch ( value ) - { - case EnclosureShape::rectangle: { return "rectangle"; } - case EnclosureShape::square: { return "square"; } - case EnclosureShape::oval: { return "oval"; } - case EnclosureShape::circle: { return "circle"; } - case EnclosureShape::bracket: { return "bracket"; } - case EnclosureShape::triangle: { return "triangle"; } - case EnclosureShape::diamond: { return "diamond"; } - case EnclosureShape::none: { return "none"; } - default: break; - } - return "rectangle"; - } - - std::ostream& toStream( std::ostream& os, const EnclosureShape value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const EnclosureShape value ) - { - return toStream( os, value ); - } - - /// Fan //////////////////////////////////////////////////////////////////////////////////// - - Fan parseFan( const std::string& value ) - { - const auto opt = tryParseFan( value ); - return opt.value_or( Fan::accel ); - } - - std::optional tryParseFan( const std::string& value ) - { - if( value == "accel" ) { return Fan::accel; } - else if( value == "rit" ) { return Fan::rit; } - else if( value == "none" ) { return Fan::none; } - return std::optional{}; - } - - std::string toString( const Fan value ) - { - switch ( value ) - { - case Fan::accel: { return "accel"; } - case Fan::rit: { return "rit"; } - case Fan::none: { return "none"; } - default: break; - } - return "accel"; - } - - std::ostream& toStream( std::ostream& os, const Fan value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const Fan value ) - { - return toStream( os, value ); - } - - /// FermataShape /////////////////////////////////////////////////////////////////////////// - - FermataShape parseFermataShape( const std::string& value ) - { - const auto opt = tryParseFermataShape( value ); - return opt.value_or( FermataShape::normal ); - } - - std::optional tryParseFermataShape( const std::string& value ) - { - if( value == "normal" ) { return FermataShape::normal; } - else if( value == "angled" ) { return FermataShape::angled; } - else if( value == "square" ) { return FermataShape::square; } - else if( value == "" ) { return FermataShape::emptystring; } - return std::optional{}; - } - - std::string toString( const FermataShape value ) - { - switch ( value ) - { - case FermataShape::normal: { return "normal"; } - case FermataShape::angled: { return "angled"; } - case FermataShape::square: { return "square"; } - case FermataShape::emptystring: { return ""; } - default: break; - } - return "normal"; - } - - std::ostream& toStream( std::ostream& os, const FermataShape value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const FermataShape value ) - { - return toStream( os, value ); - } - - /// FontStyle ////////////////////////////////////////////////////////////////////////////// - - FontStyle parseFontStyle( const std::string& value ) - { - const auto opt = tryParseFontStyle( value ); - return opt.value_or( FontStyle::normal ); - } - - std::optional tryParseFontStyle( const std::string& value ) - { - if( value == "normal" ) { return FontStyle::normal; } - else if( value == "italic" ) { return FontStyle::italic; } - return std::optional{}; - } - - std::string toString( const FontStyle value ) - { - switch ( value ) - { - case FontStyle::normal: { return "normal"; } - case FontStyle::italic: { return "italic"; } - default: break; - } - return "normal"; - } - - std::ostream& toStream( std::ostream& os, const FontStyle value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const FontStyle value ) - { - return toStream( os, value ); - } - - /// FontWeight ///////////////////////////////////////////////////////////////////////////// - - FontWeight parseFontWeight( const std::string& value ) - { - const auto opt = tryParseFontWeight( value ); - return opt.value_or( FontWeight::normal ); - } - - std::optional tryParseFontWeight( const std::string& value ) - { - if( value == "normal" ) { return FontWeight::normal; } - else if( value == "bold" ) { return FontWeight::bold; } - return std::optional{}; - } - - std::string toString( const FontWeight value ) - { - switch ( value ) - { - case FontWeight::normal: { return "normal"; } - case FontWeight::bold: { return "bold"; } - default: break; - } - return "normal"; - } - - std::ostream& toStream( std::ostream& os, const FontWeight value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const FontWeight value ) - { - return toStream( os, value ); - } - - /// GlassEnum ////////////////////////////////////////////////////////////////////////////// - - GlassEnum parseGlassEnum( const std::string& value ) - { - const auto opt = tryParseGlassEnum( value ); - return opt.value_or( GlassEnum::windChimes ); - } - - std::optional tryParseGlassEnum( const std::string& value ) - { - if( value == "wind chimes" ) { return GlassEnum::windChimes; } - return std::optional{}; - } - - std::string toString( const GlassEnum value ) - { - switch ( value ) - { - case GlassEnum::windChimes: { return "wind chimes"; } - default: break; - } - return "wind chimes"; - } - - std::ostream& toStream( std::ostream& os, const GlassEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const GlassEnum value ) - { - return toStream( os, value ); - } - - /// GroupBarlineValue ////////////////////////////////////////////////////////////////////// - - GroupBarlineValue parseGroupBarlineValue( const std::string& value ) - { - const auto opt = tryParseGroupBarlineValue( value ); - return opt.value_or( GroupBarlineValue::yes ); - } - - std::optional tryParseGroupBarlineValue( const std::string& value ) - { - if( value == "yes" ) { return GroupBarlineValue::yes; } - else if( value == "no" ) { return GroupBarlineValue::no; } - else if( value == "Mensurstrich" ) { return GroupBarlineValue::mensurstrich; } - return std::optional{}; - } - - std::string toString( const GroupBarlineValue value ) - { - switch ( value ) - { - case GroupBarlineValue::yes: { return "yes"; } - case GroupBarlineValue::no: { return "no"; } - case GroupBarlineValue::mensurstrich: { return "Mensurstrich"; } - default: break; - } - return "yes"; - } - - std::ostream& toStream( std::ostream& os, const GroupBarlineValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const GroupBarlineValue value ) - { - return toStream( os, value ); - } - - /// GroupSymbolValue /////////////////////////////////////////////////////////////////////// - - GroupSymbolValue parseGroupSymbolValue( const std::string& value ) - { - const auto opt = tryParseGroupSymbolValue( value ); - return opt.value_or( GroupSymbolValue::none ); - } - - std::optional tryParseGroupSymbolValue( const std::string& value ) - { - if( value == "none" ) { return GroupSymbolValue::none; } - else if( value == "brace" ) { return GroupSymbolValue::brace; } - else if( value == "line" ) { return GroupSymbolValue::line; } - else if( value == "bracket" ) { return GroupSymbolValue::bracket; } - else if( value == "square" ) { return GroupSymbolValue::square; } - return std::optional{}; - } - - std::string toString( const GroupSymbolValue value ) - { - switch ( value ) - { - case GroupSymbolValue::none: { return "none"; } - case GroupSymbolValue::brace: { return "brace"; } - case GroupSymbolValue::line: { return "line"; } - case GroupSymbolValue::bracket: { return "bracket"; } - case GroupSymbolValue::square: { return "square"; } - default: break; - } - return "none"; - } - - std::ostream& toStream( std::ostream& os, const GroupSymbolValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const GroupSymbolValue value ) - { - return toStream( os, value ); - } - - /// HandbellValue ////////////////////////////////////////////////////////////////////////// - - HandbellValue parseHandbellValue( const std::string& value ) - { - const auto opt = tryParseHandbellValue( value ); - return opt.value_or( HandbellValue::damp ); - } - - std::optional tryParseHandbellValue( const std::string& value ) - { - if( value == "damp" ) { return HandbellValue::damp; } - else if( value == "echo" ) { return HandbellValue::echo; } - else if( value == "gyro" ) { return HandbellValue::gyro; } - else if( value == "hand martellato" ) { return HandbellValue::handMartellato; } - else if( value == "mallet lift" ) { return HandbellValue::malletLift; } - else if( value == "mallet table" ) { return HandbellValue::malletTable; } - else if( value == "martellato" ) { return HandbellValue::martellato; } - else if( value == "martellato lift" ) { return HandbellValue::martellatoLift; } - else if( value == "muted martellato" ) { return HandbellValue::mutedMartellato; } - else if( value == "pluck lift" ) { return HandbellValue::pluckLift; } - else if( value == "swing" ) { return HandbellValue::swing; } - return std::optional{}; - } - - std::string toString( const HandbellValue value ) - { - switch ( value ) - { - case HandbellValue::damp: { return "damp"; } - case HandbellValue::echo: { return "echo"; } - case HandbellValue::gyro: { return "gyro"; } - case HandbellValue::handMartellato: { return "hand martellato"; } - case HandbellValue::malletLift: { return "mallet lift"; } - case HandbellValue::malletTable: { return "mallet table"; } - case HandbellValue::martellato: { return "martellato"; } - case HandbellValue::martellatoLift: { return "martellato lift"; } - case HandbellValue::mutedMartellato: { return "muted martellato"; } - case HandbellValue::pluckLift: { return "pluck lift"; } - case HandbellValue::swing: { return "swing"; } - default: break; - } - return "damp"; - } - - std::ostream& toStream( std::ostream& os, const HandbellValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const HandbellValue value ) - { - return toStream( os, value ); - } - - /// HarmonyType //////////////////////////////////////////////////////////////////////////// - - HarmonyType parseHarmonyType( const std::string& value ) - { - const auto opt = tryParseHarmonyType( value ); - return opt.value_or( HarmonyType::explicit_ ); - } - - std::optional tryParseHarmonyType( const std::string& value ) - { - if( value == "explicit" ) { return HarmonyType::explicit_; } - else if( value == "implied" ) { return HarmonyType::implied; } - else if( value == "alternate" ) { return HarmonyType::alternate; } - return std::optional{}; - } - - std::string toString( const HarmonyType value ) - { - switch ( value ) - { - case HarmonyType::explicit_: { return "explicit"; } - case HarmonyType::implied: { return "implied"; } - case HarmonyType::alternate: { return "alternate"; } - default: break; - } - return "explicit"; - } - - std::ostream& toStream( std::ostream& os, const HarmonyType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const HarmonyType value ) - { - return toStream( os, value ); - } - - /// HoleClosedLocation ///////////////////////////////////////////////////////////////////// - - HoleClosedLocation parseHoleClosedLocation( const std::string& value ) - { - const auto opt = tryParseHoleClosedLocation( value ); - return opt.value_or( HoleClosedLocation::right ); - } - - std::optional tryParseHoleClosedLocation( const std::string& value ) - { - if( value == "right" ) { return HoleClosedLocation::right; } - else if( value == "bottom" ) { return HoleClosedLocation::bottom; } - else if( value == "left" ) { return HoleClosedLocation::left; } - else if( value == "top" ) { return HoleClosedLocation::top; } - return std::optional{}; - } - - std::string toString( const HoleClosedLocation value ) - { - switch ( value ) - { - case HoleClosedLocation::right: { return "right"; } - case HoleClosedLocation::bottom: { return "bottom"; } - case HoleClosedLocation::left: { return "left"; } - case HoleClosedLocation::top: { return "top"; } - default: break; - } - return "right"; - } - - std::ostream& toStream( std::ostream& os, const HoleClosedLocation value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const HoleClosedLocation value ) - { - return toStream( os, value ); - } - - /// HoleClosedValue //////////////////////////////////////////////////////////////////////// - - HoleClosedValue parseHoleClosedValue( const std::string& value ) - { - const auto opt = tryParseHoleClosedValue( value ); - return opt.value_or( HoleClosedValue::yes ); - } - - std::optional tryParseHoleClosedValue( const std::string& value ) - { - if( value == "yes" ) { return HoleClosedValue::yes; } - else if( value == "no" ) { return HoleClosedValue::no; } - else if( value == "half" ) { return HoleClosedValue::half; } - return std::optional{}; - } - - std::string toString( const HoleClosedValue value ) - { - switch ( value ) - { - case HoleClosedValue::yes: { return "yes"; } - case HoleClosedValue::no: { return "no"; } - case HoleClosedValue::half: { return "half"; } - default: break; - } - return "yes"; - } - - std::ostream& toStream( std::ostream& os, const HoleClosedValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const HoleClosedValue value ) - { - return toStream( os, value ); - } - - /// KindValue ////////////////////////////////////////////////////////////////////////////// - - KindValue parseKindValue( const std::string& value ) - { - const auto opt = tryParseKindValue( value ); - return opt.value_or( KindValue::major ); - } - - std::optional tryParseKindValue( const std::string& value ) - { - if( value == "major" ) { return KindValue::major; } - else if( value == "minor" ) { return KindValue::minor; } - else if( value == "augmented" ) { return KindValue::augmented; } - else if( value == "diminished" ) { return KindValue::diminished; } - else if( value == "dominant" ) { return KindValue::dominant; } - else if( value == "major-seventh" ) { return KindValue::majorSeventh; } - else if( value == "minor-seventh" ) { return KindValue::minorSeventh; } - else if( value == "diminished-seventh" ) { return KindValue::diminishedSeventh; } - else if( value == "augmented-seventh" ) { return KindValue::augmentedSeventh; } - else if( value == "half-diminished" ) { return KindValue::halfDiminished; } - else if( value == "major-minor" ) { return KindValue::majorMinor; } - else if( value == "major-sixth" ) { return KindValue::majorSixth; } - else if( value == "minor-sixth" ) { return KindValue::minorSixth; } - else if( value == "dominant-ninth" ) { return KindValue::dominantNinth; } - else if( value == "major-ninth" ) { return KindValue::majorNinth; } - else if( value == "minor-ninth" ) { return KindValue::minorNinth; } - else if( value == "dominant-11th" ) { return KindValue::dominant11th; } - else if( value == "major-11th" ) { return KindValue::major11th; } - else if( value == "minor-11th" ) { return KindValue::minor11th; } - else if( value == "dominant-13th" ) { return KindValue::dominant13th; } - else if( value == "major-13th" ) { return KindValue::major13th; } - else if( value == "minor-13th" ) { return KindValue::minor13th; } - else if( value == "suspended-second" ) { return KindValue::suspendedSecond; } - else if( value == "suspended-fourth" ) { return KindValue::suspendedFourth; } - else if( value == "Neapolitan" ) { return KindValue::neapolitan; } - else if( value == "Italian" ) { return KindValue::italian; } - else if( value == "French" ) { return KindValue::french; } - else if( value == "German" ) { return KindValue::german; } - else if( value == "pedal" ) { return KindValue::pedal; } - else if( value == "power" ) { return KindValue::power; } - else if( value == "Tristan" ) { return KindValue::tristan; } - else if( value == "other" ) { return KindValue::other; } - else if( value == "none" ) { return KindValue::none; } - return std::optional{}; - } - - std::string toString( const KindValue value ) - { - switch ( value ) - { - case KindValue::major: { return "major"; } - case KindValue::minor: { return "minor"; } - case KindValue::augmented: { return "augmented"; } - case KindValue::diminished: { return "diminished"; } - case KindValue::dominant: { return "dominant"; } - case KindValue::majorSeventh: { return "major-seventh"; } - case KindValue::minorSeventh: { return "minor-seventh"; } - case KindValue::diminishedSeventh: { return "diminished-seventh"; } - case KindValue::augmentedSeventh: { return "augmented-seventh"; } - case KindValue::halfDiminished: { return "half-diminished"; } - case KindValue::majorMinor: { return "major-minor"; } - case KindValue::majorSixth: { return "major-sixth"; } - case KindValue::minorSixth: { return "minor-sixth"; } - case KindValue::dominantNinth: { return "dominant-ninth"; } - case KindValue::majorNinth: { return "major-ninth"; } - case KindValue::minorNinth: { return "minor-ninth"; } - case KindValue::dominant11th: { return "dominant-11th"; } - case KindValue::major11th: { return "major-11th"; } - case KindValue::minor11th: { return "minor-11th"; } - case KindValue::dominant13th: { return "dominant-13th"; } - case KindValue::major13th: { return "major-13th"; } - case KindValue::minor13th: { return "minor-13th"; } - case KindValue::suspendedSecond: { return "suspended-second"; } - case KindValue::suspendedFourth: { return "suspended-fourth"; } - case KindValue::neapolitan: { return "Neapolitan"; } - case KindValue::italian: { return "Italian"; } - case KindValue::french: { return "French"; } - case KindValue::german: { return "German"; } - case KindValue::pedal: { return "pedal"; } - case KindValue::power: { return "power"; } - case KindValue::tristan: { return "Tristan"; } - case KindValue::other: { return "other"; } - case KindValue::none: { return "none"; } - default: break; - } - return "major"; - } - - std::ostream& toStream( std::ostream& os, const KindValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const KindValue value ) - { - return toStream( os, value ); - } - - /// LeftCenterRight //////////////////////////////////////////////////////////////////////// - - LeftCenterRight parseLeftCenterRight( const std::string& value ) - { - const auto opt = tryParseLeftCenterRight( value ); - return opt.value_or( LeftCenterRight::left ); - } - - std::optional tryParseLeftCenterRight( const std::string& value ) - { - if( value == "left" ) { return LeftCenterRight::left; } - else if( value == "center" ) { return LeftCenterRight::center; } - else if( value == "right" ) { return LeftCenterRight::right; } - return std::optional{}; - } - - std::string toString( const LeftCenterRight value ) - { - switch ( value ) - { - case LeftCenterRight::left: { return "left"; } - case LeftCenterRight::center: { return "center"; } - case LeftCenterRight::right: { return "right"; } - default: break; - } - return "left"; - } - - std::ostream& toStream( std::ostream& os, const LeftCenterRight value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LeftCenterRight value ) - { - return toStream( os, value ); - } - - /// LeftRight ////////////////////////////////////////////////////////////////////////////// - - LeftRight parseLeftRight( const std::string& value ) - { - const auto opt = tryParseLeftRight( value ); - return opt.value_or( LeftRight::left ); - } - - std::optional tryParseLeftRight( const std::string& value ) - { - if( value == "left" ) { return LeftRight::left; } - else if( value == "right" ) { return LeftRight::right; } - return std::optional{}; - } - - std::string toString( const LeftRight value ) - { - switch ( value ) - { - case LeftRight::left: { return "left"; } - case LeftRight::right: { return "right"; } - default: break; - } - return "left"; - } - - std::ostream& toStream( std::ostream& os, const LeftRight value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LeftRight value ) - { - return toStream( os, value ); - } - - /// LineEnd //////////////////////////////////////////////////////////////////////////////// - - LineEnd parseLineEnd( const std::string& value ) - { - const auto opt = tryParseLineEnd( value ); - return opt.value_or( LineEnd::up ); - } - - std::optional tryParseLineEnd( const std::string& value ) - { - if( value == "up" ) { return LineEnd::up; } - else if( value == "down" ) { return LineEnd::down; } - else if( value == "both" ) { return LineEnd::both; } - else if( value == "arrow" ) { return LineEnd::arrow; } - else if( value == "none" ) { return LineEnd::none; } - return std::optional{}; - } - - std::string toString( const LineEnd value ) - { - switch ( value ) - { - case LineEnd::up: { return "up"; } - case LineEnd::down: { return "down"; } - case LineEnd::both: { return "both"; } - case LineEnd::arrow: { return "arrow"; } - case LineEnd::none: { return "none"; } - default: break; - } - return "up"; - } - - std::ostream& toStream( std::ostream& os, const LineEnd value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineEnd value ) - { - return toStream( os, value ); - } - - /// LineShape ////////////////////////////////////////////////////////////////////////////// - - LineShape parseLineShape( const std::string& value ) - { - const auto opt = tryParseLineShape( value ); - return opt.value_or( LineShape::straight ); - } - - std::optional tryParseLineShape( const std::string& value ) - { - if( value == "straight" ) { return LineShape::straight; } - else if( value == "curved" ) { return LineShape::curved; } - return std::optional{}; - } - - std::string toString( const LineShape value ) - { - switch ( value ) - { - case LineShape::straight: { return "straight"; } - case LineShape::curved: { return "curved"; } - default: break; - } - return "straight"; - } - - std::ostream& toStream( std::ostream& os, const LineShape value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineShape value ) - { - return toStream( os, value ); - } - - /// LineType /////////////////////////////////////////////////////////////////////////////// - - LineType parseLineType( const std::string& value ) - { - const auto opt = tryParseLineType( value ); - return opt.value_or( LineType::solid ); - } - - std::optional tryParseLineType( const std::string& value ) - { - if( value == "solid" ) { return LineType::solid; } - else if( value == "dashed" ) { return LineType::dashed; } - else if( value == "dotted" ) { return LineType::dotted; } - else if( value == "wavy" ) { return LineType::wavy; } - return std::optional{}; - } - - std::string toString( const LineType value ) - { - switch ( value ) - { - case LineType::solid: { return "solid"; } - case LineType::dashed: { return "dashed"; } - case LineType::dotted: { return "dotted"; } - case LineType::wavy: { return "wavy"; } - default: break; - } - return "solid"; - } - - std::ostream& toStream( std::ostream& os, const LineType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineType value ) - { - return toStream( os, value ); - } - - /// LineWidthTypeEnum ////////////////////////////////////////////////////////////////////// - - LineWidthTypeEnum parseLineWidthTypeEnum( const std::string& value ) - { - const auto opt = tryParseLineWidthTypeEnum( value ); - return opt.value_or( LineWidthTypeEnum::beam ); - } - - std::optional tryParseLineWidthTypeEnum( const std::string& value ) - { - if( value == "beam" ) { return LineWidthTypeEnum::beam; } - else if( value == "bracket" ) { return LineWidthTypeEnum::bracket; } - else if( value == "dashes" ) { return LineWidthTypeEnum::dashes; } - else if( value == "enclosure" ) { return LineWidthTypeEnum::enclosure; } - else if( value == "ending" ) { return LineWidthTypeEnum::ending; } - else if( value == "extend" ) { return LineWidthTypeEnum::extend; } - else if( value == "heavy barline" ) { return LineWidthTypeEnum::heavyBarline; } - else if( value == "leger" ) { return LineWidthTypeEnum::leger; } - else if( value == "light barline" ) { return LineWidthTypeEnum::lightBarline; } - else if( value == "octave shift" ) { return LineWidthTypeEnum::octaveShift; } - else if( value == "pedal" ) { return LineWidthTypeEnum::pedal; } - else if( value == "slur middle" ) { return LineWidthTypeEnum::slurMiddle; } - else if( value == "slur tip" ) { return LineWidthTypeEnum::slurTip; } - else if( value == "staff" ) { return LineWidthTypeEnum::staff; } - else if( value == "stem" ) { return LineWidthTypeEnum::stem; } - else if( value == "tie middle" ) { return LineWidthTypeEnum::tieMiddle; } - else if( value == "tie tip" ) { return LineWidthTypeEnum::tieTip; } - else if( value == "tuplet bracket" ) { return LineWidthTypeEnum::tupletBracket; } - else if( value == "wedge" ) { return LineWidthTypeEnum::wedge; } - else if( value == "other" ) { return LineWidthTypeEnum::other; } - return std::optional{}; - } - - std::string toString( const LineWidthTypeEnum value ) - { - switch ( value ) - { - case LineWidthTypeEnum::beam: { return "beam"; } - case LineWidthTypeEnum::bracket: { return "bracket"; } - case LineWidthTypeEnum::dashes: { return "dashes"; } - case LineWidthTypeEnum::enclosure: { return "enclosure"; } - case LineWidthTypeEnum::ending: { return "ending"; } - case LineWidthTypeEnum::extend: { return "extend"; } - case LineWidthTypeEnum::heavyBarline: { return "heavy barline"; } - case LineWidthTypeEnum::leger: { return "leger"; } - case LineWidthTypeEnum::lightBarline: { return "light barline"; } - case LineWidthTypeEnum::octaveShift: { return "octave shift"; } - case LineWidthTypeEnum::pedal: { return "pedal"; } - case LineWidthTypeEnum::slurMiddle: { return "slur middle"; } - case LineWidthTypeEnum::slurTip: { return "slur tip"; } - case LineWidthTypeEnum::staff: { return "staff"; } - case LineWidthTypeEnum::stem: { return "stem"; } - case LineWidthTypeEnum::tieMiddle: { return "tie middle"; } - case LineWidthTypeEnum::tieTip: { return "tie tip"; } - case LineWidthTypeEnum::tupletBracket: { return "tuplet bracket"; } - case LineWidthTypeEnum::wedge: { return "wedge"; } - default: break; - } - return "other"; - } - - std::ostream& toStream( std::ostream& os, const LineWidthTypeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineWidthTypeEnum value ) - { - return toStream( os, value ); - } - - LineWidthType::LineWidthType( const LineWidthTypeEnum value ) - : myEnum( value ) - , myCustomValue( "" ) - { - setValue( value ); - } - - LineWidthType::LineWidthType( const std::string& value ) - : myEnum( LineWidthTypeEnum::other ) - , myCustomValue( value ) - { - setValue( value ); - } - - LineWidthType::LineWidthType() - : myEnum( LineWidthTypeEnum::beam ) - , myCustomValue( "" ) - { - setValue( LineWidthTypeEnum::beam ); - } - - LineWidthTypeEnum LineWidthType::getValue() const - { - return myEnum; - } - - std::string LineWidthType::getValueString() const - { - if ( myEnum != LineWidthTypeEnum::other ) - { - return toString( myEnum ); - } - - else - { - return myCustomValue; - } - } - - void LineWidthType::setValue( const LineWidthTypeEnum value ) - { - myEnum = value; - if( value != LineWidthTypeEnum::other && !myCustomValue.empty() ) - { - myCustomValue = ""; - } - } - - void LineWidthType::setValue( const std::string& value ) - { - const auto temp = tryParseLineWidthTypeEnum( value ); - if ( temp ) - { - myEnum = temp.value(); - myCustomValue = ""; - } - else - { - setValue( LineWidthTypeEnum::other ); - myCustomValue = value; - } - } - - LineWidthType parseLineWidthType( const std::string& value ) - { - return LineWidthType( value ); - } - - std::string toString( const LineWidthType& value ) - { - return value.getValueString(); - } - - std::ostream& toStream( std::ostream& os, const LineWidthType& value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineWidthType& value ) - { - return toStream( os, value ); - } - - /// MarginType ///////////////////////////////////////////////////////////////////////////// - - MarginType parseMarginType( const std::string& value ) - { - const auto opt = tryParseMarginType( value ); - return opt.value_or( MarginType::odd ); - } - - std::optional tryParseMarginType( const std::string& value ) - { - if( value == "odd" ) { return MarginType::odd; } - else if( value == "even" ) { return MarginType::even; } - else if( value == "both" ) { return MarginType::both; } - return std::optional{}; - } - - std::string toString( const MarginType value ) - { - switch ( value ) - { - case MarginType::odd: { return "odd"; } - case MarginType::even: { return "even"; } - case MarginType::both: { return "both"; } - default: break; - } - return "odd"; - } - - std::ostream& toStream( std::ostream& os, const MarginType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MarginType value ) - { - return toStream( os, value ); - } - - /// MeasureNumberingValue ////////////////////////////////////////////////////////////////// - - MeasureNumberingValue parseMeasureNumberingValue( const std::string& value ) - { - const auto opt = tryParseMeasureNumberingValue( value ); - return opt.value_or( MeasureNumberingValue::none ); - } - - std::optional tryParseMeasureNumberingValue( const std::string& value ) - { - if( value == "none" ) { return MeasureNumberingValue::none; } - else if( value == "measure" ) { return MeasureNumberingValue::measure; } - else if( value == "system" ) { return MeasureNumberingValue::system; } - return std::optional{}; - } - - std::string toString( const MeasureNumberingValue value ) - { - switch ( value ) - { - case MeasureNumberingValue::none: { return "none"; } - case MeasureNumberingValue::measure: { return "measure"; } - case MeasureNumberingValue::system: { return "system"; } - default: break; - } - return "none"; - } - - std::ostream& toStream( std::ostream& os, const MeasureNumberingValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MeasureNumberingValue value ) - { - return toStream( os, value ); - } - - /// MembraneEnum /////////////////////////////////////////////////////////////////////////// - - MembraneEnum parseMembraneEnum( const std::string& value ) - { - const auto opt = tryParseMembraneEnum( value ); - return opt.value_or( MembraneEnum::bassDrum ); - } - - std::optional tryParseMembraneEnum( const std::string& value ) - { - if( value == "bass drum" ) { return MembraneEnum::bassDrum; } - else if( value == "bass drum on side" ) { return MembraneEnum::bassDrumOnSide; } - else if( value == "bongos" ) { return MembraneEnum::bongos; } - else if( value == "conga drum" ) { return MembraneEnum::congaDrum; } - else if( value == "goblet drum" ) { return MembraneEnum::gobletDrum; } - else if( value == "military drum" ) { return MembraneEnum::militaryDrum; } - else if( value == "snare drum" ) { return MembraneEnum::snareDrum; } - else if( value == "snare drum snares off" ) { return MembraneEnum::snareDrumSnaresOff; } - else if( value == "tambourine" ) { return MembraneEnum::tambourine; } - else if( value == "tenor drum" ) { return MembraneEnum::tenorDrum; } - else if( value == "timbales" ) { return MembraneEnum::timbales; } - else if( value == "tomtom" ) { return MembraneEnum::tomtom; } - return std::optional{}; - } - - std::string toString( const MembraneEnum value ) - { - switch ( value ) - { - case MembraneEnum::bassDrum: { return "bass drum"; } - case MembraneEnum::bassDrumOnSide: { return "bass drum on side"; } - case MembraneEnum::bongos: { return "bongos"; } - case MembraneEnum::congaDrum: { return "conga drum"; } - case MembraneEnum::gobletDrum: { return "goblet drum"; } - case MembraneEnum::militaryDrum: { return "military drum"; } - case MembraneEnum::snareDrum: { return "snare drum"; } - case MembraneEnum::snareDrumSnaresOff: { return "snare drum snares off"; } - case MembraneEnum::tambourine: { return "tambourine"; } - case MembraneEnum::tenorDrum: { return "tenor drum"; } - case MembraneEnum::timbales: { return "timbales"; } - case MembraneEnum::tomtom: { return "tomtom"; } - default: break; - } - return "bass drum"; - } - - std::ostream& toStream( std::ostream& os, const MembraneEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MembraneEnum value ) - { - return toStream( os, value ); - } - - /// MetalEnum ////////////////////////////////////////////////////////////////////////////// - - MetalEnum parseMetalEnum( const std::string& value ) - { - const auto opt = tryParseMetalEnum( value ); - return opt.value_or( MetalEnum::almglocken ); - } - - std::optional tryParseMetalEnum( const std::string& value ) - { - if( value == "almglocken" ) { return MetalEnum::almglocken; } - else if( value == "bell" ) { return MetalEnum::bell; } - else if( value == "bell plate" ) { return MetalEnum::bellPlate; } - else if( value == "brake drum" ) { return MetalEnum::brakeDrum; } - else if( value == "Chinese cymbal" ) { return MetalEnum::chineseCymbal; } - else if( value == "cowbell" ) { return MetalEnum::cowbell; } - else if( value == "crash cymbals" ) { return MetalEnum::crashCymbals; } - else if( value == "crotale" ) { return MetalEnum::crotale; } - else if( value == "cymbal tongs" ) { return MetalEnum::cymbalTongs; } - else if( value == "domed gong" ) { return MetalEnum::domedGong; } - else if( value == "finger cymbals" ) { return MetalEnum::fingerCymbals; } - else if( value == "flexatone" ) { return MetalEnum::flexatone; } - else if( value == "gong" ) { return MetalEnum::gong; } - else if( value == "hi-hat" ) { return MetalEnum::hiHat; } - else if( value == "high-hat cymbals" ) { return MetalEnum::highHatCymbals; } - else if( value == "handbell" ) { return MetalEnum::handbell; } - else if( value == "sistrum" ) { return MetalEnum::sistrum; } - else if( value == "sizzle cymbal" ) { return MetalEnum::sizzleCymbal; } - else if( value == "sleigh bells" ) { return MetalEnum::sleighBells; } - else if( value == "suspended cymbal" ) { return MetalEnum::suspendedCymbal; } - else if( value == "tam tam" ) { return MetalEnum::tamTam; } - else if( value == "triangle" ) { return MetalEnum::triangle; } - else if( value == "Vietnamese hat" ) { return MetalEnum::vietnameseHat; } - return std::optional{}; - } - - std::string toString( const MetalEnum value ) - { - switch ( value ) - { - case MetalEnum::almglocken: { return "almglocken"; } - case MetalEnum::bell: { return "bell"; } - case MetalEnum::bellPlate: { return "bell plate"; } - case MetalEnum::brakeDrum: { return "brake drum"; } - case MetalEnum::chineseCymbal: { return "Chinese cymbal"; } - case MetalEnum::cowbell: { return "cowbell"; } - case MetalEnum::crashCymbals: { return "crash cymbals"; } - case MetalEnum::crotale: { return "crotale"; } - case MetalEnum::cymbalTongs: { return "cymbal tongs"; } - case MetalEnum::domedGong: { return "domed gong"; } - case MetalEnum::fingerCymbals: { return "finger cymbals"; } - case MetalEnum::flexatone: { return "flexatone"; } - case MetalEnum::gong: { return "gong"; } - case MetalEnum::hiHat: { return "hi-hat"; } - case MetalEnum::highHatCymbals: { return "high-hat cymbals"; } - case MetalEnum::handbell: { return "handbell"; } - case MetalEnum::sistrum: { return "sistrum"; } - case MetalEnum::sizzleCymbal: { return "sizzle cymbal"; } - case MetalEnum::sleighBells: { return "sleigh bells"; } - case MetalEnum::suspendedCymbal: { return "suspended cymbal"; } - case MetalEnum::tamTam: { return "tam tam"; } - case MetalEnum::triangle: { return "triangle"; } - case MetalEnum::vietnameseHat: { return "Vietnamese hat"; } - default: break; - } - return "almglocken"; - } - - std::ostream& toStream( std::ostream& os, const MetalEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MetalEnum value ) - { - return toStream( os, value ); - } - - /// ModeEnum /////////////////////////////////////////////////////////////////////////////// - - ModeEnum parseModeEnum( const std::string& value ) - { - const auto opt = tryParseModeEnum( value ); - return opt.value_or( ModeEnum::major ); - } - - std::optional tryParseModeEnum( const std::string& value ) - { - if( value == "major" ) { return ModeEnum::major; } - else if( value == "minor" ) { return ModeEnum::minor; } - else if( value == "dorian" ) { return ModeEnum::dorian; } - else if( value == "phrygian" ) { return ModeEnum::phrygian; } - else if( value == "lydian" ) { return ModeEnum::lydian; } - else if( value == "mixolydian" ) { return ModeEnum::mixolydian; } - else if( value == "aeolian" ) { return ModeEnum::aeolian; } - else if( value == "ionian" ) { return ModeEnum::ionian; } - else if( value == "locrian" ) { return ModeEnum::locrian; } - else if( value == "none" ) { return ModeEnum::none; } - else if( value == "other" ) { return ModeEnum::other; } - return std::optional{}; - } - - std::string toString( const ModeEnum value ) - { - switch ( value ) - { - case ModeEnum::major: { return "major"; } - case ModeEnum::minor: { return "minor"; } - case ModeEnum::dorian: { return "dorian"; } - case ModeEnum::phrygian: { return "phrygian"; } - case ModeEnum::lydian: { return "lydian"; } - case ModeEnum::mixolydian: { return "mixolydian"; } - case ModeEnum::aeolian: { return "aeolian"; } - case ModeEnum::ionian: { return "ionian"; } - case ModeEnum::locrian: { return "locrian"; } - case ModeEnum::none: { return "none"; } - default: break; - } - return "other"; - } - - std::ostream& toStream( std::ostream& os, const ModeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ModeEnum value ) - { - return toStream( os, value ); - } - - ModeValue::ModeValue( const ModeEnum value ) - : myEnum( value ) - , myCustomValue( "" ) - { - setValue( value ); - } - - ModeValue::ModeValue( const std::string& value ) - : myEnum( ModeEnum::other ) - , myCustomValue( value ) - { - setValue( value ); - } - - ModeValue::ModeValue() - : myEnum( ModeEnum::major ) - , myCustomValue( "" ) - { - setValue( ModeEnum::major ); - } - - ModeEnum ModeValue::getValue() const - { - return myEnum; - } - - std::string ModeValue::getValueString() const - { - if ( myEnum != ModeEnum::other ) - { - return toString( myEnum ); - } - - else - { - return myCustomValue; - } - } - - void ModeValue::setValue( const ModeEnum value ) - { - myEnum = value; - if( value != ModeEnum::other && !myCustomValue.empty() ) - { - myCustomValue = ""; - } - } - - void ModeValue::setValue( const std::string& value ) - { - const auto temp = tryParseModeEnum( value ); - if ( temp ) - { - myEnum = temp.value(); - myCustomValue = ""; - } - else - { - setValue( ModeEnum::other ); - myCustomValue = value; - } - } - - ModeValue parseModeValue( const std::string& value ) - { - return ModeValue( value ); - } - - std::string toString( const ModeValue& value ) - { - return value.getValueString(); - } - - std::ostream& toStream( std::ostream& os, const ModeValue& value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ModeValue& value ) - { - return toStream( os, value ); - } - - /// MuteEnum /////////////////////////////////////////////////////////////////////////////// - - MuteEnum parseMuteEnum( const std::string& value ) - { - const auto opt = tryParseMuteEnum( value ); - return opt.value_or( MuteEnum::on ); - } - - std::optional tryParseMuteEnum( const std::string& value ) - { - if( value == "on" ) { return MuteEnum::on; } - else if( value == "off" ) { return MuteEnum::off; } - else if( value == "straight" ) { return MuteEnum::straight; } - else if( value == "cup" ) { return MuteEnum::cup; } - else if( value == "harmon-no-stem" ) { return MuteEnum::harmonNoStem; } - else if( value == "harmon-stem" ) { return MuteEnum::harmonStem; } - else if( value == "bucket" ) { return MuteEnum::bucket; } - else if( value == "plunger" ) { return MuteEnum::plunger; } - else if( value == "hat" ) { return MuteEnum::hat; } - else if( value == "solotone" ) { return MuteEnum::solotone; } - else if( value == "practice" ) { return MuteEnum::practice; } - else if( value == "stop-mute" ) { return MuteEnum::stopMute; } - else if( value == "stop-hand" ) { return MuteEnum::stopHand; } - else if( value == "echo" ) { return MuteEnum::echo; } - else if( value == "palm" ) { return MuteEnum::palm; } - return std::optional{}; - } - - std::string toString( const MuteEnum value ) - { - switch ( value ) - { - case MuteEnum::on: { return "on"; } - case MuteEnum::off: { return "off"; } - case MuteEnum::straight: { return "straight"; } - case MuteEnum::cup: { return "cup"; } - case MuteEnum::harmonNoStem: { return "harmon-no-stem"; } - case MuteEnum::harmonStem: { return "harmon-stem"; } - case MuteEnum::bucket: { return "bucket"; } - case MuteEnum::plunger: { return "plunger"; } - case MuteEnum::hat: { return "hat"; } - case MuteEnum::solotone: { return "solotone"; } - case MuteEnum::practice: { return "practice"; } - case MuteEnum::stopMute: { return "stop-mute"; } - case MuteEnum::stopHand: { return "stop-hand"; } - case MuteEnum::echo: { return "echo"; } - case MuteEnum::palm: { return "palm"; } - default: break; - } - return "on"; - } - - std::ostream& toStream( std::ostream& os, const MuteEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MuteEnum value ) - { - return toStream( os, value ); - } - - /// NoteSizeType /////////////////////////////////////////////////////////////////////////// - - NoteSizeType parseNoteSizeType( const std::string& value ) - { - const auto opt = tryParseNoteSizeType( value ); - return opt.value_or( NoteSizeType::cue ); - } - - std::optional tryParseNoteSizeType( const std::string& value ) - { - if( value == "cue" ) { return NoteSizeType::cue; } - else if( value == "grace" ) { return NoteSizeType::grace; } - else if( value == "large" ) { return NoteSizeType::large; } - return std::optional{}; - } - - std::string toString( const NoteSizeType value ) - { - switch ( value ) - { - case NoteSizeType::cue: { return "cue"; } - case NoteSizeType::grace: { return "grace"; } - case NoteSizeType::large: { return "large"; } - default: break; - } - return "cue"; - } - - std::ostream& toStream( std::ostream& os, const NoteSizeType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const NoteSizeType value ) - { - return toStream( os, value ); - } - - /// NoteTypeValue ////////////////////////////////////////////////////////////////////////// - - NoteTypeValue parseNoteTypeValue( const std::string& value ) - { - const auto opt = tryParseNoteTypeValue( value ); - return opt.value_or( NoteTypeValue::oneThousandTwentyFourth ); - } - - std::optional tryParseNoteTypeValue( const std::string& value ) - { - if( value == "1024th" ) { return NoteTypeValue::oneThousandTwentyFourth; } - else if( value == "512th" ) { return NoteTypeValue::fiveHundredTwelfth; } - else if( value == "256th" ) { return NoteTypeValue::twoHundredFifthySixth; } - else if( value == "128th" ) { return NoteTypeValue::oneHundredTwentyEighth; } - else if( value == "64th" ) { return NoteTypeValue::sixtyFourth; } - else if( value == "32nd" ) { return NoteTypeValue::thirtySecond; } - else if( value == "16th" ) { return NoteTypeValue::sixteenth; } - else if( value == "eighth" ) { return NoteTypeValue::eighth; } - else if( value == "quarter" ) { return NoteTypeValue::quarter; } - else if( value == "half" ) { return NoteTypeValue::half; } - else if( value == "whole" ) { return NoteTypeValue::whole; } - else if( value == "breve" ) { return NoteTypeValue::breve; } - else if( value == "long" ) { return NoteTypeValue::long_; } - else if( value == "maxima" ) { return NoteTypeValue::maxima; } - return std::optional{}; - } - - std::string toString( const NoteTypeValue value ) - { - switch ( value ) - { - case NoteTypeValue::oneThousandTwentyFourth: { return "1024th"; } - case NoteTypeValue::fiveHundredTwelfth: { return "512th"; } - case NoteTypeValue::twoHundredFifthySixth: { return "256th"; } - case NoteTypeValue::oneHundredTwentyEighth: { return "128th"; } - case NoteTypeValue::sixtyFourth: { return "64th"; } - case NoteTypeValue::thirtySecond: { return "32nd"; } - case NoteTypeValue::sixteenth: { return "16th"; } - case NoteTypeValue::eighth: { return "eighth"; } - case NoteTypeValue::quarter: { return "quarter"; } - case NoteTypeValue::half: { return "half"; } - case NoteTypeValue::whole: { return "whole"; } - case NoteTypeValue::breve: { return "breve"; } - case NoteTypeValue::long_: { return "long"; } - case NoteTypeValue::maxima: { return "maxima"; } - default: break; - } - return "1024th"; - } - - std::ostream& toStream( std::ostream& os, const NoteTypeValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const NoteTypeValue value ) - { - return toStream( os, value ); - } - - /// NoteheadValue ////////////////////////////////////////////////////////////////////////// - - NoteheadValue parseNoteheadValue( const std::string& value ) - { - const auto opt = tryParseNoteheadValue( value ); - return opt.value_or( NoteheadValue::slash ); - } - - std::optional tryParseNoteheadValue( const std::string& value ) - { - if( value == "slash" ) { return NoteheadValue::slash; } - else if( value == "triangle" ) { return NoteheadValue::triangle; } - else if( value == "diamond" ) { return NoteheadValue::diamond; } - else if( value == "square" ) { return NoteheadValue::square; } - else if( value == "cross" ) { return NoteheadValue::cross; } - else if( value == "x" ) { return NoteheadValue::x; } - else if( value == "circle-x" ) { return NoteheadValue::circleX; } - else if( value == "inverted triangle" ) { return NoteheadValue::invertedTriangle; } - else if( value == "arrow down" ) { return NoteheadValue::arrowDown; } - else if( value == "arrow up" ) { return NoteheadValue::arrowUp; } - else if( value == "slashed" ) { return NoteheadValue::slashed; } - else if( value == "back slashed" ) { return NoteheadValue::backSlashed; } - else if( value == "normal" ) { return NoteheadValue::normal; } - else if( value == "cluster" ) { return NoteheadValue::cluster; } - else if( value == "circle dot" ) { return NoteheadValue::circleDot; } - else if( value == "left triangle" ) { return NoteheadValue::leftTriangle; } - else if( value == "rectangle" ) { return NoteheadValue::rectangle; } - else if( value == "none" ) { return NoteheadValue::none; } - else if( value == "do" ) { return NoteheadValue::do_; } - else if( value == "re" ) { return NoteheadValue::re; } - else if( value == "mi" ) { return NoteheadValue::mi; } - else if( value == "fa" ) { return NoteheadValue::fa; } - else if( value == "fa up" ) { return NoteheadValue::faUp; } - else if( value == "so" ) { return NoteheadValue::so; } - else if( value == "la" ) { return NoteheadValue::la; } - else if( value == "ti" ) { return NoteheadValue::ti; } - return std::optional{}; - } - - std::string toString( const NoteheadValue value ) - { - switch ( value ) - { - case NoteheadValue::slash: { return "slash"; } - case NoteheadValue::triangle: { return "triangle"; } - case NoteheadValue::diamond: { return "diamond"; } - case NoteheadValue::square: { return "square"; } - case NoteheadValue::cross: { return "cross"; } - case NoteheadValue::x: { return "x"; } - case NoteheadValue::circleX: { return "circle-x"; } - case NoteheadValue::invertedTriangle: { return "inverted triangle"; } - case NoteheadValue::arrowDown: { return "arrow down"; } - case NoteheadValue::arrowUp: { return "arrow up"; } - case NoteheadValue::slashed: { return "slashed"; } - case NoteheadValue::backSlashed: { return "back slashed"; } - case NoteheadValue::normal: { return "normal"; } - case NoteheadValue::cluster: { return "cluster"; } - case NoteheadValue::circleDot: { return "circle dot"; } - case NoteheadValue::leftTriangle: { return "left triangle"; } - case NoteheadValue::rectangle: { return "rectangle"; } - case NoteheadValue::none: { return "none"; } - case NoteheadValue::do_: { return "do"; } - case NoteheadValue::re: { return "re"; } - case NoteheadValue::mi: { return "mi"; } - case NoteheadValue::fa: { return "fa"; } - case NoteheadValue::faUp: { return "fa up"; } - case NoteheadValue::so: { return "so"; } - case NoteheadValue::la: { return "la"; } - case NoteheadValue::ti: { return "ti"; } - default: break; - } - return "slash"; - } - - std::ostream& toStream( std::ostream& os, const NoteheadValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const NoteheadValue value ) - { - return toStream( os, value ); - } - - /// OnOff ////////////////////////////////////////////////////////////////////////////////// - - OnOff parseOnOff( const std::string& value ) - { - const auto opt = tryParseOnOff( value ); - return opt.value_or( OnOff::on ); - } - - std::optional tryParseOnOff( const std::string& value ) - { - if( value == "on" ) { return OnOff::on; } - else if( value == "off" ) { return OnOff::off; } - return std::optional{}; - } - - std::string toString( const OnOff value ) - { - switch ( value ) - { - case OnOff::on: { return "on"; } - case OnOff::off: { return "off"; } - default: break; - } - return "on"; - } - - std::ostream& toStream( std::ostream& os, const OnOff value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const OnOff value ) - { - return toStream( os, value ); - } - - /// OverUnder ////////////////////////////////////////////////////////////////////////////// - - OverUnder parseOverUnder( const std::string& value ) - { - const auto opt = tryParseOverUnder( value ); - return opt.value_or( OverUnder::over ); - } - - std::optional tryParseOverUnder( const std::string& value ) - { - if( value == "over" ) { return OverUnder::over; } - else if( value == "under" ) { return OverUnder::under; } - return std::optional{}; - } - - std::string toString( const OverUnder value ) - { - switch ( value ) - { - case OverUnder::over: { return "over"; } - case OverUnder::under: { return "under"; } - default: break; - } - return "over"; - } - - std::ostream& toStream( std::ostream& os, const OverUnder value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const OverUnder value ) - { - return toStream( os, value ); - } - - /// PitchedEnum //////////////////////////////////////////////////////////////////////////// - - PitchedEnum parsePitchedEnum( const std::string& value ) - { - const auto opt = tryParsePitchedEnum( value ); - return opt.value_or( PitchedEnum::chimes ); - } - - std::optional tryParsePitchedEnum( const std::string& value ) - { - if( value == "chimes" ) { return PitchedEnum::chimes; } - else if( value == "glockenspiel" ) { return PitchedEnum::glockenspiel; } - else if( value == "mallet" ) { return PitchedEnum::mallet; } - else if( value == "marimba" ) { return PitchedEnum::marimba; } - else if( value == "tubular chimes" ) { return PitchedEnum::tubularChimes; } - else if( value == "vibraphone" ) { return PitchedEnum::vibraphone; } - else if( value == "xylophone" ) { return PitchedEnum::xylophone; } - return std::optional{}; - } - - std::string toString( const PitchedEnum value ) - { - switch ( value ) - { - case PitchedEnum::chimes: { return "chimes"; } - case PitchedEnum::glockenspiel: { return "glockenspiel"; } - case PitchedEnum::mallet: { return "mallet"; } - case PitchedEnum::marimba: { return "marimba"; } - case PitchedEnum::tubularChimes: { return "tubular chimes"; } - case PitchedEnum::vibraphone: { return "vibraphone"; } - case PitchedEnum::xylophone: { return "xylophone"; } - default: break; - } - return "chimes"; - } - - std::ostream& toStream( std::ostream& os, const PitchedEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const PitchedEnum value ) - { - return toStream( os, value ); - } - - /// PrincipalVoiceSymbol /////////////////////////////////////////////////////////////////// - - PrincipalVoiceSymbol parsePrincipalVoiceSymbol( const std::string& value ) - { - const auto opt = tryParsePrincipalVoiceSymbol( value ); - return opt.value_or( PrincipalVoiceSymbol::hauptstimme ); - } - - std::optional tryParsePrincipalVoiceSymbol( const std::string& value ) - { - if( value == "Hauptstimme" ) { return PrincipalVoiceSymbol::hauptstimme; } - else if( value == "Nebenstimme" ) { return PrincipalVoiceSymbol::nebenstimme; } - else if( value == "plain" ) { return PrincipalVoiceSymbol::plain; } - else if( value == "none" ) { return PrincipalVoiceSymbol::none; } - return std::optional{}; - } - - std::string toString( const PrincipalVoiceSymbol value ) - { - switch ( value ) - { - case PrincipalVoiceSymbol::hauptstimme: { return "Hauptstimme"; } - case PrincipalVoiceSymbol::nebenstimme: { return "Nebenstimme"; } - case PrincipalVoiceSymbol::plain: { return "plain"; } - case PrincipalVoiceSymbol::none: { return "none"; } - default: break; - } - return "Hauptstimme"; - } - - std::ostream& toStream( std::ostream& os, const PrincipalVoiceSymbol value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const PrincipalVoiceSymbol value ) - { - return toStream( os, value ); - } - - /// RightLeftMiddle //////////////////////////////////////////////////////////////////////// - - RightLeftMiddle parseRightLeftMiddle( const std::string& value ) - { - const auto opt = tryParseRightLeftMiddle( value ); - return opt.value_or( RightLeftMiddle::right ); - } - - std::optional tryParseRightLeftMiddle( const std::string& value ) - { - if( value == "right" ) { return RightLeftMiddle::right; } - else if( value == "left" ) { return RightLeftMiddle::left; } - else if( value == "middle" ) { return RightLeftMiddle::middle; } - return std::optional{}; - } - - std::string toString( const RightLeftMiddle value ) - { - switch ( value ) - { - case RightLeftMiddle::right: { return "right"; } - case RightLeftMiddle::left: { return "left"; } - case RightLeftMiddle::middle: { return "middle"; } - default: break; - } - return "right"; - } - - std::ostream& toStream( std::ostream& os, const RightLeftMiddle value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const RightLeftMiddle value ) - { - return toStream( os, value ); - } - - /// SemiPitchedEnum //////////////////////////////////////////////////////////////////////// - - SemiPitchedEnum parseSemiPitchedEnum( const std::string& value ) - { - const auto opt = tryParseSemiPitchedEnum( value ); - return opt.value_or( SemiPitchedEnum::high ); - } - - std::optional tryParseSemiPitchedEnum( const std::string& value ) - { - if( value == "high" ) { return SemiPitchedEnum::high; } - else if( value == "medium-high" ) { return SemiPitchedEnum::mediumHigh; } - else if( value == "medium" ) { return SemiPitchedEnum::medium; } - else if( value == "medium-low" ) { return SemiPitchedEnum::mediumLow; } - else if( value == "low" ) { return SemiPitchedEnum::low; } - else if( value == "very-low" ) { return SemiPitchedEnum::veryLow; } - return std::optional{}; - } - - std::string toString( const SemiPitchedEnum value ) - { - switch ( value ) - { - case SemiPitchedEnum::high: { return "high"; } - case SemiPitchedEnum::mediumHigh: { return "medium-high"; } - case SemiPitchedEnum::medium: { return "medium"; } - case SemiPitchedEnum::mediumLow: { return "medium-low"; } - case SemiPitchedEnum::low: { return "low"; } - case SemiPitchedEnum::veryLow: { return "very-low"; } - default: break; - } - return "high"; - } - - std::ostream& toStream( std::ostream& os, const SemiPitchedEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const SemiPitchedEnum value ) - { - return toStream( os, value ); - } - - /// ShowFrets ////////////////////////////////////////////////////////////////////////////// - - ShowFrets parseShowFrets( const std::string& value ) - { - const auto opt = tryParseShowFrets( value ); - return opt.value_or( ShowFrets::numbers ); - } - - std::optional tryParseShowFrets( const std::string& value ) - { - if( value == "numbers" ) { return ShowFrets::numbers; } - else if( value == "letters" ) { return ShowFrets::letters; } - return std::optional{}; - } - - std::string toString( const ShowFrets value ) - { - switch ( value ) - { - case ShowFrets::numbers: { return "numbers"; } - case ShowFrets::letters: { return "letters"; } - default: break; - } - return "numbers"; - } - - std::ostream& toStream( std::ostream& os, const ShowFrets value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ShowFrets value ) - { - return toStream( os, value ); - } - - /// ShowTuplet ///////////////////////////////////////////////////////////////////////////// - - ShowTuplet parseShowTuplet( const std::string& value ) - { - const auto opt = tryParseShowTuplet( value ); - return opt.value_or( ShowTuplet::actual ); - } - - std::optional tryParseShowTuplet( const std::string& value ) - { - if( value == "actual" ) { return ShowTuplet::actual; } - else if( value == "both" ) { return ShowTuplet::both; } - else if( value == "none" ) { return ShowTuplet::none; } - return std::optional{}; - } - - std::string toString( const ShowTuplet value ) - { - switch ( value ) - { - case ShowTuplet::actual: { return "actual"; } - case ShowTuplet::both: { return "both"; } - case ShowTuplet::none: { return "none"; } - default: break; - } - return "actual"; - } - - std::ostream& toStream( std::ostream& os, const ShowTuplet value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ShowTuplet value ) - { - return toStream( os, value ); - } - - /// StaffTypeEnum ////////////////////////////////////////////////////////////////////////// - - StaffTypeEnum parseStaffTypeEnum( const std::string& value ) - { - const auto opt = tryParseStaffTypeEnum( value ); - return opt.value_or( StaffTypeEnum::ossia ); - } - - std::optional tryParseStaffTypeEnum( const std::string& value ) - { - if( value == "ossia" ) { return StaffTypeEnum::ossia; } - else if( value == "cue" ) { return StaffTypeEnum::cue; } - else if( value == "editorial" ) { return StaffTypeEnum::editorial; } - else if( value == "regular" ) { return StaffTypeEnum::regular; } - else if( value == "alternate" ) { return StaffTypeEnum::alternate; } - return std::optional{}; - } - - std::string toString( const StaffTypeEnum value ) - { - switch ( value ) - { - case StaffTypeEnum::ossia: { return "ossia"; } - case StaffTypeEnum::cue: { return "cue"; } - case StaffTypeEnum::editorial: { return "editorial"; } - case StaffTypeEnum::regular: { return "regular"; } - case StaffTypeEnum::alternate: { return "alternate"; } - default: break; - } - return "ossia"; - } - - std::ostream& toStream( std::ostream& os, const StaffTypeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StaffTypeEnum value ) - { - return toStream( os, value ); - } - - /// StartNote ////////////////////////////////////////////////////////////////////////////// - - StartNote parseStartNote( const std::string& value ) - { - const auto opt = tryParseStartNote( value ); - return opt.value_or( StartNote::upper ); - } - - std::optional tryParseStartNote( const std::string& value ) - { - if( value == "upper" ) { return StartNote::upper; } - else if( value == "main" ) { return StartNote::main; } - else if( value == "below" ) { return StartNote::below; } - return std::optional{}; - } - - std::string toString( const StartNote value ) - { - switch ( value ) - { - case StartNote::upper: { return "upper"; } - case StartNote::main: { return "main"; } - case StartNote::below: { return "below"; } - default: break; - } - return "upper"; - } - - std::ostream& toStream( std::ostream& os, const StartNote value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartNote value ) - { - return toStream( os, value ); - } - - /// StartStop ////////////////////////////////////////////////////////////////////////////// - - StartStop parseStartStop( const std::string& value ) - { - const auto opt = tryParseStartStop( value ); - return opt.value_or( StartStop::start ); - } - - std::optional tryParseStartStop( const std::string& value ) - { - if( value == "start" ) { return StartStop::start; } - else if( value == "stop" ) { return StartStop::stop; } - return std::optional{}; - } - - std::string toString( const StartStop value ) - { - switch ( value ) - { - case StartStop::start: { return "start"; } - case StartStop::stop: { return "stop"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStop value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStop value ) - { - return toStream( os, value ); - } - - /// StartStopChangeContinue //////////////////////////////////////////////////////////////// - - StartStopChangeContinue parseStartStopChangeContinue( const std::string& value ) - { - const auto opt = tryParseStartStopChangeContinue( value ); - return opt.value_or( StartStopChangeContinue::start ); - } - - std::optional tryParseStartStopChangeContinue( const std::string& value ) - { - if( value == "start" ) { return StartStopChangeContinue::start; } - else if( value == "stop" ) { return StartStopChangeContinue::stop; } - else if( value == "change" ) { return StartStopChangeContinue::change; } - else if( value == "continue" ) { return StartStopChangeContinue::continue_; } - return std::optional{}; - } - - std::string toString( const StartStopChangeContinue value ) - { - switch ( value ) - { - case StartStopChangeContinue::start: { return "start"; } - case StartStopChangeContinue::stop: { return "stop"; } - case StartStopChangeContinue::change: { return "change"; } - case StartStopChangeContinue::continue_: { return "continue"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStopChangeContinue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStopChangeContinue value ) - { - return toStream( os, value ); - } - - /// StartStopContinue ////////////////////////////////////////////////////////////////////// - - StartStopContinue parseStartStopContinue( const std::string& value ) - { - const auto opt = tryParseStartStopContinue( value ); - return opt.value_or( StartStopContinue::start ); - } - - std::optional tryParseStartStopContinue( const std::string& value ) - { - if( value == "start" ) { return StartStopContinue::start; } - else if( value == "stop" ) { return StartStopContinue::stop; } - else if( value == "continue" ) { return StartStopContinue::continue_; } - return std::optional{}; - } - - std::string toString( const StartStopContinue value ) - { - switch ( value ) - { - case StartStopContinue::start: { return "start"; } - case StartStopContinue::stop: { return "stop"; } - case StartStopContinue::continue_: { return "continue"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStopContinue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStopContinue value ) - { - return toStream( os, value ); - } - - /// StartStopDiscontinue /////////////////////////////////////////////////////////////////// - - StartStopDiscontinue parseStartStopDiscontinue( const std::string& value ) - { - const auto opt = tryParseStartStopDiscontinue( value ); - return opt.value_or( StartStopDiscontinue::start ); - } - - std::optional tryParseStartStopDiscontinue( const std::string& value ) - { - if( value == "start" ) { return StartStopDiscontinue::start; } - else if( value == "stop" ) { return StartStopDiscontinue::stop; } - else if( value == "discontinue" ) { return StartStopDiscontinue::discontinue; } - return std::optional{}; - } - - std::string toString( const StartStopDiscontinue value ) - { - switch ( value ) - { - case StartStopDiscontinue::start: { return "start"; } - case StartStopDiscontinue::stop: { return "stop"; } - case StartStopDiscontinue::discontinue: { return "discontinue"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStopDiscontinue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStopDiscontinue value ) - { - return toStream( os, value ); - } - - /// StartStopSingle //////////////////////////////////////////////////////////////////////// - - StartStopSingle parseStartStopSingle( const std::string& value ) - { - const auto opt = tryParseStartStopSingle( value ); - return opt.value_or( StartStopSingle::start ); - } - - std::optional tryParseStartStopSingle( const std::string& value ) - { - if( value == "start" ) { return StartStopSingle::start; } - else if( value == "stop" ) { return StartStopSingle::stop; } - else if( value == "single" ) { return StartStopSingle::single; } - return std::optional{}; - } - - std::string toString( const StartStopSingle value ) - { - switch ( value ) - { - case StartStopSingle::start: { return "start"; } - case StartStopSingle::stop: { return "stop"; } - case StartStopSingle::single: { return "single"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStopSingle value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStopSingle value ) - { - return toStream( os, value ); - } - - /// StemValue ////////////////////////////////////////////////////////////////////////////// - - StemValue parseStemValue( const std::string& value ) - { - const auto opt = tryParseStemValue( value ); - return opt.value_or( StemValue::down ); - } - - std::optional tryParseStemValue( const std::string& value ) - { - if( value == "down" ) { return StemValue::down; } - else if( value == "up" ) { return StemValue::up; } - else if( value == "double" ) { return StemValue::double_; } - else if( value == "none" ) { return StemValue::none; } - return std::optional{}; - } - - std::string toString( const StemValue value ) - { - switch ( value ) - { - case StemValue::down: { return "down"; } - case StemValue::up: { return "up"; } - case StemValue::double_: { return "double"; } - case StemValue::none: { return "none"; } - default: break; - } - return "down"; - } - - std::ostream& toStream( std::ostream& os, const StemValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StemValue value ) - { - return toStream( os, value ); - } - - /// StepEnum /////////////////////////////////////////////////////////////////////////////// - - StepEnum parseStepEnum( const std::string& value ) - { - const auto opt = tryParseStepEnum( value ); - return opt.value_or( StepEnum::a ); - } - - std::optional tryParseStepEnum( const std::string& value ) - { - if( value == "A" ) { return StepEnum::a; } - else if( value == "B" ) { return StepEnum::b; } - else if( value == "C" ) { return StepEnum::c; } - else if( value == "D" ) { return StepEnum::d; } - else if( value == "E" ) { return StepEnum::e; } - else if( value == "F" ) { return StepEnum::f; } - else if( value == "G" ) { return StepEnum::g; } - return std::optional{}; - } - - std::string toString( const StepEnum value ) - { - switch ( value ) - { - case StepEnum::a: { return "A"; } - case StepEnum::b: { return "B"; } - case StepEnum::c: { return "C"; } - case StepEnum::d: { return "D"; } - case StepEnum::e: { return "E"; } - case StepEnum::f: { return "F"; } - case StepEnum::g: { return "G"; } - default: break; - } - return "A"; - } - - std::ostream& toStream( std::ostream& os, const StepEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StepEnum value ) - { - return toStream( os, value ); - } - - /// StickLocationEnum ////////////////////////////////////////////////////////////////////// - - StickLocationEnum parseStickLocationEnum( const std::string& value ) - { - const auto opt = tryParseStickLocationEnum( value ); - return opt.value_or( StickLocationEnum::center ); - } - - std::optional tryParseStickLocationEnum( const std::string& value ) - { - if( value == "center" ) { return StickLocationEnum::center; } - else if( value == "rim" ) { return StickLocationEnum::rim; } - else if( value == "cymbal bell" ) { return StickLocationEnum::cymbalBell; } - else if( value == "cymbal edge" ) { return StickLocationEnum::cymbalEdge; } - return std::optional{}; - } - - std::string toString( const StickLocationEnum value ) - { - switch ( value ) - { - case StickLocationEnum::center: { return "center"; } - case StickLocationEnum::rim: { return "rim"; } - case StickLocationEnum::cymbalBell: { return "cymbal bell"; } - case StickLocationEnum::cymbalEdge: { return "cymbal edge"; } - default: break; - } - return "center"; - } - - std::ostream& toStream( std::ostream& os, const StickLocationEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StickLocationEnum value ) - { - return toStream( os, value ); - } - - /// StickMaterialEnum ////////////////////////////////////////////////////////////////////// - - StickMaterialEnum parseStickMaterialEnum( const std::string& value ) - { - const auto opt = tryParseStickMaterialEnum( value ); - return opt.value_or( StickMaterialEnum::soft ); - } - - std::optional tryParseStickMaterialEnum( const std::string& value ) - { - if( value == "soft" ) { return StickMaterialEnum::soft; } - else if( value == "medium" ) { return StickMaterialEnum::medium; } - else if( value == "hard" ) { return StickMaterialEnum::hard; } - else if( value == "shaded" ) { return StickMaterialEnum::shaded; } - else if( value == "x" ) { return StickMaterialEnum::x; } - return std::optional{}; - } - - std::string toString( const StickMaterialEnum value ) - { - switch ( value ) - { - case StickMaterialEnum::soft: { return "soft"; } - case StickMaterialEnum::medium: { return "medium"; } - case StickMaterialEnum::hard: { return "hard"; } - case StickMaterialEnum::shaded: { return "shaded"; } - case StickMaterialEnum::x: { return "x"; } - default: break; - } - return "soft"; - } - - std::ostream& toStream( std::ostream& os, const StickMaterialEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StickMaterialEnum value ) - { - return toStream( os, value ); - } - - /// StickTypeEnum ////////////////////////////////////////////////////////////////////////// - - StickTypeEnum parseStickTypeEnum( const std::string& value ) - { - const auto opt = tryParseStickTypeEnum( value ); - return opt.value_or( StickTypeEnum::bassDrum ); - } - - std::optional tryParseStickTypeEnum( const std::string& value ) - { - if( value == "bass drum" ) { return StickTypeEnum::bassDrum; } - else if( value == "double bass drum" ) { return StickTypeEnum::doubleBassDrum; } - else if( value == "timpani" ) { return StickTypeEnum::timpani; } - else if( value == "xylophone" ) { return StickTypeEnum::xylophone; } - else if( value == "yarn" ) { return StickTypeEnum::yarn; } - return std::optional{}; - } - - std::string toString( const StickTypeEnum value ) - { - switch ( value ) - { - case StickTypeEnum::bassDrum: { return "bass drum"; } - case StickTypeEnum::doubleBassDrum: { return "double bass drum"; } - case StickTypeEnum::timpani: { return "timpani"; } - case StickTypeEnum::xylophone: { return "xylophone"; } - case StickTypeEnum::yarn: { return "yarn"; } - default: break; - } - return "bass drum"; - } - - std::ostream& toStream( std::ostream& os, const StickTypeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StickTypeEnum value ) - { - return toStream( os, value ); - } - - /// SyllabicEnum /////////////////////////////////////////////////////////////////////////// - - SyllabicEnum parseSyllabicEnum( const std::string& value ) - { - const auto opt = tryParseSyllabicEnum( value ); - return opt.value_or( SyllabicEnum::single ); - } - - std::optional tryParseSyllabicEnum( const std::string& value ) - { - if( value == "single" ) { return SyllabicEnum::single; } - else if( value == "begin" ) { return SyllabicEnum::begin; } - else if( value == "end" ) { return SyllabicEnum::end; } - else if( value == "middle" ) { return SyllabicEnum::middle; } - return std::optional{}; - } - - std::string toString( const SyllabicEnum value ) - { - switch ( value ) - { - case SyllabicEnum::single: { return "single"; } - case SyllabicEnum::begin: { return "begin"; } - case SyllabicEnum::end: { return "end"; } - case SyllabicEnum::middle: { return "middle"; } - default: break; - } - return "single"; - } - - std::ostream& toStream( std::ostream& os, const SyllabicEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const SyllabicEnum value ) - { - return toStream( os, value ); - } - - /// SymbolSize ///////////////////////////////////////////////////////////////////////////// - - SymbolSize parseSymbolSize( const std::string& value ) - { - const auto opt = tryParseSymbolSize( value ); - return opt.value_or( SymbolSize::full ); - } - - std::optional tryParseSymbolSize( const std::string& value ) - { - if( value == "full" ) { return SymbolSize::full; } - else if( value == "cue" ) { return SymbolSize::cue; } - else if( value == "large" ) { return SymbolSize::large; } - return std::optional{}; - } - - std::string toString( const SymbolSize value ) - { - switch ( value ) - { - case SymbolSize::full: { return "full"; } - case SymbolSize::cue: { return "cue"; } - case SymbolSize::large: { return "large"; } - default: break; - } - return "full"; - } - - std::ostream& toStream( std::ostream& os, const SymbolSize value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const SymbolSize value ) - { - return toStream( os, value ); - } - - /// TextDirection ////////////////////////////////////////////////////////////////////////// - - TextDirection parseTextDirection( const std::string& value ) - { - const auto opt = tryParseTextDirection( value ); - return opt.value_or( TextDirection::ltr ); - } - - std::optional tryParseTextDirection( const std::string& value ) - { - if( value == "ltr" ) { return TextDirection::ltr; } - else if( value == "rtl" ) { return TextDirection::rtl; } - else if( value == "lro" ) { return TextDirection::lro; } - else if( value == "rlo" ) { return TextDirection::rlo; } - return std::optional{}; - } - - std::string toString( const TextDirection value ) - { - switch ( value ) - { - case TextDirection::ltr: { return "ltr"; } - case TextDirection::rtl: { return "rtl"; } - case TextDirection::lro: { return "lro"; } - case TextDirection::rlo: { return "rlo"; } - default: break; - } - return "ltr"; - } - - std::ostream& toStream( std::ostream& os, const TextDirection value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TextDirection value ) - { - return toStream( os, value ); - } - - /// TimeRelationEnum /////////////////////////////////////////////////////////////////////// - - TimeRelationEnum parseTimeRelationEnum( const std::string& value ) - { - const auto opt = tryParseTimeRelationEnum( value ); - return opt.value_or( TimeRelationEnum::parentheses ); - } - - std::optional tryParseTimeRelationEnum( const std::string& value ) - { - if( value == "parentheses" ) { return TimeRelationEnum::parentheses; } - else if( value == "bracket" ) { return TimeRelationEnum::bracket; } - else if( value == "equals" ) { return TimeRelationEnum::equals; } - else if( value == "slash" ) { return TimeRelationEnum::slash; } - else if( value == "space" ) { return TimeRelationEnum::space; } - else if( value == "hyphen" ) { return TimeRelationEnum::hyphen; } - return std::optional{}; - } - - std::string toString( const TimeRelationEnum value ) - { - switch ( value ) - { - case TimeRelationEnum::parentheses: { return "parentheses"; } - case TimeRelationEnum::bracket: { return "bracket"; } - case TimeRelationEnum::equals: { return "equals"; } - case TimeRelationEnum::slash: { return "slash"; } - case TimeRelationEnum::space: { return "space"; } - case TimeRelationEnum::hyphen: { return "hyphen"; } - default: break; - } - return "parentheses"; - } - - std::ostream& toStream( std::ostream& os, const TimeRelationEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TimeRelationEnum value ) - { - return toStream( os, value ); - } - - /// TimeSeparator ////////////////////////////////////////////////////////////////////////// - - TimeSeparator parseTimeSeparator( const std::string& value ) - { - const auto opt = tryParseTimeSeparator( value ); - return opt.value_or( TimeSeparator::none ); - } - - std::optional tryParseTimeSeparator( const std::string& value ) - { - if( value == "none" ) { return TimeSeparator::none; } - else if( value == "horizontal" ) { return TimeSeparator::horizontal; } - else if( value == "diagonal" ) { return TimeSeparator::diagonal; } - else if( value == "vertical" ) { return TimeSeparator::vertical; } - else if( value == "adjacent" ) { return TimeSeparator::adjacent; } - return std::optional{}; - } - - std::string toString( const TimeSeparator value ) - { - switch ( value ) - { - case TimeSeparator::none: { return "none"; } - case TimeSeparator::horizontal: { return "horizontal"; } - case TimeSeparator::diagonal: { return "diagonal"; } - case TimeSeparator::vertical: { return "vertical"; } - case TimeSeparator::adjacent: { return "adjacent"; } - default: break; - } - return "none"; - } - - std::ostream& toStream( std::ostream& os, const TimeSeparator value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TimeSeparator value ) - { - return toStream( os, value ); - } - - /// TimeSymbol ///////////////////////////////////////////////////////////////////////////// - - TimeSymbol parseTimeSymbol( const std::string& value ) - { - const auto opt = tryParseTimeSymbol( value ); - return opt.value_or( TimeSymbol::common ); - } - - std::optional tryParseTimeSymbol( const std::string& value ) - { - if( value == "common" ) { return TimeSymbol::common; } - else if( value == "cut" ) { return TimeSymbol::cut; } - else if( value == "single-number" ) { return TimeSymbol::singleNumber; } - else if( value == "note" ) { return TimeSymbol::note; } - else if( value == "dotted-note" ) { return TimeSymbol::dottedNote; } - else if( value == "normal" ) { return TimeSymbol::normal; } - return std::optional{}; - } - - std::string toString( const TimeSymbol value ) - { - switch ( value ) - { - case TimeSymbol::common: { return "common"; } - case TimeSymbol::cut: { return "cut"; } - case TimeSymbol::singleNumber: { return "single-number"; } - case TimeSymbol::note: { return "note"; } - case TimeSymbol::dottedNote: { return "dotted-note"; } - case TimeSymbol::normal: { return "normal"; } - default: break; - } - return "common"; - } - - std::ostream& toStream( std::ostream& os, const TimeSymbol value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TimeSymbol value ) - { - return toStream( os, value ); - } - - /// TipDirection /////////////////////////////////////////////////////////////////////////// - - TipDirection parseTipDirection( const std::string& value ) - { - const auto opt = tryParseTipDirection( value ); - return opt.value_or( TipDirection::up ); - } - - std::optional tryParseTipDirection( const std::string& value ) - { - if( value == "up" ) { return TipDirection::up; } - else if( value == "down" ) { return TipDirection::down; } - else if( value == "left" ) { return TipDirection::left; } - else if( value == "right" ) { return TipDirection::right; } - else if( value == "northwest" ) { return TipDirection::northwest; } - else if( value == "northeast" ) { return TipDirection::northeast; } - else if( value == "southeast" ) { return TipDirection::southeast; } - else if( value == "southwest" ) { return TipDirection::southwest; } - return std::optional{}; - } - - std::string toString( const TipDirection value ) - { - switch ( value ) - { - case TipDirection::up: { return "up"; } - case TipDirection::down: { return "down"; } - case TipDirection::left: { return "left"; } - case TipDirection::right: { return "right"; } - case TipDirection::northwest: { return "northwest"; } - case TipDirection::northeast: { return "northeast"; } - case TipDirection::southeast: { return "southeast"; } - case TipDirection::southwest: { return "southwest"; } - default: break; - } - return "up"; - } - - std::ostream& toStream( std::ostream& os, const TipDirection value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TipDirection value ) - { - return toStream( os, value ); - } - - /// TopBottom ////////////////////////////////////////////////////////////////////////////// - - TopBottom parseTopBottom( const std::string& value ) - { - const auto opt = tryParseTopBottom( value ); - return opt.value_or( TopBottom::top ); - } - - std::optional tryParseTopBottom( const std::string& value ) - { - if( value == "top" ) { return TopBottom::top; } - else if( value == "bottom" ) { return TopBottom::bottom; } - return std::optional{}; - } - - std::string toString( const TopBottom value ) - { - switch ( value ) - { - case TopBottom::top: { return "top"; } - case TopBottom::bottom: { return "bottom"; } - default: break; - } - return "top"; - } - - std::ostream& toStream( std::ostream& os, const TopBottom value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TopBottom value ) - { - return toStream( os, value ); - } - - /// TrillStep ////////////////////////////////////////////////////////////////////////////// - - TrillStep parseTrillStep( const std::string& value ) - { - const auto opt = tryParseTrillStep( value ); - return opt.value_or( TrillStep::whole ); - } - - std::optional tryParseTrillStep( const std::string& value ) - { - if( value == "whole" ) { return TrillStep::whole; } - else if( value == "half" ) { return TrillStep::half; } - else if( value == "unison" ) { return TrillStep::unison; } - return std::optional{}; - } - - std::string toString( const TrillStep value ) - { - switch ( value ) - { - case TrillStep::whole: { return "whole"; } - case TrillStep::half: { return "half"; } - case TrillStep::unison: { return "unison"; } - default: break; - } - return "whole"; - } - - std::ostream& toStream( std::ostream& os, const TrillStep value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TrillStep value ) - { - return toStream( os, value ); - } - - /// TwoNoteTurn //////////////////////////////////////////////////////////////////////////// - - TwoNoteTurn parseTwoNoteTurn( const std::string& value ) - { - const auto opt = tryParseTwoNoteTurn( value ); - return opt.value_or( TwoNoteTurn::whole ); - } - - std::optional tryParseTwoNoteTurn( const std::string& value ) - { - if( value == "whole" ) { return TwoNoteTurn::whole; } - else if( value == "half" ) { return TwoNoteTurn::half; } - else if( value == "none" ) { return TwoNoteTurn::none; } - return std::optional{}; - } - - std::string toString( const TwoNoteTurn value ) - { - switch ( value ) - { - case TwoNoteTurn::whole: { return "whole"; } - case TwoNoteTurn::half: { return "half"; } - case TwoNoteTurn::none: { return "none"; } - default: break; - } - return "whole"; - } - - std::ostream& toStream( std::ostream& os, const TwoNoteTurn value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TwoNoteTurn value ) - { - return toStream( os, value ); - } - - /// UpDown ///////////////////////////////////////////////////////////////////////////////// - - UpDown parseUpDown( const std::string& value ) - { - const auto opt = tryParseUpDown( value ); - return opt.value_or( UpDown::up ); - } - - std::optional tryParseUpDown( const std::string& value ) - { - if( value == "up" ) { return UpDown::up; } - else if( value == "down" ) { return UpDown::down; } - return std::optional{}; - } - - std::string toString( const UpDown value ) - { - switch ( value ) - { - case UpDown::up: { return "up"; } - case UpDown::down: { return "down"; } - default: break; - } - return "up"; - } - - std::ostream& toStream( std::ostream& os, const UpDown value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const UpDown value ) - { - return toStream( os, value ); - } - - /// UpDownStopContinue ///////////////////////////////////////////////////////////////////// - - UpDownStopContinue parseUpDownStopContinue( const std::string& value ) - { - const auto opt = tryParseUpDownStopContinue( value ); - return opt.value_or( UpDownStopContinue::up ); - } - - std::optional tryParseUpDownStopContinue( const std::string& value ) - { - if( value == "up" ) { return UpDownStopContinue::up; } - else if( value == "down" ) { return UpDownStopContinue::down; } - else if( value == "stop" ) { return UpDownStopContinue::stop; } - else if( value == "continue" ) { return UpDownStopContinue::continue_; } - return std::optional{}; - } - - std::string toString( const UpDownStopContinue value ) - { - switch ( value ) - { - case UpDownStopContinue::up: { return "up"; } - case UpDownStopContinue::down: { return "down"; } - case UpDownStopContinue::stop: { return "stop"; } - case UpDownStopContinue::continue_: { return "continue"; } - default: break; - } - return "up"; - } - - std::ostream& toStream( std::ostream& os, const UpDownStopContinue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const UpDownStopContinue value ) - { - return toStream( os, value ); - } - - /// UprightInverted //////////////////////////////////////////////////////////////////////// - - UprightInverted parseUprightInverted( const std::string& value ) - { - const auto opt = tryParseUprightInverted( value ); - return opt.value_or( UprightInverted::upright ); - } - - std::optional tryParseUprightInverted( const std::string& value ) - { - if( value == "upright" ) { return UprightInverted::upright; } - else if( value == "inverted" ) { return UprightInverted::inverted; } - return std::optional{}; - } - - std::string toString( const UprightInverted value ) - { - switch ( value ) - { - case UprightInverted::upright: { return "upright"; } - case UprightInverted::inverted: { return "inverted"; } - default: break; - } - return "upright"; - } - - std::ostream& toStream( std::ostream& os, const UprightInverted value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const UprightInverted value ) - { - return toStream( os, value ); - } - - /// Valign ///////////////////////////////////////////////////////////////////////////////// - - Valign parseValign( const std::string& value ) - { - const auto opt = tryParseValign( value ); - return opt.value_or( Valign::top ); - } - - std::optional tryParseValign( const std::string& value ) - { - if( value == "top" ) { return Valign::top; } - else if( value == "middle" ) { return Valign::middle; } - else if( value == "bottom" ) { return Valign::bottom; } - else if( value == "baseline" ) { return Valign::baseline; } - return std::optional{}; - } - - std::string toString( const Valign value ) - { - switch ( value ) - { - case Valign::top: { return "top"; } - case Valign::middle: { return "middle"; } - case Valign::bottom: { return "bottom"; } - case Valign::baseline: { return "baseline"; } - default: break; - } - return "top"; - } - - std::ostream& toStream( std::ostream& os, const Valign value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const Valign value ) - { - return toStream( os, value ); - } - - /// ValignImage //////////////////////////////////////////////////////////////////////////// - - ValignImage parseValignImage( const std::string& value ) - { - const auto opt = tryParseValignImage( value ); - return opt.value_or( ValignImage::top ); - } - - std::optional tryParseValignImage( const std::string& value ) - { - if( value == "top" ) { return ValignImage::top; } - else if( value == "middle" ) { return ValignImage::middle; } - else if( value == "bottom" ) { return ValignImage::bottom; } - return std::optional{}; - } - - std::string toString( const ValignImage value ) - { - switch ( value ) - { - case ValignImage::top: { return "top"; } - case ValignImage::middle: { return "middle"; } - case ValignImage::bottom: { return "bottom"; } - default: break; - } - return "top"; - } - - std::ostream& toStream( std::ostream& os, const ValignImage value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ValignImage value ) - { - return toStream( os, value ); - } - - /// WedgeType ////////////////////////////////////////////////////////////////////////////// - - WedgeType parseWedgeType( const std::string& value ) - { - const auto opt = tryParseWedgeType( value ); - return opt.value_or( WedgeType::crescendo ); - } - - std::optional tryParseWedgeType( const std::string& value ) - { - if( value == "crescendo" ) { return WedgeType::crescendo; } - else if( value == "diminuendo" ) { return WedgeType::diminuendo; } - else if( value == "stop" ) { return WedgeType::stop; } - else if( value == "continue" ) { return WedgeType::continue_; } - return std::optional{}; - } - - std::string toString( const WedgeType value ) - { - switch ( value ) - { - case WedgeType::crescendo: { return "crescendo"; } - case WedgeType::diminuendo: { return "diminuendo"; } - case WedgeType::stop: { return "stop"; } - case WedgeType::continue_: { return "continue"; } - default: break; - } - return "crescendo"; - } - - std::ostream& toStream( std::ostream& os, const WedgeType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const WedgeType value ) - { - return toStream( os, value ); - } - - /// Winged ///////////////////////////////////////////////////////////////////////////////// - - Winged parseWinged( const std::string& value ) - { - const auto opt = tryParseWinged( value ); - return opt.value_or( Winged::none ); - } - - std::optional tryParseWinged( const std::string& value ) - { - if( value == "none" ) { return Winged::none; } - else if( value == "straight" ) { return Winged::straight; } - else if( value == "curved" ) { return Winged::curved; } - else if( value == "double-straight" ) { return Winged::doubleStraight; } - else if( value == "double-curved" ) { return Winged::doubleCurved; } - return std::optional{}; - } - - std::string toString( const Winged value ) - { - switch ( value ) - { - case Winged::none: { return "none"; } - case Winged::straight: { return "straight"; } - case Winged::curved: { return "curved"; } - case Winged::doubleStraight: { return "double-straight"; } - case Winged::doubleCurved: { return "double-curved"; } - default: break; - } - return "none"; - } - - std::ostream& toStream( std::ostream& os, const Winged value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const Winged value ) - { - return toStream( os, value ); - } - - /// WoodEnum /////////////////////////////////////////////////////////////////////////////// - - WoodEnum parseWoodEnum( const std::string& value ) - { - const auto opt = tryParseWoodEnum( value ); - return opt.value_or( WoodEnum::boardClapper ); - } - - std::optional tryParseWoodEnum( const std::string& value ) - { - if( value == "board clapper" ) { return WoodEnum::boardClapper; } - else if( value == "cabasa" ) { return WoodEnum::cabasa; } - else if( value == "castanets" ) { return WoodEnum::castanets; } - else if( value == "claves" ) { return WoodEnum::claves; } - else if( value == "guiro" ) { return WoodEnum::guiro; } - else if( value == "log drum" ) { return WoodEnum::logDrum; } - else if( value == "maraca" ) { return WoodEnum::maraca; } - else if( value == "maracas" ) { return WoodEnum::maracas; } - else if( value == "ratchet" ) { return WoodEnum::ratchet; } - else if( value == "sandpaper blocks" ) { return WoodEnum::sandpaperBlocks; } - else if( value == "slit drum" ) { return WoodEnum::slitDrum; } - else if( value == "temple block" ) { return WoodEnum::templeBlock; } - else if( value == "vibraslap" ) { return WoodEnum::vibraslap; } - else if( value == "wood block" ) { return WoodEnum::woodBlock; } - return std::optional{}; - } - - std::string toString( const WoodEnum value ) - { - switch ( value ) - { - case WoodEnum::boardClapper: { return "board clapper"; } - case WoodEnum::cabasa: { return "cabasa"; } - case WoodEnum::castanets: { return "castanets"; } - case WoodEnum::claves: { return "claves"; } - case WoodEnum::guiro: { return "guiro"; } - case WoodEnum::logDrum: { return "log drum"; } - case WoodEnum::maraca: { return "maraca"; } - case WoodEnum::maracas: { return "maracas"; } - case WoodEnum::ratchet: { return "ratchet"; } - case WoodEnum::sandpaperBlocks: { return "sandpaper blocks"; } - case WoodEnum::slitDrum: { return "slit drum"; } - case WoodEnum::templeBlock: { return "temple block"; } - case WoodEnum::vibraslap: { return "vibraslap"; } - case WoodEnum::woodBlock: { return "wood block"; } - default: break; - } - return "board clapper"; - } - - std::ostream& toStream( std::ostream& os, const WoodEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const WoodEnum value ) - { - return toStream( os, value ); - } - - /// YesNo ////////////////////////////////////////////////////////////////////////////////// - - YesNo parseYesNo( const std::string& value ) - { - const auto opt = tryParseYesNo( value ); - return opt.value_or( YesNo::yes ); - } - - std::optional tryParseYesNo( const std::string& value ) - { - if( value == "yes" ) { return YesNo::yes; } - else if( value == "no" ) { return YesNo::no; } - return std::optional{}; - } - - std::string toString( const YesNo value ) - { - switch ( value ) - { - case YesNo::yes: { return "yes"; } - case YesNo::no: { return "no"; } - default: break; - } - return "yes"; - } - - std::ostream& toStream( std::ostream& os, const YesNo value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const YesNo value ) - { - return toStream( os, value ); - } +namespace core +{ +/// AboveBelow ///////////////////////////////////////////////////////////////////////////// + +AboveBelow parseAboveBelow(const std::string &value) +{ + const auto opt = tryParseAboveBelow(value); + return opt.value_or(AboveBelow::above); +} + +std::optional tryParseAboveBelow(const std::string &value) +{ + if (value == "above") + { + return AboveBelow::above; + } + else if (value == "below") + { + return AboveBelow::below; + } + return std::optional{}; +} + +std::string toString(const AboveBelow value) +{ + switch (value) + { + case AboveBelow::above: { + return "above"; + } + case AboveBelow::below: { + return "below"; + } + default: + break; + } + return "above"; +} + +std::ostream &toStream(std::ostream &os, const AboveBelow value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const AboveBelow value) +{ + return toStream(os, value); +} + +/// AccidentalValue //////////////////////////////////////////////////////////////////////// + +AccidentalValue parseAccidentalValue(const std::string &value) +{ + const auto opt = tryParseAccidentalValue(value); + return opt.value_or(AccidentalValue::sharp); +} + +std::optional tryParseAccidentalValue(const std::string &value) +{ + if (value == "sharp") + { + return AccidentalValue::sharp; + } + else if (value == "natural") + { + return AccidentalValue::natural; + } + else if (value == "flat") + { + return AccidentalValue::flat; + } + else if (value == "double-sharp") + { + return AccidentalValue::doubleSharp; + } + else if (value == "sharp-sharp") + { + return AccidentalValue::sharpSharp; + } + else if (value == "flat-flat") + { + return AccidentalValue::flatFlat; + } + else if (value == "natural-sharp") + { + return AccidentalValue::naturalSharp; + } + else if (value == "natural-flat") + { + return AccidentalValue::naturalFlat; + } + else if (value == "quarter-flat") + { + return AccidentalValue::quarterFlat; + } + else if (value == "quarter-sharp") + { + return AccidentalValue::quarterSharp; + } + else if (value == "three-quarters-flat") + { + return AccidentalValue::threeQuartersFlat; + } + else if (value == "three-quarters-sharp") + { + return AccidentalValue::threeQuartersSharp; + } + else if (value == "sharp-down") + { + return AccidentalValue::sharpDown; + } + else if (value == "sharp-up") + { + return AccidentalValue::sharpUp; + } + else if (value == "natural-down") + { + return AccidentalValue::naturalDown; + } + else if (value == "natural-up") + { + return AccidentalValue::naturalUp; + } + else if (value == "flat-down") + { + return AccidentalValue::flatDown; + } + else if (value == "flat-up") + { + return AccidentalValue::flatUp; + } + else if (value == "triple-sharp") + { + return AccidentalValue::tripleSharp; + } + else if (value == "triple-flat") + { + return AccidentalValue::tripleFlat; + } + else if (value == "slash-quarter-sharp") + { + return AccidentalValue::slashQuarterSharp; + } + else if (value == "slash-sharp") + { + return AccidentalValue::slashSharp; + } + else if (value == "slash-flat") + { + return AccidentalValue::slashFlat; + } + else if (value == "double-slash-flat") + { + return AccidentalValue::doubleSlashFlat; + } + else if (value == "sharp-1") + { + return AccidentalValue::sharp1; + } + else if (value == "sharp-2") + { + return AccidentalValue::sharp2; + } + else if (value == "sharp-3") + { + return AccidentalValue::sharp3; + } + else if (value == "sharp-5") + { + return AccidentalValue::sharp5; + } + else if (value == "flat-1") + { + return AccidentalValue::flat1; + } + else if (value == "flat-2") + { + return AccidentalValue::flat2; + } + else if (value == "flat-3") + { + return AccidentalValue::flat3; + } + else if (value == "flat-4") + { + return AccidentalValue::flat4; + } + else if (value == "sori") + { + return AccidentalValue::sori; + } + else if (value == "koron") + { + return AccidentalValue::koron; + } + return std::optional{}; +} + +std::string toString(const AccidentalValue value) +{ + switch (value) + { + case AccidentalValue::sharp: { + return "sharp"; + } + case AccidentalValue::natural: { + return "natural"; + } + case AccidentalValue::flat: { + return "flat"; + } + case AccidentalValue::doubleSharp: { + return "double-sharp"; + } + case AccidentalValue::sharpSharp: { + return "sharp-sharp"; + } + case AccidentalValue::flatFlat: { + return "flat-flat"; + } + case AccidentalValue::naturalSharp: { + return "natural-sharp"; + } + case AccidentalValue::naturalFlat: { + return "natural-flat"; + } + case AccidentalValue::quarterFlat: { + return "quarter-flat"; + } + case AccidentalValue::quarterSharp: { + return "quarter-sharp"; + } + case AccidentalValue::threeQuartersFlat: { + return "three-quarters-flat"; + } + case AccidentalValue::threeQuartersSharp: { + return "three-quarters-sharp"; + } + case AccidentalValue::sharpDown: { + return "sharp-down"; + } + case AccidentalValue::sharpUp: { + return "sharp-up"; + } + case AccidentalValue::naturalDown: { + return "natural-down"; + } + case AccidentalValue::naturalUp: { + return "natural-up"; + } + case AccidentalValue::flatDown: { + return "flat-down"; + } + case AccidentalValue::flatUp: { + return "flat-up"; + } + case AccidentalValue::tripleSharp: { + return "triple-sharp"; + } + case AccidentalValue::tripleFlat: { + return "triple-flat"; + } + case AccidentalValue::slashQuarterSharp: { + return "slash-quarter-sharp"; + } + case AccidentalValue::slashSharp: { + return "slash-sharp"; + } + case AccidentalValue::slashFlat: { + return "slash-flat"; + } + case AccidentalValue::doubleSlashFlat: { + return "double-slash-flat"; + } + case AccidentalValue::sharp1: { + return "sharp-1"; + } + case AccidentalValue::sharp2: { + return "sharp-2"; + } + case AccidentalValue::sharp3: { + return "sharp-3"; + } + case AccidentalValue::sharp5: { + return "sharp-5"; + } + case AccidentalValue::flat1: { + return "flat-1"; + } + case AccidentalValue::flat2: { + return "flat-2"; + } + case AccidentalValue::flat3: { + return "flat-3"; + } + case AccidentalValue::flat4: { + return "flat-4"; + } + case AccidentalValue::sori: { + return "sori"; + } + case AccidentalValue::koron: { + return "koron"; + } + default: + break; + } + return "sharp"; +} + +std::ostream &toStream(std::ostream &os, const AccidentalValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const AccidentalValue value) +{ + return toStream(os, value); +} + +/// ArrowDirectionEnum ///////////////////////////////////////////////////////////////////// + +ArrowDirectionEnum parseArrowDirectionEnum(const std::string &value) +{ + const auto opt = tryParseArrowDirectionEnum(value); + return opt.value_or(ArrowDirectionEnum::left); +} + +std::optional tryParseArrowDirectionEnum(const std::string &value) +{ + if (value == "left") + { + return ArrowDirectionEnum::left; + } + else if (value == "up") + { + return ArrowDirectionEnum::up; + } + else if (value == "right") + { + return ArrowDirectionEnum::right; + } + else if (value == "down") + { + return ArrowDirectionEnum::down; + } + else if (value == "northwest") + { + return ArrowDirectionEnum::northwest; + } + else if (value == "northeast") + { + return ArrowDirectionEnum::northeast; + } + else if (value == "southeast") + { + return ArrowDirectionEnum::southeast; + } + else if (value == "southwest") + { + return ArrowDirectionEnum::southwest; + } + else if (value == "left right") + { + return ArrowDirectionEnum::leftRight; + } + else if (value == "up down") + { + return ArrowDirectionEnum::upDown; + } + else if (value == "northwest southeast") + { + return ArrowDirectionEnum::northwestSoutheast; + } + else if (value == "northeast southwest") + { + return ArrowDirectionEnum::northeastSouthwest; + } + else if (value == "other") + { + return ArrowDirectionEnum::other; + } + return std::optional{}; +} + +std::string toString(const ArrowDirectionEnum value) +{ + switch (value) + { + case ArrowDirectionEnum::left: { + return "left"; + } + case ArrowDirectionEnum::up: { + return "up"; + } + case ArrowDirectionEnum::right: { + return "right"; + } + case ArrowDirectionEnum::down: { + return "down"; + } + case ArrowDirectionEnum::northwest: { + return "northwest"; + } + case ArrowDirectionEnum::northeast: { + return "northeast"; + } + case ArrowDirectionEnum::southeast: { + return "southeast"; + } + case ArrowDirectionEnum::southwest: { + return "southwest"; + } + case ArrowDirectionEnum::leftRight: { + return "left right"; + } + case ArrowDirectionEnum::upDown: { + return "up down"; + } + case ArrowDirectionEnum::northwestSoutheast: { + return "northwest southeast"; + } + case ArrowDirectionEnum::northeastSouthwest: { + return "northeast southwest"; + } + case ArrowDirectionEnum::other: { + return "other"; + } + default: + break; + } + return "left"; +} + +std::ostream &toStream(std::ostream &os, const ArrowDirectionEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const ArrowDirectionEnum value) +{ + return toStream(os, value); +} + +/// ArrowStyleEnum ///////////////////////////////////////////////////////////////////////// + +ArrowStyleEnum parseArrowStyleEnum(const std::string &value) +{ + const auto opt = tryParseArrowStyleEnum(value); + return opt.value_or(ArrowStyleEnum::single); +} + +std::optional tryParseArrowStyleEnum(const std::string &value) +{ + if (value == "single") + { + return ArrowStyleEnum::single; + } + else if (value == "double") + { + return ArrowStyleEnum::double_; + } + else if (value == "filled") + { + return ArrowStyleEnum::filled; + } + else if (value == "hollow") + { + return ArrowStyleEnum::hollow; + } + else if (value == "paired") + { + return ArrowStyleEnum::paired; + } + else if (value == "combined") + { + return ArrowStyleEnum::combined; + } + else if (value == "other") + { + return ArrowStyleEnum::other; + } + return std::optional{}; +} + +std::string toString(const ArrowStyleEnum value) +{ + switch (value) + { + case ArrowStyleEnum::single: { + return "single"; + } + case ArrowStyleEnum::double_: { + return "double"; + } + case ArrowStyleEnum::filled: { + return "filled"; + } + case ArrowStyleEnum::hollow: { + return "hollow"; + } + case ArrowStyleEnum::paired: { + return "paired"; + } + case ArrowStyleEnum::combined: { + return "combined"; + } + case ArrowStyleEnum::other: { + return "other"; + } + default: + break; + } + return "single"; +} + +std::ostream &toStream(std::ostream &os, const ArrowStyleEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const ArrowStyleEnum value) +{ + return toStream(os, value); +} + +/// BackwardForward //////////////////////////////////////////////////////////////////////// + +BackwardForward parseBackwardForward(const std::string &value) +{ + const auto opt = tryParseBackwardForward(value); + return opt.value_or(BackwardForward::backward); +} + +std::optional tryParseBackwardForward(const std::string &value) +{ + if (value == "backward") + { + return BackwardForward::backward; + } + else if (value == "forward") + { + return BackwardForward::forward; + } + return std::optional{}; +} + +std::string toString(const BackwardForward value) +{ + switch (value) + { + case BackwardForward::backward: { + return "backward"; + } + case BackwardForward::forward: { + return "forward"; + } + default: + break; + } + return "backward"; +} + +std::ostream &toStream(std::ostream &os, const BackwardForward value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const BackwardForward value) +{ + return toStream(os, value); +} + +/// BarStyleEnum /////////////////////////////////////////////////////////////////////////// + +BarStyleEnum parseBarStyleEnum(const std::string &value) +{ + const auto opt = tryParseBarStyleEnum(value); + return opt.value_or(BarStyleEnum::regular); +} + +std::optional tryParseBarStyleEnum(const std::string &value) +{ + if (value == "regular") + { + return BarStyleEnum::regular; + } + else if (value == "dotted") + { + return BarStyleEnum::dotted; + } + else if (value == "dashed") + { + return BarStyleEnum::dashed; + } + else if (value == "heavy") + { + return BarStyleEnum::heavy; + } + else if (value == "light-light") + { + return BarStyleEnum::lightLight; + } + else if (value == "light-heavy") + { + return BarStyleEnum::lightHeavy; + } + else if (value == "heavy-light") + { + return BarStyleEnum::heavyLight; + } + else if (value == "heavy-heavy") + { + return BarStyleEnum::heavyHeavy; + } + else if (value == "tick") + { + return BarStyleEnum::tick; + } + else if (value == "short") + { + return BarStyleEnum::short_; + } + else if (value == "none") + { + return BarStyleEnum::none; + } + return std::optional{}; +} + +std::string toString(const BarStyleEnum value) +{ + switch (value) + { + case BarStyleEnum::regular: { + return "regular"; + } + case BarStyleEnum::dotted: { + return "dotted"; + } + case BarStyleEnum::dashed: { + return "dashed"; + } + case BarStyleEnum::heavy: { + return "heavy"; + } + case BarStyleEnum::lightLight: { + return "light-light"; + } + case BarStyleEnum::lightHeavy: { + return "light-heavy"; + } + case BarStyleEnum::heavyLight: { + return "heavy-light"; + } + case BarStyleEnum::heavyHeavy: { + return "heavy-heavy"; + } + case BarStyleEnum::tick: { + return "tick"; + } + case BarStyleEnum::short_: { + return "short"; + } + case BarStyleEnum::none: { + return "none"; + } + default: + break; + } + return "regular"; +} + +std::ostream &toStream(std::ostream &os, const BarStyleEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const BarStyleEnum value) +{ + return toStream(os, value); +} + +/// BeamValue ////////////////////////////////////////////////////////////////////////////// + +BeamValue parseBeamValue(const std::string &value) +{ + const auto opt = tryParseBeamValue(value); + return opt.value_or(BeamValue::begin); +} + +std::optional tryParseBeamValue(const std::string &value) +{ + if (value == "begin") + { + return BeamValue::begin; + } + else if (value == "continue") + { + return BeamValue::continue_; + } + else if (value == "end") + { + return BeamValue::end; + } + else if (value == "forward hook") + { + return BeamValue::forwardHook; + } + else if (value == "backward hook") + { + return BeamValue::backwardHook; + } + return std::optional{}; +} + +std::string toString(const BeamValue value) +{ + switch (value) + { + case BeamValue::begin: { + return "begin"; + } + case BeamValue::continue_: { + return "continue"; + } + case BeamValue::end: { + return "end"; + } + case BeamValue::forwardHook: { + return "forward hook"; + } + case BeamValue::backwardHook: { + return "backward hook"; + } + default: + break; + } + return "begin"; +} + +std::ostream &toStream(std::ostream &os, const BeamValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const BeamValue value) +{ + return toStream(os, value); +} + +/// BeaterValue //////////////////////////////////////////////////////////////////////////// + +BeaterValue parseBeaterValue(const std::string &value) +{ + const auto opt = tryParseBeaterValue(value); + return opt.value_or(BeaterValue::bow); +} + +std::optional tryParseBeaterValue(const std::string &value) +{ + if (value == "bow") + { + return BeaterValue::bow; + } + else if (value == "chime hammer") + { + return BeaterValue::chimeHammer; + } + else if (value == "coin") + { + return BeaterValue::coin; + } + else if (value == "finger") + { + return BeaterValue::finger; + } + else if (value == "fingernail") + { + return BeaterValue::fingernail; + } + else if (value == "fist") + { + return BeaterValue::fist; + } + else if (value == "guiro scraper") + { + return BeaterValue::guiroScraper; + } + else if (value == "hammer") + { + return BeaterValue::hammer; + } + else if (value == "hand") + { + return BeaterValue::hand; + } + else if (value == "jazz stick") + { + return BeaterValue::jazzStick; + } + else if (value == "knitting needle") + { + return BeaterValue::knittingNeedle; + } + else if (value == "metal hammer") + { + return BeaterValue::metalHammer; + } + else if (value == "snare stick") + { + return BeaterValue::snareStick; + } + else if (value == "spoon mallet") + { + return BeaterValue::spoonMallet; + } + else if (value == "triangle beater") + { + return BeaterValue::triangleBeater; + } + else if (value == "triangle beater plain") + { + return BeaterValue::triangleBeaterPlain; + } + else if (value == "wire brush") + { + return BeaterValue::wireBrush; + } + return std::optional{}; +} + +std::string toString(const BeaterValue value) +{ + switch (value) + { + case BeaterValue::bow: { + return "bow"; + } + case BeaterValue::chimeHammer: { + return "chime hammer"; + } + case BeaterValue::coin: { + return "coin"; + } + case BeaterValue::finger: { + return "finger"; + } + case BeaterValue::fingernail: { + return "fingernail"; + } + case BeaterValue::fist: { + return "fist"; + } + case BeaterValue::guiroScraper: { + return "guiro scraper"; + } + case BeaterValue::hammer: { + return "hammer"; + } + case BeaterValue::hand: { + return "hand"; + } + case BeaterValue::jazzStick: { + return "jazz stick"; + } + case BeaterValue::knittingNeedle: { + return "knitting needle"; + } + case BeaterValue::metalHammer: { + return "metal hammer"; + } + case BeaterValue::snareStick: { + return "snare stick"; + } + case BeaterValue::spoonMallet: { + return "spoon mallet"; + } + case BeaterValue::triangleBeater: { + return "triangle beater"; + } + case BeaterValue::triangleBeaterPlain: { + return "triangle beater plain"; + } + case BeaterValue::wireBrush: { + return "wire brush"; + } + default: + break; + } + return "bow"; +} + +std::ostream &toStream(std::ostream &os, const BeaterValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const BeaterValue value) +{ + return toStream(os, value); +} + +/// BreathMarkValue //////////////////////////////////////////////////////////////////////// + +BreathMarkValue parseBreathMarkValue(const std::string &value) +{ + const auto opt = tryParseBreathMarkValue(value); + return opt.value_or(BreathMarkValue::emptystring); +} + +std::optional tryParseBreathMarkValue(const std::string &value) +{ + if (value == "") + { + return BreathMarkValue::emptystring; + } + else if (value == "comma") + { + return BreathMarkValue::comma; + } + else if (value == "tick") + { + return BreathMarkValue::tick; + } + return std::optional{}; +} + +std::string toString(const BreathMarkValue value) +{ + switch (value) + { + case BreathMarkValue::emptystring: { + return ""; + } + case BreathMarkValue::comma: { + return "comma"; + } + case BreathMarkValue::tick: { + return "tick"; + } + default: + break; + } + return ""; +} + +std::ostream &toStream(std::ostream &os, const BreathMarkValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const BreathMarkValue value) +{ + return toStream(os, value); +} + +/// CancelLocation ///////////////////////////////////////////////////////////////////////// + +CancelLocation parseCancelLocation(const std::string &value) +{ + const auto opt = tryParseCancelLocation(value); + return opt.value_or(CancelLocation::left); +} + +std::optional tryParseCancelLocation(const std::string &value) +{ + if (value == "left") + { + return CancelLocation::left; + } + else if (value == "right") + { + return CancelLocation::right; + } + else if (value == "before-barline") + { + return CancelLocation::beforeBarline; + } + return std::optional{}; +} + +std::string toString(const CancelLocation value) +{ + switch (value) + { + case CancelLocation::left: { + return "left"; + } + case CancelLocation::right: { + return "right"; + } + case CancelLocation::beforeBarline: { + return "before-barline"; + } + default: + break; + } + return "left"; +} + +std::ostream &toStream(std::ostream &os, const CancelLocation value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const CancelLocation value) +{ + return toStream(os, value); +} + +/// CircularArrowEnum ////////////////////////////////////////////////////////////////////// + +CircularArrowEnum parseCircularArrowEnum(const std::string &value) +{ + const auto opt = tryParseCircularArrowEnum(value); + return opt.value_or(CircularArrowEnum::clockwise); +} + +std::optional tryParseCircularArrowEnum(const std::string &value) +{ + if (value == "clockwise") + { + return CircularArrowEnum::clockwise; + } + else if (value == "anticlockwise") + { + return CircularArrowEnum::anticlockwise; + } + return std::optional{}; +} + +std::string toString(const CircularArrowEnum value) +{ + switch (value) + { + case CircularArrowEnum::clockwise: { + return "clockwise"; + } + case CircularArrowEnum::anticlockwise: { + return "anticlockwise"; + } + default: + break; + } + return "clockwise"; +} + +std::ostream &toStream(std::ostream &os, const CircularArrowEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const CircularArrowEnum value) +{ + return toStream(os, value); +} + +/// ClefSign /////////////////////////////////////////////////////////////////////////////// + +ClefSign parseClefSign(const std::string &value) +{ + const auto opt = tryParseClefSign(value); + return opt.value_or(ClefSign::g); +} + +std::optional tryParseClefSign(const std::string &value) +{ + if (value == "G") + { + return ClefSign::g; + } + else if (value == "F") + { + return ClefSign::f; + } + else if (value == "C") + { + return ClefSign::c; + } + else if (value == "percussion") + { + return ClefSign::percussion; + } + else if (value == "TAB") + { + return ClefSign::tab; + } + else if (value == "jianpu") + { + return ClefSign::jianpu; + } + else if (value == "none") + { + return ClefSign::none; + } + return std::optional{}; +} + +std::string toString(const ClefSign value) +{ + switch (value) + { + case ClefSign::g: { + return "G"; + } + case ClefSign::f: { + return "F"; + } + case ClefSign::c: { + return "C"; + } + case ClefSign::percussion: { + return "percussion"; + } + case ClefSign::tab: { + return "TAB"; + } + case ClefSign::jianpu: { + return "jianpu"; + } + case ClefSign::none: { + return "none"; + } + default: + break; + } + return "G"; +} + +std::ostream &toStream(std::ostream &os, const ClefSign value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const ClefSign value) +{ + return toStream(os, value); +} + +/// CssFontSize //////////////////////////////////////////////////////////////////////////// + +CssFontSize parseCssFontSize(const std::string &value) +{ + const auto opt = tryParseCssFontSize(value); + return opt.value_or(CssFontSize::xxSmall); +} + +std::optional tryParseCssFontSize(const std::string &value) +{ + if (value == "xx-small") + { + return CssFontSize::xxSmall; + } + else if (value == "x-small") + { + return CssFontSize::xSmall; + } + else if (value == "small") + { + return CssFontSize::small; + } + else if (value == "medium") + { + return CssFontSize::medium; + } + else if (value == "large") + { + return CssFontSize::large; + } + else if (value == "x-large") + { + return CssFontSize::xLarge; + } + else if (value == "xx-large") + { + return CssFontSize::xxLarge; + } + return std::optional{}; +} + +std::string toString(const CssFontSize value) +{ + switch (value) + { + case CssFontSize::xxSmall: { + return "xx-small"; + } + case CssFontSize::xSmall: { + return "x-small"; + } + case CssFontSize::small: { + return "small"; + } + case CssFontSize::medium: { + return "medium"; + } + case CssFontSize::large: { + return "large"; + } + case CssFontSize::xLarge: { + return "x-large"; + } + case CssFontSize::xxLarge: { + return "xx-large"; + } + default: + break; + } + return "xx-small"; +} + +std::ostream &toStream(std::ostream &os, const CssFontSize value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const CssFontSize value) +{ + return toStream(os, value); +} + +/// DegreeSymbolValue ////////////////////////////////////////////////////////////////////// + +DegreeSymbolValue parseDegreeSymbolValue(const std::string &value) +{ + const auto opt = tryParseDegreeSymbolValue(value); + return opt.value_or(DegreeSymbolValue::major); +} + +std::optional tryParseDegreeSymbolValue(const std::string &value) +{ + if (value == "major") + { + return DegreeSymbolValue::major; + } + else if (value == "minor") + { + return DegreeSymbolValue::minor; + } + else if (value == "augmented") + { + return DegreeSymbolValue::augmented; + } + else if (value == "diminished") + { + return DegreeSymbolValue::diminished; + } + else if (value == "half-diminished") + { + return DegreeSymbolValue::halfDiminished; + } + return std::optional{}; +} + +std::string toString(const DegreeSymbolValue value) +{ + switch (value) + { + case DegreeSymbolValue::major: { + return "major"; + } + case DegreeSymbolValue::minor: { + return "minor"; + } + case DegreeSymbolValue::augmented: { + return "augmented"; + } + case DegreeSymbolValue::diminished: { + return "diminished"; + } + case DegreeSymbolValue::halfDiminished: { + return "half-diminished"; + } + default: + break; + } + return "major"; +} + +std::ostream &toStream(std::ostream &os, const DegreeSymbolValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const DegreeSymbolValue value) +{ + return toStream(os, value); +} + +/// DegreeTypeValue //////////////////////////////////////////////////////////////////////// + +DegreeTypeValue parseDegreeTypeValue(const std::string &value) +{ + const auto opt = tryParseDegreeTypeValue(value); + return opt.value_or(DegreeTypeValue::add); +} + +std::optional tryParseDegreeTypeValue(const std::string &value) +{ + if (value == "add") + { + return DegreeTypeValue::add; + } + else if (value == "alter") + { + return DegreeTypeValue::alter; + } + else if (value == "subtract") + { + return DegreeTypeValue::subtract; + } + return std::optional{}; +} + +std::string toString(const DegreeTypeValue value) +{ + switch (value) + { + case DegreeTypeValue::add: { + return "add"; + } + case DegreeTypeValue::alter: { + return "alter"; + } + case DegreeTypeValue::subtract: { + return "subtract"; + } + default: + break; + } + return "add"; +} + +std::ostream &toStream(std::ostream &os, const DegreeTypeValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const DegreeTypeValue value) +{ + return toStream(os, value); +} + +/// DistanceTypeEnum /////////////////////////////////////////////////////////////////////// + +DistanceTypeEnum parseDistanceTypeEnum(const std::string &value) +{ + const auto opt = tryParseDistanceTypeEnum(value); + return opt.value_or(DistanceTypeEnum::beam); +} + +std::optional tryParseDistanceTypeEnum(const std::string &value) +{ + if (value == "beam") + { + return DistanceTypeEnum::beam; + } + else if (value == "hyphen") + { + return DistanceTypeEnum::hyphen; + } + else if (value == "other") + { + return DistanceTypeEnum::other; + } + return std::optional{}; +} + +std::string toString(const DistanceTypeEnum value) +{ + switch (value) + { + case DistanceTypeEnum::beam: { + return "beam"; + } + case DistanceTypeEnum::hyphen: { + return "hyphen"; + } + default: + break; + } + return "other"; +} + +std::ostream &toStream(std::ostream &os, const DistanceTypeEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const DistanceTypeEnum value) +{ + return toStream(os, value); +} + +DistanceType::DistanceType(const DistanceTypeEnum value) : myEnum(value), myCustomValue("") +{ + setValue(value); +} + +DistanceType::DistanceType(const std::string &value) : myEnum(DistanceTypeEnum::other), myCustomValue(value) +{ + setValue(value); +} + +DistanceType::DistanceType() : myEnum(DistanceTypeEnum::beam), myCustomValue("") +{ + setValue(DistanceTypeEnum::beam); +} + +DistanceTypeEnum DistanceType::getValue() const +{ + return myEnum; +} + +std::string DistanceType::getValueString() const +{ + if (myEnum != DistanceTypeEnum::other) + { + return toString(myEnum); + } + + else + { + return myCustomValue; + } +} + +void DistanceType::setValue(const DistanceTypeEnum value) +{ + myEnum = value; + if (value != DistanceTypeEnum::other && !myCustomValue.empty()) + { + myCustomValue = ""; + } +} + +void DistanceType::setValue(const std::string &value) +{ + const auto temp = tryParseDistanceTypeEnum(value); + if (temp) + { + myEnum = temp.value(); + myCustomValue = ""; + } + else + { + setValue(DistanceTypeEnum::other); + myCustomValue = value; + } +} + +DistanceType parseDistanceType(const std::string &value) +{ + return DistanceType(value); +} + +std::string toString(const DistanceType &value) +{ + return value.getValueString(); +} + +std::ostream &toStream(std::ostream &os, const DistanceType &value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const DistanceType &value) +{ + return toStream(os, value); +} + +/// DynamicsEnum /////////////////////////////////////////////////////////////////////////// + +DynamicsEnum parseDynamicsEnum(const std::string &value) +{ + const auto opt = tryParseDynamicsEnum(value); + return opt.value_or(DynamicsEnum::mf); +} + +std::optional tryParseDynamicsEnum(const std::string &value) +{ + if (value == "p") + { + return DynamicsEnum::p; + } + else if (value == "pp") + { + return DynamicsEnum::pp; + } + else if (value == "ppp") + { + return DynamicsEnum::ppp; + } + else if (value == "pppp") + { + return DynamicsEnum::pppp; + } + else if (value == "ppppp") + { + return DynamicsEnum::ppppp; + } + else if (value == "pppppp") + { + return DynamicsEnum::pppppp; + } + else if (value == "f") + { + return DynamicsEnum::f; + } + else if (value == "ff") + { + return DynamicsEnum::ff; + } + else if (value == "fff") + { + return DynamicsEnum::fff; + } + else if (value == "ffff") + { + return DynamicsEnum::ffff; + } + else if (value == "fffff") + { + return DynamicsEnum::fffff; + } + else if (value == "ffffff") + { + return DynamicsEnum::ffffff; + } + else if (value == "mp") + { + return DynamicsEnum::mp; + } + else if (value == "mf") + { + return DynamicsEnum::mf; + } + else if (value == "sf") + { + return DynamicsEnum::sf; + } + else if (value == "sfp") + { + return DynamicsEnum::sfp; + } + else if (value == "sfpp") + { + return DynamicsEnum::sfpp; + } + else if (value == "fp") + { + return DynamicsEnum::fp; + } + else if (value == "rf") + { + return DynamicsEnum::rf; + } + else if (value == "rfz") + { + return DynamicsEnum::rfz; + } + else if (value == "sfz") + { + return DynamicsEnum::sfz; + } + else if (value == "sffz") + { + return DynamicsEnum::sffz; + } + else if (value == "fz") + { + return DynamicsEnum::fz; + } + else if (value == "other-dynamics") + { + return DynamicsEnum::otherDynamics; + } + return std::optional{}; +} + +std::string toString(const DynamicsEnum value) +{ + switch (value) + { + case DynamicsEnum::p: { + return "p"; + } + case DynamicsEnum::pp: { + return "pp"; + } + case DynamicsEnum::ppp: { + return "ppp"; + } + case DynamicsEnum::pppp: { + return "pppp"; + } + case DynamicsEnum::ppppp: { + return "ppppp"; + } + case DynamicsEnum::pppppp: { + return "pppppp"; + } + case DynamicsEnum::f: { + return "f"; + } + case DynamicsEnum::ff: { + return "ff"; + } + case DynamicsEnum::fff: { + return "fff"; + } + case DynamicsEnum::ffff: { + return "ffff"; + } + case DynamicsEnum::fffff: { + return "fffff"; + } + case DynamicsEnum::ffffff: { + return "ffffff"; + } + case DynamicsEnum::mp: { + return "mp"; + } + case DynamicsEnum::mf: { + return "mf"; + } + case DynamicsEnum::sf: { + return "sf"; + } + case DynamicsEnum::sfp: { + return "sfp"; + } + case DynamicsEnum::sfpp: { + return "sfpp"; + } + case DynamicsEnum::fp: { + return "fp"; + } + case DynamicsEnum::rf: { + return "rf"; + } + case DynamicsEnum::rfz: { + return "rfz"; + } + case DynamicsEnum::sfz: { + return "sfz"; + } + case DynamicsEnum::sffz: { + return "sffz"; + } + case DynamicsEnum::fz: { + return "fz"; + } + default: + break; + } + return "other-dynamics"; +} + +std::ostream &toStream(std::ostream &os, const DynamicsEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const DynamicsEnum value) +{ + return toStream(os, value); +} + +DynamicsValue::DynamicsValue(const DynamicsEnum value) : myEnum(value), myCustomValue("") +{ + setValue(value); +} + +DynamicsValue::DynamicsValue(const std::string &value) : myEnum(DynamicsEnum::otherDynamics), myCustomValue(value) +{ + setValue(value); +} + +DynamicsValue::DynamicsValue() : myEnum(DynamicsEnum::mf), myCustomValue("") +{ + setValue(DynamicsEnum::mf); +} + +DynamicsEnum DynamicsValue::getValue() const +{ + return myEnum; +} + +std::string DynamicsValue::getValueString() const +{ + if (myEnum != DynamicsEnum::otherDynamics) + { + return toString(myEnum); + } + + else + { + return myCustomValue; + } +} + +void DynamicsValue::setValue(const DynamicsEnum value) +{ + myEnum = value; + if (value != DynamicsEnum::otherDynamics && !myCustomValue.empty()) + { + myCustomValue = ""; + } +} + +void DynamicsValue::setValue(const std::string &value) +{ + const auto temp = tryParseDynamicsEnum(value); + if (temp) + { + myEnum = temp.value(); + myCustomValue = ""; + } + else + { + setValue(DynamicsEnum::otherDynamics); + myCustomValue = value; + } +} + +DynamicsValue parseDynamicsValue(const std::string &value) +{ + return DynamicsValue(value); +} + +std::string toString(const DynamicsValue &value) +{ + return value.getValueString(); +} + +std::ostream &toStream(std::ostream &os, const DynamicsValue &value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const DynamicsValue &value) +{ + return toStream(os, value); +} + +/// EffectEnum ///////////////////////////////////////////////////////////////////////////// + +EffectEnum parseEffectEnum(const std::string &value) +{ + const auto opt = tryParseEffectEnum(value); + return opt.value_or(EffectEnum::anvil); +} + +std::optional tryParseEffectEnum(const std::string &value) +{ + if (value == "anvil") + { + return EffectEnum::anvil; + } + else if (value == "auto horn") + { + return EffectEnum::autoHorn; + } + else if (value == "bird whistle") + { + return EffectEnum::birdWhistle; + } + else if (value == "cannon") + { + return EffectEnum::cannon; + } + else if (value == "duck call") + { + return EffectEnum::duckCall; + } + else if (value == "gun shot") + { + return EffectEnum::gunShot; + } + else if (value == "klaxon horn") + { + return EffectEnum::klaxonHorn; + } + else if (value == "lions roar") + { + return EffectEnum::lionsRoar; + } + else if (value == "police whistle") + { + return EffectEnum::policeWhistle; + } + else if (value == "siren") + { + return EffectEnum::siren; + } + else if (value == "slide whistle") + { + return EffectEnum::slideWhistle; + } + else if (value == "thunder sheet") + { + return EffectEnum::thunderSheet; + } + else if (value == "wind machine") + { + return EffectEnum::windMachine; + } + else if (value == "wind whistle") + { + return EffectEnum::windWhistle; + } + return std::optional{}; +} + +std::string toString(const EffectEnum value) +{ + switch (value) + { + case EffectEnum::anvil: { + return "anvil"; + } + case EffectEnum::autoHorn: { + return "auto horn"; + } + case EffectEnum::birdWhistle: { + return "bird whistle"; + } + case EffectEnum::cannon: { + return "cannon"; + } + case EffectEnum::duckCall: { + return "duck call"; + } + case EffectEnum::gunShot: { + return "gun shot"; + } + case EffectEnum::klaxonHorn: { + return "klaxon horn"; + } + case EffectEnum::lionsRoar: { + return "lions roar"; + } + case EffectEnum::policeWhistle: { + return "police whistle"; + } + case EffectEnum::siren: { + return "siren"; + } + case EffectEnum::slideWhistle: { + return "slide whistle"; + } + case EffectEnum::thunderSheet: { + return "thunder sheet"; + } + case EffectEnum::windMachine: { + return "wind machine"; + } + case EffectEnum::windWhistle: { + return "wind whistle"; + } + default: + break; + } + return "anvil"; +} + +std::ostream &toStream(std::ostream &os, const EffectEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const EffectEnum value) +{ + return toStream(os, value); +} + +/// EnclosureShape ///////////////////////////////////////////////////////////////////////// + +EnclosureShape parseEnclosureShape(const std::string &value) +{ + const auto opt = tryParseEnclosureShape(value); + return opt.value_or(EnclosureShape::rectangle); +} + +std::optional tryParseEnclosureShape(const std::string &value) +{ + if (value == "rectangle") + { + return EnclosureShape::rectangle; + } + else if (value == "square") + { + return EnclosureShape::square; + } + else if (value == "oval") + { + return EnclosureShape::oval; + } + else if (value == "circle") + { + return EnclosureShape::circle; + } + else if (value == "bracket") + { + return EnclosureShape::bracket; + } + else if (value == "triangle") + { + return EnclosureShape::triangle; + } + else if (value == "diamond") + { + return EnclosureShape::diamond; + } + else if (value == "none") + { + return EnclosureShape::none; + } + return std::optional{}; +} + +std::string toString(const EnclosureShape value) +{ + switch (value) + { + case EnclosureShape::rectangle: { + return "rectangle"; + } + case EnclosureShape::square: { + return "square"; + } + case EnclosureShape::oval: { + return "oval"; + } + case EnclosureShape::circle: { + return "circle"; + } + case EnclosureShape::bracket: { + return "bracket"; + } + case EnclosureShape::triangle: { + return "triangle"; + } + case EnclosureShape::diamond: { + return "diamond"; + } + case EnclosureShape::none: { + return "none"; + } + default: + break; + } + return "rectangle"; +} + +std::ostream &toStream(std::ostream &os, const EnclosureShape value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const EnclosureShape value) +{ + return toStream(os, value); +} + +/// Fan //////////////////////////////////////////////////////////////////////////////////// + +Fan parseFan(const std::string &value) +{ + const auto opt = tryParseFan(value); + return opt.value_or(Fan::accel); +} + +std::optional tryParseFan(const std::string &value) +{ + if (value == "accel") + { + return Fan::accel; + } + else if (value == "rit") + { + return Fan::rit; + } + else if (value == "none") + { + return Fan::none; + } + return std::optional{}; +} + +std::string toString(const Fan value) +{ + switch (value) + { + case Fan::accel: { + return "accel"; + } + case Fan::rit: { + return "rit"; + } + case Fan::none: { + return "none"; + } + default: + break; + } + return "accel"; +} + +std::ostream &toStream(std::ostream &os, const Fan value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const Fan value) +{ + return toStream(os, value); +} + +/// FermataShape /////////////////////////////////////////////////////////////////////////// + +FermataShape parseFermataShape(const std::string &value) +{ + const auto opt = tryParseFermataShape(value); + return opt.value_or(FermataShape::normal); +} + +std::optional tryParseFermataShape(const std::string &value) +{ + if (value == "normal") + { + return FermataShape::normal; + } + else if (value == "angled") + { + return FermataShape::angled; + } + else if (value == "square") + { + return FermataShape::square; + } + else if (value == "") + { + return FermataShape::emptystring; + } + return std::optional{}; +} + +std::string toString(const FermataShape value) +{ + switch (value) + { + case FermataShape::normal: { + return "normal"; + } + case FermataShape::angled: { + return "angled"; + } + case FermataShape::square: { + return "square"; + } + case FermataShape::emptystring: { + return ""; + } + default: + break; + } + return "normal"; +} + +std::ostream &toStream(std::ostream &os, const FermataShape value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const FermataShape value) +{ + return toStream(os, value); +} + +/// FontStyle ////////////////////////////////////////////////////////////////////////////// + +FontStyle parseFontStyle(const std::string &value) +{ + const auto opt = tryParseFontStyle(value); + return opt.value_or(FontStyle::normal); +} + +std::optional tryParseFontStyle(const std::string &value) +{ + if (value == "normal") + { + return FontStyle::normal; + } + else if (value == "italic") + { + return FontStyle::italic; + } + return std::optional{}; +} + +std::string toString(const FontStyle value) +{ + switch (value) + { + case FontStyle::normal: { + return "normal"; + } + case FontStyle::italic: { + return "italic"; + } + default: + break; + } + return "normal"; +} + +std::ostream &toStream(std::ostream &os, const FontStyle value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const FontStyle value) +{ + return toStream(os, value); +} + +/// FontWeight ///////////////////////////////////////////////////////////////////////////// + +FontWeight parseFontWeight(const std::string &value) +{ + const auto opt = tryParseFontWeight(value); + return opt.value_or(FontWeight::normal); +} + +std::optional tryParseFontWeight(const std::string &value) +{ + if (value == "normal") + { + return FontWeight::normal; + } + else if (value == "bold") + { + return FontWeight::bold; + } + return std::optional{}; +} + +std::string toString(const FontWeight value) +{ + switch (value) + { + case FontWeight::normal: { + return "normal"; + } + case FontWeight::bold: { + return "bold"; + } + default: + break; + } + return "normal"; +} + +std::ostream &toStream(std::ostream &os, const FontWeight value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const FontWeight value) +{ + return toStream(os, value); +} + +/// GlassEnum ////////////////////////////////////////////////////////////////////////////// + +GlassEnum parseGlassEnum(const std::string &value) +{ + const auto opt = tryParseGlassEnum(value); + return opt.value_or(GlassEnum::windChimes); +} + +std::optional tryParseGlassEnum(const std::string &value) +{ + if (value == "wind chimes") + { + return GlassEnum::windChimes; + } + return std::optional{}; +} + +std::string toString(const GlassEnum value) +{ + switch (value) + { + case GlassEnum::windChimes: { + return "wind chimes"; + } + default: + break; + } + return "wind chimes"; +} + +std::ostream &toStream(std::ostream &os, const GlassEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const GlassEnum value) +{ + return toStream(os, value); +} + +/// GroupBarlineValue ////////////////////////////////////////////////////////////////////// + +GroupBarlineValue parseGroupBarlineValue(const std::string &value) +{ + const auto opt = tryParseGroupBarlineValue(value); + return opt.value_or(GroupBarlineValue::yes); +} + +std::optional tryParseGroupBarlineValue(const std::string &value) +{ + if (value == "yes") + { + return GroupBarlineValue::yes; + } + else if (value == "no") + { + return GroupBarlineValue::no; + } + else if (value == "Mensurstrich") + { + return GroupBarlineValue::mensurstrich; + } + return std::optional{}; +} + +std::string toString(const GroupBarlineValue value) +{ + switch (value) + { + case GroupBarlineValue::yes: { + return "yes"; + } + case GroupBarlineValue::no: { + return "no"; + } + case GroupBarlineValue::mensurstrich: { + return "Mensurstrich"; + } + default: + break; + } + return "yes"; +} + +std::ostream &toStream(std::ostream &os, const GroupBarlineValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const GroupBarlineValue value) +{ + return toStream(os, value); +} + +/// GroupSymbolValue /////////////////////////////////////////////////////////////////////// + +GroupSymbolValue parseGroupSymbolValue(const std::string &value) +{ + const auto opt = tryParseGroupSymbolValue(value); + return opt.value_or(GroupSymbolValue::none); +} + +std::optional tryParseGroupSymbolValue(const std::string &value) +{ + if (value == "none") + { + return GroupSymbolValue::none; + } + else if (value == "brace") + { + return GroupSymbolValue::brace; + } + else if (value == "line") + { + return GroupSymbolValue::line; + } + else if (value == "bracket") + { + return GroupSymbolValue::bracket; + } + else if (value == "square") + { + return GroupSymbolValue::square; + } + return std::optional{}; +} + +std::string toString(const GroupSymbolValue value) +{ + switch (value) + { + case GroupSymbolValue::none: { + return "none"; + } + case GroupSymbolValue::brace: { + return "brace"; + } + case GroupSymbolValue::line: { + return "line"; + } + case GroupSymbolValue::bracket: { + return "bracket"; + } + case GroupSymbolValue::square: { + return "square"; + } + default: + break; + } + return "none"; +} + +std::ostream &toStream(std::ostream &os, const GroupSymbolValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const GroupSymbolValue value) +{ + return toStream(os, value); +} + +/// HandbellValue ////////////////////////////////////////////////////////////////////////// + +HandbellValue parseHandbellValue(const std::string &value) +{ + const auto opt = tryParseHandbellValue(value); + return opt.value_or(HandbellValue::damp); +} + +std::optional tryParseHandbellValue(const std::string &value) +{ + if (value == "damp") + { + return HandbellValue::damp; + } + else if (value == "echo") + { + return HandbellValue::echo; + } + else if (value == "gyro") + { + return HandbellValue::gyro; + } + else if (value == "hand martellato") + { + return HandbellValue::handMartellato; + } + else if (value == "mallet lift") + { + return HandbellValue::malletLift; + } + else if (value == "mallet table") + { + return HandbellValue::malletTable; + } + else if (value == "martellato") + { + return HandbellValue::martellato; + } + else if (value == "martellato lift") + { + return HandbellValue::martellatoLift; + } + else if (value == "muted martellato") + { + return HandbellValue::mutedMartellato; + } + else if (value == "pluck lift") + { + return HandbellValue::pluckLift; + } + else if (value == "swing") + { + return HandbellValue::swing; + } + return std::optional{}; +} + +std::string toString(const HandbellValue value) +{ + switch (value) + { + case HandbellValue::damp: { + return "damp"; + } + case HandbellValue::echo: { + return "echo"; + } + case HandbellValue::gyro: { + return "gyro"; + } + case HandbellValue::handMartellato: { + return "hand martellato"; + } + case HandbellValue::malletLift: { + return "mallet lift"; + } + case HandbellValue::malletTable: { + return "mallet table"; + } + case HandbellValue::martellato: { + return "martellato"; + } + case HandbellValue::martellatoLift: { + return "martellato lift"; + } + case HandbellValue::mutedMartellato: { + return "muted martellato"; + } + case HandbellValue::pluckLift: { + return "pluck lift"; + } + case HandbellValue::swing: { + return "swing"; + } + default: + break; + } + return "damp"; +} + +std::ostream &toStream(std::ostream &os, const HandbellValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const HandbellValue value) +{ + return toStream(os, value); +} + +/// HarmonyType //////////////////////////////////////////////////////////////////////////// + +HarmonyType parseHarmonyType(const std::string &value) +{ + const auto opt = tryParseHarmonyType(value); + return opt.value_or(HarmonyType::explicit_); +} + +std::optional tryParseHarmonyType(const std::string &value) +{ + if (value == "explicit") + { + return HarmonyType::explicit_; + } + else if (value == "implied") + { + return HarmonyType::implied; + } + else if (value == "alternate") + { + return HarmonyType::alternate; + } + return std::optional{}; +} + +std::string toString(const HarmonyType value) +{ + switch (value) + { + case HarmonyType::explicit_: { + return "explicit"; + } + case HarmonyType::implied: { + return "implied"; + } + case HarmonyType::alternate: { + return "alternate"; + } + default: + break; + } + return "explicit"; +} + +std::ostream &toStream(std::ostream &os, const HarmonyType value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const HarmonyType value) +{ + return toStream(os, value); +} + +/// HoleClosedLocation ///////////////////////////////////////////////////////////////////// + +HoleClosedLocation parseHoleClosedLocation(const std::string &value) +{ + const auto opt = tryParseHoleClosedLocation(value); + return opt.value_or(HoleClosedLocation::right); +} + +std::optional tryParseHoleClosedLocation(const std::string &value) +{ + if (value == "right") + { + return HoleClosedLocation::right; + } + else if (value == "bottom") + { + return HoleClosedLocation::bottom; + } + else if (value == "left") + { + return HoleClosedLocation::left; + } + else if (value == "top") + { + return HoleClosedLocation::top; + } + return std::optional{}; +} + +std::string toString(const HoleClosedLocation value) +{ + switch (value) + { + case HoleClosedLocation::right: { + return "right"; + } + case HoleClosedLocation::bottom: { + return "bottom"; + } + case HoleClosedLocation::left: { + return "left"; + } + case HoleClosedLocation::top: { + return "top"; + } + default: + break; + } + return "right"; +} + +std::ostream &toStream(std::ostream &os, const HoleClosedLocation value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const HoleClosedLocation value) +{ + return toStream(os, value); +} + +/// HoleClosedValue //////////////////////////////////////////////////////////////////////// + +HoleClosedValue parseHoleClosedValue(const std::string &value) +{ + const auto opt = tryParseHoleClosedValue(value); + return opt.value_or(HoleClosedValue::yes); +} + +std::optional tryParseHoleClosedValue(const std::string &value) +{ + if (value == "yes") + { + return HoleClosedValue::yes; + } + else if (value == "no") + { + return HoleClosedValue::no; + } + else if (value == "half") + { + return HoleClosedValue::half; + } + return std::optional{}; +} + +std::string toString(const HoleClosedValue value) +{ + switch (value) + { + case HoleClosedValue::yes: { + return "yes"; + } + case HoleClosedValue::no: { + return "no"; + } + case HoleClosedValue::half: { + return "half"; + } + default: + break; + } + return "yes"; +} + +std::ostream &toStream(std::ostream &os, const HoleClosedValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const HoleClosedValue value) +{ + return toStream(os, value); +} + +/// KindValue ////////////////////////////////////////////////////////////////////////////// + +KindValue parseKindValue(const std::string &value) +{ + const auto opt = tryParseKindValue(value); + return opt.value_or(KindValue::major); +} + +std::optional tryParseKindValue(const std::string &value) +{ + if (value == "major") + { + return KindValue::major; + } + else if (value == "minor") + { + return KindValue::minor; + } + else if (value == "augmented") + { + return KindValue::augmented; + } + else if (value == "diminished") + { + return KindValue::diminished; + } + else if (value == "dominant") + { + return KindValue::dominant; + } + else if (value == "major-seventh") + { + return KindValue::majorSeventh; + } + else if (value == "minor-seventh") + { + return KindValue::minorSeventh; + } + else if (value == "diminished-seventh") + { + return KindValue::diminishedSeventh; + } + else if (value == "augmented-seventh") + { + return KindValue::augmentedSeventh; + } + else if (value == "half-diminished") + { + return KindValue::halfDiminished; + } + else if (value == "major-minor") + { + return KindValue::majorMinor; + } + else if (value == "major-sixth") + { + return KindValue::majorSixth; + } + else if (value == "minor-sixth") + { + return KindValue::minorSixth; + } + else if (value == "dominant-ninth") + { + return KindValue::dominantNinth; + } + else if (value == "major-ninth") + { + return KindValue::majorNinth; + } + else if (value == "minor-ninth") + { + return KindValue::minorNinth; + } + else if (value == "dominant-11th") + { + return KindValue::dominant11th; + } + else if (value == "major-11th") + { + return KindValue::major11th; + } + else if (value == "minor-11th") + { + return KindValue::minor11th; + } + else if (value == "dominant-13th") + { + return KindValue::dominant13th; + } + else if (value == "major-13th") + { + return KindValue::major13th; + } + else if (value == "minor-13th") + { + return KindValue::minor13th; + } + else if (value == "suspended-second") + { + return KindValue::suspendedSecond; + } + else if (value == "suspended-fourth") + { + return KindValue::suspendedFourth; + } + else if (value == "Neapolitan") + { + return KindValue::neapolitan; + } + else if (value == "Italian") + { + return KindValue::italian; + } + else if (value == "French") + { + return KindValue::french; + } + else if (value == "German") + { + return KindValue::german; + } + else if (value == "pedal") + { + return KindValue::pedal; + } + else if (value == "power") + { + return KindValue::power; + } + else if (value == "Tristan") + { + return KindValue::tristan; + } + else if (value == "other") + { + return KindValue::other; + } + else if (value == "none") + { + return KindValue::none; + } + return std::optional{}; +} + +std::string toString(const KindValue value) +{ + switch (value) + { + case KindValue::major: { + return "major"; + } + case KindValue::minor: { + return "minor"; + } + case KindValue::augmented: { + return "augmented"; + } + case KindValue::diminished: { + return "diminished"; + } + case KindValue::dominant: { + return "dominant"; + } + case KindValue::majorSeventh: { + return "major-seventh"; + } + case KindValue::minorSeventh: { + return "minor-seventh"; + } + case KindValue::diminishedSeventh: { + return "diminished-seventh"; + } + case KindValue::augmentedSeventh: { + return "augmented-seventh"; + } + case KindValue::halfDiminished: { + return "half-diminished"; + } + case KindValue::majorMinor: { + return "major-minor"; + } + case KindValue::majorSixth: { + return "major-sixth"; + } + case KindValue::minorSixth: { + return "minor-sixth"; + } + case KindValue::dominantNinth: { + return "dominant-ninth"; + } + case KindValue::majorNinth: { + return "major-ninth"; + } + case KindValue::minorNinth: { + return "minor-ninth"; + } + case KindValue::dominant11th: { + return "dominant-11th"; + } + case KindValue::major11th: { + return "major-11th"; + } + case KindValue::minor11th: { + return "minor-11th"; + } + case KindValue::dominant13th: { + return "dominant-13th"; + } + case KindValue::major13th: { + return "major-13th"; + } + case KindValue::minor13th: { + return "minor-13th"; + } + case KindValue::suspendedSecond: { + return "suspended-second"; + } + case KindValue::suspendedFourth: { + return "suspended-fourth"; + } + case KindValue::neapolitan: { + return "Neapolitan"; + } + case KindValue::italian: { + return "Italian"; + } + case KindValue::french: { + return "French"; + } + case KindValue::german: { + return "German"; + } + case KindValue::pedal: { + return "pedal"; + } + case KindValue::power: { + return "power"; + } + case KindValue::tristan: { + return "Tristan"; + } + case KindValue::other: { + return "other"; + } + case KindValue::none: { + return "none"; + } + default: + break; + } + return "major"; +} + +std::ostream &toStream(std::ostream &os, const KindValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const KindValue value) +{ + return toStream(os, value); +} + +/// LeftCenterRight //////////////////////////////////////////////////////////////////////// + +LeftCenterRight parseLeftCenterRight(const std::string &value) +{ + const auto opt = tryParseLeftCenterRight(value); + return opt.value_or(LeftCenterRight::left); +} + +std::optional tryParseLeftCenterRight(const std::string &value) +{ + if (value == "left") + { + return LeftCenterRight::left; + } + else if (value == "center") + { + return LeftCenterRight::center; + } + else if (value == "right") + { + return LeftCenterRight::right; + } + return std::optional{}; +} + +std::string toString(const LeftCenterRight value) +{ + switch (value) + { + case LeftCenterRight::left: { + return "left"; + } + case LeftCenterRight::center: { + return "center"; + } + case LeftCenterRight::right: { + return "right"; + } + default: + break; + } + return "left"; +} + +std::ostream &toStream(std::ostream &os, const LeftCenterRight value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const LeftCenterRight value) +{ + return toStream(os, value); +} + +/// LeftRight ////////////////////////////////////////////////////////////////////////////// + +LeftRight parseLeftRight(const std::string &value) +{ + const auto opt = tryParseLeftRight(value); + return opt.value_or(LeftRight::left); +} + +std::optional tryParseLeftRight(const std::string &value) +{ + if (value == "left") + { + return LeftRight::left; + } + else if (value == "right") + { + return LeftRight::right; + } + return std::optional{}; +} + +std::string toString(const LeftRight value) +{ + switch (value) + { + case LeftRight::left: { + return "left"; + } + case LeftRight::right: { + return "right"; + } + default: + break; + } + return "left"; +} + +std::ostream &toStream(std::ostream &os, const LeftRight value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const LeftRight value) +{ + return toStream(os, value); +} + +/// LineEnd //////////////////////////////////////////////////////////////////////////////// + +LineEnd parseLineEnd(const std::string &value) +{ + const auto opt = tryParseLineEnd(value); + return opt.value_or(LineEnd::up); +} + +std::optional tryParseLineEnd(const std::string &value) +{ + if (value == "up") + { + return LineEnd::up; + } + else if (value == "down") + { + return LineEnd::down; + } + else if (value == "both") + { + return LineEnd::both; + } + else if (value == "arrow") + { + return LineEnd::arrow; + } + else if (value == "none") + { + return LineEnd::none; + } + return std::optional{}; +} + +std::string toString(const LineEnd value) +{ + switch (value) + { + case LineEnd::up: { + return "up"; + } + case LineEnd::down: { + return "down"; + } + case LineEnd::both: { + return "both"; + } + case LineEnd::arrow: { + return "arrow"; + } + case LineEnd::none: { + return "none"; + } + default: + break; + } + return "up"; +} + +std::ostream &toStream(std::ostream &os, const LineEnd value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const LineEnd value) +{ + return toStream(os, value); +} + +/// LineShape ////////////////////////////////////////////////////////////////////////////// + +LineShape parseLineShape(const std::string &value) +{ + const auto opt = tryParseLineShape(value); + return opt.value_or(LineShape::straight); +} + +std::optional tryParseLineShape(const std::string &value) +{ + if (value == "straight") + { + return LineShape::straight; + } + else if (value == "curved") + { + return LineShape::curved; + } + return std::optional{}; +} + +std::string toString(const LineShape value) +{ + switch (value) + { + case LineShape::straight: { + return "straight"; + } + case LineShape::curved: { + return "curved"; + } + default: + break; + } + return "straight"; +} + +std::ostream &toStream(std::ostream &os, const LineShape value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const LineShape value) +{ + return toStream(os, value); +} + +/// LineType /////////////////////////////////////////////////////////////////////////////// + +LineType parseLineType(const std::string &value) +{ + const auto opt = tryParseLineType(value); + return opt.value_or(LineType::solid); +} + +std::optional tryParseLineType(const std::string &value) +{ + if (value == "solid") + { + return LineType::solid; + } + else if (value == "dashed") + { + return LineType::dashed; + } + else if (value == "dotted") + { + return LineType::dotted; + } + else if (value == "wavy") + { + return LineType::wavy; + } + return std::optional{}; +} + +std::string toString(const LineType value) +{ + switch (value) + { + case LineType::solid: { + return "solid"; + } + case LineType::dashed: { + return "dashed"; + } + case LineType::dotted: { + return "dotted"; + } + case LineType::wavy: { + return "wavy"; + } + default: + break; + } + return "solid"; +} + +std::ostream &toStream(std::ostream &os, const LineType value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const LineType value) +{ + return toStream(os, value); +} + +/// LineWidthTypeEnum ////////////////////////////////////////////////////////////////////// + +LineWidthTypeEnum parseLineWidthTypeEnum(const std::string &value) +{ + const auto opt = tryParseLineWidthTypeEnum(value); + return opt.value_or(LineWidthTypeEnum::beam); +} + +std::optional tryParseLineWidthTypeEnum(const std::string &value) +{ + if (value == "beam") + { + return LineWidthTypeEnum::beam; + } + else if (value == "bracket") + { + return LineWidthTypeEnum::bracket; + } + else if (value == "dashes") + { + return LineWidthTypeEnum::dashes; + } + else if (value == "enclosure") + { + return LineWidthTypeEnum::enclosure; + } + else if (value == "ending") + { + return LineWidthTypeEnum::ending; + } + else if (value == "extend") + { + return LineWidthTypeEnum::extend; + } + else if (value == "heavy barline") + { + return LineWidthTypeEnum::heavyBarline; + } + else if (value == "leger") + { + return LineWidthTypeEnum::leger; + } + else if (value == "light barline") + { + return LineWidthTypeEnum::lightBarline; + } + else if (value == "octave shift") + { + return LineWidthTypeEnum::octaveShift; + } + else if (value == "pedal") + { + return LineWidthTypeEnum::pedal; + } + else if (value == "slur middle") + { + return LineWidthTypeEnum::slurMiddle; + } + else if (value == "slur tip") + { + return LineWidthTypeEnum::slurTip; + } + else if (value == "staff") + { + return LineWidthTypeEnum::staff; + } + else if (value == "stem") + { + return LineWidthTypeEnum::stem; + } + else if (value == "tie middle") + { + return LineWidthTypeEnum::tieMiddle; + } + else if (value == "tie tip") + { + return LineWidthTypeEnum::tieTip; + } + else if (value == "tuplet bracket") + { + return LineWidthTypeEnum::tupletBracket; + } + else if (value == "wedge") + { + return LineWidthTypeEnum::wedge; + } + else if (value == "other") + { + return LineWidthTypeEnum::other; + } + return std::optional{}; +} + +std::string toString(const LineWidthTypeEnum value) +{ + switch (value) + { + case LineWidthTypeEnum::beam: { + return "beam"; + } + case LineWidthTypeEnum::bracket: { + return "bracket"; + } + case LineWidthTypeEnum::dashes: { + return "dashes"; + } + case LineWidthTypeEnum::enclosure: { + return "enclosure"; + } + case LineWidthTypeEnum::ending: { + return "ending"; + } + case LineWidthTypeEnum::extend: { + return "extend"; + } + case LineWidthTypeEnum::heavyBarline: { + return "heavy barline"; + } + case LineWidthTypeEnum::leger: { + return "leger"; + } + case LineWidthTypeEnum::lightBarline: { + return "light barline"; + } + case LineWidthTypeEnum::octaveShift: { + return "octave shift"; + } + case LineWidthTypeEnum::pedal: { + return "pedal"; + } + case LineWidthTypeEnum::slurMiddle: { + return "slur middle"; + } + case LineWidthTypeEnum::slurTip: { + return "slur tip"; + } + case LineWidthTypeEnum::staff: { + return "staff"; + } + case LineWidthTypeEnum::stem: { + return "stem"; + } + case LineWidthTypeEnum::tieMiddle: { + return "tie middle"; + } + case LineWidthTypeEnum::tieTip: { + return "tie tip"; + } + case LineWidthTypeEnum::tupletBracket: { + return "tuplet bracket"; + } + case LineWidthTypeEnum::wedge: { + return "wedge"; + } + default: + break; + } + return "other"; +} + +std::ostream &toStream(std::ostream &os, const LineWidthTypeEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const LineWidthTypeEnum value) +{ + return toStream(os, value); +} + +LineWidthType::LineWidthType(const LineWidthTypeEnum value) : myEnum(value), myCustomValue("") +{ + setValue(value); +} + +LineWidthType::LineWidthType(const std::string &value) : myEnum(LineWidthTypeEnum::other), myCustomValue(value) +{ + setValue(value); +} + +LineWidthType::LineWidthType() : myEnum(LineWidthTypeEnum::beam), myCustomValue("") +{ + setValue(LineWidthTypeEnum::beam); +} + +LineWidthTypeEnum LineWidthType::getValue() const +{ + return myEnum; +} + +std::string LineWidthType::getValueString() const +{ + if (myEnum != LineWidthTypeEnum::other) + { + return toString(myEnum); + } + + else + { + return myCustomValue; + } +} + +void LineWidthType::setValue(const LineWidthTypeEnum value) +{ + myEnum = value; + if (value != LineWidthTypeEnum::other && !myCustomValue.empty()) + { + myCustomValue = ""; + } +} + +void LineWidthType::setValue(const std::string &value) +{ + const auto temp = tryParseLineWidthTypeEnum(value); + if (temp) + { + myEnum = temp.value(); + myCustomValue = ""; + } + else + { + setValue(LineWidthTypeEnum::other); + myCustomValue = value; + } +} + +LineWidthType parseLineWidthType(const std::string &value) +{ + return LineWidthType(value); +} + +std::string toString(const LineWidthType &value) +{ + return value.getValueString(); +} + +std::ostream &toStream(std::ostream &os, const LineWidthType &value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const LineWidthType &value) +{ + return toStream(os, value); +} + +/// MarginType ///////////////////////////////////////////////////////////////////////////// + +MarginType parseMarginType(const std::string &value) +{ + const auto opt = tryParseMarginType(value); + return opt.value_or(MarginType::odd); +} + +std::optional tryParseMarginType(const std::string &value) +{ + if (value == "odd") + { + return MarginType::odd; + } + else if (value == "even") + { + return MarginType::even; + } + else if (value == "both") + { + return MarginType::both; + } + return std::optional{}; +} + +std::string toString(const MarginType value) +{ + switch (value) + { + case MarginType::odd: { + return "odd"; + } + case MarginType::even: { + return "even"; + } + case MarginType::both: { + return "both"; + } + default: + break; + } + return "odd"; +} + +std::ostream &toStream(std::ostream &os, const MarginType value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const MarginType value) +{ + return toStream(os, value); +} + +/// MeasureNumberingValue ////////////////////////////////////////////////////////////////// + +MeasureNumberingValue parseMeasureNumberingValue(const std::string &value) +{ + const auto opt = tryParseMeasureNumberingValue(value); + return opt.value_or(MeasureNumberingValue::none); +} + +std::optional tryParseMeasureNumberingValue(const std::string &value) +{ + if (value == "none") + { + return MeasureNumberingValue::none; + } + else if (value == "measure") + { + return MeasureNumberingValue::measure; + } + else if (value == "system") + { + return MeasureNumberingValue::system; + } + return std::optional{}; +} + +std::string toString(const MeasureNumberingValue value) +{ + switch (value) + { + case MeasureNumberingValue::none: { + return "none"; + } + case MeasureNumberingValue::measure: { + return "measure"; + } + case MeasureNumberingValue::system: { + return "system"; + } + default: + break; + } + return "none"; +} + +std::ostream &toStream(std::ostream &os, const MeasureNumberingValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const MeasureNumberingValue value) +{ + return toStream(os, value); +} + +/// MembraneEnum /////////////////////////////////////////////////////////////////////////// + +MembraneEnum parseMembraneEnum(const std::string &value) +{ + const auto opt = tryParseMembraneEnum(value); + return opt.value_or(MembraneEnum::bassDrum); +} + +std::optional tryParseMembraneEnum(const std::string &value) +{ + if (value == "bass drum") + { + return MembraneEnum::bassDrum; + } + else if (value == "bass drum on side") + { + return MembraneEnum::bassDrumOnSide; + } + else if (value == "bongos") + { + return MembraneEnum::bongos; + } + else if (value == "conga drum") + { + return MembraneEnum::congaDrum; + } + else if (value == "goblet drum") + { + return MembraneEnum::gobletDrum; + } + else if (value == "military drum") + { + return MembraneEnum::militaryDrum; + } + else if (value == "snare drum") + { + return MembraneEnum::snareDrum; + } + else if (value == "snare drum snares off") + { + return MembraneEnum::snareDrumSnaresOff; + } + else if (value == "tambourine") + { + return MembraneEnum::tambourine; + } + else if (value == "tenor drum") + { + return MembraneEnum::tenorDrum; + } + else if (value == "timbales") + { + return MembraneEnum::timbales; + } + else if (value == "tomtom") + { + return MembraneEnum::tomtom; + } + return std::optional{}; +} + +std::string toString(const MembraneEnum value) +{ + switch (value) + { + case MembraneEnum::bassDrum: { + return "bass drum"; + } + case MembraneEnum::bassDrumOnSide: { + return "bass drum on side"; + } + case MembraneEnum::bongos: { + return "bongos"; + } + case MembraneEnum::congaDrum: { + return "conga drum"; + } + case MembraneEnum::gobletDrum: { + return "goblet drum"; + } + case MembraneEnum::militaryDrum: { + return "military drum"; + } + case MembraneEnum::snareDrum: { + return "snare drum"; + } + case MembraneEnum::snareDrumSnaresOff: { + return "snare drum snares off"; + } + case MembraneEnum::tambourine: { + return "tambourine"; + } + case MembraneEnum::tenorDrum: { + return "tenor drum"; + } + case MembraneEnum::timbales: { + return "timbales"; + } + case MembraneEnum::tomtom: { + return "tomtom"; + } + default: + break; + } + return "bass drum"; +} + +std::ostream &toStream(std::ostream &os, const MembraneEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const MembraneEnum value) +{ + return toStream(os, value); +} + +/// MetalEnum ////////////////////////////////////////////////////////////////////////////// + +MetalEnum parseMetalEnum(const std::string &value) +{ + const auto opt = tryParseMetalEnum(value); + return opt.value_or(MetalEnum::almglocken); +} + +std::optional tryParseMetalEnum(const std::string &value) +{ + if (value == "almglocken") + { + return MetalEnum::almglocken; + } + else if (value == "bell") + { + return MetalEnum::bell; + } + else if (value == "bell plate") + { + return MetalEnum::bellPlate; + } + else if (value == "brake drum") + { + return MetalEnum::brakeDrum; + } + else if (value == "Chinese cymbal") + { + return MetalEnum::chineseCymbal; + } + else if (value == "cowbell") + { + return MetalEnum::cowbell; + } + else if (value == "crash cymbals") + { + return MetalEnum::crashCymbals; + } + else if (value == "crotale") + { + return MetalEnum::crotale; + } + else if (value == "cymbal tongs") + { + return MetalEnum::cymbalTongs; + } + else if (value == "domed gong") + { + return MetalEnum::domedGong; + } + else if (value == "finger cymbals") + { + return MetalEnum::fingerCymbals; + } + else if (value == "flexatone") + { + return MetalEnum::flexatone; + } + else if (value == "gong") + { + return MetalEnum::gong; + } + else if (value == "hi-hat") + { + return MetalEnum::hiHat; + } + else if (value == "high-hat cymbals") + { + return MetalEnum::highHatCymbals; + } + else if (value == "handbell") + { + return MetalEnum::handbell; + } + else if (value == "sistrum") + { + return MetalEnum::sistrum; + } + else if (value == "sizzle cymbal") + { + return MetalEnum::sizzleCymbal; + } + else if (value == "sleigh bells") + { + return MetalEnum::sleighBells; + } + else if (value == "suspended cymbal") + { + return MetalEnum::suspendedCymbal; + } + else if (value == "tam tam") + { + return MetalEnum::tamTam; + } + else if (value == "triangle") + { + return MetalEnum::triangle; + } + else if (value == "Vietnamese hat") + { + return MetalEnum::vietnameseHat; + } + return std::optional{}; +} + +std::string toString(const MetalEnum value) +{ + switch (value) + { + case MetalEnum::almglocken: { + return "almglocken"; + } + case MetalEnum::bell: { + return "bell"; + } + case MetalEnum::bellPlate: { + return "bell plate"; + } + case MetalEnum::brakeDrum: { + return "brake drum"; + } + case MetalEnum::chineseCymbal: { + return "Chinese cymbal"; + } + case MetalEnum::cowbell: { + return "cowbell"; + } + case MetalEnum::crashCymbals: { + return "crash cymbals"; + } + case MetalEnum::crotale: { + return "crotale"; + } + case MetalEnum::cymbalTongs: { + return "cymbal tongs"; + } + case MetalEnum::domedGong: { + return "domed gong"; + } + case MetalEnum::fingerCymbals: { + return "finger cymbals"; + } + case MetalEnum::flexatone: { + return "flexatone"; + } + case MetalEnum::gong: { + return "gong"; + } + case MetalEnum::hiHat: { + return "hi-hat"; + } + case MetalEnum::highHatCymbals: { + return "high-hat cymbals"; + } + case MetalEnum::handbell: { + return "handbell"; + } + case MetalEnum::sistrum: { + return "sistrum"; + } + case MetalEnum::sizzleCymbal: { + return "sizzle cymbal"; + } + case MetalEnum::sleighBells: { + return "sleigh bells"; + } + case MetalEnum::suspendedCymbal: { + return "suspended cymbal"; + } + case MetalEnum::tamTam: { + return "tam tam"; + } + case MetalEnum::triangle: { + return "triangle"; + } + case MetalEnum::vietnameseHat: { + return "Vietnamese hat"; + } + default: + break; + } + return "almglocken"; +} + +std::ostream &toStream(std::ostream &os, const MetalEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const MetalEnum value) +{ + return toStream(os, value); +} + +/// ModeEnum /////////////////////////////////////////////////////////////////////////////// + +ModeEnum parseModeEnum(const std::string &value) +{ + const auto opt = tryParseModeEnum(value); + return opt.value_or(ModeEnum::major); +} + +std::optional tryParseModeEnum(const std::string &value) +{ + if (value == "major") + { + return ModeEnum::major; + } + else if (value == "minor") + { + return ModeEnum::minor; + } + else if (value == "dorian") + { + return ModeEnum::dorian; + } + else if (value == "phrygian") + { + return ModeEnum::phrygian; + } + else if (value == "lydian") + { + return ModeEnum::lydian; + } + else if (value == "mixolydian") + { + return ModeEnum::mixolydian; + } + else if (value == "aeolian") + { + return ModeEnum::aeolian; + } + else if (value == "ionian") + { + return ModeEnum::ionian; + } + else if (value == "locrian") + { + return ModeEnum::locrian; + } + else if (value == "none") + { + return ModeEnum::none; + } + else if (value == "other") + { + return ModeEnum::other; + } + return std::optional{}; +} + +std::string toString(const ModeEnum value) +{ + switch (value) + { + case ModeEnum::major: { + return "major"; + } + case ModeEnum::minor: { + return "minor"; + } + case ModeEnum::dorian: { + return "dorian"; + } + case ModeEnum::phrygian: { + return "phrygian"; + } + case ModeEnum::lydian: { + return "lydian"; + } + case ModeEnum::mixolydian: { + return "mixolydian"; + } + case ModeEnum::aeolian: { + return "aeolian"; + } + case ModeEnum::ionian: { + return "ionian"; + } + case ModeEnum::locrian: { + return "locrian"; + } + case ModeEnum::none: { + return "none"; + } + default: + break; + } + return "other"; +} + +std::ostream &toStream(std::ostream &os, const ModeEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const ModeEnum value) +{ + return toStream(os, value); +} + +ModeValue::ModeValue(const ModeEnum value) : myEnum(value), myCustomValue("") +{ + setValue(value); +} + +ModeValue::ModeValue(const std::string &value) : myEnum(ModeEnum::other), myCustomValue(value) +{ + setValue(value); +} + +ModeValue::ModeValue() : myEnum(ModeEnum::major), myCustomValue("") +{ + setValue(ModeEnum::major); +} + +ModeEnum ModeValue::getValue() const +{ + return myEnum; +} + +std::string ModeValue::getValueString() const +{ + if (myEnum != ModeEnum::other) + { + return toString(myEnum); + } + + else + { + return myCustomValue; + } +} + +void ModeValue::setValue(const ModeEnum value) +{ + myEnum = value; + if (value != ModeEnum::other && !myCustomValue.empty()) + { + myCustomValue = ""; + } +} + +void ModeValue::setValue(const std::string &value) +{ + const auto temp = tryParseModeEnum(value); + if (temp) + { + myEnum = temp.value(); + myCustomValue = ""; + } + else + { + setValue(ModeEnum::other); + myCustomValue = value; + } +} + +ModeValue parseModeValue(const std::string &value) +{ + return ModeValue(value); +} + +std::string toString(const ModeValue &value) +{ + return value.getValueString(); +} + +std::ostream &toStream(std::ostream &os, const ModeValue &value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const ModeValue &value) +{ + return toStream(os, value); +} + +/// MuteEnum /////////////////////////////////////////////////////////////////////////////// + +MuteEnum parseMuteEnum(const std::string &value) +{ + const auto opt = tryParseMuteEnum(value); + return opt.value_or(MuteEnum::on); +} + +std::optional tryParseMuteEnum(const std::string &value) +{ + if (value == "on") + { + return MuteEnum::on; + } + else if (value == "off") + { + return MuteEnum::off; + } + else if (value == "straight") + { + return MuteEnum::straight; + } + else if (value == "cup") + { + return MuteEnum::cup; + } + else if (value == "harmon-no-stem") + { + return MuteEnum::harmonNoStem; + } + else if (value == "harmon-stem") + { + return MuteEnum::harmonStem; + } + else if (value == "bucket") + { + return MuteEnum::bucket; + } + else if (value == "plunger") + { + return MuteEnum::plunger; + } + else if (value == "hat") + { + return MuteEnum::hat; + } + else if (value == "solotone") + { + return MuteEnum::solotone; + } + else if (value == "practice") + { + return MuteEnum::practice; + } + else if (value == "stop-mute") + { + return MuteEnum::stopMute; + } + else if (value == "stop-hand") + { + return MuteEnum::stopHand; + } + else if (value == "echo") + { + return MuteEnum::echo; + } + else if (value == "palm") + { + return MuteEnum::palm; + } + return std::optional{}; +} + +std::string toString(const MuteEnum value) +{ + switch (value) + { + case MuteEnum::on: { + return "on"; + } + case MuteEnum::off: { + return "off"; + } + case MuteEnum::straight: { + return "straight"; + } + case MuteEnum::cup: { + return "cup"; + } + case MuteEnum::harmonNoStem: { + return "harmon-no-stem"; + } + case MuteEnum::harmonStem: { + return "harmon-stem"; + } + case MuteEnum::bucket: { + return "bucket"; + } + case MuteEnum::plunger: { + return "plunger"; + } + case MuteEnum::hat: { + return "hat"; + } + case MuteEnum::solotone: { + return "solotone"; + } + case MuteEnum::practice: { + return "practice"; + } + case MuteEnum::stopMute: { + return "stop-mute"; + } + case MuteEnum::stopHand: { + return "stop-hand"; + } + case MuteEnum::echo: { + return "echo"; + } + case MuteEnum::palm: { + return "palm"; + } + default: + break; + } + return "on"; +} + +std::ostream &toStream(std::ostream &os, const MuteEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const MuteEnum value) +{ + return toStream(os, value); +} + +/// NoteSizeType /////////////////////////////////////////////////////////////////////////// + +NoteSizeType parseNoteSizeType(const std::string &value) +{ + const auto opt = tryParseNoteSizeType(value); + return opt.value_or(NoteSizeType::cue); +} + +std::optional tryParseNoteSizeType(const std::string &value) +{ + if (value == "cue") + { + return NoteSizeType::cue; + } + else if (value == "grace") + { + return NoteSizeType::grace; + } + else if (value == "large") + { + return NoteSizeType::large; + } + return std::optional{}; +} + +std::string toString(const NoteSizeType value) +{ + switch (value) + { + case NoteSizeType::cue: { + return "cue"; + } + case NoteSizeType::grace: { + return "grace"; + } + case NoteSizeType::large: { + return "large"; + } + default: + break; + } + return "cue"; +} + +std::ostream &toStream(std::ostream &os, const NoteSizeType value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const NoteSizeType value) +{ + return toStream(os, value); +} + +/// NoteTypeValue ////////////////////////////////////////////////////////////////////////// + +NoteTypeValue parseNoteTypeValue(const std::string &value) +{ + const auto opt = tryParseNoteTypeValue(value); + return opt.value_or(NoteTypeValue::oneThousandTwentyFourth); +} + +std::optional tryParseNoteTypeValue(const std::string &value) +{ + if (value == "1024th") + { + return NoteTypeValue::oneThousandTwentyFourth; + } + else if (value == "512th") + { + return NoteTypeValue::fiveHundredTwelfth; + } + else if (value == "256th") + { + return NoteTypeValue::twoHundredFifthySixth; + } + else if (value == "128th") + { + return NoteTypeValue::oneHundredTwentyEighth; + } + else if (value == "64th") + { + return NoteTypeValue::sixtyFourth; + } + else if (value == "32nd") + { + return NoteTypeValue::thirtySecond; + } + else if (value == "16th") + { + return NoteTypeValue::sixteenth; + } + else if (value == "eighth") + { + return NoteTypeValue::eighth; + } + else if (value == "quarter") + { + return NoteTypeValue::quarter; + } + else if (value == "half") + { + return NoteTypeValue::half; + } + else if (value == "whole") + { + return NoteTypeValue::whole; + } + else if (value == "breve") + { + return NoteTypeValue::breve; + } + else if (value == "long") + { + return NoteTypeValue::long_; + } + else if (value == "maxima") + { + return NoteTypeValue::maxima; + } + return std::optional{}; +} + +std::string toString(const NoteTypeValue value) +{ + switch (value) + { + case NoteTypeValue::oneThousandTwentyFourth: { + return "1024th"; + } + case NoteTypeValue::fiveHundredTwelfth: { + return "512th"; + } + case NoteTypeValue::twoHundredFifthySixth: { + return "256th"; + } + case NoteTypeValue::oneHundredTwentyEighth: { + return "128th"; + } + case NoteTypeValue::sixtyFourth: { + return "64th"; + } + case NoteTypeValue::thirtySecond: { + return "32nd"; + } + case NoteTypeValue::sixteenth: { + return "16th"; + } + case NoteTypeValue::eighth: { + return "eighth"; + } + case NoteTypeValue::quarter: { + return "quarter"; + } + case NoteTypeValue::half: { + return "half"; + } + case NoteTypeValue::whole: { + return "whole"; + } + case NoteTypeValue::breve: { + return "breve"; + } + case NoteTypeValue::long_: { + return "long"; + } + case NoteTypeValue::maxima: { + return "maxima"; + } + default: + break; + } + return "1024th"; +} + +std::ostream &toStream(std::ostream &os, const NoteTypeValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const NoteTypeValue value) +{ + return toStream(os, value); +} + +/// NoteheadValue ////////////////////////////////////////////////////////////////////////// + +NoteheadValue parseNoteheadValue(const std::string &value) +{ + const auto opt = tryParseNoteheadValue(value); + return opt.value_or(NoteheadValue::slash); +} + +std::optional tryParseNoteheadValue(const std::string &value) +{ + if (value == "slash") + { + return NoteheadValue::slash; + } + else if (value == "triangle") + { + return NoteheadValue::triangle; + } + else if (value == "diamond") + { + return NoteheadValue::diamond; + } + else if (value == "square") + { + return NoteheadValue::square; + } + else if (value == "cross") + { + return NoteheadValue::cross; + } + else if (value == "x") + { + return NoteheadValue::x; + } + else if (value == "circle-x") + { + return NoteheadValue::circleX; + } + else if (value == "inverted triangle") + { + return NoteheadValue::invertedTriangle; + } + else if (value == "arrow down") + { + return NoteheadValue::arrowDown; + } + else if (value == "arrow up") + { + return NoteheadValue::arrowUp; + } + else if (value == "slashed") + { + return NoteheadValue::slashed; + } + else if (value == "back slashed") + { + return NoteheadValue::backSlashed; + } + else if (value == "normal") + { + return NoteheadValue::normal; + } + else if (value == "cluster") + { + return NoteheadValue::cluster; + } + else if (value == "circle dot") + { + return NoteheadValue::circleDot; + } + else if (value == "left triangle") + { + return NoteheadValue::leftTriangle; + } + else if (value == "rectangle") + { + return NoteheadValue::rectangle; + } + else if (value == "none") + { + return NoteheadValue::none; + } + else if (value == "do") + { + return NoteheadValue::do_; + } + else if (value == "re") + { + return NoteheadValue::re; + } + else if (value == "mi") + { + return NoteheadValue::mi; + } + else if (value == "fa") + { + return NoteheadValue::fa; + } + else if (value == "fa up") + { + return NoteheadValue::faUp; + } + else if (value == "so") + { + return NoteheadValue::so; + } + else if (value == "la") + { + return NoteheadValue::la; + } + else if (value == "ti") + { + return NoteheadValue::ti; + } + return std::optional{}; +} + +std::string toString(const NoteheadValue value) +{ + switch (value) + { + case NoteheadValue::slash: { + return "slash"; + } + case NoteheadValue::triangle: { + return "triangle"; + } + case NoteheadValue::diamond: { + return "diamond"; + } + case NoteheadValue::square: { + return "square"; + } + case NoteheadValue::cross: { + return "cross"; + } + case NoteheadValue::x: { + return "x"; + } + case NoteheadValue::circleX: { + return "circle-x"; + } + case NoteheadValue::invertedTriangle: { + return "inverted triangle"; + } + case NoteheadValue::arrowDown: { + return "arrow down"; + } + case NoteheadValue::arrowUp: { + return "arrow up"; + } + case NoteheadValue::slashed: { + return "slashed"; + } + case NoteheadValue::backSlashed: { + return "back slashed"; + } + case NoteheadValue::normal: { + return "normal"; + } + case NoteheadValue::cluster: { + return "cluster"; + } + case NoteheadValue::circleDot: { + return "circle dot"; + } + case NoteheadValue::leftTriangle: { + return "left triangle"; + } + case NoteheadValue::rectangle: { + return "rectangle"; + } + case NoteheadValue::none: { + return "none"; + } + case NoteheadValue::do_: { + return "do"; + } + case NoteheadValue::re: { + return "re"; + } + case NoteheadValue::mi: { + return "mi"; + } + case NoteheadValue::fa: { + return "fa"; + } + case NoteheadValue::faUp: { + return "fa up"; + } + case NoteheadValue::so: { + return "so"; + } + case NoteheadValue::la: { + return "la"; + } + case NoteheadValue::ti: { + return "ti"; + } + default: + break; + } + return "slash"; +} + +std::ostream &toStream(std::ostream &os, const NoteheadValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const NoteheadValue value) +{ + return toStream(os, value); +} + +/// OnOff ////////////////////////////////////////////////////////////////////////////////// + +OnOff parseOnOff(const std::string &value) +{ + const auto opt = tryParseOnOff(value); + return opt.value_or(OnOff::on); +} + +std::optional tryParseOnOff(const std::string &value) +{ + if (value == "on") + { + return OnOff::on; + } + else if (value == "off") + { + return OnOff::off; + } + return std::optional{}; +} + +std::string toString(const OnOff value) +{ + switch (value) + { + case OnOff::on: { + return "on"; + } + case OnOff::off: { + return "off"; + } + default: + break; + } + return "on"; +} + +std::ostream &toStream(std::ostream &os, const OnOff value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const OnOff value) +{ + return toStream(os, value); +} + +/// OverUnder ////////////////////////////////////////////////////////////////////////////// + +OverUnder parseOverUnder(const std::string &value) +{ + const auto opt = tryParseOverUnder(value); + return opt.value_or(OverUnder::over); +} + +std::optional tryParseOverUnder(const std::string &value) +{ + if (value == "over") + { + return OverUnder::over; + } + else if (value == "under") + { + return OverUnder::under; + } + return std::optional{}; +} + +std::string toString(const OverUnder value) +{ + switch (value) + { + case OverUnder::over: { + return "over"; + } + case OverUnder::under: { + return "under"; + } + default: + break; + } + return "over"; +} + +std::ostream &toStream(std::ostream &os, const OverUnder value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const OverUnder value) +{ + return toStream(os, value); +} + +/// PitchedEnum //////////////////////////////////////////////////////////////////////////// + +PitchedEnum parsePitchedEnum(const std::string &value) +{ + const auto opt = tryParsePitchedEnum(value); + return opt.value_or(PitchedEnum::chimes); +} + +std::optional tryParsePitchedEnum(const std::string &value) +{ + if (value == "chimes") + { + return PitchedEnum::chimes; + } + else if (value == "glockenspiel") + { + return PitchedEnum::glockenspiel; + } + else if (value == "mallet") + { + return PitchedEnum::mallet; + } + else if (value == "marimba") + { + return PitchedEnum::marimba; + } + else if (value == "tubular chimes") + { + return PitchedEnum::tubularChimes; + } + else if (value == "vibraphone") + { + return PitchedEnum::vibraphone; + } + else if (value == "xylophone") + { + return PitchedEnum::xylophone; + } + return std::optional{}; +} + +std::string toString(const PitchedEnum value) +{ + switch (value) + { + case PitchedEnum::chimes: { + return "chimes"; + } + case PitchedEnum::glockenspiel: { + return "glockenspiel"; + } + case PitchedEnum::mallet: { + return "mallet"; + } + case PitchedEnum::marimba: { + return "marimba"; + } + case PitchedEnum::tubularChimes: { + return "tubular chimes"; + } + case PitchedEnum::vibraphone: { + return "vibraphone"; + } + case PitchedEnum::xylophone: { + return "xylophone"; + } + default: + break; + } + return "chimes"; +} + +std::ostream &toStream(std::ostream &os, const PitchedEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const PitchedEnum value) +{ + return toStream(os, value); +} + +/// PrincipalVoiceSymbol /////////////////////////////////////////////////////////////////// + +PrincipalVoiceSymbol parsePrincipalVoiceSymbol(const std::string &value) +{ + const auto opt = tryParsePrincipalVoiceSymbol(value); + return opt.value_or(PrincipalVoiceSymbol::hauptstimme); +} + +std::optional tryParsePrincipalVoiceSymbol(const std::string &value) +{ + if (value == "Hauptstimme") + { + return PrincipalVoiceSymbol::hauptstimme; + } + else if (value == "Nebenstimme") + { + return PrincipalVoiceSymbol::nebenstimme; + } + else if (value == "plain") + { + return PrincipalVoiceSymbol::plain; + } + else if (value == "none") + { + return PrincipalVoiceSymbol::none; + } + return std::optional{}; +} + +std::string toString(const PrincipalVoiceSymbol value) +{ + switch (value) + { + case PrincipalVoiceSymbol::hauptstimme: { + return "Hauptstimme"; + } + case PrincipalVoiceSymbol::nebenstimme: { + return "Nebenstimme"; + } + case PrincipalVoiceSymbol::plain: { + return "plain"; + } + case PrincipalVoiceSymbol::none: { + return "none"; + } + default: + break; + } + return "Hauptstimme"; +} + +std::ostream &toStream(std::ostream &os, const PrincipalVoiceSymbol value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const PrincipalVoiceSymbol value) +{ + return toStream(os, value); +} + +/// RightLeftMiddle //////////////////////////////////////////////////////////////////////// + +RightLeftMiddle parseRightLeftMiddle(const std::string &value) +{ + const auto opt = tryParseRightLeftMiddle(value); + return opt.value_or(RightLeftMiddle::right); +} + +std::optional tryParseRightLeftMiddle(const std::string &value) +{ + if (value == "right") + { + return RightLeftMiddle::right; + } + else if (value == "left") + { + return RightLeftMiddle::left; + } + else if (value == "middle") + { + return RightLeftMiddle::middle; + } + return std::optional{}; +} + +std::string toString(const RightLeftMiddle value) +{ + switch (value) + { + case RightLeftMiddle::right: { + return "right"; + } + case RightLeftMiddle::left: { + return "left"; + } + case RightLeftMiddle::middle: { + return "middle"; + } + default: + break; + } + return "right"; +} + +std::ostream &toStream(std::ostream &os, const RightLeftMiddle value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const RightLeftMiddle value) +{ + return toStream(os, value); +} + +/// SemiPitchedEnum //////////////////////////////////////////////////////////////////////// + +SemiPitchedEnum parseSemiPitchedEnum(const std::string &value) +{ + const auto opt = tryParseSemiPitchedEnum(value); + return opt.value_or(SemiPitchedEnum::high); +} + +std::optional tryParseSemiPitchedEnum(const std::string &value) +{ + if (value == "high") + { + return SemiPitchedEnum::high; + } + else if (value == "medium-high") + { + return SemiPitchedEnum::mediumHigh; + } + else if (value == "medium") + { + return SemiPitchedEnum::medium; + } + else if (value == "medium-low") + { + return SemiPitchedEnum::mediumLow; + } + else if (value == "low") + { + return SemiPitchedEnum::low; + } + else if (value == "very-low") + { + return SemiPitchedEnum::veryLow; + } + return std::optional{}; +} + +std::string toString(const SemiPitchedEnum value) +{ + switch (value) + { + case SemiPitchedEnum::high: { + return "high"; + } + case SemiPitchedEnum::mediumHigh: { + return "medium-high"; + } + case SemiPitchedEnum::medium: { + return "medium"; + } + case SemiPitchedEnum::mediumLow: { + return "medium-low"; + } + case SemiPitchedEnum::low: { + return "low"; + } + case SemiPitchedEnum::veryLow: { + return "very-low"; + } + default: + break; + } + return "high"; +} + +std::ostream &toStream(std::ostream &os, const SemiPitchedEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const SemiPitchedEnum value) +{ + return toStream(os, value); +} + +/// ShowFrets ////////////////////////////////////////////////////////////////////////////// + +ShowFrets parseShowFrets(const std::string &value) +{ + const auto opt = tryParseShowFrets(value); + return opt.value_or(ShowFrets::numbers); +} + +std::optional tryParseShowFrets(const std::string &value) +{ + if (value == "numbers") + { + return ShowFrets::numbers; + } + else if (value == "letters") + { + return ShowFrets::letters; + } + return std::optional{}; +} + +std::string toString(const ShowFrets value) +{ + switch (value) + { + case ShowFrets::numbers: { + return "numbers"; + } + case ShowFrets::letters: { + return "letters"; + } + default: + break; + } + return "numbers"; +} + +std::ostream &toStream(std::ostream &os, const ShowFrets value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const ShowFrets value) +{ + return toStream(os, value); +} + +/// ShowTuplet ///////////////////////////////////////////////////////////////////////////// + +ShowTuplet parseShowTuplet(const std::string &value) +{ + const auto opt = tryParseShowTuplet(value); + return opt.value_or(ShowTuplet::actual); +} + +std::optional tryParseShowTuplet(const std::string &value) +{ + if (value == "actual") + { + return ShowTuplet::actual; + } + else if (value == "both") + { + return ShowTuplet::both; + } + else if (value == "none") + { + return ShowTuplet::none; + } + return std::optional{}; +} + +std::string toString(const ShowTuplet value) +{ + switch (value) + { + case ShowTuplet::actual: { + return "actual"; + } + case ShowTuplet::both: { + return "both"; + } + case ShowTuplet::none: { + return "none"; + } + default: + break; + } + return "actual"; +} + +std::ostream &toStream(std::ostream &os, const ShowTuplet value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const ShowTuplet value) +{ + return toStream(os, value); +} + +/// StaffTypeEnum ////////////////////////////////////////////////////////////////////////// + +StaffTypeEnum parseStaffTypeEnum(const std::string &value) +{ + const auto opt = tryParseStaffTypeEnum(value); + return opt.value_or(StaffTypeEnum::ossia); +} + +std::optional tryParseStaffTypeEnum(const std::string &value) +{ + if (value == "ossia") + { + return StaffTypeEnum::ossia; + } + else if (value == "cue") + { + return StaffTypeEnum::cue; + } + else if (value == "editorial") + { + return StaffTypeEnum::editorial; + } + else if (value == "regular") + { + return StaffTypeEnum::regular; + } + else if (value == "alternate") + { + return StaffTypeEnum::alternate; + } + return std::optional{}; +} + +std::string toString(const StaffTypeEnum value) +{ + switch (value) + { + case StaffTypeEnum::ossia: { + return "ossia"; + } + case StaffTypeEnum::cue: { + return "cue"; + } + case StaffTypeEnum::editorial: { + return "editorial"; + } + case StaffTypeEnum::regular: { + return "regular"; + } + case StaffTypeEnum::alternate: { + return "alternate"; + } + default: + break; + } + return "ossia"; +} + +std::ostream &toStream(std::ostream &os, const StaffTypeEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StaffTypeEnum value) +{ + return toStream(os, value); +} + +/// StartNote ////////////////////////////////////////////////////////////////////////////// + +StartNote parseStartNote(const std::string &value) +{ + const auto opt = tryParseStartNote(value); + return opt.value_or(StartNote::upper); +} + +std::optional tryParseStartNote(const std::string &value) +{ + if (value == "upper") + { + return StartNote::upper; + } + else if (value == "main") + { + return StartNote::main; + } + else if (value == "below") + { + return StartNote::below; + } + return std::optional{}; +} + +std::string toString(const StartNote value) +{ + switch (value) + { + case StartNote::upper: { + return "upper"; + } + case StartNote::main: { + return "main"; + } + case StartNote::below: { + return "below"; + } + default: + break; + } + return "upper"; +} + +std::ostream &toStream(std::ostream &os, const StartNote value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StartNote value) +{ + return toStream(os, value); +} + +/// StartStop ////////////////////////////////////////////////////////////////////////////// + +StartStop parseStartStop(const std::string &value) +{ + const auto opt = tryParseStartStop(value); + return opt.value_or(StartStop::start); +} + +std::optional tryParseStartStop(const std::string &value) +{ + if (value == "start") + { + return StartStop::start; + } + else if (value == "stop") + { + return StartStop::stop; + } + return std::optional{}; +} + +std::string toString(const StartStop value) +{ + switch (value) + { + case StartStop::start: { + return "start"; + } + case StartStop::stop: { + return "stop"; + } + default: + break; + } + return "start"; +} + +std::ostream &toStream(std::ostream &os, const StartStop value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StartStop value) +{ + return toStream(os, value); +} + +/// StartStopChangeContinue //////////////////////////////////////////////////////////////// + +StartStopChangeContinue parseStartStopChangeContinue(const std::string &value) +{ + const auto opt = tryParseStartStopChangeContinue(value); + return opt.value_or(StartStopChangeContinue::start); +} + +std::optional tryParseStartStopChangeContinue(const std::string &value) +{ + if (value == "start") + { + return StartStopChangeContinue::start; + } + else if (value == "stop") + { + return StartStopChangeContinue::stop; + } + else if (value == "change") + { + return StartStopChangeContinue::change; + } + else if (value == "continue") + { + return StartStopChangeContinue::continue_; + } + return std::optional{}; +} + +std::string toString(const StartStopChangeContinue value) +{ + switch (value) + { + case StartStopChangeContinue::start: { + return "start"; + } + case StartStopChangeContinue::stop: { + return "stop"; + } + case StartStopChangeContinue::change: { + return "change"; + } + case StartStopChangeContinue::continue_: { + return "continue"; + } + default: + break; + } + return "start"; +} + +std::ostream &toStream(std::ostream &os, const StartStopChangeContinue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StartStopChangeContinue value) +{ + return toStream(os, value); +} + +/// StartStopContinue ////////////////////////////////////////////////////////////////////// + +StartStopContinue parseStartStopContinue(const std::string &value) +{ + const auto opt = tryParseStartStopContinue(value); + return opt.value_or(StartStopContinue::start); +} + +std::optional tryParseStartStopContinue(const std::string &value) +{ + if (value == "start") + { + return StartStopContinue::start; + } + else if (value == "stop") + { + return StartStopContinue::stop; + } + else if (value == "continue") + { + return StartStopContinue::continue_; + } + return std::optional{}; +} + +std::string toString(const StartStopContinue value) +{ + switch (value) + { + case StartStopContinue::start: { + return "start"; + } + case StartStopContinue::stop: { + return "stop"; + } + case StartStopContinue::continue_: { + return "continue"; + } + default: + break; + } + return "start"; +} + +std::ostream &toStream(std::ostream &os, const StartStopContinue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StartStopContinue value) +{ + return toStream(os, value); +} + +/// StartStopDiscontinue /////////////////////////////////////////////////////////////////// + +StartStopDiscontinue parseStartStopDiscontinue(const std::string &value) +{ + const auto opt = tryParseStartStopDiscontinue(value); + return opt.value_or(StartStopDiscontinue::start); +} + +std::optional tryParseStartStopDiscontinue(const std::string &value) +{ + if (value == "start") + { + return StartStopDiscontinue::start; + } + else if (value == "stop") + { + return StartStopDiscontinue::stop; + } + else if (value == "discontinue") + { + return StartStopDiscontinue::discontinue; + } + return std::optional{}; +} + +std::string toString(const StartStopDiscontinue value) +{ + switch (value) + { + case StartStopDiscontinue::start: { + return "start"; + } + case StartStopDiscontinue::stop: { + return "stop"; + } + case StartStopDiscontinue::discontinue: { + return "discontinue"; + } + default: + break; + } + return "start"; +} + +std::ostream &toStream(std::ostream &os, const StartStopDiscontinue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StartStopDiscontinue value) +{ + return toStream(os, value); +} + +/// StartStopSingle //////////////////////////////////////////////////////////////////////// + +StartStopSingle parseStartStopSingle(const std::string &value) +{ + const auto opt = tryParseStartStopSingle(value); + return opt.value_or(StartStopSingle::start); +} + +std::optional tryParseStartStopSingle(const std::string &value) +{ + if (value == "start") + { + return StartStopSingle::start; + } + else if (value == "stop") + { + return StartStopSingle::stop; + } + else if (value == "single") + { + return StartStopSingle::single; + } + return std::optional{}; +} + +std::string toString(const StartStopSingle value) +{ + switch (value) + { + case StartStopSingle::start: { + return "start"; + } + case StartStopSingle::stop: { + return "stop"; + } + case StartStopSingle::single: { + return "single"; + } + default: + break; + } + return "start"; +} + +std::ostream &toStream(std::ostream &os, const StartStopSingle value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StartStopSingle value) +{ + return toStream(os, value); +} + +/// StemValue ////////////////////////////////////////////////////////////////////////////// + +StemValue parseStemValue(const std::string &value) +{ + const auto opt = tryParseStemValue(value); + return opt.value_or(StemValue::down); +} + +std::optional tryParseStemValue(const std::string &value) +{ + if (value == "down") + { + return StemValue::down; + } + else if (value == "up") + { + return StemValue::up; + } + else if (value == "double") + { + return StemValue::double_; + } + else if (value == "none") + { + return StemValue::none; + } + return std::optional{}; +} + +std::string toString(const StemValue value) +{ + switch (value) + { + case StemValue::down: { + return "down"; + } + case StemValue::up: { + return "up"; + } + case StemValue::double_: { + return "double"; + } + case StemValue::none: { + return "none"; + } + default: + break; + } + return "down"; +} + +std::ostream &toStream(std::ostream &os, const StemValue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StemValue value) +{ + return toStream(os, value); +} + +/// StepEnum /////////////////////////////////////////////////////////////////////////////// + +StepEnum parseStepEnum(const std::string &value) +{ + const auto opt = tryParseStepEnum(value); + return opt.value_or(StepEnum::a); +} + +std::optional tryParseStepEnum(const std::string &value) +{ + if (value == "A") + { + return StepEnum::a; + } + else if (value == "B") + { + return StepEnum::b; + } + else if (value == "C") + { + return StepEnum::c; + } + else if (value == "D") + { + return StepEnum::d; + } + else if (value == "E") + { + return StepEnum::e; + } + else if (value == "F") + { + return StepEnum::f; + } + else if (value == "G") + { + return StepEnum::g; + } + return std::optional{}; +} + +std::string toString(const StepEnum value) +{ + switch (value) + { + case StepEnum::a: { + return "A"; + } + case StepEnum::b: { + return "B"; + } + case StepEnum::c: { + return "C"; + } + case StepEnum::d: { + return "D"; + } + case StepEnum::e: { + return "E"; + } + case StepEnum::f: { + return "F"; + } + case StepEnum::g: { + return "G"; + } + default: + break; + } + return "A"; +} + +std::ostream &toStream(std::ostream &os, const StepEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StepEnum value) +{ + return toStream(os, value); +} + +/// StickLocationEnum ////////////////////////////////////////////////////////////////////// + +StickLocationEnum parseStickLocationEnum(const std::string &value) +{ + const auto opt = tryParseStickLocationEnum(value); + return opt.value_or(StickLocationEnum::center); +} + +std::optional tryParseStickLocationEnum(const std::string &value) +{ + if (value == "center") + { + return StickLocationEnum::center; + } + else if (value == "rim") + { + return StickLocationEnum::rim; + } + else if (value == "cymbal bell") + { + return StickLocationEnum::cymbalBell; + } + else if (value == "cymbal edge") + { + return StickLocationEnum::cymbalEdge; + } + return std::optional{}; +} + +std::string toString(const StickLocationEnum value) +{ + switch (value) + { + case StickLocationEnum::center: { + return "center"; + } + case StickLocationEnum::rim: { + return "rim"; + } + case StickLocationEnum::cymbalBell: { + return "cymbal bell"; + } + case StickLocationEnum::cymbalEdge: { + return "cymbal edge"; + } + default: + break; + } + return "center"; +} + +std::ostream &toStream(std::ostream &os, const StickLocationEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StickLocationEnum value) +{ + return toStream(os, value); +} + +/// StickMaterialEnum ////////////////////////////////////////////////////////////////////// + +StickMaterialEnum parseStickMaterialEnum(const std::string &value) +{ + const auto opt = tryParseStickMaterialEnum(value); + return opt.value_or(StickMaterialEnum::soft); +} + +std::optional tryParseStickMaterialEnum(const std::string &value) +{ + if (value == "soft") + { + return StickMaterialEnum::soft; + } + else if (value == "medium") + { + return StickMaterialEnum::medium; + } + else if (value == "hard") + { + return StickMaterialEnum::hard; + } + else if (value == "shaded") + { + return StickMaterialEnum::shaded; + } + else if (value == "x") + { + return StickMaterialEnum::x; + } + return std::optional{}; +} + +std::string toString(const StickMaterialEnum value) +{ + switch (value) + { + case StickMaterialEnum::soft: { + return "soft"; + } + case StickMaterialEnum::medium: { + return "medium"; + } + case StickMaterialEnum::hard: { + return "hard"; + } + case StickMaterialEnum::shaded: { + return "shaded"; + } + case StickMaterialEnum::x: { + return "x"; + } + default: + break; + } + return "soft"; +} + +std::ostream &toStream(std::ostream &os, const StickMaterialEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StickMaterialEnum value) +{ + return toStream(os, value); +} + +/// StickTypeEnum ////////////////////////////////////////////////////////////////////////// + +StickTypeEnum parseStickTypeEnum(const std::string &value) +{ + const auto opt = tryParseStickTypeEnum(value); + return opt.value_or(StickTypeEnum::bassDrum); +} + +std::optional tryParseStickTypeEnum(const std::string &value) +{ + if (value == "bass drum") + { + return StickTypeEnum::bassDrum; + } + else if (value == "double bass drum") + { + return StickTypeEnum::doubleBassDrum; + } + else if (value == "timpani") + { + return StickTypeEnum::timpani; + } + else if (value == "xylophone") + { + return StickTypeEnum::xylophone; + } + else if (value == "yarn") + { + return StickTypeEnum::yarn; + } + return std::optional{}; +} + +std::string toString(const StickTypeEnum value) +{ + switch (value) + { + case StickTypeEnum::bassDrum: { + return "bass drum"; + } + case StickTypeEnum::doubleBassDrum: { + return "double bass drum"; + } + case StickTypeEnum::timpani: { + return "timpani"; + } + case StickTypeEnum::xylophone: { + return "xylophone"; + } + case StickTypeEnum::yarn: { + return "yarn"; + } + default: + break; + } + return "bass drum"; +} + +std::ostream &toStream(std::ostream &os, const StickTypeEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const StickTypeEnum value) +{ + return toStream(os, value); +} + +/// SyllabicEnum /////////////////////////////////////////////////////////////////////////// + +SyllabicEnum parseSyllabicEnum(const std::string &value) +{ + const auto opt = tryParseSyllabicEnum(value); + return opt.value_or(SyllabicEnum::single); +} + +std::optional tryParseSyllabicEnum(const std::string &value) +{ + if (value == "single") + { + return SyllabicEnum::single; + } + else if (value == "begin") + { + return SyllabicEnum::begin; + } + else if (value == "end") + { + return SyllabicEnum::end; + } + else if (value == "middle") + { + return SyllabicEnum::middle; + } + return std::optional{}; +} + +std::string toString(const SyllabicEnum value) +{ + switch (value) + { + case SyllabicEnum::single: { + return "single"; + } + case SyllabicEnum::begin: { + return "begin"; + } + case SyllabicEnum::end: { + return "end"; + } + case SyllabicEnum::middle: { + return "middle"; + } + default: + break; + } + return "single"; +} + +std::ostream &toStream(std::ostream &os, const SyllabicEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const SyllabicEnum value) +{ + return toStream(os, value); +} + +/// SymbolSize ///////////////////////////////////////////////////////////////////////////// + +SymbolSize parseSymbolSize(const std::string &value) +{ + const auto opt = tryParseSymbolSize(value); + return opt.value_or(SymbolSize::full); +} + +std::optional tryParseSymbolSize(const std::string &value) +{ + if (value == "full") + { + return SymbolSize::full; + } + else if (value == "cue") + { + return SymbolSize::cue; + } + else if (value == "large") + { + return SymbolSize::large; + } + return std::optional{}; +} + +std::string toString(const SymbolSize value) +{ + switch (value) + { + case SymbolSize::full: { + return "full"; + } + case SymbolSize::cue: { + return "cue"; + } + case SymbolSize::large: { + return "large"; + } + default: + break; + } + return "full"; +} + +std::ostream &toStream(std::ostream &os, const SymbolSize value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const SymbolSize value) +{ + return toStream(os, value); +} + +/// TextDirection ////////////////////////////////////////////////////////////////////////// + +TextDirection parseTextDirection(const std::string &value) +{ + const auto opt = tryParseTextDirection(value); + return opt.value_or(TextDirection::ltr); +} + +std::optional tryParseTextDirection(const std::string &value) +{ + if (value == "ltr") + { + return TextDirection::ltr; + } + else if (value == "rtl") + { + return TextDirection::rtl; + } + else if (value == "lro") + { + return TextDirection::lro; + } + else if (value == "rlo") + { + return TextDirection::rlo; + } + return std::optional{}; +} + +std::string toString(const TextDirection value) +{ + switch (value) + { + case TextDirection::ltr: { + return "ltr"; + } + case TextDirection::rtl: { + return "rtl"; + } + case TextDirection::lro: { + return "lro"; + } + case TextDirection::rlo: { + return "rlo"; + } + default: + break; + } + return "ltr"; +} + +std::ostream &toStream(std::ostream &os, const TextDirection value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const TextDirection value) +{ + return toStream(os, value); +} + +/// TimeRelationEnum /////////////////////////////////////////////////////////////////////// + +TimeRelationEnum parseTimeRelationEnum(const std::string &value) +{ + const auto opt = tryParseTimeRelationEnum(value); + return opt.value_or(TimeRelationEnum::parentheses); +} + +std::optional tryParseTimeRelationEnum(const std::string &value) +{ + if (value == "parentheses") + { + return TimeRelationEnum::parentheses; + } + else if (value == "bracket") + { + return TimeRelationEnum::bracket; + } + else if (value == "equals") + { + return TimeRelationEnum::equals; + } + else if (value == "slash") + { + return TimeRelationEnum::slash; + } + else if (value == "space") + { + return TimeRelationEnum::space; + } + else if (value == "hyphen") + { + return TimeRelationEnum::hyphen; + } + return std::optional{}; +} + +std::string toString(const TimeRelationEnum value) +{ + switch (value) + { + case TimeRelationEnum::parentheses: { + return "parentheses"; + } + case TimeRelationEnum::bracket: { + return "bracket"; + } + case TimeRelationEnum::equals: { + return "equals"; + } + case TimeRelationEnum::slash: { + return "slash"; + } + case TimeRelationEnum::space: { + return "space"; + } + case TimeRelationEnum::hyphen: { + return "hyphen"; + } + default: + break; + } + return "parentheses"; +} + +std::ostream &toStream(std::ostream &os, const TimeRelationEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const TimeRelationEnum value) +{ + return toStream(os, value); +} + +/// TimeSeparator ////////////////////////////////////////////////////////////////////////// + +TimeSeparator parseTimeSeparator(const std::string &value) +{ + const auto opt = tryParseTimeSeparator(value); + return opt.value_or(TimeSeparator::none); +} + +std::optional tryParseTimeSeparator(const std::string &value) +{ + if (value == "none") + { + return TimeSeparator::none; + } + else if (value == "horizontal") + { + return TimeSeparator::horizontal; + } + else if (value == "diagonal") + { + return TimeSeparator::diagonal; + } + else if (value == "vertical") + { + return TimeSeparator::vertical; + } + else if (value == "adjacent") + { + return TimeSeparator::adjacent; + } + return std::optional{}; +} + +std::string toString(const TimeSeparator value) +{ + switch (value) + { + case TimeSeparator::none: { + return "none"; + } + case TimeSeparator::horizontal: { + return "horizontal"; + } + case TimeSeparator::diagonal: { + return "diagonal"; + } + case TimeSeparator::vertical: { + return "vertical"; + } + case TimeSeparator::adjacent: { + return "adjacent"; + } + default: + break; + } + return "none"; +} + +std::ostream &toStream(std::ostream &os, const TimeSeparator value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const TimeSeparator value) +{ + return toStream(os, value); +} + +/// TimeSymbol ///////////////////////////////////////////////////////////////////////////// + +TimeSymbol parseTimeSymbol(const std::string &value) +{ + const auto opt = tryParseTimeSymbol(value); + return opt.value_or(TimeSymbol::common); +} + +std::optional tryParseTimeSymbol(const std::string &value) +{ + if (value == "common") + { + return TimeSymbol::common; + } + else if (value == "cut") + { + return TimeSymbol::cut; + } + else if (value == "single-number") + { + return TimeSymbol::singleNumber; + } + else if (value == "note") + { + return TimeSymbol::note; + } + else if (value == "dotted-note") + { + return TimeSymbol::dottedNote; + } + else if (value == "normal") + { + return TimeSymbol::normal; + } + return std::optional{}; +} + +std::string toString(const TimeSymbol value) +{ + switch (value) + { + case TimeSymbol::common: { + return "common"; + } + case TimeSymbol::cut: { + return "cut"; + } + case TimeSymbol::singleNumber: { + return "single-number"; + } + case TimeSymbol::note: { + return "note"; + } + case TimeSymbol::dottedNote: { + return "dotted-note"; + } + case TimeSymbol::normal: { + return "normal"; + } + default: + break; + } + return "common"; +} + +std::ostream &toStream(std::ostream &os, const TimeSymbol value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const TimeSymbol value) +{ + return toStream(os, value); +} + +/// TipDirection /////////////////////////////////////////////////////////////////////////// + +TipDirection parseTipDirection(const std::string &value) +{ + const auto opt = tryParseTipDirection(value); + return opt.value_or(TipDirection::up); +} + +std::optional tryParseTipDirection(const std::string &value) +{ + if (value == "up") + { + return TipDirection::up; + } + else if (value == "down") + { + return TipDirection::down; + } + else if (value == "left") + { + return TipDirection::left; + } + else if (value == "right") + { + return TipDirection::right; + } + else if (value == "northwest") + { + return TipDirection::northwest; + } + else if (value == "northeast") + { + return TipDirection::northeast; + } + else if (value == "southeast") + { + return TipDirection::southeast; + } + else if (value == "southwest") + { + return TipDirection::southwest; + } + return std::optional{}; +} + +std::string toString(const TipDirection value) +{ + switch (value) + { + case TipDirection::up: { + return "up"; + } + case TipDirection::down: { + return "down"; + } + case TipDirection::left: { + return "left"; + } + case TipDirection::right: { + return "right"; + } + case TipDirection::northwest: { + return "northwest"; + } + case TipDirection::northeast: { + return "northeast"; + } + case TipDirection::southeast: { + return "southeast"; + } + case TipDirection::southwest: { + return "southwest"; + } + default: + break; + } + return "up"; +} + +std::ostream &toStream(std::ostream &os, const TipDirection value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const TipDirection value) +{ + return toStream(os, value); +} + +/// TopBottom ////////////////////////////////////////////////////////////////////////////// + +TopBottom parseTopBottom(const std::string &value) +{ + const auto opt = tryParseTopBottom(value); + return opt.value_or(TopBottom::top); +} + +std::optional tryParseTopBottom(const std::string &value) +{ + if (value == "top") + { + return TopBottom::top; + } + else if (value == "bottom") + { + return TopBottom::bottom; + } + return std::optional{}; +} + +std::string toString(const TopBottom value) +{ + switch (value) + { + case TopBottom::top: { + return "top"; + } + case TopBottom::bottom: { + return "bottom"; + } + default: + break; + } + return "top"; +} + +std::ostream &toStream(std::ostream &os, const TopBottom value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const TopBottom value) +{ + return toStream(os, value); +} + +/// TrillStep ////////////////////////////////////////////////////////////////////////////// + +TrillStep parseTrillStep(const std::string &value) +{ + const auto opt = tryParseTrillStep(value); + return opt.value_or(TrillStep::whole); +} + +std::optional tryParseTrillStep(const std::string &value) +{ + if (value == "whole") + { + return TrillStep::whole; + } + else if (value == "half") + { + return TrillStep::half; + } + else if (value == "unison") + { + return TrillStep::unison; + } + return std::optional{}; +} + +std::string toString(const TrillStep value) +{ + switch (value) + { + case TrillStep::whole: { + return "whole"; + } + case TrillStep::half: { + return "half"; + } + case TrillStep::unison: { + return "unison"; + } + default: + break; + } + return "whole"; +} + +std::ostream &toStream(std::ostream &os, const TrillStep value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const TrillStep value) +{ + return toStream(os, value); +} + +/// TwoNoteTurn //////////////////////////////////////////////////////////////////////////// + +TwoNoteTurn parseTwoNoteTurn(const std::string &value) +{ + const auto opt = tryParseTwoNoteTurn(value); + return opt.value_or(TwoNoteTurn::whole); +} + +std::optional tryParseTwoNoteTurn(const std::string &value) +{ + if (value == "whole") + { + return TwoNoteTurn::whole; + } + else if (value == "half") + { + return TwoNoteTurn::half; + } + else if (value == "none") + { + return TwoNoteTurn::none; + } + return std::optional{}; +} + +std::string toString(const TwoNoteTurn value) +{ + switch (value) + { + case TwoNoteTurn::whole: { + return "whole"; + } + case TwoNoteTurn::half: { + return "half"; + } + case TwoNoteTurn::none: { + return "none"; + } + default: + break; + } + return "whole"; +} + +std::ostream &toStream(std::ostream &os, const TwoNoteTurn value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const TwoNoteTurn value) +{ + return toStream(os, value); +} + +/// UpDown ///////////////////////////////////////////////////////////////////////////////// + +UpDown parseUpDown(const std::string &value) +{ + const auto opt = tryParseUpDown(value); + return opt.value_or(UpDown::up); +} + +std::optional tryParseUpDown(const std::string &value) +{ + if (value == "up") + { + return UpDown::up; + } + else if (value == "down") + { + return UpDown::down; + } + return std::optional{}; +} + +std::string toString(const UpDown value) +{ + switch (value) + { + case UpDown::up: { + return "up"; + } + case UpDown::down: { + return "down"; + } + default: + break; + } + return "up"; +} + +std::ostream &toStream(std::ostream &os, const UpDown value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const UpDown value) +{ + return toStream(os, value); +} + +/// UpDownStopContinue ///////////////////////////////////////////////////////////////////// + +UpDownStopContinue parseUpDownStopContinue(const std::string &value) +{ + const auto opt = tryParseUpDownStopContinue(value); + return opt.value_or(UpDownStopContinue::up); +} + +std::optional tryParseUpDownStopContinue(const std::string &value) +{ + if (value == "up") + { + return UpDownStopContinue::up; + } + else if (value == "down") + { + return UpDownStopContinue::down; + } + else if (value == "stop") + { + return UpDownStopContinue::stop; + } + else if (value == "continue") + { + return UpDownStopContinue::continue_; + } + return std::optional{}; +} + +std::string toString(const UpDownStopContinue value) +{ + switch (value) + { + case UpDownStopContinue::up: { + return "up"; + } + case UpDownStopContinue::down: { + return "down"; + } + case UpDownStopContinue::stop: { + return "stop"; + } + case UpDownStopContinue::continue_: { + return "continue"; + } + default: + break; + } + return "up"; +} + +std::ostream &toStream(std::ostream &os, const UpDownStopContinue value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const UpDownStopContinue value) +{ + return toStream(os, value); +} + +/// UprightInverted //////////////////////////////////////////////////////////////////////// + +UprightInverted parseUprightInverted(const std::string &value) +{ + const auto opt = tryParseUprightInverted(value); + return opt.value_or(UprightInverted::upright); +} + +std::optional tryParseUprightInverted(const std::string &value) +{ + if (value == "upright") + { + return UprightInverted::upright; + } + else if (value == "inverted") + { + return UprightInverted::inverted; + } + return std::optional{}; +} + +std::string toString(const UprightInverted value) +{ + switch (value) + { + case UprightInverted::upright: { + return "upright"; + } + case UprightInverted::inverted: { + return "inverted"; + } + default: + break; + } + return "upright"; +} + +std::ostream &toStream(std::ostream &os, const UprightInverted value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const UprightInverted value) +{ + return toStream(os, value); +} + +/// Valign ///////////////////////////////////////////////////////////////////////////////// + +Valign parseValign(const std::string &value) +{ + const auto opt = tryParseValign(value); + return opt.value_or(Valign::top); +} + +std::optional tryParseValign(const std::string &value) +{ + if (value == "top") + { + return Valign::top; + } + else if (value == "middle") + { + return Valign::middle; + } + else if (value == "bottom") + { + return Valign::bottom; + } + else if (value == "baseline") + { + return Valign::baseline; + } + return std::optional{}; +} + +std::string toString(const Valign value) +{ + switch (value) + { + case Valign::top: { + return "top"; + } + case Valign::middle: { + return "middle"; + } + case Valign::bottom: { + return "bottom"; + } + case Valign::baseline: { + return "baseline"; + } + default: + break; + } + return "top"; +} + +std::ostream &toStream(std::ostream &os, const Valign value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const Valign value) +{ + return toStream(os, value); +} + +/// ValignImage //////////////////////////////////////////////////////////////////////////// + +ValignImage parseValignImage(const std::string &value) +{ + const auto opt = tryParseValignImage(value); + return opt.value_or(ValignImage::top); +} + +std::optional tryParseValignImage(const std::string &value) +{ + if (value == "top") + { + return ValignImage::top; + } + else if (value == "middle") + { + return ValignImage::middle; + } + else if (value == "bottom") + { + return ValignImage::bottom; + } + return std::optional{}; +} + +std::string toString(const ValignImage value) +{ + switch (value) + { + case ValignImage::top: { + return "top"; + } + case ValignImage::middle: { + return "middle"; + } + case ValignImage::bottom: { + return "bottom"; + } + default: + break; + } + return "top"; +} + +std::ostream &toStream(std::ostream &os, const ValignImage value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const ValignImage value) +{ + return toStream(os, value); +} + +/// WedgeType ////////////////////////////////////////////////////////////////////////////// + +WedgeType parseWedgeType(const std::string &value) +{ + const auto opt = tryParseWedgeType(value); + return opt.value_or(WedgeType::crescendo); +} + +std::optional tryParseWedgeType(const std::string &value) +{ + if (value == "crescendo") + { + return WedgeType::crescendo; + } + else if (value == "diminuendo") + { + return WedgeType::diminuendo; + } + else if (value == "stop") + { + return WedgeType::stop; + } + else if (value == "continue") + { + return WedgeType::continue_; + } + return std::optional{}; +} + +std::string toString(const WedgeType value) +{ + switch (value) + { + case WedgeType::crescendo: { + return "crescendo"; + } + case WedgeType::diminuendo: { + return "diminuendo"; + } + case WedgeType::stop: { + return "stop"; + } + case WedgeType::continue_: { + return "continue"; + } + default: + break; + } + return "crescendo"; +} + +std::ostream &toStream(std::ostream &os, const WedgeType value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const WedgeType value) +{ + return toStream(os, value); +} + +/// Winged ///////////////////////////////////////////////////////////////////////////////// + +Winged parseWinged(const std::string &value) +{ + const auto opt = tryParseWinged(value); + return opt.value_or(Winged::none); +} + +std::optional tryParseWinged(const std::string &value) +{ + if (value == "none") + { + return Winged::none; + } + else if (value == "straight") + { + return Winged::straight; + } + else if (value == "curved") + { + return Winged::curved; + } + else if (value == "double-straight") + { + return Winged::doubleStraight; + } + else if (value == "double-curved") + { + return Winged::doubleCurved; + } + return std::optional{}; +} + +std::string toString(const Winged value) +{ + switch (value) + { + case Winged::none: { + return "none"; + } + case Winged::straight: { + return "straight"; + } + case Winged::curved: { + return "curved"; + } + case Winged::doubleStraight: { + return "double-straight"; + } + case Winged::doubleCurved: { + return "double-curved"; + } + default: + break; + } + return "none"; +} + +std::ostream &toStream(std::ostream &os, const Winged value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const Winged value) +{ + return toStream(os, value); +} + +/// WoodEnum /////////////////////////////////////////////////////////////////////////////// + +WoodEnum parseWoodEnum(const std::string &value) +{ + const auto opt = tryParseWoodEnum(value); + return opt.value_or(WoodEnum::boardClapper); +} + +std::optional tryParseWoodEnum(const std::string &value) +{ + if (value == "board clapper") + { + return WoodEnum::boardClapper; + } + else if (value == "cabasa") + { + return WoodEnum::cabasa; + } + else if (value == "castanets") + { + return WoodEnum::castanets; + } + else if (value == "claves") + { + return WoodEnum::claves; + } + else if (value == "guiro") + { + return WoodEnum::guiro; + } + else if (value == "log drum") + { + return WoodEnum::logDrum; + } + else if (value == "maraca") + { + return WoodEnum::maraca; + } + else if (value == "maracas") + { + return WoodEnum::maracas; + } + else if (value == "ratchet") + { + return WoodEnum::ratchet; + } + else if (value == "sandpaper blocks") + { + return WoodEnum::sandpaperBlocks; + } + else if (value == "slit drum") + { + return WoodEnum::slitDrum; + } + else if (value == "temple block") + { + return WoodEnum::templeBlock; + } + else if (value == "vibraslap") + { + return WoodEnum::vibraslap; + } + else if (value == "wood block") + { + return WoodEnum::woodBlock; + } + return std::optional{}; +} + +std::string toString(const WoodEnum value) +{ + switch (value) + { + case WoodEnum::boardClapper: { + return "board clapper"; + } + case WoodEnum::cabasa: { + return "cabasa"; + } + case WoodEnum::castanets: { + return "castanets"; + } + case WoodEnum::claves: { + return "claves"; + } + case WoodEnum::guiro: { + return "guiro"; + } + case WoodEnum::logDrum: { + return "log drum"; + } + case WoodEnum::maraca: { + return "maraca"; + } + case WoodEnum::maracas: { + return "maracas"; + } + case WoodEnum::ratchet: { + return "ratchet"; + } + case WoodEnum::sandpaperBlocks: { + return "sandpaper blocks"; + } + case WoodEnum::slitDrum: { + return "slit drum"; + } + case WoodEnum::templeBlock: { + return "temple block"; + } + case WoodEnum::vibraslap: { + return "vibraslap"; } + case WoodEnum::woodBlock: { + return "wood block"; + } + default: + break; + } + return "board clapper"; +} + +std::ostream &toStream(std::ostream &os, const WoodEnum value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const WoodEnum value) +{ + return toStream(os, value); +} + +/// YesNo ////////////////////////////////////////////////////////////////////////////////// + +YesNo parseYesNo(const std::string &value) +{ + const auto opt = tryParseYesNo(value); + return opt.value_or(YesNo::yes); +} + +std::optional tryParseYesNo(const std::string &value) +{ + if (value == "yes") + { + return YesNo::yes; + } + else if (value == "no") + { + return YesNo::no; + } + return std::optional{}; +} + +std::string toString(const YesNo value) +{ + switch (value) + { + case YesNo::yes: { + return "yes"; + } + case YesNo::no: { + return "no"; + } + default: + break; + } + return "yes"; +} + +std::ostream &toStream(std::ostream &os, const YesNo value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const YesNo value) +{ + return toStream(os, value); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Enums.h b/Sourcecode/private/mx/core/Enums.h index c60b29d53..cbdd1e7de 100644 --- a/Sourcecode/private/mx/core/Enums.h +++ b/Sourcecode/private/mx/core/Enums.h @@ -12,2035 +12,2039 @@ namespace mx { - namespace core - { - /// AboveBelow ///////////////////////////////////////////////////////////////////////////// - /// - /// The above-below type is used to indicate whether one element appears above or below - /// another element. - /// - enum class AboveBelow - { - above = 0, - below = 1 - }; - - AboveBelow parseAboveBelow( const std::string& value ); - std::optional tryParseAboveBelow( const std::string& value ); - std::string toString( const AboveBelow value ); - std::ostream& toStream( std::ostream& os, const AboveBelow value ); - std::ostream& operator<<( std::ostream& os, const AboveBelow value ); - - /// AccidentalValue //////////////////////////////////////////////////////////////////////// - /// - /// The accidental-value type represents notated accidentals supported by MusicXML. In the - /// MusicXML 2.0 DTD this was a string with values that could be included. The XSD - /// strengthens the data typing to an enumerated list. The quarter- and three-quarters- - /// accidentals are Tartini-style quarter-tone accidentals. The -down and -up accidentals - /// are quarter-tone accidentals that include arrows pointing down or up. The slash- - /// accidentals are used in Turkish classical music. The numbered sharp and flat accidentals - /// are superscripted versions of the accidental signs, used in Turkish folk music. The sori - /// and koron accidentals are microtonal sharp and flat accidentals used in Iranian and - /// Persian music. - /// - enum class AccidentalValue - { - sharp = 0, - natural = 1, - flat = 2, - doubleSharp = 3, - sharpSharp = 4, - flatFlat = 5, - naturalSharp = 6, - naturalFlat = 7, - quarterFlat = 8, - quarterSharp = 9, - threeQuartersFlat = 10, - threeQuartersSharp = 11, - sharpDown = 12, - sharpUp = 13, - naturalDown = 14, - naturalUp = 15, - flatDown = 16, - flatUp = 17, - tripleSharp = 18, - tripleFlat = 19, - slashQuarterSharp = 20, - slashSharp = 21, - slashFlat = 22, - doubleSlashFlat = 23, - sharp1 = 24, - sharp2 = 25, - sharp3 = 26, - sharp5 = 27, - flat1 = 28, - flat2 = 29, - flat3 = 30, - flat4 = 31, - sori = 32, - koron = 33 - }; - - AccidentalValue parseAccidentalValue( const std::string& value ); - std::optional tryParseAccidentalValue( const std::string& value ); - std::string toString( const AccidentalValue value ); - std::ostream& toStream( std::ostream& os, const AccidentalValue value ); - std::ostream& operator<<( std::ostream& os, const AccidentalValue value ); - - /// ArrowDirectionEnum ///////////////////////////////////////////////////////////////////// - /// - /// The arrow-direction type represents the direction in which an arrow points, using - /// Unicode arrow terminology. - /// - enum class ArrowDirectionEnum - { - left = 0, - up = 1, - right = 2, - down = 3, - northwest = 4, - northeast = 5, - southeast = 6, - southwest = 7, - leftRight = 8, - upDown = 9, - northwestSoutheast = 10, - northeastSouthwest = 11, - other = 12 - }; - - ArrowDirectionEnum parseArrowDirectionEnum( const std::string& value ); - std::optional tryParseArrowDirectionEnum( const std::string& value ); - std::string toString( const ArrowDirectionEnum value ); - std::ostream& toStream( std::ostream& os, const ArrowDirectionEnum value ); - std::ostream& operator<<( std::ostream& os, const ArrowDirectionEnum value ); - - /// ArrowStyleEnum ///////////////////////////////////////////////////////////////////////// - /// - /// The arrow-style type represents the style of an arrow, using Unicode arrow terminology. - /// Filled and hollow arrows indicate polygonal single arrows. Paired arrows are duplicate - /// single arrows in the same direction. Combined arrows apply to double direction arrows - /// like left right, indicating that an arrow in one direction should be combined with an - /// arrow in the other direction. - /// - enum class ArrowStyleEnum - { - single = 0, - double_ = 1, - filled = 2, - hollow = 3, - paired = 4, - combined = 5, - other = 6 - }; - - ArrowStyleEnum parseArrowStyleEnum( const std::string& value ); - std::optional tryParseArrowStyleEnum( const std::string& value ); - std::string toString( const ArrowStyleEnum value ); - std::ostream& toStream( std::ostream& os, const ArrowStyleEnum value ); - std::ostream& operator<<( std::ostream& os, const ArrowStyleEnum value ); - - /// BackwardForward //////////////////////////////////////////////////////////////////////// - /// - /// The backward-forward type is used to specify repeat directions. The start of the repeat - /// has a forward direction while the end of the repeat has a backward direction. - /// - enum class BackwardForward - { - backward = 0, - forward = 1 - }; - - BackwardForward parseBackwardForward( const std::string& value ); - std::optional tryParseBackwardForward( const std::string& value ); - std::string toString( const BackwardForward value ); - std::ostream& toStream( std::ostream& os, const BackwardForward value ); - std::ostream& operator<<( std::ostream& os, const BackwardForward value ); - - /// BarStyleEnum /////////////////////////////////////////////////////////////////////////// - /// - /// The bar-style type represents barline style information. Choices are regular, dotted, - /// dashed, heavy, light-light, light-heavy, heavy-light, heavy-heavy, tick (a short stroke - /// through the top line), short (a partial barline between the 2nd and 4th lines), and - /// none. - /// - enum class BarStyleEnum - { - regular = 0, - dotted = 1, - dashed = 2, - heavy = 3, - lightLight = 4, - lightHeavy = 5, - heavyLight = 6, - heavyHeavy = 7, - tick = 8, - short_ = 9, - none = 10 - }; - - BarStyleEnum parseBarStyleEnum( const std::string& value ); - std::optional tryParseBarStyleEnum( const std::string& value ); - std::string toString( const BarStyleEnum value ); - std::ostream& toStream( std::ostream& os, const BarStyleEnum value ); - std::ostream& operator<<( std::ostream& os, const BarStyleEnum value ); - - /// BeamValue ////////////////////////////////////////////////////////////////////////////// - /// - /// The beam-value type represents the type of beam associated with each of 8 beam levels - /// (up to 1024th notes) available for each note. - /// - enum class BeamValue - { - begin = 0, - continue_ = 1, - end = 2, - forwardHook = 3, - backwardHook = 4 - }; - - BeamValue parseBeamValue( const std::string& value ); - std::optional tryParseBeamValue( const std::string& value ); - std::string toString( const BeamValue value ); - std::ostream& toStream( std::ostream& os, const BeamValue value ); - std::ostream& operator<<( std::ostream& os, const BeamValue value ); - - /// BeaterValue //////////////////////////////////////////////////////////////////////////// - /// - /// The beater-value type represents pictograms for beaters, mallets, and sticks that do not - /// have different materials represented in the pictogram. The finger and hammer values are - /// in addition to Stone's list. - /// - enum class BeaterValue - { - bow = 0, - chimeHammer = 1, - coin = 2, - finger = 3, - fingernail = 4, - fist = 5, - guiroScraper = 6, - hammer = 7, - hand = 8, - jazzStick = 9, - knittingNeedle = 10, - metalHammer = 11, - snareStick = 12, - spoonMallet = 13, - triangleBeater = 14, - triangleBeaterPlain = 15, - wireBrush = 16 - }; - - BeaterValue parseBeaterValue( const std::string& value ); - std::optional tryParseBeaterValue( const std::string& value ); - std::string toString( const BeaterValue value ); - std::ostream& toStream( std::ostream& os, const BeaterValue value ); - std::ostream& operator<<( std::ostream& os, const BeaterValue value ); - - /// BreathMarkValue //////////////////////////////////////////////////////////////////////// - /// - /// The breath-mark-value type represents the symbol used for a breath mark. - /// - enum class BreathMarkValue - { - emptystring = 0, - comma = 1, - tick = 2 - }; - - BreathMarkValue parseBreathMarkValue( const std::string& value ); - std::optional tryParseBreathMarkValue( const std::string& value ); - std::string toString( const BreathMarkValue value ); - std::ostream& toStream( std::ostream& os, const BreathMarkValue value ); - std::ostream& operator<<( std::ostream& os, const BreathMarkValue value ); - - /// CancelLocation ///////////////////////////////////////////////////////////////////////// - /// - /// The cancel-location type is used to indicate where a key signature cancellation appears - /// relative to a new key signature: to the left, to the right, or before the barline and to - /// the left. It is left by default. For mid-measure key elements, a cancel-location of - /// before-barline should be treated like a cancel-location of left. - /// - enum class CancelLocation - { - left = 0, - right = 1, - beforeBarline = 2 - }; - - CancelLocation parseCancelLocation( const std::string& value ); - std::optional tryParseCancelLocation( const std::string& value ); - std::string toString( const CancelLocation value ); - std::ostream& toStream( std::ostream& os, const CancelLocation value ); - std::ostream& operator<<( std::ostream& os, const CancelLocation value ); - - /// CircularArrowEnum ////////////////////////////////////////////////////////////////////// - /// - /// The circular-arrow type represents the direction in which a circular arrow points, using - /// Unicode arrow terminology. - /// - enum class CircularArrowEnum - { - clockwise = 0, - anticlockwise = 1 - }; - - CircularArrowEnum parseCircularArrowEnum( const std::string& value ); - std::optional tryParseCircularArrowEnum( const std::string& value ); - std::string toString( const CircularArrowEnum value ); - std::ostream& toStream( std::ostream& os, const CircularArrowEnum value ); - std::ostream& operator<<( std::ostream& os, const CircularArrowEnum value ); - - /// ClefSign /////////////////////////////////////////////////////////////////////////////// - /// - /// The clef-sign element represents the different clef symbols. The jianpu sign indicates - /// that the music that follows should be in jianpu numbered notation, just as the TAB sign - /// indicates that the music that follows should be in tablature notation. Unlike TAB, a - /// jianpu sign does not correspond to a visual clef notation. - /// - enum class ClefSign - { - g = 0, - f = 1, - c = 2, - percussion = 3, - tab = 4, - jianpu = 5, - none = 6 - }; - - ClefSign parseClefSign( const std::string& value ); - std::optional tryParseClefSign( const std::string& value ); - std::string toString( const ClefSign value ); - std::ostream& toStream( std::ostream& os, const ClefSign value ); - std::ostream& operator<<( std::ostream& os, const ClefSign value ); - - /// CssFontSize //////////////////////////////////////////////////////////////////////////// - /// - /// The css-font-size type includes the CSS font sizes used as an alternative to a numeric - /// point size. - /// - enum class CssFontSize - { - xxSmall = 0, - xSmall = 1, - small = 2, - medium = 3, - large = 4, - xLarge = 5, - xxLarge = 6 - }; - - CssFontSize parseCssFontSize( const std::string& value ); - std::optional tryParseCssFontSize( const std::string& value ); - std::string toString( const CssFontSize value ); - std::ostream& toStream( std::ostream& os, const CssFontSize value ); - std::ostream& operator<<( std::ostream& os, const CssFontSize value ); - - /// DegreeSymbolValue ////////////////////////////////////////////////////////////////////// - /// - /// The degree-symbol-value type indicates indicates that a symbol should be used in - /// specifying the degree. - /// - enum class DegreeSymbolValue - { - major = 0, - minor = 1, - augmented = 2, - diminished = 3, - halfDiminished = 4 - }; - - DegreeSymbolValue parseDegreeSymbolValue( const std::string& value ); - std::optional tryParseDegreeSymbolValue( const std::string& value ); - std::string toString( const DegreeSymbolValue value ); - std::ostream& toStream( std::ostream& os, const DegreeSymbolValue value ); - std::ostream& operator<<( std::ostream& os, const DegreeSymbolValue value ); - - /// DegreeTypeValue //////////////////////////////////////////////////////////////////////// - /// - /// The degree-type-value type indicates whether the current degree element is an addition, - /// alteration, or subtraction to the kind of the current chord in the harmony element. - /// - enum class DegreeTypeValue - { - add = 0, - alter = 1, - subtract = 2 - }; - - DegreeTypeValue parseDegreeTypeValue( const std::string& value ); - std::optional tryParseDegreeTypeValue( const std::string& value ); - std::string toString( const DegreeTypeValue value ); - std::ostream& toStream( std::ostream& os, const DegreeTypeValue value ); - std::ostream& operator<<( std::ostream& os, const DegreeTypeValue value ); - - /// DistanceTypeEnum /////////////////////////////////////////////////////////////////////// - /// - /// The distance-type defines what type of distance is being defined in a distance element. - /// Values include beam and hyphen. This is left as a string so that other application- - /// specific types can be defined, but it is made a separate type so that it can be - /// redefined more strictly. - /// - enum class DistanceTypeEnum - { - beam = 0, - hyphen = 1, - other = 2 - }; - - DistanceTypeEnum parseDistanceTypeEnum( const std::string& value ); - std::optional tryParseDistanceTypeEnum( const std::string& value ); - std::string toString( const DistanceTypeEnum value ); - std::ostream& toStream( std::ostream& os, const DistanceTypeEnum value ); - std::ostream& operator<<( std::ostream& os, const DistanceTypeEnum value ); - - class DistanceType - { - public: - explicit DistanceType( const DistanceTypeEnum value ); - explicit DistanceType( const std::string& value ); - DistanceType(); - DistanceTypeEnum getValue() const; - std::string getValueString() const; - void setValue( const DistanceTypeEnum value ); - void setValue( const std::string& value ); - private: - DistanceTypeEnum myEnum; - std::string myCustomValue; - }; - - DistanceType parseDistanceType( const std::string& value ); - std::string toString( const DistanceType& value ); - std::ostream& toStream( std::ostream& os, const DistanceType& value ); - std::ostream& operator<<( std::ostream& os, const DistanceType& value ); - - /// DynamicsEnum /////////////////////////////////////////////////////////////////////////// - /// - /// Dynamics can be associated either with a note or a general musical direction. To avoid - /// inconsistencies between and amongst the letter abbreviations for dynamics (what is sf - /// vs. sfz, standing alone or with a trailing dynamic that is not always piano), we use the - /// actual letters as the names of these dynamic elements. The other-dynamics element allows - /// other dynamic marks that are not covered here, but many of those should perhaps be - /// included in a more general musical direction element. Dynamics elements may also be - /// combined to create marks not covered by a single element, such as sfmp. - /// - /// These letter dynamic symbols are separated from crescendo, decrescendo, and wedge - /// indications. Dynamic representation is inconsistent in scores. Many things are assumed - /// by the composer and left out, such as returns to original dynamics. Systematic - /// representations are quite complex: for example, Humdrum has at least 3 representation - /// formats related to dynamics. The MusicXML format captures what is in the score, but does - /// not try to be optimal for analysis or synthesis of dynamics. - /// - enum class DynamicsEnum - { - p = 0, - pp = 1, - ppp = 2, - pppp = 3, - ppppp = 4, - pppppp = 5, - f = 6, - ff = 7, - fff = 8, - ffff = 9, - fffff = 10, - ffffff = 11, - mp = 12, - mf = 13, - sf = 14, - sfp = 15, - sfpp = 16, - fp = 17, - rf = 18, - rfz = 19, - sfz = 20, - sffz = 21, - fz = 22, - otherDynamics = 23 - }; - - DynamicsEnum parseDynamicsEnum( const std::string& value ); - std::optional tryParseDynamicsEnum( const std::string& value ); - std::string toString( const DynamicsEnum value ); - std::ostream& toStream( std::ostream& os, const DynamicsEnum value ); - std::ostream& operator<<( std::ostream& os, const DynamicsEnum value ); - - class DynamicsValue - { - public: - explicit DynamicsValue( const DynamicsEnum value ); - explicit DynamicsValue( const std::string& value ); - DynamicsValue(); - DynamicsEnum getValue() const; - std::string getValueString() const; - void setValue( const DynamicsEnum value ); - void setValue( const std::string& value ); - private: - DynamicsEnum myEnum; - std::string myCustomValue; - }; - - DynamicsValue parseDynamicsValue( const std::string& value ); - std::string toString( const DynamicsValue& value ); - std::ostream& toStream( std::ostream& os, const DynamicsValue& value ); - std::ostream& operator<<( std::ostream& os, const DynamicsValue& value ); - - /// EffectEnum ///////////////////////////////////////////////////////////////////////////// - /// - /// The effect type represents pictograms for sound effect percussion instruments. The - /// cannon value is in addition to Stone's list. - /// - enum class EffectEnum - { - anvil = 0, - autoHorn = 1, - birdWhistle = 2, - cannon = 3, - duckCall = 4, - gunShot = 5, - klaxonHorn = 6, - lionsRoar = 7, - policeWhistle = 8, - siren = 9, - slideWhistle = 10, - thunderSheet = 11, - windMachine = 12, - windWhistle = 13 - }; - - EffectEnum parseEffectEnum( const std::string& value ); - std::optional tryParseEffectEnum( const std::string& value ); - std::string toString( const EffectEnum value ); - std::ostream& toStream( std::ostream& os, const EffectEnum value ); - std::ostream& operator<<( std::ostream& os, const EffectEnum value ); - - /// EnclosureShape ///////////////////////////////////////////////////////////////////////// - /// - /// The enclosure-shape type describes the shape and presence / absence of an enclosure - /// around text or symbols. A bracket enclosure is similar to a rectangle with the bottom - /// line missing, as is common in jazz notation. - /// - enum class EnclosureShape - { - rectangle = 0, - square = 1, - oval = 2, - circle = 3, - bracket = 4, - triangle = 5, - diamond = 6, - none = 7 - }; - - EnclosureShape parseEnclosureShape( const std::string& value ); - std::optional tryParseEnclosureShape( const std::string& value ); - std::string toString( const EnclosureShape value ); - std::ostream& toStream( std::ostream& os, const EnclosureShape value ); - std::ostream& operator<<( std::ostream& os, const EnclosureShape value ); - - /// Fan //////////////////////////////////////////////////////////////////////////////////// - /// - /// The fan type represents the type of beam fanning present on a note, used to represent - /// accelerandos and ritardandos. - /// - enum class Fan - { - accel = 0, - rit = 1, - none = 2 - }; - - Fan parseFan( const std::string& value ); - std::optional tryParseFan( const std::string& value ); - std::string toString( const Fan value ); - std::ostream& toStream( std::ostream& os, const Fan value ); - std::ostream& operator<<( std::ostream& os, const Fan value ); - - /// FermataShape /////////////////////////////////////////////////////////////////////////// - /// - /// The fermata-shape type represents the shape of the fermata sign. The empty value is - /// equivalent to the normal value. - /// - enum class FermataShape - { - normal = 0, - angled = 1, - square = 2, - emptystring = 3 - }; - - FermataShape parseFermataShape( const std::string& value ); - std::optional tryParseFermataShape( const std::string& value ); - std::string toString( const FermataShape value ); - std::ostream& toStream( std::ostream& os, const FermataShape value ); - std::ostream& operator<<( std::ostream& os, const FermataShape value ); - - /// FontStyle ////////////////////////////////////////////////////////////////////////////// - /// - /// The font-style type represents a simplified version of the CSS font-style property. - /// - enum class FontStyle - { - normal = 0, - italic = 1 - }; - - FontStyle parseFontStyle( const std::string& value ); - std::optional tryParseFontStyle( const std::string& value ); - std::string toString( const FontStyle value ); - std::ostream& toStream( std::ostream& os, const FontStyle value ); - std::ostream& operator<<( std::ostream& os, const FontStyle value ); - - /// FontWeight ///////////////////////////////////////////////////////////////////////////// - /// - /// The font-weight type represents a simplified version of the CSS font-weight property. - /// - enum class FontWeight - { - normal = 0, - bold = 1 - }; - - FontWeight parseFontWeight( const std::string& value ); - std::optional tryParseFontWeight( const std::string& value ); - std::string toString( const FontWeight value ); - std::ostream& toStream( std::ostream& os, const FontWeight value ); - std::ostream& operator<<( std::ostream& os, const FontWeight value ); - - /// GlassEnum ////////////////////////////////////////////////////////////////////////////// - /// - /// The glass type represents pictograms for glass percussion instruments. - /// - enum class GlassEnum - { - windChimes = 0 - }; - - GlassEnum parseGlassEnum( const std::string& value ); - std::optional tryParseGlassEnum( const std::string& value ); - std::string toString( const GlassEnum value ); - std::ostream& toStream( std::ostream& os, const GlassEnum value ); - std::ostream& operator<<( std::ostream& os, const GlassEnum value ); - - /// GroupBarlineValue ////////////////////////////////////////////////////////////////////// - /// - /// The group-barline-value type indicates if the group should have common barlines. - /// - enum class GroupBarlineValue - { - yes = 0, - no = 1, - mensurstrich = 2 - }; - - GroupBarlineValue parseGroupBarlineValue( const std::string& value ); - std::optional tryParseGroupBarlineValue( const std::string& value ); - std::string toString( const GroupBarlineValue value ); - std::ostream& toStream( std::ostream& os, const GroupBarlineValue value ); - std::ostream& operator<<( std::ostream& os, const GroupBarlineValue value ); - - /// GroupSymbolValue /////////////////////////////////////////////////////////////////////// - /// - /// The group-symbol-value type indicates how the symbol for a group is indicated in the - /// score. The default value is none. - /// - enum class GroupSymbolValue - { - none = 0, - brace = 1, - line = 2, - bracket = 3, - square = 4 - }; - - GroupSymbolValue parseGroupSymbolValue( const std::string& value ); - std::optional tryParseGroupSymbolValue( const std::string& value ); - std::string toString( const GroupSymbolValue value ); - std::ostream& toStream( std::ostream& os, const GroupSymbolValue value ); - std::ostream& operator<<( std::ostream& os, const GroupSymbolValue value ); - - /// HandbellValue ////////////////////////////////////////////////////////////////////////// - /// - /// The handbell-value type represents the type of handbell technique being notated. - /// - enum class HandbellValue - { - damp = 0, - echo = 1, - gyro = 2, - handMartellato = 3, - malletLift = 4, - malletTable = 5, - martellato = 6, - martellatoLift = 7, - mutedMartellato = 8, - pluckLift = 9, - swing = 10 - }; - - HandbellValue parseHandbellValue( const std::string& value ); - std::optional tryParseHandbellValue( const std::string& value ); - std::string toString( const HandbellValue value ); - std::ostream& toStream( std::ostream& os, const HandbellValue value ); - std::ostream& operator<<( std::ostream& os, const HandbellValue value ); - - /// HarmonyType //////////////////////////////////////////////////////////////////////////// - /// - /// The harmony-type type differentiates different types of harmonies when alternate - /// harmonies are possible. Explicit harmonies have all note present in the music; implied - /// have some notes missing but implied; alternate represents alternate analyses. - /// - enum class HarmonyType - { - explicit_ = 0, - implied = 1, - alternate = 2 - }; - - HarmonyType parseHarmonyType( const std::string& value ); - std::optional tryParseHarmonyType( const std::string& value ); - std::string toString( const HarmonyType value ); - std::ostream& toStream( std::ostream& os, const HarmonyType value ); - std::ostream& operator<<( std::ostream& os, const HarmonyType value ); - - /// HoleClosedLocation ///////////////////////////////////////////////////////////////////// - /// - /// The hole-closed-location type indicates which portion of the hole is filled in when the - /// corresponding hole-closed-value is half. - /// - enum class HoleClosedLocation - { - right = 0, - bottom = 1, - left = 2, - top = 3 - }; - - HoleClosedLocation parseHoleClosedLocation( const std::string& value ); - std::optional tryParseHoleClosedLocation( const std::string& value ); - std::string toString( const HoleClosedLocation value ); - std::ostream& toStream( std::ostream& os, const HoleClosedLocation value ); - std::ostream& operator<<( std::ostream& os, const HoleClosedLocation value ); - - /// HoleClosedValue //////////////////////////////////////////////////////////////////////// - /// - /// The hole-closed-value type represents whether the hole is closed, open, or half-open. - /// - enum class HoleClosedValue - { - yes = 0, - no = 1, - half = 2 - }; - - HoleClosedValue parseHoleClosedValue( const std::string& value ); - std::optional tryParseHoleClosedValue( const std::string& value ); - std::string toString( const HoleClosedValue value ); - std::ostream& toStream( std::ostream& os, const HoleClosedValue value ); - std::ostream& operator<<( std::ostream& os, const HoleClosedValue value ); - - /// KindValue ////////////////////////////////////////////////////////////////////////////// - /// - /// A kind-value indicates the type of chord. Degree elements can then add, subtract, or - /// alter from these starting points. Values include: - /// - /// Triads: - /// major (major third, perfect fifth) - /// minor (minor third, perfect fifth) - /// augmented (major third, augmented fifth) - /// diminished (minor third, diminished fifth) - /// Sevenths: - /// dominant (major triad, minor seventh) - /// major-seventh (major triad, major seventh) - /// minor-seventh (minor triad, minor seventh) - /// diminished-seventh (diminished triad, diminished seventh) - /// augmented-seventh (augmented triad, minor seventh) - /// half-diminished (diminished triad, minor seventh) - /// major-minor (minor triad, major seventh) - /// Sixths: - /// major-sixth (major triad, added sixth) - /// minor-sixth (minor triad, added sixth) - /// Ninths: - /// dominant-ninth (dominant-seventh, major ninth) - /// major-ninth (major-seventh, major ninth) - /// minor-ninth (minor-seventh, major ninth) - /// 11ths (usually as the basis for alteration): - /// dominant-11th (dominant-ninth, perfect 11th) - /// major-11th (major-ninth, perfect 11th) - /// minor-11th (minor-ninth, perfect 11th) - /// 13ths (usually as the basis for alteration): - /// dominant-13th (dominant-11th, major 13th) - /// major-13th (major-11th, major 13th) - /// minor-13th (minor-11th, major 13th) - /// Suspended: - /// suspended-second (major second, perfect fifth) - /// suspended-fourth (perfect fourth, perfect fifth) - /// Functional sixths: - /// Neapolitan - /// Italian - /// French - /// German - /// Other: - /// pedal (pedal-point bass) - /// power (perfect fifth) - /// Tristan - /// - /// The "other" kind is used when the harmony is entirely composed of add elements. The - /// "none" kind is used to explicitly encode absence of chords or functional harmony. - /// - enum class KindValue - { - major = 0, - minor = 1, - augmented = 2, - diminished = 3, - dominant = 4, - majorSeventh = 5, - minorSeventh = 6, - diminishedSeventh = 7, - augmentedSeventh = 8, - halfDiminished = 9, - majorMinor = 10, - majorSixth = 11, - minorSixth = 12, - dominantNinth = 13, - majorNinth = 14, - minorNinth = 15, - dominant11th = 16, - major11th = 17, - minor11th = 18, - dominant13th = 19, - major13th = 20, - minor13th = 21, - suspendedSecond = 22, - suspendedFourth = 23, - neapolitan = 24, - italian = 25, - french = 26, - german = 27, - pedal = 28, - power = 29, - tristan = 30, - other = 31, - none = 32 - }; - - KindValue parseKindValue( const std::string& value ); - std::optional tryParseKindValue( const std::string& value ); - std::string toString( const KindValue value ); - std::ostream& toStream( std::ostream& os, const KindValue value ); - std::ostream& operator<<( std::ostream& os, const KindValue value ); - - /// LeftCenterRight //////////////////////////////////////////////////////////////////////// - /// - /// The left-center-right type is used to define horizontal alignment and text - /// justification. - /// - enum class LeftCenterRight - { - left = 0, - center = 1, - right = 2 - }; - - LeftCenterRight parseLeftCenterRight( const std::string& value ); - std::optional tryParseLeftCenterRight( const std::string& value ); - std::string toString( const LeftCenterRight value ); - std::ostream& toStream( std::ostream& os, const LeftCenterRight value ); - std::ostream& operator<<( std::ostream& os, const LeftCenterRight value ); - - /// LeftRight ////////////////////////////////////////////////////////////////////////////// - /// - /// The left-right type is used to indicate whether one element appears to the left or the - /// right of another element. - /// - enum class LeftRight - { - left = 0, - right = 1 - }; - - LeftRight parseLeftRight( const std::string& value ); - std::optional tryParseLeftRight( const std::string& value ); - std::string toString( const LeftRight value ); - std::ostream& toStream( std::ostream& os, const LeftRight value ); - std::ostream& operator<<( std::ostream& os, const LeftRight value ); - - /// LineEnd //////////////////////////////////////////////////////////////////////////////// - /// - /// The line-end type specifies if there is a jog up or down (or both), an arrow, or nothing - /// at the start or end of a bracket. - /// - enum class LineEnd - { - up = 0, - down = 1, - both = 2, - arrow = 3, - none = 4 - }; - - LineEnd parseLineEnd( const std::string& value ); - std::optional tryParseLineEnd( const std::string& value ); - std::string toString( const LineEnd value ); - std::ostream& toStream( std::ostream& os, const LineEnd value ); - std::ostream& operator<<( std::ostream& os, const LineEnd value ); - - /// LineShape ////////////////////////////////////////////////////////////////////////////// - /// - /// The line-shape type distinguishes between straight and curved lines. - /// - enum class LineShape - { - straight = 0, - curved = 1 - }; - - LineShape parseLineShape( const std::string& value ); - std::optional tryParseLineShape( const std::string& value ); - std::string toString( const LineShape value ); - std::ostream& toStream( std::ostream& os, const LineShape value ); - std::ostream& operator<<( std::ostream& os, const LineShape value ); - - /// LineType /////////////////////////////////////////////////////////////////////////////// - /// - /// The line-type type distinguishes between solid, dashed, dotted, and wavy lines. - /// - enum class LineType - { - solid = 0, - dashed = 1, - dotted = 2, - wavy = 3 - }; - - LineType parseLineType( const std::string& value ); - std::optional tryParseLineType( const std::string& value ); - std::string toString( const LineType value ); - std::ostream& toStream( std::ostream& os, const LineType value ); - std::ostream& operator<<( std::ostream& os, const LineType value ); - - /// LineWidthTypeEnum ////////////////////////////////////////////////////////////////////// - /// - /// The line-width-type defines what type of line is being defined in a line-width element. - /// Values include beam, bracket, dashes, enclosure, ending, extend, heavy barline, leger, - /// light barline, octave shift, pedal, slur middle, slur tip, staff, stem, tie middle, tie - /// tip, tuplet bracket, and wedge. This is left as a string so that other application- - /// specific types can be defined, but it is made a separate type so that it can be - /// redefined more strictly. - /// - enum class LineWidthTypeEnum - { - beam = 0, - bracket = 1, - dashes = 2, - enclosure = 3, - ending = 4, - extend = 5, - heavyBarline = 6, - leger = 7, - lightBarline = 8, - octaveShift = 9, - pedal = 10, - slurMiddle = 11, - slurTip = 12, - staff = 13, - stem = 14, - tieMiddle = 15, - tieTip = 16, - tupletBracket = 17, - wedge = 18, - other = 19 - }; - - LineWidthTypeEnum parseLineWidthTypeEnum( const std::string& value ); - std::optional tryParseLineWidthTypeEnum( const std::string& value ); - std::string toString( const LineWidthTypeEnum value ); - std::ostream& toStream( std::ostream& os, const LineWidthTypeEnum value ); - std::ostream& operator<<( std::ostream& os, const LineWidthTypeEnum value ); - - class LineWidthType - { - public: - explicit LineWidthType( const LineWidthTypeEnum value ); - explicit LineWidthType( const std::string& value ); - LineWidthType(); - LineWidthTypeEnum getValue() const; - std::string getValueString() const; - void setValue( const LineWidthTypeEnum value ); - void setValue( const std::string& value ); - private: - LineWidthTypeEnum myEnum; - std::string myCustomValue; - }; - - LineWidthType parseLineWidthType( const std::string& value ); - std::string toString( const LineWidthType& value ); - std::ostream& toStream( std::ostream& os, const LineWidthType& value ); - std::ostream& operator<<( std::ostream& os, const LineWidthType& value ); - - /// MarginType ///////////////////////////////////////////////////////////////////////////// - /// - /// The margin-type type specifies whether margins apply to even page, odd pages, or both. - /// - enum class MarginType - { - odd = 0, - even = 1, - both = 2 - }; - - MarginType parseMarginType( const std::string& value ); - std::optional tryParseMarginType( const std::string& value ); - std::string toString( const MarginType value ); - std::ostream& toStream( std::ostream& os, const MarginType value ); - std::ostream& operator<<( std::ostream& os, const MarginType value ); - - /// MeasureNumberingValue ////////////////////////////////////////////////////////////////// - /// - /// The measure-numbering-value type describes how measure numbers are displayed on this - /// part: no numbers, numbers every measure, or numbers every system. - /// - enum class MeasureNumberingValue - { - none = 0, - measure = 1, - system = 2 - }; - - MeasureNumberingValue parseMeasureNumberingValue( const std::string& value ); - std::optional tryParseMeasureNumberingValue( const std::string& value ); - std::string toString( const MeasureNumberingValue value ); - std::ostream& toStream( std::ostream& os, const MeasureNumberingValue value ); - std::ostream& operator<<( std::ostream& os, const MeasureNumberingValue value ); - - /// MembraneEnum /////////////////////////////////////////////////////////////////////////// - /// - /// The membrane type represents pictograms for membrane percussion instruments. The goblet - /// drum value is in addition to Stone's list. - /// - enum class MembraneEnum - { - bassDrum = 0, - bassDrumOnSide = 1, - bongos = 2, - congaDrum = 3, - gobletDrum = 4, - militaryDrum = 5, - snareDrum = 6, - snareDrumSnaresOff = 7, - tambourine = 8, - tenorDrum = 9, - timbales = 10, - tomtom = 11 - }; - - MembraneEnum parseMembraneEnum( const std::string& value ); - std::optional tryParseMembraneEnum( const std::string& value ); - std::string toString( const MembraneEnum value ); - std::ostream& toStream( std::ostream& os, const MembraneEnum value ); - std::ostream& operator<<( std::ostream& os, const MembraneEnum value ); - - /// MetalEnum ////////////////////////////////////////////////////////////////////////////// - /// - /// The metal type represents pictograms for metal percussion instruments. The hi-hat value - /// refers to a pictogram like Stone's high-hat cymbals but without the long vertical line - /// at the bottom. - /// - enum class MetalEnum - { - almglocken = 0, - bell = 1, - bellPlate = 2, - brakeDrum = 3, - chineseCymbal = 4, - cowbell = 5, - crashCymbals = 6, - crotale = 7, - cymbalTongs = 8, - domedGong = 9, - fingerCymbals = 10, - flexatone = 11, - gong = 12, - hiHat = 13, - highHatCymbals = 14, - handbell = 15, - sistrum = 16, - sizzleCymbal = 17, - sleighBells = 18, - suspendedCymbal = 19, - tamTam = 20, - triangle = 21, - vietnameseHat = 22 - }; - - MetalEnum parseMetalEnum( const std::string& value ); - std::optional tryParseMetalEnum( const std::string& value ); - std::string toString( const MetalEnum value ); - std::ostream& toStream( std::ostream& os, const MetalEnum value ); - std::ostream& operator<<( std::ostream& os, const MetalEnum value ); - - /// ModeEnum /////////////////////////////////////////////////////////////////////////////// - /// - /// The mode type is used to specify major/minor and other mode distinctions. Valid mode - /// values include major, minor, dorian, phrygian, lydian, mixolydian, aeolian, ionian, - /// locrian, and none. - /// - enum class ModeEnum - { - major = 0, - minor = 1, - dorian = 2, - phrygian = 3, - lydian = 4, - mixolydian = 5, - aeolian = 6, - ionian = 7, - locrian = 8, - none = 9, - other = 10 - }; - - ModeEnum parseModeEnum( const std::string& value ); - std::optional tryParseModeEnum( const std::string& value ); - std::string toString( const ModeEnum value ); - std::ostream& toStream( std::ostream& os, const ModeEnum value ); - std::ostream& operator<<( std::ostream& os, const ModeEnum value ); - - class ModeValue - { - public: - explicit ModeValue( const ModeEnum value ); - explicit ModeValue( const std::string& value ); - ModeValue(); - ModeEnum getValue() const; - std::string getValueString() const; - void setValue( const ModeEnum value ); - void setValue( const std::string& value ); - private: - ModeEnum myEnum; - std::string myCustomValue; - }; - - ModeValue parseModeValue( const std::string& value ); - std::string toString( const ModeValue& value ); - std::ostream& toStream( std::ostream& os, const ModeValue& value ); - std::ostream& operator<<( std::ostream& os, const ModeValue& value ); - - /// MuteEnum /////////////////////////////////////////////////////////////////////////////// - /// - /// The mute type represents muting for different instruments, including brass, winds, and - /// strings. The on and off values are used for undifferentiated mutes. The remaining values - /// represent specific mutes. - /// - enum class MuteEnum - { - on = 0, - off = 1, - straight = 2, - cup = 3, - harmonNoStem = 4, - harmonStem = 5, - bucket = 6, - plunger = 7, - hat = 8, - solotone = 9, - practice = 10, - stopMute = 11, - stopHand = 12, - echo = 13, - palm = 14 - }; - - MuteEnum parseMuteEnum( const std::string& value ); - std::optional tryParseMuteEnum( const std::string& value ); - std::string toString( const MuteEnum value ); - std::ostream& toStream( std::ostream& os, const MuteEnum value ); - std::ostream& operator<<( std::ostream& os, const MuteEnum value ); - - /// NoteSizeType /////////////////////////////////////////////////////////////////////////// - /// - /// The note-size-type type indicates the type of note being defined by a note-size element. - /// The grace type is used for notes of cue size that that include a grace element. The cue - /// type is used for all other notes with cue size, whether defined explicitly or implicitly - /// via a cue element. The large type is used for notes of large size. - /// - enum class NoteSizeType - { - cue = 0, - grace = 1, - large = 2 - }; - - NoteSizeType parseNoteSizeType( const std::string& value ); - std::optional tryParseNoteSizeType( const std::string& value ); - std::string toString( const NoteSizeType value ); - std::ostream& toStream( std::ostream& os, const NoteSizeType value ); - std::ostream& operator<<( std::ostream& os, const NoteSizeType value ); - - /// NoteTypeValue ////////////////////////////////////////////////////////////////////////// - /// - /// The note-type type is used for the MusicXML type element and represents the graphic note - /// type, from 1024th (shortest) to maxima (longest). - /// - enum class NoteTypeValue - { - oneThousandTwentyFourth = 0, - fiveHundredTwelfth = 1, - twoHundredFifthySixth = 2, - oneHundredTwentyEighth = 3, - sixtyFourth = 4, - thirtySecond = 5, - sixteenth = 6, - eighth = 7, - quarter = 8, - half = 9, - whole = 10, - breve = 11, - long_ = 12, - maxima = 13 - }; - - NoteTypeValue parseNoteTypeValue( const std::string& value ); - std::optional tryParseNoteTypeValue( const std::string& value ); - std::string toString( const NoteTypeValue value ); - std::ostream& toStream( std::ostream& os, const NoteTypeValue value ); - std::ostream& operator<<( std::ostream& os, const NoteTypeValue value ); - - /// NoteheadValue ////////////////////////////////////////////////////////////////////////// - /// - /// The notehead type indicates shapes other than the open and closed ovals associated with - /// note durations. The values do, re, mi, fa, fa up, so, la, and ti correspond to Aikin's - /// 7-shape system. The fa up shape is typically used with upstems; the fa shape is - /// typically used with downstems or no stems. - /// - /// The arrow shapes differ from triangle and inverted triangle by being centered on the - /// stem. Slashed and back slashed notes include both the normal notehead and a slash. The - /// triangle shape has the tip of the triangle pointing up; the inverted triangle shape has - /// the tip of the triangle pointing down. The left triangle shape is a right triangle with - /// the hypotenuse facing up and to the left. - /// - enum class NoteheadValue - { - slash = 0, - triangle = 1, - diamond = 2, - square = 3, - cross = 4, - x = 5, - circleX = 6, - invertedTriangle = 7, - arrowDown = 8, - arrowUp = 9, - slashed = 10, - backSlashed = 11, - normal = 12, - cluster = 13, - circleDot = 14, - leftTriangle = 15, - rectangle = 16, - none = 17, - do_ = 18, - re = 19, - mi = 20, - fa = 21, - faUp = 22, - so = 23, - la = 24, - ti = 25 - }; - - NoteheadValue parseNoteheadValue( const std::string& value ); - std::optional tryParseNoteheadValue( const std::string& value ); - std::string toString( const NoteheadValue value ); - std::ostream& toStream( std::ostream& os, const NoteheadValue value ); - std::ostream& operator<<( std::ostream& os, const NoteheadValue value ); - - /// OnOff ////////////////////////////////////////////////////////////////////////////////// - /// - /// The on-off type is used for notation elements such as string mutes. - /// - enum class OnOff - { - on = 0, - off = 1 - }; - - OnOff parseOnOff( const std::string& value ); - std::optional tryParseOnOff( const std::string& value ); - std::string toString( const OnOff value ); - std::ostream& toStream( std::ostream& os, const OnOff value ); - std::ostream& operator<<( std::ostream& os, const OnOff value ); - - /// OverUnder ////////////////////////////////////////////////////////////////////////////// - /// - /// The over-under type is used to indicate whether the tips of curved lines such as slurs - /// and ties are overhand (tips down) or underhand (tips up). - /// - enum class OverUnder - { - over = 0, - under = 1 - }; - - OverUnder parseOverUnder( const std::string& value ); - std::optional tryParseOverUnder( const std::string& value ); - std::string toString( const OverUnder value ); - std::ostream& toStream( std::ostream& os, const OverUnder value ); - std::ostream& operator<<( std::ostream& os, const OverUnder value ); - - /// PitchedEnum //////////////////////////////////////////////////////////////////////////// - /// - /// The pitched type represents pictograms for pitched percussion instruments. The chimes - /// and tubular chimes values distinguish the single-line and double-line versions of the - /// pictogram. The mallet value is in addition to Stone's list. - /// - enum class PitchedEnum - { - chimes = 0, - glockenspiel = 1, - mallet = 2, - marimba = 3, - tubularChimes = 4, - vibraphone = 5, - xylophone = 6 - }; - - PitchedEnum parsePitchedEnum( const std::string& value ); - std::optional tryParsePitchedEnum( const std::string& value ); - std::string toString( const PitchedEnum value ); - std::ostream& toStream( std::ostream& os, const PitchedEnum value ); - std::ostream& operator<<( std::ostream& os, const PitchedEnum value ); - - /// PrincipalVoiceSymbol /////////////////////////////////////////////////////////////////// - /// - /// The principal-voice-symbol type represents the type of symbol used to indicate the start - /// of a principal or secondary voice. The "plain" value represents a plain square bracket. - /// The value of "none" is used for analysis markup when the principal-voice element does - /// not have a corresponding appearance in the score. - /// - enum class PrincipalVoiceSymbol - { - hauptstimme = 0, - nebenstimme = 1, - plain = 2, - none = 3 - }; - - PrincipalVoiceSymbol parsePrincipalVoiceSymbol( const std::string& value ); - std::optional tryParsePrincipalVoiceSymbol( const std::string& value ); - std::string toString( const PrincipalVoiceSymbol value ); - std::ostream& toStream( std::ostream& os, const PrincipalVoiceSymbol value ); - std::ostream& operator<<( std::ostream& os, const PrincipalVoiceSymbol value ); - - /// RightLeftMiddle //////////////////////////////////////////////////////////////////////// - /// - /// The right-left-middle type is used to specify barline location. - /// - enum class RightLeftMiddle - { - right = 0, - left = 1, - middle = 2 - }; - - RightLeftMiddle parseRightLeftMiddle( const std::string& value ); - std::optional tryParseRightLeftMiddle( const std::string& value ); - std::string toString( const RightLeftMiddle value ); - std::ostream& toStream( std::ostream& os, const RightLeftMiddle value ); - std::ostream& operator<<( std::ostream& os, const RightLeftMiddle value ); - - /// SemiPitchedEnum //////////////////////////////////////////////////////////////////////// - /// - /// The semi-pitched type represents categories of indefinite pitch for percussion - /// instruments. - /// - enum class SemiPitchedEnum - { - high = 0, - mediumHigh = 1, - medium = 2, - mediumLow = 3, - low = 4, - veryLow = 5 - }; - - SemiPitchedEnum parseSemiPitchedEnum( const std::string& value ); - std::optional tryParseSemiPitchedEnum( const std::string& value ); - std::string toString( const SemiPitchedEnum value ); - std::ostream& toStream( std::ostream& os, const SemiPitchedEnum value ); - std::ostream& operator<<( std::ostream& os, const SemiPitchedEnum value ); - - /// ShowFrets ////////////////////////////////////////////////////////////////////////////// - /// - /// The show-frets type indicates whether to show tablature frets as numbers (0, 1, 2) or - /// letters (a, b, c). The default choice is numbers. - /// - enum class ShowFrets - { - numbers = 0, - letters = 1 - }; - - ShowFrets parseShowFrets( const std::string& value ); - std::optional tryParseShowFrets( const std::string& value ); - std::string toString( const ShowFrets value ); - std::ostream& toStream( std::ostream& os, const ShowFrets value ); - std::ostream& operator<<( std::ostream& os, const ShowFrets value ); - - /// ShowTuplet ///////////////////////////////////////////////////////////////////////////// - /// - /// The show-tuplet type indicates whether to show a part of a tuplet relating to the - /// tuplet-actual element, both the tuplet-actual and tuplet-normal elements, or neither. - /// - enum class ShowTuplet - { - actual = 0, - both = 1, - none = 2 - }; - - ShowTuplet parseShowTuplet( const std::string& value ); - std::optional tryParseShowTuplet( const std::string& value ); - std::string toString( const ShowTuplet value ); - std::ostream& toStream( std::ostream& os, const ShowTuplet value ); - std::ostream& operator<<( std::ostream& os, const ShowTuplet value ); - - /// StaffTypeEnum ////////////////////////////////////////////////////////////////////////// - /// - /// The staff-type value can be ossia, cue, editorial, regular, or alternate. An alternate - /// staff indicates one that shares the same musical data as the prior staff, but displayed - /// differently (e.g., treble and bass clef, standard notation and tab). - /// - enum class StaffTypeEnum - { - ossia = 0, - cue = 1, - editorial = 2, - regular = 3, - alternate = 4 - }; - - StaffTypeEnum parseStaffTypeEnum( const std::string& value ); - std::optional tryParseStaffTypeEnum( const std::string& value ); - std::string toString( const StaffTypeEnum value ); - std::ostream& toStream( std::ostream& os, const StaffTypeEnum value ); - std::ostream& operator<<( std::ostream& os, const StaffTypeEnum value ); - - /// StartNote ////////////////////////////////////////////////////////////////////////////// - /// - /// The start-note type describes the starting note of trills and mordents for playback, - /// relative to the current note. - /// - enum class StartNote - { - upper = 0, - main = 1, - below = 2 - }; - - StartNote parseStartNote( const std::string& value ); - std::optional tryParseStartNote( const std::string& value ); - std::string toString( const StartNote value ); - std::ostream& toStream( std::ostream& os, const StartNote value ); - std::ostream& operator<<( std::ostream& os, const StartNote value ); - - /// StartStop ////////////////////////////////////////////////////////////////////////////// - /// - /// The start-stop type is used for an attribute of musical elements that can either start - /// or stop, such as tuplets. - /// - /// The values of start and stop refer to how an element appears in musical score order, not - /// in MusicXML document order. An element with a stop attribute may precede the - /// corresponding element with a start attribute within a MusicXML document. This is - /// particularly common in multi-staff music. For example, the stopping point for a tuplet - /// may appear in staff 1 before the starting point for the tuplet appears in staff 2 later - /// in the document. - /// - enum class StartStop - { - start = 0, - stop = 1 - }; - - StartStop parseStartStop( const std::string& value ); - std::optional tryParseStartStop( const std::string& value ); - std::string toString( const StartStop value ); - std::ostream& toStream( std::ostream& os, const StartStop value ); - std::ostream& operator<<( std::ostream& os, const StartStop value ); - - /// StartStopChangeContinue //////////////////////////////////////////////////////////////// - /// - /// The start-stop-change-continue type is used to distinguish types of pedal directions. - /// - enum class StartStopChangeContinue - { - start = 0, - stop = 1, - change = 2, - continue_ = 3 - }; - - StartStopChangeContinue parseStartStopChangeContinue( const std::string& value ); - std::optional tryParseStartStopChangeContinue( const std::string& value ); - std::string toString( const StartStopChangeContinue value ); - std::ostream& toStream( std::ostream& os, const StartStopChangeContinue value ); - std::ostream& operator<<( std::ostream& os, const StartStopChangeContinue value ); - - /// StartStopContinue ////////////////////////////////////////////////////////////////////// - /// - /// The start-stop-continue type is used for an attribute of musical elements that can - /// either start or stop, but also need to refer to an intermediate point in the symbol, as - /// for complex slurs or for formatting of symbols across system breaks. - /// - /// The values of start, stop, and continue refer to how an element appears in musical score - /// order, not in MusicXML document order. An element with a stop attribute may precede the - /// corresponding element with a start attribute within a MusicXML document. This is - /// particularly common in multi-staff music. For example, the stopping point for a slur may - /// appear in staff 1 before the starting point for the slur appears in staff 2 later in the - /// document. - /// - enum class StartStopContinue - { - start = 0, - stop = 1, - continue_ = 2 - }; - - StartStopContinue parseStartStopContinue( const std::string& value ); - std::optional tryParseStartStopContinue( const std::string& value ); - std::string toString( const StartStopContinue value ); - std::ostream& toStream( std::ostream& os, const StartStopContinue value ); - std::ostream& operator<<( std::ostream& os, const StartStopContinue value ); - - /// StartStopDiscontinue /////////////////////////////////////////////////////////////////// - /// - /// The start-stop-discontinue type is used to specify ending types. Typically, the start - /// type is associated with the left barline of the first measure in an ending. The stop and - /// discontinue types are associated with the right barline of the last measure in an - /// ending. Stop is used when the ending mark concludes with a downward jog, as is typical - /// for first endings. Discontinue is used when there is no downward jog, as is typical for - /// second endings that do not conclude a piece. - /// - enum class StartStopDiscontinue - { - start = 0, - stop = 1, - discontinue = 2 - }; - - StartStopDiscontinue parseStartStopDiscontinue( const std::string& value ); - std::optional tryParseStartStopDiscontinue( const std::string& value ); - std::string toString( const StartStopDiscontinue value ); - std::ostream& toStream( std::ostream& os, const StartStopDiscontinue value ); - std::ostream& operator<<( std::ostream& os, const StartStopDiscontinue value ); - - /// StartStopSingle //////////////////////////////////////////////////////////////////////// - /// - /// The start-stop-single type is used for an attribute of musical elements that can be used - /// for either multi-note or single-note musical elements, as for tremolos. - /// - enum class StartStopSingle - { - start = 0, - stop = 1, - single = 2 - }; - - StartStopSingle parseStartStopSingle( const std::string& value ); - std::optional tryParseStartStopSingle( const std::string& value ); - std::string toString( const StartStopSingle value ); - std::ostream& toStream( std::ostream& os, const StartStopSingle value ); - std::ostream& operator<<( std::ostream& os, const StartStopSingle value ); - - /// StemValue ////////////////////////////////////////////////////////////////////////////// - /// - /// The stem type represents the notated stem direction. - /// - enum class StemValue - { - down = 0, - up = 1, - double_ = 2, - none = 3 - }; - - StemValue parseStemValue( const std::string& value ); - std::optional tryParseStemValue( const std::string& value ); - std::string toString( const StemValue value ); - std::ostream& toStream( std::ostream& os, const StemValue value ); - std::ostream& operator<<( std::ostream& os, const StemValue value ); - - /// StepEnum /////////////////////////////////////////////////////////////////////////////// - /// - /// The step type represents a step of the diatonic scale, represented using the English - /// letters A through G. - /// - enum class StepEnum - { - a = 0, - b = 1, - c = 2, - d = 3, - e = 4, - f = 5, - g = 6 - }; - - StepEnum parseStepEnum( const std::string& value ); - std::optional tryParseStepEnum( const std::string& value ); - std::string toString( const StepEnum value ); - std::ostream& toStream( std::ostream& os, const StepEnum value ); - std::ostream& operator<<( std::ostream& os, const StepEnum value ); - - /// StickLocationEnum ////////////////////////////////////////////////////////////////////// - /// - /// The stick-location type represents pictograms for the location of sticks, beaters, or - /// mallets on cymbals, gongs, drums, and other instruments. - /// - enum class StickLocationEnum - { - center = 0, - rim = 1, - cymbalBell = 2, - cymbalEdge = 3 - }; - - StickLocationEnum parseStickLocationEnum( const std::string& value ); - std::optional tryParseStickLocationEnum( const std::string& value ); - std::string toString( const StickLocationEnum value ); - std::ostream& toStream( std::ostream& os, const StickLocationEnum value ); - std::ostream& operator<<( std::ostream& os, const StickLocationEnum value ); - - /// StickMaterialEnum ////////////////////////////////////////////////////////////////////// - /// - /// The stick-material type represents the material being displayed in a stick pictogram. - /// - enum class StickMaterialEnum - { - soft = 0, - medium = 1, - hard = 2, - shaded = 3, - x = 4 - }; - - StickMaterialEnum parseStickMaterialEnum( const std::string& value ); - std::optional tryParseStickMaterialEnum( const std::string& value ); - std::string toString( const StickMaterialEnum value ); - std::ostream& toStream( std::ostream& os, const StickMaterialEnum value ); - std::ostream& operator<<( std::ostream& os, const StickMaterialEnum value ); - - /// StickTypeEnum ////////////////////////////////////////////////////////////////////////// - /// - /// The stick-type type represents the shape of pictograms where the material - /// in the stick, mallet, or beater is represented in the pictogram. - /// - enum class StickTypeEnum - { - bassDrum = 0, - doubleBassDrum = 1, - timpani = 2, - xylophone = 3, - yarn = 4 - }; - - StickTypeEnum parseStickTypeEnum( const std::string& value ); - std::optional tryParseStickTypeEnum( const std::string& value ); - std::string toString( const StickTypeEnum value ); - std::ostream& toStream( std::ostream& os, const StickTypeEnum value ); - std::ostream& operator<<( std::ostream& os, const StickTypeEnum value ); - - /// SyllabicEnum /////////////////////////////////////////////////////////////////////////// - /// - /// Lyric hyphenation is indicated by the syllabic type. The single, begin, end, and middle - /// values represent single-syllable words, word-beginning syllables, word-ending syllables, - /// and mid-word syllables, respectively. - /// - enum class SyllabicEnum - { - single = 0, - begin = 1, - end = 2, - middle = 3 - }; - - SyllabicEnum parseSyllabicEnum( const std::string& value ); - std::optional tryParseSyllabicEnum( const std::string& value ); - std::string toString( const SyllabicEnum value ); - std::ostream& toStream( std::ostream& os, const SyllabicEnum value ); - std::ostream& operator<<( std::ostream& os, const SyllabicEnum value ); - - /// SymbolSize ///////////////////////////////////////////////////////////////////////////// - /// - /// The symbol-size type is used to indicate full vs. cue-sized vs. oversized symbols. The - /// large value for oversized symbols was added in version 1.1. - /// - enum class SymbolSize - { - full = 0, - cue = 1, - large = 2 - }; - - SymbolSize parseSymbolSize( const std::string& value ); - std::optional tryParseSymbolSize( const std::string& value ); - std::string toString( const SymbolSize value ); - std::ostream& toStream( std::ostream& os, const SymbolSize value ); - std::ostream& operator<<( std::ostream& os, const SymbolSize value ); - - /// TextDirection ////////////////////////////////////////////////////////////////////////// - /// - /// The text-direction type is used to adjust and override the Unicode bidirectional text - /// algorithm, similar to the W3C Internationalization Tag Set recommendation. Values are - /// ltr (left-to-right embed), rtl (right-to-left embed), lro (left-to-right bidi-override), - /// and rlo (right-to-left bidi-override). The default value is ltr. This type is typically - /// used by applications that store text in left-to-right visual order rather than logical - /// order. Such applications can use the lro value to better communicate with other - /// applications that more fully support bidirectional text. - /// - enum class TextDirection - { - ltr = 0, - rtl = 1, - lro = 2, - rlo = 3 - }; - - TextDirection parseTextDirection( const std::string& value ); - std::optional tryParseTextDirection( const std::string& value ); - std::string toString( const TextDirection value ); - std::ostream& toStream( std::ostream& os, const TextDirection value ); - std::ostream& operator<<( std::ostream& os, const TextDirection value ); - - /// TimeRelationEnum /////////////////////////////////////////////////////////////////////// - /// - /// The time-relation type indicates the symbol used to represent the interchangeable aspect - /// of dual time signatures. - /// - enum class TimeRelationEnum - { - parentheses = 0, - bracket = 1, - equals = 2, - slash = 3, - space = 4, - hyphen = 5 - }; - - TimeRelationEnum parseTimeRelationEnum( const std::string& value ); - std::optional tryParseTimeRelationEnum( const std::string& value ); - std::string toString( const TimeRelationEnum value ); - std::ostream& toStream( std::ostream& os, const TimeRelationEnum value ); - std::ostream& operator<<( std::ostream& os, const TimeRelationEnum value ); - - /// TimeSeparator ////////////////////////////////////////////////////////////////////////// - /// - /// The time-separator type indicates how to display the arrangement between the beats and - /// beat-type values in a time signature. The default value is none. The horizontal, - /// diagonal, and vertical values represent horizontal, diagonal lower-left to upper-right, - /// and vertical lines respectively. For these values, the beats and beat-type values are - /// arranged on either side of the separator line. The none value represents no separator - /// with the beats and beat-type arranged vertically. The adjacent value represents no - /// separator with the beats and beat-type arranged horizontally. - /// - enum class TimeSeparator - { - none = 0, - horizontal = 1, - diagonal = 2, - vertical = 3, - adjacent = 4 - }; - - TimeSeparator parseTimeSeparator( const std::string& value ); - std::optional tryParseTimeSeparator( const std::string& value ); - std::string toString( const TimeSeparator value ); - std::ostream& toStream( std::ostream& os, const TimeSeparator value ); - std::ostream& operator<<( std::ostream& os, const TimeSeparator value ); - - /// TimeSymbol ///////////////////////////////////////////////////////////////////////////// - /// - /// The time-symbol type indicates how to display a time signature. The normal value is the - /// usual fractional display, and is the implied symbol type if none is specified. Other - /// options are the common and cut time symbols, as well as a single number with an implied - /// denominator. The note symbol indicates that the beat-type should be represented with the - /// corresponding downstem note rather than a number. The dotted-note symbol indicates that - /// the beat-type should be represented with a dotted downstem note that corresponds to - /// three times the beat-type value, and a numerator that is one third the beats value. - /// - enum class TimeSymbol - { - common = 0, - cut = 1, - singleNumber = 2, - note = 3, - dottedNote = 4, - normal = 5 - }; - - TimeSymbol parseTimeSymbol( const std::string& value ); - std::optional tryParseTimeSymbol( const std::string& value ); - std::string toString( const TimeSymbol value ); - std::ostream& toStream( std::ostream& os, const TimeSymbol value ); - std::ostream& operator<<( std::ostream& os, const TimeSymbol value ); - - /// TipDirection /////////////////////////////////////////////////////////////////////////// - /// - /// The tip-direction type represents the direction in which the tip of a stick or beater - /// points, using Unicode arrow terminology. - /// - enum class TipDirection - { - up = 0, - down = 1, - left = 2, - right = 3, - northwest = 4, - northeast = 5, - southeast = 6, - southwest = 7 - }; - - TipDirection parseTipDirection( const std::string& value ); - std::optional tryParseTipDirection( const std::string& value ); - std::string toString( const TipDirection value ); - std::ostream& toStream( std::ostream& os, const TipDirection value ); - std::ostream& operator<<( std::ostream& os, const TipDirection value ); - - /// TopBottom ////////////////////////////////////////////////////////////////////////////// - /// - /// The top-bottom type is used to indicate the top or bottom part of a vertical shape like - /// non-arpeggiate. - /// - enum class TopBottom - { - top = 0, - bottom = 1 - }; - - TopBottom parseTopBottom( const std::string& value ); - std::optional tryParseTopBottom( const std::string& value ); - std::string toString( const TopBottom value ); - std::ostream& toStream( std::ostream& os, const TopBottom value ); - std::ostream& operator<<( std::ostream& os, const TopBottom value ); - - /// TrillStep ////////////////////////////////////////////////////////////////////////////// - /// - /// The trill-step type describes the alternating note of trills and mordents for playback, - /// relative to the current note. - /// - enum class TrillStep - { - whole = 0, - half = 1, - unison = 2 - }; - - TrillStep parseTrillStep( const std::string& value ); - std::optional tryParseTrillStep( const std::string& value ); - std::string toString( const TrillStep value ); - std::ostream& toStream( std::ostream& os, const TrillStep value ); - std::ostream& operator<<( std::ostream& os, const TrillStep value ); - - /// TwoNoteTurn //////////////////////////////////////////////////////////////////////////// - /// - /// The two-note-turn type describes the ending notes of trills and mordents for playback, - /// relative to the current note. - /// - enum class TwoNoteTurn - { - whole = 0, - half = 1, - none = 2 - }; - - TwoNoteTurn parseTwoNoteTurn( const std::string& value ); - std::optional tryParseTwoNoteTurn( const std::string& value ); - std::string toString( const TwoNoteTurn value ); - std::ostream& toStream( std::ostream& os, const TwoNoteTurn value ); - std::ostream& operator<<( std::ostream& os, const TwoNoteTurn value ); - - /// UpDown ///////////////////////////////////////////////////////////////////////////////// - /// - /// The up-down type is used for the direction of arrows and other pointed symbols like - /// vertical accents, indicating which way the tip is pointing. - /// - enum class UpDown - { - up = 0, - down = 1 - }; - - UpDown parseUpDown( const std::string& value ); - std::optional tryParseUpDown( const std::string& value ); - std::string toString( const UpDown value ); - std::ostream& toStream( std::ostream& os, const UpDown value ); - std::ostream& operator<<( std::ostream& os, const UpDown value ); - - /// UpDownStopContinue ///////////////////////////////////////////////////////////////////// - /// - /// The up-down-stop-continue type is used for octave-shift elements, indicating the - /// direction of the shift from their true pitched values because of printing difficulty. - /// - enum class UpDownStopContinue - { - up = 0, - down = 1, - stop = 2, - continue_ = 3 - }; - - UpDownStopContinue parseUpDownStopContinue( const std::string& value ); - std::optional tryParseUpDownStopContinue( const std::string& value ); - std::string toString( const UpDownStopContinue value ); - std::ostream& toStream( std::ostream& os, const UpDownStopContinue value ); - std::ostream& operator<<( std::ostream& os, const UpDownStopContinue value ); - - /// UprightInverted //////////////////////////////////////////////////////////////////////// - /// - /// The upright-inverted type describes the appearance of a fermata element. The value is - /// upright if not specified. - /// - enum class UprightInverted - { - upright = 0, - inverted = 1 - }; - - UprightInverted parseUprightInverted( const std::string& value ); - std::optional tryParseUprightInverted( const std::string& value ); - std::string toString( const UprightInverted value ); - std::ostream& toStream( std::ostream& os, const UprightInverted value ); - std::ostream& operator<<( std::ostream& os, const UprightInverted value ); - - /// Valign ///////////////////////////////////////////////////////////////////////////////// - /// - /// The valign type is used to indicate vertical alignment to the top, middle, bottom, or - /// baseline of the text. Defaults are implementation-dependent. - /// - enum class Valign - { - top = 0, - middle = 1, - bottom = 2, - baseline = 3 - }; - - Valign parseValign( const std::string& value ); - std::optional tryParseValign( const std::string& value ); - std::string toString( const Valign value ); - std::ostream& toStream( std::ostream& os, const Valign value ); - std::ostream& operator<<( std::ostream& os, const Valign value ); - - /// ValignImage //////////////////////////////////////////////////////////////////////////// - /// - /// The valign-image type is used to indicate vertical alignment for images and graphics, so - /// it does not include a baseline value. Defaults are implementation-dependent. - /// - enum class ValignImage - { - top = 0, - middle = 1, - bottom = 2 - }; - - ValignImage parseValignImage( const std::string& value ); - std::optional tryParseValignImage( const std::string& value ); - std::string toString( const ValignImage value ); - std::ostream& toStream( std::ostream& os, const ValignImage value ); - std::ostream& operator<<( std::ostream& os, const ValignImage value ); - - /// WedgeType ////////////////////////////////////////////////////////////////////////////// - /// - /// The wedge type is crescendo for the start of a wedge that is closed at the left side, - /// diminuendo for the start of a wedge that is closed on the right side, and stop for the - /// end of a wedge. The continue type is used for formatting wedges over a system break, or - /// for other situations where a single wedge is divided into multiple segments. - /// - enum class WedgeType - { - crescendo = 0, - diminuendo = 1, - stop = 2, - continue_ = 3 - }; - - WedgeType parseWedgeType( const std::string& value ); - std::optional tryParseWedgeType( const std::string& value ); - std::string toString( const WedgeType value ); - std::ostream& toStream( std::ostream& os, const WedgeType value ); - std::ostream& operator<<( std::ostream& os, const WedgeType value ); - - /// Winged ///////////////////////////////////////////////////////////////////////////////// - /// - /// The winged attribute indicates whether the repeat has winged extensions that appear - /// above and below the barline. The straight and curved values represent single wings, - /// while the double-straight and double-curved values represent double wings. The none - /// value indicates no wings and is the default. - /// - enum class Winged - { - none = 0, - straight = 1, - curved = 2, - doubleStraight = 3, - doubleCurved = 4 - }; - - Winged parseWinged( const std::string& value ); - std::optional tryParseWinged( const std::string& value ); - std::string toString( const Winged value ); - std::ostream& toStream( std::ostream& os, const Winged value ); - std::ostream& operator<<( std::ostream& os, const Winged value ); - - /// WoodEnum /////////////////////////////////////////////////////////////////////////////// - /// - /// The wood type represents pictograms for wood percussion instruments. The maraca and - /// maracas values distinguish the one- and two-maraca versions of the pictogram. The - /// vibraslap and castanets values are in addition to Stone's list. - /// - enum class WoodEnum - { - boardClapper = 0, - cabasa = 1, - castanets = 2, - claves = 3, - guiro = 4, - logDrum = 5, - maraca = 6, - maracas = 7, - ratchet = 8, - sandpaperBlocks = 9, - slitDrum = 10, - templeBlock = 11, - vibraslap = 12, - woodBlock = 13 - }; - - WoodEnum parseWoodEnum( const std::string& value ); - std::optional tryParseWoodEnum( const std::string& value ); - std::string toString( const WoodEnum value ); - std::ostream& toStream( std::ostream& os, const WoodEnum value ); - std::ostream& operator<<( std::ostream& os, const WoodEnum value ); - - /// YesNo ////////////////////////////////////////////////////////////////////////////////// - /// - /// The yes-no type is used for boolean-like attributes. We cannot use W3C XML Schema - /// booleans due to their restrictions on expression of boolean values. - /// - enum class YesNo - { - yes = 0, - no = 1 - }; - - YesNo parseYesNo( const std::string& value ); - std::optional tryParseYesNo( const std::string& value ); - std::string toString( const YesNo value ); - std::ostream& toStream( std::ostream& os, const YesNo value ); - std::ostream& operator<<( std::ostream& os, const YesNo value ); - } -} +namespace core +{ +/// AboveBelow ///////////////////////////////////////////////////////////////////////////// +/// +/// The above-below type is used to indicate whether one element appears above or below +/// another element. +/// +enum class AboveBelow +{ + above = 0, + below = 1 +}; + +AboveBelow parseAboveBelow(const std::string &value); +std::optional tryParseAboveBelow(const std::string &value); +std::string toString(const AboveBelow value); +std::ostream &toStream(std::ostream &os, const AboveBelow value); +std::ostream &operator<<(std::ostream &os, const AboveBelow value); + +/// AccidentalValue //////////////////////////////////////////////////////////////////////// +/// +/// The accidental-value type represents notated accidentals supported by MusicXML. In the +/// MusicXML 2.0 DTD this was a string with values that could be included. The XSD +/// strengthens the data typing to an enumerated list. The quarter- and three-quarters- +/// accidentals are Tartini-style quarter-tone accidentals. The -down and -up accidentals +/// are quarter-tone accidentals that include arrows pointing down or up. The slash- +/// accidentals are used in Turkish classical music. The numbered sharp and flat accidentals +/// are superscripted versions of the accidental signs, used in Turkish folk music. The sori +/// and koron accidentals are microtonal sharp and flat accidentals used in Iranian and +/// Persian music. +/// +enum class AccidentalValue +{ + sharp = 0, + natural = 1, + flat = 2, + doubleSharp = 3, + sharpSharp = 4, + flatFlat = 5, + naturalSharp = 6, + naturalFlat = 7, + quarterFlat = 8, + quarterSharp = 9, + threeQuartersFlat = 10, + threeQuartersSharp = 11, + sharpDown = 12, + sharpUp = 13, + naturalDown = 14, + naturalUp = 15, + flatDown = 16, + flatUp = 17, + tripleSharp = 18, + tripleFlat = 19, + slashQuarterSharp = 20, + slashSharp = 21, + slashFlat = 22, + doubleSlashFlat = 23, + sharp1 = 24, + sharp2 = 25, + sharp3 = 26, + sharp5 = 27, + flat1 = 28, + flat2 = 29, + flat3 = 30, + flat4 = 31, + sori = 32, + koron = 33 +}; + +AccidentalValue parseAccidentalValue(const std::string &value); +std::optional tryParseAccidentalValue(const std::string &value); +std::string toString(const AccidentalValue value); +std::ostream &toStream(std::ostream &os, const AccidentalValue value); +std::ostream &operator<<(std::ostream &os, const AccidentalValue value); + +/// ArrowDirectionEnum ///////////////////////////////////////////////////////////////////// +/// +/// The arrow-direction type represents the direction in which an arrow points, using +/// Unicode arrow terminology. +/// +enum class ArrowDirectionEnum +{ + left = 0, + up = 1, + right = 2, + down = 3, + northwest = 4, + northeast = 5, + southeast = 6, + southwest = 7, + leftRight = 8, + upDown = 9, + northwestSoutheast = 10, + northeastSouthwest = 11, + other = 12 +}; + +ArrowDirectionEnum parseArrowDirectionEnum(const std::string &value); +std::optional tryParseArrowDirectionEnum(const std::string &value); +std::string toString(const ArrowDirectionEnum value); +std::ostream &toStream(std::ostream &os, const ArrowDirectionEnum value); +std::ostream &operator<<(std::ostream &os, const ArrowDirectionEnum value); + +/// ArrowStyleEnum ///////////////////////////////////////////////////////////////////////// +/// +/// The arrow-style type represents the style of an arrow, using Unicode arrow terminology. +/// Filled and hollow arrows indicate polygonal single arrows. Paired arrows are duplicate +/// single arrows in the same direction. Combined arrows apply to double direction arrows +/// like left right, indicating that an arrow in one direction should be combined with an +/// arrow in the other direction. +/// +enum class ArrowStyleEnum +{ + single = 0, + double_ = 1, + filled = 2, + hollow = 3, + paired = 4, + combined = 5, + other = 6 +}; + +ArrowStyleEnum parseArrowStyleEnum(const std::string &value); +std::optional tryParseArrowStyleEnum(const std::string &value); +std::string toString(const ArrowStyleEnum value); +std::ostream &toStream(std::ostream &os, const ArrowStyleEnum value); +std::ostream &operator<<(std::ostream &os, const ArrowStyleEnum value); + +/// BackwardForward //////////////////////////////////////////////////////////////////////// +/// +/// The backward-forward type is used to specify repeat directions. The start of the repeat +/// has a forward direction while the end of the repeat has a backward direction. +/// +enum class BackwardForward +{ + backward = 0, + forward = 1 +}; + +BackwardForward parseBackwardForward(const std::string &value); +std::optional tryParseBackwardForward(const std::string &value); +std::string toString(const BackwardForward value); +std::ostream &toStream(std::ostream &os, const BackwardForward value); +std::ostream &operator<<(std::ostream &os, const BackwardForward value); + +/// BarStyleEnum /////////////////////////////////////////////////////////////////////////// +/// +/// The bar-style type represents barline style information. Choices are regular, dotted, +/// dashed, heavy, light-light, light-heavy, heavy-light, heavy-heavy, tick (a short stroke +/// through the top line), short (a partial barline between the 2nd and 4th lines), and +/// none. +/// +enum class BarStyleEnum +{ + regular = 0, + dotted = 1, + dashed = 2, + heavy = 3, + lightLight = 4, + lightHeavy = 5, + heavyLight = 6, + heavyHeavy = 7, + tick = 8, + short_ = 9, + none = 10 +}; + +BarStyleEnum parseBarStyleEnum(const std::string &value); +std::optional tryParseBarStyleEnum(const std::string &value); +std::string toString(const BarStyleEnum value); +std::ostream &toStream(std::ostream &os, const BarStyleEnum value); +std::ostream &operator<<(std::ostream &os, const BarStyleEnum value); + +/// BeamValue ////////////////////////////////////////////////////////////////////////////// +/// +/// The beam-value type represents the type of beam associated with each of 8 beam levels +/// (up to 1024th notes) available for each note. +/// +enum class BeamValue +{ + begin = 0, + continue_ = 1, + end = 2, + forwardHook = 3, + backwardHook = 4 +}; + +BeamValue parseBeamValue(const std::string &value); +std::optional tryParseBeamValue(const std::string &value); +std::string toString(const BeamValue value); +std::ostream &toStream(std::ostream &os, const BeamValue value); +std::ostream &operator<<(std::ostream &os, const BeamValue value); + +/// BeaterValue //////////////////////////////////////////////////////////////////////////// +/// +/// The beater-value type represents pictograms for beaters, mallets, and sticks that do not +/// have different materials represented in the pictogram. The finger and hammer values are +/// in addition to Stone's list. +/// +enum class BeaterValue +{ + bow = 0, + chimeHammer = 1, + coin = 2, + finger = 3, + fingernail = 4, + fist = 5, + guiroScraper = 6, + hammer = 7, + hand = 8, + jazzStick = 9, + knittingNeedle = 10, + metalHammer = 11, + snareStick = 12, + spoonMallet = 13, + triangleBeater = 14, + triangleBeaterPlain = 15, + wireBrush = 16 +}; + +BeaterValue parseBeaterValue(const std::string &value); +std::optional tryParseBeaterValue(const std::string &value); +std::string toString(const BeaterValue value); +std::ostream &toStream(std::ostream &os, const BeaterValue value); +std::ostream &operator<<(std::ostream &os, const BeaterValue value); + +/// BreathMarkValue //////////////////////////////////////////////////////////////////////// +/// +/// The breath-mark-value type represents the symbol used for a breath mark. +/// +enum class BreathMarkValue +{ + emptystring = 0, + comma = 1, + tick = 2 +}; + +BreathMarkValue parseBreathMarkValue(const std::string &value); +std::optional tryParseBreathMarkValue(const std::string &value); +std::string toString(const BreathMarkValue value); +std::ostream &toStream(std::ostream &os, const BreathMarkValue value); +std::ostream &operator<<(std::ostream &os, const BreathMarkValue value); + +/// CancelLocation ///////////////////////////////////////////////////////////////////////// +/// +/// The cancel-location type is used to indicate where a key signature cancellation appears +/// relative to a new key signature: to the left, to the right, or before the barline and to +/// the left. It is left by default. For mid-measure key elements, a cancel-location of +/// before-barline should be treated like a cancel-location of left. +/// +enum class CancelLocation +{ + left = 0, + right = 1, + beforeBarline = 2 +}; + +CancelLocation parseCancelLocation(const std::string &value); +std::optional tryParseCancelLocation(const std::string &value); +std::string toString(const CancelLocation value); +std::ostream &toStream(std::ostream &os, const CancelLocation value); +std::ostream &operator<<(std::ostream &os, const CancelLocation value); + +/// CircularArrowEnum ////////////////////////////////////////////////////////////////////// +/// +/// The circular-arrow type represents the direction in which a circular arrow points, using +/// Unicode arrow terminology. +/// +enum class CircularArrowEnum +{ + clockwise = 0, + anticlockwise = 1 +}; + +CircularArrowEnum parseCircularArrowEnum(const std::string &value); +std::optional tryParseCircularArrowEnum(const std::string &value); +std::string toString(const CircularArrowEnum value); +std::ostream &toStream(std::ostream &os, const CircularArrowEnum value); +std::ostream &operator<<(std::ostream &os, const CircularArrowEnum value); + +/// ClefSign /////////////////////////////////////////////////////////////////////////////// +/// +/// The clef-sign element represents the different clef symbols. The jianpu sign indicates +/// that the music that follows should be in jianpu numbered notation, just as the TAB sign +/// indicates that the music that follows should be in tablature notation. Unlike TAB, a +/// jianpu sign does not correspond to a visual clef notation. +/// +enum class ClefSign +{ + g = 0, + f = 1, + c = 2, + percussion = 3, + tab = 4, + jianpu = 5, + none = 6 +}; + +ClefSign parseClefSign(const std::string &value); +std::optional tryParseClefSign(const std::string &value); +std::string toString(const ClefSign value); +std::ostream &toStream(std::ostream &os, const ClefSign value); +std::ostream &operator<<(std::ostream &os, const ClefSign value); + +/// CssFontSize //////////////////////////////////////////////////////////////////////////// +/// +/// The css-font-size type includes the CSS font sizes used as an alternative to a numeric +/// point size. +/// +enum class CssFontSize +{ + xxSmall = 0, + xSmall = 1, + small = 2, + medium = 3, + large = 4, + xLarge = 5, + xxLarge = 6 +}; + +CssFontSize parseCssFontSize(const std::string &value); +std::optional tryParseCssFontSize(const std::string &value); +std::string toString(const CssFontSize value); +std::ostream &toStream(std::ostream &os, const CssFontSize value); +std::ostream &operator<<(std::ostream &os, const CssFontSize value); + +/// DegreeSymbolValue ////////////////////////////////////////////////////////////////////// +/// +/// The degree-symbol-value type indicates indicates that a symbol should be used in +/// specifying the degree. +/// +enum class DegreeSymbolValue +{ + major = 0, + minor = 1, + augmented = 2, + diminished = 3, + halfDiminished = 4 +}; + +DegreeSymbolValue parseDegreeSymbolValue(const std::string &value); +std::optional tryParseDegreeSymbolValue(const std::string &value); +std::string toString(const DegreeSymbolValue value); +std::ostream &toStream(std::ostream &os, const DegreeSymbolValue value); +std::ostream &operator<<(std::ostream &os, const DegreeSymbolValue value); + +/// DegreeTypeValue //////////////////////////////////////////////////////////////////////// +/// +/// The degree-type-value type indicates whether the current degree element is an addition, +/// alteration, or subtraction to the kind of the current chord in the harmony element. +/// +enum class DegreeTypeValue +{ + add = 0, + alter = 1, + subtract = 2 +}; + +DegreeTypeValue parseDegreeTypeValue(const std::string &value); +std::optional tryParseDegreeTypeValue(const std::string &value); +std::string toString(const DegreeTypeValue value); +std::ostream &toStream(std::ostream &os, const DegreeTypeValue value); +std::ostream &operator<<(std::ostream &os, const DegreeTypeValue value); + +/// DistanceTypeEnum /////////////////////////////////////////////////////////////////////// +/// +/// The distance-type defines what type of distance is being defined in a distance element. +/// Values include beam and hyphen. This is left as a string so that other application- +/// specific types can be defined, but it is made a separate type so that it can be +/// redefined more strictly. +/// +enum class DistanceTypeEnum +{ + beam = 0, + hyphen = 1, + other = 2 +}; + +DistanceTypeEnum parseDistanceTypeEnum(const std::string &value); +std::optional tryParseDistanceTypeEnum(const std::string &value); +std::string toString(const DistanceTypeEnum value); +std::ostream &toStream(std::ostream &os, const DistanceTypeEnum value); +std::ostream &operator<<(std::ostream &os, const DistanceTypeEnum value); + +class DistanceType +{ + public: + explicit DistanceType(const DistanceTypeEnum value); + explicit DistanceType(const std::string &value); + DistanceType(); + DistanceTypeEnum getValue() const; + std::string getValueString() const; + void setValue(const DistanceTypeEnum value); + void setValue(const std::string &value); + + private: + DistanceTypeEnum myEnum; + std::string myCustomValue; +}; + +DistanceType parseDistanceType(const std::string &value); +std::string toString(const DistanceType &value); +std::ostream &toStream(std::ostream &os, const DistanceType &value); +std::ostream &operator<<(std::ostream &os, const DistanceType &value); + +/// DynamicsEnum /////////////////////////////////////////////////////////////////////////// +/// +/// Dynamics can be associated either with a note or a general musical direction. To avoid +/// inconsistencies between and amongst the letter abbreviations for dynamics (what is sf +/// vs. sfz, standing alone or with a trailing dynamic that is not always piano), we use the +/// actual letters as the names of these dynamic elements. The other-dynamics element allows +/// other dynamic marks that are not covered here, but many of those should perhaps be +/// included in a more general musical direction element. Dynamics elements may also be +/// combined to create marks not covered by a single element, such as sfmp. +/// +/// These letter dynamic symbols are separated from crescendo, decrescendo, and wedge +/// indications. Dynamic representation is inconsistent in scores. Many things are assumed +/// by the composer and left out, such as returns to original dynamics. Systematic +/// representations are quite complex: for example, Humdrum has at least 3 representation +/// formats related to dynamics. The MusicXML format captures what is in the score, but does +/// not try to be optimal for analysis or synthesis of dynamics. +/// +enum class DynamicsEnum +{ + p = 0, + pp = 1, + ppp = 2, + pppp = 3, + ppppp = 4, + pppppp = 5, + f = 6, + ff = 7, + fff = 8, + ffff = 9, + fffff = 10, + ffffff = 11, + mp = 12, + mf = 13, + sf = 14, + sfp = 15, + sfpp = 16, + fp = 17, + rf = 18, + rfz = 19, + sfz = 20, + sffz = 21, + fz = 22, + otherDynamics = 23 +}; + +DynamicsEnum parseDynamicsEnum(const std::string &value); +std::optional tryParseDynamicsEnum(const std::string &value); +std::string toString(const DynamicsEnum value); +std::ostream &toStream(std::ostream &os, const DynamicsEnum value); +std::ostream &operator<<(std::ostream &os, const DynamicsEnum value); + +class DynamicsValue +{ + public: + explicit DynamicsValue(const DynamicsEnum value); + explicit DynamicsValue(const std::string &value); + DynamicsValue(); + DynamicsEnum getValue() const; + std::string getValueString() const; + void setValue(const DynamicsEnum value); + void setValue(const std::string &value); + + private: + DynamicsEnum myEnum; + std::string myCustomValue; +}; + +DynamicsValue parseDynamicsValue(const std::string &value); +std::string toString(const DynamicsValue &value); +std::ostream &toStream(std::ostream &os, const DynamicsValue &value); +std::ostream &operator<<(std::ostream &os, const DynamicsValue &value); + +/// EffectEnum ///////////////////////////////////////////////////////////////////////////// +/// +/// The effect type represents pictograms for sound effect percussion instruments. The +/// cannon value is in addition to Stone's list. +/// +enum class EffectEnum +{ + anvil = 0, + autoHorn = 1, + birdWhistle = 2, + cannon = 3, + duckCall = 4, + gunShot = 5, + klaxonHorn = 6, + lionsRoar = 7, + policeWhistle = 8, + siren = 9, + slideWhistle = 10, + thunderSheet = 11, + windMachine = 12, + windWhistle = 13 +}; + +EffectEnum parseEffectEnum(const std::string &value); +std::optional tryParseEffectEnum(const std::string &value); +std::string toString(const EffectEnum value); +std::ostream &toStream(std::ostream &os, const EffectEnum value); +std::ostream &operator<<(std::ostream &os, const EffectEnum value); + +/// EnclosureShape ///////////////////////////////////////////////////////////////////////// +/// +/// The enclosure-shape type describes the shape and presence / absence of an enclosure +/// around text or symbols. A bracket enclosure is similar to a rectangle with the bottom +/// line missing, as is common in jazz notation. +/// +enum class EnclosureShape +{ + rectangle = 0, + square = 1, + oval = 2, + circle = 3, + bracket = 4, + triangle = 5, + diamond = 6, + none = 7 +}; + +EnclosureShape parseEnclosureShape(const std::string &value); +std::optional tryParseEnclosureShape(const std::string &value); +std::string toString(const EnclosureShape value); +std::ostream &toStream(std::ostream &os, const EnclosureShape value); +std::ostream &operator<<(std::ostream &os, const EnclosureShape value); + +/// Fan //////////////////////////////////////////////////////////////////////////////////// +/// +/// The fan type represents the type of beam fanning present on a note, used to represent +/// accelerandos and ritardandos. +/// +enum class Fan +{ + accel = 0, + rit = 1, + none = 2 +}; + +Fan parseFan(const std::string &value); +std::optional tryParseFan(const std::string &value); +std::string toString(const Fan value); +std::ostream &toStream(std::ostream &os, const Fan value); +std::ostream &operator<<(std::ostream &os, const Fan value); + +/// FermataShape /////////////////////////////////////////////////////////////////////////// +/// +/// The fermata-shape type represents the shape of the fermata sign. The empty value is +/// equivalent to the normal value. +/// +enum class FermataShape +{ + normal = 0, + angled = 1, + square = 2, + emptystring = 3 +}; + +FermataShape parseFermataShape(const std::string &value); +std::optional tryParseFermataShape(const std::string &value); +std::string toString(const FermataShape value); +std::ostream &toStream(std::ostream &os, const FermataShape value); +std::ostream &operator<<(std::ostream &os, const FermataShape value); + +/// FontStyle ////////////////////////////////////////////////////////////////////////////// +/// +/// The font-style type represents a simplified version of the CSS font-style property. +/// +enum class FontStyle +{ + normal = 0, + italic = 1 +}; + +FontStyle parseFontStyle(const std::string &value); +std::optional tryParseFontStyle(const std::string &value); +std::string toString(const FontStyle value); +std::ostream &toStream(std::ostream &os, const FontStyle value); +std::ostream &operator<<(std::ostream &os, const FontStyle value); + +/// FontWeight ///////////////////////////////////////////////////////////////////////////// +/// +/// The font-weight type represents a simplified version of the CSS font-weight property. +/// +enum class FontWeight +{ + normal = 0, + bold = 1 +}; + +FontWeight parseFontWeight(const std::string &value); +std::optional tryParseFontWeight(const std::string &value); +std::string toString(const FontWeight value); +std::ostream &toStream(std::ostream &os, const FontWeight value); +std::ostream &operator<<(std::ostream &os, const FontWeight value); + +/// GlassEnum ////////////////////////////////////////////////////////////////////////////// +/// +/// The glass type represents pictograms for glass percussion instruments. +/// +enum class GlassEnum +{ + windChimes = 0 +}; + +GlassEnum parseGlassEnum(const std::string &value); +std::optional tryParseGlassEnum(const std::string &value); +std::string toString(const GlassEnum value); +std::ostream &toStream(std::ostream &os, const GlassEnum value); +std::ostream &operator<<(std::ostream &os, const GlassEnum value); + +/// GroupBarlineValue ////////////////////////////////////////////////////////////////////// +/// +/// The group-barline-value type indicates if the group should have common barlines. +/// +enum class GroupBarlineValue +{ + yes = 0, + no = 1, + mensurstrich = 2 +}; + +GroupBarlineValue parseGroupBarlineValue(const std::string &value); +std::optional tryParseGroupBarlineValue(const std::string &value); +std::string toString(const GroupBarlineValue value); +std::ostream &toStream(std::ostream &os, const GroupBarlineValue value); +std::ostream &operator<<(std::ostream &os, const GroupBarlineValue value); + +/// GroupSymbolValue /////////////////////////////////////////////////////////////////////// +/// +/// The group-symbol-value type indicates how the symbol for a group is indicated in the +/// score. The default value is none. +/// +enum class GroupSymbolValue +{ + none = 0, + brace = 1, + line = 2, + bracket = 3, + square = 4 +}; + +GroupSymbolValue parseGroupSymbolValue(const std::string &value); +std::optional tryParseGroupSymbolValue(const std::string &value); +std::string toString(const GroupSymbolValue value); +std::ostream &toStream(std::ostream &os, const GroupSymbolValue value); +std::ostream &operator<<(std::ostream &os, const GroupSymbolValue value); + +/// HandbellValue ////////////////////////////////////////////////////////////////////////// +/// +/// The handbell-value type represents the type of handbell technique being notated. +/// +enum class HandbellValue +{ + damp = 0, + echo = 1, + gyro = 2, + handMartellato = 3, + malletLift = 4, + malletTable = 5, + martellato = 6, + martellatoLift = 7, + mutedMartellato = 8, + pluckLift = 9, + swing = 10 +}; + +HandbellValue parseHandbellValue(const std::string &value); +std::optional tryParseHandbellValue(const std::string &value); +std::string toString(const HandbellValue value); +std::ostream &toStream(std::ostream &os, const HandbellValue value); +std::ostream &operator<<(std::ostream &os, const HandbellValue value); + +/// HarmonyType //////////////////////////////////////////////////////////////////////////// +/// +/// The harmony-type type differentiates different types of harmonies when alternate +/// harmonies are possible. Explicit harmonies have all note present in the music; implied +/// have some notes missing but implied; alternate represents alternate analyses. +/// +enum class HarmonyType +{ + explicit_ = 0, + implied = 1, + alternate = 2 +}; + +HarmonyType parseHarmonyType(const std::string &value); +std::optional tryParseHarmonyType(const std::string &value); +std::string toString(const HarmonyType value); +std::ostream &toStream(std::ostream &os, const HarmonyType value); +std::ostream &operator<<(std::ostream &os, const HarmonyType value); + +/// HoleClosedLocation ///////////////////////////////////////////////////////////////////// +/// +/// The hole-closed-location type indicates which portion of the hole is filled in when the +/// corresponding hole-closed-value is half. +/// +enum class HoleClosedLocation +{ + right = 0, + bottom = 1, + left = 2, + top = 3 +}; + +HoleClosedLocation parseHoleClosedLocation(const std::string &value); +std::optional tryParseHoleClosedLocation(const std::string &value); +std::string toString(const HoleClosedLocation value); +std::ostream &toStream(std::ostream &os, const HoleClosedLocation value); +std::ostream &operator<<(std::ostream &os, const HoleClosedLocation value); + +/// HoleClosedValue //////////////////////////////////////////////////////////////////////// +/// +/// The hole-closed-value type represents whether the hole is closed, open, or half-open. +/// +enum class HoleClosedValue +{ + yes = 0, + no = 1, + half = 2 +}; + +HoleClosedValue parseHoleClosedValue(const std::string &value); +std::optional tryParseHoleClosedValue(const std::string &value); +std::string toString(const HoleClosedValue value); +std::ostream &toStream(std::ostream &os, const HoleClosedValue value); +std::ostream &operator<<(std::ostream &os, const HoleClosedValue value); + +/// KindValue ////////////////////////////////////////////////////////////////////////////// +/// +/// A kind-value indicates the type of chord. Degree elements can then add, subtract, or +/// alter from these starting points. Values include: +/// +/// Triads: +/// major (major third, perfect fifth) +/// minor (minor third, perfect fifth) +/// augmented (major third, augmented fifth) +/// diminished (minor third, diminished fifth) +/// Sevenths: +/// dominant (major triad, minor seventh) +/// major-seventh (major triad, major seventh) +/// minor-seventh (minor triad, minor seventh) +/// diminished-seventh (diminished triad, diminished seventh) +/// augmented-seventh (augmented triad, minor seventh) +/// half-diminished (diminished triad, minor seventh) +/// major-minor (minor triad, major seventh) +/// Sixths: +/// major-sixth (major triad, added sixth) +/// minor-sixth (minor triad, added sixth) +/// Ninths: +/// dominant-ninth (dominant-seventh, major ninth) +/// major-ninth (major-seventh, major ninth) +/// minor-ninth (minor-seventh, major ninth) +/// 11ths (usually as the basis for alteration): +/// dominant-11th (dominant-ninth, perfect 11th) +/// major-11th (major-ninth, perfect 11th) +/// minor-11th (minor-ninth, perfect 11th) +/// 13ths (usually as the basis for alteration): +/// dominant-13th (dominant-11th, major 13th) +/// major-13th (major-11th, major 13th) +/// minor-13th (minor-11th, major 13th) +/// Suspended: +/// suspended-second (major second, perfect fifth) +/// suspended-fourth (perfect fourth, perfect fifth) +/// Functional sixths: +/// Neapolitan +/// Italian +/// French +/// German +/// Other: +/// pedal (pedal-point bass) +/// power (perfect fifth) +/// Tristan +/// +/// The "other" kind is used when the harmony is entirely composed of add elements. The +/// "none" kind is used to explicitly encode absence of chords or functional harmony. +/// +enum class KindValue +{ + major = 0, + minor = 1, + augmented = 2, + diminished = 3, + dominant = 4, + majorSeventh = 5, + minorSeventh = 6, + diminishedSeventh = 7, + augmentedSeventh = 8, + halfDiminished = 9, + majorMinor = 10, + majorSixth = 11, + minorSixth = 12, + dominantNinth = 13, + majorNinth = 14, + minorNinth = 15, + dominant11th = 16, + major11th = 17, + minor11th = 18, + dominant13th = 19, + major13th = 20, + minor13th = 21, + suspendedSecond = 22, + suspendedFourth = 23, + neapolitan = 24, + italian = 25, + french = 26, + german = 27, + pedal = 28, + power = 29, + tristan = 30, + other = 31, + none = 32 +}; + +KindValue parseKindValue(const std::string &value); +std::optional tryParseKindValue(const std::string &value); +std::string toString(const KindValue value); +std::ostream &toStream(std::ostream &os, const KindValue value); +std::ostream &operator<<(std::ostream &os, const KindValue value); + +/// LeftCenterRight //////////////////////////////////////////////////////////////////////// +/// +/// The left-center-right type is used to define horizontal alignment and text +/// justification. +/// +enum class LeftCenterRight +{ + left = 0, + center = 1, + right = 2 +}; + +LeftCenterRight parseLeftCenterRight(const std::string &value); +std::optional tryParseLeftCenterRight(const std::string &value); +std::string toString(const LeftCenterRight value); +std::ostream &toStream(std::ostream &os, const LeftCenterRight value); +std::ostream &operator<<(std::ostream &os, const LeftCenterRight value); + +/// LeftRight ////////////////////////////////////////////////////////////////////////////// +/// +/// The left-right type is used to indicate whether one element appears to the left or the +/// right of another element. +/// +enum class LeftRight +{ + left = 0, + right = 1 +}; + +LeftRight parseLeftRight(const std::string &value); +std::optional tryParseLeftRight(const std::string &value); +std::string toString(const LeftRight value); +std::ostream &toStream(std::ostream &os, const LeftRight value); +std::ostream &operator<<(std::ostream &os, const LeftRight value); + +/// LineEnd //////////////////////////////////////////////////////////////////////////////// +/// +/// The line-end type specifies if there is a jog up or down (or both), an arrow, or nothing +/// at the start or end of a bracket. +/// +enum class LineEnd +{ + up = 0, + down = 1, + both = 2, + arrow = 3, + none = 4 +}; + +LineEnd parseLineEnd(const std::string &value); +std::optional tryParseLineEnd(const std::string &value); +std::string toString(const LineEnd value); +std::ostream &toStream(std::ostream &os, const LineEnd value); +std::ostream &operator<<(std::ostream &os, const LineEnd value); + +/// LineShape ////////////////////////////////////////////////////////////////////////////// +/// +/// The line-shape type distinguishes between straight and curved lines. +/// +enum class LineShape +{ + straight = 0, + curved = 1 +}; + +LineShape parseLineShape(const std::string &value); +std::optional tryParseLineShape(const std::string &value); +std::string toString(const LineShape value); +std::ostream &toStream(std::ostream &os, const LineShape value); +std::ostream &operator<<(std::ostream &os, const LineShape value); + +/// LineType /////////////////////////////////////////////////////////////////////////////// +/// +/// The line-type type distinguishes between solid, dashed, dotted, and wavy lines. +/// +enum class LineType +{ + solid = 0, + dashed = 1, + dotted = 2, + wavy = 3 +}; + +LineType parseLineType(const std::string &value); +std::optional tryParseLineType(const std::string &value); +std::string toString(const LineType value); +std::ostream &toStream(std::ostream &os, const LineType value); +std::ostream &operator<<(std::ostream &os, const LineType value); + +/// LineWidthTypeEnum ////////////////////////////////////////////////////////////////////// +/// +/// The line-width-type defines what type of line is being defined in a line-width element. +/// Values include beam, bracket, dashes, enclosure, ending, extend, heavy barline, leger, +/// light barline, octave shift, pedal, slur middle, slur tip, staff, stem, tie middle, tie +/// tip, tuplet bracket, and wedge. This is left as a string so that other application- +/// specific types can be defined, but it is made a separate type so that it can be +/// redefined more strictly. +/// +enum class LineWidthTypeEnum +{ + beam = 0, + bracket = 1, + dashes = 2, + enclosure = 3, + ending = 4, + extend = 5, + heavyBarline = 6, + leger = 7, + lightBarline = 8, + octaveShift = 9, + pedal = 10, + slurMiddle = 11, + slurTip = 12, + staff = 13, + stem = 14, + tieMiddle = 15, + tieTip = 16, + tupletBracket = 17, + wedge = 18, + other = 19 +}; + +LineWidthTypeEnum parseLineWidthTypeEnum(const std::string &value); +std::optional tryParseLineWidthTypeEnum(const std::string &value); +std::string toString(const LineWidthTypeEnum value); +std::ostream &toStream(std::ostream &os, const LineWidthTypeEnum value); +std::ostream &operator<<(std::ostream &os, const LineWidthTypeEnum value); + +class LineWidthType +{ + public: + explicit LineWidthType(const LineWidthTypeEnum value); + explicit LineWidthType(const std::string &value); + LineWidthType(); + LineWidthTypeEnum getValue() const; + std::string getValueString() const; + void setValue(const LineWidthTypeEnum value); + void setValue(const std::string &value); + + private: + LineWidthTypeEnum myEnum; + std::string myCustomValue; +}; + +LineWidthType parseLineWidthType(const std::string &value); +std::string toString(const LineWidthType &value); +std::ostream &toStream(std::ostream &os, const LineWidthType &value); +std::ostream &operator<<(std::ostream &os, const LineWidthType &value); + +/// MarginType ///////////////////////////////////////////////////////////////////////////// +/// +/// The margin-type type specifies whether margins apply to even page, odd pages, or both. +/// +enum class MarginType +{ + odd = 0, + even = 1, + both = 2 +}; + +MarginType parseMarginType(const std::string &value); +std::optional tryParseMarginType(const std::string &value); +std::string toString(const MarginType value); +std::ostream &toStream(std::ostream &os, const MarginType value); +std::ostream &operator<<(std::ostream &os, const MarginType value); + +/// MeasureNumberingValue ////////////////////////////////////////////////////////////////// +/// +/// The measure-numbering-value type describes how measure numbers are displayed on this +/// part: no numbers, numbers every measure, or numbers every system. +/// +enum class MeasureNumberingValue +{ + none = 0, + measure = 1, + system = 2 +}; + +MeasureNumberingValue parseMeasureNumberingValue(const std::string &value); +std::optional tryParseMeasureNumberingValue(const std::string &value); +std::string toString(const MeasureNumberingValue value); +std::ostream &toStream(std::ostream &os, const MeasureNumberingValue value); +std::ostream &operator<<(std::ostream &os, const MeasureNumberingValue value); + +/// MembraneEnum /////////////////////////////////////////////////////////////////////////// +/// +/// The membrane type represents pictograms for membrane percussion instruments. The goblet +/// drum value is in addition to Stone's list. +/// +enum class MembraneEnum +{ + bassDrum = 0, + bassDrumOnSide = 1, + bongos = 2, + congaDrum = 3, + gobletDrum = 4, + militaryDrum = 5, + snareDrum = 6, + snareDrumSnaresOff = 7, + tambourine = 8, + tenorDrum = 9, + timbales = 10, + tomtom = 11 +}; + +MembraneEnum parseMembraneEnum(const std::string &value); +std::optional tryParseMembraneEnum(const std::string &value); +std::string toString(const MembraneEnum value); +std::ostream &toStream(std::ostream &os, const MembraneEnum value); +std::ostream &operator<<(std::ostream &os, const MembraneEnum value); + +/// MetalEnum ////////////////////////////////////////////////////////////////////////////// +/// +/// The metal type represents pictograms for metal percussion instruments. The hi-hat value +/// refers to a pictogram like Stone's high-hat cymbals but without the long vertical line +/// at the bottom. +/// +enum class MetalEnum +{ + almglocken = 0, + bell = 1, + bellPlate = 2, + brakeDrum = 3, + chineseCymbal = 4, + cowbell = 5, + crashCymbals = 6, + crotale = 7, + cymbalTongs = 8, + domedGong = 9, + fingerCymbals = 10, + flexatone = 11, + gong = 12, + hiHat = 13, + highHatCymbals = 14, + handbell = 15, + sistrum = 16, + sizzleCymbal = 17, + sleighBells = 18, + suspendedCymbal = 19, + tamTam = 20, + triangle = 21, + vietnameseHat = 22 +}; + +MetalEnum parseMetalEnum(const std::string &value); +std::optional tryParseMetalEnum(const std::string &value); +std::string toString(const MetalEnum value); +std::ostream &toStream(std::ostream &os, const MetalEnum value); +std::ostream &operator<<(std::ostream &os, const MetalEnum value); + +/// ModeEnum /////////////////////////////////////////////////////////////////////////////// +/// +/// The mode type is used to specify major/minor and other mode distinctions. Valid mode +/// values include major, minor, dorian, phrygian, lydian, mixolydian, aeolian, ionian, +/// locrian, and none. +/// +enum class ModeEnum +{ + major = 0, + minor = 1, + dorian = 2, + phrygian = 3, + lydian = 4, + mixolydian = 5, + aeolian = 6, + ionian = 7, + locrian = 8, + none = 9, + other = 10 +}; + +ModeEnum parseModeEnum(const std::string &value); +std::optional tryParseModeEnum(const std::string &value); +std::string toString(const ModeEnum value); +std::ostream &toStream(std::ostream &os, const ModeEnum value); +std::ostream &operator<<(std::ostream &os, const ModeEnum value); + +class ModeValue +{ + public: + explicit ModeValue(const ModeEnum value); + explicit ModeValue(const std::string &value); + ModeValue(); + ModeEnum getValue() const; + std::string getValueString() const; + void setValue(const ModeEnum value); + void setValue(const std::string &value); + + private: + ModeEnum myEnum; + std::string myCustomValue; +}; + +ModeValue parseModeValue(const std::string &value); +std::string toString(const ModeValue &value); +std::ostream &toStream(std::ostream &os, const ModeValue &value); +std::ostream &operator<<(std::ostream &os, const ModeValue &value); + +/// MuteEnum /////////////////////////////////////////////////////////////////////////////// +/// +/// The mute type represents muting for different instruments, including brass, winds, and +/// strings. The on and off values are used for undifferentiated mutes. The remaining values +/// represent specific mutes. +/// +enum class MuteEnum +{ + on = 0, + off = 1, + straight = 2, + cup = 3, + harmonNoStem = 4, + harmonStem = 5, + bucket = 6, + plunger = 7, + hat = 8, + solotone = 9, + practice = 10, + stopMute = 11, + stopHand = 12, + echo = 13, + palm = 14 +}; + +MuteEnum parseMuteEnum(const std::string &value); +std::optional tryParseMuteEnum(const std::string &value); +std::string toString(const MuteEnum value); +std::ostream &toStream(std::ostream &os, const MuteEnum value); +std::ostream &operator<<(std::ostream &os, const MuteEnum value); + +/// NoteSizeType /////////////////////////////////////////////////////////////////////////// +/// +/// The note-size-type type indicates the type of note being defined by a note-size element. +/// The grace type is used for notes of cue size that that include a grace element. The cue +/// type is used for all other notes with cue size, whether defined explicitly or implicitly +/// via a cue element. The large type is used for notes of large size. +/// +enum class NoteSizeType +{ + cue = 0, + grace = 1, + large = 2 +}; + +NoteSizeType parseNoteSizeType(const std::string &value); +std::optional tryParseNoteSizeType(const std::string &value); +std::string toString(const NoteSizeType value); +std::ostream &toStream(std::ostream &os, const NoteSizeType value); +std::ostream &operator<<(std::ostream &os, const NoteSizeType value); + +/// NoteTypeValue ////////////////////////////////////////////////////////////////////////// +/// +/// The note-type type is used for the MusicXML type element and represents the graphic note +/// type, from 1024th (shortest) to maxima (longest). +/// +enum class NoteTypeValue +{ + oneThousandTwentyFourth = 0, + fiveHundredTwelfth = 1, + twoHundredFifthySixth = 2, + oneHundredTwentyEighth = 3, + sixtyFourth = 4, + thirtySecond = 5, + sixteenth = 6, + eighth = 7, + quarter = 8, + half = 9, + whole = 10, + breve = 11, + long_ = 12, + maxima = 13 +}; + +NoteTypeValue parseNoteTypeValue(const std::string &value); +std::optional tryParseNoteTypeValue(const std::string &value); +std::string toString(const NoteTypeValue value); +std::ostream &toStream(std::ostream &os, const NoteTypeValue value); +std::ostream &operator<<(std::ostream &os, const NoteTypeValue value); + +/// NoteheadValue ////////////////////////////////////////////////////////////////////////// +/// +/// The notehead type indicates shapes other than the open and closed ovals associated with +/// note durations. The values do, re, mi, fa, fa up, so, la, and ti correspond to Aikin's +/// 7-shape system. The fa up shape is typically used with upstems; the fa shape is +/// typically used with downstems or no stems. +/// +/// The arrow shapes differ from triangle and inverted triangle by being centered on the +/// stem. Slashed and back slashed notes include both the normal notehead and a slash. The +/// triangle shape has the tip of the triangle pointing up; the inverted triangle shape has +/// the tip of the triangle pointing down. The left triangle shape is a right triangle with +/// the hypotenuse facing up and to the left. +/// +enum class NoteheadValue +{ + slash = 0, + triangle = 1, + diamond = 2, + square = 3, + cross = 4, + x = 5, + circleX = 6, + invertedTriangle = 7, + arrowDown = 8, + arrowUp = 9, + slashed = 10, + backSlashed = 11, + normal = 12, + cluster = 13, + circleDot = 14, + leftTriangle = 15, + rectangle = 16, + none = 17, + do_ = 18, + re = 19, + mi = 20, + fa = 21, + faUp = 22, + so = 23, + la = 24, + ti = 25 +}; + +NoteheadValue parseNoteheadValue(const std::string &value); +std::optional tryParseNoteheadValue(const std::string &value); +std::string toString(const NoteheadValue value); +std::ostream &toStream(std::ostream &os, const NoteheadValue value); +std::ostream &operator<<(std::ostream &os, const NoteheadValue value); + +/// OnOff ////////////////////////////////////////////////////////////////////////////////// +/// +/// The on-off type is used for notation elements such as string mutes. +/// +enum class OnOff +{ + on = 0, + off = 1 +}; + +OnOff parseOnOff(const std::string &value); +std::optional tryParseOnOff(const std::string &value); +std::string toString(const OnOff value); +std::ostream &toStream(std::ostream &os, const OnOff value); +std::ostream &operator<<(std::ostream &os, const OnOff value); + +/// OverUnder ////////////////////////////////////////////////////////////////////////////// +/// +/// The over-under type is used to indicate whether the tips of curved lines such as slurs +/// and ties are overhand (tips down) or underhand (tips up). +/// +enum class OverUnder +{ + over = 0, + under = 1 +}; + +OverUnder parseOverUnder(const std::string &value); +std::optional tryParseOverUnder(const std::string &value); +std::string toString(const OverUnder value); +std::ostream &toStream(std::ostream &os, const OverUnder value); +std::ostream &operator<<(std::ostream &os, const OverUnder value); + +/// PitchedEnum //////////////////////////////////////////////////////////////////////////// +/// +/// The pitched type represents pictograms for pitched percussion instruments. The chimes +/// and tubular chimes values distinguish the single-line and double-line versions of the +/// pictogram. The mallet value is in addition to Stone's list. +/// +enum class PitchedEnum +{ + chimes = 0, + glockenspiel = 1, + mallet = 2, + marimba = 3, + tubularChimes = 4, + vibraphone = 5, + xylophone = 6 +}; + +PitchedEnum parsePitchedEnum(const std::string &value); +std::optional tryParsePitchedEnum(const std::string &value); +std::string toString(const PitchedEnum value); +std::ostream &toStream(std::ostream &os, const PitchedEnum value); +std::ostream &operator<<(std::ostream &os, const PitchedEnum value); + +/// PrincipalVoiceSymbol /////////////////////////////////////////////////////////////////// +/// +/// The principal-voice-symbol type represents the type of symbol used to indicate the start +/// of a principal or secondary voice. The "plain" value represents a plain square bracket. +/// The value of "none" is used for analysis markup when the principal-voice element does +/// not have a corresponding appearance in the score. +/// +enum class PrincipalVoiceSymbol +{ + hauptstimme = 0, + nebenstimme = 1, + plain = 2, + none = 3 +}; + +PrincipalVoiceSymbol parsePrincipalVoiceSymbol(const std::string &value); +std::optional tryParsePrincipalVoiceSymbol(const std::string &value); +std::string toString(const PrincipalVoiceSymbol value); +std::ostream &toStream(std::ostream &os, const PrincipalVoiceSymbol value); +std::ostream &operator<<(std::ostream &os, const PrincipalVoiceSymbol value); + +/// RightLeftMiddle //////////////////////////////////////////////////////////////////////// +/// +/// The right-left-middle type is used to specify barline location. +/// +enum class RightLeftMiddle +{ + right = 0, + left = 1, + middle = 2 +}; + +RightLeftMiddle parseRightLeftMiddle(const std::string &value); +std::optional tryParseRightLeftMiddle(const std::string &value); +std::string toString(const RightLeftMiddle value); +std::ostream &toStream(std::ostream &os, const RightLeftMiddle value); +std::ostream &operator<<(std::ostream &os, const RightLeftMiddle value); + +/// SemiPitchedEnum //////////////////////////////////////////////////////////////////////// +/// +/// The semi-pitched type represents categories of indefinite pitch for percussion +/// instruments. +/// +enum class SemiPitchedEnum +{ + high = 0, + mediumHigh = 1, + medium = 2, + mediumLow = 3, + low = 4, + veryLow = 5 +}; + +SemiPitchedEnum parseSemiPitchedEnum(const std::string &value); +std::optional tryParseSemiPitchedEnum(const std::string &value); +std::string toString(const SemiPitchedEnum value); +std::ostream &toStream(std::ostream &os, const SemiPitchedEnum value); +std::ostream &operator<<(std::ostream &os, const SemiPitchedEnum value); + +/// ShowFrets ////////////////////////////////////////////////////////////////////////////// +/// +/// The show-frets type indicates whether to show tablature frets as numbers (0, 1, 2) or +/// letters (a, b, c). The default choice is numbers. +/// +enum class ShowFrets +{ + numbers = 0, + letters = 1 +}; + +ShowFrets parseShowFrets(const std::string &value); +std::optional tryParseShowFrets(const std::string &value); +std::string toString(const ShowFrets value); +std::ostream &toStream(std::ostream &os, const ShowFrets value); +std::ostream &operator<<(std::ostream &os, const ShowFrets value); + +/// ShowTuplet ///////////////////////////////////////////////////////////////////////////// +/// +/// The show-tuplet type indicates whether to show a part of a tuplet relating to the +/// tuplet-actual element, both the tuplet-actual and tuplet-normal elements, or neither. +/// +enum class ShowTuplet +{ + actual = 0, + both = 1, + none = 2 +}; + +ShowTuplet parseShowTuplet(const std::string &value); +std::optional tryParseShowTuplet(const std::string &value); +std::string toString(const ShowTuplet value); +std::ostream &toStream(std::ostream &os, const ShowTuplet value); +std::ostream &operator<<(std::ostream &os, const ShowTuplet value); + +/// StaffTypeEnum ////////////////////////////////////////////////////////////////////////// +/// +/// The staff-type value can be ossia, cue, editorial, regular, or alternate. An alternate +/// staff indicates one that shares the same musical data as the prior staff, but displayed +/// differently (e.g., treble and bass clef, standard notation and tab). +/// +enum class StaffTypeEnum +{ + ossia = 0, + cue = 1, + editorial = 2, + regular = 3, + alternate = 4 +}; + +StaffTypeEnum parseStaffTypeEnum(const std::string &value); +std::optional tryParseStaffTypeEnum(const std::string &value); +std::string toString(const StaffTypeEnum value); +std::ostream &toStream(std::ostream &os, const StaffTypeEnum value); +std::ostream &operator<<(std::ostream &os, const StaffTypeEnum value); + +/// StartNote ////////////////////////////////////////////////////////////////////////////// +/// +/// The start-note type describes the starting note of trills and mordents for playback, +/// relative to the current note. +/// +enum class StartNote +{ + upper = 0, + main = 1, + below = 2 +}; + +StartNote parseStartNote(const std::string &value); +std::optional tryParseStartNote(const std::string &value); +std::string toString(const StartNote value); +std::ostream &toStream(std::ostream &os, const StartNote value); +std::ostream &operator<<(std::ostream &os, const StartNote value); + +/// StartStop ////////////////////////////////////////////////////////////////////////////// +/// +/// The start-stop type is used for an attribute of musical elements that can either start +/// or stop, such as tuplets. +/// +/// The values of start and stop refer to how an element appears in musical score order, not +/// in MusicXML document order. An element with a stop attribute may precede the +/// corresponding element with a start attribute within a MusicXML document. This is +/// particularly common in multi-staff music. For example, the stopping point for a tuplet +/// may appear in staff 1 before the starting point for the tuplet appears in staff 2 later +/// in the document. +/// +enum class StartStop +{ + start = 0, + stop = 1 +}; + +StartStop parseStartStop(const std::string &value); +std::optional tryParseStartStop(const std::string &value); +std::string toString(const StartStop value); +std::ostream &toStream(std::ostream &os, const StartStop value); +std::ostream &operator<<(std::ostream &os, const StartStop value); + +/// StartStopChangeContinue //////////////////////////////////////////////////////////////// +/// +/// The start-stop-change-continue type is used to distinguish types of pedal directions. +/// +enum class StartStopChangeContinue +{ + start = 0, + stop = 1, + change = 2, + continue_ = 3 +}; + +StartStopChangeContinue parseStartStopChangeContinue(const std::string &value); +std::optional tryParseStartStopChangeContinue(const std::string &value); +std::string toString(const StartStopChangeContinue value); +std::ostream &toStream(std::ostream &os, const StartStopChangeContinue value); +std::ostream &operator<<(std::ostream &os, const StartStopChangeContinue value); + +/// StartStopContinue ////////////////////////////////////////////////////////////////////// +/// +/// The start-stop-continue type is used for an attribute of musical elements that can +/// either start or stop, but also need to refer to an intermediate point in the symbol, as +/// for complex slurs or for formatting of symbols across system breaks. +/// +/// The values of start, stop, and continue refer to how an element appears in musical score +/// order, not in MusicXML document order. An element with a stop attribute may precede the +/// corresponding element with a start attribute within a MusicXML document. This is +/// particularly common in multi-staff music. For example, the stopping point for a slur may +/// appear in staff 1 before the starting point for the slur appears in staff 2 later in the +/// document. +/// +enum class StartStopContinue +{ + start = 0, + stop = 1, + continue_ = 2 +}; + +StartStopContinue parseStartStopContinue(const std::string &value); +std::optional tryParseStartStopContinue(const std::string &value); +std::string toString(const StartStopContinue value); +std::ostream &toStream(std::ostream &os, const StartStopContinue value); +std::ostream &operator<<(std::ostream &os, const StartStopContinue value); + +/// StartStopDiscontinue /////////////////////////////////////////////////////////////////// +/// +/// The start-stop-discontinue type is used to specify ending types. Typically, the start +/// type is associated with the left barline of the first measure in an ending. The stop and +/// discontinue types are associated with the right barline of the last measure in an +/// ending. Stop is used when the ending mark concludes with a downward jog, as is typical +/// for first endings. Discontinue is used when there is no downward jog, as is typical for +/// second endings that do not conclude a piece. +/// +enum class StartStopDiscontinue +{ + start = 0, + stop = 1, + discontinue = 2 +}; + +StartStopDiscontinue parseStartStopDiscontinue(const std::string &value); +std::optional tryParseStartStopDiscontinue(const std::string &value); +std::string toString(const StartStopDiscontinue value); +std::ostream &toStream(std::ostream &os, const StartStopDiscontinue value); +std::ostream &operator<<(std::ostream &os, const StartStopDiscontinue value); + +/// StartStopSingle //////////////////////////////////////////////////////////////////////// +/// +/// The start-stop-single type is used for an attribute of musical elements that can be used +/// for either multi-note or single-note musical elements, as for tremolos. +/// +enum class StartStopSingle +{ + start = 0, + stop = 1, + single = 2 +}; + +StartStopSingle parseStartStopSingle(const std::string &value); +std::optional tryParseStartStopSingle(const std::string &value); +std::string toString(const StartStopSingle value); +std::ostream &toStream(std::ostream &os, const StartStopSingle value); +std::ostream &operator<<(std::ostream &os, const StartStopSingle value); + +/// StemValue ////////////////////////////////////////////////////////////////////////////// +/// +/// The stem type represents the notated stem direction. +/// +enum class StemValue +{ + down = 0, + up = 1, + double_ = 2, + none = 3 +}; + +StemValue parseStemValue(const std::string &value); +std::optional tryParseStemValue(const std::string &value); +std::string toString(const StemValue value); +std::ostream &toStream(std::ostream &os, const StemValue value); +std::ostream &operator<<(std::ostream &os, const StemValue value); + +/// StepEnum /////////////////////////////////////////////////////////////////////////////// +/// +/// The step type represents a step of the diatonic scale, represented using the English +/// letters A through G. +/// +enum class StepEnum +{ + a = 0, + b = 1, + c = 2, + d = 3, + e = 4, + f = 5, + g = 6 +}; + +StepEnum parseStepEnum(const std::string &value); +std::optional tryParseStepEnum(const std::string &value); +std::string toString(const StepEnum value); +std::ostream &toStream(std::ostream &os, const StepEnum value); +std::ostream &operator<<(std::ostream &os, const StepEnum value); + +/// StickLocationEnum ////////////////////////////////////////////////////////////////////// +/// +/// The stick-location type represents pictograms for the location of sticks, beaters, or +/// mallets on cymbals, gongs, drums, and other instruments. +/// +enum class StickLocationEnum +{ + center = 0, + rim = 1, + cymbalBell = 2, + cymbalEdge = 3 +}; + +StickLocationEnum parseStickLocationEnum(const std::string &value); +std::optional tryParseStickLocationEnum(const std::string &value); +std::string toString(const StickLocationEnum value); +std::ostream &toStream(std::ostream &os, const StickLocationEnum value); +std::ostream &operator<<(std::ostream &os, const StickLocationEnum value); + +/// StickMaterialEnum ////////////////////////////////////////////////////////////////////// +/// +/// The stick-material type represents the material being displayed in a stick pictogram. +/// +enum class StickMaterialEnum +{ + soft = 0, + medium = 1, + hard = 2, + shaded = 3, + x = 4 +}; + +StickMaterialEnum parseStickMaterialEnum(const std::string &value); +std::optional tryParseStickMaterialEnum(const std::string &value); +std::string toString(const StickMaterialEnum value); +std::ostream &toStream(std::ostream &os, const StickMaterialEnum value); +std::ostream &operator<<(std::ostream &os, const StickMaterialEnum value); + +/// StickTypeEnum ////////////////////////////////////////////////////////////////////////// +/// +/// The stick-type type represents the shape of pictograms where the material +/// in the stick, mallet, or beater is represented in the pictogram. +/// +enum class StickTypeEnum +{ + bassDrum = 0, + doubleBassDrum = 1, + timpani = 2, + xylophone = 3, + yarn = 4 +}; + +StickTypeEnum parseStickTypeEnum(const std::string &value); +std::optional tryParseStickTypeEnum(const std::string &value); +std::string toString(const StickTypeEnum value); +std::ostream &toStream(std::ostream &os, const StickTypeEnum value); +std::ostream &operator<<(std::ostream &os, const StickTypeEnum value); + +/// SyllabicEnum /////////////////////////////////////////////////////////////////////////// +/// +/// Lyric hyphenation is indicated by the syllabic type. The single, begin, end, and middle +/// values represent single-syllable words, word-beginning syllables, word-ending syllables, +/// and mid-word syllables, respectively. +/// +enum class SyllabicEnum +{ + single = 0, + begin = 1, + end = 2, + middle = 3 +}; + +SyllabicEnum parseSyllabicEnum(const std::string &value); +std::optional tryParseSyllabicEnum(const std::string &value); +std::string toString(const SyllabicEnum value); +std::ostream &toStream(std::ostream &os, const SyllabicEnum value); +std::ostream &operator<<(std::ostream &os, const SyllabicEnum value); + +/// SymbolSize ///////////////////////////////////////////////////////////////////////////// +/// +/// The symbol-size type is used to indicate full vs. cue-sized vs. oversized symbols. The +/// large value for oversized symbols was added in version 1.1. +/// +enum class SymbolSize +{ + full = 0, + cue = 1, + large = 2 +}; + +SymbolSize parseSymbolSize(const std::string &value); +std::optional tryParseSymbolSize(const std::string &value); +std::string toString(const SymbolSize value); +std::ostream &toStream(std::ostream &os, const SymbolSize value); +std::ostream &operator<<(std::ostream &os, const SymbolSize value); + +/// TextDirection ////////////////////////////////////////////////////////////////////////// +/// +/// The text-direction type is used to adjust and override the Unicode bidirectional text +/// algorithm, similar to the W3C Internationalization Tag Set recommendation. Values are +/// ltr (left-to-right embed), rtl (right-to-left embed), lro (left-to-right bidi-override), +/// and rlo (right-to-left bidi-override). The default value is ltr. This type is typically +/// used by applications that store text in left-to-right visual order rather than logical +/// order. Such applications can use the lro value to better communicate with other +/// applications that more fully support bidirectional text. +/// +enum class TextDirection +{ + ltr = 0, + rtl = 1, + lro = 2, + rlo = 3 +}; + +TextDirection parseTextDirection(const std::string &value); +std::optional tryParseTextDirection(const std::string &value); +std::string toString(const TextDirection value); +std::ostream &toStream(std::ostream &os, const TextDirection value); +std::ostream &operator<<(std::ostream &os, const TextDirection value); + +/// TimeRelationEnum /////////////////////////////////////////////////////////////////////// +/// +/// The time-relation type indicates the symbol used to represent the interchangeable aspect +/// of dual time signatures. +/// +enum class TimeRelationEnum +{ + parentheses = 0, + bracket = 1, + equals = 2, + slash = 3, + space = 4, + hyphen = 5 +}; + +TimeRelationEnum parseTimeRelationEnum(const std::string &value); +std::optional tryParseTimeRelationEnum(const std::string &value); +std::string toString(const TimeRelationEnum value); +std::ostream &toStream(std::ostream &os, const TimeRelationEnum value); +std::ostream &operator<<(std::ostream &os, const TimeRelationEnum value); + +/// TimeSeparator ////////////////////////////////////////////////////////////////////////// +/// +/// The time-separator type indicates how to display the arrangement between the beats and +/// beat-type values in a time signature. The default value is none. The horizontal, +/// diagonal, and vertical values represent horizontal, diagonal lower-left to upper-right, +/// and vertical lines respectively. For these values, the beats and beat-type values are +/// arranged on either side of the separator line. The none value represents no separator +/// with the beats and beat-type arranged vertically. The adjacent value represents no +/// separator with the beats and beat-type arranged horizontally. +/// +enum class TimeSeparator +{ + none = 0, + horizontal = 1, + diagonal = 2, + vertical = 3, + adjacent = 4 +}; + +TimeSeparator parseTimeSeparator(const std::string &value); +std::optional tryParseTimeSeparator(const std::string &value); +std::string toString(const TimeSeparator value); +std::ostream &toStream(std::ostream &os, const TimeSeparator value); +std::ostream &operator<<(std::ostream &os, const TimeSeparator value); + +/// TimeSymbol ///////////////////////////////////////////////////////////////////////////// +/// +/// The time-symbol type indicates how to display a time signature. The normal value is the +/// usual fractional display, and is the implied symbol type if none is specified. Other +/// options are the common and cut time symbols, as well as a single number with an implied +/// denominator. The note symbol indicates that the beat-type should be represented with the +/// corresponding downstem note rather than a number. The dotted-note symbol indicates that +/// the beat-type should be represented with a dotted downstem note that corresponds to +/// three times the beat-type value, and a numerator that is one third the beats value. +/// +enum class TimeSymbol +{ + common = 0, + cut = 1, + singleNumber = 2, + note = 3, + dottedNote = 4, + normal = 5 +}; + +TimeSymbol parseTimeSymbol(const std::string &value); +std::optional tryParseTimeSymbol(const std::string &value); +std::string toString(const TimeSymbol value); +std::ostream &toStream(std::ostream &os, const TimeSymbol value); +std::ostream &operator<<(std::ostream &os, const TimeSymbol value); + +/// TipDirection /////////////////////////////////////////////////////////////////////////// +/// +/// The tip-direction type represents the direction in which the tip of a stick or beater +/// points, using Unicode arrow terminology. +/// +enum class TipDirection +{ + up = 0, + down = 1, + left = 2, + right = 3, + northwest = 4, + northeast = 5, + southeast = 6, + southwest = 7 +}; + +TipDirection parseTipDirection(const std::string &value); +std::optional tryParseTipDirection(const std::string &value); +std::string toString(const TipDirection value); +std::ostream &toStream(std::ostream &os, const TipDirection value); +std::ostream &operator<<(std::ostream &os, const TipDirection value); + +/// TopBottom ////////////////////////////////////////////////////////////////////////////// +/// +/// The top-bottom type is used to indicate the top or bottom part of a vertical shape like +/// non-arpeggiate. +/// +enum class TopBottom +{ + top = 0, + bottom = 1 +}; + +TopBottom parseTopBottom(const std::string &value); +std::optional tryParseTopBottom(const std::string &value); +std::string toString(const TopBottom value); +std::ostream &toStream(std::ostream &os, const TopBottom value); +std::ostream &operator<<(std::ostream &os, const TopBottom value); + +/// TrillStep ////////////////////////////////////////////////////////////////////////////// +/// +/// The trill-step type describes the alternating note of trills and mordents for playback, +/// relative to the current note. +/// +enum class TrillStep +{ + whole = 0, + half = 1, + unison = 2 +}; + +TrillStep parseTrillStep(const std::string &value); +std::optional tryParseTrillStep(const std::string &value); +std::string toString(const TrillStep value); +std::ostream &toStream(std::ostream &os, const TrillStep value); +std::ostream &operator<<(std::ostream &os, const TrillStep value); + +/// TwoNoteTurn //////////////////////////////////////////////////////////////////////////// +/// +/// The two-note-turn type describes the ending notes of trills and mordents for playback, +/// relative to the current note. +/// +enum class TwoNoteTurn +{ + whole = 0, + half = 1, + none = 2 +}; + +TwoNoteTurn parseTwoNoteTurn(const std::string &value); +std::optional tryParseTwoNoteTurn(const std::string &value); +std::string toString(const TwoNoteTurn value); +std::ostream &toStream(std::ostream &os, const TwoNoteTurn value); +std::ostream &operator<<(std::ostream &os, const TwoNoteTurn value); + +/// UpDown ///////////////////////////////////////////////////////////////////////////////// +/// +/// The up-down type is used for the direction of arrows and other pointed symbols like +/// vertical accents, indicating which way the tip is pointing. +/// +enum class UpDown +{ + up = 0, + down = 1 +}; + +UpDown parseUpDown(const std::string &value); +std::optional tryParseUpDown(const std::string &value); +std::string toString(const UpDown value); +std::ostream &toStream(std::ostream &os, const UpDown value); +std::ostream &operator<<(std::ostream &os, const UpDown value); + +/// UpDownStopContinue ///////////////////////////////////////////////////////////////////// +/// +/// The up-down-stop-continue type is used for octave-shift elements, indicating the +/// direction of the shift from their true pitched values because of printing difficulty. +/// +enum class UpDownStopContinue +{ + up = 0, + down = 1, + stop = 2, + continue_ = 3 +}; + +UpDownStopContinue parseUpDownStopContinue(const std::string &value); +std::optional tryParseUpDownStopContinue(const std::string &value); +std::string toString(const UpDownStopContinue value); +std::ostream &toStream(std::ostream &os, const UpDownStopContinue value); +std::ostream &operator<<(std::ostream &os, const UpDownStopContinue value); + +/// UprightInverted //////////////////////////////////////////////////////////////////////// +/// +/// The upright-inverted type describes the appearance of a fermata element. The value is +/// upright if not specified. +/// +enum class UprightInverted +{ + upright = 0, + inverted = 1 +}; + +UprightInverted parseUprightInverted(const std::string &value); +std::optional tryParseUprightInverted(const std::string &value); +std::string toString(const UprightInverted value); +std::ostream &toStream(std::ostream &os, const UprightInverted value); +std::ostream &operator<<(std::ostream &os, const UprightInverted value); + +/// Valign ///////////////////////////////////////////////////////////////////////////////// +/// +/// The valign type is used to indicate vertical alignment to the top, middle, bottom, or +/// baseline of the text. Defaults are implementation-dependent. +/// +enum class Valign +{ + top = 0, + middle = 1, + bottom = 2, + baseline = 3 +}; + +Valign parseValign(const std::string &value); +std::optional tryParseValign(const std::string &value); +std::string toString(const Valign value); +std::ostream &toStream(std::ostream &os, const Valign value); +std::ostream &operator<<(std::ostream &os, const Valign value); + +/// ValignImage //////////////////////////////////////////////////////////////////////////// +/// +/// The valign-image type is used to indicate vertical alignment for images and graphics, so +/// it does not include a baseline value. Defaults are implementation-dependent. +/// +enum class ValignImage +{ + top = 0, + middle = 1, + bottom = 2 +}; + +ValignImage parseValignImage(const std::string &value); +std::optional tryParseValignImage(const std::string &value); +std::string toString(const ValignImage value); +std::ostream &toStream(std::ostream &os, const ValignImage value); +std::ostream &operator<<(std::ostream &os, const ValignImage value); + +/// WedgeType ////////////////////////////////////////////////////////////////////////////// +/// +/// The wedge type is crescendo for the start of a wedge that is closed at the left side, +/// diminuendo for the start of a wedge that is closed on the right side, and stop for the +/// end of a wedge. The continue type is used for formatting wedges over a system break, or +/// for other situations where a single wedge is divided into multiple segments. +/// +enum class WedgeType +{ + crescendo = 0, + diminuendo = 1, + stop = 2, + continue_ = 3 +}; + +WedgeType parseWedgeType(const std::string &value); +std::optional tryParseWedgeType(const std::string &value); +std::string toString(const WedgeType value); +std::ostream &toStream(std::ostream &os, const WedgeType value); +std::ostream &operator<<(std::ostream &os, const WedgeType value); + +/// Winged ///////////////////////////////////////////////////////////////////////////////// +/// +/// The winged attribute indicates whether the repeat has winged extensions that appear +/// above and below the barline. The straight and curved values represent single wings, +/// while the double-straight and double-curved values represent double wings. The none +/// value indicates no wings and is the default. +/// +enum class Winged +{ + none = 0, + straight = 1, + curved = 2, + doubleStraight = 3, + doubleCurved = 4 +}; + +Winged parseWinged(const std::string &value); +std::optional tryParseWinged(const std::string &value); +std::string toString(const Winged value); +std::ostream &toStream(std::ostream &os, const Winged value); +std::ostream &operator<<(std::ostream &os, const Winged value); + +/// WoodEnum /////////////////////////////////////////////////////////////////////////////// +/// +/// The wood type represents pictograms for wood percussion instruments. The maraca and +/// maracas values distinguish the one- and two-maraca versions of the pictogram. The +/// vibraslap and castanets values are in addition to Stone's list. +/// +enum class WoodEnum +{ + boardClapper = 0, + cabasa = 1, + castanets = 2, + claves = 3, + guiro = 4, + logDrum = 5, + maraca = 6, + maracas = 7, + ratchet = 8, + sandpaperBlocks = 9, + slitDrum = 10, + templeBlock = 11, + vibraslap = 12, + woodBlock = 13 +}; + +WoodEnum parseWoodEnum(const std::string &value); +std::optional tryParseWoodEnum(const std::string &value); +std::string toString(const WoodEnum value); +std::ostream &toStream(std::ostream &os, const WoodEnum value); +std::ostream &operator<<(std::ostream &os, const WoodEnum value); + +/// YesNo ////////////////////////////////////////////////////////////////////////////////// +/// +/// The yes-no type is used for boolean-like attributes. We cannot use W3C XML Schema +/// booleans due to their restrictions on expression of boolean values. +/// +enum class YesNo +{ + yes = 0, + no = 1 +}; + +YesNo parseYesNo(const std::string &value); +std::optional tryParseYesNo(const std::string &value); +std::string toString(const YesNo value); +std::ostream &toStream(std::ostream &os, const YesNo value); +std::ostream &operator<<(std::ostream &os, const YesNo value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/EnumsBuiltin.cpp b/Sourcecode/private/mx/core/EnumsBuiltin.cpp index a0fed85dc..218a133eb 100644 --- a/Sourcecode/private/mx/core/EnumsBuiltin.cpp +++ b/Sourcecode/private/mx/core/EnumsBuiltin.cpp @@ -6,148 +6,208 @@ namespace mx { - namespace core - { - XlinkActuate parseXlinkActuate( const std::string& value ) - { - if ( value == "onLoad" ) { return XlinkActuate::onLoad; } - else if ( value == "onRequest" ) { return XlinkActuate::onRequest; } - else if ( value == "other" ) { return XlinkActuate::other; } - else if ( value == "none" ) { return XlinkActuate::none; } - return XlinkActuate::onLoad; - } - - - std::string toString( const XlinkActuate value ) - { - switch ( value ) - { - case XlinkActuate::onLoad: return "onLoad"; - case XlinkActuate::onRequest: return "onRequest"; - case XlinkActuate::other: return "other"; - case XlinkActuate::none: return "none"; - default: break; - } - return "none"; - } - - - std::ostream& toStream( std::ostream& os, const XlinkActuate value ) - { - return os << toString( value ); - } - - - std::ostream& operator<<( std::ostream& os, const XlinkActuate value ) - { - return toStream( os, value ); - } - - XlinkShow parseXlinkShow( const std::string& value ) - { - if ( value == "new" ) { return XlinkShow::new_; } - else if ( value == "replace" ) { return XlinkShow::replace; } - else if ( value == "embed" ) { return XlinkShow::embed; } - else if ( value == "other" ) { return XlinkShow::other; } - else if ( value == "none" ) { return XlinkShow::none; } - return XlinkShow::new_; - } - - - std::string toString( const XlinkShow value ) - { - switch ( value ) - { - case XlinkShow::new_: return "new"; - case XlinkShow::replace: return "replace"; - case XlinkShow::embed: return "embed"; - case XlinkShow::other: return "other"; - case XlinkShow::none: return "none"; - default: break; - } - return "none"; - } - - - std::ostream& toStream( std::ostream& os, const XlinkShow value ) - { - return os << toString( value ); - } - - - std::ostream& operator<<( std::ostream& os, const XlinkShow value ) - { - return toStream( os, value ); - } - - XlinkType parseXlinkType( const std::string& value ) - { - if ( value == "simple" ) { return XlinkType::simple; } - else if ( value == "extended" ) { return XlinkType::extended; } - else if ( value == "title" ) { return XlinkType::title; } - else if ( value == "resource" ) { return XlinkType::resource; } - else if ( value == "locator" ) { return XlinkType::locator; } - else if ( value == "arc" ) { return XlinkType::arc; } - return XlinkType::simple; - } - - - std::string toString( const XlinkType value ) - { - switch ( value ) - { - case XlinkType::simple: return "simple"; - case XlinkType::extended: return "extended"; - case XlinkType::title: return "title"; - case XlinkType::resource: return "resource"; - case XlinkType::locator: return "locator"; - case XlinkType::arc: return "arc"; - default: break; - } - return "simple"; - } - - - std::ostream& toStream( std::ostream& os, const XlinkType value ) - { - return os << toString( value ); - } - - - std::ostream& operator<<( std::ostream& os, const XlinkType value ) - { - return toStream( os, value ); - } - - XmlSpace parseXmlSpace( const std::string& value ) - { - if ( value == "default" ) { return XmlSpace::default_; } - else if ( value == "preserve" ) { return XmlSpace::preserve; } - return XmlSpace::default_; - } - - - std::string toString( const XmlSpace value ) - { - switch ( value ) - { - case XmlSpace::default_: return "default"; - case XmlSpace::preserve: return "preserve"; - default: break; - } - return "default"; - } - - - std::ostream& toStream( std::ostream& os, const XmlSpace value ) - { - return os << toString( value ); - } - - - std::ostream& operator<<( std::ostream& os, const XmlSpace value ) - { - return toStream( os, value ); - } +namespace core +{ +XlinkActuate parseXlinkActuate(const std::string &value) +{ + if (value == "onLoad") + { + return XlinkActuate::onLoad; + } + else if (value == "onRequest") + { + return XlinkActuate::onRequest; + } + else if (value == "other") + { + return XlinkActuate::other; + } + else if (value == "none") + { + return XlinkActuate::none; + } + return XlinkActuate::onLoad; +} + +std::string toString(const XlinkActuate value) +{ + switch (value) + { + case XlinkActuate::onLoad: + return "onLoad"; + case XlinkActuate::onRequest: + return "onRequest"; + case XlinkActuate::other: + return "other"; + case XlinkActuate::none: + return "none"; + default: + break; + } + return "none"; +} + +std::ostream &toStream(std::ostream &os, const XlinkActuate value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const XlinkActuate value) +{ + return toStream(os, value); +} + +XlinkShow parseXlinkShow(const std::string &value) +{ + if (value == "new") + { + return XlinkShow::new_; + } + else if (value == "replace") + { + return XlinkShow::replace; + } + else if (value == "embed") + { + return XlinkShow::embed; + } + else if (value == "other") + { + return XlinkShow::other; + } + else if (value == "none") + { + return XlinkShow::none; + } + return XlinkShow::new_; +} + +std::string toString(const XlinkShow value) +{ + switch (value) + { + case XlinkShow::new_: + return "new"; + case XlinkShow::replace: + return "replace"; + case XlinkShow::embed: + return "embed"; + case XlinkShow::other: + return "other"; + case XlinkShow::none: + return "none"; + default: + break; + } + return "none"; +} + +std::ostream &toStream(std::ostream &os, const XlinkShow value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const XlinkShow value) +{ + return toStream(os, value); +} + +XlinkType parseXlinkType(const std::string &value) +{ + if (value == "simple") + { + return XlinkType::simple; + } + else if (value == "extended") + { + return XlinkType::extended; + } + else if (value == "title") + { + return XlinkType::title; + } + else if (value == "resource") + { + return XlinkType::resource; + } + else if (value == "locator") + { + return XlinkType::locator; + } + else if (value == "arc") + { + return XlinkType::arc; + } + return XlinkType::simple; +} + +std::string toString(const XlinkType value) +{ + switch (value) + { + case XlinkType::simple: + return "simple"; + case XlinkType::extended: + return "extended"; + case XlinkType::title: + return "title"; + case XlinkType::resource: + return "resource"; + case XlinkType::locator: + return "locator"; + case XlinkType::arc: + return "arc"; + default: + break; + } + return "simple"; +} + +std::ostream &toStream(std::ostream &os, const XlinkType value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const XlinkType value) +{ + return toStream(os, value); +} + +XmlSpace parseXmlSpace(const std::string &value) +{ + if (value == "default") + { + return XmlSpace::default_; + } + else if (value == "preserve") + { + return XmlSpace::preserve; } + return XmlSpace::default_; +} + +std::string toString(const XmlSpace value) +{ + switch (value) + { + case XmlSpace::default_: + return "default"; + case XmlSpace::preserve: + return "preserve"; + default: + break; + } + return "default"; +} + +std::ostream &toStream(std::ostream &os, const XmlSpace value) +{ + return os << toString(value); +} + +std::ostream &operator<<(std::ostream &os, const XmlSpace value) +{ + return toStream(os, value); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/EnumsBuiltin.h b/Sourcecode/private/mx/core/EnumsBuiltin.h index 78fd00d3d..1b38d330c 100644 --- a/Sourcecode/private/mx/core/EnumsBuiltin.h +++ b/Sourcecode/private/mx/core/EnumsBuiltin.h @@ -9,58 +9,55 @@ namespace mx { - namespace core - { - enum class XlinkType - { - simple = 0, - extended = 1, - title = 2, - resource = 3, - locator = 4, - arc = 5 - }; - XlinkType parseXlinkType( const std::string& value ); - std::string toString( const XlinkType value ); - std::ostream& toStream( std::ostream& os, const XlinkType value ); - std::ostream& operator<<( std::ostream& os, const XlinkType value ); - - - enum class XmlSpace - { - default_ = 0, - preserve = 1 - }; - XmlSpace parseXmlSpace( const std::string& value ); - std::string toString( const XmlSpace value ); - std::ostream& toStream( std::ostream& os, const XmlSpace value ); - std::ostream& operator<<( std::ostream& os, const XmlSpace value ); +namespace core +{ +enum class XlinkType +{ + simple = 0, + extended = 1, + title = 2, + resource = 3, + locator = 4, + arc = 5 +}; +XlinkType parseXlinkType(const std::string &value); +std::string toString(const XlinkType value); +std::ostream &toStream(std::ostream &os, const XlinkType value); +std::ostream &operator<<(std::ostream &os, const XlinkType value); + +enum class XmlSpace +{ + default_ = 0, + preserve = 1 +}; +XmlSpace parseXmlSpace(const std::string &value); +std::string toString(const XmlSpace value); +std::ostream &toStream(std::ostream &os, const XmlSpace value); +std::ostream &operator<<(std::ostream &os, const XmlSpace value); - - enum class XlinkActuate - { - onLoad = 0, - onRequest = 1, - other = 2, - none = 3 - }; - XlinkActuate parseXlinkActuate( const std::string& value ); - std::string toString( const XlinkActuate value ); - std::ostream& toStream( std::ostream& os, const XlinkActuate value ); - std::ostream& operator<<( std::ostream& os, const XlinkActuate value ); - - enum class XlinkShow - { - new_ = 0, - replace = 1, - embed = 2, - other = 3, - none = 4 - }; - XlinkShow parseXlinkShow( const std::string& value ); - std::string toString( const XlinkShow value ); - std::ostream& toStream( std::ostream& os, const XlinkShow value ); - std::ostream& operator<<( std::ostream& os, const XlinkShow value ); - } -} +enum class XlinkActuate +{ + onLoad = 0, + onRequest = 1, + other = 2, + none = 3 +}; +XlinkActuate parseXlinkActuate(const std::string &value); +std::string toString(const XlinkActuate value); +std::ostream &toStream(std::ostream &os, const XlinkActuate value); +std::ostream &operator<<(std::ostream &os, const XlinkActuate value); +enum class XlinkShow +{ + new_ = 0, + replace = 1, + embed = 2, + other = 3, + none = 4 +}; +XlinkShow parseXlinkShow(const std::string &value); +std::string toString(const XlinkShow value); +std::ostream &toStream(std::ostream &os, const XlinkShow value); +std::ostream &operator<<(std::ostream &os, const XlinkShow value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/FontSize.cpp b/Sourcecode/private/mx/core/FontSize.cpp index ca39b1f51..f3822c687 100644 --- a/Sourcecode/private/mx/core/FontSize.cpp +++ b/Sourcecode/private/mx/core/FontSize.cpp @@ -11,126 +11,121 @@ namespace mx { - namespace core +namespace core +{ +template inline constexpr bool always_false_v = false; + +FontSize::FontSize() : myValue{Decimal{}} +{ +} + +FontSize::FontSize(Decimal value) : myValue{std::move(value)} +{ +} + +FontSize::FontSize(CssFontSize value) : myValue{value} +{ +} + +FontSize::FontSize(const std::string &value) : FontSize{} +{ + parse(value); +} + +bool FontSize::getIsDecimal() const +{ + return myValue.index() == 0; +} + +bool FontSize::getIsCssFontSize() const +{ + return myValue.index() == 1; +} + +void FontSize::setDecimal(Decimal value) +{ + myValue.emplace(value); +} + +void FontSize::setCssFontSize(CssFontSize value) +{ + myValue.emplace(value); +} + +Decimal FontSize::getValueDecimal() const +{ + auto result = Decimal{}; + std::visit( + [&](auto &&arg) { + using T = std::decay_t; + if constexpr (std::is_same_v) + result = arg; + else if constexpr (std::is_same_v) + result = Decimal{}; + else + static_assert(always_false_v, "non-exhaustive visitor!"); + }, + myValue); + return result; +} + +CssFontSize FontSize::getValueCssFontSize() const +{ + auto result = CssFontSize::xxSmall; + std::visit( + [&](auto &&arg) { + using T = std::decay_t; + if constexpr (std::is_same_v) + result = CssFontSize::xxSmall; + else if constexpr (std::is_same_v) + result = arg; + else + static_assert(always_false_v, "non-exhaustive visitor!"); + }, + myValue); + return result; +} + +bool FontSize::parse(const std::string &value) +{ + auto decimal = Decimal{}; + if (decimal.parse(value)) + { + setDecimal(decimal); + return true; + } + const auto cssFontSize = tryParseCssFontSize(value); + if (cssFontSize) + { + setCssFontSize(*cssFontSize); + return true; + } + return false; +} + +std::string toString(const FontSize &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +std::ostream &toStream(std::ostream &os, const FontSize &value) +{ + if (value.getIsDecimal()) + { + toStream(os, value.getValueDecimal()); + } + if (value.getIsCssFontSize()) { - template inline constexpr bool always_false_v = false; - - FontSize::FontSize() - : myValue{ Decimal{} } - { - - } - - FontSize::FontSize( Decimal value ) - : myValue{ std::move( value ) } - { - - } - - FontSize::FontSize( CssFontSize value ) - : myValue{ value } - { - - } - - FontSize::FontSize( const std::string& value ) - : FontSize{} - { - parse( value ); - } - - bool FontSize::getIsDecimal() const - { - return myValue.index() == 0; - } - - bool FontSize::getIsCssFontSize() const - { - return myValue.index() == 1; - } - - void FontSize::setDecimal( Decimal value ) - { - myValue.emplace( value ); - } - - void FontSize::setCssFontSize( CssFontSize value ) - { - myValue.emplace( value ); - } - - Decimal FontSize::getValueDecimal() const - { - auto result = Decimal{}; - std::visit([&](auto&& arg) - { - using T = std::decay_t; - if constexpr( std::is_same_v ) - result = arg; - else if constexpr( std::is_same_v ) - result = Decimal{}; - else - static_assert(always_false_v, "non-exhaustive visitor!"); - }, myValue); - return result; - } - - CssFontSize FontSize::getValueCssFontSize() const - { - auto result = CssFontSize::xxSmall; - std::visit([&](auto&& arg) - { - using T = std::decay_t; - if constexpr( std::is_same_v ) - result = CssFontSize::xxSmall; - else if constexpr( std::is_same_v ) - result = arg; - else - static_assert(always_false_v, "non-exhaustive visitor!"); - }, myValue); - return result; - } - - bool FontSize::parse( const std::string& value ) - { - auto decimal = Decimal{}; - if( decimal.parse( value ) ) - { - setDecimal( decimal ); - return true; - } - const auto cssFontSize = tryParseCssFontSize( value ); - if( cssFontSize ) - { - setCssFontSize( *cssFontSize ); - return true; - } - return false; - } - - std::string toString( const FontSize& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - std::ostream& toStream( std::ostream& os, const FontSize& value ) - { - if( value.getIsDecimal() ) - { - toStream( os, value.getValueDecimal() ); - } - if( value.getIsCssFontSize() ) - { - toStream( os, value.getValueCssFontSize() ); - } - return os; - } - - std::ostream& operator<<( std::ostream& os, const FontSize& value ) - { - return toStream( os, value ); - } + toStream(os, value.getValueCssFontSize()); } + return os; +} + +std::ostream &operator<<(std::ostream &os, const FontSize &value) +{ + return toStream(os, value); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/FontSize.h b/Sourcecode/private/mx/core/FontSize.h index d55312f61..e7c6f2e68 100644 --- a/Sourcecode/private/mx/core/FontSize.h +++ b/Sourcecode/private/mx/core/FontSize.h @@ -13,30 +13,30 @@ namespace mx { - namespace core - { - /// The font-size can be one of the CSS font sizes or a numeric point size. - class FontSize - { - public: - explicit FontSize(); - explicit FontSize( Decimal value ); - explicit FontSize( CssFontSize value ); - explicit FontSize( const std::string& value ); - bool getIsDecimal() const; - bool getIsCssFontSize() const; - void setDecimal( Decimal value ); - void setCssFontSize( CssFontSize value ); - Decimal getValueDecimal() const; - CssFontSize getValueCssFontSize() const; - bool parse( const std::string& value ); - - private: - std::variant myValue; - }; - - std::string toString( const FontSize& value ); - std::ostream& toStream( std::ostream& os, const FontSize& value ); - std::ostream& operator<<( std::ostream& os, const FontSize& value ); - } -} +namespace core +{ +/// The font-size can be one of the CSS font sizes or a numeric point size. +class FontSize +{ + public: + explicit FontSize(); + explicit FontSize(Decimal value); + explicit FontSize(CssFontSize value); + explicit FontSize(const std::string &value); + bool getIsDecimal() const; + bool getIsCssFontSize() const; + void setDecimal(Decimal value); + void setCssFontSize(CssFontSize value); + Decimal getValueDecimal() const; + CssFontSize getValueCssFontSize() const; + bool parse(const std::string &value); + + private: + std::variant myValue; +}; + +std::string toString(const FontSize &value); +std::ostream &toStream(std::ostream &os, const FontSize &value); +std::ostream &operator<<(std::ostream &os, const FontSize &value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/ForwardDeclare.h b/Sourcecode/private/mx/core/ForwardDeclare.h index bb201a726..abd6c55da 100644 --- a/Sourcecode/private/mx/core/ForwardDeclare.h +++ b/Sourcecode/private/mx/core/ForwardDeclare.h @@ -4,46 +4,50 @@ #pragma once +#include "mx/utility/JitAllocate.h" +#include "mx/utility/Lock.h" +#include "mx/utility/Throw.h" +#include #include #include -#include -#include "mx/utility/Throw.h" -#include "mx/utility/Lock.h" -#include "mx/utility/JitAllocate.h" #ifndef MX_FORWARD_DECLARE_ELEMENT -#define MX_FORWARD_DECLARE_ELEMENT( class_name ) \ -class class_name ; \ -using class_name ## Ptr = std::shared_ptr< class_name >; \ -using class_name ## UPtr = std::unique_ptr< class_name >; \ -using class_name ## Set = std::vector< class_name ## Ptr >; \ -using class_name ## SetIter = class_name ## Set::iterator; \ -using class_name ## SetIterConst = class_name ## Set::const_iterator; \ +#define MX_FORWARD_DECLARE_ELEMENT(class_name) \ + class class_name; \ + using class_name##Ptr = std::shared_ptr; \ + using class_name##UPtr = std::unique_ptr; \ + using class_name##Set = std::vector; \ + using class_name##SetIter = class_name##Set::iterator; \ + using class_name##SetIterConst = class_name##Set::const_iterator; #endif - #ifndef MX_FORWARD_DECLARE_ATTRIBUTES -#define MX_FORWARD_DECLARE_ATTRIBUTES( struct_name ) \ -struct struct_name ; \ -using struct_name ## Ptr = std::shared_ptr< struct_name >; \ +#define MX_FORWARD_DECLARE_ATTRIBUTES(struct_name) \ + struct struct_name; \ + using struct_name##Ptr = std::shared_ptr; #endif // uncomment the next line to throw on parse issues // #define MX_DO_THROW_ON_PARSE_ISSUE - #ifdef MX_DO_THROW_ON_PARSE_ISSUE +#ifdef MX_DO_THROW_ON_PARSE_ISSUE - #define MX_DEBUG_THROW_ON_PARSE_ISSUE if( !isSuccess ) { MX_THROW( "isSuccess is false" ); } +#define MX_DEBUG_THROW_ON_PARSE_ISSUE \ + if (!isSuccess) \ + { \ + MX_THROW("isSuccess is false"); \ + } - #else +#else - #define MX_DEBUG_THROW_ON_PARSE_ISSUE - - #endif +#define MX_DEBUG_THROW_ON_PARSE_ISSUE +#endif #ifndef MX_RETURN_IS_SUCCESS - #define MX_RETURN_IS_SUCCESS MX_DEBUG_THROW_ON_PARSE_ISSUE; return isSuccess; +#define MX_RETURN_IS_SUCCESS \ + MX_DEBUG_THROW_ON_PARSE_ISSUE; \ + return isSuccess; #endif diff --git a/Sourcecode/private/mx/core/FromString.h b/Sourcecode/private/mx/core/FromString.h index a1aa79343..7df0897f8 100644 --- a/Sourcecode/private/mx/core/FromString.h +++ b/Sourcecode/private/mx/core/FromString.h @@ -3,14 +3,14 @@ // Distributed under the MIT License #pragma once -#include "ezxml/XElement.h" #include "ezxml/XAttributeIterator.h" +#include "ezxml/XElement.h" #include namespace mx { - namespace core - { - - } +namespace core +{ + } +} // namespace mx diff --git a/Sourcecode/private/mx/core/FromXElement.cpp b/Sourcecode/private/mx/core/FromXElement.cpp index bf3c2c420..4f404dbd1 100644 --- a/Sourcecode/private/mx/core/FromXElement.cpp +++ b/Sourcecode/private/mx/core/FromXElement.cpp @@ -51,458 +51,493 @@ namespace mx { - namespace core +namespace core +{ +bool importElement(std::ostream &message, ::ezxml::XElement &xelement, bool &isSuccess, ElementInterface &element, + bool &isMatch) +{ + if (xelement.getName() != element.getElementName()) { - bool importElement( - std::ostream& message, - ::ezxml::XElement& xelement, - bool& isSuccess, - ElementInterface& element, - bool& isMatch ) - { - if( xelement.getName() != element.getElementName() ) - { - return false; - } - isMatch = true; - isSuccess &= element.fromXElement( message, xelement ); - return true; - } + return false; + } + isMatch = true; + isSuccess &= element.fromXElement(message, xelement); + return true; +} - bool isEndWithDecrementIfNeeded( - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool isDecrementNeeded ) +bool isEndWithDecrementIfNeeded(::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool isDecrementNeeded) +{ + if (iter == endIter) + { + if (isDecrementNeeded) { - if( iter == endIter ) - { - if( isDecrementNeeded ) - { - --iter; - } - return true; - } - return false; + --iter; } + return true; + } + return false; +} - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialGroupPtr& group ) - { - bool doDecrementIter = false; - if( iter == endIter ) - { - return; - } +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, EditorialGroupPtr &group) +{ + bool doDecrementIter = false; + if (iter == endIter) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialGroup::getFootnote, &EditorialGroup::setHasFootnote ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, doDecrementIter, group, + &EditorialGroup::getFootnote, &EditorialGroup::setHasFootnote); + if (isEndWithDecrementIfNeeded(iter, endIter, doDecrementIter)) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialGroup::getLevel, &EditorialGroup::setHasLevel ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, doDecrementIter, group, + &EditorialGroup::getLevel, &EditorialGroup::setHasLevel); + if (isEndWithDecrementIfNeeded(iter, endIter, doDecrementIter)) + { + return; + } +} - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialVoiceGroupPtr& group ) - { - bool doDecrementIter = false; - if( iter == endIter ) - { - return; - } +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, EditorialVoiceGroupPtr &group) +{ + bool doDecrementIter = false; + if (iter == endIter) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceGroup::getFootnote, &EditorialVoiceGroup::setHasFootnote ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, doDecrementIter, group, + &EditorialVoiceGroup::getFootnote, &EditorialVoiceGroup::setHasFootnote); + if (isEndWithDecrementIfNeeded(iter, endIter, doDecrementIter)) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceGroup::getLevel, &EditorialVoiceGroup::setHasLevel ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, doDecrementIter, group, + &EditorialVoiceGroup::getLevel, &EditorialVoiceGroup::setHasLevel); + if (isEndWithDecrementIfNeeded(iter, endIter, doDecrementIter)) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceGroup::getVoice, &EditorialVoiceGroup::setHasVoice ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, doDecrementIter, group, + &EditorialVoiceGroup::getVoice, &EditorialVoiceGroup::setHasVoice); + if (isEndWithDecrementIfNeeded(iter, endIter, doDecrementIter)) + { + return; + } +} +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, EditorialVoiceDirectionGroupPtr &group) +{ + bool doDecrementIter = false; + if (iter == endIter) + { + return; + } - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialVoiceDirectionGroupPtr& group ) - { - bool doDecrementIter = false; - if( iter == endIter ) - { - return; - } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, doDecrementIter, group, + &EditorialVoiceDirectionGroup::getFootnote, + &EditorialVoiceDirectionGroup::setHasFootnote); + if (isEndWithDecrementIfNeeded(iter, endIter, doDecrementIter)) + { + return; + } + + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, doDecrementIter, group, + &EditorialVoiceDirectionGroup::getLevel, + &EditorialVoiceDirectionGroup::setHasLevel); + if (isEndWithDecrementIfNeeded(iter, endIter, doDecrementIter)) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceDirectionGroup::getFootnote, &EditorialVoiceDirectionGroup::setHasFootnote ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, doDecrementIter, group, + &EditorialVoiceDirectionGroup::getVoice, + &EditorialVoiceDirectionGroup::setHasVoice); + if (isEndWithDecrementIfNeeded(iter, endIter, doDecrementIter)) + { + return; + } +} - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceDirectionGroup::getLevel, &EditorialVoiceDirectionGroup::setHasLevel ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, LayoutGroupPtr &group) +{ + bool isIterIncremented = false; + if (iter == endIter) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceDirectionGroup::getVoice, &EditorialVoiceDirectionGroup::setHasVoice ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, group, + &LayoutGroup::getPageLayout, &LayoutGroup::setHasPageLayout); + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - LayoutGroupPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, group, + &LayoutGroup::getSystemLayout, &LayoutGroup::setHasSystemLayout); + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &LayoutGroup::getPageLayout, &LayoutGroup::setHasPageLayout ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } + checkSetGroupMemberSetAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, "staff-layout", group, + &LayoutGroup::getStaffLayoutSet, &LayoutGroup::addStaffLayout, + &LayoutGroup::removeStaffLayout); + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &LayoutGroup::getSystemLayout, &LayoutGroup::setHasSystemLayout ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - checkSetGroupMemberSetAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, "staff-layout", group, &LayoutGroup::getStaffLayoutSet, &LayoutGroup::addStaffLayout, &LayoutGroup::removeStaffLayout ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( isIterIncremented ) - { - --iter; - return; - } - } + if (isIterIncremented) + { + --iter; + return; + } +} +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, BeatUnitGroupPtr &group) +{ + bool isIterIncremented = false; + if (iter == endIter) + { + return; + } - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - BeatUnitGroupPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } + bool dummy = false; - bool dummy = false; + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, group, + &BeatUnitGroup::getBeatUnit, dummy); + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &BeatUnitGroup::getBeatUnit, dummy ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - checkSetGroupMemberSetAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, "beat-unit-dot", group, &BeatUnitGroup::getBeatUnitDotSet, &BeatUnitGroup::addBeatUnitDot, &BeatUnitGroup::removeBeatUnitDot ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( isIterIncremented ) - { - --iter; - return; - } - } + checkSetGroupMemberSetAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, "beat-unit-dot", group, + &BeatUnitGroup::getBeatUnitDotSet, &BeatUnitGroup::addBeatUnitDot, + &BeatUnitGroup::removeBeatUnitDot); + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } + if (isIterIncremented) + { + --iter; + return; + } +} - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - MetronomeRelationGroupPtr& group, - bool& hasGroup ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, MetronomeRelationGroupPtr &group, bool &hasGroup) +{ + bool isIterIncremented = false; + if (iter == endIter) + { + return; + } - bool isFound; + bool isFound; - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &MetronomeRelationGroup::getMetronomeRelation, isFound ); - hasGroup |= isFound; - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &MetronomeRelationGroup::getMetronomeNote, isFound ); - hasGroup |= isFound; - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( isIterIncremented ) - { - --iter; - return; - } - } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, group, + &MetronomeRelationGroup::getMetronomeRelation, isFound); + hasGroup |= isFound; + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, group, + &MetronomeRelationGroup::getMetronomeNote, isFound); + hasGroup |= isFound; + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - DisplayStepOctaveGroupPtr& group, - bool& hasGroup ) + if (isIterIncremented) + { + --iter; + return; + } +} + +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, DisplayStepOctaveGroupPtr &group, bool &hasGroup) +{ + hasGroup = false; + bool isIterIncremented = false; + if (iter == endIter) + { + return; + } + + if (iter->getName() == group->getDisplayStep()->getElementName()) + { + isSuccess &= group->getDisplayStep()->fromXElement(message, *iter); + isIterIncremented = true; + hasGroup = true; + ++iter; + } + + if ((iter != endIter) && (iter->getName() == group->getDisplayOctave()->getElementName())) + { + isSuccess &= group->getDisplayOctave()->fromXElement(message, *iter); + isIterIncremented = true; + hasGroup = true; + ++iter; + } + + if (isIterIncremented) + { + --iter; + return; + } +} + +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, SyllabicTextGroupPtr &group) +{ + bool isIterIncremented = false; + if (iter == endIter) + { + return; + } + + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, group, + &SyllabicTextGroup::getSyllabic, &SyllabicTextGroup::setHasSyllabic); + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } + + bool hasText = false; + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, group, + &SyllabicTextGroup::getText, hasText); + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } + + // Something seems slightly off about this 'if' statement. originally I expected to always + // find a 'text' element here, but it turns out that 'end-line' and 'end-paragraph' + // are valid to find here as well. It seems to be working. + if (iter->getName() != "end-line" && iter->getName() != "end-paragraph" && !hasText) + { + isSuccess = false; + message << "SyllabicTextGroup: 'text' was not found where expected, '" << iter->getName() + << "' was found instead" << std::endl; + } + + while (iter != endIter && + (iter->getName() == "elision" || iter->getName() == "syllabic" || iter->getName() == "text")) + { + auto elisionSyllabicTextGroup = makeElisionSyllabicTextGroup(); + group->addElisionSyllabicTextGroup(elisionSyllabicTextGroup); + + if (iter->getName() == "elision") { - hasGroup = false; - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } - if( iter->getName() == group->getDisplayStep()->getElementName() ) - { - isSuccess &= group->getDisplayStep()->fromXElement( message, *iter ); - isIterIncremented = true; - hasGroup = true; - ++iter; - } - - if( ( iter != endIter ) && ( iter->getName() == group->getDisplayOctave()->getElementName() ) ) - { - isSuccess &= group->getDisplayOctave()->fromXElement( message, *iter ); - isIterIncremented = true; - hasGroup = true; - ++iter; - } - - if( isIterIncremented ) - { - --iter; - return; - } + isSuccess &= + elisionSyllabicTextGroup->getElisionSyllabicGroup()->getElision()->fromXElement(message, *iter); + elisionSyllabicTextGroup->setHasElisionSyllabicGroup(true); + ++iter; + isIterIncremented = true; + } + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; } + if (iter->getName() == "syllabic") + { - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - SyllabicTextGroupPtr& group ) + isSuccess &= + elisionSyllabicTextGroup->getElisionSyllabicGroup()->getSyllabic()->fromXElement(message, *iter); + elisionSyllabicTextGroup->setHasElisionSyllabicGroup(true); + ++iter; + isIterIncremented = true; + } + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) { - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } + return; + } - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &SyllabicTextGroup::getSyllabic, &SyllabicTextGroup::setHasSyllabic ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - bool hasText = false; - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &SyllabicTextGroup::getText, hasText ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - // Something seems slightly off about this 'if' statement. originally I expected to always - // find a 'text' element here, but it turns out that 'end-line' and 'end-paragraph' - // are valid to find here as well. It seems to be working. - if( iter->getName() != "end-line" && iter->getName() != "end-paragraph" && !hasText ) - { - isSuccess = false; - message << "SyllabicTextGroup: 'text' was not found where expected, '" << iter->getName() << "' was found instead" << std::endl; - } + if (iter->getName() == "text") + { - while( iter != endIter && ( iter->getName() == "elision" || iter->getName() == "syllabic" || iter->getName() == "text" ) ) - { - auto elisionSyllabicTextGroup = makeElisionSyllabicTextGroup(); - group->addElisionSyllabicTextGroup( elisionSyllabicTextGroup ); - - if( iter->getName() == "elision" ) - { - - isSuccess &= elisionSyllabicTextGroup->getElisionSyllabicGroup()->getElision()->fromXElement( message, *iter ); - elisionSyllabicTextGroup->setHasElisionSyllabicGroup( true ); - ++iter; - isIterIncremented = true; - } - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( iter->getName() == "syllabic" ) - { - - isSuccess &= elisionSyllabicTextGroup->getElisionSyllabicGroup()->getSyllabic()->fromXElement( message, *iter ); - elisionSyllabicTextGroup->setHasElisionSyllabicGroup( true ); - ++iter; - isIterIncremented = true; - } - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( iter->getName() == "text" ) - { - - isSuccess &= elisionSyllabicTextGroup->getText()->fromXElement( message, *iter ); - ++iter; - isIterIncremented = true; - } - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &SyllabicTextGroup::getExtend, &SyllabicTextGroup::setHasExtend ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } + isSuccess &= elisionSyllabicTextGroup->getText()->fromXElement(message, *iter); + ++iter; + isIterIncremented = true; + } + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } + } + checkSetGroupMemberAndIncrementIter(message, iter, endIter, isSuccess, isIterIncremented, group, + &SyllabicTextGroup::getExtend, &SyllabicTextGroup::setHasExtend); + if (isEndWithDecrementIfNeeded(iter, endIter, isIterIncremented)) + { + return; + } - if( isIterIncremented ) - { - --iter; - return; - } - } + if (isIterIncremented) + { + --iter; + return; + } +} +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, TimeSignatureGroupPtr &group) +{ + bool isIterIncremented = false; + if (iter == endIter) + { + isSuccess = false; + return; + } - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - TimeSignatureGroupPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - isSuccess = false; - return; - } + bool isBeatsFound = false; + bool isBeatTypeFound = false; - bool isBeatsFound = false; - bool isBeatTypeFound = false; + if (iter->getName() == group->getBeats()->getElementName()) + { + isSuccess &= group->getBeats()->fromXElement(message, *iter); + isIterIncremented = true; + isBeatsFound = true; + ++iter; + } - if( iter->getName() == group->getBeats()->getElementName() ) - { - isSuccess &= group->getBeats()->fromXElement( message, *iter ); - isIterIncremented = true; - isBeatsFound = true; - ++iter; - } - - if( ( iter != endIter ) && ( iter->getName() == group->getBeatType()->getElementName() ) ) - { - isSuccess &= group->getBeatType()->fromXElement( message, *iter ); - isIterIncremented = true; - isBeatTypeFound = true; - ++iter; - } - - if( ( iter != endIter ) && ( iter->getName() == group->getInterchangeable()->getElementName() ) ) - { - group->setHasInterchangeable( true ); - isSuccess &= group->getInterchangeable()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( !isBeatsFound ) - { - message << "importGroup: the time-signature group requires a 'beats' element but it was not found" << std::endl; - isSuccess = false; - } - - if( !isBeatTypeFound ) - { - message << "importGroup: the time-signature group requires a 'beat-type' element but it was not found" << std::endl; - isSuccess = false; - } + if ((iter != endIter) && (iter->getName() == group->getBeatType()->getElementName())) + { + isSuccess &= group->getBeatType()->fromXElement(message, *iter); + isIterIncremented = true; + isBeatTypeFound = true; + ++iter; + } - if( isIterIncremented ) - { - --iter; - return; - } - } + if ((iter != endIter) && (iter->getName() == group->getInterchangeable()->getElementName())) + { + group->setHasInterchangeable(true); + isSuccess &= group->getInterchangeable()->fromXElement(message, *iter); + isIterIncremented = true; + ++iter; + } + + if (!isBeatsFound) + { + message << "importGroup: the time-signature group requires a 'beats' element but it was not found" << std::endl; + isSuccess = false; + } + if (!isBeatTypeFound) + { + message << "importGroup: the time-signature group requires a 'beat-type' element but it was not found" + << std::endl; + isSuccess = false; + } - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - MidiInstrumentPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - isSuccess = false; - return; - } + if (isIterIncremented) + { + --iter; + return; + } +} - if( iter->getName() == group->getMidiChannel()->getElementName() ) - { - isSuccess &= group->getMidiChannel()->fromXElement( message, *iter ); - group->setHasMidiChannel( true ); - isIterIncremented = true; - ++iter; - } +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, MidiInstrumentPtr &group) +{ + bool isIterIncremented = false; + if (iter == endIter) + { + isSuccess = false; + return; + } - if( iter->getName() == group->getMidiName()->getElementName() ) - { - isSuccess &= group->getMidiName()->fromXElement( message, *iter ); - group->setHasMidiName( true ); - isIterIncremented = true; - ++iter; - } + if (iter->getName() == group->getMidiChannel()->getElementName()) + { + isSuccess &= group->getMidiChannel()->fromXElement(message, *iter); + group->setHasMidiChannel(true); + isIterIncremented = true; + ++iter; + } - if( iter->getName() == group->getMidiBank()->getElementName() ) - { - isSuccess &= group->getMidiBank()->fromXElement( message, *iter ); - group->setHasMidiBank( true ); - isIterIncremented = true; - ++iter; - } + if (iter->getName() == group->getMidiName()->getElementName()) + { + isSuccess &= group->getMidiName()->fromXElement(message, *iter); + group->setHasMidiName(true); + isIterIncremented = true; + ++iter; + } - if( iter->getName() == group->getMidiProgram()->getElementName() ) - { - isSuccess &= group->getMidiProgram()->fromXElement( message, *iter ); - group->setHasMidiProgram( true ); - isIterIncremented = true; - ++iter; - } + if (iter->getName() == group->getMidiBank()->getElementName()) + { + isSuccess &= group->getMidiBank()->fromXElement(message, *iter); + group->setHasMidiBank(true); + isIterIncremented = true; + ++iter; + } - if( iter->getName() == group->getMidiUnpitched()->getElementName() ) - { - isSuccess &= group->getMidiUnpitched()->fromXElement( message, *iter ); - group->setHasMidiUnpitched( true ); - isIterIncremented = true; - ++iter; - } + if (iter->getName() == group->getMidiProgram()->getElementName()) + { + isSuccess &= group->getMidiProgram()->fromXElement(message, *iter); + group->setHasMidiProgram(true); + isIterIncremented = true; + ++iter; + } - if( iter->getName() == group->getVolume()->getElementName() ) - { - isSuccess &= group->getVolume()->fromXElement( message, *iter ); - group->setHasVolume( true ); - isIterIncremented = true; - ++iter; - } + if (iter->getName() == group->getMidiUnpitched()->getElementName()) + { + isSuccess &= group->getMidiUnpitched()->fromXElement(message, *iter); + group->setHasMidiUnpitched(true); + isIterIncremented = true; + ++iter; + } - if( iter->getName() == group->getPan()->getElementName() ) - { - isSuccess &= group->getPan()->fromXElement( message, *iter ); - group->setHasPan( true ); - isIterIncremented = true; - ++iter; - } + if (iter->getName() == group->getVolume()->getElementName()) + { + isSuccess &= group->getVolume()->fromXElement(message, *iter); + group->setHasVolume(true); + isIterIncremented = true; + ++iter; + } - if( iter->getName() == group->getElevation()->getElementName() ) - { - isSuccess &= group->getElevation()->fromXElement( message, *iter ); - group->setHasElevation( true ); - isIterIncremented = true; - ++iter; - } + if (iter->getName() == group->getPan()->getElementName()) + { + isSuccess &= group->getPan()->fromXElement(message, *iter); + group->setHasPan(true); + isIterIncremented = true; + ++iter; + } - if( isIterIncremented ) - { - --iter; - return; - } - } + if (iter->getName() == group->getElevation()->getElementName()) + { + isSuccess &= group->getElevation()->fromXElement(message, *iter); + group->setHasElevation(true); + isIterIncremented = true; + ++iter; + } + + if (isIterIncremented) + { + --iter; + return; + } +} /* void importGroup( @@ -561,347 +596,262 @@ namespace mx } */ +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, XsString &assignmentTarget, bool &hasAttribute, const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.setValue(iter->getValue()); + return true; +} - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - XsString& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.setValue( iter->getValue() ); - return true; - } - - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - Decimal& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - return true; - } - - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - Integer& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class Color; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - Color& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class Date; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - Date& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class FontSize; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, Decimal &assignmentTarget, bool &hasAttribute, const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + return true; +} - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - FontSize& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, Integer &assignmentTarget, bool &hasAttribute, const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + if (iter->getValue() != toString(assignmentTarget)) + { + isSuccess = false; + message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; + message << iter->getValue() << "' was unrecognized - setting value to '"; + message << toString(assignmentTarget) << "'"; + } + return true; +} +class Color; - class NumberOrNormal; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, Color &assignmentTarget, bool &hasAttribute, const char *const attributeName) +{ + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + if (iter->getValue() != toString(assignmentTarget)) + { + isSuccess = false; + message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; + message << iter->getValue() << "' was unrecognized - setting value to '"; + message << toString(assignmentTarget) << "'"; + } + return true; +} - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - NumberOrNormal& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } +class Date; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, Date &assignmentTarget, bool &hasAttribute, const char *const attributeName) +{ + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + if (iter->getValue() != toString(assignmentTarget)) + { + isSuccess = false; + message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; + message << iter->getValue() << "' was unrecognized - setting value to '"; + message << toString(assignmentTarget) << "'"; + } + return true; +} - class PositiveIntegerOrEmpty; +class FontSize; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - PositiveIntegerOrEmpty& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, FontSize &assignmentTarget, bool &hasAttribute, const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + if (iter->getValue() != toString(assignmentTarget)) + { + isSuccess = false; + message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; + message << iter->getValue() << "' was unrecognized - setting value to '"; + message << toString(assignmentTarget) << "'"; + } + return true; +} +class NumberOrNormal; - class YesNoNumber; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, NumberOrNormal &assignmentTarget, bool &hasAttribute, + const char *const attributeName) +{ + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + if (iter->getValue() != toString(assignmentTarget)) + { + isSuccess = false; + message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; + message << iter->getValue() << "' was unrecognized - setting value to '"; + message << toString(assignmentTarget) << "'"; + } + return true; +} - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - YesNoNumber& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } +class PositiveIntegerOrEmpty; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, PositiveIntegerOrEmpty &assignmentTarget, bool &hasAttribute, + const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + if (iter->getValue() != toString(assignmentTarget)) + { + isSuccess = false; + message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; + message << iter->getValue() << "' was unrecognized - setting value to '"; + message << toString(assignmentTarget) << "'"; + } + return true; +} - class CommaSeparatedText; +class YesNoNumber; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - CommaSeparatedText& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - return true; - } +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, YesNoNumber &assignmentTarget, bool &hasAttribute, const char *const attributeName) +{ + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + if (iter->getValue() != toString(assignmentTarget)) + { + isSuccess = false; + message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; + message << iter->getValue() << "' was unrecognized - setting value to '"; + message << toString(assignmentTarget) << "'"; + } + return true; +} +class CommaSeparatedText; - class DistanceType; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, CommaSeparatedText &assignmentTarget, bool &hasAttribute, + const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + return true; +} - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - DistanceType& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.setValue( iter->getValue() ); - return true; - } +class DistanceType; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, DistanceType &assignmentTarget, bool &hasAttribute, + const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.setValue(iter->getValue()); + return true; +} - class LineWidthType; +class LineWidthType; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - LineWidthType& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.setValue( iter->getValue() ); - return true; - } - +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, LineWidthType &assignmentTarget, bool &hasAttribute, + const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget.setValue(iter->getValue()); + return true; +} - class CommaSeparatedListOfPositiveIntegers; +class CommaSeparatedListOfPositiveIntegers; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - CommaSeparatedListOfPositiveIntegers& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - return true; - } +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSuccess, CommaSeparatedListOfPositiveIntegers &assignmentTarget, bool &hasAttribute, + const char *const attributeName) +{ + MX_UNUSED(message); + MX_UNUSED(className); + MX_UNUSED(isSuccess); + if (iter->getName() != attributeName) + { + return false; } + hasAttribute = true; + assignmentTarget.parse(iter->getValue()); + return true; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/FromXElement.h b/Sourcecode/private/mx/core/FromXElement.h index 0e67e6d0e..e061a11d2 100644 --- a/Sourcecode/private/mx/core/FromXElement.h +++ b/Sourcecode/private/mx/core/FromXElement.h @@ -4,519 +4,344 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "ezxml/XElement.h" #include "ezxml/XAttribute.h" -#include "ezxml/XElementIterator.h" #include "ezxml/XAttributeIterator.h" +#include "ezxml/XElement.h" +#include "ezxml/XElementIterator.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #ifndef MX_FROM_XELEMENT_UNUSED -#define MX_FROM_XELEMENT_UNUSED( class_name ) \ -\ - bool class_name::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) \ - { \ - MX_UNUSED( xelement ); \ - message << #class_name ": fromXElement function is not expected to be called on this class" << std::endl; \ - return false; \ - } \ -\ +#define MX_FROM_XELEMENT_UNUSED(class_name) \ + \ + bool class_name::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) \ + { \ + MX_UNUSED(xelement); \ + message << #class_name ": fromXElement function is not expected to be called on this class" << std::endl; \ + return false; \ + } #endif #ifndef MX_CHOICE_IF -#define MX_CHOICE_IF( enum_symbol, element_name, function_name_part ) \ -\ - if( xelement.getName() == element_name ) \ - { \ - myChoice = Choice::enum_symbol; \ - return get##function_name_part()->fromXElement( message, xelement ); \ - } \ -\ +#define MX_CHOICE_IF(enum_symbol, element_name, function_name_part) \ + \ + if (xelement.getName() == element_name) \ + { \ + myChoice = Choice::enum_symbol; \ + return get##function_name_part()->fromXElement(message, xelement); \ + } #endif #ifndef MX_BAD_ELEMENT_FAILURE -#define MX_BAD_ELEMENT_FAILURE( class_name ) \ -\ - message << #class_name << ": '" << xelement.getName() << "' is unrecognized" << std::endl; \ - return false; \ +#define MX_BAD_ELEMENT_FAILURE(class_name) \ + \ + message << #class_name << ": '" << xelement.getName() << "' is unrecognized" << std::endl; \ + return false; #endif namespace mx { - namespace core - { +namespace core +{ - bool importElement( - std::ostream& message, - ::ezxml::XElement& xelement, - bool& isSuccess, - ElementInterface& element, - bool& isMatch ); - +bool importElement(std::ostream &message, ::ezxml::XElement &xelement, bool &isSuccess, ElementInterface &element, + bool &isMatch); - template - bool importElementSet( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - const std::string& elementName, - std::vector>& elementSet ) +template +bool importElementSet(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, const std::string &elementName, std::vector> &elementSet) +{ + bool isFirstItemAdded = false; + bool doDecrementIter = false; + while (iter != endIter && iter->getName() == elementName) + { + auto item = std::make_shared(); + isSuccess &= item->fromXElement(message, *iter); + if (!isFirstItemAdded && elementSet.size() == 1) { - bool isFirstItemAdded = false; - bool doDecrementIter = false; - while( iter != endIter && iter->getName() == elementName ) - { - auto item = std::make_shared(); - isSuccess &= item->fromXElement( message, *iter ); - if( !isFirstItemAdded && elementSet.size() == 1 ) - { - *elementSet.begin() = item; - isFirstItemAdded = true; - } - else - { - elementSet.push_back( item ); - isFirstItemAdded = true; - } - doDecrementIter = true; - ++iter; - } - if( doDecrementIter ) - { - --iter; - } - return isFirstItemAdded; + *elementSet.begin() = item; + isFirstItemAdded = true; } - - - template - void checkSetGroupMemberAndIncrementIter( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - bool& hasIterBeenIncremented, - std::shared_ptr& elementPtr, - std::shared_ptr( PARENT_TYPE:: *getChildFunction ) () const, - void ( PARENT_TYPE:: *setHasFunction ) ( bool ) ) + else { - if( iter == endIter ) - { - return; - } - auto& parent = *elementPtr; - auto childPtr = ( ( parent ).*( getChildFunction ) )(); - - if( iter->getName() == childPtr->getElementName() ) - { - isSuccess &= childPtr->fromXElement( message, *iter ); - ( ( parent ).*( setHasFunction ) )( true ); - ++iter; - hasIterBeenIncremented = true; - } + elementSet.push_back(item); + isFirstItemAdded = true; } + doDecrementIter = true; + ++iter; + } + if (doDecrementIter) + { + --iter; + } + return isFirstItemAdded; +} +template +void checkSetGroupMemberAndIncrementIter(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess, + bool &hasIterBeenIncremented, std::shared_ptr &elementPtr, + std::shared_ptr (PARENT_TYPE::*getChildFunction)() const, + void (PARENT_TYPE::*setHasFunction)(bool)) +{ + if (iter == endIter) + { + return; + } + auto &parent = *elementPtr; + auto childPtr = ((parent).*(getChildFunction))(); - template - void checkSetGroupMemberAndIncrementIter( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - bool& hasIterBeenIncremented, - std::shared_ptr& elementPtr, - std::shared_ptr( PARENT_TYPE:: *getChildFunction ) () const, - bool& isFound ) - { - isFound = false; - if( iter == endIter ) - { - return; - } - auto& parent = *elementPtr; - auto childPtr = ( ( parent ).*( getChildFunction ) )(); - - if( iter->getName() == childPtr->getElementName() ) - { - isFound = true; - isSuccess &= childPtr->fromXElement( message, *iter ); - ++iter; - hasIterBeenIncremented = true; - } - } + if (iter->getName() == childPtr->getElementName()) + { + isSuccess &= childPtr->fromXElement(message, *iter); + ((parent).*(setHasFunction))(true); + ++iter; + hasIterBeenIncremented = true; + } +} +template +void checkSetGroupMemberAndIncrementIter(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess, + bool &hasIterBeenIncremented, std::shared_ptr &elementPtr, + std::shared_ptr (PARENT_TYPE::*getChildFunction)() const, + bool &isFound) +{ + isFound = false; + if (iter == endIter) + { + return; + } + auto &parent = *elementPtr; + auto childPtr = ((parent).*(getChildFunction))(); - template - void checkSetGroupMemberSetAndIncrementIter( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - bool& hasIterBeenIncremented, - std::string elementName, - std::shared_ptr& parentPtr, - const std::vector>& ( PARENT_TYPE:: *getConstSet ) () const, - void ( PARENT_TYPE:: *addItem ) ( const std::shared_ptr& ), - void ( PARENT_TYPE:: *removeItem ) ( const typename std::vector>::const_iterator& ) ) - { - if( iter == endIter ) - { - return; - } - - bool isFirstItemAdded = false; - - auto& parent = *parentPtr; - const auto& set = ( ( parent ).*( getConstSet ) )(); - - while( iter != endIter && iter->getName() == elementName ) - { - auto item = std::make_shared(); - isSuccess &= item->fromXElement( message, *iter ); - ++iter; - hasIterBeenIncremented = true; - - if( !isFirstItemAdded && set.size() == 1 ) - { - ( ( parent ).*( addItem ) )( item ); - ( ( parent ).*( removeItem ) )( set.cbegin() ); - isFirstItemAdded = true; - } - else - { - ( ( parent ).*( addItem ) )( item ); - isFirstItemAdded = true; - } - } - } + if (iter->getName() == childPtr->getElementName()) + { + isFound = true; + isSuccess &= childPtr->fromXElement(message, *iter); + ++iter; + hasIterBeenIncremented = true; + } +} +template +void checkSetGroupMemberSetAndIncrementIter( + std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, bool &isSuccess, + bool &hasIterBeenIncremented, std::string elementName, std::shared_ptr &parentPtr, + const std::vector> &(PARENT_TYPE::*getConstSet)() const, + void (PARENT_TYPE::*addItem)(const std::shared_ptr &), + void (PARENT_TYPE::*removeItem)(const typename std::vector>::const_iterator &)) +{ + if (iter == endIter) + { + return; + } - bool isEndWithDecrementIfNeeded( - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool isDecrementNeeded ); + bool isFirstItemAdded = false; + auto &parent = *parentPtr; + const auto &set = ((parent).*(getConstSet))(); - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialVoiceGroupPtr& group ); + while (iter != endIter && iter->getName() == elementName) + { + auto item = std::make_shared(); + isSuccess &= item->fromXElement(message, *iter); + ++iter; + hasIterBeenIncremented = true; - MX_FORWARD_DECLARE_ELEMENT( LayoutGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - LayoutGroupPtr& group ); + if (!isFirstItemAdded && set.size() == 1) + { + ((parent).*(addItem))(item); + ((parent).*(removeItem))(set.cbegin()); + isFirstItemAdded = true; + } + else + { + ((parent).*(addItem))(item); + isFirstItemAdded = true; + } + } +} - MX_FORWARD_DECLARE_ELEMENT( DisplayStepOctaveGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - DisplayStepOctaveGroupPtr& group, - bool& hasGroup ); - - MX_FORWARD_DECLARE_ELEMENT( SyllabicTextGroup ); +bool isEndWithDecrementIfNeeded(::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool isDecrementNeeded); - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - SyllabicTextGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceDirectionGroup ); +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup); - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialVoiceDirectionGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( BeatUnitGroup ); +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, EditorialGroupPtr &group); - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - BeatUnitGroupPtr& group ); +MX_FORWARD_DECLARE_ELEMENT(EditorialVoiceGroup); - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelationGroup ); +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, EditorialVoiceGroupPtr &group); - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - MetronomeRelationGroupPtr& group, - bool& hasGroup ); +MX_FORWARD_DECLARE_ELEMENT(LayoutGroup); - MX_FORWARD_DECLARE_ELEMENT( TimeSignatureGroup ); +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, LayoutGroupPtr &group); - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - TimeSignatureGroupPtr& group ); +MX_FORWARD_DECLARE_ELEMENT(DisplayStepOctaveGroup); - MX_FORWARD_DECLARE_ELEMENT( MidiInstrument ); +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, DisplayStepOctaveGroupPtr &group, bool &hasGroup); - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - MidiInstrumentPtr& group ); +MX_FORWARD_DECLARE_ELEMENT(SyllabicTextGroup); - MX_FORWARD_DECLARE_ELEMENT( CreditWordsGroup ); +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, SyllabicTextGroupPtr &group); - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - CreditWordsGroupPtr& group ); +MX_FORWARD_DECLARE_ELEMENT(EditorialVoiceDirectionGroup); -/* - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - BeatUnitPerPtr& group ); -*/ - - template - bool checkSetChoiceMember( - std::ostream& message, - ::ezxml::XElement& xelement, - bool& isSuccess, - std::shared_ptr& elementPtr, - std::string choiceElementName, - std::shared_ptr ( CHOICE_CLASS_TYPE:: *getFunction ) () const, - int choiceValue ) - { - if( xelement.getName() != choiceElementName ) - { - return false; - } - using enumType = typename CHOICE_CLASS_TYPE::Choice; - auto enumValue = static_cast( choiceValue ); - auto& parent = *elementPtr; - auto childPtr = ( ( parent ).*( getFunction ) )(); - isSuccess &= childPtr->fromXElement( message, xelement ); - parent.setChoice( enumValue ); - return true; - } +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, EditorialVoiceDirectionGroupPtr &group); +MX_FORWARD_DECLARE_ELEMENT(BeatUnitGroup); - template - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - T& assignmentTarget, - bool& hasAttribute, - const char* const attributeName, - T (*parseFunction)( const std::string& ) ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget = parseFunction( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSucces = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - defaulting to value '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, BeatUnitGroupPtr &group); +MX_FORWARD_DECLARE_ELEMENT(MetronomeRelationGroup); - class XsString; +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, MetronomeRelationGroupPtr &group, bool &hasGroup); - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - XsString& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +MX_FORWARD_DECLARE_ELEMENT(TimeSignatureGroup); +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, TimeSignatureGroupPtr &group); - class Decimal; +MX_FORWARD_DECLARE_ELEMENT(MidiInstrument); - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - Decimal& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, MidiInstrumentPtr &group); +MX_FORWARD_DECLARE_ELEMENT(CreditWordsGroup); - class Integer; +void importGroup(std::ostream &message, ::ezxml::XElementIterator &iter, ::ezxml::XElementIterator &endIter, + bool &isSuccess, CreditWordsGroupPtr &group); - bool parseAttribute( +/* + void importGroup( std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - Integer& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - + ::ezxml::XElementIterator& iter, + ::ezxml::XElementIterator& endIter, + bool& isSuccess, + BeatUnitPerPtr& group ); +*/ - class Color; +template +bool checkSetChoiceMember(std::ostream &message, ::ezxml::XElement &xelement, bool &isSuccess, + std::shared_ptr &elementPtr, std::string choiceElementName, + std::shared_ptr (CHOICE_CLASS_TYPE::*getFunction)() const, int choiceValue) +{ + if (xelement.getName() != choiceElementName) + { + return false; + } + using enumType = typename CHOICE_CLASS_TYPE::Choice; + auto enumValue = static_cast(choiceValue); + auto &parent = *elementPtr; + auto childPtr = ((parent).*(getFunction))(); + isSuccess &= childPtr->fromXElement(message, xelement); + parent.setChoice(enumValue); + return true; +} - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - Color& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +template +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, T &assignmentTarget, bool &hasAttribute, const char *const attributeName, + T (*parseFunction)(const std::string &)) +{ + if (iter->getName() != attributeName) + { + return false; + } + hasAttribute = true; + assignmentTarget = parseFunction(iter->getValue()); + if (iter->getValue() != toString(assignmentTarget)) + { + isSucces = false; + message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; + message << iter->getValue() << "' was unrecognized - defaulting to value '"; + message << toString(assignmentTarget) << "'"; + } + return true; +} +class XsString; - class Date; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, XsString &assignmentTarget, bool &hasAttribute, const char *const attributeName); - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - Date& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +class Decimal; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, Decimal &assignmentTarget, bool &hasAttribute, const char *const attributeName); - class FontSize; +class Integer; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - FontSize& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, Integer &assignmentTarget, bool &hasAttribute, const char *const attributeName); +class Color; - class NumberOrNormal; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, Color &assignmentTarget, bool &hasAttribute, const char *const attributeName); - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - NumberOrNormal& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +class Date; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, Date &assignmentTarget, bool &hasAttribute, const char *const attributeName); - class PositiveIntegerOrEmpty; +class FontSize; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - PositiveIntegerOrEmpty& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, FontSize &assignmentTarget, bool &hasAttribute, const char *const attributeName); +class NumberOrNormal; - class YesNoNumber; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, NumberOrNormal &assignmentTarget, bool &hasAttribute, + const char *const attributeName); - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - YesNoNumber& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +class PositiveIntegerOrEmpty; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, PositiveIntegerOrEmpty &assignmentTarget, bool &hasAttribute, + const char *const attributeName); - class CommaSeparatedText; +class YesNoNumber; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - CommaSeparatedText& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, YesNoNumber &assignmentTarget, bool &hasAttribute, const char *const attributeName); +class CommaSeparatedText; - class DistanceType; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, CommaSeparatedText &assignmentTarget, bool &hasAttribute, + const char *const attributeName); - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - DistanceType& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); +class DistanceType; +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, DistanceType &assignmentTarget, bool &hasAttribute, + const char *const attributeName); - class LineWidthType; +class LineWidthType; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - LineWidthType& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, LineWidthType &assignmentTarget, bool &hasAttribute, + const char *const attributeName); - class CommaSeparatedListOfPositiveIntegers; +class CommaSeparatedListOfPositiveIntegers; - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - CommaSeparatedListOfPositiveIntegers& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - } -} +bool parseAttribute(std::ostream &message, ::ezxml::XAttributeIterator &iter, const std::string &className, + bool &isSucces, CommaSeparatedListOfPositiveIntegers &assignmentTarget, bool &hasAttribute, + const char *const attributeName); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Integers.cpp b/Sourcecode/private/mx/core/Integers.cpp index c13b3277f..256d46893 100644 --- a/Sourcecode/private/mx/core/Integers.cpp +++ b/Sourcecode/private/mx/core/Integers.cpp @@ -10,279 +10,206 @@ namespace mx { - namespace core - { - Integer::Integer() - : Integer{ 0 } - { - - } - - Integer::Integer( IntType value ) - : myValue{ value } - { - - } - - IntType Integer::getValue() const - { - return myValue; - } - - void Integer::setValue( IntType value ) - { - myValue = value; - } - - bool Integer::parse( const std::string& value ) - { - std::stringstream ss( value ); - IntType temp = 0; - if ( ( ss >> temp ).fail() || !( ss >> std::ws ).eof()) - { - return false; - } - setValue( temp ); - return true; - } - - std::string toString( const Integer& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - std::ostream& toStream( std::ostream& os, const Integer& value ) - { - return os << value.getValue(); - } - - - std::ostream& operator<<( std::ostream& os, const Integer& value ) - { - return toStream( os, value ); - } - - inline IntType clamp( IntType min, IntType max, IntType value ) - { - if( value < min ) - { - return min; - } - else if( value > max ) - { - return max; - } - else - { - return value; - } - } - - IntRange::IntRange( IntType min, IntType max, IntType value ) - : Integer{ clamp( min, max, value ) } - , myMin{ min } - , myMax{ max } - { - - } - - void IntRange::setValue( IntType value ) - { - Integer::setValue( clamp( myMin, myMax, value ) ); - } - - AccordionMiddleValue::AccordionMiddleValue() - :AccordionMiddleValue{ 0 } - { - - } - - AccordionMiddleValue::AccordionMiddleValue( IntType value ) - :IntRange( 0, 3, value ) - { - - } - - BeamLevel::BeamLevel() - :BeamLevel{ 0 } - { - - } - - BeamLevel::BeamLevel( IntType value ) - :IntRange( 1, 8, value ) - { - - } - - Byte::Byte() - :Byte{ 0 } - { - - } - - Byte::Byte( IntType value ) - :IntRange( 0, 255, value ) - { - - } - - FifthsValue::FifthsValue() - :FifthsValue{ 0 } - { - - } - - FifthsValue::FifthsValue( IntType value ) - :IntRange( IntMin, IntMax, value ) - { - - } - - Midi128::Midi128() - :Midi128{ 0 } - { - - } - - Midi128::Midi128( IntType value ) - :IntRange( 1, 128, value ) - { - - } - - Midi16::Midi16() - :Midi16{ 0 } - { - - } +namespace core +{ +Integer::Integer() : Integer{0} +{ +} - Midi16::Midi16( IntType value ) - :IntRange( 1, 16, value ) - { +Integer::Integer(IntType value) : myValue{value} +{ +} - } +IntType Integer::getValue() const +{ + return myValue; +} - Midi16384::Midi16384() - :Midi16384{ 0 } - { +void Integer::setValue(IntType value) +{ + myValue = value; +} - } +bool Integer::parse(const std::string &value) +{ + std::stringstream ss(value); + IntType temp = 0; + if ((ss >> temp).fail() || !(ss >> std::ws).eof()) + { + return false; + } + setValue(temp); + return true; +} - Midi16384::Midi16384( IntType value ) - :IntRange( 1, 16384, value ) - { +std::string toString(const Integer &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} - } +std::ostream &toStream(std::ostream &os, const Integer &value) +{ + return os << value.getValue(); +} - NonNegativeInteger::NonNegativeInteger() - :NonNegativeInteger{ 0 } - { +std::ostream &operator<<(std::ostream &os, const Integer &value) +{ + return toStream(os, value); +} - } +inline IntType clamp(IntType min, IntType max, IntType value) +{ + if (value < min) + { + return min; + } + else if (value > max) + { + return max; + } + else + { + return value; + } +} - NonNegativeInteger::NonNegativeInteger( IntType value ) - :IntRange( 0, IntMax, value ) - { +IntRange::IntRange(IntType min, IntType max, IntType value) : Integer{clamp(min, max, value)}, myMin{min}, myMax{max} +{ +} - } +void IntRange::setValue(IntType value) +{ + Integer::setValue(clamp(myMin, myMax, value)); +} - NumberLevel::NumberLevel() - :NumberLevel{ 0 } - { +AccordionMiddleValue::AccordionMiddleValue() : AccordionMiddleValue{0} +{ +} - } +AccordionMiddleValue::AccordionMiddleValue(IntType value) : IntRange(0, 3, value) +{ +} - NumberLevel::NumberLevel( IntType value ) - :IntRange( 1, 6, value ) - { +BeamLevel::BeamLevel() : BeamLevel{0} +{ +} - } +BeamLevel::BeamLevel(IntType value) : IntRange(1, 8, value) +{ +} - NumberOfLines::NumberOfLines() - :NumberOfLines{ 0 } - { +Byte::Byte() : Byte{0} +{ +} - } +Byte::Byte(IntType value) : IntRange(0, 255, value) +{ +} - NumberOfLines::NumberOfLines( IntType value ) - :IntRange( 0, 3, value ) - { +FifthsValue::FifthsValue() : FifthsValue{0} +{ +} - } +FifthsValue::FifthsValue(IntType value) : IntRange(IntMin, IntMax, value) +{ +} - OctaveValue::OctaveValue() - :OctaveValue{ 0 } - { +Midi128::Midi128() : Midi128{0} +{ +} - } +Midi128::Midi128(IntType value) : IntRange(1, 128, value) +{ +} - OctaveValue::OctaveValue( IntType value ) - :IntRange( 0, 9, value ) - { +Midi16::Midi16() : Midi16{0} +{ +} - } +Midi16::Midi16(IntType value) : IntRange(1, 16, value) +{ +} - PositiveInteger::PositiveInteger() - :PositiveInteger{ 0 } - { +Midi16384::Midi16384() : Midi16384{0} +{ +} - } +Midi16384::Midi16384(IntType value) : IntRange(1, 16384, value) +{ +} - PositiveInteger::PositiveInteger( IntType value ) - :IntRange( 1, IntMax, value ) - { +NonNegativeInteger::NonNegativeInteger() : NonNegativeInteger{0} +{ +} - } +NonNegativeInteger::NonNegativeInteger(IntType value) : IntRange(0, IntMax, value) +{ +} - StaffLine::StaffLine() - :StaffLine{ 0 } - { +NumberLevel::NumberLevel() : NumberLevel{0} +{ +} - } +NumberLevel::NumberLevel(IntType value) : IntRange(1, 6, value) +{ +} - StaffLine::StaffLine( IntType value ) - :IntRange( IntMin, IntMax, value ) - { +NumberOfLines::NumberOfLines() : NumberOfLines{0} +{ +} - } +NumberOfLines::NumberOfLines(IntType value) : IntRange(0, 3, value) +{ +} - StaffNumber::StaffNumber() - :StaffNumber{ 0 } - { +OctaveValue::OctaveValue() : OctaveValue{0} +{ +} - } +OctaveValue::OctaveValue(IntType value) : IntRange(0, 9, value) +{ +} - StaffNumber::StaffNumber( IntType value ) - :IntRange( 1, IntMax, value ) - { +PositiveInteger::PositiveInteger() : PositiveInteger{0} +{ +} - } +PositiveInteger::PositiveInteger(IntType value) : IntRange(1, IntMax, value) +{ +} - StringNumber::StringNumber() - :StringNumber{ 0 } - { +StaffLine::StaffLine() : StaffLine{0} +{ +} - } +StaffLine::StaffLine(IntType value) : IntRange(IntMin, IntMax, value) +{ +} - StringNumber::StringNumber( IntType value ) - :IntRange( 1, IntMax, value ) - { +StaffNumber::StaffNumber() : StaffNumber{0} +{ +} - } +StaffNumber::StaffNumber(IntType value) : IntRange(1, IntMax, value) +{ +} - TremoloMarks::TremoloMarks() - :TremoloMarks{ 0 } - { +StringNumber::StringNumber() : StringNumber{0} +{ +} - } +StringNumber::StringNumber(IntType value) : IntRange(1, IntMax, value) +{ +} - TremoloMarks::TremoloMarks( IntType value ) - :IntRange( 0, 8, value ) - { +TremoloMarks::TremoloMarks() : TremoloMarks{0} +{ +} - } - } +TremoloMarks::TremoloMarks(IntType value) : IntRange(0, 8, value) +{ } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/Integers.h b/Sourcecode/private/mx/core/Integers.h index baa73a7a1..3f34ec37a 100644 --- a/Sourcecode/private/mx/core/Integers.h +++ b/Sourcecode/private/mx/core/Integers.h @@ -10,231 +10,232 @@ namespace mx { - namespace core - { - /// Alias for the int type used by this library. - using IntType = int; - constexpr const IntType IntMin = std::numeric_limits::min(); - constexpr const IntType IntMax = std::numeric_limits::max(); - - /// A base class for all integer types. - class Integer - { - public: - Integer(); - explicit Integer( IntType value ); - virtual ~Integer() = default; - Integer( const Integer& ) = default; - Integer( Integer&& ) = default; - Integer& operator=( const Integer& ) = default; - Integer& operator=( Integer&& ) = default; - [[nodiscard]] IntType getValue() const; - virtual void setValue( IntType value ); - bool parse( const std::string& value ); - private: - IntType myValue; - }; - - - std::string toString( const Integer& value ); - std::ostream& toStream( std::ostream& os, const Integer& value ); - std::ostream& operator<<( std::ostream& os, const Integer& value ); - - /// A 'clamped', or 'ranged' Integer where the value can never be set - /// less than min or greater than max. - class IntRange : public Integer - { - public: - explicit IntRange( IntType min, IntType max, IntType value ); - void setValue( IntType value ) override; - private: - IntType myMin; - IntType myMax; - }; - - /// The accordion-middle type may have values of 1, 2, or 3, corresponding to having 1 to 3 - /// dots in the middle section of the accordion registration symbol. - /// - /// Note: MusicXML specifies the minimum allowable value as 1, however test documents exist - /// that have a value of 0. This library supports a minimum value of 0. Per - /// https://github.com/w3c/musicxml/issues/134, the correct representation for 0 dots is to - /// omit the element, so it is possible to create invalid MusicXML by setting the value to 0 - /// here. - /// - /// Range: min=0, max=3 - class AccordionMiddleValue : public IntRange - { - public: - explicit AccordionMiddleValue( IntType value ); - AccordionMiddleValue(); - }; - - /// The MusicXML format supports six levels of beaming, up to 1024th notes. Unlike the - /// number-level type, the beam-level type identifies concurrent beams in a beam group. It - /// does not distinguish overlapping beams such as grace notes within regular notes, or - /// beams used in different voices. - /// - /// Range: min=1, max=8 - class BeamLevel : public IntRange - { - public: - explicit BeamLevel( IntType value ); - BeamLevel(); - }; - - /// This is not part of MusicXML. It represents a clamped byte. - /// - /// Range: min=0, max=255 - class Byte : public IntRange - { - public: - explicit Byte( IntType value ); - Byte(); - }; - - /// The fifths type represents the number of flats or sharps in a traditional key signature. - /// Negative numbers are used for flats and positive numbers for sharps, reflecting the - /// key's placement within the circle of fifths (hence the type name). - /// - /// Range: min=None, max=None - class FifthsValue : public IntRange - { - public: - explicit FifthsValue( IntType value ); - FifthsValue(); - }; - - /// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 128. - /// - /// Range: min=1, max=128 - class Midi128 : public IntRange - { - public: - explicit Midi128( IntType value ); - Midi128(); - }; - - /// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 16. - /// - /// Range: min=1, max=16 - class Midi16 : public IntRange - { - public: - explicit Midi16( IntType value ); - Midi16(); - }; - - /// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 16,384. - /// - /// Range: min=1, max=16384 - class Midi16384 : public IntRange - { - public: - explicit Midi16384( IntType value ); - Midi16384(); - }; - - /// The built-in primitive xs:nonNegativeInteger - /// - /// Range: min=0, max=None - class NonNegativeInteger : public IntRange - { - public: - explicit NonNegativeInteger( IntType value ); - NonNegativeInteger(); - }; - - /// Slurs, tuplets, and many other features can be concurrent and overlapping within a - /// single musical part. The number-level type distinguishes up to six concurrent objects of - /// the same type. A reading program should be prepared to handle cases where the number- - /// levels stop in an arbitrary order. Different numbers are needed when the features - /// overlap in MusicXML document order. When a number-level value is implied, the value is 1 - /// by default. - /// - /// Range: min=1, max=6 - class NumberLevel : public IntRange - { - public: - explicit NumberLevel( IntType value ); - NumberLevel(); - }; - - /// The number-of-lines type is used to specify the number of lines in text decoration - /// attributes. - /// - /// Range: min=0, max=3 - class NumberOfLines : public IntRange - { - public: - explicit NumberOfLines( IntType value ); - NumberOfLines(); - }; - - /// Octaves are represented by the numbers 0 to 9, where 4 indicates the octave started by - /// middle C. - /// - /// Range: min=0, max=9 - class OctaveValue : public IntRange - { - public: - explicit OctaveValue( IntType value ); - OctaveValue(); - }; - - /// The built-in primitive xs:positiveInteger - /// - /// Range: min=1, max=None - class PositiveInteger : public IntRange - { - public: - explicit PositiveInteger( IntType value ); - PositiveInteger(); - }; - - /// The staff-line type indicates the line on a given staff. Staff lines are numbered from - /// bottom to top, with 1 being the bottom line on a staff. Staff line values can be used to - /// specify positions outside the staff, such as a C clef positioned in the middle of a - /// grand staff. - /// - /// Range: min=None, max=None - class StaffLine : public IntRange - { - public: - explicit StaffLine( IntType value ); - StaffLine(); - }; - - /// The staff-number type indicates staff numbers within a multi-staff part. Staves are - /// numbered from top to bottom, with 1 being the top staff on a part. - /// - /// Range: min=1, max=None - class StaffNumber : public IntRange - { - public: - explicit StaffNumber( IntType value ); - StaffNumber(); - }; - - /// The string-number type indicates a string number. Strings are numbered from high to low, - /// with 1 being the highest pitched string. - /// - /// Range: min=1, max=None - class StringNumber : public IntRange - { - public: - explicit StringNumber( IntType value ); - StringNumber(); - }; - - /// The number of tremolo marks is represented by a number from 0 to 8: the same as beam- - /// level with 0 added. - /// - /// Range: min=0, max=8 - class TremoloMarks : public IntRange - { - public: - explicit TremoloMarks( IntType value ); - TremoloMarks(); - }; - } -} +namespace core +{ +/// Alias for the int type used by this library. +using IntType = int; +constexpr const IntType IntMin = std::numeric_limits::min(); +constexpr const IntType IntMax = std::numeric_limits::max(); + +/// A base class for all integer types. +class Integer +{ + public: + Integer(); + explicit Integer(IntType value); + virtual ~Integer() = default; + Integer(const Integer &) = default; + Integer(Integer &&) = default; + Integer &operator=(const Integer &) = default; + Integer &operator=(Integer &&) = default; + [[nodiscard]] IntType getValue() const; + virtual void setValue(IntType value); + bool parse(const std::string &value); + + private: + IntType myValue; +}; + +std::string toString(const Integer &value); +std::ostream &toStream(std::ostream &os, const Integer &value); +std::ostream &operator<<(std::ostream &os, const Integer &value); + +/// A 'clamped', or 'ranged' Integer where the value can never be set +/// less than min or greater than max. +class IntRange : public Integer +{ + public: + explicit IntRange(IntType min, IntType max, IntType value); + void setValue(IntType value) override; + + private: + IntType myMin; + IntType myMax; +}; + +/// The accordion-middle type may have values of 1, 2, or 3, corresponding to having 1 to 3 +/// dots in the middle section of the accordion registration symbol. +/// +/// Note: MusicXML specifies the minimum allowable value as 1, however test documents exist +/// that have a value of 0. This library supports a minimum value of 0. Per +/// https://github.com/w3c/musicxml/issues/134, the correct representation for 0 dots is to +/// omit the element, so it is possible to create invalid MusicXML by setting the value to 0 +/// here. +/// +/// Range: min=0, max=3 +class AccordionMiddleValue : public IntRange +{ + public: + explicit AccordionMiddleValue(IntType value); + AccordionMiddleValue(); +}; + +/// The MusicXML format supports six levels of beaming, up to 1024th notes. Unlike the +/// number-level type, the beam-level type identifies concurrent beams in a beam group. It +/// does not distinguish overlapping beams such as grace notes within regular notes, or +/// beams used in different voices. +/// +/// Range: min=1, max=8 +class BeamLevel : public IntRange +{ + public: + explicit BeamLevel(IntType value); + BeamLevel(); +}; + +/// This is not part of MusicXML. It represents a clamped byte. +/// +/// Range: min=0, max=255 +class Byte : public IntRange +{ + public: + explicit Byte(IntType value); + Byte(); +}; + +/// The fifths type represents the number of flats or sharps in a traditional key signature. +/// Negative numbers are used for flats and positive numbers for sharps, reflecting the +/// key's placement within the circle of fifths (hence the type name). +/// +/// Range: min=None, max=None +class FifthsValue : public IntRange +{ + public: + explicit FifthsValue(IntType value); + FifthsValue(); +}; + +/// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 128. +/// +/// Range: min=1, max=128 +class Midi128 : public IntRange +{ + public: + explicit Midi128(IntType value); + Midi128(); +}; + +/// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 16. +/// +/// Range: min=1, max=16 +class Midi16 : public IntRange +{ + public: + explicit Midi16(IntType value); + Midi16(); +}; + +/// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 16,384. +/// +/// Range: min=1, max=16384 +class Midi16384 : public IntRange +{ + public: + explicit Midi16384(IntType value); + Midi16384(); +}; + +/// The built-in primitive xs:nonNegativeInteger +/// +/// Range: min=0, max=None +class NonNegativeInteger : public IntRange +{ + public: + explicit NonNegativeInteger(IntType value); + NonNegativeInteger(); +}; + +/// Slurs, tuplets, and many other features can be concurrent and overlapping within a +/// single musical part. The number-level type distinguishes up to six concurrent objects of +/// the same type. A reading program should be prepared to handle cases where the number- +/// levels stop in an arbitrary order. Different numbers are needed when the features +/// overlap in MusicXML document order. When a number-level value is implied, the value is 1 +/// by default. +/// +/// Range: min=1, max=6 +class NumberLevel : public IntRange +{ + public: + explicit NumberLevel(IntType value); + NumberLevel(); +}; + +/// The number-of-lines type is used to specify the number of lines in text decoration +/// attributes. +/// +/// Range: min=0, max=3 +class NumberOfLines : public IntRange +{ + public: + explicit NumberOfLines(IntType value); + NumberOfLines(); +}; + +/// Octaves are represented by the numbers 0 to 9, where 4 indicates the octave started by +/// middle C. +/// +/// Range: min=0, max=9 +class OctaveValue : public IntRange +{ + public: + explicit OctaveValue(IntType value); + OctaveValue(); +}; + +/// The built-in primitive xs:positiveInteger +/// +/// Range: min=1, max=None +class PositiveInteger : public IntRange +{ + public: + explicit PositiveInteger(IntType value); + PositiveInteger(); +}; + +/// The staff-line type indicates the line on a given staff. Staff lines are numbered from +/// bottom to top, with 1 being the bottom line on a staff. Staff line values can be used to +/// specify positions outside the staff, such as a C clef positioned in the middle of a +/// grand staff. +/// +/// Range: min=None, max=None +class StaffLine : public IntRange +{ + public: + explicit StaffLine(IntType value); + StaffLine(); +}; + +/// The staff-number type indicates staff numbers within a multi-staff part. Staves are +/// numbered from top to bottom, with 1 being the top staff on a part. +/// +/// Range: min=1, max=None +class StaffNumber : public IntRange +{ + public: + explicit StaffNumber(IntType value); + StaffNumber(); +}; + +/// The string-number type indicates a string number. Strings are numbered from high to low, +/// with 1 being the highest pitched string. +/// +/// Range: min=1, max=None +class StringNumber : public IntRange +{ + public: + explicit StringNumber(IntType value); + StringNumber(); +}; + +/// The number of tremolo marks is represented by a number from 0 to 8: the same as beam- +/// level with 0 added. +/// +/// Range: min=0, max=8 +class TremoloMarks : public IntRange +{ + public: + explicit TremoloMarks(IntType value); + TremoloMarks(); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/NumberOrNormal.cpp b/Sourcecode/private/mx/core/NumberOrNormal.cpp index db52fb232..d05a368fd 100644 --- a/Sourcecode/private/mx/core/NumberOrNormal.cpp +++ b/Sourcecode/private/mx/core/NumberOrNormal.cpp @@ -10,151 +10,162 @@ namespace mx { - namespace core +namespace core +{ +class NumberOrNormal::impl +{ + public: + explicit impl() : myDecimal(0), myIsNormal(true) { - class NumberOrNormal::impl - { - public: - explicit impl() - :myDecimal( 0 ) - ,myIsNormal( true ) - {} - - explicit impl( const Decimal& value ) - :myDecimal( value ) - ,myIsNormal( false ) - {} - - explicit impl( const std::string& value ) - :myDecimal( 0 ) - ,myIsNormal( false ) - { - parse( value ); - } - - bool getIsNormal() const - { - return myIsNormal; - } - bool getIsNumber() const - { - return ! myIsNormal; - } - void setValueNormal() - { - myDecimal = Decimal( 0 ); - myIsNormal = true;; - } - void setValue( const Decimal& value ) - { - myDecimal = Decimal( value ); - myIsNormal = false; - } - Decimal getValueNumber() const - { - return myDecimal; - } - void parse( const std::string& value ) - { - if ( value == "normal" ) - { - myDecimal = Decimal( 0 ); - myIsNormal = true; - } - else - { - /* if it contains only numeric - characters it must be a number */ - myDecimal.parse( value ); - myIsNormal = false; - } - } - private: - Decimal myDecimal; - bool myIsNormal; - }; - - - NumberOrNormal::NumberOrNormal() - :myImpl( new impl() ) - {} - - NumberOrNormal::NumberOrNormal( const Decimal& value ) - :myImpl( new impl( value ) ) - {} - - NumberOrNormal::NumberOrNormal( const std::string& value ) - :myImpl( new impl( value ) ) - {} - - NumberOrNormal::~NumberOrNormal() {} - - NumberOrNormal::NumberOrNormal( const NumberOrNormal& other ) - :myImpl( new NumberOrNormal::impl( *other.myImpl ) ) - {} - - NumberOrNormal::NumberOrNormal( NumberOrNormal&& other ) - :myImpl( std::move( other.myImpl ) ) - {} - - NumberOrNormal& NumberOrNormal::operator=( NumberOrNormal&& other ) - { - myImpl = std::move( other.myImpl ); - return *this; - } - - NumberOrNormal& NumberOrNormal::operator=( const NumberOrNormal& other ) - { - this->myImpl = std::unique_ptr( new NumberOrNormal::impl( *other.myImpl ) ); - return *this; - } - bool NumberOrNormal::getIsNormal() const - { - return myImpl->getIsNormal(); - } - bool NumberOrNormal::getIsNumber() const - { - return myImpl->getIsNumber(); - } - void NumberOrNormal::setValueNormal() - { - myImpl->setValueNormal(); - } - void NumberOrNormal::setValue( const Decimal& value ) - { - myImpl->setValue( value ); - } - Decimal NumberOrNormal::getValueNumber() const - { - return myImpl->getValueNumber(); - } - - void NumberOrNormal::parse( const std::string& value ) - { - myImpl->parse( value ); - } - - std::string toString( const NumberOrNormal& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - std::ostream& toStream( std::ostream& os, const NumberOrNormal& value ) + } + + explicit impl(const Decimal &value) : myDecimal(value), myIsNormal(false) + { + } + + explicit impl(const std::string &value) : myDecimal(0), myIsNormal(false) + { + parse(value); + } + + bool getIsNormal() const + { + return myIsNormal; + } + + bool getIsNumber() const + { + return !myIsNormal; + } + + void setValueNormal() + { + myDecimal = Decimal(0); + myIsNormal = true; + ; + } + + void setValue(const Decimal &value) + { + myDecimal = Decimal(value); + myIsNormal = false; + } + + Decimal getValueNumber() const + { + return myDecimal; + } + + void parse(const std::string &value) + { + if (value == "normal") { - if ( value.getIsNumber() ) - { - toStream( os, value.getValueNumber() ); - } - else - { - os << "normal"; - } - return os; + myDecimal = Decimal(0); + myIsNormal = true; } - std::ostream& operator<<( std::ostream& os, const NumberOrNormal& value ) + else { - return toStream( os, value ); + /* if it contains only numeric + characters it must be a number */ + myDecimal.parse(value); + myIsNormal = false; } } + + private: + Decimal myDecimal; + bool myIsNormal; +}; + +NumberOrNormal::NumberOrNormal() : myImpl(new impl()) +{ +} + +NumberOrNormal::NumberOrNormal(const Decimal &value) : myImpl(new impl(value)) +{ +} + +NumberOrNormal::NumberOrNormal(const std::string &value) : myImpl(new impl(value)) +{ +} + +NumberOrNormal::~NumberOrNormal() +{ +} + +NumberOrNormal::NumberOrNormal(const NumberOrNormal &other) : myImpl(new NumberOrNormal::impl(*other.myImpl)) +{ +} + +NumberOrNormal::NumberOrNormal(NumberOrNormal &&other) : myImpl(std::move(other.myImpl)) +{ +} + +NumberOrNormal &NumberOrNormal::operator=(NumberOrNormal &&other) +{ + myImpl = std::move(other.myImpl); + return *this; +} + +NumberOrNormal &NumberOrNormal::operator=(const NumberOrNormal &other) +{ + this->myImpl = std::unique_ptr(new NumberOrNormal::impl(*other.myImpl)); + return *this; +} + +bool NumberOrNormal::getIsNormal() const +{ + return myImpl->getIsNormal(); +} + +bool NumberOrNormal::getIsNumber() const +{ + return myImpl->getIsNumber(); +} + +void NumberOrNormal::setValueNormal() +{ + myImpl->setValueNormal(); +} + +void NumberOrNormal::setValue(const Decimal &value) +{ + myImpl->setValue(value); +} + +Decimal NumberOrNormal::getValueNumber() const +{ + return myImpl->getValueNumber(); +} + +void NumberOrNormal::parse(const std::string &value) +{ + myImpl->parse(value); +} + +std::string toString(const NumberOrNormal &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +std::ostream &toStream(std::ostream &os, const NumberOrNormal &value) +{ + if (value.getIsNumber()) + { + toStream(os, value.getValueNumber()); + } + else + { + os << "normal"; + } + return os; +} + +std::ostream &operator<<(std::ostream &os, const NumberOrNormal &value) +{ + return toStream(os, value); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/NumberOrNormal.h b/Sourcecode/private/mx/core/NumberOrNormal.h index e95ca0f5d..7271ec6c5 100644 --- a/Sourcecode/private/mx/core/NumberOrNormal.h +++ b/Sourcecode/private/mx/core/NumberOrNormal.h @@ -12,36 +12,36 @@ namespace mx { - namespace core - { - /// The number-or-normal values can be either a decimal number or the string "normal". This - /// is used by the line-height and letter-spacing attributes. - class NumberOrNormal - { - public: - explicit NumberOrNormal(); - explicit NumberOrNormal( const Decimal& value ); - explicit NumberOrNormal( const std::string& value ); - virtual ~NumberOrNormal(); - NumberOrNormal( const NumberOrNormal& other ); - NumberOrNormal( NumberOrNormal&& other ); - NumberOrNormal& operator=( const NumberOrNormal& other ); - NumberOrNormal& operator=( NumberOrNormal&& other ); - - bool getIsNormal() const; - bool getIsNumber() const; - void setValueNormal(); - void setValue( const Decimal& value ); - Decimal getValueNumber() const; - void parse( const std::string& value ); - - private: - class impl; - std::unique_ptr myImpl; - }; - - std::string toString( const NumberOrNormal& value ); - std::ostream& toStream( std::ostream& os, const NumberOrNormal& value ); - std::ostream& operator<<( std::ostream& os, const NumberOrNormal& value ); - } -} +namespace core +{ +/// The number-or-normal values can be either a decimal number or the string "normal". This +/// is used by the line-height and letter-spacing attributes. +class NumberOrNormal +{ + public: + explicit NumberOrNormal(); + explicit NumberOrNormal(const Decimal &value); + explicit NumberOrNormal(const std::string &value); + virtual ~NumberOrNormal(); + NumberOrNormal(const NumberOrNormal &other); + NumberOrNormal(NumberOrNormal &&other); + NumberOrNormal &operator=(const NumberOrNormal &other); + NumberOrNormal &operator=(NumberOrNormal &&other); + + bool getIsNormal() const; + bool getIsNumber() const; + void setValueNormal(); + void setValue(const Decimal &value); + Decimal getValueNumber() const; + void parse(const std::string &value); + + private: + class impl; + std::unique_ptr myImpl; +}; + +std::string toString(const NumberOrNormal &value); +std::ostream &toStream(std::ostream &os, const NumberOrNormal &value); +std::ostream &operator<<(std::ostream &os, const NumberOrNormal &value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/PlaybackSound.h b/Sourcecode/private/mx/core/PlaybackSound.h index 2e4f0258c..6eacd98fd 100644 --- a/Sourcecode/private/mx/core/PlaybackSound.h +++ b/Sourcecode/private/mx/core/PlaybackSound.h @@ -9,901 +9,901 @@ namespace mx { - namespace core - { - #define MX_ENUM_CLASS_NAME PlaybackSound +namespace core +{ +#define MX_ENUM_CLASS_NAME PlaybackSound - #define MX_ENUM_MEMBERS( MX_ENUM_VALUE ) \ - MX_ENUM_VALUE( brassAlphorn, "brass.alphorn" ) \ - MX_ENUM_VALUE( brassAltoHorn, "brass.alto-horn" ) \ - MX_ENUM_VALUE( brassBaritoneHorn, "brass.baritone-horn" ) \ - MX_ENUM_VALUE( brassBugle, "brass.bugle" ) \ - MX_ENUM_VALUE( brassBugleAlto, "brass.bugle.alto" ) \ - MX_ENUM_VALUE( brassBugleBaritone, "brass.bugle.baritone" ) \ - MX_ENUM_VALUE( brassBugleContrabass, "brass.bugle.contrabass" ) \ - MX_ENUM_VALUE( brassBugleEuphoniumBugle, "brass.bugle.euphonium-bugle" ) \ - MX_ENUM_VALUE( brassBugleMellophoneBugle, "brass.bugle.mellophone-bugle" ) \ - MX_ENUM_VALUE( brassBugleSoprano, "brass.bugle.soprano" ) \ - MX_ENUM_VALUE( brassCimbasso, "brass.cimbasso" ) \ - MX_ENUM_VALUE( brassConchShell, "brass.conch-shell" ) \ - MX_ENUM_VALUE( brassCornet, "brass.cornet" ) \ - MX_ENUM_VALUE( brassCornetSoprano, "brass.cornet.soprano" ) \ - MX_ENUM_VALUE( brassCornett, "brass.cornett" ) \ - MX_ENUM_VALUE( brassCornettTenor, "brass.cornett.tenor" ) \ - MX_ENUM_VALUE( brassCornettino, "brass.cornettino" ) \ - MX_ENUM_VALUE( brassDidgeridoo, "brass.didgeridoo" ) \ - MX_ENUM_VALUE( brassEuphonium, "brass.euphonium" ) \ - MX_ENUM_VALUE( brassFiscorn, "brass.fiscorn" ) \ - MX_ENUM_VALUE( brassFlugelhorn, "brass.flugelhorn" ) \ - MX_ENUM_VALUE( brassFrenchHorn, "brass.french-horn" ) \ - MX_ENUM_VALUE( brassGroup, "brass.group" ) \ - MX_ENUM_VALUE( brassGroupSynth, "brass.group.synth" ) \ - MX_ENUM_VALUE( brassHelicon, "brass.helicon" ) \ - MX_ENUM_VALUE( brassHoragai, "brass.horagai" ) \ - MX_ENUM_VALUE( brassKuhlohorn, "brass.kuhlohorn" ) \ - MX_ENUM_VALUE( brassMellophone, "brass.mellophone" ) \ - MX_ENUM_VALUE( brassNaturalHorn, "brass.natural-horn" ) \ - MX_ENUM_VALUE( brassOphicleide, "brass.ophicleide" ) \ - MX_ENUM_VALUE( brassPosthorn, "brass.posthorn" ) \ - MX_ENUM_VALUE( brassRagDung, "brass.rag-dung" ) \ - MX_ENUM_VALUE( brassSackbutt, "brass.sackbutt" ) \ - MX_ENUM_VALUE( brassSackbuttAlto, "brass.sackbutt.alto" ) \ - MX_ENUM_VALUE( brassSackbuttBass, "brass.sackbutt.bass" ) \ - MX_ENUM_VALUE( brassSackbuttTenor, "brass.sackbutt.tenor" ) \ - MX_ENUM_VALUE( brassSaxhorn, "brass.saxhorn" ) \ - MX_ENUM_VALUE( brassSerpent, "brass.serpent" ) \ - MX_ENUM_VALUE( brassShofar, "brass.shofar" ) \ - MX_ENUM_VALUE( brassSousaphone, "brass.sousaphone" ) \ - MX_ENUM_VALUE( brassTrombone, "brass.trombone" ) \ - MX_ENUM_VALUE( brassTromboneAlto, "brass.trombone.alto" ) \ - MX_ENUM_VALUE( brassTromboneBass, "brass.trombone.bass" ) \ - MX_ENUM_VALUE( brassTromboneContrabass, "brass.trombone.contrabass" ) \ - MX_ENUM_VALUE( brassTromboneTenor, "brass.trombone.tenor" ) \ - MX_ENUM_VALUE( brassTrumpet, "brass.trumpet" ) \ - MX_ENUM_VALUE( brassTrumpetBaroque, "brass.trumpet.baroque" ) \ - MX_ENUM_VALUE( brassTrumpetBass, "brass.trumpet.bass" ) \ - MX_ENUM_VALUE( brassTrumpetBflat, "brass.trumpet.bflat" ) \ - MX_ENUM_VALUE( brassTrumpetC, "brass.trumpet.c" ) \ - MX_ENUM_VALUE( brassTrumpetD, "brass.trumpet.d" ) \ - MX_ENUM_VALUE( brassTrumpetPiccolo, "brass.trumpet.piccolo" ) \ - MX_ENUM_VALUE( brassTrumpetPocket, "brass.trumpet.pocket" ) \ - MX_ENUM_VALUE( brassTrumpetSlide, "brass.trumpet.slide" ) \ - MX_ENUM_VALUE( brassTrumpetTenor, "brass.trumpet.tenor" ) \ - MX_ENUM_VALUE( brassTuba, "brass.tuba" ) \ - MX_ENUM_VALUE( brassTubaBass, "brass.tuba.bass" ) \ - MX_ENUM_VALUE( brassTubaSubcontrabass, "brass.tuba.subcontrabass" ) \ - MX_ENUM_VALUE( brassViennaHorn, "brass.vienna-horn" ) \ - MX_ENUM_VALUE( brassVuvuzela, "brass.vuvuzela" ) \ - MX_ENUM_VALUE( brassWagnerTuba, "brass.wagner-tuba" ) \ - MX_ENUM_VALUE( drumApentemma, "drum.apentemma" ) \ - MX_ENUM_VALUE( drumAshiko, "drum.ashiko" ) \ - MX_ENUM_VALUE( drumAtabaque, "drum.atabaque" ) \ - MX_ENUM_VALUE( drumAtoke, "drum.atoke" ) \ - MX_ENUM_VALUE( drumAtsimevu, "drum.atsimevu" ) \ - MX_ENUM_VALUE( drumAxatse, "drum.axatse" ) \ - MX_ENUM_VALUE( drumBassDrum, "drum.bass-drum" ) \ - MX_ENUM_VALUE( drumBata, "drum.bata" ) \ - MX_ENUM_VALUE( drumBataItotele, "drum.bata.itotele" ) \ - MX_ENUM_VALUE( drumBataIya, "drum.bata.iya" ) \ - MX_ENUM_VALUE( drumBataOkonkolo, "drum.bata.okonkolo" ) \ - MX_ENUM_VALUE( drumBendir, "drum.bendir" ) \ - MX_ENUM_VALUE( drumBodhran, "drum.bodhran" ) \ - MX_ENUM_VALUE( drumBombo, "drum.bombo" ) \ - MX_ENUM_VALUE( drumBongo, "drum.bongo" ) \ - MX_ENUM_VALUE( drumBougarabou, "drum.bougarabou" ) \ - MX_ENUM_VALUE( drumBuffaloDrum, "drum.buffalo-drum" ) \ - MX_ENUM_VALUE( drumCajon, "drum.cajon" ) \ - MX_ENUM_VALUE( drumChenda, "drum.chenda" ) \ - MX_ENUM_VALUE( drumChuDaiko, "drum.chu-daiko" ) \ - MX_ENUM_VALUE( drumConga, "drum.conga" ) \ - MX_ENUM_VALUE( drumCuica, "drum.cuica" ) \ - MX_ENUM_VALUE( drumDabakan, "drum.dabakan" ) \ - MX_ENUM_VALUE( drumDaff, "drum.daff" ) \ - MX_ENUM_VALUE( drumDafli, "drum.dafli" ) \ - MX_ENUM_VALUE( drumDaibyosi, "drum.daibyosi" ) \ - MX_ENUM_VALUE( drumDamroo, "drum.damroo" ) \ - MX_ENUM_VALUE( drumDarabuka, "drum.darabuka" ) \ - MX_ENUM_VALUE( drumDef, "drum.def" ) \ - MX_ENUM_VALUE( drumDhol, "drum.dhol" ) \ - MX_ENUM_VALUE( drumDholak, "drum.dholak" ) \ - MX_ENUM_VALUE( drumDjembe, "drum.djembe" ) \ - MX_ENUM_VALUE( drumDoira, "drum.doira" ) \ - MX_ENUM_VALUE( drumDondo, "drum.dondo" ) \ - MX_ENUM_VALUE( drumDounDounBa, "drum.doun-doun-ba" ) \ - MX_ENUM_VALUE( drumDuff, "drum.duff" ) \ - MX_ENUM_VALUE( drumDumbek, "drum.dumbek" ) \ - MX_ENUM_VALUE( drumFontomfrom, "drum.fontomfrom" ) \ - MX_ENUM_VALUE( drumFrameDrum, "drum.frame-drum" ) \ - MX_ENUM_VALUE( drumFrameDrumArabian, "drum.frame-drum.arabian" ) \ - MX_ENUM_VALUE( drumGeduk, "drum.geduk" ) \ - MX_ENUM_VALUE( drumGhatam, "drum.ghatam" ) \ - MX_ENUM_VALUE( drumGome, "drum.gome" ) \ - MX_ENUM_VALUE( drumGroup, "drum.group" ) \ - MX_ENUM_VALUE( drumGroupChinese, "drum.group.chinese" ) \ - MX_ENUM_VALUE( drumGroupEwe, "drum.group.ewe" ) \ - MX_ENUM_VALUE( drumGroupIndian, "drum.group.indian" ) \ - MX_ENUM_VALUE( drumGroupSet, "drum.group.set" ) \ - MX_ENUM_VALUE( drumHandDrum, "drum.hand-drum" ) \ - MX_ENUM_VALUE( drumHiraDaiko, "drum.hira-daiko" ) \ - MX_ENUM_VALUE( drumIbo, "drum.ibo" ) \ - MX_ENUM_VALUE( drumIgihumurizo, "drum.igihumurizo" ) \ - MX_ENUM_VALUE( drumInyahura, "drum.inyahura" ) \ - MX_ENUM_VALUE( drumIshakwe, "drum.ishakwe" ) \ - MX_ENUM_VALUE( drumJangGu, "drum.jang-gu" ) \ - MX_ENUM_VALUE( drumKagan, "drum.kagan" ) \ - MX_ENUM_VALUE( drumKakko, "drum.kakko" ) \ - MX_ENUM_VALUE( drumKanjira, "drum.kanjira" ) \ - MX_ENUM_VALUE( drumKendhang, "drum.kendhang" ) \ - MX_ENUM_VALUE( drumKendhangAgeng, "drum.kendhang.ageng" ) \ - MX_ENUM_VALUE( drumKendhangCiblon, "drum.kendhang.ciblon" ) \ - MX_ENUM_VALUE( drumKenkeni, "drum.kenkeni" ) \ - MX_ENUM_VALUE( drumKhol, "drum.khol" ) \ - MX_ENUM_VALUE( drumKickDrum, "drum.kick-drum" ) \ - MX_ENUM_VALUE( drumKidi, "drum.kidi" ) \ - MX_ENUM_VALUE( drumKoDaiko, "drum.ko-daiko" ) \ - MX_ENUM_VALUE( drumKpanlogo, "drum.kpanlogo" ) \ - MX_ENUM_VALUE( drumKudum, "drum.kudum" ) \ - MX_ENUM_VALUE( drumLambeg, "drum.lambeg" ) \ - MX_ENUM_VALUE( drumLionDrum, "drum.lion-drum" ) \ - MX_ENUM_VALUE( drumLogDrum, "drum.log-drum" ) \ - MX_ENUM_VALUE( drumLogDrumAfrican, "drum.log-drum.african" ) \ - MX_ENUM_VALUE( drumLogDrumNative, "drum.log-drum.native" ) \ - MX_ENUM_VALUE( drumLogDrumNigerian, "drum.log-drum.nigerian" ) \ - MX_ENUM_VALUE( drumMadal, "drum.madal" ) \ - MX_ENUM_VALUE( drumMaddale, "drum.maddale" ) \ - MX_ENUM_VALUE( drumMridangam, "drum.mridangam" ) \ - MX_ENUM_VALUE( drumNaal, "drum.naal" ) \ - MX_ENUM_VALUE( drumNagadoDaiko, "drum.nagado-daiko" ) \ - MX_ENUM_VALUE( drumNagara, "drum.nagara" ) \ - MX_ENUM_VALUE( drumNaqara, "drum.naqara" ) \ - MX_ENUM_VALUE( drumODaiko, "drum.o-daiko" ) \ - MX_ENUM_VALUE( drumOkawa, "drum.okawa" ) \ - MX_ENUM_VALUE( drumOkedoDaiko, "drum.okedo-daiko" ) \ - MX_ENUM_VALUE( drumPahuHula, "drum.pahu-hula" ) \ - MX_ENUM_VALUE( drumPakhawaj, "drum.pakhawaj" ) \ - MX_ENUM_VALUE( drumPandeiro, "drum.pandeiro" ) \ - MX_ENUM_VALUE( drumPandero, "drum.pandero" ) \ - MX_ENUM_VALUE( drumPowwow, "drum.powwow" ) \ - MX_ENUM_VALUE( drumPueblo, "drum.pueblo" ) \ - MX_ENUM_VALUE( drumRepinique, "drum.repinique" ) \ - MX_ENUM_VALUE( drumRiq, "drum.riq" ) \ - MX_ENUM_VALUE( drumRototom, "drum.rototom" ) \ - MX_ENUM_VALUE( drumSabar, "drum.sabar" ) \ - MX_ENUM_VALUE( drumSakara, "drum.sakara" ) \ - MX_ENUM_VALUE( drumSampho, "drum.sampho" ) \ - MX_ENUM_VALUE( drumSangban, "drum.sangban" ) \ - MX_ENUM_VALUE( drumShimeDaiko, "drum.shime-daiko" ) \ - MX_ENUM_VALUE( drumSlitDrum, "drum.slit-drum" ) \ - MX_ENUM_VALUE( drumSlitDrumKrin, "drum.slit-drum.krin" ) \ - MX_ENUM_VALUE( drumSnareDrum, "drum.snare-drum" ) \ - MX_ENUM_VALUE( drumSnareDrumElectric, "drum.snare-drum.electric" ) \ - MX_ENUM_VALUE( drumSogo, "drum.sogo" ) \ - MX_ENUM_VALUE( drumSurdo, "drum.surdo" ) \ - MX_ENUM_VALUE( drumTabla, "drum.tabla" ) \ - MX_ENUM_VALUE( drumTablaBayan, "drum.tabla.bayan" ) \ - MX_ENUM_VALUE( drumTablaDayan, "drum.tabla.dayan" ) \ - MX_ENUM_VALUE( drumTaiko, "drum.taiko" ) \ - MX_ENUM_VALUE( drumTalking, "drum.talking" ) \ - MX_ENUM_VALUE( drumTama, "drum.tama" ) \ - MX_ENUM_VALUE( drumTamborita, "drum.tamborita" ) \ - MX_ENUM_VALUE( drumTambourine, "drum.tambourine" ) \ - MX_ENUM_VALUE( drumTamte, "drum.tamte" ) \ - MX_ENUM_VALUE( drumTangku, "drum.tangku" ) \ - MX_ENUM_VALUE( drumTanTan, "drum.tan-tan" ) \ - MX_ENUM_VALUE( drumTaphon, "drum.taphon" ) \ - MX_ENUM_VALUE( drumTar, "drum.tar" ) \ - MX_ENUM_VALUE( drumTasha, "drum.tasha" ) \ - MX_ENUM_VALUE( drumTenorDrum, "drum.tenor-drum" ) \ - MX_ENUM_VALUE( drumTeponaxtli, "drum.teponaxtli" ) \ - MX_ENUM_VALUE( drumThavil, "drum.thavil" ) \ - MX_ENUM_VALUE( drumTheBox, "drum.the-box" ) \ - MX_ENUM_VALUE( drumTimbale, "drum.timbale" ) \ - MX_ENUM_VALUE( drumTimpani, "drum.timpani" ) \ - MX_ENUM_VALUE( drumTinaja, "drum.tinaja" ) \ - MX_ENUM_VALUE( drumToere, "drum.toere" ) \ - MX_ENUM_VALUE( drumTombak, "drum.tombak" ) \ - MX_ENUM_VALUE( drumTomTom, "drum.tom-tom" ) \ - MX_ENUM_VALUE( drumTomTomSynth, "drum.tom-tom.synth" ) \ - MX_ENUM_VALUE( drumTsuzumi, "drum.tsuzumi" ) \ - MX_ENUM_VALUE( drumTumbak, "drum.tumbak" ) \ - MX_ENUM_VALUE( drumUchiwaDaiko, "drum.uchiwa-daiko" ) \ - MX_ENUM_VALUE( drumUdaku, "drum.udaku" ) \ - MX_ENUM_VALUE( drumUdu, "drum.udu" ) \ - MX_ENUM_VALUE( drumZarb, "drum.zarb" ) \ - MX_ENUM_VALUE( effectAeolianHarp, "effect.aeolian-harp" ) \ - MX_ENUM_VALUE( effectAirHorn, "effect.air-horn" ) \ - MX_ENUM_VALUE( effectApplause, "effect.applause" ) \ - MX_ENUM_VALUE( effectBassStringSlap, "effect.bass-string-slap" ) \ - MX_ENUM_VALUE( effectBird, "effect.bird" ) \ - MX_ENUM_VALUE( effectBirdNightingale, "effect.bird.nightingale" ) \ - MX_ENUM_VALUE( effectBirdTweet, "effect.bird.tweet" ) \ - MX_ENUM_VALUE( effectBreath, "effect.breath" ) \ - MX_ENUM_VALUE( effectBubble, "effect.bubble" ) \ - MX_ENUM_VALUE( effectBullroarer, "effect.bullroarer" ) \ - MX_ENUM_VALUE( effectBurst, "effect.burst" ) \ - MX_ENUM_VALUE( effectCar, "effect.car" ) \ - MX_ENUM_VALUE( effectCarCrash, "effect.car.crash" ) \ - MX_ENUM_VALUE( effectCarEngine, "effect.car.engine" ) \ - MX_ENUM_VALUE( effectCarPass, "effect.car.pass" ) \ - MX_ENUM_VALUE( effectCarStop, "effect.car.stop" ) \ - MX_ENUM_VALUE( effectCrickets, "effect.crickets" ) \ - MX_ENUM_VALUE( effectDog, "effect.dog" ) \ - MX_ENUM_VALUE( effectDoorCreak, "effect.door.creak" ) \ - MX_ENUM_VALUE( effectDoorSlam, "effect.door.slam" ) \ - MX_ENUM_VALUE( effectExplosion, "effect.explosion" ) \ - MX_ENUM_VALUE( effectFluteKeyClick, "effect.flute-key-click" ) \ - MX_ENUM_VALUE( effectFootsteps, "effect.footsteps" ) \ - MX_ENUM_VALUE( effectFrogs, "effect.frogs" ) \ - MX_ENUM_VALUE( effectGuitarCutting, "effect.guitar-cutting" ) \ - MX_ENUM_VALUE( effectGuitarFret, "effect.guitar-fret" ) \ - MX_ENUM_VALUE( effectGunshot, "effect.gunshot" ) \ - MX_ENUM_VALUE( effectHandClap, "effect.hand-clap" ) \ - MX_ENUM_VALUE( effectHeartbeat, "effect.heartbeat" ) \ - MX_ENUM_VALUE( effectHelicopter, "effect.helicopter" ) \ - MX_ENUM_VALUE( effectHighQ, "effect.high-q" ) \ - MX_ENUM_VALUE( effectHorseGallop, "effect.horse-gallop" ) \ - MX_ENUM_VALUE( effectJetPlane, "effect.jet-plane" ) \ - MX_ENUM_VALUE( effectLaserGun, "effect.laser-gun" ) \ - MX_ENUM_VALUE( effectLaugh, "effect.laugh" ) \ - MX_ENUM_VALUE( effectLionsRoar, "effect.lions-roar" ) \ - MX_ENUM_VALUE( effectMachineGun, "effect.machine-gun" ) \ - MX_ENUM_VALUE( effectMarchingMachine, "effect.marching-machine" ) \ - MX_ENUM_VALUE( effectMetronomeBell, "effect.metronome-bell" ) \ - MX_ENUM_VALUE( effectMetronomeClick, "effect.metronome-click" ) \ - MX_ENUM_VALUE( effectPat, "effect.pat" ) \ - MX_ENUM_VALUE( effectPunch, "effect.punch" ) \ - MX_ENUM_VALUE( effectRain, "effect.rain" ) \ - MX_ENUM_VALUE( effectScratch, "effect.scratch" ) \ - MX_ENUM_VALUE( effectScream, "effect.scream" ) \ - MX_ENUM_VALUE( effectSeashore, "effect.seashore" ) \ - MX_ENUM_VALUE( effectSiren, "effect.siren" ) \ - MX_ENUM_VALUE( effectSlap, "effect.slap" ) \ - MX_ENUM_VALUE( effectSnap, "effect.snap" ) \ - MX_ENUM_VALUE( effectStamp, "effect.stamp" ) \ - MX_ENUM_VALUE( effectStarship, "effect.starship" ) \ - MX_ENUM_VALUE( effectStream, "effect.stream" ) \ - MX_ENUM_VALUE( effectTelephoneRing, "effect.telephone-ring" ) \ - MX_ENUM_VALUE( effectThunder, "effect.thunder" ) \ - MX_ENUM_VALUE( effectTrain, "effect.train" ) \ - MX_ENUM_VALUE( effectTrashCan, "effect.trash-can" ) \ - MX_ENUM_VALUE( effectWhip, "effect.whip" ) \ - MX_ENUM_VALUE( effectWhistle, "effect.whistle" ) \ - MX_ENUM_VALUE( effectWhistleMouthSiren, "effect.whistle.mouth-siren" ) \ - MX_ENUM_VALUE( effectWhistlePolice, "effect.whistle.police" ) \ - MX_ENUM_VALUE( effectWhistleSlide, "effect.whistle.slide" ) \ - MX_ENUM_VALUE( effectWhistleTrain, "effect.whistle.train" ) \ - MX_ENUM_VALUE( effectWind, "effect.wind" ) \ - MX_ENUM_VALUE( keyboardAccordion, "keyboard.accordion" ) \ - MX_ENUM_VALUE( keyboardBandoneon, "keyboard.bandoneon" ) \ - MX_ENUM_VALUE( keyboardCelesta, "keyboard.celesta" ) \ - MX_ENUM_VALUE( keyboardClavichord, "keyboard.clavichord" ) \ - MX_ENUM_VALUE( keyboardClavichordSynth, "keyboard.clavichord.synth" ) \ - MX_ENUM_VALUE( keyboardConcertina, "keyboard.concertina" ) \ - MX_ENUM_VALUE( keyboardFortepiano, "keyboard.fortepiano" ) \ - MX_ENUM_VALUE( keyboardHarmonium, "keyboard.harmonium" ) \ - MX_ENUM_VALUE( keyboardHarpsichord, "keyboard.harpsichord" ) \ - MX_ENUM_VALUE( keyboardOndesMartenot, "keyboard.ondes-martenot" ) \ - MX_ENUM_VALUE( keyboardOrgan, "keyboard.organ" ) \ - MX_ENUM_VALUE( keyboardOrganDrawbar, "keyboard.organ.drawbar" ) \ - MX_ENUM_VALUE( keyboardOrganPercussive, "keyboard.organ.percussive" ) \ - MX_ENUM_VALUE( keyboardOrganPipe, "keyboard.organ.pipe" ) \ - MX_ENUM_VALUE( keyboardOrganReed, "keyboard.organ.reed" ) \ - MX_ENUM_VALUE( keyboardOrganRotary, "keyboard.organ.rotary" ) \ - MX_ENUM_VALUE( keyboardPiano, "keyboard.piano" ) \ - MX_ENUM_VALUE( keyboardPianoElectric, "keyboard.piano.electric" ) \ - MX_ENUM_VALUE( keyboardPianoGrand, "keyboard.piano.grand" ) \ - MX_ENUM_VALUE( keyboardPianoHonkyTonk, "keyboard.piano.honky-tonk" ) \ - MX_ENUM_VALUE( keyboardPianoPrepared, "keyboard.piano.prepared" ) \ - MX_ENUM_VALUE( keyboardPianoToy, "keyboard.piano.toy" ) \ - MX_ENUM_VALUE( keyboardPianoUpright, "keyboard.piano.upright" ) \ - MX_ENUM_VALUE( keyboardVirginal, "keyboard.virginal" ) \ - MX_ENUM_VALUE( metalAdodo, "metal.adodo" ) \ - MX_ENUM_VALUE( metalAnvil, "metal.anvil" ) \ - MX_ENUM_VALUE( metalBabendil, "metal.babendil" ) \ - MX_ENUM_VALUE( metalBellsAgogo, "metal.bells.agogo" ) \ - MX_ENUM_VALUE( metalBellsAlmglocken, "metal.bells.almglocken" ) \ - MX_ENUM_VALUE( metalBellsBellPlate, "metal.bells.bell-plate" ) \ - MX_ENUM_VALUE( metalBellsBellTree, "metal.bells.bell-tree" ) \ - MX_ENUM_VALUE( metalBellsCarillon, "metal.bells.carillon" ) \ - MX_ENUM_VALUE( metalBellsChimes, "metal.bells.chimes" ) \ - MX_ENUM_VALUE( metalBellsChimta, "metal.bells.chimta" ) \ - MX_ENUM_VALUE( metalBellsChippli, "metal.bells.chippli" ) \ - MX_ENUM_VALUE( metalBellsChurch, "metal.bells.church" ) \ - MX_ENUM_VALUE( metalBellsCowbell, "metal.bells.cowbell" ) \ - MX_ENUM_VALUE( metalBellsDawuro, "metal.bells.dawuro" ) \ - MX_ENUM_VALUE( metalBellsGankokwe, "metal.bells.gankokwe" ) \ - MX_ENUM_VALUE( metalBellsGhungroo, "metal.bells.ghungroo" ) \ - MX_ENUM_VALUE( metalBellsHatheli, "metal.bells.hatheli" ) \ - MX_ENUM_VALUE( metalBellsJingleBell, "metal.bells.jingle-bell" ) \ - MX_ENUM_VALUE( metalBellsKhartal, "metal.bells.khartal" ) \ - MX_ENUM_VALUE( metalBellsMarkTree, "metal.bells.mark-tree" ) \ - MX_ENUM_VALUE( metalBellsSistrum, "metal.bells.sistrum" ) \ - MX_ENUM_VALUE( metalBellsSleighBells, "metal.bells.sleigh-bells" ) \ - MX_ENUM_VALUE( metalBellsTemple, "metal.bells.temple" ) \ - MX_ENUM_VALUE( metalBellsTibetan, "metal.bells.tibetan" ) \ - MX_ENUM_VALUE( metalBellsTinklebell, "metal.bells.tinklebell" ) \ - MX_ENUM_VALUE( metalBellsTrychel, "metal.bells.trychel" ) \ - MX_ENUM_VALUE( metalBellsWindChimes, "metal.bells.wind-chimes" ) \ - MX_ENUM_VALUE( metalBellsZills, "metal.bells.zills" ) \ - MX_ENUM_VALUE( metalBerimbau, "metal.berimbau" ) \ - MX_ENUM_VALUE( metalBrakeDrums, "metal.brake-drums" ) \ - MX_ENUM_VALUE( metalCrotales, "metal.crotales" ) \ - MX_ENUM_VALUE( metalCymbalBo, "metal.cymbal.bo" ) \ - MX_ENUM_VALUE( metalCymbalCengCeng, "metal.cymbal.ceng-ceng" ) \ - MX_ENUM_VALUE( metalCymbalChabara, "metal.cymbal.chabara" ) \ - MX_ENUM_VALUE( metalCymbalChinese, "metal.cymbal.chinese" ) \ - MX_ENUM_VALUE( metalCymbalChing, "metal.cymbal.ching" ) \ - MX_ENUM_VALUE( metalCymbalClash, "metal.cymbal.clash" ) \ - MX_ENUM_VALUE( metalCymbalCrash, "metal.cymbal.crash" ) \ - MX_ENUM_VALUE( metalCymbalFinger, "metal.cymbal.finger" ) \ - MX_ENUM_VALUE( metalCymbalHand, "metal.cymbal.hand" ) \ - MX_ENUM_VALUE( metalCymbalKesi, "metal.cymbal.kesi" ) \ - MX_ENUM_VALUE( metalCymbalManjeera, "metal.cymbal.manjeera" ) \ - MX_ENUM_VALUE( metalCymbalReverse, "metal.cymbal.reverse" ) \ - MX_ENUM_VALUE( metalCymbalRide, "metal.cymbal.ride" ) \ - MX_ENUM_VALUE( metalCymbalSizzle, "metal.cymbal.sizzle" ) \ - MX_ENUM_VALUE( metalCymbalSplash, "metal.cymbal.splash" ) \ - MX_ENUM_VALUE( metalCymbalSuspended, "metal.cymbal.suspended" ) \ - MX_ENUM_VALUE( metalCymbalTebyoshi, "metal.cymbal.tebyoshi" ) \ - MX_ENUM_VALUE( metalCymbalTibetan, "metal.cymbal.tibetan" ) \ - MX_ENUM_VALUE( metalCymbalTingsha, "metal.cymbal.tingsha" ) \ - MX_ENUM_VALUE( metalFlexatone, "metal.flexatone" ) \ - MX_ENUM_VALUE( metalGong, "metal.gong" ) \ - MX_ENUM_VALUE( metalGongAgeng, "metal.gong.ageng" ) \ - MX_ENUM_VALUE( metalGongAgung, "metal.gong.agung" ) \ - MX_ENUM_VALUE( metalGongChanchiki, "metal.gong.chanchiki" ) \ - MX_ENUM_VALUE( metalGongChinese, "metal.gong.chinese" ) \ - MX_ENUM_VALUE( metalGongGandingan, "metal.gong.gandingan" ) \ - MX_ENUM_VALUE( metalGongKempul, "metal.gong.kempul" ) \ - MX_ENUM_VALUE( metalGongKempyang, "metal.gong.kempyang" ) \ - MX_ENUM_VALUE( metalGongKetuk, "metal.gong.ketuk" ) \ - MX_ENUM_VALUE( metalGongKkwenggwari, "metal.gong.kkwenggwari" ) \ - MX_ENUM_VALUE( metalGongLuo, "metal.gong.luo" ) \ - MX_ENUM_VALUE( metalGongSinging, "metal.gong.singing" ) \ - MX_ENUM_VALUE( metalGongThai, "metal.gong.thai" ) \ - MX_ENUM_VALUE( metalGuira, "metal.guira" ) \ - MX_ENUM_VALUE( metalHang, "metal.hang" ) \ - MX_ENUM_VALUE( metalHiHat, "metal.hi-hat" ) \ - MX_ENUM_VALUE( metalJawHarp, "metal.jaw-harp" ) \ - MX_ENUM_VALUE( metalKengong, "metal.kengong" ) \ - MX_ENUM_VALUE( metalMurchang, "metal.murchang" ) \ - MX_ENUM_VALUE( metalMusicalSaw, "metal.musical-saw" ) \ - MX_ENUM_VALUE( metalSingingBowl, "metal.singing-bowl" ) \ - MX_ENUM_VALUE( metalSpoons, "metal.spoons" ) \ - MX_ENUM_VALUE( metalSteelDrums, "metal.steel-drums" ) \ - MX_ENUM_VALUE( metalTamtam, "metal.tamtam" ) \ - MX_ENUM_VALUE( metalThundersheet, "metal.thundersheet" ) \ - MX_ENUM_VALUE( metalTriangle, "metal.triangle" ) \ - MX_ENUM_VALUE( metalWashboard, "metal.washboard" ) \ - MX_ENUM_VALUE( pitchedPercussionAngklung, "pitched-percussion.angklung" ) \ - MX_ENUM_VALUE( pitchedPercussionBalafon, "pitched-percussion.balafon" ) \ - MX_ENUM_VALUE( pitchedPercussionBellLyre, "pitched-percussion.bell-lyre" ) \ - MX_ENUM_VALUE( pitchedPercussionBells, "pitched-percussion.bells" ) \ - MX_ENUM_VALUE( pitchedPercussionBianqing, "pitched-percussion.bianqing" ) \ - MX_ENUM_VALUE( pitchedPercussionBianzhong, "pitched-percussion.bianzhong" ) \ - MX_ENUM_VALUE( pitchedPercussionBonang, "pitched-percussion.bonang" ) \ - MX_ENUM_VALUE( pitchedPercussionCimbalom, "pitched-percussion.cimbalom" ) \ - MX_ENUM_VALUE( pitchedPercussionCrystalGlasses, "pitched-percussion.crystal-glasses" ) \ - MX_ENUM_VALUE( pitchedPercussionDanTamThapLuc, "pitched-percussion.dan-tam-thap-luc" ) \ - MX_ENUM_VALUE( pitchedPercussionFangxiang, "pitched-percussion.fangxiang" ) \ - MX_ENUM_VALUE( pitchedPercussionGandinganAKayo, "pitched-percussion.gandingan-a-kayo" ) \ - MX_ENUM_VALUE( pitchedPercussionGangsa, "pitched-percussion.gangsa" ) \ - MX_ENUM_VALUE( pitchedPercussionGender, "pitched-percussion.gender" ) \ - MX_ENUM_VALUE( pitchedPercussionGiying, "pitched-percussion.giying" ) \ - MX_ENUM_VALUE( pitchedPercussionGlassHarmonica, "pitched-percussion.glass-harmonica" ) \ - MX_ENUM_VALUE( pitchedPercussionGlockenspiel, "pitched-percussion.glockenspiel" ) \ - MX_ENUM_VALUE( pitchedPercussionGlockenspielAlto, "pitched-percussion.glockenspiel.alto" ) \ - MX_ENUM_VALUE( pitchedPercussionGlockenspielSoprano, "pitched-percussion.glockenspiel.soprano" ) \ - MX_ENUM_VALUE( pitchedPercussionGyil, "pitched-percussion.gyil" ) \ - MX_ENUM_VALUE( pitchedPercussionHammerDulcimer, "pitched-percussion.hammer-dulcimer" ) \ - MX_ENUM_VALUE( pitchedPercussionHandbells, "pitched-percussion.handbells" ) \ - MX_ENUM_VALUE( pitchedPercussionKalimba, "pitched-percussion.kalimba" ) \ - MX_ENUM_VALUE( pitchedPercussionKantil, "pitched-percussion.kantil" ) \ - MX_ENUM_VALUE( pitchedPercussionKhim, "pitched-percussion.khim" ) \ - MX_ENUM_VALUE( pitchedPercussionKulintang, "pitched-percussion.kulintang" ) \ - MX_ENUM_VALUE( pitchedPercussionKulintangAKayo, "pitched-percussion.kulintang-a-kayo" ) \ - MX_ENUM_VALUE( pitchedPercussionKulintangATiniok, "pitched-percussion.kulintang-a-tiniok" ) \ - MX_ENUM_VALUE( pitchedPercussionLikembe, "pitched-percussion.likembe" ) \ - MX_ENUM_VALUE( pitchedPercussionLuntang, "pitched-percussion.luntang" ) \ - MX_ENUM_VALUE( pitchedPercussionMarimba, "pitched-percussion.marimba" ) \ - MX_ENUM_VALUE( pitchedPercussionMarimbaBass, "pitched-percussion.marimba.bass" ) \ - MX_ENUM_VALUE( pitchedPercussionMbira, "pitched-percussion.mbira" ) \ - MX_ENUM_VALUE( pitchedPercussionMbiraArray, "pitched-percussion.mbira.array" ) \ - MX_ENUM_VALUE( pitchedPercussionMetallophone, "pitched-percussion.metallophone" ) \ - MX_ENUM_VALUE( pitchedPercussionMetallophoneAlto, "pitched-percussion.metallophone.alto" ) \ - MX_ENUM_VALUE( pitchedPercussionMetallophoneBass, "pitched-percussion.metallophone.bass" ) \ - MX_ENUM_VALUE( pitchedPercussionMetallophoneSoprano, "pitched-percussion.metallophone.soprano" ) \ - MX_ENUM_VALUE( pitchedPercussionMusicBox, "pitched-percussion.music-box" ) \ - MX_ENUM_VALUE( pitchedPercussionPelogPanerus, "pitched-percussion.pelog-panerus" ) \ - MX_ENUM_VALUE( pitchedPercussionPemade, "pitched-percussion.pemade" ) \ - MX_ENUM_VALUE( pitchedPercussionPenyacah, "pitched-percussion.penyacah" ) \ - MX_ENUM_VALUE( pitchedPercussionRanatEk, "pitched-percussion.ranat.ek" ) \ - MX_ENUM_VALUE( pitchedPercussionRanatEkLek, "pitched-percussion.ranat.ek-lek" ) \ - MX_ENUM_VALUE( pitchedPercussionRanatThum, "pitched-percussion.ranat.thum" ) \ - MX_ENUM_VALUE( pitchedPercussionRanatThumLek, "pitched-percussion.ranat.thum-lek" ) \ - MX_ENUM_VALUE( pitchedPercussionReyong, "pitched-percussion.reyong" ) \ - MX_ENUM_VALUE( pitchedPercussionSanza, "pitched-percussion.sanza" ) \ - MX_ENUM_VALUE( pitchedPercussionSaronBarung, "pitched-percussion.saron-barung" ) \ - MX_ENUM_VALUE( pitchedPercussionSaronDemong, "pitched-percussion.saron-demong" ) \ - MX_ENUM_VALUE( pitchedPercussionSaronPanerus, "pitched-percussion.saron-panerus" ) \ - MX_ENUM_VALUE( pitchedPercussionSlendroPanerus, "pitched-percussion.slendro-panerus" ) \ - MX_ENUM_VALUE( pitchedPercussionSlentem, "pitched-percussion.slentem" ) \ - MX_ENUM_VALUE( pitchedPercussionTsymbaly, "pitched-percussion.tsymbaly" ) \ - MX_ENUM_VALUE( pitchedPercussionTubes, "pitched-percussion.tubes" ) \ - MX_ENUM_VALUE( pitchedPercussionTubularBells, "pitched-percussion.tubular-bells" ) \ - MX_ENUM_VALUE( pitchedPercussionVibraphone, "pitched-percussion.vibraphone" ) \ - MX_ENUM_VALUE( pitchedPercussionXylophone, "pitched-percussion.xylophone" ) \ - MX_ENUM_VALUE( pitchedPercussionXylophoneAlto, "pitched-percussion.xylophone.alto" ) \ - MX_ENUM_VALUE( pitchedPercussionXylophoneBass, "pitched-percussion.xylophone.bass" ) \ - MX_ENUM_VALUE( pitchedPercussionXylophoneSoprano, "pitched-percussion.xylophone.soprano" ) \ - MX_ENUM_VALUE( pitchedPercussionXylorimba, "pitched-percussion.xylorimba" ) \ - MX_ENUM_VALUE( pitchedPercussionYangqin, "pitched-percussion.yangqin" ) \ - MX_ENUM_VALUE( pluckArchlute, "pluck.archlute" ) \ - MX_ENUM_VALUE( pluckAutoharp, "pluck.autoharp" ) \ - MX_ENUM_VALUE( pluckBaglama, "pluck.baglama" ) \ - MX_ENUM_VALUE( pluckBajo, "pluck.bajo" ) \ - MX_ENUM_VALUE( pluckBalalaika, "pluck.balalaika" ) \ - MX_ENUM_VALUE( pluckBalalaikaAlto, "pluck.balalaika.alto" ) \ - MX_ENUM_VALUE( pluckBalalaikaBass, "pluck.balalaika.bass" ) \ - MX_ENUM_VALUE( pluckBalalaikaContrabass, "pluck.balalaika.contrabass" ) \ - MX_ENUM_VALUE( pluckBalalaikaPiccolo, "pluck.balalaika.piccolo" ) \ - MX_ENUM_VALUE( pluckBalalaikaPrima, "pluck.balalaika.prima" ) \ - MX_ENUM_VALUE( pluckBalalaikaSecunda, "pluck.balalaika.secunda" ) \ - MX_ENUM_VALUE( pluckBandola, "pluck.bandola" ) \ - MX_ENUM_VALUE( pluckBandura, "pluck.bandura" ) \ - MX_ENUM_VALUE( pluckBandurria, "pluck.bandurria" ) \ - MX_ENUM_VALUE( pluckBanjo, "pluck.banjo" ) \ - MX_ENUM_VALUE( pluckBanjoTenor, "pluck.banjo.tenor" ) \ - MX_ENUM_VALUE( pluckBanjolele, "pluck.banjolele" ) \ - MX_ENUM_VALUE( pluckBarbat, "pluck.barbat" ) \ - MX_ENUM_VALUE( pluckBass, "pluck.bass" ) \ - MX_ENUM_VALUE( pluckBassAcoustic, "pluck.bass.acoustic" ) \ - MX_ENUM_VALUE( pluckBassBolon, "pluck.bass.bolon" ) \ - MX_ENUM_VALUE( pluckBassElectric, "pluck.bass.electric" ) \ - MX_ENUM_VALUE( pluckBassFretless, "pluck.bass.fretless" ) \ - MX_ENUM_VALUE( pluckBassGuitarron, "pluck.bass.guitarron" ) \ - MX_ENUM_VALUE( pluckBassSynth, "pluck.bass.synth" ) \ - MX_ENUM_VALUE( pluckBassSynthLead, "pluck.bass.synth.lead" ) \ - MX_ENUM_VALUE( pluckBassWashtub, "pluck.bass.washtub" ) \ - MX_ENUM_VALUE( pluckBassWhamola, "pluck.bass.whamola" ) \ - MX_ENUM_VALUE( pluckBegena, "pluck.begena" ) \ - MX_ENUM_VALUE( pluckBiwa, "pluck.biwa" ) \ - MX_ENUM_VALUE( pluckBordonua, "pluck.bordonua" ) \ - MX_ENUM_VALUE( pluckBouzouki, "pluck.bouzouki" ) \ - MX_ENUM_VALUE( pluckBouzoukiIrish, "pluck.bouzouki.irish" ) \ - MX_ENUM_VALUE( pluckCelticHarp, "pluck.celtic-harp" ) \ - MX_ENUM_VALUE( pluckCharango, "pluck.charango" ) \ - MX_ENUM_VALUE( pluckChitarraBattente, "pluck.chitarra-battente" ) \ - MX_ENUM_VALUE( pluckCithara, "pluck.cithara" ) \ - MX_ENUM_VALUE( pluckCittern, "pluck.cittern" ) \ - MX_ENUM_VALUE( pluckCuatro, "pluck.cuatro" ) \ - MX_ENUM_VALUE( pluckDanBau, "pluck.dan-bau" ) \ - MX_ENUM_VALUE( pluckDanNguyet, "pluck.dan-nguyet" ) \ - MX_ENUM_VALUE( pluckDanTranh, "pluck.dan-tranh" ) \ - MX_ENUM_VALUE( pluckDanTyBa, "pluck.dan-ty-ba" ) \ - MX_ENUM_VALUE( pluckDiddleyBow, "pluck.diddley-bow" ) \ - MX_ENUM_VALUE( pluckDomra, "pluck.domra" ) \ - MX_ENUM_VALUE( pluckDomu, "pluck.domu" ) \ - MX_ENUM_VALUE( pluckDulcimer, "pluck.dulcimer" ) \ - MX_ENUM_VALUE( pluckDutar, "pluck.dutar" ) \ - MX_ENUM_VALUE( pluckDuxianqin, "pluck.duxianqin" ) \ - MX_ENUM_VALUE( pluckEktara, "pluck.ektara" ) \ - MX_ENUM_VALUE( pluckGeomungo, "pluck.geomungo" ) \ - MX_ENUM_VALUE( pluckGottuvadhyam, "pluck.gottuvadhyam" ) \ - MX_ENUM_VALUE( pluckGuitar, "pluck.guitar" ) \ - MX_ENUM_VALUE( pluckGuitarAcoustic, "pluck.guitar.acoustic" ) \ - MX_ENUM_VALUE( pluckGuitarElectric, "pluck.guitar.electric" ) \ - MX_ENUM_VALUE( pluckGuitarNylonString, "pluck.guitar.nylon-string" ) \ - MX_ENUM_VALUE( pluckGuitarPedalSteel, "pluck.guitar.pedal-steel" ) \ - MX_ENUM_VALUE( pluckGuitarPortuguese, "pluck.guitar.portuguese" ) \ - MX_ENUM_VALUE( pluckGuitarRequinto, "pluck.guitar.requinto" ) \ - MX_ENUM_VALUE( pluckGuitarResonator, "pluck.guitar.resonator" ) \ - MX_ENUM_VALUE( pluckGuitarSteelString, "pluck.guitar.steel-string" ) \ - MX_ENUM_VALUE( pluckGuitjo, "pluck.guitjo" ) \ - MX_ENUM_VALUE( pluckGuitjoDoubleNeck, "pluck.guitjo.double-neck" ) \ - MX_ENUM_VALUE( pluckGuqin, "pluck.guqin" ) \ - MX_ENUM_VALUE( pluckGuzheng, "pluck.guzheng" ) \ - MX_ENUM_VALUE( pluckGuzhengChoazhou, "pluck.guzheng.choazhou" ) \ - MX_ENUM_VALUE( pluckHarp, "pluck.harp" ) \ - MX_ENUM_VALUE( pluckHarpGuitar, "pluck.harp-guitar" ) \ - MX_ENUM_VALUE( pluckHuapanguera, "pluck.huapanguera" ) \ - MX_ENUM_VALUE( pluckJaranaHuasteca, "pluck.jarana-huasteca" ) \ - MX_ENUM_VALUE( pluckJaranaJarocha, "pluck.jarana-jarocha" ) \ - MX_ENUM_VALUE( pluckJaranaJarochaMosquito, "pluck.jarana-jarocha.mosquito" ) \ - MX_ENUM_VALUE( pluckJaranaJarochaPrimera, "pluck.jarana-jarocha.primera" ) \ - MX_ENUM_VALUE( pluckJaranaJarochaSegunda, "pluck.jarana-jarocha.segunda" ) \ - MX_ENUM_VALUE( pluckJaranaJarochaTercera, "pluck.jarana-jarocha.tercera" ) \ - MX_ENUM_VALUE( pluckKabosy, "pluck.kabosy" ) \ - MX_ENUM_VALUE( pluckKantele, "pluck.kantele" ) \ - MX_ENUM_VALUE( pluckKanun, "pluck.kanun" ) \ - MX_ENUM_VALUE( pluckKayagum, "pluck.kayagum" ) \ - MX_ENUM_VALUE( pluckKobza, "pluck.kobza" ) \ - MX_ENUM_VALUE( pluckKomuz, "pluck.komuz" ) \ - MX_ENUM_VALUE( pluckKora, "pluck.kora" ) \ - MX_ENUM_VALUE( pluckKoto, "pluck.koto" ) \ - MX_ENUM_VALUE( pluckKutiyapi, "pluck.kutiyapi" ) \ - MX_ENUM_VALUE( pluckLangeleik, "pluck.langeleik" ) \ - MX_ENUM_VALUE( pluckLaud, "pluck.laud" ) \ - MX_ENUM_VALUE( pluckLute, "pluck.lute" ) \ - MX_ENUM_VALUE( pluckLyre, "pluck.lyre" ) \ - MX_ENUM_VALUE( pluckMandobass, "pluck.mandobass" ) \ - MX_ENUM_VALUE( pluckMandocello, "pluck.mandocello" ) \ - MX_ENUM_VALUE( pluckMandola, "pluck.mandola" ) \ - MX_ENUM_VALUE( pluckMandolin, "pluck.mandolin" ) \ - MX_ENUM_VALUE( pluckMandolinOctave, "pluck.mandolin.octave" ) \ - MX_ENUM_VALUE( pluckMandora, "pluck.mandora" ) \ - MX_ENUM_VALUE( pluckMandore, "pluck.mandore" ) \ - MX_ENUM_VALUE( pluckMarovany, "pluck.marovany" ) \ - MX_ENUM_VALUE( pluckMusicalBow, "pluck.musical-bow" ) \ - MX_ENUM_VALUE( pluckNgoni, "pluck.ngoni" ) \ - MX_ENUM_VALUE( pluckOud, "pluck.oud" ) \ - MX_ENUM_VALUE( pluckPipa, "pluck.pipa" ) \ - MX_ENUM_VALUE( pluckPsaltery, "pluck.psaltery" ) \ - MX_ENUM_VALUE( pluckRuan, "pluck.ruan" ) \ - MX_ENUM_VALUE( pluckSallaneh, "pluck.sallaneh" ) \ - MX_ENUM_VALUE( pluckSanshin, "pluck.sanshin" ) \ - MX_ENUM_VALUE( pluckSantoor, "pluck.santoor" ) \ - MX_ENUM_VALUE( pluckSanxian, "pluck.sanxian" ) \ - MX_ENUM_VALUE( pluckSarod, "pluck.sarod" ) \ - MX_ENUM_VALUE( pluckSaung, "pluck.saung" ) \ - MX_ENUM_VALUE( pluckSaz, "pluck.saz" ) \ - MX_ENUM_VALUE( pluckSe, "pluck.se" ) \ - MX_ENUM_VALUE( pluckSetar, "pluck.setar" ) \ - MX_ENUM_VALUE( pluckShamisen, "pluck.shamisen" ) \ - MX_ENUM_VALUE( pluckSitar, "pluck.sitar" ) \ - MX_ENUM_VALUE( pluckSynth, "pluck.synth" ) \ - MX_ENUM_VALUE( pluckSynthCharang, "pluck.synth.charang" ) \ - MX_ENUM_VALUE( pluckSynthChiff, "pluck.synth.chiff" ) \ - MX_ENUM_VALUE( pluckSynthStick, "pluck.synth.stick" ) \ - MX_ENUM_VALUE( pluckTambura, "pluck.tambura" ) \ - MX_ENUM_VALUE( pluckTamburaBulgarian, "pluck.tambura.bulgarian" ) \ - MX_ENUM_VALUE( pluckTamburaFemale, "pluck.tambura.female" ) \ - MX_ENUM_VALUE( pluckTamburaMale, "pluck.tambura.male" ) \ - MX_ENUM_VALUE( pluckTar, "pluck.tar" ) \ - MX_ENUM_VALUE( pluckTheorbo, "pluck.theorbo" ) \ - MX_ENUM_VALUE( pluckTimple, "pluck.timple" ) \ - MX_ENUM_VALUE( pluckTiple, "pluck.tiple" ) \ - MX_ENUM_VALUE( pluckTres, "pluck.tres" ) \ - MX_ENUM_VALUE( pluckUkulele, "pluck.ukulele" ) \ - MX_ENUM_VALUE( pluckUkuleleTenor, "pluck.ukulele.tenor" ) \ - MX_ENUM_VALUE( pluckValiha, "pluck.valiha" ) \ - MX_ENUM_VALUE( pluckVeena, "pluck.veena" ) \ - MX_ENUM_VALUE( pluckVeenaMohan, "pluck.veena.mohan" ) \ - MX_ENUM_VALUE( pluckVeenaRudra, "pluck.veena.rudra" ) \ - MX_ENUM_VALUE( pluckVeenaVichitra, "pluck.veena.vichitra" ) \ - MX_ENUM_VALUE( pluckVihuela, "pluck.vihuela" ) \ - MX_ENUM_VALUE( pluckVihuelaMexican, "pluck.vihuela.mexican" ) \ - MX_ENUM_VALUE( pluckXalam, "pluck.xalam" ) \ - MX_ENUM_VALUE( pluckYueqin, "pluck.yueqin" ) \ - MX_ENUM_VALUE( pluckZither, "pluck.zither" ) \ - MX_ENUM_VALUE( pluckZitherOvertone, "pluck.zither.overtone" ) \ - MX_ENUM_VALUE( rattleAfoxe, "rattle.afoxe" ) \ - MX_ENUM_VALUE( rattleBirds, "rattle.birds" ) \ - MX_ENUM_VALUE( rattleCabasa, "rattle.cabasa" ) \ - MX_ENUM_VALUE( rattleCaxixi, "rattle.caxixi" ) \ - MX_ENUM_VALUE( rattleCog, "rattle.cog" ) \ - MX_ENUM_VALUE( rattleGanza, "rattle.ganza" ) \ - MX_ENUM_VALUE( rattleHosho, "rattle.hosho" ) \ - MX_ENUM_VALUE( rattleJawbone, "rattle.jawbone" ) \ - MX_ENUM_VALUE( rattleKayamba, "rattle.kayamba" ) \ - MX_ENUM_VALUE( rattleKpokoKpoko, "rattle.kpoko-kpoko" ) \ - MX_ENUM_VALUE( rattleLavaStones, "rattle.lava-stones" ) \ - MX_ENUM_VALUE( rattleMaraca, "rattle.maraca" ) \ - MX_ENUM_VALUE( rattleRainStick, "rattle.rain-stick" ) \ - MX_ENUM_VALUE( rattleRatchet, "rattle.ratchet" ) \ - MX_ENUM_VALUE( rattleRattle, "rattle.rattle" ) \ - MX_ENUM_VALUE( rattleShaker, "rattle.shaker" ) \ - MX_ENUM_VALUE( rattleShakerEgg, "rattle.shaker.egg" ) \ - MX_ENUM_VALUE( rattleShekere, "rattle.shekere" ) \ - MX_ENUM_VALUE( rattleSistre, "rattle.sistre" ) \ - MX_ENUM_VALUE( rattleTelevi, "rattle.televi" ) \ - MX_ENUM_VALUE( rattleVibraslap, "rattle.vibraslap" ) \ - MX_ENUM_VALUE( rattleWasembe, "rattle.wasembe" ) \ - MX_ENUM_VALUE( stringsAjaeng, "strings.ajaeng" ) \ - MX_ENUM_VALUE( stringsArpeggione, "strings.arpeggione" ) \ - MX_ENUM_VALUE( stringsBaryton, "strings.baryton" ) \ - MX_ENUM_VALUE( stringsCello, "strings.cello" ) \ - MX_ENUM_VALUE( stringsCelloPiccolo, "strings.cello.piccolo" ) \ - MX_ENUM_VALUE( stringsContrabass, "strings.contrabass" ) \ - MX_ENUM_VALUE( stringsCrwth, "strings.crwth" ) \ - MX_ENUM_VALUE( stringsDanGao, "strings.dan-gao" ) \ - MX_ENUM_VALUE( stringsDihu, "strings.dihu" ) \ - MX_ENUM_VALUE( stringsErhu, "strings.erhu" ) \ - MX_ENUM_VALUE( stringsErxian, "strings.erxian" ) \ - MX_ENUM_VALUE( stringsEsraj, "strings.esraj" ) \ - MX_ENUM_VALUE( stringsFiddle, "strings.fiddle" ) \ - MX_ENUM_VALUE( stringsFiddleHardanger, "strings.fiddle.hardanger" ) \ - MX_ENUM_VALUE( stringsGadulka, "strings.gadulka" ) \ - MX_ENUM_VALUE( stringsGaohu, "strings.gaohu" ) \ - MX_ENUM_VALUE( stringsGehu, "strings.gehu" ) \ - MX_ENUM_VALUE( stringsGroup, "strings.group" ) \ - MX_ENUM_VALUE( stringsGroupSynth, "strings.group.synth" ) \ - MX_ENUM_VALUE( stringsHaegeum, "strings.haegeum" ) \ - MX_ENUM_VALUE( stringsHurdyGurdy, "strings.hurdy-gurdy" ) \ - MX_ENUM_VALUE( stringsIgil, "strings.igil" ) \ - MX_ENUM_VALUE( stringsKamancha, "strings.kamancha" ) \ - MX_ENUM_VALUE( stringsKokyu, "strings.kokyu" ) \ - MX_ENUM_VALUE( stringsLaruan, "strings.laruan" ) \ - MX_ENUM_VALUE( stringsLeiqin, "strings.leiqin" ) \ - MX_ENUM_VALUE( stringsLirone, "strings.lirone" ) \ - MX_ENUM_VALUE( stringsLyraByzantine, "strings.lyra.byzantine" ) \ - MX_ENUM_VALUE( stringsLyraCretan, "strings.lyra.cretan" ) \ - MX_ENUM_VALUE( stringsMorinKhuur, "strings.morin-khuur" ) \ - MX_ENUM_VALUE( stringsNyckelharpa, "strings.nyckelharpa" ) \ - MX_ENUM_VALUE( stringsOctobass, "strings.octobass" ) \ - MX_ENUM_VALUE( stringsRebab, "strings.rebab" ) \ - MX_ENUM_VALUE( stringsRebec, "strings.rebec" ) \ - MX_ENUM_VALUE( stringsSarangi, "strings.sarangi" ) \ - MX_ENUM_VALUE( stringsStrohViolin, "strings.stroh-violin" ) \ - MX_ENUM_VALUE( stringsTrombaMarina, "strings.tromba-marina" ) \ - MX_ENUM_VALUE( stringsVielle, "strings.vielle" ) \ - MX_ENUM_VALUE( stringsViol, "strings.viol" ) \ - MX_ENUM_VALUE( stringsViolAlto, "strings.viol.alto" ) \ - MX_ENUM_VALUE( stringsViolBass, "strings.viol.bass" ) \ - MX_ENUM_VALUE( stringsViolTenor, "strings.viol.tenor" ) \ - MX_ENUM_VALUE( stringsViolTreble, "strings.viol.treble" ) \ - MX_ENUM_VALUE( stringsViolViolone, "strings.viol.violone" ) \ - MX_ENUM_VALUE( stringsViola, "strings.viola" ) \ - MX_ENUM_VALUE( stringsViolaDamore, "strings.viola-damore" ) \ - MX_ENUM_VALUE( stringsViolin, "strings.violin" ) \ - MX_ENUM_VALUE( stringsViolonoPiccolo, "strings.violono.piccolo" ) \ - MX_ENUM_VALUE( stringsViolotta, "strings.violotta" ) \ - MX_ENUM_VALUE( stringsYayliTanbur, "strings.yayli-tanbur" ) \ - MX_ENUM_VALUE( stringsYazheng, "strings.yazheng" ) \ - MX_ENUM_VALUE( stringsZhonghu, "strings.zhonghu" ) \ - MX_ENUM_VALUE( synthEffects, "synth.effects" ) \ - MX_ENUM_VALUE( synthEffectsAtmosphere, "synth.effects.atmosphere" ) \ - MX_ENUM_VALUE( synthEffectsBrightness, "synth.effects.brightness" ) \ - MX_ENUM_VALUE( synthEffectsCrystal, "synth.effects.crystal" ) \ - MX_ENUM_VALUE( synthEffectsEchoes, "synth.effects.echoes" ) \ - MX_ENUM_VALUE( synthEffectsGoblins, "synth.effects.goblins" ) \ - MX_ENUM_VALUE( synthEffectsRain, "synth.effects.rain" ) \ - MX_ENUM_VALUE( synthEffectsSciFi, "synth.effects.sci-fi" ) \ - MX_ENUM_VALUE( synthEffectsSoundtrack, "synth.effects.soundtrack" ) \ - MX_ENUM_VALUE( synthGroup, "synth.group" ) \ - MX_ENUM_VALUE( synthGroupFifths, "synth.group.fifths" ) \ - MX_ENUM_VALUE( synthGroupOrchestra, "synth.group.orchestra" ) \ - MX_ENUM_VALUE( synthPad, "synth.pad" ) \ - MX_ENUM_VALUE( synthPadBowed, "synth.pad.bowed" ) \ - MX_ENUM_VALUE( synthPadChoir, "synth.pad.choir" ) \ - MX_ENUM_VALUE( synthPadHalo, "synth.pad.halo" ) \ - MX_ENUM_VALUE( synthPadMetallic, "synth.pad.metallic" ) \ - MX_ENUM_VALUE( synthPadPolysynth, "synth.pad.polysynth" ) \ - MX_ENUM_VALUE( synthPadSweep, "synth.pad.sweep" ) \ - MX_ENUM_VALUE( synthPadWarm, "synth.pad.warm" ) \ - MX_ENUM_VALUE( synthTheremin, "synth.theremin" ) \ - MX_ENUM_VALUE( synthToneSawtooth, "synth.tone.sawtooth" ) \ - MX_ENUM_VALUE( synthToneSine, "synth.tone.sine" ) \ - MX_ENUM_VALUE( synthToneSquare, "synth.tone.square" ) \ - MX_ENUM_VALUE( voiceAa, "voice.aa" ) \ - MX_ENUM_VALUE( voiceAlto, "voice.alto" ) \ - MX_ENUM_VALUE( voiceAw, "voice.aw" ) \ - MX_ENUM_VALUE( voiceBaritone, "voice.baritone" ) \ - MX_ENUM_VALUE( voiceBass, "voice.bass" ) \ - MX_ENUM_VALUE( voiceChild, "voice.child" ) \ - MX_ENUM_VALUE( voiceCountertenor, "voice.countertenor" ) \ - MX_ENUM_VALUE( voiceDoo, "voice.doo" ) \ - MX_ENUM_VALUE( voiceEe, "voice.ee" ) \ - MX_ENUM_VALUE( voiceFemale, "voice.female" ) \ - MX_ENUM_VALUE( voiceKazoo, "voice.kazoo" ) \ - MX_ENUM_VALUE( voiceMale, "voice.male" ) \ - MX_ENUM_VALUE( voiceMezzoSoprano, "voice.mezzo-soprano" ) \ - MX_ENUM_VALUE( voiceMm, "voice.mm" ) \ - MX_ENUM_VALUE( voiceOo, "voice.oo" ) \ - MX_ENUM_VALUE( voicePercussion, "voice.percussion" ) \ - MX_ENUM_VALUE( voicePercussionBeatbox, "voice.percussion.beatbox" ) \ - MX_ENUM_VALUE( voiceSoprano, "voice.soprano" ) \ - MX_ENUM_VALUE( voiceSynth, "voice.synth" ) \ - MX_ENUM_VALUE( voiceTalkBox, "voice.talk-box" ) \ - MX_ENUM_VALUE( voiceTenor, "voice.tenor" ) \ - MX_ENUM_VALUE( voiceVocals, "voice.vocals" ) \ - MX_ENUM_VALUE( windFlutesBansuri, "wind.flutes.bansuri" ) \ - MX_ENUM_VALUE( windFlutesBlownBottle, "wind.flutes.blown-bottle" ) \ - MX_ENUM_VALUE( windFlutesCalliope, "wind.flutes.calliope" ) \ - MX_ENUM_VALUE( windFlutesDanso, "wind.flutes.danso" ) \ - MX_ENUM_VALUE( windFlutesDiZi, "wind.flutes.di-zi" ) \ - MX_ENUM_VALUE( windFlutesDvojnice, "wind.flutes.dvojnice" ) \ - MX_ENUM_VALUE( windFlutesFife, "wind.flutes.fife" ) \ - MX_ENUM_VALUE( windFlutesFlageolet, "wind.flutes.flageolet" ) \ - MX_ENUM_VALUE( windFlutesFlute, "wind.flutes.flute" ) \ - MX_ENUM_VALUE( windFlutesFluteAlto, "wind.flutes.flute.alto" ) \ - MX_ENUM_VALUE( windFlutesFluteBass, "wind.flutes.flute.bass" ) \ - MX_ENUM_VALUE( windFlutesFluteContraAlto, "wind.flutes.flute.contra-alto" ) \ - MX_ENUM_VALUE( windFlutesFluteContrabass, "wind.flutes.flute.contrabass" ) \ - MX_ENUM_VALUE( windFlutesFluteDoubleContrabass, "wind.flutes.flute.double-contrabass" ) \ - MX_ENUM_VALUE( windFlutesFluteIrish, "wind.flutes.flute.irish" ) \ - MX_ENUM_VALUE( windFlutesFlutePiccolo, "wind.flutes.flute.piccolo" ) \ - MX_ENUM_VALUE( windFlutesFluteSubcontrabass, "wind.flutes.flute.subcontrabass" ) \ - MX_ENUM_VALUE( windFlutesFujara, "wind.flutes.fujara" ) \ - MX_ENUM_VALUE( windFlutesGemshorn, "wind.flutes.gemshorn" ) \ - MX_ENUM_VALUE( windFlutesHocchiku, "wind.flutes.hocchiku" ) \ - MX_ENUM_VALUE( windFlutesHun, "wind.flutes.hun" ) \ - MX_ENUM_VALUE( windFlutesKaval, "wind.flutes.kaval" ) \ - MX_ENUM_VALUE( windFlutesKawala, "wind.flutes.kawala" ) \ - MX_ENUM_VALUE( windFlutesKhlui, "wind.flutes.khlui" ) \ - MX_ENUM_VALUE( windFlutesKnotweed, "wind.flutes.knotweed" ) \ - MX_ENUM_VALUE( windFlutesKoncovkaAlto, "wind.flutes.koncovka.alto" ) \ - MX_ENUM_VALUE( windFlutesKoudi, "wind.flutes.koudi" ) \ - MX_ENUM_VALUE( windFlutesNey, "wind.flutes.ney" ) \ - MX_ENUM_VALUE( windFlutesNohkan, "wind.flutes.nohkan" ) \ - MX_ENUM_VALUE( windFlutesNose, "wind.flutes.nose" ) \ - MX_ENUM_VALUE( windFlutesOcarina, "wind.flutes.ocarina" ) \ - MX_ENUM_VALUE( windFlutesOvertoneTenor, "wind.flutes.overtone.tenor" ) \ - MX_ENUM_VALUE( windFlutesPalendag, "wind.flutes.palendag" ) \ - MX_ENUM_VALUE( windFlutesPanpipes, "wind.flutes.panpipes" ) \ - MX_ENUM_VALUE( windFlutesQuena, "wind.flutes.quena" ) \ - MX_ENUM_VALUE( windFlutesRecorder, "wind.flutes.recorder" ) \ - MX_ENUM_VALUE( windFlutesRecorderAlto, "wind.flutes.recorder.alto" ) \ - MX_ENUM_VALUE( windFlutesRecorderBass, "wind.flutes.recorder.bass" ) \ - MX_ENUM_VALUE( windFlutesRecorderContrabass, "wind.flutes.recorder.contrabass" ) \ - MX_ENUM_VALUE( windFlutesRecorderDescant, "wind.flutes.recorder.descant" ) \ - MX_ENUM_VALUE( windFlutesRecorderGarklein, "wind.flutes.recorder.garklein" ) \ - MX_ENUM_VALUE( windFlutesRecorderGreatBass, "wind.flutes.recorder.great-bass" ) \ - MX_ENUM_VALUE( windFlutesRecorderSopranino, "wind.flutes.recorder.sopranino" ) \ - MX_ENUM_VALUE( windFlutesRecorderSoprano, "wind.flutes.recorder.soprano" ) \ - MX_ENUM_VALUE( windFlutesRecorderTenor, "wind.flutes.recorder.tenor" ) \ - MX_ENUM_VALUE( windFlutesRyuteki, "wind.flutes.ryuteki" ) \ - MX_ENUM_VALUE( windFlutesShakuhachi, "wind.flutes.shakuhachi" ) \ - MX_ENUM_VALUE( windFlutesShepherdsPipe, "wind.flutes.shepherds-pipe" ) \ - MX_ENUM_VALUE( windFlutesShinobue, "wind.flutes.shinobue" ) \ - MX_ENUM_VALUE( windFlutesShvi, "wind.flutes.shvi" ) \ - MX_ENUM_VALUE( windFlutesSuling, "wind.flutes.suling" ) \ - MX_ENUM_VALUE( windFlutesTarka, "wind.flutes.tarka" ) \ - MX_ENUM_VALUE( windFlutesTumpong, "wind.flutes.tumpong" ) \ - MX_ENUM_VALUE( windFlutesVenu, "wind.flutes.venu" ) \ - MX_ENUM_VALUE( windFlutesWhistle, "wind.flutes.whistle" ) \ - MX_ENUM_VALUE( windFlutesWhistleAlto, "wind.flutes.whistle.alto" ) \ - MX_ENUM_VALUE( windFlutesWhistleLowIrish, "wind.flutes.whistle.low-irish" ) \ - MX_ENUM_VALUE( windFlutesWhistleShiva, "wind.flutes.whistle.shiva" ) \ - MX_ENUM_VALUE( windFlutesWhistleSlide, "wind.flutes.whistle.slide" ) \ - MX_ENUM_VALUE( windFlutesWhistleTin, "wind.flutes.whistle.tin" ) \ - MX_ENUM_VALUE( windFlutesWhistleTinBflat, "wind.flutes.whistle.tin.bflat" ) \ - MX_ENUM_VALUE( windFlutesWhistleTinD, "wind.flutes.whistle.tin.d" ) \ - MX_ENUM_VALUE( windFlutesXiao, "wind.flutes.xiao" ) \ - MX_ENUM_VALUE( windFlutesXun, "wind.flutes.xun" ) \ - MX_ENUM_VALUE( windGroup, "wind.group" ) \ - MX_ENUM_VALUE( windJug, "wind.jug" ) \ - MX_ENUM_VALUE( windPipesBagpipes, "wind.pipes.bagpipes" ) \ - MX_ENUM_VALUE( windPipesGaida, "wind.pipes.gaida" ) \ - MX_ENUM_VALUE( windPipesHighland, "wind.pipes.highland" ) \ - MX_ENUM_VALUE( windPipesUilleann, "wind.pipes.uilleann" ) \ - MX_ENUM_VALUE( windPungi, "wind.pungi" ) \ - MX_ENUM_VALUE( windReedAlbogue, "wind.reed.albogue" ) \ - MX_ENUM_VALUE( windReedAlboka, "wind.reed.alboka" ) \ - MX_ENUM_VALUE( windReedAlgaita, "wind.reed.algaita" ) \ - MX_ENUM_VALUE( windReedArghul, "wind.reed.arghul" ) \ - MX_ENUM_VALUE( windReedBassetHorn, "wind.reed.basset-horn" ) \ - MX_ENUM_VALUE( windReedBassoon, "wind.reed.bassoon" ) \ - MX_ENUM_VALUE( windReedBawu, "wind.reed.bawu" ) \ - MX_ENUM_VALUE( windReedBifora, "wind.reed.bifora" ) \ - MX_ENUM_VALUE( windReedBombarde, "wind.reed.bombarde" ) \ - MX_ENUM_VALUE( windReedChalumeau, "wind.reed.chalumeau" ) \ - MX_ENUM_VALUE( windReedClarinet, "wind.reed.clarinet" ) \ - MX_ENUM_VALUE( windReedClarinetA, "wind.reed.clarinet.a" ) \ - MX_ENUM_VALUE( windReedClarinetAlto, "wind.reed.clarinet.alto" ) \ - MX_ENUM_VALUE( windReedClarinetBass, "wind.reed.clarinet.bass" ) \ - MX_ENUM_VALUE( windReedClarinetBasset, "wind.reed.clarinet.basset" ) \ - MX_ENUM_VALUE( windReedClarinetBflat, "wind.reed.clarinet.bflat" ) \ - MX_ENUM_VALUE( windReedClarinetContraAlto, "wind.reed.clarinet.contra-alto" ) \ - MX_ENUM_VALUE( windReedClarinetContrabass, "wind.reed.clarinet.contrabass" ) \ - MX_ENUM_VALUE( windReedClarinetEflat, "wind.reed.clarinet.eflat" ) \ - MX_ENUM_VALUE( windReedClarinetPiccoloAflat, "wind.reed.clarinet.piccolo.aflat" ) \ - MX_ENUM_VALUE( windReedClarinetteDamour, "wind.reed.clarinette-damour" ) \ - MX_ENUM_VALUE( windReedContrabass, "wind.reed.contrabass" ) \ - MX_ENUM_VALUE( windReedContrabassoon, "wind.reed.contrabassoon" ) \ - MX_ENUM_VALUE( windReedCornamuse, "wind.reed.cornamuse" ) \ - MX_ENUM_VALUE( windReedCromorne, "wind.reed.cromorne" ) \ - MX_ENUM_VALUE( windReedCrumhorn, "wind.reed.crumhorn" ) \ - MX_ENUM_VALUE( windReedCrumhornAlto, "wind.reed.crumhorn.alto" ) \ - MX_ENUM_VALUE( windReedCrumhornBass, "wind.reed.crumhorn.bass" ) \ - MX_ENUM_VALUE( windReedCrumhornGreatBass, "wind.reed.crumhorn.great-bass" ) \ - MX_ENUM_VALUE( windReedCrumhornSoprano, "wind.reed.crumhorn.soprano" ) \ - MX_ENUM_VALUE( windReedCrumhornTenor, "wind.reed.crumhorn.tenor" ) \ - MX_ENUM_VALUE( windReedDiple, "wind.reed.diple" ) \ - MX_ENUM_VALUE( windReedDiplica, "wind.reed.diplica" ) \ - MX_ENUM_VALUE( windReedDuduk, "wind.reed.duduk" ) \ - MX_ENUM_VALUE( windReedDulcian, "wind.reed.dulcian" ) \ - MX_ENUM_VALUE( windReedDulzaina, "wind.reed.dulzaina" ) \ - MX_ENUM_VALUE( windReedEnglishHorn, "wind.reed.english-horn" ) \ - MX_ENUM_VALUE( windReedGuanzi, "wind.reed.guanzi" ) \ - MX_ENUM_VALUE( windReedHarmonica, "wind.reed.harmonica" ) \ - MX_ENUM_VALUE( windReedHarmonicaBass, "wind.reed.harmonica.bass" ) \ - MX_ENUM_VALUE( windReedHeckelClarina, "wind.reed.heckel-clarina" ) \ - MX_ENUM_VALUE( windReedHeckelphone, "wind.reed.heckelphone" ) \ - MX_ENUM_VALUE( windReedHeckelphonePiccolo, "wind.reed.heckelphone.piccolo" ) \ - MX_ENUM_VALUE( windReedHeckelphoneClarinet, "wind.reed.heckelphone-clarinet" ) \ - MX_ENUM_VALUE( windReedHichiriki, "wind.reed.hichiriki" ) \ - MX_ENUM_VALUE( windReedHirtenschalmei, "wind.reed.hirtenschalmei" ) \ - MX_ENUM_VALUE( windReedHne, "wind.reed.hne" ) \ - MX_ENUM_VALUE( windReedHornpipe, "wind.reed.hornpipe" ) \ - MX_ENUM_VALUE( windReedHouguan, "wind.reed.houguan" ) \ - MX_ENUM_VALUE( windReedHulusi, "wind.reed.hulusi" ) \ - MX_ENUM_VALUE( windReedJogiBaja, "wind.reed.jogi-baja" ) \ - MX_ENUM_VALUE( windReedKenBau, "wind.reed.ken-bau" ) \ - MX_ENUM_VALUE( windReedKhaenMouthOrgan, "wind.reed.khaen-mouth-organ" ) \ - MX_ENUM_VALUE( windReedLauneddas, "wind.reed.launeddas" ) \ - MX_ENUM_VALUE( windReedMaqrunah, "wind.reed.maqrunah" ) \ - MX_ENUM_VALUE( windReedMelodica, "wind.reed.melodica" ) \ - MX_ENUM_VALUE( windReedMijwiz, "wind.reed.mijwiz" ) \ - MX_ENUM_VALUE( windReedMizmar, "wind.reed.mizmar" ) \ - MX_ENUM_VALUE( windReedNadaswaram, "wind.reed.nadaswaram" ) \ - MX_ENUM_VALUE( windReedOboe, "wind.reed.oboe" ) \ - MX_ENUM_VALUE( windReedOboeBass, "wind.reed.oboe.bass" ) \ - MX_ENUM_VALUE( windReedOboePiccolo, "wind.reed.oboe.piccolo" ) \ - MX_ENUM_VALUE( windReedOboeDaCaccia, "wind.reed.oboe-da-caccia" ) \ - MX_ENUM_VALUE( windReedOboeDamore, "wind.reed.oboe-damore" ) \ - MX_ENUM_VALUE( windReedOctavin, "wind.reed.octavin" ) \ - MX_ENUM_VALUE( windReedPi, "wind.reed.pi" ) \ - MX_ENUM_VALUE( windReedPibgorn, "wind.reed.pibgorn" ) \ - MX_ENUM_VALUE( windReedPiri, "wind.reed.piri" ) \ - MX_ENUM_VALUE( windReedRackett, "wind.reed.rackett" ) \ - MX_ENUM_VALUE( windReedRauschpfeife, "wind.reed.rauschpfeife" ) \ - MX_ENUM_VALUE( windReedRhaita, "wind.reed.rhaita" ) \ - MX_ENUM_VALUE( windReedRothphone, "wind.reed.rothphone" ) \ - MX_ENUM_VALUE( windReedSarrusaphone, "wind.reed.sarrusaphone" ) \ - MX_ENUM_VALUE( windReedSaxonette, "wind.reed.saxonette" ) \ - MX_ENUM_VALUE( windReedSaxophone, "wind.reed.saxophone" ) \ - MX_ENUM_VALUE( windReedSaxophoneAlto, "wind.reed.saxophone.alto" ) \ - MX_ENUM_VALUE( windReedSaxophoneAulochrome, "wind.reed.saxophone.aulochrome" ) \ - MX_ENUM_VALUE( windReedSaxophoneBaritone, "wind.reed.saxophone.baritone" ) \ - MX_ENUM_VALUE( windReedSaxophoneBass, "wind.reed.saxophone.bass" ) \ - MX_ENUM_VALUE( windReedSaxophoneContrabass, "wind.reed.saxophone.contrabass" ) \ - MX_ENUM_VALUE( windReedSaxophoneMelody, "wind.reed.saxophone.melody" ) \ - MX_ENUM_VALUE( windReedSaxophoneMezzoSoprano, "wind.reed.saxophone.mezzo-soprano" ) \ - MX_ENUM_VALUE( windReedSaxophoneSopranino, "wind.reed.saxophone.sopranino" ) \ - MX_ENUM_VALUE( windReedSaxophoneSopranissimo, "wind.reed.saxophone.sopranissimo" ) \ - MX_ENUM_VALUE( windReedSaxophoneSoprano, "wind.reed.saxophone.soprano" ) \ - MX_ENUM_VALUE( windReedSaxophoneSubcontrabass, "wind.reed.saxophone.subcontrabass" ) \ - MX_ENUM_VALUE( windReedSaxophoneTenor, "wind.reed.saxophone.tenor" ) \ - MX_ENUM_VALUE( windReedShawm, "wind.reed.shawm" ) \ - MX_ENUM_VALUE( windReedShenai, "wind.reed.shenai" ) \ - MX_ENUM_VALUE( windReedSheng, "wind.reed.sheng" ) \ - MX_ENUM_VALUE( windReedSipsi, "wind.reed.sipsi" ) \ - MX_ENUM_VALUE( windReedSopila, "wind.reed.sopila" ) \ - MX_ENUM_VALUE( windReedSorna, "wind.reed.sorna" ) \ - MX_ENUM_VALUE( windReedSralai, "wind.reed.sralai" ) \ - MX_ENUM_VALUE( windReedSuona, "wind.reed.suona" ) \ - MX_ENUM_VALUE( windReedSurnai, "wind.reed.surnai" ) \ - MX_ENUM_VALUE( windReedTaepyeongso, "wind.reed.taepyeongso" ) \ - MX_ENUM_VALUE( windReedTarogato, "wind.reed.tarogato" ) \ - MX_ENUM_VALUE( windReedTarogatoAncient, "wind.reed.tarogato.ancient" ) \ - MX_ENUM_VALUE( windReedTrompetaChina, "wind.reed.trompeta-china" ) \ - MX_ENUM_VALUE( windReedTubax, "wind.reed.tubax" ) \ - MX_ENUM_VALUE( windReedXaphoon, "wind.reed.xaphoon" ) \ - MX_ENUM_VALUE( windReedZhaleika, "wind.reed.zhaleika" ) \ - MX_ENUM_VALUE( windReedZurla, "wind.reed.zurla" ) \ - MX_ENUM_VALUE( windReedZurna, "wind.reed.zurna" ) \ - MX_ENUM_VALUE( woodAgogoBlock, "wood.agogo-block" ) \ - MX_ENUM_VALUE( woodAgungATamlang, "wood.agung-a-tamlang" ) \ - MX_ENUM_VALUE( woodAhoko, "wood.ahoko" ) \ - MX_ENUM_VALUE( woodBones, "wood.bones" ) \ - MX_ENUM_VALUE( woodCastanets, "wood.castanets" ) \ - MX_ENUM_VALUE( woodClaves, "wood.claves" ) \ - MX_ENUM_VALUE( woodDrumSticks, "wood.drum-sticks" ) \ - MX_ENUM_VALUE( woodGourd, "wood.gourd" ) \ - MX_ENUM_VALUE( woodGraniteBlock, "wood.granite-block" ) \ - MX_ENUM_VALUE( woodGuban, "wood.guban" ) \ - MX_ENUM_VALUE( woodGuiro, "wood.guiro" ) \ - MX_ENUM_VALUE( woodHyoushigi, "wood.hyoushigi" ) \ - MX_ENUM_VALUE( woodIpu, "wood.ipu" ) \ - MX_ENUM_VALUE( woodJamBlock, "wood.jam-block" ) \ - MX_ENUM_VALUE( woodKaekeeke, "wood.kaekeeke" ) \ - MX_ENUM_VALUE( woodKagul, "wood.kagul" ) \ - MX_ENUM_VALUE( woodKalaau, "wood.kalaau" ) \ - MX_ENUM_VALUE( woodKashiklar, "wood.kashiklar" ) \ - MX_ENUM_VALUE( woodKubing, "wood.kubing" ) \ - MX_ENUM_VALUE( woodPanClappers, "wood.pan-clappers" ) \ - MX_ENUM_VALUE( woodSandBlock, "wood.sand-block" ) \ - MX_ENUM_VALUE( woodSlapstick, "wood.slapstick" ) \ - MX_ENUM_VALUE( woodStirDrum, "wood.stir-drum" ) \ - MX_ENUM_VALUE( woodTempleBlock, "wood.temple-block" ) \ - MX_ENUM_VALUE( woodTicTocBlock, "wood.tic-toc-block" ) \ - MX_ENUM_VALUE( woodTonetang, "wood.tonetang" ) \ - MX_ENUM_VALUE( woodWoodBlock, "wood.wood-block" ) \ +#define MX_ENUM_MEMBERS(MX_ENUM_VALUE) \ + MX_ENUM_VALUE(brassAlphorn, "brass.alphorn") \ + MX_ENUM_VALUE(brassAltoHorn, "brass.alto-horn") \ + MX_ENUM_VALUE(brassBaritoneHorn, "brass.baritone-horn") \ + MX_ENUM_VALUE(brassBugle, "brass.bugle") \ + MX_ENUM_VALUE(brassBugleAlto, "brass.bugle.alto") \ + MX_ENUM_VALUE(brassBugleBaritone, "brass.bugle.baritone") \ + MX_ENUM_VALUE(brassBugleContrabass, "brass.bugle.contrabass") \ + MX_ENUM_VALUE(brassBugleEuphoniumBugle, "brass.bugle.euphonium-bugle") \ + MX_ENUM_VALUE(brassBugleMellophoneBugle, "brass.bugle.mellophone-bugle") \ + MX_ENUM_VALUE(brassBugleSoprano, "brass.bugle.soprano") \ + MX_ENUM_VALUE(brassCimbasso, "brass.cimbasso") \ + MX_ENUM_VALUE(brassConchShell, "brass.conch-shell") \ + MX_ENUM_VALUE(brassCornet, "brass.cornet") \ + MX_ENUM_VALUE(brassCornetSoprano, "brass.cornet.soprano") \ + MX_ENUM_VALUE(brassCornett, "brass.cornett") \ + MX_ENUM_VALUE(brassCornettTenor, "brass.cornett.tenor") \ + MX_ENUM_VALUE(brassCornettino, "brass.cornettino") \ + MX_ENUM_VALUE(brassDidgeridoo, "brass.didgeridoo") \ + MX_ENUM_VALUE(brassEuphonium, "brass.euphonium") \ + MX_ENUM_VALUE(brassFiscorn, "brass.fiscorn") \ + MX_ENUM_VALUE(brassFlugelhorn, "brass.flugelhorn") \ + MX_ENUM_VALUE(brassFrenchHorn, "brass.french-horn") \ + MX_ENUM_VALUE(brassGroup, "brass.group") \ + MX_ENUM_VALUE(brassGroupSynth, "brass.group.synth") \ + MX_ENUM_VALUE(brassHelicon, "brass.helicon") \ + MX_ENUM_VALUE(brassHoragai, "brass.horagai") \ + MX_ENUM_VALUE(brassKuhlohorn, "brass.kuhlohorn") \ + MX_ENUM_VALUE(brassMellophone, "brass.mellophone") \ + MX_ENUM_VALUE(brassNaturalHorn, "brass.natural-horn") \ + MX_ENUM_VALUE(brassOphicleide, "brass.ophicleide") \ + MX_ENUM_VALUE(brassPosthorn, "brass.posthorn") \ + MX_ENUM_VALUE(brassRagDung, "brass.rag-dung") \ + MX_ENUM_VALUE(brassSackbutt, "brass.sackbutt") \ + MX_ENUM_VALUE(brassSackbuttAlto, "brass.sackbutt.alto") \ + MX_ENUM_VALUE(brassSackbuttBass, "brass.sackbutt.bass") \ + MX_ENUM_VALUE(brassSackbuttTenor, "brass.sackbutt.tenor") \ + MX_ENUM_VALUE(brassSaxhorn, "brass.saxhorn") \ + MX_ENUM_VALUE(brassSerpent, "brass.serpent") \ + MX_ENUM_VALUE(brassShofar, "brass.shofar") \ + MX_ENUM_VALUE(brassSousaphone, "brass.sousaphone") \ + MX_ENUM_VALUE(brassTrombone, "brass.trombone") \ + MX_ENUM_VALUE(brassTromboneAlto, "brass.trombone.alto") \ + MX_ENUM_VALUE(brassTromboneBass, "brass.trombone.bass") \ + MX_ENUM_VALUE(brassTromboneContrabass, "brass.trombone.contrabass") \ + MX_ENUM_VALUE(brassTromboneTenor, "brass.trombone.tenor") \ + MX_ENUM_VALUE(brassTrumpet, "brass.trumpet") \ + MX_ENUM_VALUE(brassTrumpetBaroque, "brass.trumpet.baroque") \ + MX_ENUM_VALUE(brassTrumpetBass, "brass.trumpet.bass") \ + MX_ENUM_VALUE(brassTrumpetBflat, "brass.trumpet.bflat") \ + MX_ENUM_VALUE(brassTrumpetC, "brass.trumpet.c") \ + MX_ENUM_VALUE(brassTrumpetD, "brass.trumpet.d") \ + MX_ENUM_VALUE(brassTrumpetPiccolo, "brass.trumpet.piccolo") \ + MX_ENUM_VALUE(brassTrumpetPocket, "brass.trumpet.pocket") \ + MX_ENUM_VALUE(brassTrumpetSlide, "brass.trumpet.slide") \ + MX_ENUM_VALUE(brassTrumpetTenor, "brass.trumpet.tenor") \ + MX_ENUM_VALUE(brassTuba, "brass.tuba") \ + MX_ENUM_VALUE(brassTubaBass, "brass.tuba.bass") \ + MX_ENUM_VALUE(brassTubaSubcontrabass, "brass.tuba.subcontrabass") \ + MX_ENUM_VALUE(brassViennaHorn, "brass.vienna-horn") \ + MX_ENUM_VALUE(brassVuvuzela, "brass.vuvuzela") \ + MX_ENUM_VALUE(brassWagnerTuba, "brass.wagner-tuba") \ + MX_ENUM_VALUE(drumApentemma, "drum.apentemma") \ + MX_ENUM_VALUE(drumAshiko, "drum.ashiko") \ + MX_ENUM_VALUE(drumAtabaque, "drum.atabaque") \ + MX_ENUM_VALUE(drumAtoke, "drum.atoke") \ + MX_ENUM_VALUE(drumAtsimevu, "drum.atsimevu") \ + MX_ENUM_VALUE(drumAxatse, "drum.axatse") \ + MX_ENUM_VALUE(drumBassDrum, "drum.bass-drum") \ + MX_ENUM_VALUE(drumBata, "drum.bata") \ + MX_ENUM_VALUE(drumBataItotele, "drum.bata.itotele") \ + MX_ENUM_VALUE(drumBataIya, "drum.bata.iya") \ + MX_ENUM_VALUE(drumBataOkonkolo, "drum.bata.okonkolo") \ + MX_ENUM_VALUE(drumBendir, "drum.bendir") \ + MX_ENUM_VALUE(drumBodhran, "drum.bodhran") \ + MX_ENUM_VALUE(drumBombo, "drum.bombo") \ + MX_ENUM_VALUE(drumBongo, "drum.bongo") \ + MX_ENUM_VALUE(drumBougarabou, "drum.bougarabou") \ + MX_ENUM_VALUE(drumBuffaloDrum, "drum.buffalo-drum") \ + MX_ENUM_VALUE(drumCajon, "drum.cajon") \ + MX_ENUM_VALUE(drumChenda, "drum.chenda") \ + MX_ENUM_VALUE(drumChuDaiko, "drum.chu-daiko") \ + MX_ENUM_VALUE(drumConga, "drum.conga") \ + MX_ENUM_VALUE(drumCuica, "drum.cuica") \ + MX_ENUM_VALUE(drumDabakan, "drum.dabakan") \ + MX_ENUM_VALUE(drumDaff, "drum.daff") \ + MX_ENUM_VALUE(drumDafli, "drum.dafli") \ + MX_ENUM_VALUE(drumDaibyosi, "drum.daibyosi") \ + MX_ENUM_VALUE(drumDamroo, "drum.damroo") \ + MX_ENUM_VALUE(drumDarabuka, "drum.darabuka") \ + MX_ENUM_VALUE(drumDef, "drum.def") \ + MX_ENUM_VALUE(drumDhol, "drum.dhol") \ + MX_ENUM_VALUE(drumDholak, "drum.dholak") \ + MX_ENUM_VALUE(drumDjembe, "drum.djembe") \ + MX_ENUM_VALUE(drumDoira, "drum.doira") \ + MX_ENUM_VALUE(drumDondo, "drum.dondo") \ + MX_ENUM_VALUE(drumDounDounBa, "drum.doun-doun-ba") \ + MX_ENUM_VALUE(drumDuff, "drum.duff") \ + MX_ENUM_VALUE(drumDumbek, "drum.dumbek") \ + MX_ENUM_VALUE(drumFontomfrom, "drum.fontomfrom") \ + MX_ENUM_VALUE(drumFrameDrum, "drum.frame-drum") \ + MX_ENUM_VALUE(drumFrameDrumArabian, "drum.frame-drum.arabian") \ + MX_ENUM_VALUE(drumGeduk, "drum.geduk") \ + MX_ENUM_VALUE(drumGhatam, "drum.ghatam") \ + MX_ENUM_VALUE(drumGome, "drum.gome") \ + MX_ENUM_VALUE(drumGroup, "drum.group") \ + MX_ENUM_VALUE(drumGroupChinese, "drum.group.chinese") \ + MX_ENUM_VALUE(drumGroupEwe, "drum.group.ewe") \ + MX_ENUM_VALUE(drumGroupIndian, "drum.group.indian") \ + MX_ENUM_VALUE(drumGroupSet, "drum.group.set") \ + MX_ENUM_VALUE(drumHandDrum, "drum.hand-drum") \ + MX_ENUM_VALUE(drumHiraDaiko, "drum.hira-daiko") \ + MX_ENUM_VALUE(drumIbo, "drum.ibo") \ + MX_ENUM_VALUE(drumIgihumurizo, "drum.igihumurizo") \ + MX_ENUM_VALUE(drumInyahura, "drum.inyahura") \ + MX_ENUM_VALUE(drumIshakwe, "drum.ishakwe") \ + MX_ENUM_VALUE(drumJangGu, "drum.jang-gu") \ + MX_ENUM_VALUE(drumKagan, "drum.kagan") \ + MX_ENUM_VALUE(drumKakko, "drum.kakko") \ + MX_ENUM_VALUE(drumKanjira, "drum.kanjira") \ + MX_ENUM_VALUE(drumKendhang, "drum.kendhang") \ + MX_ENUM_VALUE(drumKendhangAgeng, "drum.kendhang.ageng") \ + MX_ENUM_VALUE(drumKendhangCiblon, "drum.kendhang.ciblon") \ + MX_ENUM_VALUE(drumKenkeni, "drum.kenkeni") \ + MX_ENUM_VALUE(drumKhol, "drum.khol") \ + MX_ENUM_VALUE(drumKickDrum, "drum.kick-drum") \ + MX_ENUM_VALUE(drumKidi, "drum.kidi") \ + MX_ENUM_VALUE(drumKoDaiko, "drum.ko-daiko") \ + MX_ENUM_VALUE(drumKpanlogo, "drum.kpanlogo") \ + MX_ENUM_VALUE(drumKudum, "drum.kudum") \ + MX_ENUM_VALUE(drumLambeg, "drum.lambeg") \ + MX_ENUM_VALUE(drumLionDrum, "drum.lion-drum") \ + MX_ENUM_VALUE(drumLogDrum, "drum.log-drum") \ + MX_ENUM_VALUE(drumLogDrumAfrican, "drum.log-drum.african") \ + MX_ENUM_VALUE(drumLogDrumNative, "drum.log-drum.native") \ + MX_ENUM_VALUE(drumLogDrumNigerian, "drum.log-drum.nigerian") \ + MX_ENUM_VALUE(drumMadal, "drum.madal") \ + MX_ENUM_VALUE(drumMaddale, "drum.maddale") \ + MX_ENUM_VALUE(drumMridangam, "drum.mridangam") \ + MX_ENUM_VALUE(drumNaal, "drum.naal") \ + MX_ENUM_VALUE(drumNagadoDaiko, "drum.nagado-daiko") \ + MX_ENUM_VALUE(drumNagara, "drum.nagara") \ + MX_ENUM_VALUE(drumNaqara, "drum.naqara") \ + MX_ENUM_VALUE(drumODaiko, "drum.o-daiko") \ + MX_ENUM_VALUE(drumOkawa, "drum.okawa") \ + MX_ENUM_VALUE(drumOkedoDaiko, "drum.okedo-daiko") \ + MX_ENUM_VALUE(drumPahuHula, "drum.pahu-hula") \ + MX_ENUM_VALUE(drumPakhawaj, "drum.pakhawaj") \ + MX_ENUM_VALUE(drumPandeiro, "drum.pandeiro") \ + MX_ENUM_VALUE(drumPandero, "drum.pandero") \ + MX_ENUM_VALUE(drumPowwow, "drum.powwow") \ + MX_ENUM_VALUE(drumPueblo, "drum.pueblo") \ + MX_ENUM_VALUE(drumRepinique, "drum.repinique") \ + MX_ENUM_VALUE(drumRiq, "drum.riq") \ + MX_ENUM_VALUE(drumRototom, "drum.rototom") \ + MX_ENUM_VALUE(drumSabar, "drum.sabar") \ + MX_ENUM_VALUE(drumSakara, "drum.sakara") \ + MX_ENUM_VALUE(drumSampho, "drum.sampho") \ + MX_ENUM_VALUE(drumSangban, "drum.sangban") \ + MX_ENUM_VALUE(drumShimeDaiko, "drum.shime-daiko") \ + MX_ENUM_VALUE(drumSlitDrum, "drum.slit-drum") \ + MX_ENUM_VALUE(drumSlitDrumKrin, "drum.slit-drum.krin") \ + MX_ENUM_VALUE(drumSnareDrum, "drum.snare-drum") \ + MX_ENUM_VALUE(drumSnareDrumElectric, "drum.snare-drum.electric") \ + MX_ENUM_VALUE(drumSogo, "drum.sogo") \ + MX_ENUM_VALUE(drumSurdo, "drum.surdo") \ + MX_ENUM_VALUE(drumTabla, "drum.tabla") \ + MX_ENUM_VALUE(drumTablaBayan, "drum.tabla.bayan") \ + MX_ENUM_VALUE(drumTablaDayan, "drum.tabla.dayan") \ + MX_ENUM_VALUE(drumTaiko, "drum.taiko") \ + MX_ENUM_VALUE(drumTalking, "drum.talking") \ + MX_ENUM_VALUE(drumTama, "drum.tama") \ + MX_ENUM_VALUE(drumTamborita, "drum.tamborita") \ + MX_ENUM_VALUE(drumTambourine, "drum.tambourine") \ + MX_ENUM_VALUE(drumTamte, "drum.tamte") \ + MX_ENUM_VALUE(drumTangku, "drum.tangku") \ + MX_ENUM_VALUE(drumTanTan, "drum.tan-tan") \ + MX_ENUM_VALUE(drumTaphon, "drum.taphon") \ + MX_ENUM_VALUE(drumTar, "drum.tar") \ + MX_ENUM_VALUE(drumTasha, "drum.tasha") \ + MX_ENUM_VALUE(drumTenorDrum, "drum.tenor-drum") \ + MX_ENUM_VALUE(drumTeponaxtli, "drum.teponaxtli") \ + MX_ENUM_VALUE(drumThavil, "drum.thavil") \ + MX_ENUM_VALUE(drumTheBox, "drum.the-box") \ + MX_ENUM_VALUE(drumTimbale, "drum.timbale") \ + MX_ENUM_VALUE(drumTimpani, "drum.timpani") \ + MX_ENUM_VALUE(drumTinaja, "drum.tinaja") \ + MX_ENUM_VALUE(drumToere, "drum.toere") \ + MX_ENUM_VALUE(drumTombak, "drum.tombak") \ + MX_ENUM_VALUE(drumTomTom, "drum.tom-tom") \ + MX_ENUM_VALUE(drumTomTomSynth, "drum.tom-tom.synth") \ + MX_ENUM_VALUE(drumTsuzumi, "drum.tsuzumi") \ + MX_ENUM_VALUE(drumTumbak, "drum.tumbak") \ + MX_ENUM_VALUE(drumUchiwaDaiko, "drum.uchiwa-daiko") \ + MX_ENUM_VALUE(drumUdaku, "drum.udaku") \ + MX_ENUM_VALUE(drumUdu, "drum.udu") \ + MX_ENUM_VALUE(drumZarb, "drum.zarb") \ + MX_ENUM_VALUE(effectAeolianHarp, "effect.aeolian-harp") \ + MX_ENUM_VALUE(effectAirHorn, "effect.air-horn") \ + MX_ENUM_VALUE(effectApplause, "effect.applause") \ + MX_ENUM_VALUE(effectBassStringSlap, "effect.bass-string-slap") \ + MX_ENUM_VALUE(effectBird, "effect.bird") \ + MX_ENUM_VALUE(effectBirdNightingale, "effect.bird.nightingale") \ + MX_ENUM_VALUE(effectBirdTweet, "effect.bird.tweet") \ + MX_ENUM_VALUE(effectBreath, "effect.breath") \ + MX_ENUM_VALUE(effectBubble, "effect.bubble") \ + MX_ENUM_VALUE(effectBullroarer, "effect.bullroarer") \ + MX_ENUM_VALUE(effectBurst, "effect.burst") \ + MX_ENUM_VALUE(effectCar, "effect.car") \ + MX_ENUM_VALUE(effectCarCrash, "effect.car.crash") \ + MX_ENUM_VALUE(effectCarEngine, "effect.car.engine") \ + MX_ENUM_VALUE(effectCarPass, "effect.car.pass") \ + MX_ENUM_VALUE(effectCarStop, "effect.car.stop") \ + MX_ENUM_VALUE(effectCrickets, "effect.crickets") \ + MX_ENUM_VALUE(effectDog, "effect.dog") \ + MX_ENUM_VALUE(effectDoorCreak, "effect.door.creak") \ + MX_ENUM_VALUE(effectDoorSlam, "effect.door.slam") \ + MX_ENUM_VALUE(effectExplosion, "effect.explosion") \ + MX_ENUM_VALUE(effectFluteKeyClick, "effect.flute-key-click") \ + MX_ENUM_VALUE(effectFootsteps, "effect.footsteps") \ + MX_ENUM_VALUE(effectFrogs, "effect.frogs") \ + MX_ENUM_VALUE(effectGuitarCutting, "effect.guitar-cutting") \ + MX_ENUM_VALUE(effectGuitarFret, "effect.guitar-fret") \ + MX_ENUM_VALUE(effectGunshot, "effect.gunshot") \ + MX_ENUM_VALUE(effectHandClap, "effect.hand-clap") \ + MX_ENUM_VALUE(effectHeartbeat, "effect.heartbeat") \ + MX_ENUM_VALUE(effectHelicopter, "effect.helicopter") \ + MX_ENUM_VALUE(effectHighQ, "effect.high-q") \ + MX_ENUM_VALUE(effectHorseGallop, "effect.horse-gallop") \ + MX_ENUM_VALUE(effectJetPlane, "effect.jet-plane") \ + MX_ENUM_VALUE(effectLaserGun, "effect.laser-gun") \ + MX_ENUM_VALUE(effectLaugh, "effect.laugh") \ + MX_ENUM_VALUE(effectLionsRoar, "effect.lions-roar") \ + MX_ENUM_VALUE(effectMachineGun, "effect.machine-gun") \ + MX_ENUM_VALUE(effectMarchingMachine, "effect.marching-machine") \ + MX_ENUM_VALUE(effectMetronomeBell, "effect.metronome-bell") \ + MX_ENUM_VALUE(effectMetronomeClick, "effect.metronome-click") \ + MX_ENUM_VALUE(effectPat, "effect.pat") \ + MX_ENUM_VALUE(effectPunch, "effect.punch") \ + MX_ENUM_VALUE(effectRain, "effect.rain") \ + MX_ENUM_VALUE(effectScratch, "effect.scratch") \ + MX_ENUM_VALUE(effectScream, "effect.scream") \ + MX_ENUM_VALUE(effectSeashore, "effect.seashore") \ + MX_ENUM_VALUE(effectSiren, "effect.siren") \ + MX_ENUM_VALUE(effectSlap, "effect.slap") \ + MX_ENUM_VALUE(effectSnap, "effect.snap") \ + MX_ENUM_VALUE(effectStamp, "effect.stamp") \ + MX_ENUM_VALUE(effectStarship, "effect.starship") \ + MX_ENUM_VALUE(effectStream, "effect.stream") \ + MX_ENUM_VALUE(effectTelephoneRing, "effect.telephone-ring") \ + MX_ENUM_VALUE(effectThunder, "effect.thunder") \ + MX_ENUM_VALUE(effectTrain, "effect.train") \ + MX_ENUM_VALUE(effectTrashCan, "effect.trash-can") \ + MX_ENUM_VALUE(effectWhip, "effect.whip") \ + MX_ENUM_VALUE(effectWhistle, "effect.whistle") \ + MX_ENUM_VALUE(effectWhistleMouthSiren, "effect.whistle.mouth-siren") \ + MX_ENUM_VALUE(effectWhistlePolice, "effect.whistle.police") \ + MX_ENUM_VALUE(effectWhistleSlide, "effect.whistle.slide") \ + MX_ENUM_VALUE(effectWhistleTrain, "effect.whistle.train") \ + MX_ENUM_VALUE(effectWind, "effect.wind") \ + MX_ENUM_VALUE(keyboardAccordion, "keyboard.accordion") \ + MX_ENUM_VALUE(keyboardBandoneon, "keyboard.bandoneon") \ + MX_ENUM_VALUE(keyboardCelesta, "keyboard.celesta") \ + MX_ENUM_VALUE(keyboardClavichord, "keyboard.clavichord") \ + MX_ENUM_VALUE(keyboardClavichordSynth, "keyboard.clavichord.synth") \ + MX_ENUM_VALUE(keyboardConcertina, "keyboard.concertina") \ + MX_ENUM_VALUE(keyboardFortepiano, "keyboard.fortepiano") \ + MX_ENUM_VALUE(keyboardHarmonium, "keyboard.harmonium") \ + MX_ENUM_VALUE(keyboardHarpsichord, "keyboard.harpsichord") \ + MX_ENUM_VALUE(keyboardOndesMartenot, "keyboard.ondes-martenot") \ + MX_ENUM_VALUE(keyboardOrgan, "keyboard.organ") \ + MX_ENUM_VALUE(keyboardOrganDrawbar, "keyboard.organ.drawbar") \ + MX_ENUM_VALUE(keyboardOrganPercussive, "keyboard.organ.percussive") \ + MX_ENUM_VALUE(keyboardOrganPipe, "keyboard.organ.pipe") \ + MX_ENUM_VALUE(keyboardOrganReed, "keyboard.organ.reed") \ + MX_ENUM_VALUE(keyboardOrganRotary, "keyboard.organ.rotary") \ + MX_ENUM_VALUE(keyboardPiano, "keyboard.piano") \ + MX_ENUM_VALUE(keyboardPianoElectric, "keyboard.piano.electric") \ + MX_ENUM_VALUE(keyboardPianoGrand, "keyboard.piano.grand") \ + MX_ENUM_VALUE(keyboardPianoHonkyTonk, "keyboard.piano.honky-tonk") \ + MX_ENUM_VALUE(keyboardPianoPrepared, "keyboard.piano.prepared") \ + MX_ENUM_VALUE(keyboardPianoToy, "keyboard.piano.toy") \ + MX_ENUM_VALUE(keyboardPianoUpright, "keyboard.piano.upright") \ + MX_ENUM_VALUE(keyboardVirginal, "keyboard.virginal") \ + MX_ENUM_VALUE(metalAdodo, "metal.adodo") \ + MX_ENUM_VALUE(metalAnvil, "metal.anvil") \ + MX_ENUM_VALUE(metalBabendil, "metal.babendil") \ + MX_ENUM_VALUE(metalBellsAgogo, "metal.bells.agogo") \ + MX_ENUM_VALUE(metalBellsAlmglocken, "metal.bells.almglocken") \ + MX_ENUM_VALUE(metalBellsBellPlate, "metal.bells.bell-plate") \ + MX_ENUM_VALUE(metalBellsBellTree, "metal.bells.bell-tree") \ + MX_ENUM_VALUE(metalBellsCarillon, "metal.bells.carillon") \ + MX_ENUM_VALUE(metalBellsChimes, "metal.bells.chimes") \ + MX_ENUM_VALUE(metalBellsChimta, "metal.bells.chimta") \ + MX_ENUM_VALUE(metalBellsChippli, "metal.bells.chippli") \ + MX_ENUM_VALUE(metalBellsChurch, "metal.bells.church") \ + MX_ENUM_VALUE(metalBellsCowbell, "metal.bells.cowbell") \ + MX_ENUM_VALUE(metalBellsDawuro, "metal.bells.dawuro") \ + MX_ENUM_VALUE(metalBellsGankokwe, "metal.bells.gankokwe") \ + MX_ENUM_VALUE(metalBellsGhungroo, "metal.bells.ghungroo") \ + MX_ENUM_VALUE(metalBellsHatheli, "metal.bells.hatheli") \ + MX_ENUM_VALUE(metalBellsJingleBell, "metal.bells.jingle-bell") \ + MX_ENUM_VALUE(metalBellsKhartal, "metal.bells.khartal") \ + MX_ENUM_VALUE(metalBellsMarkTree, "metal.bells.mark-tree") \ + MX_ENUM_VALUE(metalBellsSistrum, "metal.bells.sistrum") \ + MX_ENUM_VALUE(metalBellsSleighBells, "metal.bells.sleigh-bells") \ + MX_ENUM_VALUE(metalBellsTemple, "metal.bells.temple") \ + MX_ENUM_VALUE(metalBellsTibetan, "metal.bells.tibetan") \ + MX_ENUM_VALUE(metalBellsTinklebell, "metal.bells.tinklebell") \ + MX_ENUM_VALUE(metalBellsTrychel, "metal.bells.trychel") \ + MX_ENUM_VALUE(metalBellsWindChimes, "metal.bells.wind-chimes") \ + MX_ENUM_VALUE(metalBellsZills, "metal.bells.zills") \ + MX_ENUM_VALUE(metalBerimbau, "metal.berimbau") \ + MX_ENUM_VALUE(metalBrakeDrums, "metal.brake-drums") \ + MX_ENUM_VALUE(metalCrotales, "metal.crotales") \ + MX_ENUM_VALUE(metalCymbalBo, "metal.cymbal.bo") \ + MX_ENUM_VALUE(metalCymbalCengCeng, "metal.cymbal.ceng-ceng") \ + MX_ENUM_VALUE(metalCymbalChabara, "metal.cymbal.chabara") \ + MX_ENUM_VALUE(metalCymbalChinese, "metal.cymbal.chinese") \ + MX_ENUM_VALUE(metalCymbalChing, "metal.cymbal.ching") \ + MX_ENUM_VALUE(metalCymbalClash, "metal.cymbal.clash") \ + MX_ENUM_VALUE(metalCymbalCrash, "metal.cymbal.crash") \ + MX_ENUM_VALUE(metalCymbalFinger, "metal.cymbal.finger") \ + MX_ENUM_VALUE(metalCymbalHand, "metal.cymbal.hand") \ + MX_ENUM_VALUE(metalCymbalKesi, "metal.cymbal.kesi") \ + MX_ENUM_VALUE(metalCymbalManjeera, "metal.cymbal.manjeera") \ + MX_ENUM_VALUE(metalCymbalReverse, "metal.cymbal.reverse") \ + MX_ENUM_VALUE(metalCymbalRide, "metal.cymbal.ride") \ + MX_ENUM_VALUE(metalCymbalSizzle, "metal.cymbal.sizzle") \ + MX_ENUM_VALUE(metalCymbalSplash, "metal.cymbal.splash") \ + MX_ENUM_VALUE(metalCymbalSuspended, "metal.cymbal.suspended") \ + MX_ENUM_VALUE(metalCymbalTebyoshi, "metal.cymbal.tebyoshi") \ + MX_ENUM_VALUE(metalCymbalTibetan, "metal.cymbal.tibetan") \ + MX_ENUM_VALUE(metalCymbalTingsha, "metal.cymbal.tingsha") \ + MX_ENUM_VALUE(metalFlexatone, "metal.flexatone") \ + MX_ENUM_VALUE(metalGong, "metal.gong") \ + MX_ENUM_VALUE(metalGongAgeng, "metal.gong.ageng") \ + MX_ENUM_VALUE(metalGongAgung, "metal.gong.agung") \ + MX_ENUM_VALUE(metalGongChanchiki, "metal.gong.chanchiki") \ + MX_ENUM_VALUE(metalGongChinese, "metal.gong.chinese") \ + MX_ENUM_VALUE(metalGongGandingan, "metal.gong.gandingan") \ + MX_ENUM_VALUE(metalGongKempul, "metal.gong.kempul") \ + MX_ENUM_VALUE(metalGongKempyang, "metal.gong.kempyang") \ + MX_ENUM_VALUE(metalGongKetuk, "metal.gong.ketuk") \ + MX_ENUM_VALUE(metalGongKkwenggwari, "metal.gong.kkwenggwari") \ + MX_ENUM_VALUE(metalGongLuo, "metal.gong.luo") \ + MX_ENUM_VALUE(metalGongSinging, "metal.gong.singing") \ + MX_ENUM_VALUE(metalGongThai, "metal.gong.thai") \ + MX_ENUM_VALUE(metalGuira, "metal.guira") \ + MX_ENUM_VALUE(metalHang, "metal.hang") \ + MX_ENUM_VALUE(metalHiHat, "metal.hi-hat") \ + MX_ENUM_VALUE(metalJawHarp, "metal.jaw-harp") \ + MX_ENUM_VALUE(metalKengong, "metal.kengong") \ + MX_ENUM_VALUE(metalMurchang, "metal.murchang") \ + MX_ENUM_VALUE(metalMusicalSaw, "metal.musical-saw") \ + MX_ENUM_VALUE(metalSingingBowl, "metal.singing-bowl") \ + MX_ENUM_VALUE(metalSpoons, "metal.spoons") \ + MX_ENUM_VALUE(metalSteelDrums, "metal.steel-drums") \ + MX_ENUM_VALUE(metalTamtam, "metal.tamtam") \ + MX_ENUM_VALUE(metalThundersheet, "metal.thundersheet") \ + MX_ENUM_VALUE(metalTriangle, "metal.triangle") \ + MX_ENUM_VALUE(metalWashboard, "metal.washboard") \ + MX_ENUM_VALUE(pitchedPercussionAngklung, "pitched-percussion.angklung") \ + MX_ENUM_VALUE(pitchedPercussionBalafon, "pitched-percussion.balafon") \ + MX_ENUM_VALUE(pitchedPercussionBellLyre, "pitched-percussion.bell-lyre") \ + MX_ENUM_VALUE(pitchedPercussionBells, "pitched-percussion.bells") \ + MX_ENUM_VALUE(pitchedPercussionBianqing, "pitched-percussion.bianqing") \ + MX_ENUM_VALUE(pitchedPercussionBianzhong, "pitched-percussion.bianzhong") \ + MX_ENUM_VALUE(pitchedPercussionBonang, "pitched-percussion.bonang") \ + MX_ENUM_VALUE(pitchedPercussionCimbalom, "pitched-percussion.cimbalom") \ + MX_ENUM_VALUE(pitchedPercussionCrystalGlasses, "pitched-percussion.crystal-glasses") \ + MX_ENUM_VALUE(pitchedPercussionDanTamThapLuc, "pitched-percussion.dan-tam-thap-luc") \ + MX_ENUM_VALUE(pitchedPercussionFangxiang, "pitched-percussion.fangxiang") \ + MX_ENUM_VALUE(pitchedPercussionGandinganAKayo, "pitched-percussion.gandingan-a-kayo") \ + MX_ENUM_VALUE(pitchedPercussionGangsa, "pitched-percussion.gangsa") \ + MX_ENUM_VALUE(pitchedPercussionGender, "pitched-percussion.gender") \ + MX_ENUM_VALUE(pitchedPercussionGiying, "pitched-percussion.giying") \ + MX_ENUM_VALUE(pitchedPercussionGlassHarmonica, "pitched-percussion.glass-harmonica") \ + MX_ENUM_VALUE(pitchedPercussionGlockenspiel, "pitched-percussion.glockenspiel") \ + MX_ENUM_VALUE(pitchedPercussionGlockenspielAlto, "pitched-percussion.glockenspiel.alto") \ + MX_ENUM_VALUE(pitchedPercussionGlockenspielSoprano, "pitched-percussion.glockenspiel.soprano") \ + MX_ENUM_VALUE(pitchedPercussionGyil, "pitched-percussion.gyil") \ + MX_ENUM_VALUE(pitchedPercussionHammerDulcimer, "pitched-percussion.hammer-dulcimer") \ + MX_ENUM_VALUE(pitchedPercussionHandbells, "pitched-percussion.handbells") \ + MX_ENUM_VALUE(pitchedPercussionKalimba, "pitched-percussion.kalimba") \ + MX_ENUM_VALUE(pitchedPercussionKantil, "pitched-percussion.kantil") \ + MX_ENUM_VALUE(pitchedPercussionKhim, "pitched-percussion.khim") \ + MX_ENUM_VALUE(pitchedPercussionKulintang, "pitched-percussion.kulintang") \ + MX_ENUM_VALUE(pitchedPercussionKulintangAKayo, "pitched-percussion.kulintang-a-kayo") \ + MX_ENUM_VALUE(pitchedPercussionKulintangATiniok, "pitched-percussion.kulintang-a-tiniok") \ + MX_ENUM_VALUE(pitchedPercussionLikembe, "pitched-percussion.likembe") \ + MX_ENUM_VALUE(pitchedPercussionLuntang, "pitched-percussion.luntang") \ + MX_ENUM_VALUE(pitchedPercussionMarimba, "pitched-percussion.marimba") \ + MX_ENUM_VALUE(pitchedPercussionMarimbaBass, "pitched-percussion.marimba.bass") \ + MX_ENUM_VALUE(pitchedPercussionMbira, "pitched-percussion.mbira") \ + MX_ENUM_VALUE(pitchedPercussionMbiraArray, "pitched-percussion.mbira.array") \ + MX_ENUM_VALUE(pitchedPercussionMetallophone, "pitched-percussion.metallophone") \ + MX_ENUM_VALUE(pitchedPercussionMetallophoneAlto, "pitched-percussion.metallophone.alto") \ + MX_ENUM_VALUE(pitchedPercussionMetallophoneBass, "pitched-percussion.metallophone.bass") \ + MX_ENUM_VALUE(pitchedPercussionMetallophoneSoprano, "pitched-percussion.metallophone.soprano") \ + MX_ENUM_VALUE(pitchedPercussionMusicBox, "pitched-percussion.music-box") \ + MX_ENUM_VALUE(pitchedPercussionPelogPanerus, "pitched-percussion.pelog-panerus") \ + MX_ENUM_VALUE(pitchedPercussionPemade, "pitched-percussion.pemade") \ + MX_ENUM_VALUE(pitchedPercussionPenyacah, "pitched-percussion.penyacah") \ + MX_ENUM_VALUE(pitchedPercussionRanatEk, "pitched-percussion.ranat.ek") \ + MX_ENUM_VALUE(pitchedPercussionRanatEkLek, "pitched-percussion.ranat.ek-lek") \ + MX_ENUM_VALUE(pitchedPercussionRanatThum, "pitched-percussion.ranat.thum") \ + MX_ENUM_VALUE(pitchedPercussionRanatThumLek, "pitched-percussion.ranat.thum-lek") \ + MX_ENUM_VALUE(pitchedPercussionReyong, "pitched-percussion.reyong") \ + MX_ENUM_VALUE(pitchedPercussionSanza, "pitched-percussion.sanza") \ + MX_ENUM_VALUE(pitchedPercussionSaronBarung, "pitched-percussion.saron-barung") \ + MX_ENUM_VALUE(pitchedPercussionSaronDemong, "pitched-percussion.saron-demong") \ + MX_ENUM_VALUE(pitchedPercussionSaronPanerus, "pitched-percussion.saron-panerus") \ + MX_ENUM_VALUE(pitchedPercussionSlendroPanerus, "pitched-percussion.slendro-panerus") \ + MX_ENUM_VALUE(pitchedPercussionSlentem, "pitched-percussion.slentem") \ + MX_ENUM_VALUE(pitchedPercussionTsymbaly, "pitched-percussion.tsymbaly") \ + MX_ENUM_VALUE(pitchedPercussionTubes, "pitched-percussion.tubes") \ + MX_ENUM_VALUE(pitchedPercussionTubularBells, "pitched-percussion.tubular-bells") \ + MX_ENUM_VALUE(pitchedPercussionVibraphone, "pitched-percussion.vibraphone") \ + MX_ENUM_VALUE(pitchedPercussionXylophone, "pitched-percussion.xylophone") \ + MX_ENUM_VALUE(pitchedPercussionXylophoneAlto, "pitched-percussion.xylophone.alto") \ + MX_ENUM_VALUE(pitchedPercussionXylophoneBass, "pitched-percussion.xylophone.bass") \ + MX_ENUM_VALUE(pitchedPercussionXylophoneSoprano, "pitched-percussion.xylophone.soprano") \ + MX_ENUM_VALUE(pitchedPercussionXylorimba, "pitched-percussion.xylorimba") \ + MX_ENUM_VALUE(pitchedPercussionYangqin, "pitched-percussion.yangqin") \ + MX_ENUM_VALUE(pluckArchlute, "pluck.archlute") \ + MX_ENUM_VALUE(pluckAutoharp, "pluck.autoharp") \ + MX_ENUM_VALUE(pluckBaglama, "pluck.baglama") \ + MX_ENUM_VALUE(pluckBajo, "pluck.bajo") \ + MX_ENUM_VALUE(pluckBalalaika, "pluck.balalaika") \ + MX_ENUM_VALUE(pluckBalalaikaAlto, "pluck.balalaika.alto") \ + MX_ENUM_VALUE(pluckBalalaikaBass, "pluck.balalaika.bass") \ + MX_ENUM_VALUE(pluckBalalaikaContrabass, "pluck.balalaika.contrabass") \ + MX_ENUM_VALUE(pluckBalalaikaPiccolo, "pluck.balalaika.piccolo") \ + MX_ENUM_VALUE(pluckBalalaikaPrima, "pluck.balalaika.prima") \ + MX_ENUM_VALUE(pluckBalalaikaSecunda, "pluck.balalaika.secunda") \ + MX_ENUM_VALUE(pluckBandola, "pluck.bandola") \ + MX_ENUM_VALUE(pluckBandura, "pluck.bandura") \ + MX_ENUM_VALUE(pluckBandurria, "pluck.bandurria") \ + MX_ENUM_VALUE(pluckBanjo, "pluck.banjo") \ + MX_ENUM_VALUE(pluckBanjoTenor, "pluck.banjo.tenor") \ + MX_ENUM_VALUE(pluckBanjolele, "pluck.banjolele") \ + MX_ENUM_VALUE(pluckBarbat, "pluck.barbat") \ + MX_ENUM_VALUE(pluckBass, "pluck.bass") \ + MX_ENUM_VALUE(pluckBassAcoustic, "pluck.bass.acoustic") \ + MX_ENUM_VALUE(pluckBassBolon, "pluck.bass.bolon") \ + MX_ENUM_VALUE(pluckBassElectric, "pluck.bass.electric") \ + MX_ENUM_VALUE(pluckBassFretless, "pluck.bass.fretless") \ + MX_ENUM_VALUE(pluckBassGuitarron, "pluck.bass.guitarron") \ + MX_ENUM_VALUE(pluckBassSynth, "pluck.bass.synth") \ + MX_ENUM_VALUE(pluckBassSynthLead, "pluck.bass.synth.lead") \ + MX_ENUM_VALUE(pluckBassWashtub, "pluck.bass.washtub") \ + MX_ENUM_VALUE(pluckBassWhamola, "pluck.bass.whamola") \ + MX_ENUM_VALUE(pluckBegena, "pluck.begena") \ + MX_ENUM_VALUE(pluckBiwa, "pluck.biwa") \ + MX_ENUM_VALUE(pluckBordonua, "pluck.bordonua") \ + MX_ENUM_VALUE(pluckBouzouki, "pluck.bouzouki") \ + MX_ENUM_VALUE(pluckBouzoukiIrish, "pluck.bouzouki.irish") \ + MX_ENUM_VALUE(pluckCelticHarp, "pluck.celtic-harp") \ + MX_ENUM_VALUE(pluckCharango, "pluck.charango") \ + MX_ENUM_VALUE(pluckChitarraBattente, "pluck.chitarra-battente") \ + MX_ENUM_VALUE(pluckCithara, "pluck.cithara") \ + MX_ENUM_VALUE(pluckCittern, "pluck.cittern") \ + MX_ENUM_VALUE(pluckCuatro, "pluck.cuatro") \ + MX_ENUM_VALUE(pluckDanBau, "pluck.dan-bau") \ + MX_ENUM_VALUE(pluckDanNguyet, "pluck.dan-nguyet") \ + MX_ENUM_VALUE(pluckDanTranh, "pluck.dan-tranh") \ + MX_ENUM_VALUE(pluckDanTyBa, "pluck.dan-ty-ba") \ + MX_ENUM_VALUE(pluckDiddleyBow, "pluck.diddley-bow") \ + MX_ENUM_VALUE(pluckDomra, "pluck.domra") \ + MX_ENUM_VALUE(pluckDomu, "pluck.domu") \ + MX_ENUM_VALUE(pluckDulcimer, "pluck.dulcimer") \ + MX_ENUM_VALUE(pluckDutar, "pluck.dutar") \ + MX_ENUM_VALUE(pluckDuxianqin, "pluck.duxianqin") \ + MX_ENUM_VALUE(pluckEktara, "pluck.ektara") \ + MX_ENUM_VALUE(pluckGeomungo, "pluck.geomungo") \ + MX_ENUM_VALUE(pluckGottuvadhyam, "pluck.gottuvadhyam") \ + MX_ENUM_VALUE(pluckGuitar, "pluck.guitar") \ + MX_ENUM_VALUE(pluckGuitarAcoustic, "pluck.guitar.acoustic") \ + MX_ENUM_VALUE(pluckGuitarElectric, "pluck.guitar.electric") \ + MX_ENUM_VALUE(pluckGuitarNylonString, "pluck.guitar.nylon-string") \ + MX_ENUM_VALUE(pluckGuitarPedalSteel, "pluck.guitar.pedal-steel") \ + MX_ENUM_VALUE(pluckGuitarPortuguese, "pluck.guitar.portuguese") \ + MX_ENUM_VALUE(pluckGuitarRequinto, "pluck.guitar.requinto") \ + MX_ENUM_VALUE(pluckGuitarResonator, "pluck.guitar.resonator") \ + MX_ENUM_VALUE(pluckGuitarSteelString, "pluck.guitar.steel-string") \ + MX_ENUM_VALUE(pluckGuitjo, "pluck.guitjo") \ + MX_ENUM_VALUE(pluckGuitjoDoubleNeck, "pluck.guitjo.double-neck") \ + MX_ENUM_VALUE(pluckGuqin, "pluck.guqin") \ + MX_ENUM_VALUE(pluckGuzheng, "pluck.guzheng") \ + MX_ENUM_VALUE(pluckGuzhengChoazhou, "pluck.guzheng.choazhou") \ + MX_ENUM_VALUE(pluckHarp, "pluck.harp") \ + MX_ENUM_VALUE(pluckHarpGuitar, "pluck.harp-guitar") \ + MX_ENUM_VALUE(pluckHuapanguera, "pluck.huapanguera") \ + MX_ENUM_VALUE(pluckJaranaHuasteca, "pluck.jarana-huasteca") \ + MX_ENUM_VALUE(pluckJaranaJarocha, "pluck.jarana-jarocha") \ + MX_ENUM_VALUE(pluckJaranaJarochaMosquito, "pluck.jarana-jarocha.mosquito") \ + MX_ENUM_VALUE(pluckJaranaJarochaPrimera, "pluck.jarana-jarocha.primera") \ + MX_ENUM_VALUE(pluckJaranaJarochaSegunda, "pluck.jarana-jarocha.segunda") \ + MX_ENUM_VALUE(pluckJaranaJarochaTercera, "pluck.jarana-jarocha.tercera") \ + MX_ENUM_VALUE(pluckKabosy, "pluck.kabosy") \ + MX_ENUM_VALUE(pluckKantele, "pluck.kantele") \ + MX_ENUM_VALUE(pluckKanun, "pluck.kanun") \ + MX_ENUM_VALUE(pluckKayagum, "pluck.kayagum") \ + MX_ENUM_VALUE(pluckKobza, "pluck.kobza") \ + MX_ENUM_VALUE(pluckKomuz, "pluck.komuz") \ + MX_ENUM_VALUE(pluckKora, "pluck.kora") \ + MX_ENUM_VALUE(pluckKoto, "pluck.koto") \ + MX_ENUM_VALUE(pluckKutiyapi, "pluck.kutiyapi") \ + MX_ENUM_VALUE(pluckLangeleik, "pluck.langeleik") \ + MX_ENUM_VALUE(pluckLaud, "pluck.laud") \ + MX_ENUM_VALUE(pluckLute, "pluck.lute") \ + MX_ENUM_VALUE(pluckLyre, "pluck.lyre") \ + MX_ENUM_VALUE(pluckMandobass, "pluck.mandobass") \ + MX_ENUM_VALUE(pluckMandocello, "pluck.mandocello") \ + MX_ENUM_VALUE(pluckMandola, "pluck.mandola") \ + MX_ENUM_VALUE(pluckMandolin, "pluck.mandolin") \ + MX_ENUM_VALUE(pluckMandolinOctave, "pluck.mandolin.octave") \ + MX_ENUM_VALUE(pluckMandora, "pluck.mandora") \ + MX_ENUM_VALUE(pluckMandore, "pluck.mandore") \ + MX_ENUM_VALUE(pluckMarovany, "pluck.marovany") \ + MX_ENUM_VALUE(pluckMusicalBow, "pluck.musical-bow") \ + MX_ENUM_VALUE(pluckNgoni, "pluck.ngoni") \ + MX_ENUM_VALUE(pluckOud, "pluck.oud") \ + MX_ENUM_VALUE(pluckPipa, "pluck.pipa") \ + MX_ENUM_VALUE(pluckPsaltery, "pluck.psaltery") \ + MX_ENUM_VALUE(pluckRuan, "pluck.ruan") \ + MX_ENUM_VALUE(pluckSallaneh, "pluck.sallaneh") \ + MX_ENUM_VALUE(pluckSanshin, "pluck.sanshin") \ + MX_ENUM_VALUE(pluckSantoor, "pluck.santoor") \ + MX_ENUM_VALUE(pluckSanxian, "pluck.sanxian") \ + MX_ENUM_VALUE(pluckSarod, "pluck.sarod") \ + MX_ENUM_VALUE(pluckSaung, "pluck.saung") \ + MX_ENUM_VALUE(pluckSaz, "pluck.saz") \ + MX_ENUM_VALUE(pluckSe, "pluck.se") \ + MX_ENUM_VALUE(pluckSetar, "pluck.setar") \ + MX_ENUM_VALUE(pluckShamisen, "pluck.shamisen") \ + MX_ENUM_VALUE(pluckSitar, "pluck.sitar") \ + MX_ENUM_VALUE(pluckSynth, "pluck.synth") \ + MX_ENUM_VALUE(pluckSynthCharang, "pluck.synth.charang") \ + MX_ENUM_VALUE(pluckSynthChiff, "pluck.synth.chiff") \ + MX_ENUM_VALUE(pluckSynthStick, "pluck.synth.stick") \ + MX_ENUM_VALUE(pluckTambura, "pluck.tambura") \ + MX_ENUM_VALUE(pluckTamburaBulgarian, "pluck.tambura.bulgarian") \ + MX_ENUM_VALUE(pluckTamburaFemale, "pluck.tambura.female") \ + MX_ENUM_VALUE(pluckTamburaMale, "pluck.tambura.male") \ + MX_ENUM_VALUE(pluckTar, "pluck.tar") \ + MX_ENUM_VALUE(pluckTheorbo, "pluck.theorbo") \ + MX_ENUM_VALUE(pluckTimple, "pluck.timple") \ + MX_ENUM_VALUE(pluckTiple, "pluck.tiple") \ + MX_ENUM_VALUE(pluckTres, "pluck.tres") \ + MX_ENUM_VALUE(pluckUkulele, "pluck.ukulele") \ + MX_ENUM_VALUE(pluckUkuleleTenor, "pluck.ukulele.tenor") \ + MX_ENUM_VALUE(pluckValiha, "pluck.valiha") \ + MX_ENUM_VALUE(pluckVeena, "pluck.veena") \ + MX_ENUM_VALUE(pluckVeenaMohan, "pluck.veena.mohan") \ + MX_ENUM_VALUE(pluckVeenaRudra, "pluck.veena.rudra") \ + MX_ENUM_VALUE(pluckVeenaVichitra, "pluck.veena.vichitra") \ + MX_ENUM_VALUE(pluckVihuela, "pluck.vihuela") \ + MX_ENUM_VALUE(pluckVihuelaMexican, "pluck.vihuela.mexican") \ + MX_ENUM_VALUE(pluckXalam, "pluck.xalam") \ + MX_ENUM_VALUE(pluckYueqin, "pluck.yueqin") \ + MX_ENUM_VALUE(pluckZither, "pluck.zither") \ + MX_ENUM_VALUE(pluckZitherOvertone, "pluck.zither.overtone") \ + MX_ENUM_VALUE(rattleAfoxe, "rattle.afoxe") \ + MX_ENUM_VALUE(rattleBirds, "rattle.birds") \ + MX_ENUM_VALUE(rattleCabasa, "rattle.cabasa") \ + MX_ENUM_VALUE(rattleCaxixi, "rattle.caxixi") \ + MX_ENUM_VALUE(rattleCog, "rattle.cog") \ + MX_ENUM_VALUE(rattleGanza, "rattle.ganza") \ + MX_ENUM_VALUE(rattleHosho, "rattle.hosho") \ + MX_ENUM_VALUE(rattleJawbone, "rattle.jawbone") \ + MX_ENUM_VALUE(rattleKayamba, "rattle.kayamba") \ + MX_ENUM_VALUE(rattleKpokoKpoko, "rattle.kpoko-kpoko") \ + MX_ENUM_VALUE(rattleLavaStones, "rattle.lava-stones") \ + MX_ENUM_VALUE(rattleMaraca, "rattle.maraca") \ + MX_ENUM_VALUE(rattleRainStick, "rattle.rain-stick") \ + MX_ENUM_VALUE(rattleRatchet, "rattle.ratchet") \ + MX_ENUM_VALUE(rattleRattle, "rattle.rattle") \ + MX_ENUM_VALUE(rattleShaker, "rattle.shaker") \ + MX_ENUM_VALUE(rattleShakerEgg, "rattle.shaker.egg") \ + MX_ENUM_VALUE(rattleShekere, "rattle.shekere") \ + MX_ENUM_VALUE(rattleSistre, "rattle.sistre") \ + MX_ENUM_VALUE(rattleTelevi, "rattle.televi") \ + MX_ENUM_VALUE(rattleVibraslap, "rattle.vibraslap") \ + MX_ENUM_VALUE(rattleWasembe, "rattle.wasembe") \ + MX_ENUM_VALUE(stringsAjaeng, "strings.ajaeng") \ + MX_ENUM_VALUE(stringsArpeggione, "strings.arpeggione") \ + MX_ENUM_VALUE(stringsBaryton, "strings.baryton") \ + MX_ENUM_VALUE(stringsCello, "strings.cello") \ + MX_ENUM_VALUE(stringsCelloPiccolo, "strings.cello.piccolo") \ + MX_ENUM_VALUE(stringsContrabass, "strings.contrabass") \ + MX_ENUM_VALUE(stringsCrwth, "strings.crwth") \ + MX_ENUM_VALUE(stringsDanGao, "strings.dan-gao") \ + MX_ENUM_VALUE(stringsDihu, "strings.dihu") \ + MX_ENUM_VALUE(stringsErhu, "strings.erhu") \ + MX_ENUM_VALUE(stringsErxian, "strings.erxian") \ + MX_ENUM_VALUE(stringsEsraj, "strings.esraj") \ + MX_ENUM_VALUE(stringsFiddle, "strings.fiddle") \ + MX_ENUM_VALUE(stringsFiddleHardanger, "strings.fiddle.hardanger") \ + MX_ENUM_VALUE(stringsGadulka, "strings.gadulka") \ + MX_ENUM_VALUE(stringsGaohu, "strings.gaohu") \ + MX_ENUM_VALUE(stringsGehu, "strings.gehu") \ + MX_ENUM_VALUE(stringsGroup, "strings.group") \ + MX_ENUM_VALUE(stringsGroupSynth, "strings.group.synth") \ + MX_ENUM_VALUE(stringsHaegeum, "strings.haegeum") \ + MX_ENUM_VALUE(stringsHurdyGurdy, "strings.hurdy-gurdy") \ + MX_ENUM_VALUE(stringsIgil, "strings.igil") \ + MX_ENUM_VALUE(stringsKamancha, "strings.kamancha") \ + MX_ENUM_VALUE(stringsKokyu, "strings.kokyu") \ + MX_ENUM_VALUE(stringsLaruan, "strings.laruan") \ + MX_ENUM_VALUE(stringsLeiqin, "strings.leiqin") \ + MX_ENUM_VALUE(stringsLirone, "strings.lirone") \ + MX_ENUM_VALUE(stringsLyraByzantine, "strings.lyra.byzantine") \ + MX_ENUM_VALUE(stringsLyraCretan, "strings.lyra.cretan") \ + MX_ENUM_VALUE(stringsMorinKhuur, "strings.morin-khuur") \ + MX_ENUM_VALUE(stringsNyckelharpa, "strings.nyckelharpa") \ + MX_ENUM_VALUE(stringsOctobass, "strings.octobass") \ + MX_ENUM_VALUE(stringsRebab, "strings.rebab") \ + MX_ENUM_VALUE(stringsRebec, "strings.rebec") \ + MX_ENUM_VALUE(stringsSarangi, "strings.sarangi") \ + MX_ENUM_VALUE(stringsStrohViolin, "strings.stroh-violin") \ + MX_ENUM_VALUE(stringsTrombaMarina, "strings.tromba-marina") \ + MX_ENUM_VALUE(stringsVielle, "strings.vielle") \ + MX_ENUM_VALUE(stringsViol, "strings.viol") \ + MX_ENUM_VALUE(stringsViolAlto, "strings.viol.alto") \ + MX_ENUM_VALUE(stringsViolBass, "strings.viol.bass") \ + MX_ENUM_VALUE(stringsViolTenor, "strings.viol.tenor") \ + MX_ENUM_VALUE(stringsViolTreble, "strings.viol.treble") \ + MX_ENUM_VALUE(stringsViolViolone, "strings.viol.violone") \ + MX_ENUM_VALUE(stringsViola, "strings.viola") \ + MX_ENUM_VALUE(stringsViolaDamore, "strings.viola-damore") \ + MX_ENUM_VALUE(stringsViolin, "strings.violin") \ + MX_ENUM_VALUE(stringsViolonoPiccolo, "strings.violono.piccolo") \ + MX_ENUM_VALUE(stringsViolotta, "strings.violotta") \ + MX_ENUM_VALUE(stringsYayliTanbur, "strings.yayli-tanbur") \ + MX_ENUM_VALUE(stringsYazheng, "strings.yazheng") \ + MX_ENUM_VALUE(stringsZhonghu, "strings.zhonghu") \ + MX_ENUM_VALUE(synthEffects, "synth.effects") \ + MX_ENUM_VALUE(synthEffectsAtmosphere, "synth.effects.atmosphere") \ + MX_ENUM_VALUE(synthEffectsBrightness, "synth.effects.brightness") \ + MX_ENUM_VALUE(synthEffectsCrystal, "synth.effects.crystal") \ + MX_ENUM_VALUE(synthEffectsEchoes, "synth.effects.echoes") \ + MX_ENUM_VALUE(synthEffectsGoblins, "synth.effects.goblins") \ + MX_ENUM_VALUE(synthEffectsRain, "synth.effects.rain") \ + MX_ENUM_VALUE(synthEffectsSciFi, "synth.effects.sci-fi") \ + MX_ENUM_VALUE(synthEffectsSoundtrack, "synth.effects.soundtrack") \ + MX_ENUM_VALUE(synthGroup, "synth.group") \ + MX_ENUM_VALUE(synthGroupFifths, "synth.group.fifths") \ + MX_ENUM_VALUE(synthGroupOrchestra, "synth.group.orchestra") \ + MX_ENUM_VALUE(synthPad, "synth.pad") \ + MX_ENUM_VALUE(synthPadBowed, "synth.pad.bowed") \ + MX_ENUM_VALUE(synthPadChoir, "synth.pad.choir") \ + MX_ENUM_VALUE(synthPadHalo, "synth.pad.halo") \ + MX_ENUM_VALUE(synthPadMetallic, "synth.pad.metallic") \ + MX_ENUM_VALUE(synthPadPolysynth, "synth.pad.polysynth") \ + MX_ENUM_VALUE(synthPadSweep, "synth.pad.sweep") \ + MX_ENUM_VALUE(synthPadWarm, "synth.pad.warm") \ + MX_ENUM_VALUE(synthTheremin, "synth.theremin") \ + MX_ENUM_VALUE(synthToneSawtooth, "synth.tone.sawtooth") \ + MX_ENUM_VALUE(synthToneSine, "synth.tone.sine") \ + MX_ENUM_VALUE(synthToneSquare, "synth.tone.square") \ + MX_ENUM_VALUE(voiceAa, "voice.aa") \ + MX_ENUM_VALUE(voiceAlto, "voice.alto") \ + MX_ENUM_VALUE(voiceAw, "voice.aw") \ + MX_ENUM_VALUE(voiceBaritone, "voice.baritone") \ + MX_ENUM_VALUE(voiceBass, "voice.bass") \ + MX_ENUM_VALUE(voiceChild, "voice.child") \ + MX_ENUM_VALUE(voiceCountertenor, "voice.countertenor") \ + MX_ENUM_VALUE(voiceDoo, "voice.doo") \ + MX_ENUM_VALUE(voiceEe, "voice.ee") \ + MX_ENUM_VALUE(voiceFemale, "voice.female") \ + MX_ENUM_VALUE(voiceKazoo, "voice.kazoo") \ + MX_ENUM_VALUE(voiceMale, "voice.male") \ + MX_ENUM_VALUE(voiceMezzoSoprano, "voice.mezzo-soprano") \ + MX_ENUM_VALUE(voiceMm, "voice.mm") \ + MX_ENUM_VALUE(voiceOo, "voice.oo") \ + MX_ENUM_VALUE(voicePercussion, "voice.percussion") \ + MX_ENUM_VALUE(voicePercussionBeatbox, "voice.percussion.beatbox") \ + MX_ENUM_VALUE(voiceSoprano, "voice.soprano") \ + MX_ENUM_VALUE(voiceSynth, "voice.synth") \ + MX_ENUM_VALUE(voiceTalkBox, "voice.talk-box") \ + MX_ENUM_VALUE(voiceTenor, "voice.tenor") \ + MX_ENUM_VALUE(voiceVocals, "voice.vocals") \ + MX_ENUM_VALUE(windFlutesBansuri, "wind.flutes.bansuri") \ + MX_ENUM_VALUE(windFlutesBlownBottle, "wind.flutes.blown-bottle") \ + MX_ENUM_VALUE(windFlutesCalliope, "wind.flutes.calliope") \ + MX_ENUM_VALUE(windFlutesDanso, "wind.flutes.danso") \ + MX_ENUM_VALUE(windFlutesDiZi, "wind.flutes.di-zi") \ + MX_ENUM_VALUE(windFlutesDvojnice, "wind.flutes.dvojnice") \ + MX_ENUM_VALUE(windFlutesFife, "wind.flutes.fife") \ + MX_ENUM_VALUE(windFlutesFlageolet, "wind.flutes.flageolet") \ + MX_ENUM_VALUE(windFlutesFlute, "wind.flutes.flute") \ + MX_ENUM_VALUE(windFlutesFluteAlto, "wind.flutes.flute.alto") \ + MX_ENUM_VALUE(windFlutesFluteBass, "wind.flutes.flute.bass") \ + MX_ENUM_VALUE(windFlutesFluteContraAlto, "wind.flutes.flute.contra-alto") \ + MX_ENUM_VALUE(windFlutesFluteContrabass, "wind.flutes.flute.contrabass") \ + MX_ENUM_VALUE(windFlutesFluteDoubleContrabass, "wind.flutes.flute.double-contrabass") \ + MX_ENUM_VALUE(windFlutesFluteIrish, "wind.flutes.flute.irish") \ + MX_ENUM_VALUE(windFlutesFlutePiccolo, "wind.flutes.flute.piccolo") \ + MX_ENUM_VALUE(windFlutesFluteSubcontrabass, "wind.flutes.flute.subcontrabass") \ + MX_ENUM_VALUE(windFlutesFujara, "wind.flutes.fujara") \ + MX_ENUM_VALUE(windFlutesGemshorn, "wind.flutes.gemshorn") \ + MX_ENUM_VALUE(windFlutesHocchiku, "wind.flutes.hocchiku") \ + MX_ENUM_VALUE(windFlutesHun, "wind.flutes.hun") \ + MX_ENUM_VALUE(windFlutesKaval, "wind.flutes.kaval") \ + MX_ENUM_VALUE(windFlutesKawala, "wind.flutes.kawala") \ + MX_ENUM_VALUE(windFlutesKhlui, "wind.flutes.khlui") \ + MX_ENUM_VALUE(windFlutesKnotweed, "wind.flutes.knotweed") \ + MX_ENUM_VALUE(windFlutesKoncovkaAlto, "wind.flutes.koncovka.alto") \ + MX_ENUM_VALUE(windFlutesKoudi, "wind.flutes.koudi") \ + MX_ENUM_VALUE(windFlutesNey, "wind.flutes.ney") \ + MX_ENUM_VALUE(windFlutesNohkan, "wind.flutes.nohkan") \ + MX_ENUM_VALUE(windFlutesNose, "wind.flutes.nose") \ + MX_ENUM_VALUE(windFlutesOcarina, "wind.flutes.ocarina") \ + MX_ENUM_VALUE(windFlutesOvertoneTenor, "wind.flutes.overtone.tenor") \ + MX_ENUM_VALUE(windFlutesPalendag, "wind.flutes.palendag") \ + MX_ENUM_VALUE(windFlutesPanpipes, "wind.flutes.panpipes") \ + MX_ENUM_VALUE(windFlutesQuena, "wind.flutes.quena") \ + MX_ENUM_VALUE(windFlutesRecorder, "wind.flutes.recorder") \ + MX_ENUM_VALUE(windFlutesRecorderAlto, "wind.flutes.recorder.alto") \ + MX_ENUM_VALUE(windFlutesRecorderBass, "wind.flutes.recorder.bass") \ + MX_ENUM_VALUE(windFlutesRecorderContrabass, "wind.flutes.recorder.contrabass") \ + MX_ENUM_VALUE(windFlutesRecorderDescant, "wind.flutes.recorder.descant") \ + MX_ENUM_VALUE(windFlutesRecorderGarklein, "wind.flutes.recorder.garklein") \ + MX_ENUM_VALUE(windFlutesRecorderGreatBass, "wind.flutes.recorder.great-bass") \ + MX_ENUM_VALUE(windFlutesRecorderSopranino, "wind.flutes.recorder.sopranino") \ + MX_ENUM_VALUE(windFlutesRecorderSoprano, "wind.flutes.recorder.soprano") \ + MX_ENUM_VALUE(windFlutesRecorderTenor, "wind.flutes.recorder.tenor") \ + MX_ENUM_VALUE(windFlutesRyuteki, "wind.flutes.ryuteki") \ + MX_ENUM_VALUE(windFlutesShakuhachi, "wind.flutes.shakuhachi") \ + MX_ENUM_VALUE(windFlutesShepherdsPipe, "wind.flutes.shepherds-pipe") \ + MX_ENUM_VALUE(windFlutesShinobue, "wind.flutes.shinobue") \ + MX_ENUM_VALUE(windFlutesShvi, "wind.flutes.shvi") \ + MX_ENUM_VALUE(windFlutesSuling, "wind.flutes.suling") \ + MX_ENUM_VALUE(windFlutesTarka, "wind.flutes.tarka") \ + MX_ENUM_VALUE(windFlutesTumpong, "wind.flutes.tumpong") \ + MX_ENUM_VALUE(windFlutesVenu, "wind.flutes.venu") \ + MX_ENUM_VALUE(windFlutesWhistle, "wind.flutes.whistle") \ + MX_ENUM_VALUE(windFlutesWhistleAlto, "wind.flutes.whistle.alto") \ + MX_ENUM_VALUE(windFlutesWhistleLowIrish, "wind.flutes.whistle.low-irish") \ + MX_ENUM_VALUE(windFlutesWhistleShiva, "wind.flutes.whistle.shiva") \ + MX_ENUM_VALUE(windFlutesWhistleSlide, "wind.flutes.whistle.slide") \ + MX_ENUM_VALUE(windFlutesWhistleTin, "wind.flutes.whistle.tin") \ + MX_ENUM_VALUE(windFlutesWhistleTinBflat, "wind.flutes.whistle.tin.bflat") \ + MX_ENUM_VALUE(windFlutesWhistleTinD, "wind.flutes.whistle.tin.d") \ + MX_ENUM_VALUE(windFlutesXiao, "wind.flutes.xiao") \ + MX_ENUM_VALUE(windFlutesXun, "wind.flutes.xun") \ + MX_ENUM_VALUE(windGroup, "wind.group") \ + MX_ENUM_VALUE(windJug, "wind.jug") \ + MX_ENUM_VALUE(windPipesBagpipes, "wind.pipes.bagpipes") \ + MX_ENUM_VALUE(windPipesGaida, "wind.pipes.gaida") \ + MX_ENUM_VALUE(windPipesHighland, "wind.pipes.highland") \ + MX_ENUM_VALUE(windPipesUilleann, "wind.pipes.uilleann") \ + MX_ENUM_VALUE(windPungi, "wind.pungi") \ + MX_ENUM_VALUE(windReedAlbogue, "wind.reed.albogue") \ + MX_ENUM_VALUE(windReedAlboka, "wind.reed.alboka") \ + MX_ENUM_VALUE(windReedAlgaita, "wind.reed.algaita") \ + MX_ENUM_VALUE(windReedArghul, "wind.reed.arghul") \ + MX_ENUM_VALUE(windReedBassetHorn, "wind.reed.basset-horn") \ + MX_ENUM_VALUE(windReedBassoon, "wind.reed.bassoon") \ + MX_ENUM_VALUE(windReedBawu, "wind.reed.bawu") \ + MX_ENUM_VALUE(windReedBifora, "wind.reed.bifora") \ + MX_ENUM_VALUE(windReedBombarde, "wind.reed.bombarde") \ + MX_ENUM_VALUE(windReedChalumeau, "wind.reed.chalumeau") \ + MX_ENUM_VALUE(windReedClarinet, "wind.reed.clarinet") \ + MX_ENUM_VALUE(windReedClarinetA, "wind.reed.clarinet.a") \ + MX_ENUM_VALUE(windReedClarinetAlto, "wind.reed.clarinet.alto") \ + MX_ENUM_VALUE(windReedClarinetBass, "wind.reed.clarinet.bass") \ + MX_ENUM_VALUE(windReedClarinetBasset, "wind.reed.clarinet.basset") \ + MX_ENUM_VALUE(windReedClarinetBflat, "wind.reed.clarinet.bflat") \ + MX_ENUM_VALUE(windReedClarinetContraAlto, "wind.reed.clarinet.contra-alto") \ + MX_ENUM_VALUE(windReedClarinetContrabass, "wind.reed.clarinet.contrabass") \ + MX_ENUM_VALUE(windReedClarinetEflat, "wind.reed.clarinet.eflat") \ + MX_ENUM_VALUE(windReedClarinetPiccoloAflat, "wind.reed.clarinet.piccolo.aflat") \ + MX_ENUM_VALUE(windReedClarinetteDamour, "wind.reed.clarinette-damour") \ + MX_ENUM_VALUE(windReedContrabass, "wind.reed.contrabass") \ + MX_ENUM_VALUE(windReedContrabassoon, "wind.reed.contrabassoon") \ + MX_ENUM_VALUE(windReedCornamuse, "wind.reed.cornamuse") \ + MX_ENUM_VALUE(windReedCromorne, "wind.reed.cromorne") \ + MX_ENUM_VALUE(windReedCrumhorn, "wind.reed.crumhorn") \ + MX_ENUM_VALUE(windReedCrumhornAlto, "wind.reed.crumhorn.alto") \ + MX_ENUM_VALUE(windReedCrumhornBass, "wind.reed.crumhorn.bass") \ + MX_ENUM_VALUE(windReedCrumhornGreatBass, "wind.reed.crumhorn.great-bass") \ + MX_ENUM_VALUE(windReedCrumhornSoprano, "wind.reed.crumhorn.soprano") \ + MX_ENUM_VALUE(windReedCrumhornTenor, "wind.reed.crumhorn.tenor") \ + MX_ENUM_VALUE(windReedDiple, "wind.reed.diple") \ + MX_ENUM_VALUE(windReedDiplica, "wind.reed.diplica") \ + MX_ENUM_VALUE(windReedDuduk, "wind.reed.duduk") \ + MX_ENUM_VALUE(windReedDulcian, "wind.reed.dulcian") \ + MX_ENUM_VALUE(windReedDulzaina, "wind.reed.dulzaina") \ + MX_ENUM_VALUE(windReedEnglishHorn, "wind.reed.english-horn") \ + MX_ENUM_VALUE(windReedGuanzi, "wind.reed.guanzi") \ + MX_ENUM_VALUE(windReedHarmonica, "wind.reed.harmonica") \ + MX_ENUM_VALUE(windReedHarmonicaBass, "wind.reed.harmonica.bass") \ + MX_ENUM_VALUE(windReedHeckelClarina, "wind.reed.heckel-clarina") \ + MX_ENUM_VALUE(windReedHeckelphone, "wind.reed.heckelphone") \ + MX_ENUM_VALUE(windReedHeckelphonePiccolo, "wind.reed.heckelphone.piccolo") \ + MX_ENUM_VALUE(windReedHeckelphoneClarinet, "wind.reed.heckelphone-clarinet") \ + MX_ENUM_VALUE(windReedHichiriki, "wind.reed.hichiriki") \ + MX_ENUM_VALUE(windReedHirtenschalmei, "wind.reed.hirtenschalmei") \ + MX_ENUM_VALUE(windReedHne, "wind.reed.hne") \ + MX_ENUM_VALUE(windReedHornpipe, "wind.reed.hornpipe") \ + MX_ENUM_VALUE(windReedHouguan, "wind.reed.houguan") \ + MX_ENUM_VALUE(windReedHulusi, "wind.reed.hulusi") \ + MX_ENUM_VALUE(windReedJogiBaja, "wind.reed.jogi-baja") \ + MX_ENUM_VALUE(windReedKenBau, "wind.reed.ken-bau") \ + MX_ENUM_VALUE(windReedKhaenMouthOrgan, "wind.reed.khaen-mouth-organ") \ + MX_ENUM_VALUE(windReedLauneddas, "wind.reed.launeddas") \ + MX_ENUM_VALUE(windReedMaqrunah, "wind.reed.maqrunah") \ + MX_ENUM_VALUE(windReedMelodica, "wind.reed.melodica") \ + MX_ENUM_VALUE(windReedMijwiz, "wind.reed.mijwiz") \ + MX_ENUM_VALUE(windReedMizmar, "wind.reed.mizmar") \ + MX_ENUM_VALUE(windReedNadaswaram, "wind.reed.nadaswaram") \ + MX_ENUM_VALUE(windReedOboe, "wind.reed.oboe") \ + MX_ENUM_VALUE(windReedOboeBass, "wind.reed.oboe.bass") \ + MX_ENUM_VALUE(windReedOboePiccolo, "wind.reed.oboe.piccolo") \ + MX_ENUM_VALUE(windReedOboeDaCaccia, "wind.reed.oboe-da-caccia") \ + MX_ENUM_VALUE(windReedOboeDamore, "wind.reed.oboe-damore") \ + MX_ENUM_VALUE(windReedOctavin, "wind.reed.octavin") \ + MX_ENUM_VALUE(windReedPi, "wind.reed.pi") \ + MX_ENUM_VALUE(windReedPibgorn, "wind.reed.pibgorn") \ + MX_ENUM_VALUE(windReedPiri, "wind.reed.piri") \ + MX_ENUM_VALUE(windReedRackett, "wind.reed.rackett") \ + MX_ENUM_VALUE(windReedRauschpfeife, "wind.reed.rauschpfeife") \ + MX_ENUM_VALUE(windReedRhaita, "wind.reed.rhaita") \ + MX_ENUM_VALUE(windReedRothphone, "wind.reed.rothphone") \ + MX_ENUM_VALUE(windReedSarrusaphone, "wind.reed.sarrusaphone") \ + MX_ENUM_VALUE(windReedSaxonette, "wind.reed.saxonette") \ + MX_ENUM_VALUE(windReedSaxophone, "wind.reed.saxophone") \ + MX_ENUM_VALUE(windReedSaxophoneAlto, "wind.reed.saxophone.alto") \ + MX_ENUM_VALUE(windReedSaxophoneAulochrome, "wind.reed.saxophone.aulochrome") \ + MX_ENUM_VALUE(windReedSaxophoneBaritone, "wind.reed.saxophone.baritone") \ + MX_ENUM_VALUE(windReedSaxophoneBass, "wind.reed.saxophone.bass") \ + MX_ENUM_VALUE(windReedSaxophoneContrabass, "wind.reed.saxophone.contrabass") \ + MX_ENUM_VALUE(windReedSaxophoneMelody, "wind.reed.saxophone.melody") \ + MX_ENUM_VALUE(windReedSaxophoneMezzoSoprano, "wind.reed.saxophone.mezzo-soprano") \ + MX_ENUM_VALUE(windReedSaxophoneSopranino, "wind.reed.saxophone.sopranino") \ + MX_ENUM_VALUE(windReedSaxophoneSopranissimo, "wind.reed.saxophone.sopranissimo") \ + MX_ENUM_VALUE(windReedSaxophoneSoprano, "wind.reed.saxophone.soprano") \ + MX_ENUM_VALUE(windReedSaxophoneSubcontrabass, "wind.reed.saxophone.subcontrabass") \ + MX_ENUM_VALUE(windReedSaxophoneTenor, "wind.reed.saxophone.tenor") \ + MX_ENUM_VALUE(windReedShawm, "wind.reed.shawm") \ + MX_ENUM_VALUE(windReedShenai, "wind.reed.shenai") \ + MX_ENUM_VALUE(windReedSheng, "wind.reed.sheng") \ + MX_ENUM_VALUE(windReedSipsi, "wind.reed.sipsi") \ + MX_ENUM_VALUE(windReedSopila, "wind.reed.sopila") \ + MX_ENUM_VALUE(windReedSorna, "wind.reed.sorna") \ + MX_ENUM_VALUE(windReedSralai, "wind.reed.sralai") \ + MX_ENUM_VALUE(windReedSuona, "wind.reed.suona") \ + MX_ENUM_VALUE(windReedSurnai, "wind.reed.surnai") \ + MX_ENUM_VALUE(windReedTaepyeongso, "wind.reed.taepyeongso") \ + MX_ENUM_VALUE(windReedTarogato, "wind.reed.tarogato") \ + MX_ENUM_VALUE(windReedTarogatoAncient, "wind.reed.tarogato.ancient") \ + MX_ENUM_VALUE(windReedTrompetaChina, "wind.reed.trompeta-china") \ + MX_ENUM_VALUE(windReedTubax, "wind.reed.tubax") \ + MX_ENUM_VALUE(windReedXaphoon, "wind.reed.xaphoon") \ + MX_ENUM_VALUE(windReedZhaleika, "wind.reed.zhaleika") \ + MX_ENUM_VALUE(windReedZurla, "wind.reed.zurla") \ + MX_ENUM_VALUE(windReedZurna, "wind.reed.zurna") \ + MX_ENUM_VALUE(woodAgogoBlock, "wood.agogo-block") \ + MX_ENUM_VALUE(woodAgungATamlang, "wood.agung-a-tamlang") \ + MX_ENUM_VALUE(woodAhoko, "wood.ahoko") \ + MX_ENUM_VALUE(woodBones, "wood.bones") \ + MX_ENUM_VALUE(woodCastanets, "wood.castanets") \ + MX_ENUM_VALUE(woodClaves, "wood.claves") \ + MX_ENUM_VALUE(woodDrumSticks, "wood.drum-sticks") \ + MX_ENUM_VALUE(woodGourd, "wood.gourd") \ + MX_ENUM_VALUE(woodGraniteBlock, "wood.granite-block") \ + MX_ENUM_VALUE(woodGuban, "wood.guban") \ + MX_ENUM_VALUE(woodGuiro, "wood.guiro") \ + MX_ENUM_VALUE(woodHyoushigi, "wood.hyoushigi") \ + MX_ENUM_VALUE(woodIpu, "wood.ipu") \ + MX_ENUM_VALUE(woodJamBlock, "wood.jam-block") \ + MX_ENUM_VALUE(woodKaekeeke, "wood.kaekeeke") \ + MX_ENUM_VALUE(woodKagul, "wood.kagul") \ + MX_ENUM_VALUE(woodKalaau, "wood.kalaau") \ + MX_ENUM_VALUE(woodKashiklar, "wood.kashiklar") \ + MX_ENUM_VALUE(woodKubing, "wood.kubing") \ + MX_ENUM_VALUE(woodPanClappers, "wood.pan-clappers") \ + MX_ENUM_VALUE(woodSandBlock, "wood.sand-block") \ + MX_ENUM_VALUE(woodSlapstick, "wood.slapstick") \ + MX_ENUM_VALUE(woodStirDrum, "wood.stir-drum") \ + MX_ENUM_VALUE(woodTempleBlock, "wood.temple-block") \ + MX_ENUM_VALUE(woodTicTocBlock, "wood.tic-toc-block") \ + MX_ENUM_VALUE(woodTonetang, "wood.tonetang") \ + MX_ENUM_VALUE(woodWoodBlock, "wood.wood-block") - #include "mx/utility/EnumWithString.h" - #undef MX_ENUM_CLASS_NAME - #undef MX_ENUM_VALUE - #undef MX_ENUM_MEMBERS - } -} +#include "mx/utility/EnumWithString.h" +#undef MX_ENUM_CLASS_NAME +#undef MX_ENUM_VALUE +#undef MX_ENUM_MEMBERS +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp b/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp index 1f7290287..cb9e46eb3 100644 --- a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp +++ b/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp @@ -10,154 +10,163 @@ namespace mx { - namespace core +namespace core +{ +class PositiveIntegerOrEmpty::impl +{ + public: + explicit impl() : myPositiveInteger(1), myIsEmpty(true) { - class PositiveIntegerOrEmpty::impl - { - public: - explicit impl() - :myPositiveInteger( 1 ) - ,myIsEmpty( true ) - {} - - explicit impl( const PositiveInteger& value ) - :myPositiveInteger( value ) - ,myIsEmpty( false ) - {} - - explicit impl( const std::string& value ) - :myPositiveInteger( 1 ) - ,myIsEmpty( false ) - { - parse( value ); - } - - bool getIsEmpty() const - { - return myIsEmpty; - } - bool getIsNumber() const - { - return ! myIsEmpty; - } - void setValueEmpty() - { - myPositiveInteger = PositiveInteger( 1 ); - myIsEmpty = true;; - } - void setValue( const PositiveInteger& value ) - { - myPositiveInteger = PositiveInteger( value ); - myIsEmpty = false; - } - PositiveInteger getValueNumber() const - { - return myPositiveInteger; - } - void parse( const std::string& value ) - { - if ( value == "" ) - { - myPositiveInteger = PositiveInteger( 1 ); - myIsEmpty = true; - } - else - { - /* if it contains only numeric - characters it must be a number */ - myPositiveInteger.parse( value ); - myIsEmpty = false; - } - } - private: - PositiveInteger myPositiveInteger; - bool myIsEmpty; - }; - - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty() - :myImpl( new impl() ) - {} - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty( const PositiveInteger& value ) - :myImpl( new impl( value ) ) - {} - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty( const std::string& value ) - :myImpl( new impl( value ) ) - {} - - PositiveIntegerOrEmpty::~PositiveIntegerOrEmpty() {} - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty( const PositiveIntegerOrEmpty& other ) - :myImpl( new PositiveIntegerOrEmpty::impl( *other.myImpl ) ) - {} - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty( PositiveIntegerOrEmpty&& other ) - :myImpl( std::move( other.myImpl ) ) - {} - - PositiveIntegerOrEmpty& PositiveIntegerOrEmpty::operator=( PositiveIntegerOrEmpty&& other ) - { - myImpl = std::move( other.myImpl ); - return *this; - } - - PositiveIntegerOrEmpty& PositiveIntegerOrEmpty::operator=( const PositiveIntegerOrEmpty& other ) - { - this->myImpl = std::unique_ptr( new PositiveIntegerOrEmpty::impl( *other.myImpl ) ); - return *this; - } - - bool PositiveIntegerOrEmpty::getIsEmpty() const - { - return myImpl->getIsEmpty(); - } - bool PositiveIntegerOrEmpty::getIsNumber() const - { - return myImpl->getIsNumber(); - } - void PositiveIntegerOrEmpty::setValueEmpty() - { - myImpl->setValueEmpty(); - } - void PositiveIntegerOrEmpty::setValue( const PositiveInteger& value ) - { - myImpl->setValue( value ); - } - PositiveInteger PositiveIntegerOrEmpty::getValueNumber() const - { - return myImpl->getValueNumber(); - } - - void PositiveIntegerOrEmpty::parse( const std::string& value ) - { - myImpl->parse( value ); - } - - std::string toString( const PositiveIntegerOrEmpty& value ) + } + + explicit impl(const PositiveInteger &value) : myPositiveInteger(value), myIsEmpty(false) + { + } + + explicit impl(const std::string &value) : myPositiveInteger(1), myIsEmpty(false) + { + parse(value); + } + + bool getIsEmpty() const + { + return myIsEmpty; + } + + bool getIsNumber() const + { + return !myIsEmpty; + } + + void setValueEmpty() + { + myPositiveInteger = PositiveInteger(1); + myIsEmpty = true; + ; + } + + void setValue(const PositiveInteger &value) + { + myPositiveInteger = PositiveInteger(value); + myIsEmpty = false; + } + + PositiveInteger getValueNumber() const + { + return myPositiveInteger; + } + + void parse(const std::string &value) + { + if (value == "") { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); + myPositiveInteger = PositiveInteger(1); + myIsEmpty = true; } - - std::ostream& toStream( std::ostream& os, const PositiveIntegerOrEmpty& value ) + else { - if ( value.getIsNumber() ) - { - toStream( os, value.getValueNumber() ); - } - else - { - ; // os << ""; - } - return os; + /* if it contains only numeric + characters it must be a number */ + myPositiveInteger.parse(value); + myIsEmpty = false; } + } - std::ostream& operator<<( std::ostream& os, const PositiveIntegerOrEmpty& value ) - { - return toStream( os, value ); - } + private: + PositiveInteger myPositiveInteger; + bool myIsEmpty; +}; + +PositiveIntegerOrEmpty::PositiveIntegerOrEmpty() : myImpl(new impl()) +{ +} + +PositiveIntegerOrEmpty::PositiveIntegerOrEmpty(const PositiveInteger &value) : myImpl(new impl(value)) +{ +} + +PositiveIntegerOrEmpty::PositiveIntegerOrEmpty(const std::string &value) : myImpl(new impl(value)) +{ +} + +PositiveIntegerOrEmpty::~PositiveIntegerOrEmpty() +{ +} + +PositiveIntegerOrEmpty::PositiveIntegerOrEmpty(const PositiveIntegerOrEmpty &other) + : myImpl(new PositiveIntegerOrEmpty::impl(*other.myImpl)) +{ +} + +PositiveIntegerOrEmpty::PositiveIntegerOrEmpty(PositiveIntegerOrEmpty &&other) : myImpl(std::move(other.myImpl)) +{ +} + +PositiveIntegerOrEmpty &PositiveIntegerOrEmpty::operator=(PositiveIntegerOrEmpty &&other) +{ + myImpl = std::move(other.myImpl); + return *this; +} + +PositiveIntegerOrEmpty &PositiveIntegerOrEmpty::operator=(const PositiveIntegerOrEmpty &other) +{ + this->myImpl = std::unique_ptr(new PositiveIntegerOrEmpty::impl(*other.myImpl)); + return *this; +} + +bool PositiveIntegerOrEmpty::getIsEmpty() const +{ + return myImpl->getIsEmpty(); +} + +bool PositiveIntegerOrEmpty::getIsNumber() const +{ + return myImpl->getIsNumber(); +} + +void PositiveIntegerOrEmpty::setValueEmpty() +{ + myImpl->setValueEmpty(); +} + +void PositiveIntegerOrEmpty::setValue(const PositiveInteger &value) +{ + myImpl->setValue(value); +} + +PositiveInteger PositiveIntegerOrEmpty::getValueNumber() const +{ + return myImpl->getValueNumber(); +} + +void PositiveIntegerOrEmpty::parse(const std::string &value) +{ + myImpl->parse(value); +} + +std::string toString(const PositiveIntegerOrEmpty &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +std::ostream &toStream(std::ostream &os, const PositiveIntegerOrEmpty &value) +{ + if (value.getIsNumber()) + { + toStream(os, value.getValueNumber()); + } + else + { + ; // os << ""; } + return os; +} + +std::ostream &operator<<(std::ostream &os, const PositiveIntegerOrEmpty &value) +{ + return toStream(os, value); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h b/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h index 8f24d78f5..d98abfd83 100644 --- a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h +++ b/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h @@ -12,36 +12,36 @@ namespace mx { - namespace core - { - /// The positive-integer-or-empty values can be either a positive integer or an empty - /// string. - class PositiveIntegerOrEmpty - { - public: - explicit PositiveIntegerOrEmpty(); - explicit PositiveIntegerOrEmpty( const PositiveInteger& value ); - explicit PositiveIntegerOrEmpty( const std::string& value ); - virtual ~PositiveIntegerOrEmpty(); - PositiveIntegerOrEmpty( const PositiveIntegerOrEmpty& other ); - PositiveIntegerOrEmpty( PositiveIntegerOrEmpty&& other ); - PositiveIntegerOrEmpty& operator=( const PositiveIntegerOrEmpty& other ); - PositiveIntegerOrEmpty& operator=( PositiveIntegerOrEmpty&& other ); - - bool getIsEmpty() const; - bool getIsNumber() const; - void setValueEmpty(); - void setValue( const PositiveInteger& value ); - PositiveInteger getValueNumber() const; - void parse( const std::string& value ); - - private: - class impl; - std::unique_ptr myImpl; - }; - - std::string toString( const PositiveIntegerOrEmpty& value ); - std::ostream& toStream( std::ostream& os, const PositiveIntegerOrEmpty& value ); - std::ostream& operator<<( std::ostream& os, const PositiveIntegerOrEmpty& value ); - } -} +namespace core +{ +/// The positive-integer-or-empty values can be either a positive integer or an empty +/// string. +class PositiveIntegerOrEmpty +{ + public: + explicit PositiveIntegerOrEmpty(); + explicit PositiveIntegerOrEmpty(const PositiveInteger &value); + explicit PositiveIntegerOrEmpty(const std::string &value); + virtual ~PositiveIntegerOrEmpty(); + PositiveIntegerOrEmpty(const PositiveIntegerOrEmpty &other); + PositiveIntegerOrEmpty(PositiveIntegerOrEmpty &&other); + PositiveIntegerOrEmpty &operator=(const PositiveIntegerOrEmpty &other); + PositiveIntegerOrEmpty &operator=(PositiveIntegerOrEmpty &&other); + + bool getIsEmpty() const; + bool getIsNumber() const; + void setValueEmpty(); + void setValue(const PositiveInteger &value); + PositiveInteger getValueNumber() const; + void parse(const std::string &value); + + private: + class impl; + std::unique_ptr myImpl; +}; + +std::string toString(const PositiveIntegerOrEmpty &value); +std::ostream &toStream(std::ostream &os, const PositiveIntegerOrEmpty &value); +std::ostream &operator<<(std::ostream &os, const PositiveIntegerOrEmpty &value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/ProcessingInstruction.cpp b/Sourcecode/private/mx/core/ProcessingInstruction.cpp index 6ff144dda..01e684600 100644 --- a/Sourcecode/private/mx/core/ProcessingInstruction.cpp +++ b/Sourcecode/private/mx/core/ProcessingInstruction.cpp @@ -9,94 +9,80 @@ namespace mx { - namespace core - { +namespace core +{ //////////////////////////////////////////////////////////////////////////////// // CTOR AND COPY /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - ProcessingInstruction::ProcessingInstruction() - : myName{ "default-name" } - , myData{} - , mIsChild{true} - { - - } - +ProcessingInstruction::ProcessingInstruction() : myName{"default-name"}, myData{}, mIsChild{true} +{ +} - ProcessingInstruction::ProcessingInstruction( StringType inName, StringType inData ) - : ProcessingInstruction{} - { - this->setName( std::move( inName ) ); - this->setData( std::move( inData ) ); - } +ProcessingInstruction::ProcessingInstruction(StringType inName, StringType inData) : ProcessingInstruction{} +{ + this->setName(std::move(inName)); + this->setData(std::move(inData)); +} //////////////////////////////////////////////////////////////////////////////// // PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - const StringType& ProcessingInstruction::getName() const - { - return myName; - } - - - void ProcessingInstruction::setName( StringType inName ) - { - if( !inName.empty() ) - { - myName = std::move( inName ); - } - } - - - const StringType& ProcessingInstruction::getData() const - { - return myData; - } - - - void ProcessingInstruction::setData( StringType inData ) - { - myData = std::move( inData ); - } - +const StringType &ProcessingInstruction::getName() const +{ + return myName; +} - std::ostream& ProcessingInstruction::toStream( std::ostream& os ) const - { - os << ""; - return os; - } +void ProcessingInstruction::setName(StringType inName) +{ + if (!inName.empty()) + { + myName = std::move(inName); + } +} +const StringType &ProcessingInstruction::getData() const +{ + return myData; +} - StringType ProcessingInstruction::toString() const - { - std::stringstream ss; - this->toStream( ss ); - return ss.str(); - } +void ProcessingInstruction::setData(StringType inData) +{ + myData = std::move(inData); +} +std::ostream &ProcessingInstruction::toStream(std::ostream &os) const +{ + os << ""; + return os; +} - bool ProcessingInstruction::getIsChild() const - { - return mIsChild; - } +StringType ProcessingInstruction::toString() const +{ + std::stringstream ss; + this->toStream(ss); + return ss.str(); +} +bool ProcessingInstruction::getIsChild() const +{ + return mIsChild; +} - void ProcessingInstruction::setIsChild( bool inValue ) - { - mIsChild = inValue; - } +void ProcessingInstruction::setIsChild(bool inValue) +{ + mIsChild = inValue; +} //////////////////////////////////////////////////////////////////////////////// // PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - - } -} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/ProcessingInstruction.h b/Sourcecode/private/mx/core/ProcessingInstruction.h index e24ec9ac6..ba7139624 100644 --- a/Sourcecode/private/mx/core/ProcessingInstruction.h +++ b/Sourcecode/private/mx/core/ProcessingInstruction.h @@ -6,47 +6,47 @@ #include "mx/core/XsString.h" -#include #include +#include #include namespace mx { - namespace core - { - /// @brief An XML Processing Instruction - /// - /// @detailed Will be written/read to/from the XML - /// document as Processing Instructions - /// - class ProcessingInstruction - { - public: - ProcessingInstruction(); - ProcessingInstruction( StringType inName, StringType inData ); - - public: - const StringType& getName() const; - void setName( StringType inName ); - const StringType& getData() const; - void setData( StringType inData ); - std::ostream& toStream( std::ostream& os ) const; - StringType toString() const; - - /// place the instruction as the first child if possible. this may - /// not be possible if the element has no other child elements. - bool getIsChild() const; - - /// place the instruction as the first child if possible. this may - /// not be possible if the element has no other child elements. - void setIsChild( bool inValue ); - - private: - StringType myName; - StringType myData; - bool mIsChild; - }; - - using ProcessingInstructions = std::vector; - } -} +namespace core +{ +/// @brief An XML Processing Instruction +/// +/// @detailed Will be written/read to/from the XML +/// document as Processing Instructions +/// +class ProcessingInstruction +{ + public: + ProcessingInstruction(); + ProcessingInstruction(StringType inName, StringType inData); + + public: + const StringType &getName() const; + void setName(StringType inName); + const StringType &getData() const; + void setData(StringType inData); + std::ostream &toStream(std::ostream &os) const; + StringType toString() const; + + /// place the instruction as the first child if possible. this may + /// not be possible if the element has no other child elements. + bool getIsChild() const; + + /// place the instruction as the first child if possible. this may + /// not be possible if the element has no other child elements. + void setIsChild(bool inValue); + + private: + StringType myName; + StringType myData; + bool mIsChild; +}; + +using ProcessingInstructions = std::vector; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/ScoreConversions.cpp b/Sourcecode/private/mx/core/ScoreConversions.cpp index 9ffa559d5..09e171879 100644 --- a/Sourcecode/private/mx/core/ScoreConversions.cpp +++ b/Sourcecode/private/mx/core/ScoreConversions.cpp @@ -3,168 +3,163 @@ // Distributed under the MIT License #include "mx/core/ScoreConversions.h" -#include "mx/core/elements/TimewiseMeasure.h" +#include "mx/core/elements/PartGroup.h" +#include "mx/core/elements/PartGroupOrScorePart.h" +#include "mx/core/elements/PartList.h" #include "mx/core/elements/PartwiseMeasure.h" #include "mx/core/elements/PartwisePart.h" -#include "mx/core/elements/TimewisePart.h" #include "mx/core/elements/ScorePart.h" -#include "mx/core/elements/PartList.h" -#include "mx/core/elements/PartGroup.h" -#include "mx/core/elements/PartGroupOrScorePart.h" +#include "mx/core/elements/TimewiseMeasure.h" +#include "mx/core/elements/TimewisePart.h" #include namespace mx { - namespace core +namespace core +{ +ScoreTimewisePtr partwiseTimewise(const ScorePartwisePtr &inScore) +{ + auto score_new = makeScoreTimewise(); + score_new->setScoreHeaderGroup(inScore->getScoreHeaderGroup()); + auto attr_old = inScore->getAttributes(); + auto attr_new = score_new->getAttributes(); + attr_new->hasVersion = attr_old->hasVersion; + attr_new->version = attr_old->version; + TimewiseMeasureSet twMeasures; + using Intz = PartwiseMeasureSet::size_type; + + /* find max number of measures */ + Intz measureCount = 0; + for (auto p : inScore->getPartwisePartSet()) + { + if (p->getPartwiseMeasureSet().size() > measureCount) + { + measureCount = p->getPartwiseMeasureSet().size(); + } + } + + /* Outer Loop, Once for each Measure */ + for (Intz currentMeasureIndex = 0; currentMeasureIndex < measureCount; ++currentMeasureIndex) { - ScoreTimewisePtr partwiseTimewise( const ScorePartwisePtr& inScore ) + TimewiseMeasurePtr newMeasure; + if (currentMeasureIndex == 0) { - auto score_new = makeScoreTimewise(); - score_new->setScoreHeaderGroup( inScore->getScoreHeaderGroup() ); - auto attr_old = inScore->getAttributes(); - auto attr_new = score_new->getAttributes(); - attr_new->hasVersion = attr_old->hasVersion; - attr_new->version = attr_old->version; - TimewiseMeasureSet twMeasures; - using Intz = PartwiseMeasureSet::size_type; - - /* find max number of measures */ - Intz measureCount = 0; - for ( auto p : inScore->getPartwisePartSet() ) + newMeasure = *(score_new->getTimewiseMeasureSet().cbegin()); + } + else + { + newMeasure = makeTimewiseMeasure(); + score_new->addTimewiseMeasure(newMeasure); + } + + /* Create a simple list of parts from the score header */ + std::vector partlist; + partlist.push_back(inScore->getScoreHeaderGroup()->getPartList()->getScorePart()); + for (auto pgosp : inScore->getScoreHeaderGroup()->getPartList()->getPartGroupOrScorePartSet()) + { + if (pgosp->getChoice() == PartGroupOrScorePart::Choice::scorePart) { - if ( p->getPartwiseMeasureSet().size() > measureCount ) - { - measureCount = p->getPartwiseMeasureSet().size(); - } + partlist.push_back(pgosp->getScorePart()); } - - /* Outer Loop, Once for each Measure */ - for ( Intz currentMeasureIndex = 0; - currentMeasureIndex < measureCount; - ++currentMeasureIndex ) + } + + /* First Nested Loop, for each Part */ + bool isFirst = true; + for (auto sp : partlist) + { + /* Find the Correct Part */ + auto partIter = std::find_if(inScore->getPartwisePartSet().cbegin(), inScore->getPartwisePartSet().cend(), + [&](const PartwisePartPtr &searchingForThis) { + return searchingForThis->getAttributes()->id.getValue() == + sp->getAttributes()->id.getValue(); + }); + if (partIter != inScore->getPartwisePartSet().cend()) { - TimewiseMeasurePtr newMeasure; - if ( currentMeasureIndex == 0 ) - { - newMeasure = *( score_new->getTimewiseMeasureSet().cbegin() ); - } - else + auto measureIter = (*partIter)->getPartwiseMeasureSet().cbegin(); + /* Find the Correct Measure Within The Part */ + for (Intz x = 0; x < currentMeasureIndex; ++measureIter, ++x) { - newMeasure = makeTimewiseMeasure(); - score_new->addTimewiseMeasure( newMeasure ); } - - /* Create a simple list of parts from the score header */ - std::vector partlist; - partlist.push_back( inScore->getScoreHeaderGroup()->getPartList()->getScorePart() ); - for ( auto pgosp : inScore->getScoreHeaderGroup()->getPartList()->getPartGroupOrScorePartSet() ) + + /* Create and add the Part Music to the outer loop's Measure */ + TimewisePartPtr newPart; + if (isFirst) { - if ( pgosp->getChoice() == PartGroupOrScorePart::Choice::scorePart ) - { - partlist.push_back( pgosp->getScorePart() ); - } + newPart = *(newMeasure->getTimewisePartSet().cbegin()); + isFirst = false; } - - /* First Nested Loop, for each Part */ - bool isFirst = true; - for ( auto sp : partlist ) + else { - /* Find the Correct Part */ - auto partIter = std::find_if( inScore->getPartwisePartSet().cbegin(), - inScore->getPartwisePartSet().cend(), - [&]( const PartwisePartPtr& searchingForThis ) - { - return searchingForThis->getAttributes()->id.getValue() == sp->getAttributes()->id.getValue(); - }); - if ( partIter != inScore->getPartwisePartSet().cend() ) - { - auto measureIter = (*partIter)->getPartwiseMeasureSet().cbegin(); - /* Find the Correct Measure Within The Part */ - for( Intz x = 0; - x < currentMeasureIndex; - ++measureIter, ++x ) {} - - /* Create and add the Part Music to the outer loop's Measure */ - TimewisePartPtr newPart; - if ( isFirst ) - { - newPart = *( newMeasure->getTimewisePartSet().cbegin() ); - isFirst = false; - } - else - { - newPart = makeTimewisePart(); - newMeasure->addTimewisePart( newPart ); - } - newPart->getAttributes()->id = (*partIter)->getAttributes()->id; - newPart->setMusicDataGroup( (*measureIter)->getMusicDataGroup() ); - newMeasure->setAttributes( (*measureIter)->getAttributes() ); - } + newPart = makeTimewisePart(); + newMeasure->addTimewisePart(newPart); } + newPart->getAttributes()->id = (*partIter)->getAttributes()->id; + newPart->setMusicDataGroup((*measureIter)->getMusicDataGroup()); + newMeasure->setAttributes((*measureIter)->getAttributes()); } - return score_new; } + } + return score_new; +} +ScorePartwisePtr timewisePartwise(const ScoreTimewisePtr &inScore) +{ + auto score_new = makeScorePartwise(); + score_new->setScoreHeaderGroup(inScore->getScoreHeaderGroup()); + auto attr_old = inScore->getAttributes(); + auto attr_new = score_new->getAttributes(); + attr_new->hasVersion = attr_old->hasVersion; + attr_new->version = attr_old->version; + PartwisePartSet pwParts; - ScorePartwisePtr timewisePartwise( const ScoreTimewisePtr& inScore ) + /* Create and add a ScorePartwisePart for each part in the main list */ + auto firstPart = makePartwisePart(); + firstPart->getAttributes()->id = inScore->getScoreHeaderGroup()->getPartList()->getScorePart()->getAttributes()->id; + score_new->addPartwisePart(firstPart); + score_new->removePartwisePart(score_new->getPartwisePartSet().cbegin()); + for (auto pgosp : inScore->getScoreHeaderGroup()->getPartList()->getPartGroupOrScorePartSet()) + { + if (pgosp->getChoice() == PartGroupOrScorePart::Choice::scorePart) + { + auto additionalPart = makePartwisePart(); + additionalPart->getAttributes()->id = pgosp->getScorePart()->getAttributes()->id; + score_new->addPartwisePart(additionalPart); + } + } + /* outter loop: for each scorepart in score_new */ + for (auto p : score_new->getPartwisePartSet()) + { + /* inner loop: for each measure in inScore */ + bool isFirst = true; + for (auto m : inScore->getTimewiseMeasureSet()) { - auto score_new = makeScorePartwise(); - score_new->setScoreHeaderGroup( inScore->getScoreHeaderGroup() ); - auto attr_old = inScore->getAttributes(); - auto attr_new = score_new->getAttributes(); - attr_new->hasVersion = attr_old->hasVersion; - attr_new->version = attr_old->version; - PartwisePartSet pwParts; - - /* Create and add a ScorePartwisePart for each part in the main list */ - auto firstPart = makePartwisePart(); - firstPart->getAttributes()->id = inScore->getScoreHeaderGroup()->getPartList()->getScorePart()->getAttributes()->id; - score_new->addPartwisePart( firstPart ); - score_new->removePartwisePart( score_new->getPartwisePartSet().cbegin() ); - for ( auto pgosp : inScore->getScoreHeaderGroup()->getPartList()->getPartGroupOrScorePartSet() ) + PartwiseMeasurePtr newMeasure; + if (isFirst) { - if ( pgosp->getChoice() == PartGroupOrScorePart::Choice::scorePart ) - { - auto additionalPart = makePartwisePart(); - additionalPart->getAttributes()->id = pgosp->getScorePart()->getAttributes()->id; - score_new->addPartwisePart( additionalPart ); - } + newMeasure = *(p->getPartwiseMeasureSet().cbegin()); + isFirst = false; } - /* outter loop: for each scorepart in score_new */ - for ( auto p : score_new->getPartwisePartSet() ) + else { - /* inner loop: for each measure in inScore */ - bool isFirst = true; - for ( auto m : inScore->getTimewiseMeasureSet() ) - { - PartwiseMeasurePtr newMeasure; - if ( isFirst ) - { - newMeasure = *( p->getPartwiseMeasureSet().cbegin() ); - isFirst = false; - } - else - { - newMeasure = makePartwiseMeasure(); - p->addPartwiseMeasure( newMeasure ); - } - newMeasure->setAttributes( m->getAttributes() ); - - /* find the correct music data */ - auto partIter = std::find_if( m->getTimewisePartSet().cbegin(), - m->getTimewisePartSet().cend(), - [&]( const TimewisePartPtr& searchingForThis ) - { - return searchingForThis->getAttributes()->id.getValue() == p->getAttributes()->id.getValue(); - }); - if ( partIter != m->getTimewisePartSet().cend() ) - { - newMeasure->setMusicDataGroup( (*partIter)->getMusicDataGroup() ); - } - } + newMeasure = makePartwiseMeasure(); + p->addPartwiseMeasure(newMeasure); + } + newMeasure->setAttributes(m->getAttributes()); + + /* find the correct music data */ + auto partIter = std::find_if(m->getTimewisePartSet().cbegin(), m->getTimewisePartSet().cend(), + [&](const TimewisePartPtr &searchingForThis) { + return searchingForThis->getAttributes()->id.getValue() == + p->getAttributes()->id.getValue(); + }); + if (partIter != m->getTimewisePartSet().cend()) + { + newMeasure->setMusicDataGroup((*partIter)->getMusicDataGroup()); } - return score_new; } } + return score_new; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/ScoreConversions.h b/Sourcecode/private/mx/core/ScoreConversions.h index 26ef3df75..aba73194c 100644 --- a/Sourcecode/private/mx/core/ScoreConversions.h +++ b/Sourcecode/private/mx/core/ScoreConversions.h @@ -4,22 +4,22 @@ #pragma once -#include +#include "mx/core/elements/ScoreHeaderGroup.h" #include "mx/core/elements/ScorePartwise.h" #include "mx/core/elements/ScoreTimewise.h" -#include "mx/core/elements/ScoreHeaderGroup.h" +#include #include namespace mx { - namespace core - { - // Converts a 'score-timewise' to 'score-partwise' - // caution - uses shallow copies, does not clone - ScorePartwisePtr timewisePartwise( const ScoreTimewisePtr& inScore ); +namespace core +{ +// Converts a 'score-timewise' to 'score-partwise' +// caution - uses shallow copies, does not clone +ScorePartwisePtr timewisePartwise(const ScoreTimewisePtr &inScore); - // Converts a 'score-timewise' to 'score-partwise' - // caution - uses shallow copies, does not clone - ScoreTimewisePtr partwiseTimewise( const ScorePartwisePtr& inScore ); - } -} +// Converts a 'score-timewise' to 'score-partwise' +// caution - uses shallow copies, does not clone +ScoreTimewisePtr partwiseTimewise(const ScorePartwisePtr &inScore); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/StringUtils.h b/Sourcecode/private/mx/core/StringUtils.h index 239dfab7b..58885cd13 100644 --- a/Sourcecode/private/mx/core/StringUtils.h +++ b/Sourcecode/private/mx/core/StringUtils.h @@ -3,76 +3,68 @@ // Distributed under the MIT License #include "mx/core/XsString.h" -#include #include #include #include +#include namespace mx::core { - static constexpr const char* const kWhitespace = " \t\n\v\f\r"; - static constexpr const char* const kNCNameAllowed = "-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"; +static constexpr const char *const kWhitespace = " \t\n\v\f\r"; +static constexpr const char *const kNCNameAllowed = "-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"; +inline StringType trim(const StringType &str, const StringType &whitespace = kWhitespace) +{ + const auto strBegin = str.find_first_not_of(whitespace); + if (strBegin == StringType::npos) + return ""; // no content - inline StringType trim(const StringType& str, const StringType& whitespace = kWhitespace ) - { - const auto strBegin = str.find_first_not_of(whitespace); - if (strBegin == StringType::npos) - return ""; // no content - - const auto strEnd = str.find_last_not_of(whitespace); - const auto strRange = strEnd - strBegin + 1; - - return str.substr(strBegin, strRange); - } - + const auto strEnd = str.find_last_not_of(whitespace); + const auto strRange = strEnd - strBegin + 1; + + return str.substr(strBegin, strRange); +} - inline StringType reduce( - const StringType& str, - const StringType& fill = " ", - const StringType& whitespace = kWhitespace) +inline StringType reduce(const StringType &str, const StringType &fill = " ", + const StringType &whitespace = kWhitespace) +{ + // trim first + auto result = trim(str, whitespace); + + // replace sub ranges + auto beginSpace = result.find_first_of(whitespace); + while (beginSpace != mx::core::StringType::npos) { - // trim first - auto result = trim(str, whitespace); - - // replace sub ranges - auto beginSpace = result.find_first_of(whitespace); - while (beginSpace != mx::core::StringType::npos) - { - const auto endSpace = result.find_first_not_of(whitespace, beginSpace); - const auto range = endSpace - beginSpace; - - result.replace(beginSpace, range, fill); - - const auto newStart = beginSpace + fill.length(); - beginSpace = result.find_first_of(whitespace, newStart); - } - - return result; + const auto endSpace = result.find_first_not_of(whitespace, beginSpace); + const auto range = endSpace - beginSpace; + + result.replace(beginSpace, range, fill); + + const auto newStart = beginSpace + fill.length(); + beginSpace = result.find_first_of(whitespace, newStart); } + return result; +} - inline StringType onlyAllow( - const StringType& input, - const StringType& fill = "_", - const StringType& onlyAllow = kNCNameAllowed) +inline StringType onlyAllow(const StringType &input, const StringType &fill = "_", + const StringType &onlyAllow = kNCNameAllowed) +{ + std::string str = input; + auto firstBadChar = str.find_first_not_of(onlyAllow); + while (firstBadChar != StringType::npos) { - std::string str = input; - auto firstBadChar = str.find_first_not_of( onlyAllow ); - while ( firstBadChar != StringType::npos ) - { - str = str.replace( firstBadChar, 1, fill ); - firstBadChar = str.find_first_not_of( onlyAllow ); - } - return str; + str = str.replace(firstBadChar, 1, fill); + firstBadChar = str.find_first_not_of(onlyAllow); } - - - // inline std::set copyPositives( const std::set& input ) - // { - // std::set output; - // std::copy_if( input.cbegin(), input.cend(), std::inserter( output, output.begin() ), - // [](const int i){ return i > 0; } ); - // return output; - // } + return str; } + +// inline std::set copyPositives( const std::set& input ) +// { +// std::set output; +// std::copy_if( input.cbegin(), input.cend(), std::inserter( output, output.begin() ), +// [](const int i){ return i > 0; } ); +// return output; +// } +} // namespace mx::core diff --git a/Sourcecode/private/mx/core/TimeOnly.h b/Sourcecode/private/mx/core/TimeOnly.h index a0d11ec3b..63501f9ba 100644 --- a/Sourcecode/private/mx/core/TimeOnly.h +++ b/Sourcecode/private/mx/core/TimeOnly.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using TimeOnly = CommaSeparatedListOfPositiveIntegers; - } +namespace core +{ +using TimeOnly = CommaSeparatedListOfPositiveIntegers; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/UnusedParameter.h b/Sourcecode/private/mx/core/UnusedParameter.h index d06fdb88f..624575d68 100644 --- a/Sourcecode/private/mx/core/UnusedParameter.h +++ b/Sourcecode/private/mx/core/UnusedParameter.h @@ -5,5 +5,9 @@ #pragma once #ifndef MX_UNUSED -#define MX_UNUSED(expr) do { (void)(expr); } while (0) +#define MX_UNUSED(expr) \ + do \ + { \ + (void)(expr); \ + } while (0) #endif diff --git a/Sourcecode/private/mx/core/XlinkHref.h b/Sourcecode/private/mx/core/XlinkHref.h index fa86b05b7..c74355f8c 100644 --- a/Sourcecode/private/mx/core/XlinkHref.h +++ b/Sourcecode/private/mx/core/XlinkHref.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using XlinkHref = XsAnyUri; - } +namespace core +{ +using XlinkHref = XsAnyUri; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/XlinkRole.h b/Sourcecode/private/mx/core/XlinkRole.h index 10ce984b6..530cb6ced 100644 --- a/Sourcecode/private/mx/core/XlinkRole.h +++ b/Sourcecode/private/mx/core/XlinkRole.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using XlinkRole = XsToken; - } +namespace core +{ +using XlinkRole = XsToken; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/XlinkTitle.h b/Sourcecode/private/mx/core/XlinkTitle.h index 812a2ea05..63442cbc2 100644 --- a/Sourcecode/private/mx/core/XlinkTitle.h +++ b/Sourcecode/private/mx/core/XlinkTitle.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using XlinkTitle = XsToken; - } +namespace core +{ +using XlinkTitle = XsToken; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/XmlLang.h b/Sourcecode/private/mx/core/XmlLang.h index 0294065f6..0bc86f442 100644 --- a/Sourcecode/private/mx/core/XmlLang.h +++ b/Sourcecode/private/mx/core/XmlLang.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using XmlLang = XsString; - } +namespace core +{ +using XmlLang = XsString; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsAnyUri.h b/Sourcecode/private/mx/core/XsAnyUri.h index 98274c2df..574daaa97 100644 --- a/Sourcecode/private/mx/core/XsAnyUri.h +++ b/Sourcecode/private/mx/core/XsAnyUri.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using XsAnyUri = XsString; - } +namespace core +{ +using XsAnyUri = XsString; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsID.cpp b/Sourcecode/private/mx/core/XsID.cpp index 745041df2..6b5ca9b4f 100644 --- a/Sourcecode/private/mx/core/XsID.cpp +++ b/Sourcecode/private/mx/core/XsID.cpp @@ -7,34 +7,29 @@ namespace mx { - namespace core - { - XsID::XsID() - :XsString( "ID" ) - { - - } +namespace core +{ +XsID::XsID() : XsString("ID") +{ +} - - XsID::XsID( const StringType& value ) - :XsString( value ) - { - XsID::setValue( value ); - } - +XsID::XsID(const StringType &value) : XsString(value) +{ + XsID::setValue(value); +} - void XsID::setValue( const StringType& value ) - { - std::string scrubbed = onlyAllow( value ); - if ( scrubbed.length() == 0 ) - { - scrubbed = "ID"; - } - else if ( isdigit( scrubbed[0] ) ) - { - scrubbed = "ID" + scrubbed; - } - XsString::setValue( scrubbed ); - } +void XsID::setValue(const StringType &value) +{ + std::string scrubbed = onlyAllow(value); + if (scrubbed.length() == 0) + { + scrubbed = "ID"; + } + else if (isdigit(scrubbed[0])) + { + scrubbed = "ID" + scrubbed; } + XsString::setValue(scrubbed); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsID.h b/Sourcecode/private/mx/core/XsID.h index e66906e13..dfadc0e40 100644 --- a/Sourcecode/private/mx/core/XsID.h +++ b/Sourcecode/private/mx/core/XsID.h @@ -8,14 +8,14 @@ namespace mx { - namespace core - { - class XsID : public XsString - { - public: - XsID(); - XsID( const StringType& value ); - virtual void setValue( const StringType& value ); - }; - } -} +namespace core +{ +class XsID : public XsString +{ + public: + XsID(); + XsID(const StringType &value); + virtual void setValue(const StringType &value); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsIDREF.h b/Sourcecode/private/mx/core/XsIDREF.h index fe62d40ee..6f25e4382 100644 --- a/Sourcecode/private/mx/core/XsIDREF.h +++ b/Sourcecode/private/mx/core/XsIDREF.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using XsIDREF = XsID; - } +namespace core +{ +using XsIDREF = XsID; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsNMToken.h b/Sourcecode/private/mx/core/XsNMToken.h index 24938ab05..8e1ffc08d 100644 --- a/Sourcecode/private/mx/core/XsNMToken.h +++ b/Sourcecode/private/mx/core/XsNMToken.h @@ -8,8 +8,8 @@ namespace mx { - namespace core - { - using XsNMToken = XsToken; - } +namespace core +{ +using XsNMToken = XsToken; } +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsString.cpp b/Sourcecode/private/mx/core/XsString.cpp index bf29c5aeb..f17b4c561 100644 --- a/Sourcecode/private/mx/core/XsString.cpp +++ b/Sourcecode/private/mx/core/XsString.cpp @@ -6,83 +6,68 @@ namespace mx { - namespace core - { - XsString::XsString() - :myValue( "" ) - { - - } - - - XsString::XsString( const StringType& value ) - :myValue( value ) - { - - } - - - XsString::~XsString() - { +namespace core +{ +XsString::XsString() : myValue("") +{ +} - } - +XsString::XsString(const StringType &value) : myValue(value) +{ +} - StringType XsString::getValue() const - { - return myValue; - } +XsString::~XsString() +{ +} +StringType XsString::getValue() const +{ + return myValue; +} - void XsString::setValue( const StringType& value ) - { - myValue = value; - } +void XsString::setValue(const StringType &value) +{ + myValue = value; +} +StringType toString(const XsString &xsstring) +{ + return xsstring.getValue(); +} - StringType toString( const XsString& xsstring ) +std::ostream &toStream(std::ostream &os, const XsString &xsstring, bool useXmlEscapeCharacters) +{ + if (!useXmlEscapeCharacters) + { + return os << xsstring.getValue(); + } + for (auto c : xsstring.getValue()) + { + switch (c) { - return xsstring.getValue(); - } + case '<': + os << "<"; + break; + case '>': + os << ">"; + break; - std::ostream& toStream( - std::ostream& os, - const XsString& xsstring, - bool useXmlEscapeCharacters ) - { - if( !useXmlEscapeCharacters ) - { - return os << xsstring.getValue(); - } - for( auto c : xsstring.getValue() ) - { - switch ( c ) - { - case '<': - os << "<"; - break; - - case '>': - os << ">"; - break; - - case '&': - os << "&"; - break; - - default: - os << c; - break; - } - } - return os; - } - + case '&': + os << "&"; + break; - std::ostream& operator<<( std::ostream& os, const XsString& xsstring ) - { - return toStream( os, xsstring ); + default: + os << c; + break; } } + return os; +} + +std::ostream &operator<<(std::ostream &os, const XsString &xsstring) +{ + return toStream(os, xsstring); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsString.h b/Sourcecode/private/mx/core/XsString.h index 6f188ef80..1c704cbbe 100644 --- a/Sourcecode/private/mx/core/XsString.h +++ b/Sourcecode/private/mx/core/XsString.h @@ -9,24 +9,25 @@ namespace mx { - namespace core - { - using StringType = std::string; - - class XsString - { - public: - XsString(); - XsString( const StringType& value ); - virtual ~XsString(); - StringType getValue() const; - virtual void setValue( const StringType& value ); - private: - StringType myValue; - }; - - StringType toString( const XsString& xsstring ); - std::ostream& toStream( std::ostream& os, const XsString& xsstring, bool useXmlEscapeCharacters = true ); - std::ostream& operator<<( std::ostream& os, const XsString& xsstring ); - } -} +namespace core +{ +using StringType = std::string; + +class XsString +{ + public: + XsString(); + XsString(const StringType &value); + virtual ~XsString(); + StringType getValue() const; + virtual void setValue(const StringType &value); + + private: + StringType myValue; +}; + +StringType toString(const XsString &xsstring); +std::ostream &toStream(std::ostream &os, const XsString &xsstring, bool useXmlEscapeCharacters = true); +std::ostream &operator<<(std::ostream &os, const XsString &xsstring); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsToken.cpp b/Sourcecode/private/mx/core/XsToken.cpp index f47401ddc..5920fa816 100644 --- a/Sourcecode/private/mx/core/XsToken.cpp +++ b/Sourcecode/private/mx/core/XsToken.cpp @@ -7,24 +7,20 @@ namespace mx { - namespace core - { - XsToken::XsToken() - :XsString() - { - - } - - XsToken::XsToken( const StringType& value ) - :XsString( value ) - { - XsToken::setValue( value ); - } +namespace core +{ +XsToken::XsToken() : XsString() +{ +} +XsToken::XsToken(const StringType &value) : XsString(value) +{ + XsToken::setValue(value); +} - void XsToken::setValue( const StringType& value ) - { - XsString::setValue( reduce( value ) ); - } - } +void XsToken::setValue(const StringType &value) +{ + XsString::setValue(reduce(value)); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/XsToken.h b/Sourcecode/private/mx/core/XsToken.h index cb997fb3a..b9c1b836a 100644 --- a/Sourcecode/private/mx/core/XsToken.h +++ b/Sourcecode/private/mx/core/XsToken.h @@ -8,14 +8,14 @@ namespace mx { - namespace core - { - class XsToken : public XsString - { - public: - XsToken(); - XsToken( const StringType& value ); - virtual void setValue( const StringType& value ); - }; - } -} +namespace core +{ +class XsToken : public XsString +{ + public: + XsToken(); + XsToken(const StringType &value); + virtual void setValue(const StringType &value); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/YesNoNumber.cpp b/Sourcecode/private/mx/core/YesNoNumber.cpp index 1826f405a..b8f3a1d32 100644 --- a/Sourcecode/private/mx/core/YesNoNumber.cpp +++ b/Sourcecode/private/mx/core/YesNoNumber.cpp @@ -11,126 +11,121 @@ namespace mx { - namespace core +namespace core +{ +template inline constexpr bool always_false_v = false; + +YesNoNumber::YesNoNumber() : myValue{YesNo::yes} +{ +} + +YesNoNumber::YesNoNumber(YesNo value) : myValue{value} +{ +} + +YesNoNumber::YesNoNumber(Decimal value) : myValue{std::move(value)} +{ +} + +YesNoNumber::YesNoNumber(const std::string &value) : YesNoNumber{} +{ + parse(value); +} + +bool YesNoNumber::getIsYesNo() const +{ + return myValue.index() == 0; +} + +bool YesNoNumber::getIsDecimal() const +{ + return myValue.index() == 1; +} + +void YesNoNumber::setYesNo(YesNo value) +{ + myValue.emplace(value); +} + +void YesNoNumber::setDecimal(Decimal value) +{ + myValue.emplace(value); +} + +YesNo YesNoNumber::getValueYesNo() const +{ + auto result = YesNo::yes; + std::visit( + [&](auto &&arg) { + using T = std::decay_t; + if constexpr (std::is_same_v) + result = arg; + else if constexpr (std::is_same_v) + result = YesNo::yes; + else + static_assert(always_false_v, "non-exhaustive visitor!"); + }, + myValue); + return result; +} + +Decimal YesNoNumber::getValueDecimal() const +{ + auto result = Decimal{}; + std::visit( + [&](auto &&arg) { + using T = std::decay_t; + if constexpr (std::is_same_v) + result = Decimal{}; + else if constexpr (std::is_same_v) + result = arg; + else + static_assert(always_false_v, "non-exhaustive visitor!"); + }, + myValue); + return result; +} + +bool YesNoNumber::parse(const std::string &value) +{ + const auto yesNo = tryParseYesNo(value); + if (yesNo) + { + setYesNo(*yesNo); + return true; + } + auto decimal = Decimal{}; + if (decimal.parse(value)) + { + setDecimal(decimal); + return true; + } + return false; +} + +std::string toString(const YesNoNumber &value) +{ + std::stringstream ss; + toStream(ss, value); + return ss.str(); +} + +std::ostream &toStream(std::ostream &os, const YesNoNumber &value) +{ + if (value.getIsYesNo()) + { + toStream(os, value.getValueYesNo()); + } + if (value.getIsDecimal()) { - template inline constexpr bool always_false_v = false; - - YesNoNumber::YesNoNumber() - : myValue{ YesNo::yes } - { - - } - - YesNoNumber::YesNoNumber( YesNo value ) - : myValue{ value } - { - - } - - YesNoNumber::YesNoNumber( Decimal value ) - : myValue{ std::move( value ) } - { - - } - - YesNoNumber::YesNoNumber( const std::string& value ) - : YesNoNumber{} - { - parse( value ); - } - - bool YesNoNumber::getIsYesNo() const - { - return myValue.index() == 0; - } - - bool YesNoNumber::getIsDecimal() const - { - return myValue.index() == 1; - } - - void YesNoNumber::setYesNo( YesNo value ) - { - myValue.emplace( value ); - } - - void YesNoNumber::setDecimal( Decimal value ) - { - myValue.emplace( value ); - } - - YesNo YesNoNumber::getValueYesNo() const - { - auto result = YesNo::yes; - std::visit([&](auto&& arg) - { - using T = std::decay_t; - if constexpr( std::is_same_v ) - result = arg; - else if constexpr( std::is_same_v ) - result = YesNo::yes; - else - static_assert(always_false_v, "non-exhaustive visitor!"); - }, myValue); - return result; - } - - Decimal YesNoNumber::getValueDecimal() const - { - auto result = Decimal{}; - std::visit([&](auto&& arg) - { - using T = std::decay_t; - if constexpr( std::is_same_v ) - result = Decimal{}; - else if constexpr( std::is_same_v ) - result = arg; - else - static_assert(always_false_v, "non-exhaustive visitor!"); - }, myValue); - return result; - } - - bool YesNoNumber::parse( const std::string& value ) - { - const auto yesNo = tryParseYesNo( value ); - if( yesNo ) - { - setYesNo( *yesNo ); - return true; - } - auto decimal = Decimal{}; - if( decimal.parse( value ) ) - { - setDecimal( decimal ); - return true; - } - return false; - } - - std::string toString( const YesNoNumber& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - std::ostream& toStream( std::ostream& os, const YesNoNumber& value ) - { - if( value.getIsYesNo() ) - { - toStream( os, value.getValueYesNo() ); - } - if( value.getIsDecimal() ) - { - toStream( os, value.getValueDecimal() ); - } - return os; - } - - std::ostream& operator<<( std::ostream& os, const YesNoNumber& value ) - { - return toStream( os, value ); - } + toStream(os, value.getValueDecimal()); } + return os; +} + +std::ostream &operator<<(std::ostream &os, const YesNoNumber &value) +{ + return toStream(os, value); } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/YesNoNumber.h b/Sourcecode/private/mx/core/YesNoNumber.h index 36638ba62..d255ff23f 100644 --- a/Sourcecode/private/mx/core/YesNoNumber.h +++ b/Sourcecode/private/mx/core/YesNoNumber.h @@ -13,31 +13,31 @@ namespace mx { - namespace core - { - /// The yes-no-number type is used for attributes that can be either boolean or numeric - /// values. - class YesNoNumber - { - public: - explicit YesNoNumber(); - explicit YesNoNumber( YesNo value ); - explicit YesNoNumber( Decimal value ); - explicit YesNoNumber( const std::string& value ); - bool getIsYesNo() const; - bool getIsDecimal() const; - void setYesNo( YesNo value ); - void setDecimal( Decimal value ); - YesNo getValueYesNo() const; - Decimal getValueDecimal() const; - bool parse( const std::string& value ); - - private: - std::variant myValue; - }; - - std::string toString( const YesNoNumber& value ); - std::ostream& toStream( std::ostream& os, const YesNoNumber& value ); - std::ostream& operator<<( std::ostream& os, const YesNoNumber& value ); - } -} +namespace core +{ +/// The yes-no-number type is used for attributes that can be either boolean or numeric +/// values. +class YesNoNumber +{ + public: + explicit YesNoNumber(); + explicit YesNoNumber(YesNo value); + explicit YesNoNumber(Decimal value); + explicit YesNoNumber(const std::string &value); + bool getIsYesNo() const; + bool getIsDecimal() const; + void setYesNo(YesNo value); + void setDecimal(Decimal value); + YesNo getValueYesNo() const; + Decimal getValueDecimal() const; + bool parse(const std::string &value); + + private: + std::variant myValue; +}; + +std::string toString(const YesNoNumber &value); +std::ostream &toStream(std::ostream &os, const YesNoNumber &value); +std::ostream &operator<<(std::ostream &os, const YesNoNumber &value); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Accent.cpp b/Sourcecode/private/mx/core/elements/Accent.cpp index e46680854..47e215d73 100644 --- a/Sourcecode/private/mx/core/elements/Accent.cpp +++ b/Sourcecode/private/mx/core/elements/Accent.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Accent::Accent() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Accent::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Accent::hasContents() const { return false; } - std::ostream& Accent::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Accent::streamName( std::ostream& os ) const { os << "accent"; return os; } - std::ostream& Accent::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Accent::Accent() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Accent::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Accent::getAttributes() const - { - return myAttributes; - } +bool Accent::hasContents() const +{ + return false; +} +std::ostream &Accent::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Accent::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Accent::streamName(std::ostream &os) const +{ + os << "accent"; + return os; +} +std::ostream &Accent::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Accent::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Accent::getAttributes() const +{ + return myAttributes; +} +void Accent::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Accent::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Accent.h b/Sourcecode/private/mx/core/elements/Accent.h index ecbfea266..5ca611d22 100644 --- a/Sourcecode/private/mx/core/elements/Accent.h +++ b/Sourcecode/private/mx/core/elements/Accent.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Accent ) - - inline AccentPtr makeAccent() { return std::make_shared(); } - - class Accent : public ElementInterface - { - public: - Accent(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Accent) + +inline AccentPtr makeAccent() +{ + return std::make_shared(); } + +class Accent : public ElementInterface +{ + public: + Accent(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Accidental.cpp b/Sourcecode/private/mx/core/elements/Accidental.cpp index a95160e94..815d8dd4d 100644 --- a/Sourcecode/private/mx/core/elements/Accidental.cpp +++ b/Sourcecode/private/mx/core/elements/Accidental.cpp @@ -8,100 +8,89 @@ namespace mx { - namespace core - { - Accidental::Accidental() - :myValue( AccidentalValue::natural ) - ,myAttributes( std::make_shared() ) - {} - - - Accidental::Accidental( const AccidentalValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Accidental::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Accidental::hasContents() const - { - return true; - } - - - std::ostream& Accidental::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Accidental::streamName( std::ostream& os ) const - { - os << "accidental"; - return os; - } - - - std::ostream& Accidental::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Accidental::Accidental() : myValue(AccidentalValue::natural), myAttributes(std::make_shared()) +{ +} +Accidental::Accidental(const AccidentalValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - AccidentalAttributesPtr Accidental::getAttributes() const - { - return myAttributes; - } +bool Accidental::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Accidental::hasContents() const +{ + return true; +} - void Accidental::setAttributes( const AccidentalAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Accidental::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Accidental::streamName(std::ostream &os) const +{ + os << "accidental"; + return os; +} - AccidentalValue Accidental::getValue() const - { - return myValue; - } +std::ostream &Accidental::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +AccidentalAttributesPtr Accidental::getAttributes() const +{ + return myAttributes; +} - void Accidental::setValue( const AccidentalValue& value ) - { - myValue = value; - } +void Accidental::setAttributes(const AccidentalAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +AccidentalValue Accidental::getValue() const +{ + return myValue; +} - bool Accidental::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - if( xelement.getValue() == "double-flat" ) - { - message << "Accidental: 'double-flat' is not a valid MusicXML 'accidental' value - converting it to 'flat-flat'" << std::endl; - myValue = parseAccidentalValue( "flat-flat" ); - } - else - { - myValue = parseAccidentalValue( xelement.getValue() ); - } - MX_RETURN_IS_SUCCESS; - } +void Accidental::setValue(const AccidentalValue &value) +{ + myValue = value; +} +bool Accidental::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + if (xelement.getValue() == "double-flat") + { + message << "Accidental: 'double-flat' is not a valid MusicXML 'accidental' value - converting it to 'flat-flat'" + << std::endl; + myValue = parseAccidentalValue("flat-flat"); } + else + { + myValue = parseAccidentalValue(xelement.getValue()); + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Accidental.h b/Sourcecode/private/mx/core/elements/Accidental.h index 10fa83f95..63902dc2c 100644 --- a/Sourcecode/private/mx/core/elements/Accidental.h +++ b/Sourcecode/private/mx/core/elements/Accidental.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/AccidentalAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Accidental ) - - inline AccidentalPtr makeAccidental() { return std::make_shared(); } - inline AccidentalPtr makeAccidental( const AccidentalValue& value ) { return std::make_shared( value ); } - inline AccidentalPtr makeAccidental( AccidentalValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Accidental : public ElementInterface - { - public: - Accidental(); - Accidental( const AccidentalValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccidentalAttributesPtr getAttributes() const; - void setAttributes( const AccidentalAttributesPtr& attributes ); - AccidentalValue getValue() const; - void setValue( const AccidentalValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccidentalValue myValue; - AccidentalAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(AccidentalAttributes) +MX_FORWARD_DECLARE_ELEMENT(Accidental) + +inline AccidentalPtr makeAccidental() +{ + return std::make_shared(); +} + +inline AccidentalPtr makeAccidental(const AccidentalValue &value) +{ + return std::make_shared(value); } + +inline AccidentalPtr makeAccidental(AccidentalValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Accidental : public ElementInterface +{ + public: + Accidental(); + Accidental(const AccidentalValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + AccidentalAttributesPtr getAttributes() const; + void setAttributes(const AccidentalAttributesPtr &attributes); + AccidentalValue getValue() const; + void setValue(const AccidentalValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + AccidentalValue myValue; + AccidentalAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp b/Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp index 4aaead2a1..7ea8d68ce 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp @@ -8,106 +8,111 @@ namespace mx { - namespace core +namespace core +{ +AccidentalAttributes::AccidentalAttributes() + : cautionary(YesNo::no), editorial(YesNo::no), parentheses(YesNo::no), bracket(), size(), defaultX(), defaultY(), + relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), hasCautionary(false), hasEditorial(false), hasParentheses(false), + hasBracket(false), hasSize(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false) +{ +} + +bool AccidentalAttributes::hasValues() const +{ + return hasCautionary || hasEditorial || hasParentheses || hasBracket || hasSize || hasDefaultX || hasDefaultY || + hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight; +} + +std::ostream &AccidentalAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - AccidentalAttributes::AccidentalAttributes() - :cautionary( YesNo::no ) - ,editorial( YesNo::no ) - ,parentheses( YesNo::no ) - ,bracket() - ,size() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasCautionary( false ) - ,hasEditorial( false ) - ,hasParentheses( false ) - ,hasBracket( false ) - ,hasSize( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, cautionary, "cautionary", hasCautionary); + streamAttribute(os, editorial, "editorial", hasEditorial); + streamAttribute(os, parentheses, "parentheses", hasParentheses); + streamAttribute(os, bracket, "bracket", hasBracket); + streamAttribute(os, size, "size", hasSize); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} +bool AccidentalAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "AccidentalAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool AccidentalAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, cautionary, hasCautionary, "cautionary", &parseYesNo)) { - return hasCautionary || - hasEditorial || - hasParentheses || - hasBracket || - hasSize || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& AccidentalAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, editorial, hasEditorial, "editorial", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, cautionary, "cautionary", hasCautionary ); - streamAttribute( os, editorial, "editorial", hasEditorial ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - streamAttribute( os, bracket, "bracket", hasBracket ); - streamAttribute( os, size, "size", hasSize ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool AccidentalAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo)) { - const char* const className = "AccidentalAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, cautionary, hasCautionary, "cautionary", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, editorial, hasEditorial, "editorial", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalAttributes.h b/Sourcecode/private/mx/core/elements/AccidentalAttributes.h index 03a3d8fed..88071b678 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalAttributes.h +++ b/Sourcecode/private/mx/core/elements/AccidentalAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,46 +17,46 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(AccidentalAttributes) - struct AccidentalAttributes : public AttributesInterface - { - public: - AccidentalAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo cautionary; - YesNo editorial; - YesNo parentheses; - YesNo bracket; - SymbolSize size; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasCautionary; - bool hasEditorial; - bool hasParentheses; - bool hasBracket; - bool hasSize; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct AccidentalAttributes : public AttributesInterface +{ + public: + AccidentalAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo cautionary; + YesNo editorial; + YesNo parentheses; + YesNo bracket; + SymbolSize size; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasCautionary; + bool hasEditorial; + bool hasParentheses; + bool hasBracket; + bool hasSize; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalMark.cpp b/Sourcecode/private/mx/core/elements/AccidentalMark.cpp index f3dba5a7d..1bc602d26 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalMark.cpp +++ b/Sourcecode/private/mx/core/elements/AccidentalMark.cpp @@ -8,92 +8,81 @@ namespace mx { - namespace core - { - AccidentalMark::AccidentalMark() - :myValue( AccidentalValue::natural ) - ,myAttributes( std::make_shared() ) - {} - - - AccidentalMark::AccidentalMark( const AccidentalValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool AccidentalMark::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool AccidentalMark::hasContents() const - { - return true; - } - - - std::ostream& AccidentalMark::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& AccidentalMark::streamName( std::ostream& os ) const - { - os << "accidental-mark"; - return os; - } - - - std::ostream& AccidentalMark::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +AccidentalMark::AccidentalMark() + : myValue(AccidentalValue::natural), myAttributes(std::make_shared()) +{ +} +AccidentalMark::AccidentalMark(const AccidentalValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - AccidentalMarkAttributesPtr AccidentalMark::getAttributes() const - { - return myAttributes; - } +bool AccidentalMark::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool AccidentalMark::hasContents() const +{ + return true; +} - void AccidentalMark::setAttributes( const AccidentalMarkAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &AccidentalMark::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &AccidentalMark::streamName(std::ostream &os) const +{ + os << "accidental-mark"; + return os; +} - AccidentalValue AccidentalMark::getValue() const - { - return myValue; - } +std::ostream &AccidentalMark::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +AccidentalMarkAttributesPtr AccidentalMark::getAttributes() const +{ + return myAttributes; +} - void AccidentalMark::setValue( const AccidentalValue& value ) - { - myValue = value; - } +void AccidentalMark::setAttributes(const AccidentalMarkAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +AccidentalValue AccidentalMark::getValue() const +{ + return myValue; +} - bool AccidentalMark::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseAccidentalValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void AccidentalMark::setValue(const AccidentalValue &value) +{ + myValue = value; +} - } +bool AccidentalMark::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseAccidentalValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalMark.h b/Sourcecode/private/mx/core/elements/AccidentalMark.h index 3ab55ba07..c0bff3f5f 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalMark.h +++ b/Sourcecode/private/mx/core/elements/AccidentalMark.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/AccidentalMarkAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalMarkAttributes ) - MX_FORWARD_DECLARE_ELEMENT( AccidentalMark ) - - inline AccidentalMarkPtr makeAccidentalMark() { return std::make_shared(); } - inline AccidentalMarkPtr makeAccidentalMark( const AccidentalValue& value ) { return std::make_shared( value ); } - inline AccidentalMarkPtr makeAccidentalMark( AccidentalValue&& value ) { return std::make_shared( std::move( value ) ); } - - class AccidentalMark : public ElementInterface - { - public: - AccidentalMark(); - AccidentalMark( const AccidentalValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccidentalMarkAttributesPtr getAttributes() const; - void setAttributes( const AccidentalMarkAttributesPtr& attributes ); - AccidentalValue getValue() const; - void setValue( const AccidentalValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccidentalValue myValue; - AccidentalMarkAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(AccidentalMarkAttributes) +MX_FORWARD_DECLARE_ELEMENT(AccidentalMark) + +inline AccidentalMarkPtr makeAccidentalMark() +{ + return std::make_shared(); +} + +inline AccidentalMarkPtr makeAccidentalMark(const AccidentalValue &value) +{ + return std::make_shared(value); } + +inline AccidentalMarkPtr makeAccidentalMark(AccidentalValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class AccidentalMark : public ElementInterface +{ + public: + AccidentalMark(); + AccidentalMark(const AccidentalValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + AccidentalMarkAttributesPtr getAttributes() const; + void setAttributes(const AccidentalMarkAttributesPtr &attributes); + AccidentalValue getValue() const; + void setValue(const AccidentalValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + AccidentalValue myValue; + AccidentalMarkAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp b/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp index 0798ca65f..dda6ddd51 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +AccidentalMarkAttributes::AccidentalMarkAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), placement(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool AccidentalMarkAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &AccidentalMarkAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - AccidentalMarkAttributes::AccidentalMarkAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool AccidentalMarkAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "AccidentalMarkAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool AccidentalMarkAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& AccidentalMarkAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool AccidentalMarkAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "AccidentalMarkAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h b/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h index 37d8b941f..43fda2a57 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h +++ b/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalMarkAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(AccidentalMarkAttributes) - struct AccidentalMarkAttributes : public AttributesInterface - { - public: - AccidentalMarkAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct AccidentalMarkAttributes : public AttributesInterface +{ + public: + AccidentalMarkAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalText.cpp b/Sourcecode/private/mx/core/elements/AccidentalText.cpp index acbb46bbe..773d686ff 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalText.cpp +++ b/Sourcecode/private/mx/core/elements/AccidentalText.cpp @@ -8,92 +8,81 @@ namespace mx { - namespace core - { - AccidentalText::AccidentalText() - :myValue( AccidentalValue::natural ) - ,myAttributes( std::make_shared() ) - {} - - - AccidentalText::AccidentalText( const AccidentalValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool AccidentalText::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool AccidentalText::hasContents() const - { - return true; - } - - - std::ostream& AccidentalText::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& AccidentalText::streamName( std::ostream& os ) const - { - os << "accidental-text"; - return os; - } - - - std::ostream& AccidentalText::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +AccidentalText::AccidentalText() + : myValue(AccidentalValue::natural), myAttributes(std::make_shared()) +{ +} +AccidentalText::AccidentalText(const AccidentalValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - AccidentalTextAttributesPtr AccidentalText::getAttributes() const - { - return myAttributes; - } +bool AccidentalText::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool AccidentalText::hasContents() const +{ + return true; +} - void AccidentalText::setAttributes( const AccidentalTextAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &AccidentalText::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &AccidentalText::streamName(std::ostream &os) const +{ + os << "accidental-text"; + return os; +} - AccidentalValue AccidentalText::getValue() const - { - return myValue; - } +std::ostream &AccidentalText::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +AccidentalTextAttributesPtr AccidentalText::getAttributes() const +{ + return myAttributes; +} - void AccidentalText::setValue( const AccidentalValue& value ) - { - myValue = value; - } +void AccidentalText::setAttributes(const AccidentalTextAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +AccidentalValue AccidentalText::getValue() const +{ + return myValue; +} - bool AccidentalText::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseAccidentalValue( xelement.getValue() ); - return isSuccess; - } +void AccidentalText::setValue(const AccidentalValue &value) +{ + myValue = value; +} - } +bool AccidentalText::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseAccidentalValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalText.h b/Sourcecode/private/mx/core/elements/AccidentalText.h index f46748c68..c61e40f3e 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalText.h +++ b/Sourcecode/private/mx/core/elements/AccidentalText.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/AccidentalTextAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalTextAttributes ) - MX_FORWARD_DECLARE_ELEMENT( AccidentalText ) - - inline AccidentalTextPtr makeAccidentalText() { return std::make_shared(); } - inline AccidentalTextPtr makeAccidentalText( const AccidentalValue& value ) { return std::make_shared( value ); } - inline AccidentalTextPtr makeAccidentalText( AccidentalValue&& value ) { return std::make_shared( std::move( value ) ); } - - class AccidentalText : public ElementInterface - { - public: - AccidentalText(); - AccidentalText( const AccidentalValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccidentalTextAttributesPtr getAttributes() const; - void setAttributes( const AccidentalTextAttributesPtr& attributes ); - AccidentalValue getValue() const; - void setValue( const AccidentalValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccidentalValue myValue; - AccidentalTextAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(AccidentalTextAttributes) +MX_FORWARD_DECLARE_ELEMENT(AccidentalText) + +inline AccidentalTextPtr makeAccidentalText() +{ + return std::make_shared(); +} + +inline AccidentalTextPtr makeAccidentalText(const AccidentalValue &value) +{ + return std::make_shared(value); } + +inline AccidentalTextPtr makeAccidentalText(AccidentalValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class AccidentalText : public ElementInterface +{ + public: + AccidentalText(); + AccidentalText(const AccidentalValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + AccidentalTextAttributesPtr getAttributes() const; + void setAttributes(const AccidentalTextAttributesPtr &attributes); + AccidentalValue getValue() const; + void setValue(const AccidentalValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + AccidentalValue myValue; + AccidentalTextAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp b/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp index a5d79fa34..74f8c9ea1 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp @@ -8,138 +8,154 @@ namespace mx { - namespace core - { - AccidentalTextAttributes::AccidentalTextAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( "it" ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - +namespace core +{ +AccidentalTextAttributes::AccidentalTextAttributes() + : justify(LeftCenterRight::center), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), halign(), + underline(), overline(), lineThrough(), rotation(), letterSpacing(), lineHeight(), lang("it"), + space(XmlSpace::default_), enclosure(EnclosureShape::rectangle), hasJustify(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasHalign(false), hasUnderline(false), hasOverline(false), + hasLineThrough(false), hasRotation(false), hasLetterSpacing(false), hasLineHeight(false), hasLang(false), + hasSpace(false), hasEnclosure(false) +{ +} - bool AccidentalTextAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } +bool AccidentalTextAttributes::hasValues() const +{ + return hasJustify || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight || hasHalign || hasUnderline || hasOverline || hasLineThrough || hasRotation || + hasLetterSpacing || hasLineHeight || hasLang || hasSpace || hasEnclosure; +} +std::ostream &AccidentalTextAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, justify, "justify", hasJustify); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, underline, "underline", hasUnderline); + streamAttribute(os, overline, "overline", hasOverline); + streamAttribute(os, lineThrough, "line-through", hasLineThrough); + streamAttribute(os, rotation, "rotation", hasRotation); + streamAttribute(os, letterSpacing, "letter-spacing", hasLetterSpacing); + streamAttribute(os, lineHeight, "line-height", hasLineHeight); + streamAttribute(os, lang, "xml:lang", hasLang); + streamAttribute(os, space, "xml:space", hasSpace); + streamAttribute(os, enclosure, "enclosure", hasEnclosure); + } + return os; +} - std::ostream& AccidentalTextAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } +bool AccidentalTextAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "AccidentalTextAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool AccidentalTextAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "AccidentalTextAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - return isSuccess; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, underline, hasUnderline, "underline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, overline, hasOverline, "overline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, rotation, hasRotation, "rotation")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "xml:lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", + &parseEnclosureShape)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h b/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h index eb8dd5c92..596d8778d 100644 --- a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h +++ b/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/NumberOrNormal.h" #include "mx/core/XmlLang.h" @@ -20,58 +20,58 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalTextAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(AccidentalTextAttributes) - struct AccidentalTextAttributes : public AttributesInterface - { - public: - AccidentalTextAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; +struct AccidentalTextAttributes : public AttributesInterface +{ + public: + AccidentalTextAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + LeftCenterRight justify; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + NumberOfLines underline; + NumberOfLines overline; + NumberOfLines lineThrough; + RotationDegrees rotation; + NumberOrNormal letterSpacing; + NumberOrNormal lineHeight; + XmlLang lang; + XmlSpace space; + EnclosureShape enclosure; + bool hasJustify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; + bool hasUnderline; + bool hasOverline; + bool hasLineThrough; + bool hasRotation; + bool hasLetterSpacing; + bool hasLineHeight; + bool hasLang; + bool hasSpace; + bool hasEnclosure; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Accord.cpp b/Sourcecode/private/mx/core/elements/Accord.cpp index ceb0adbe7..0269b87dc 100644 --- a/Sourcecode/private/mx/core/elements/Accord.cpp +++ b/Sourcecode/private/mx/core/elements/Accord.cpp @@ -11,156 +11,147 @@ namespace mx { - namespace core - { - Accord::Accord() - :myAttributes( std::make_shared() ) - ,myTuningStep( makeTuningStep() ) - ,myTuningAlter( makeTuningAlter() ) - ,myHasTuningAlter( false ) - ,myTuningOctave( makeTuningOctave() ) - {} - - - bool Accord::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Accord::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Accord::streamName( std::ostream& os ) const - { - os << "accord"; - return os; - } - - - bool Accord::hasContents() const - { - return true; - } - - - std::ostream& Accord::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myTuningStep->toStream( os, indentLevel+1 ); - if ( myHasTuningAlter ) - { - os << std::endl; - myTuningAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - myTuningOctave->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - +namespace core +{ +Accord::Accord() + : myAttributes(std::make_shared()), myTuningStep(makeTuningStep()), + myTuningAlter(makeTuningAlter()), myHasTuningAlter(false), myTuningOctave(makeTuningOctave()) +{ +} - AccordAttributesPtr Accord::getAttributes() const - { - return myAttributes; - } +bool Accord::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Accord::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void Accord::setAttributes( const AccordAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Accord::streamName(std::ostream &os) const +{ + os << "accord"; + return os; +} +bool Accord::hasContents() const +{ + return true; +} - TuningStepPtr Accord::getTuningStep() const - { - return myTuningStep; - } +std::ostream &Accord::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myTuningStep->toStream(os, indentLevel + 1); + if (myHasTuningAlter) + { + os << std::endl; + myTuningAlter->toStream(os, indentLevel + 1); + } + os << std::endl; + myTuningOctave->toStream(os, indentLevel + 1); + os << std::endl; + return os; +} +AccordAttributesPtr Accord::getAttributes() const +{ + return myAttributes; +} - void Accord::setTuningStep( const TuningStepPtr& value ) - { - if( value ) - { - myTuningStep = value; - } - } +void Accord::setAttributes(const AccordAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +TuningStepPtr Accord::getTuningStep() const +{ + return myTuningStep; +} - TuningAlterPtr Accord::getTuningAlter() const - { - return myTuningAlter; - } +void Accord::setTuningStep(const TuningStepPtr &value) +{ + if (value) + { + myTuningStep = value; + } +} +TuningAlterPtr Accord::getTuningAlter() const +{ + return myTuningAlter; +} - void Accord::setTuningAlter( const TuningAlterPtr& value ) - { - if( value ) - { - myTuningAlter = value; - } - } +void Accord::setTuningAlter(const TuningAlterPtr &value) +{ + if (value) + { + myTuningAlter = value; + } +} +bool Accord::getHasTuningAlter() const +{ + return myHasTuningAlter; +} - bool Accord::getHasTuningAlter() const - { - return myHasTuningAlter; - } +void Accord::setHasTuningAlter(const bool value) +{ + myHasTuningAlter = value; +} +TuningOctavePtr Accord::getTuningOctave() const +{ + return myTuningOctave; +} - void Accord::setHasTuningAlter( const bool value ) - { - myHasTuningAlter = value; - } +void Accord::setTuningOctave(const TuningOctavePtr &value) +{ + if (value) + { + myTuningOctave = value; + } +} +bool Accord::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isTuningStepFound = false; + bool isTuningOctaveFound = false; - TuningOctavePtr Accord::getTuningOctave() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myTuningStep, isTuningStepFound)) { - return myTuningOctave; + continue; } - - - void Accord::setTuningOctave( const TuningOctavePtr& value ) + if (importElement(message, *it, isSuccess, *myTuningAlter, myHasTuningAlter)) { - if( value ) - { - myTuningOctave = value; - } + continue; } - - - bool Accord::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myTuningOctave, isTuningOctaveFound)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isTuningStepFound = false; - bool isTuningOctaveFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myTuningStep, isTuningStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTuningAlter, myHasTuningAlter ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTuningOctave, isTuningOctaveFound ) ) { continue; } - } - - if( !isTuningStepFound ) - { - message << "Accord: '" << myTuningStep->getElementName() << "' is required but was not found" << std::endl; - } - if( !isTuningOctaveFound ) - { - message << "Accord: '" << myTuningOctave->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTuningStepFound) + { + message << "Accord: '" << myTuningStep->getElementName() << "' is required but was not found" << std::endl; } + if (!isTuningOctaveFound) + { + message << "Accord: '" << myTuningOctave->getElementName() << "' is required but was not found" << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Accord.h b/Sourcecode/private/mx/core/elements/Accord.h index fe5fdb4f3..b31b0b58b 100644 --- a/Sourcecode/private/mx/core/elements/Accord.h +++ b/Sourcecode/private/mx/core/elements/Accord.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/AccordAttributes.h" #include @@ -14,53 +14,56 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( AccordAttributes ) - MX_FORWARD_DECLARE_ELEMENT( TuningAlter ) - MX_FORWARD_DECLARE_ELEMENT( TuningOctave ) - MX_FORWARD_DECLARE_ELEMENT( TuningStep ) - MX_FORWARD_DECLARE_ELEMENT( Accord ) +MX_FORWARD_DECLARE_ATTRIBUTES(AccordAttributes) +MX_FORWARD_DECLARE_ELEMENT(TuningAlter) +MX_FORWARD_DECLARE_ELEMENT(TuningOctave) +MX_FORWARD_DECLARE_ELEMENT(TuningStep) +MX_FORWARD_DECLARE_ELEMENT(Accord) - inline AccordPtr makeAccord() { return std::make_shared(); } +inline AccordPtr makeAccord() +{ + return std::make_shared(); +} - class Accord : public ElementInterface - { - public: - Accord(); +class Accord : public ElementInterface +{ + public: + Accord(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccordAttributesPtr getAttributes() const; - void setAttributes( const AccordAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + AccordAttributesPtr getAttributes() const; + void setAttributes(const AccordAttributesPtr &value); - /* _________ TuningStep minOccurs = 1, maxOccurs = 1 _________ */ - TuningStepPtr getTuningStep() const; - void setTuningStep( const TuningStepPtr& value ); + /* _________ TuningStep minOccurs = 1, maxOccurs = 1 _________ */ + TuningStepPtr getTuningStep() const; + void setTuningStep(const TuningStepPtr &value); - /* _________ TuningAlter minOccurs = 0, maxOccurs = 1 _________ */ - TuningAlterPtr getTuningAlter() const; - void setTuningAlter( const TuningAlterPtr& value ); - bool getHasTuningAlter() const; - void setHasTuningAlter( const bool value ); + /* _________ TuningAlter minOccurs = 0, maxOccurs = 1 _________ */ + TuningAlterPtr getTuningAlter() const; + void setTuningAlter(const TuningAlterPtr &value); + bool getHasTuningAlter() const; + void setHasTuningAlter(const bool value); - /* _________ TuningOctave minOccurs = 1, maxOccurs = 1 _________ */ - TuningOctavePtr getTuningOctave() const; - void setTuningOctave( const TuningOctavePtr& value ); + /* _________ TuningOctave minOccurs = 1, maxOccurs = 1 _________ */ + TuningOctavePtr getTuningOctave() const; + void setTuningOctave(const TuningOctavePtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - AccordAttributesPtr myAttributes; - TuningStepPtr myTuningStep; - TuningAlterPtr myTuningAlter; - bool myHasTuningAlter; - TuningOctavePtr myTuningOctave; - }; - } -} + private: + AccordAttributesPtr myAttributes; + TuningStepPtr myTuningStep; + TuningAlterPtr myTuningAlter; + bool myHasTuningAlter; + TuningOctavePtr myTuningOctave; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordAttributes.cpp b/Sourcecode/private/mx/core/elements/AccordAttributes.cpp index 21b7be2c0..3ebc2bebc 100644 --- a/Sourcecode/private/mx/core/elements/AccordAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/AccordAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - AccordAttributes::AccordAttributes() - :string() - ,hasString( false ) - {} - +namespace core +{ +AccordAttributes::AccordAttributes() : string(), hasString(false) +{ +} - bool AccordAttributes::hasValues() const - { - return hasString; - } +bool AccordAttributes::hasValues() const +{ + return hasString; +} +std::ostream &AccordAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, string, "string", hasString); + } + return os; +} - std::ostream& AccordAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, string, "string", hasString ); - } - return os; - } +bool AccordAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "AccordAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool AccordAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, string, hasString, "string")) { - const char* const className = "AccordAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, string, hasString, "string" ) ) { continue; } - } - - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordAttributes.h b/Sourcecode/private/mx/core/elements/AccordAttributes.h index 0049be3d9..ff0e32ca0 100644 --- a/Sourcecode/private/mx/core/elements/AccordAttributes.h +++ b/Sourcecode/private/mx/core/elements/AccordAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( AccordAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(AccordAttributes) - struct AccordAttributes : public AttributesInterface - { - public: - AccordAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StringNumber string; - bool hasString; +struct AccordAttributes : public AttributesInterface +{ + public: + AccordAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StringNumber string; + bool hasString; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionHigh.cpp b/Sourcecode/private/mx/core/elements/AccordionHigh.cpp index b7ce2f02b..d93f99cf7 100644 --- a/Sourcecode/private/mx/core/elements/AccordionHigh.cpp +++ b/Sourcecode/private/mx/core/elements/AccordionHigh.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - AccordionHigh::AccordionHigh() : ElementInterface() {} - +namespace core +{ +AccordionHigh::AccordionHigh() : ElementInterface() +{ +} - bool AccordionHigh::hasAttributes() const { return false; } +bool AccordionHigh::hasAttributes() const +{ + return false; +} +bool AccordionHigh::hasContents() const +{ + return false; +} - bool AccordionHigh::hasContents() const { return false; } - std::ostream& AccordionHigh::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& AccordionHigh::streamName( std::ostream& os ) const { os << "accordion-high"; return os; } - std::ostream& AccordionHigh::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &AccordionHigh::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &AccordionHigh::streamName(std::ostream &os) const +{ + os << "accordion-high"; + return os; +} - bool AccordionHigh::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &AccordionHigh::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool AccordionHigh::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionHigh.h b/Sourcecode/private/mx/core/elements/AccordionHigh.h index 13c0dc220..8c6a37cfc 100644 --- a/Sourcecode/private/mx/core/elements/AccordionHigh.h +++ b/Sourcecode/private/mx/core/elements/AccordionHigh.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccordionHigh ) - - inline AccordionHighPtr makeAccordionHigh() { return std::make_shared(); } - - class AccordionHigh : public ElementInterface - { - public: - AccordionHigh(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(AccordionHigh) + +inline AccordionHighPtr makeAccordionHigh() +{ + return std::make_shared(); } + +class AccordionHigh : public ElementInterface +{ + public: + AccordionHigh(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionLow.cpp b/Sourcecode/private/mx/core/elements/AccordionLow.cpp index 51b307f2c..419a8f05c 100644 --- a/Sourcecode/private/mx/core/elements/AccordionLow.cpp +++ b/Sourcecode/private/mx/core/elements/AccordionLow.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - AccordionLow::AccordionLow() : ElementInterface() {} - +namespace core +{ +AccordionLow::AccordionLow() : ElementInterface() +{ +} - bool AccordionLow::hasAttributes() const { return false; } +bool AccordionLow::hasAttributes() const +{ + return false; +} +bool AccordionLow::hasContents() const +{ + return false; +} - bool AccordionLow::hasContents() const { return false; } - std::ostream& AccordionLow::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& AccordionLow::streamName( std::ostream& os ) const { os << "accordion-low"; return os; } - std::ostream& AccordionLow::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &AccordionLow::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &AccordionLow::streamName(std::ostream &os) const +{ + os << "accordion-low"; + return os; +} - bool AccordionLow::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &AccordionLow::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool AccordionLow::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionLow.h b/Sourcecode/private/mx/core/elements/AccordionLow.h index d5a2330aa..a96189584 100644 --- a/Sourcecode/private/mx/core/elements/AccordionLow.h +++ b/Sourcecode/private/mx/core/elements/AccordionLow.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccordionLow ) - - inline AccordionLowPtr makeAccordionLow() { return std::make_shared(); } - - class AccordionLow : public ElementInterface - { - public: - AccordionLow(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(AccordionLow) + +inline AccordionLowPtr makeAccordionLow() +{ + return std::make_shared(); } + +class AccordionLow : public ElementInterface +{ + public: + AccordionLow(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionMiddle.cpp b/Sourcecode/private/mx/core/elements/AccordionMiddle.cpp index 60823af36..8181a31bb 100644 --- a/Sourcecode/private/mx/core/elements/AccordionMiddle.cpp +++ b/Sourcecode/private/mx/core/elements/AccordionMiddle.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - AccordionMiddle::AccordionMiddle() - :myValue() - {} - - - AccordionMiddle::AccordionMiddle( const AccordionMiddleValue& value ) - :myValue( value ) - {} - - - bool AccordionMiddle::hasAttributes() const - { - return false; - } - - - bool AccordionMiddle::hasContents() const - { - return true; - } - - - std::ostream& AccordionMiddle::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& AccordionMiddle::streamName( std::ostream& os ) const - { - os << "accordion-middle"; - return os; - } +namespace core +{ +AccordionMiddle::AccordionMiddle() : myValue() +{ +} +AccordionMiddle::AccordionMiddle(const AccordionMiddleValue &value) : myValue(value) +{ +} - std::ostream& AccordionMiddle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool AccordionMiddle::hasAttributes() const +{ + return false; +} +bool AccordionMiddle::hasContents() const +{ + return true; +} - AccordionMiddleValue AccordionMiddle::getValue() const - { - return myValue; - } +std::ostream &AccordionMiddle::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &AccordionMiddle::streamName(std::ostream &os) const +{ + os << "accordion-middle"; + return os; +} - void AccordionMiddle::setValue( const AccordionMiddleValue& value ) - { - myValue = value; - } +std::ostream &AccordionMiddle::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +AccordionMiddleValue AccordionMiddle::getValue() const +{ + return myValue; +} - bool AccordionMiddle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void AccordionMiddle::setValue(const AccordionMiddleValue &value) +{ + myValue = value; +} - } +bool AccordionMiddle::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionMiddle.h b/Sourcecode/private/mx/core/elements/AccordionMiddle.h index 194ef3b0d..02b271c10 100644 --- a/Sourcecode/private/mx/core/elements/AccordionMiddle.h +++ b/Sourcecode/private/mx/core/elements/AccordionMiddle.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccordionMiddle ) - - inline AccordionMiddlePtr makeAccordionMiddle() { return std::make_shared(); } - inline AccordionMiddlePtr makeAccordionMiddle( const AccordionMiddleValue& value ) { return std::make_shared( value ); } - inline AccordionMiddlePtr makeAccordionMiddle( AccordionMiddleValue&& value ) { return std::make_shared( std::move( value ) ); } - - class AccordionMiddle : public ElementInterface - { - public: - AccordionMiddle(); - AccordionMiddle( const AccordionMiddleValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccordionMiddleValue getValue() const; - void setValue( const AccordionMiddleValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccordionMiddleValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(AccordionMiddle) + +inline AccordionMiddlePtr makeAccordionMiddle() +{ + return std::make_shared(); +} + +inline AccordionMiddlePtr makeAccordionMiddle(const AccordionMiddleValue &value) +{ + return std::make_shared(value); } + +inline AccordionMiddlePtr makeAccordionMiddle(AccordionMiddleValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class AccordionMiddle : public ElementInterface +{ + public: + AccordionMiddle(); + AccordionMiddle(const AccordionMiddleValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + AccordionMiddleValue getValue() const; + void setValue(const AccordionMiddleValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + AccordionMiddleValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistration.cpp b/Sourcecode/private/mx/core/elements/AccordionRegistration.cpp index bea612c69..1813ec063 100644 --- a/Sourcecode/private/mx/core/elements/AccordionRegistration.cpp +++ b/Sourcecode/private/mx/core/elements/AccordionRegistration.cpp @@ -11,181 +11,167 @@ namespace mx { - namespace core - { - AccordionRegistration::AccordionRegistration() - :myAttributes( std::make_shared() ) - ,myAccordionHigh( makeAccordionHigh() ) - ,myHasAccordionHigh( false ) - ,myAccordionMiddle( makeAccordionMiddle() ) - ,myHasAccordionMiddle( false ) - ,myAccordionLow( makeAccordionLow() ) - ,myHasAccordionLow( false ) - {} - - - bool AccordionRegistration::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& AccordionRegistration::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& AccordionRegistration::streamName( std::ostream& os ) const - { - os << "accordion-registration"; - return os; - } - - - bool AccordionRegistration::hasContents() const - { - return myHasAccordionHigh || myHasAccordionMiddle || myHasAccordionLow; - } - - - std::ostream& AccordionRegistration::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = !hasContents(); - if ( myHasAccordionHigh ) - { - os << std::endl; - myAccordionHigh->toStream( os, indentLevel+1 ); - } - if ( myHasAccordionMiddle ) - { - os << std::endl; - myAccordionMiddle->toStream( os, indentLevel+1 ); - } - if ( myHasAccordionLow ) - { - os << std::endl; - myAccordionLow->toStream( os, indentLevel+1 ); - } - if ( hasContents() ) - { - os << std::endl; - } - return os; - } - - - AccordionRegistrationAttributesPtr AccordionRegistration::getAttributes() const - { - return myAttributes; - } - - - void AccordionRegistration::setAttributes( const AccordionRegistrationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - +namespace core +{ +AccordionRegistration::AccordionRegistration() + : myAttributes(std::make_shared()), myAccordionHigh(makeAccordionHigh()), + myHasAccordionHigh(false), myAccordionMiddle(makeAccordionMiddle()), myHasAccordionMiddle(false), + myAccordionLow(makeAccordionLow()), myHasAccordionLow(false) +{ +} - AccordionHighPtr AccordionRegistration::getAccordionHigh() const - { - return myAccordionHigh; - } +bool AccordionRegistration::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &AccordionRegistration::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void AccordionRegistration::setAccordionHigh( const AccordionHighPtr& value ) - { - if( value ) - { - myAccordionHigh = value; - } - } +std::ostream &AccordionRegistration::streamName(std::ostream &os) const +{ + os << "accordion-registration"; + return os; +} +bool AccordionRegistration::hasContents() const +{ + return myHasAccordionHigh || myHasAccordionMiddle || myHasAccordionLow; +} - bool AccordionRegistration::getHasAccordionHigh() const - { - return myHasAccordionHigh; - } +std::ostream &AccordionRegistration::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = !hasContents(); + if (myHasAccordionHigh) + { + os << std::endl; + myAccordionHigh->toStream(os, indentLevel + 1); + } + if (myHasAccordionMiddle) + { + os << std::endl; + myAccordionMiddle->toStream(os, indentLevel + 1); + } + if (myHasAccordionLow) + { + os << std::endl; + myAccordionLow->toStream(os, indentLevel + 1); + } + if (hasContents()) + { + os << std::endl; + } + return os; +} +AccordionRegistrationAttributesPtr AccordionRegistration::getAttributes() const +{ + return myAttributes; +} - void AccordionRegistration::setHasAccordionHigh( const bool value ) - { - myHasAccordionHigh = value; - } +void AccordionRegistration::setAttributes(const AccordionRegistrationAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +AccordionHighPtr AccordionRegistration::getAccordionHigh() const +{ + return myAccordionHigh; +} - AccordionMiddlePtr AccordionRegistration::getAccordionMiddle() const - { - return myAccordionMiddle; - } +void AccordionRegistration::setAccordionHigh(const AccordionHighPtr &value) +{ + if (value) + { + myAccordionHigh = value; + } +} +bool AccordionRegistration::getHasAccordionHigh() const +{ + return myHasAccordionHigh; +} - void AccordionRegistration::setAccordionMiddle( const AccordionMiddlePtr& value ) - { - if( value ) - { - myAccordionMiddle = value; - } - } +void AccordionRegistration::setHasAccordionHigh(const bool value) +{ + myHasAccordionHigh = value; +} +AccordionMiddlePtr AccordionRegistration::getAccordionMiddle() const +{ + return myAccordionMiddle; +} - bool AccordionRegistration::getHasAccordionMiddle() const - { - return myHasAccordionMiddle; - } +void AccordionRegistration::setAccordionMiddle(const AccordionMiddlePtr &value) +{ + if (value) + { + myAccordionMiddle = value; + } +} +bool AccordionRegistration::getHasAccordionMiddle() const +{ + return myHasAccordionMiddle; +} - void AccordionRegistration::setHasAccordionMiddle( const bool value ) - { - myHasAccordionMiddle = value; - } +void AccordionRegistration::setHasAccordionMiddle(const bool value) +{ + myHasAccordionMiddle = value; +} +AccordionLowPtr AccordionRegistration::getAccordionLow() const +{ + return myAccordionLow; +} - AccordionLowPtr AccordionRegistration::getAccordionLow() const - { - return myAccordionLow; - } +void AccordionRegistration::setAccordionLow(const AccordionLowPtr &value) +{ + if (value) + { + myAccordionLow = value; + } +} +bool AccordionRegistration::getHasAccordionLow() const +{ + return myHasAccordionLow; +} - void AccordionRegistration::setAccordionLow( const AccordionLowPtr& value ) - { - if( value ) - { - myAccordionLow = value; - } - } +void AccordionRegistration::setHasAccordionLow(const bool value) +{ + myHasAccordionLow = value; +} +bool AccordionRegistration::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - bool AccordionRegistration::getHasAccordionLow() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myAccordionHigh, myHasAccordionHigh)) { - return myHasAccordionLow; + continue; } - - - void AccordionRegistration::setHasAccordionLow( const bool value ) + if (importElement(message, *it, isSuccess, *myAccordionMiddle, myHasAccordionMiddle)) { - myHasAccordionLow = value; + continue; } - - - bool AccordionRegistration::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myAccordionLow, myHasAccordionLow)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myAccordionHigh, myHasAccordionHigh ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myAccordionMiddle, myHasAccordionMiddle ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myAccordionLow, myHasAccordionLow ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistration.h b/Sourcecode/private/mx/core/elements/AccordionRegistration.h index a0d81d436..ef2453267 100644 --- a/Sourcecode/private/mx/core/elements/AccordionRegistration.h +++ b/Sourcecode/private/mx/core/elements/AccordionRegistration.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/AccordionRegistrationAttributes.h" #include @@ -14,59 +14,62 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( AccordionRegistrationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( AccordionHigh ) - MX_FORWARD_DECLARE_ELEMENT( AccordionLow ) - MX_FORWARD_DECLARE_ELEMENT( AccordionMiddle ) - MX_FORWARD_DECLARE_ELEMENT( AccordionRegistration ) +MX_FORWARD_DECLARE_ATTRIBUTES(AccordionRegistrationAttributes) +MX_FORWARD_DECLARE_ELEMENT(AccordionHigh) +MX_FORWARD_DECLARE_ELEMENT(AccordionLow) +MX_FORWARD_DECLARE_ELEMENT(AccordionMiddle) +MX_FORWARD_DECLARE_ELEMENT(AccordionRegistration) - inline AccordionRegistrationPtr makeAccordionRegistration() { return std::make_shared(); } +inline AccordionRegistrationPtr makeAccordionRegistration() +{ + return std::make_shared(); +} - class AccordionRegistration : public ElementInterface - { - public: - AccordionRegistration(); +class AccordionRegistration : public ElementInterface +{ + public: + AccordionRegistration(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccordionRegistrationAttributesPtr getAttributes() const; - void setAttributes( const AccordionRegistrationAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + AccordionRegistrationAttributesPtr getAttributes() const; + void setAttributes(const AccordionRegistrationAttributesPtr &value); - /* _________ AccordionHigh minOccurs = 0, maxOccurs = 1 _________ */ - AccordionHighPtr getAccordionHigh() const; - void setAccordionHigh( const AccordionHighPtr& value ); - bool getHasAccordionHigh() const; - void setHasAccordionHigh( const bool value ); + /* _________ AccordionHigh minOccurs = 0, maxOccurs = 1 _________ */ + AccordionHighPtr getAccordionHigh() const; + void setAccordionHigh(const AccordionHighPtr &value); + bool getHasAccordionHigh() const; + void setHasAccordionHigh(const bool value); - /* _________ AccordionMiddle minOccurs = 0, maxOccurs = 1 _________ */ - AccordionMiddlePtr getAccordionMiddle() const; - void setAccordionMiddle( const AccordionMiddlePtr& value ); - bool getHasAccordionMiddle() const; - void setHasAccordionMiddle( const bool value ); + /* _________ AccordionMiddle minOccurs = 0, maxOccurs = 1 _________ */ + AccordionMiddlePtr getAccordionMiddle() const; + void setAccordionMiddle(const AccordionMiddlePtr &value); + bool getHasAccordionMiddle() const; + void setHasAccordionMiddle(const bool value); - /* _________ AccordionLow minOccurs = 0, maxOccurs = 1 _________ */ - AccordionLowPtr getAccordionLow() const; - void setAccordionLow( const AccordionLowPtr& value ); - bool getHasAccordionLow() const; - void setHasAccordionLow( const bool value ); + /* _________ AccordionLow minOccurs = 0, maxOccurs = 1 _________ */ + AccordionLowPtr getAccordionLow() const; + void setAccordionLow(const AccordionLowPtr &value); + bool getHasAccordionLow() const; + void setHasAccordionLow(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - AccordionRegistrationAttributesPtr myAttributes; - AccordionHighPtr myAccordionHigh; - bool myHasAccordionHigh; - AccordionMiddlePtr myAccordionMiddle; - bool myHasAccordionMiddle; - AccordionLowPtr myAccordionLow; - bool myHasAccordionLow; - }; - } -} + private: + AccordionRegistrationAttributesPtr myAttributes; + AccordionHighPtr myAccordionHigh; + bool myHasAccordionHigh; + AccordionMiddlePtr myAccordionMiddle; + bool myHasAccordionMiddle; + AccordionLowPtr myAccordionLow; + bool myHasAccordionLow; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp b/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp index 5e6235fdb..06be05660 100644 --- a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp @@ -8,96 +8,101 @@ namespace mx { - namespace core +namespace core +{ +AccordionRegistrationAttributes::AccordionRegistrationAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), halign(LeftCenterRight::center), + valign(Valign::baseline), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), + hasHalign(false), hasValign(false) +{ +} + +bool AccordionRegistrationAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasHalign || hasValign; +} + +std::ostream &AccordionRegistrationAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - AccordionRegistrationAttributes::AccordionRegistrationAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign( LeftCenterRight::center ) - ,valign( Valign::baseline ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, valign, "valign", hasValign); + } + return os; +} + +bool AccordionRegistrationAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "AccordionRegistrationAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool AccordionRegistrationAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign; + continue; } - - - std::ostream& AccordionRegistrationAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - } - return os; + continue; } - - - bool AccordionRegistrationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "AccordionRegistrationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, valign, hasValign, "valign", &parseValign)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h b/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h index 0bd189644..e4e52b1c7 100644 --- a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h +++ b/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,42 +18,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( AccordionRegistrationAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(AccordionRegistrationAttributes) - struct AccordionRegistrationAttributes : public AttributesInterface - { - public: - AccordionRegistrationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; +struct AccordionRegistrationAttributes : public AttributesInterface +{ + public: + AccordionRegistrationAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + LeftCenterRight halign; + Valign valign; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasHalign; + bool hasValign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ActualNotes.cpp b/Sourcecode/private/mx/core/elements/ActualNotes.cpp index a6ee4e4c5..26e7c59c2 100644 --- a/Sourcecode/private/mx/core/elements/ActualNotes.cpp +++ b/Sourcecode/private/mx/core/elements/ActualNotes.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - ActualNotes::ActualNotes() - :myValue() - {} - - - ActualNotes::ActualNotes( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool ActualNotes::hasAttributes() const - { - return false; - } - - - bool ActualNotes::hasContents() const - { - return true; - } - - - std::ostream& ActualNotes::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ActualNotes::streamName( std::ostream& os ) const - { - os << "actual-notes"; - return os; - } +namespace core +{ +ActualNotes::ActualNotes() : myValue() +{ +} +ActualNotes::ActualNotes(const NonNegativeInteger &value) : myValue(value) +{ +} - std::ostream& ActualNotes::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool ActualNotes::hasAttributes() const +{ + return false; +} +bool ActualNotes::hasContents() const +{ + return true; +} - NonNegativeInteger ActualNotes::getValue() const - { - return myValue; - } +std::ostream &ActualNotes::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &ActualNotes::streamName(std::ostream &os) const +{ + os << "actual-notes"; + return os; +} - void ActualNotes::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } +std::ostream &ActualNotes::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NonNegativeInteger ActualNotes::getValue() const +{ + return myValue; +} - bool ActualNotes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void ActualNotes::setValue(const NonNegativeInteger &value) +{ + myValue = value; +} - } +bool ActualNotes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ActualNotes.h b/Sourcecode/private/mx/core/elements/ActualNotes.h index c8e53cb2d..d3f05d6a5 100644 --- a/Sourcecode/private/mx/core/elements/ActualNotes.h +++ b/Sourcecode/private/mx/core/elements/ActualNotes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ActualNotes ) - - inline ActualNotesPtr makeActualNotes() { return std::make_shared(); } - inline ActualNotesPtr makeActualNotes( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline ActualNotesPtr makeActualNotes( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class ActualNotes : public ElementInterface - { - public: - ActualNotes(); - ActualNotes( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(ActualNotes) + +inline ActualNotesPtr makeActualNotes() +{ + return std::make_shared(); +} + +inline ActualNotesPtr makeActualNotes(const NonNegativeInteger &value) +{ + return std::make_shared(value); } + +inline ActualNotesPtr makeActualNotes(NonNegativeInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class ActualNotes : public ElementInterface +{ + public: + ActualNotes(); + ActualNotes(const NonNegativeInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NonNegativeInteger getValue() const; + void setValue(const NonNegativeInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Alter.cpp b/Sourcecode/private/mx/core/elements/Alter.cpp index 2dcf56540..3fb2b70f0 100644 --- a/Sourcecode/private/mx/core/elements/Alter.cpp +++ b/Sourcecode/private/mx/core/elements/Alter.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Alter::Alter() - :myValue() - {} - - - Alter::Alter( const Semitones& value ) - :myValue( value ) - {} - - - bool Alter::hasAttributes() const - { - return false; - } - - - bool Alter::hasContents() const - { - return true; - } - - - std::ostream& Alter::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Alter::streamName( std::ostream& os ) const - { - os << "alter"; - return os; - } +namespace core +{ +Alter::Alter() : myValue() +{ +} +Alter::Alter(const Semitones &value) : myValue(value) +{ +} - std::ostream& Alter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Alter::hasAttributes() const +{ + return false; +} +bool Alter::hasContents() const +{ + return true; +} - Semitones Alter::getValue() const - { - return myValue; - } +std::ostream &Alter::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Alter::streamName(std::ostream &os) const +{ + os << "alter"; + return os; +} - void Alter::setValue( const Semitones& value ) - { - myValue = value; - } +std::ostream &Alter::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Semitones Alter::getValue() const +{ + return myValue; +} - bool Alter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Alter::setValue(const Semitones &value) +{ + myValue = value; +} - } +bool Alter::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Alter.h b/Sourcecode/private/mx/core/elements/Alter.h index 7d171f0ca..e83e0b811 100644 --- a/Sourcecode/private/mx/core/elements/Alter.h +++ b/Sourcecode/private/mx/core/elements/Alter.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Alter ) - - inline AlterPtr makeAlter() { return std::make_shared(); } - inline AlterPtr makeAlter( const Semitones& value ) { return std::make_shared( value ); } - inline AlterPtr makeAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class Alter : public ElementInterface - { - public: - Alter(); - Alter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Alter) + +inline AlterPtr makeAlter() +{ + return std::make_shared(); } + +inline AlterPtr makeAlter(const Semitones &value) +{ + return std::make_shared(value); +} + +inline AlterPtr makeAlter(Semitones &&value) +{ + return std::make_shared(std::move(value)); +} + +class Alter : public ElementInterface +{ + public: + Alter(); + Alter(const Semitones &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Semitones getValue() const; + void setValue(const Semitones &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Semitones myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Appearance.cpp b/Sourcecode/private/mx/core/elements/Appearance.cpp index 1cfebcc41..74b1caf02 100644 --- a/Sourcecode/private/mx/core/elements/Appearance.cpp +++ b/Sourcecode/private/mx/core/elements/Appearance.cpp @@ -12,250 +12,219 @@ namespace mx { - namespace core - { - Appearance::Appearance() - :myLineWidthSet() - ,myNoteSizeSet() - ,myDistanceSet() - ,myOtherAppearanceSet() - {} - - - bool Appearance::hasAttributes() const - { - return false; - } - - - std::ostream& Appearance::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Appearance::streamName( std::ostream& os ) const - { - os << "appearance"; - return os; - } - - - bool Appearance::hasContents() const - { - return myLineWidthSet.size() > 0 - || myNoteSizeSet.size() > 0 - || myDistanceSet.size() > 0 - || myOtherAppearanceSet.size() > 0; - } - - - std::ostream& Appearance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myLineWidthSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myNoteSizeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myDistanceSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myOtherAppearanceSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - isOneLineOnly = ! hasContents(); - if ( ! isOneLineOnly ) - { - os << std::endl; - } - return os; - } - - - const LineWidthSet& Appearance::getLineWidthSet() const - { - return myLineWidthSet; - } - - - void Appearance::removeLineWidth( const LineWidthSetIterConst& value ) - { - if ( value != myLineWidthSet.cend() ) - { - myLineWidthSet.erase( value ); - } - } - - - void Appearance::addLineWidth( const LineWidthPtr& value ) - { - if ( value ) - { - myLineWidthSet.push_back( value ); - } - } - - - void Appearance::clearLineWidthSet() - { - myLineWidthSet.clear(); - } - - - LineWidthPtr Appearance::getLineWidth( const LineWidthSetIterConst& setIterator ) const - { - if( setIterator != myLineWidthSet.cend() ) - { - return *setIterator; - } - return LineWidthPtr(); - } - - - const NoteSizeSet& Appearance::getNoteSizeSet() const - { - return myNoteSizeSet; - } - - - void Appearance::removeNoteSize( const NoteSizeSetIterConst& value ) - { - if ( value != myNoteSizeSet.cend() ) - { - myNoteSizeSet.erase( value ); - } - } - - - void Appearance::addNoteSize( const NoteSizePtr& value ) - { - if ( value ) - { - myNoteSizeSet.push_back( value ); - } - } - - - void Appearance::clearNoteSizeSet() - { - myNoteSizeSet.clear(); - } +namespace core +{ +Appearance::Appearance() : myLineWidthSet(), myNoteSizeSet(), myDistanceSet(), myOtherAppearanceSet() +{ +} +bool Appearance::hasAttributes() const +{ + return false; +} - NoteSizePtr Appearance::getNoteSize( const NoteSizeSetIterConst& setIterator ) const - { - if( setIterator != myNoteSizeSet.cend() ) - { - return *setIterator; - } - return NoteSizePtr(); - } +std::ostream &Appearance::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Appearance::streamName(std::ostream &os) const +{ + os << "appearance"; + return os; +} - const DistanceSet& Appearance::getDistanceSet() const - { - return myDistanceSet; - } +bool Appearance::hasContents() const +{ + return myLineWidthSet.size() > 0 || myNoteSizeSet.size() > 0 || myDistanceSet.size() > 0 || + myOtherAppearanceSet.size() > 0; +} +std::ostream &Appearance::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto x : myLineWidthSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myNoteSizeSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myDistanceSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myOtherAppearanceSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + isOneLineOnly = !hasContents(); + if (!isOneLineOnly) + { + os << std::endl; + } + return os; +} - void Appearance::removeDistance( const DistanceSetIterConst& value ) - { - if ( value != myDistanceSet.cend() ) - { - myDistanceSet.erase( value ); - } - } +const LineWidthSet &Appearance::getLineWidthSet() const +{ + return myLineWidthSet; +} +void Appearance::removeLineWidth(const LineWidthSetIterConst &value) +{ + if (value != myLineWidthSet.cend()) + { + myLineWidthSet.erase(value); + } +} - void Appearance::addDistance( const DistancePtr& value ) - { - if ( value ) - { - myDistanceSet.push_back( value ); - } - } +void Appearance::addLineWidth(const LineWidthPtr &value) +{ + if (value) + { + myLineWidthSet.push_back(value); + } +} +void Appearance::clearLineWidthSet() +{ + myLineWidthSet.clear(); +} - void Appearance::clearDistanceSet() - { - myDistanceSet.clear(); - } +LineWidthPtr Appearance::getLineWidth(const LineWidthSetIterConst &setIterator) const +{ + if (setIterator != myLineWidthSet.cend()) + { + return *setIterator; + } + return LineWidthPtr(); +} +const NoteSizeSet &Appearance::getNoteSizeSet() const +{ + return myNoteSizeSet; +} - DistancePtr Appearance::getDistance( const DistanceSetIterConst& setIterator ) const - { - if( setIterator != myDistanceSet.cend() ) - { - return *setIterator; - } - return DistancePtr(); - } +void Appearance::removeNoteSize(const NoteSizeSetIterConst &value) +{ + if (value != myNoteSizeSet.cend()) + { + myNoteSizeSet.erase(value); + } +} +void Appearance::addNoteSize(const NoteSizePtr &value) +{ + if (value) + { + myNoteSizeSet.push_back(value); + } +} - const OtherAppearanceSet& Appearance::getOtherAppearanceSet() const - { - return myOtherAppearanceSet; - } +void Appearance::clearNoteSizeSet() +{ + myNoteSizeSet.clear(); +} +NoteSizePtr Appearance::getNoteSize(const NoteSizeSetIterConst &setIterator) const +{ + if (setIterator != myNoteSizeSet.cend()) + { + return *setIterator; + } + return NoteSizePtr(); +} - void Appearance::removeOtherAppearance( const OtherAppearanceSetIterConst& value ) - { - if ( value != myOtherAppearanceSet.cend() ) - { - myOtherAppearanceSet.erase( value ); - } - } +const DistanceSet &Appearance::getDistanceSet() const +{ + return myDistanceSet; +} +void Appearance::removeDistance(const DistanceSetIterConst &value) +{ + if (value != myDistanceSet.cend()) + { + myDistanceSet.erase(value); + } +} - void Appearance::addOtherAppearance( const OtherAppearancePtr& value ) - { - if ( value ) - { - myOtherAppearanceSet.push_back( value ); - } - } +void Appearance::addDistance(const DistancePtr &value) +{ + if (value) + { + myDistanceSet.push_back(value); + } +} +void Appearance::clearDistanceSet() +{ + myDistanceSet.clear(); +} - void Appearance::clearOtherAppearanceSet() - { - myOtherAppearanceSet.clear(); - } +DistancePtr Appearance::getDistance(const DistanceSetIterConst &setIterator) const +{ + if (setIterator != myDistanceSet.cend()) + { + return *setIterator; + } + return DistancePtr(); +} +const OtherAppearanceSet &Appearance::getOtherAppearanceSet() const +{ + return myOtherAppearanceSet; +} - OtherAppearancePtr Appearance::getOtherAppearance( const OtherAppearanceSetIterConst& setIterator ) const - { - if( setIterator != myOtherAppearanceSet.cend() ) - { - return *setIterator; - } - return OtherAppearancePtr(); - } +void Appearance::removeOtherAppearance(const OtherAppearanceSetIterConst &value) +{ + if (value != myOtherAppearanceSet.cend()) + { + myOtherAppearanceSet.erase(value); + } +} +void Appearance::addOtherAppearance(const OtherAppearancePtr &value) +{ + if (value) + { + myOtherAppearanceSet.push_back(value); + } +} - bool Appearance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; +void Appearance::clearOtherAppearanceSet() +{ + myOtherAppearanceSet.clear(); +} - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "line-width", myLineWidthSet ); - importElementSet( message, it, endIter, isSuccess, "note-size", myNoteSizeSet ); - importElementSet( message, it, endIter, isSuccess, "distance", myDistanceSet ); - importElementSet( message, it, endIter, isSuccess, "other-appearance", myOtherAppearanceSet ); - } +OtherAppearancePtr Appearance::getOtherAppearance(const OtherAppearanceSetIterConst &setIterator) const +{ + if (setIterator != myOtherAppearanceSet.cend()) + { + return *setIterator; + } + return OtherAppearancePtr(); +} - MX_RETURN_IS_SUCCESS; - } +bool Appearance::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importElementSet(message, it, endIter, isSuccess, "line-width", myLineWidthSet); + importElementSet(message, it, endIter, isSuccess, "note-size", myNoteSizeSet); + importElementSet(message, it, endIter, isSuccess, "distance", myDistanceSet); + importElementSet(message, it, endIter, isSuccess, "other-appearance", myOtherAppearanceSet); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Appearance.h b/Sourcecode/private/mx/core/elements/Appearance.h index 24193ae04..39e2546a3 100644 --- a/Sourcecode/private/mx/core/elements/Appearance.h +++ b/Sourcecode/private/mx/core/elements/Appearance.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,64 +13,67 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Distance ) - MX_FORWARD_DECLARE_ELEMENT( LineWidth ) - MX_FORWARD_DECLARE_ELEMENT( NoteSize ) - MX_FORWARD_DECLARE_ELEMENT( OtherAppearance ) - MX_FORWARD_DECLARE_ELEMENT( Appearance ) +MX_FORWARD_DECLARE_ELEMENT(Distance) +MX_FORWARD_DECLARE_ELEMENT(LineWidth) +MX_FORWARD_DECLARE_ELEMENT(NoteSize) +MX_FORWARD_DECLARE_ELEMENT(OtherAppearance) +MX_FORWARD_DECLARE_ELEMENT(Appearance) - inline AppearancePtr makeAppearance() { return std::make_shared(); } +inline AppearancePtr makeAppearance() +{ + return std::make_shared(); +} - class Appearance : public ElementInterface - { - public: - Appearance(); +class Appearance : public ElementInterface +{ + public: + Appearance(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ LineWidth minOccurs = 0, maxOccurs = unbounded _________ */ - const LineWidthSet& getLineWidthSet() const; - void addLineWidth( const LineWidthPtr& value ); - void removeLineWidth( const LineWidthSetIterConst& value ); - void clearLineWidthSet(); - LineWidthPtr getLineWidth( const LineWidthSetIterConst& setIterator ) const; + /* _________ LineWidth minOccurs = 0, maxOccurs = unbounded _________ */ + const LineWidthSet &getLineWidthSet() const; + void addLineWidth(const LineWidthPtr &value); + void removeLineWidth(const LineWidthSetIterConst &value); + void clearLineWidthSet(); + LineWidthPtr getLineWidth(const LineWidthSetIterConst &setIterator) const; - /* _________ NoteSize minOccurs = 0, maxOccurs = unbounded _________ */ - const NoteSizeSet& getNoteSizeSet() const; - void addNoteSize( const NoteSizePtr& value ); - void removeNoteSize( const NoteSizeSetIterConst& value ); - void clearNoteSizeSet(); - NoteSizePtr getNoteSize( const NoteSizeSetIterConst& setIterator ) const; + /* _________ NoteSize minOccurs = 0, maxOccurs = unbounded _________ */ + const NoteSizeSet &getNoteSizeSet() const; + void addNoteSize(const NoteSizePtr &value); + void removeNoteSize(const NoteSizeSetIterConst &value); + void clearNoteSizeSet(); + NoteSizePtr getNoteSize(const NoteSizeSetIterConst &setIterator) const; - /* _________ Distance minOccurs = 0, maxOccurs = unbounded _________ */ - const DistanceSet& getDistanceSet() const; - void addDistance( const DistancePtr& value ); - void removeDistance( const DistanceSetIterConst& value ); - void clearDistanceSet(); - DistancePtr getDistance( const DistanceSetIterConst& setIterator ) const; + /* _________ Distance minOccurs = 0, maxOccurs = unbounded _________ */ + const DistanceSet &getDistanceSet() const; + void addDistance(const DistancePtr &value); + void removeDistance(const DistanceSetIterConst &value); + void clearDistanceSet(); + DistancePtr getDistance(const DistanceSetIterConst &setIterator) const; - /* _________ OtherAppearance minOccurs = 0, maxOccurs = unbounded _________ */ - const OtherAppearanceSet& getOtherAppearanceSet() const; - void addOtherAppearance( const OtherAppearancePtr& value ); - void removeOtherAppearance( const OtherAppearanceSetIterConst& value ); - void clearOtherAppearanceSet(); - OtherAppearancePtr getOtherAppearance( const OtherAppearanceSetIterConst& setIterator ) const; + /* _________ OtherAppearance minOccurs = 0, maxOccurs = unbounded _________ */ + const OtherAppearanceSet &getOtherAppearanceSet() const; + void addOtherAppearance(const OtherAppearancePtr &value); + void removeOtherAppearance(const OtherAppearanceSetIterConst &value); + void clearOtherAppearanceSet(); + OtherAppearancePtr getOtherAppearance(const OtherAppearanceSetIterConst &setIterator) const; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - LineWidthSet myLineWidthSet; - NoteSizeSet myNoteSizeSet; - DistanceSet myDistanceSet; - OtherAppearanceSet myOtherAppearanceSet; - }; - } -} + private: + LineWidthSet myLineWidthSet; + NoteSizeSet myNoteSizeSet; + DistanceSet myDistanceSet; + OtherAppearanceSet myOtherAppearanceSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Arpeggiate.cpp b/Sourcecode/private/mx/core/elements/Arpeggiate.cpp index f027fe034..f3dbb5c55 100644 --- a/Sourcecode/private/mx/core/elements/Arpeggiate.cpp +++ b/Sourcecode/private/mx/core/elements/Arpeggiate.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Arpeggiate::Arpeggiate() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Arpeggiate::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Arpeggiate::hasContents() const { return false; } - std::ostream& Arpeggiate::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Arpeggiate::streamName( std::ostream& os ) const { os << "arpeggiate"; return os; } - std::ostream& Arpeggiate::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Arpeggiate::Arpeggiate() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Arpeggiate::hasAttributes() const +{ + return myAttributes->hasValues(); +} - ArpeggiateAttributesPtr Arpeggiate::getAttributes() const - { - return myAttributes; - } +bool Arpeggiate::hasContents() const +{ + return false; +} +std::ostream &Arpeggiate::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Arpeggiate::setAttributes( const ArpeggiateAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Arpeggiate::streamName(std::ostream &os) const +{ + os << "arpeggiate"; + return os; +} +std::ostream &Arpeggiate::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Arpeggiate::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +ArpeggiateAttributesPtr Arpeggiate::getAttributes() const +{ + return myAttributes; +} +void Arpeggiate::setAttributes(const ArpeggiateAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Arpeggiate::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Arpeggiate.h b/Sourcecode/private/mx/core/elements/Arpeggiate.h index 1f470c613..4f96cded1 100644 --- a/Sourcecode/private/mx/core/elements/Arpeggiate.h +++ b/Sourcecode/private/mx/core/elements/Arpeggiate.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ArpeggiateAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ArpeggiateAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Arpeggiate ) - - inline ArpeggiatePtr makeArpeggiate() { return std::make_shared(); } - - class Arpeggiate : public ElementInterface - { - public: - Arpeggiate(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ArpeggiateAttributesPtr getAttributes() const; - void setAttributes( const ArpeggiateAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArpeggiateAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(ArpeggiateAttributes) +MX_FORWARD_DECLARE_ELEMENT(Arpeggiate) + +inline ArpeggiatePtr makeArpeggiate() +{ + return std::make_shared(); } + +class Arpeggiate : public ElementInterface +{ + public: + Arpeggiate(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ArpeggiateAttributesPtr getAttributes() const; + void setAttributes(const ArpeggiateAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ArpeggiateAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp b/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp index 13cac6391..ab1722371 100644 --- a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp @@ -8,76 +8,77 @@ namespace mx { - namespace core +namespace core +{ +ArpeggiateAttributes::ArpeggiateAttributes() + : number(), direction(), defaultX(), defaultY(), relativeX(), relativeY(), placement(AboveBelow::below), + hasNumber(false), hasDirection(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasPlacement(false) +{ +} + +bool ArpeggiateAttributes::hasValues() const +{ + return hasNumber || hasDirection || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasPlacement; +} + +std::ostream &ArpeggiateAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - ArpeggiateAttributes::ArpeggiateAttributes() - :number() - ,direction() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,hasNumber( false ) - ,hasDirection( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, direction, "direction", hasDirection); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} +bool ArpeggiateAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ArpeggiateAttributes"; + bool isSuccess = true; - bool ArpeggiateAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasDirection || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement; + continue; } - - - std::ostream& ArpeggiateAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, direction, hasDirection, "direction", &parseUpDown)) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, direction, "direction", hasDirection ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool ArpeggiateAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - const char* const className = "ArpeggiateAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, direction, hasDirection, "direction", &parseUpDown ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h b/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h index a83f77fd2..83d902d58 100644 --- a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h +++ b/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -16,34 +16,34 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ArpeggiateAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(ArpeggiateAttributes) - struct ArpeggiateAttributes : public AttributesInterface - { - public: - ArpeggiateAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - NumberLevel number; - UpDown direction; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - bool hasNumber; - bool hasDirection; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; +struct ArpeggiateAttributes : public AttributesInterface +{ + public: + ArpeggiateAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + NumberLevel number; + UpDown direction; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + AboveBelow placement; + bool hasNumber; + bool hasDirection; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Arrow.cpp b/Sourcecode/private/mx/core/elements/Arrow.cpp index e0a9d9958..30e7e2abc 100644 --- a/Sourcecode/private/mx/core/elements/Arrow.cpp +++ b/Sourcecode/private/mx/core/elements/Arrow.cpp @@ -10,146 +10,129 @@ namespace mx { - namespace core - { - Arrow::Arrow() - :myChoice( Choice::arrowGroup ) - ,myAttributes( std::make_shared() ) - ,myArrowGroup( makeArrowGroup() ) - ,myCircularArrow( makeCircularArrow() ) - {} - - - bool Arrow::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Arrow::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Arrow::streamName( std::ostream& os ) const - { - os << "arrow"; - return os; - } - - - bool Arrow::hasContents() const - { - return true; - } - - - std::ostream& Arrow::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::arrowGroup: - { - os << std::endl; - myArrowGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - } - break; - case Choice::circularArrow: - { - os << std::endl; - myCircularArrow->toStream( os, indentLevel+1 ); - os << std::endl; - isOneLineOnly = false; - } - break; - default: - break; - } - return os; - } - - - ArrowAttributesPtr Arrow::getAttributes() const - { - return myAttributes; - } - +namespace core +{ +Arrow::Arrow() + : myChoice(Choice::arrowGroup), myAttributes(std::make_shared()), myArrowGroup(makeArrowGroup()), + myCircularArrow(makeCircularArrow()) +{ +} - void Arrow::setAttributes( const ArrowAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool Arrow::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Arrow::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - Arrow::Choice Arrow::getChoice() const - { - return myChoice; - } +std::ostream &Arrow::streamName(std::ostream &os) const +{ + os << "arrow"; + return os; +} +bool Arrow::hasContents() const +{ + return true; +} - void Arrow::setChoice( const Arrow::Choice value ) - { - myChoice = value; - } +std::ostream &Arrow::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::arrowGroup: { + os << std::endl; + myArrowGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + os << std::endl; + isOneLineOnly = false; + } + break; + case Choice::circularArrow: { + os << std::endl; + myCircularArrow->toStream(os, indentLevel + 1); + os << std::endl; + isOneLineOnly = false; + } + break; + default: + break; + } + return os; +} +ArrowAttributesPtr Arrow::getAttributes() const +{ + return myAttributes; +} - ArrowGroupPtr Arrow::getArrowGroup() const - { - return myArrowGroup; - } +void Arrow::setAttributes(const ArrowAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +Arrow::Choice Arrow::getChoice() const +{ + return myChoice; +} - void Arrow::setArrowGroup( const ArrowGroupPtr& value ) - { - if( value ) - { - myArrowGroup = value; - } - } +void Arrow::setChoice(const Arrow::Choice value) +{ + myChoice = value; +} +ArrowGroupPtr Arrow::getArrowGroup() const +{ + return myArrowGroup; +} - CircularArrowPtr Arrow::getCircularArrow() const - { - return myCircularArrow; - } +void Arrow::setArrowGroup(const ArrowGroupPtr &value) +{ + if (value) + { + myArrowGroup = value; + } +} +CircularArrowPtr Arrow::getCircularArrow() const +{ + return myCircularArrow; +} - void Arrow::setCircularArrow( const CircularArrowPtr& value ) - { - if( value ) - { - myCircularArrow = value; - } - } +void Arrow::setCircularArrow(const CircularArrowPtr &value) +{ + if (value) + { + myCircularArrow = value; + } +} +bool Arrow::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - bool Arrow::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (it->getName() == "circular-arrow") { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if( it->getName() == "circular-arrow" ) - { - myChoice = Choice::circularArrow; - isSuccess &= myCircularArrow->fromXElement( message, *it ); - // this is a mistake I think MX_RETURN_IS_SUCCESS; - } - myChoice = Choice::arrowGroup; - isSuccess = myArrowGroup->fromXElement( message, xelement ); - // this is a mistake I think MX_RETURN_IS_SUCCESS; - } - - MX_RETURN_IS_SUCCESS; + myChoice = Choice::circularArrow; + isSuccess &= myCircularArrow->fromXElement(message, *it); + // this is a mistake I think MX_RETURN_IS_SUCCESS; } - + myChoice = Choice::arrowGroup; + isSuccess = myArrowGroup->fromXElement(message, xelement); + // this is a mistake I think MX_RETURN_IS_SUCCESS; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Arrow.h b/Sourcecode/private/mx/core/elements/Arrow.h index 14618709c..e9537ac54 100644 --- a/Sourcecode/private/mx/core/elements/Arrow.h +++ b/Sourcecode/private/mx/core/elements/Arrow.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ArrowAttributes.h" #include @@ -14,54 +14,57 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ArrowAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ArrowGroup ) - MX_FORWARD_DECLARE_ELEMENT( CircularArrow ) - MX_FORWARD_DECLARE_ELEMENT( Arrow ) +MX_FORWARD_DECLARE_ATTRIBUTES(ArrowAttributes) +MX_FORWARD_DECLARE_ELEMENT(ArrowGroup) +MX_FORWARD_DECLARE_ELEMENT(CircularArrow) +MX_FORWARD_DECLARE_ELEMENT(Arrow) - inline ArrowPtr makeArrow() { return std::make_shared(); } +inline ArrowPtr makeArrow() +{ + return std::make_shared(); +} - class Arrow : public ElementInterface - { - public: - enum class Choice - { - arrowGroup = 1, - circularArrow = 2 - }; - Arrow(); +class Arrow : public ElementInterface +{ + public: + enum class Choice + { + arrowGroup = 1, + circularArrow = 2 + }; + Arrow(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ArrowAttributesPtr getAttributes() const; - void setAttributes( const ArrowAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ArrowAttributesPtr getAttributes() const; + void setAttributes(const ArrowAttributesPtr &value); - /* _________ Choice _________ */ - Arrow::Choice getChoice() const; - void setChoice( const Arrow::Choice value ); + /* _________ Choice _________ */ + Arrow::Choice getChoice() const; + void setChoice(const Arrow::Choice value); - /* _________ ArrowGroup minOccurs = 1, maxOccurs = 1 _________ */ - ArrowGroupPtr getArrowGroup() const; - void setArrowGroup( const ArrowGroupPtr& value ); + /* _________ ArrowGroup minOccurs = 1, maxOccurs = 1 _________ */ + ArrowGroupPtr getArrowGroup() const; + void setArrowGroup(const ArrowGroupPtr &value); - /* _________ CircularArrow minOccurs = 1, maxOccurs = 1 _________ */ - CircularArrowPtr getCircularArrow() const; - void setCircularArrow( const CircularArrowPtr& value ); + /* _________ CircularArrow minOccurs = 1, maxOccurs = 1 _________ */ + CircularArrowPtr getCircularArrow() const; + void setCircularArrow(const CircularArrowPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - Choice myChoice; - ArrowAttributesPtr myAttributes; - ArrowGroupPtr myArrowGroup; - CircularArrowPtr myCircularArrow; - }; - } -} + private: + Choice myChoice; + ArrowAttributesPtr myAttributes; + ArrowGroupPtr myArrowGroup; + CircularArrowPtr myCircularArrow; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArrowAttributes.cpp b/Sourcecode/private/mx/core/elements/ArrowAttributes.cpp index eec9383a4..392934fde 100644 --- a/Sourcecode/private/mx/core/elements/ArrowAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ArrowAttributes.cpp @@ -8,91 +8,95 @@ namespace mx { - namespace core +namespace core +{ +ArrowAttributes::ArrowAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), placement(AboveBelow::below), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasPlacement(false) +{ +} + +bool ArrowAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPlacement; +} + +std::ostream &ArrowAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - ArrowAttributes::ArrowAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool ArrowAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ArrowAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool ArrowAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; + continue; } - - - std::ostream& ArrowAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool ArrowAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "ArrowAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArrowAttributes.h b/Sourcecode/private/mx/core/elements/ArrowAttributes.h index a862ede65..82756fcbe 100644 --- a/Sourcecode/private/mx/core/elements/ArrowAttributes.h +++ b/Sourcecode/private/mx/core/elements/ArrowAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,40 +18,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ArrowAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(ArrowAttributes) - struct ArrowAttributes : public AttributesInterface - { - public: - ArrowAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; +struct ArrowAttributes : public AttributesInterface +{ + public: + ArrowAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArrowDirection.cpp b/Sourcecode/private/mx/core/elements/ArrowDirection.cpp index 2ce6009c6..6e60e21e1 100644 --- a/Sourcecode/private/mx/core/elements/ArrowDirection.cpp +++ b/Sourcecode/private/mx/core/elements/ArrowDirection.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - ArrowDirection::ArrowDirection() - :myValue( ArrowDirectionEnum::up ) - {} - - - ArrowDirection::ArrowDirection( const ArrowDirectionEnum& value ) - :myValue( value ) - {} - - - bool ArrowDirection::hasAttributes() const - { - return false; - } - - - bool ArrowDirection::hasContents() const - { - return true; - } - - - std::ostream& ArrowDirection::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ArrowDirection::streamName( std::ostream& os ) const - { - os << "arrow-direction"; - return os; - } +namespace core +{ +ArrowDirection::ArrowDirection() : myValue(ArrowDirectionEnum::up) +{ +} +ArrowDirection::ArrowDirection(const ArrowDirectionEnum &value) : myValue(value) +{ +} - std::ostream& ArrowDirection::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool ArrowDirection::hasAttributes() const +{ + return false; +} +bool ArrowDirection::hasContents() const +{ + return true; +} - ArrowDirectionEnum ArrowDirection::getValue() const - { - return myValue; - } +std::ostream &ArrowDirection::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &ArrowDirection::streamName(std::ostream &os) const +{ + os << "arrow-direction"; + return os; +} - void ArrowDirection::setValue( const ArrowDirectionEnum& value ) - { - myValue = value; - } +std::ostream &ArrowDirection::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +ArrowDirectionEnum ArrowDirection::getValue() const +{ + return myValue; +} - bool ArrowDirection::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseArrowDirectionEnum( xelement.getValue() ); - return true; - } +void ArrowDirection::setValue(const ArrowDirectionEnum &value) +{ + myValue = value; +} - } +bool ArrowDirection::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseArrowDirectionEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArrowDirection.h b/Sourcecode/private/mx/core/elements/ArrowDirection.h index 257d2cec2..83f400689 100644 --- a/Sourcecode/private/mx/core/elements/ArrowDirection.h +++ b/Sourcecode/private/mx/core/elements/ArrowDirection.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ArrowDirection ) - - inline ArrowDirectionPtr makeArrowDirection() { return std::make_shared(); } - inline ArrowDirectionPtr makeArrowDirection( const ArrowDirectionEnum& value ) { return std::make_shared( value ); } - inline ArrowDirectionPtr makeArrowDirection( ArrowDirectionEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class ArrowDirection : public ElementInterface - { - public: - ArrowDirection(); - ArrowDirection( const ArrowDirectionEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ArrowDirectionEnum getValue() const; - void setValue( const ArrowDirectionEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArrowDirectionEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(ArrowDirection) + +inline ArrowDirectionPtr makeArrowDirection() +{ + return std::make_shared(); +} + +inline ArrowDirectionPtr makeArrowDirection(const ArrowDirectionEnum &value) +{ + return std::make_shared(value); } + +inline ArrowDirectionPtr makeArrowDirection(ArrowDirectionEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class ArrowDirection : public ElementInterface +{ + public: + ArrowDirection(); + ArrowDirection(const ArrowDirectionEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ArrowDirectionEnum getValue() const; + void setValue(const ArrowDirectionEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ArrowDirectionEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArrowGroup.cpp b/Sourcecode/private/mx/core/elements/ArrowGroup.cpp index 8ea3d0429..0456937c9 100644 --- a/Sourcecode/private/mx/core/elements/ArrowGroup.cpp +++ b/Sourcecode/private/mx/core/elements/ArrowGroup.cpp @@ -10,125 +10,112 @@ namespace mx { - namespace core - { - ArrowGroup::ArrowGroup() - :myArrowDirection( makeArrowDirection() ) - ,myArrowStyle( makeArrowStyle() ) - ,myHasArrowStyle( false ) - {} - - - bool ArrowGroup::hasAttributes() const - { - return false; - } - - - std::ostream& ArrowGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ArrowGroup::streamName( std::ostream& os ) const - { - return os; - } +namespace core +{ +ArrowGroup::ArrowGroup() + : myArrowDirection(makeArrowDirection()), myArrowStyle(makeArrowStyle()), myHasArrowStyle(false) +{ +} +bool ArrowGroup::hasAttributes() const +{ + return false; +} - bool ArrowGroup::hasContents() const - { - return true; - } +std::ostream &ArrowGroup::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &ArrowGroup::streamName(std::ostream &os) const +{ + return os; +} - std::ostream& ArrowGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myArrowDirection->toStream( os, indentLevel ); - if ( myHasArrowStyle ) - { - os << std::endl; - myArrowStyle->toStream( os, indentLevel ); - } - isOneLineOnly = false; - return os; - } +bool ArrowGroup::hasContents() const +{ + return true; +} +std::ostream &ArrowGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + myArrowDirection->toStream(os, indentLevel); + if (myHasArrowStyle) + { + os << std::endl; + myArrowStyle->toStream(os, indentLevel); + } + isOneLineOnly = false; + return os; +} - ArrowDirectionPtr ArrowGroup::getArrowDirection() const - { - return myArrowDirection; - } +ArrowDirectionPtr ArrowGroup::getArrowDirection() const +{ + return myArrowDirection; +} +void ArrowGroup::setArrowDirection(const ArrowDirectionPtr &value) +{ + if (value) + { + myArrowDirection = value; + } +} - void ArrowGroup::setArrowDirection( const ArrowDirectionPtr& value ) - { - if ( value ) - { - myArrowDirection = value; - } - } +ArrowStylePtr ArrowGroup::getArrowStyle() const +{ + return myArrowStyle; +} +void ArrowGroup::setArrowStyle(const ArrowStylePtr &value) +{ + if (value) + { + myArrowStyle = value; + } +} - ArrowStylePtr ArrowGroup::getArrowStyle() const - { - return myArrowStyle; - } +bool ArrowGroup::getHasArrowStyle() const +{ + return myHasArrowStyle; +} +void ArrowGroup::setHasArrowStyle(const bool value) +{ + myHasArrowStyle = value; +} - void ArrowGroup::setArrowStyle( const ArrowStylePtr& value ) - { - if ( value ) - { - myArrowStyle = value; - } - } +bool ArrowGroup::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isArrowDirectionFound = false; + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); - bool ArrowGroup::getHasArrowStyle() const + if (elementName == "arrow-direction") { - return myHasArrowStyle; + isArrowDirectionFound = true; + isSuccess &= myArrowDirection->fromXElement(message, *it); } - - - void ArrowGroup::setHasArrowStyle( const bool value ) + else if (elementName == "arrow-style") { - myHasArrowStyle = value; + myHasArrowStyle = true; + isSuccess &= myArrowStyle->fromXElement(message, *it); } - - - bool ArrowGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + else { - bool isSuccess = true; - bool isArrowDirectionFound = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + if (!isArrowDirectionFound) { - const std::string elementName = it->getName(); - - if( elementName == "arrow-direction" ) - { - isArrowDirectionFound = true; - isSuccess &= myArrowDirection->fromXElement( message, *it ); - } - else if( elementName == "arrow-style" ) - { - myHasArrowStyle = true; - isSuccess &= myArrowStyle->fromXElement( message, *it ); - } - else - { - if( !isArrowDirectionFound ) - { - isSuccess = false; - message << "ArrowGroup: 'arrow-direction' element is required but was not found" << std::endl; - } - break; - } + isSuccess = false; + message << "ArrowGroup: 'arrow-direction' element is required but was not found" << std::endl; } - MX_RETURN_IS_SUCCESS; + break; } - } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArrowGroup.h b/Sourcecode/private/mx/core/elements/ArrowGroup.h index 6be9b580c..0dcfe11e0 100644 --- a/Sourcecode/private/mx/core/elements/ArrowGroup.h +++ b/Sourcecode/private/mx/core/elements/ArrowGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,43 +13,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ArrowDirection ) - MX_FORWARD_DECLARE_ELEMENT( ArrowStyle ) - MX_FORWARD_DECLARE_ELEMENT( ArrowGroup ) - - inline ArrowGroupPtr makeArrowGroup() { return std::make_shared(); } - - class ArrowGroup : public ElementInterface - { - public: - ArrowGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ ArrowDirection minOccurs = 1, maxOccurs = 1 _________ */ - ArrowDirectionPtr getArrowDirection() const; - void setArrowDirection( const ArrowDirectionPtr& value ); - - /* _________ ArrowStyle minOccurs = 0, maxOccurs = 1 _________ */ - ArrowStylePtr getArrowStyle() const; - void setArrowStyle( const ArrowStylePtr& value ); - bool getHasArrowStyle() const; - void setHasArrowStyle( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArrowDirectionPtr myArrowDirection; - ArrowStylePtr myArrowStyle; - bool myHasArrowStyle; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(ArrowDirection) +MX_FORWARD_DECLARE_ELEMENT(ArrowStyle) +MX_FORWARD_DECLARE_ELEMENT(ArrowGroup) + +inline ArrowGroupPtr makeArrowGroup() +{ + return std::make_shared(); } + +class ArrowGroup : public ElementInterface +{ + public: + ArrowGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ ArrowDirection minOccurs = 1, maxOccurs = 1 _________ */ + ArrowDirectionPtr getArrowDirection() const; + void setArrowDirection(const ArrowDirectionPtr &value); + + /* _________ ArrowStyle minOccurs = 0, maxOccurs = 1 _________ */ + ArrowStylePtr getArrowStyle() const; + void setArrowStyle(const ArrowStylePtr &value); + bool getHasArrowStyle() const; + void setHasArrowStyle(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ArrowDirectionPtr myArrowDirection; + ArrowStylePtr myArrowStyle; + bool myHasArrowStyle; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArrowStyle.cpp b/Sourcecode/private/mx/core/elements/ArrowStyle.cpp index f2eacf6b0..0384534ee 100644 --- a/Sourcecode/private/mx/core/elements/ArrowStyle.cpp +++ b/Sourcecode/private/mx/core/elements/ArrowStyle.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - ArrowStyle::ArrowStyle() - :myValue( ArrowStyleEnum::single ) - {} - - - ArrowStyle::ArrowStyle( const ArrowStyleEnum& value ) - :myValue( value ) - {} - - - bool ArrowStyle::hasAttributes() const - { - return false; - } - - - bool ArrowStyle::hasContents() const - { - return true; - } - - - std::ostream& ArrowStyle::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ArrowStyle::streamName( std::ostream& os ) const - { - os << "arrow-style"; - return os; - } +namespace core +{ +ArrowStyle::ArrowStyle() : myValue(ArrowStyleEnum::single) +{ +} +ArrowStyle::ArrowStyle(const ArrowStyleEnum &value) : myValue(value) +{ +} - std::ostream& ArrowStyle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool ArrowStyle::hasAttributes() const +{ + return false; +} +bool ArrowStyle::hasContents() const +{ + return true; +} - ArrowStyleEnum ArrowStyle::getValue() const - { - return myValue; - } +std::ostream &ArrowStyle::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &ArrowStyle::streamName(std::ostream &os) const +{ + os << "arrow-style"; + return os; +} - void ArrowStyle::setValue( const ArrowStyleEnum& value ) - { - myValue = value; - } +std::ostream &ArrowStyle::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +ArrowStyleEnum ArrowStyle::getValue() const +{ + return myValue; +} - bool ArrowStyle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseArrowStyleEnum( xelement.getValue() ); - return true; - } +void ArrowStyle::setValue(const ArrowStyleEnum &value) +{ + myValue = value; +} - } +bool ArrowStyle::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseArrowStyleEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArrowStyle.h b/Sourcecode/private/mx/core/elements/ArrowStyle.h index 58fb2772f..11ff90550 100644 --- a/Sourcecode/private/mx/core/elements/ArrowStyle.h +++ b/Sourcecode/private/mx/core/elements/ArrowStyle.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ArrowStyle ) - - inline ArrowStylePtr makeArrowStyle() { return std::make_shared(); } - inline ArrowStylePtr makeArrowStyle( const ArrowStyleEnum& value ) { return std::make_shared( value ); } - inline ArrowStylePtr makeArrowStyle( ArrowStyleEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class ArrowStyle : public ElementInterface - { - public: - ArrowStyle(); - ArrowStyle( const ArrowStyleEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ArrowStyleEnum getValue() const; - void setValue( const ArrowStyleEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArrowStyleEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(ArrowStyle) + +inline ArrowStylePtr makeArrowStyle() +{ + return std::make_shared(); +} + +inline ArrowStylePtr makeArrowStyle(const ArrowStyleEnum &value) +{ + return std::make_shared(value); } + +inline ArrowStylePtr makeArrowStyle(ArrowStyleEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class ArrowStyle : public ElementInterface +{ + public: + ArrowStyle(); + ArrowStyle(const ArrowStyleEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ArrowStyleEnum getValue() const; + void setValue(const ArrowStyleEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ArrowStyleEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Articulations.cpp b/Sourcecode/private/mx/core/elements/Articulations.cpp index 7477af83c..37334068f 100644 --- a/Sourcecode/private/mx/core/elements/Articulations.cpp +++ b/Sourcecode/private/mx/core/elements/Articulations.cpp @@ -9,111 +9,100 @@ namespace mx { - namespace core - { - Articulations::Articulations() - :myArticulationsChoiceSet() - {} - - - bool Articulations::hasAttributes() const - { - return false; - } - - - std::ostream& Articulations::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Articulations::streamName( std::ostream& os ) const - { - return os << "articulations"; - } - - - bool Articulations::hasContents() const - { - return myArticulationsChoiceSet.size() > 0; - } - - - std::ostream& Articulations::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myArticulationsChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - const ArticulationsChoiceSet& Articulations::getArticulationsChoiceSet() const - { - return myArticulationsChoiceSet; - } - +namespace core +{ +Articulations::Articulations() : myArticulationsChoiceSet() +{ +} - void Articulations::addArticulationsChoice( const ArticulationsChoicePtr& value ) - { - if ( value ) - { - myArticulationsChoiceSet.push_back( value ); - } - } +bool Articulations::hasAttributes() const +{ + return false; +} +std::ostream &Articulations::streamAttributes(std::ostream &os) const +{ + return os; +} - void Articulations::removeArticulationsChoice( const ArticulationsChoiceSetIterConst& value ) - { - if ( value != myArticulationsChoiceSet.cend() ) - { - myArticulationsChoiceSet.erase( value ); - } - } +std::ostream &Articulations::streamName(std::ostream &os) const +{ + return os << "articulations"; +} +bool Articulations::hasContents() const +{ + return myArticulationsChoiceSet.size() > 0; +} - void Articulations::clearArticulationsChoiceSet() +std::ostream &Articulations::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + for (auto x : myArticulationsChoiceSet) { - myArticulationsChoiceSet.clear(); + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); } + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +const ArticulationsChoiceSet &Articulations::getArticulationsChoiceSet() const +{ + return myArticulationsChoiceSet; +} - ArticulationsChoicePtr Articulations::getArticulationsChoice( const ArticulationsChoiceSetIterConst& setIterator ) const - { - if( setIterator != myArticulationsChoiceSet.cend() ) - { - return *setIterator; - } - return ArticulationsChoicePtr(); - } +void Articulations::addArticulationsChoice(const ArticulationsChoicePtr &value) +{ + if (value) + { + myArticulationsChoiceSet.push_back(value); + } +} +void Articulations::removeArticulationsChoice(const ArticulationsChoiceSetIterConst &value) +{ + if (value != myArticulationsChoiceSet.cend()) + { + myArticulationsChoiceSet.erase(value); + } +} - bool Articulations::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; +void Articulations::clearArticulationsChoiceSet() +{ + myArticulationsChoiceSet.clear(); +} - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeArticulationsChoice(); - isSuccess &= item->fromXElement( message, *it ); - myArticulationsChoiceSet.push_back( item ); - } +ArticulationsChoicePtr Articulations::getArticulationsChoice(const ArticulationsChoiceSetIterConst &setIterator) const +{ + if (setIterator != myArticulationsChoiceSet.cend()) + { + return *setIterator; + } + return ArticulationsChoicePtr(); +} - return isSuccess; - } +bool Articulations::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + auto item = makeArticulationsChoice(); + isSuccess &= item->fromXElement(message, *it); + myArticulationsChoiceSet.push_back(item); } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Articulations.h b/Sourcecode/private/mx/core/elements/Articulations.h index 9e8f46109..eb9b3cd45 100644 --- a/Sourcecode/private/mx/core/elements/Articulations.h +++ b/Sourcecode/private/mx/core/elements/Articulations.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,37 +13,40 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ArticulationsChoice ) - MX_FORWARD_DECLARE_ELEMENT( Articulations ) - - inline ArticulationsPtr makeArticulations() { return std::make_shared(); } - - class Articulations : public ElementInterface - { - public: - Articulations(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ ArticulationsChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const ArticulationsChoiceSet& getArticulationsChoiceSet() const; - void addArticulationsChoice( const ArticulationsChoicePtr& value ); - void removeArticulationsChoice( const ArticulationsChoiceSetIterConst& value ); - void clearArticulationsChoiceSet(); - ArticulationsChoicePtr getArticulationsChoice( const ArticulationsChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArticulationsChoiceSet myArticulationsChoiceSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(ArticulationsChoice) +MX_FORWARD_DECLARE_ELEMENT(Articulations) + +inline ArticulationsPtr makeArticulations() +{ + return std::make_shared(); } + +class Articulations : public ElementInterface +{ + public: + Articulations(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ ArticulationsChoice minOccurs = 0, maxOccurs = unbounded _________ */ + const ArticulationsChoiceSet &getArticulationsChoiceSet() const; + void addArticulationsChoice(const ArticulationsChoicePtr &value); + void removeArticulationsChoice(const ArticulationsChoiceSetIterConst &value); + void clearArticulationsChoiceSet(); + ArticulationsChoicePtr getArticulationsChoice(const ArticulationsChoiceSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ArticulationsChoiceSet myArticulationsChoiceSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp b/Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp index 66140a4ba..d1a23b363 100644 --- a/Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp +++ b/Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp @@ -24,500 +24,433 @@ namespace mx { - namespace core - { - ArticulationsChoice::ArticulationsChoice() - :myChoice( Choice::accent ) - ,myAccent( makeAccent() ) - ,myStrongAccent( makeStrongAccent() ) - ,myStaccato( makeStaccato() ) - ,myTenuto( makeTenuto() ) - ,myDetachedLegato( makeDetachedLegato() ) - ,myStaccatissimo( makeStaccatissimo() ) - ,mySpiccato( makeSpiccato() ) - ,myScoop( makeScoop() ) - ,myPlop( makePlop() ) - ,myDoit( makeDoit() ) - ,myFalloff( makeFalloff() ) - ,myBreathMark( makeBreathMark() ) - ,myCaesura( makeCaesura() ) - ,myStress( makeStress() ) - ,myUnstress( makeUnstress() ) - ,myOtherArticulation( makeOtherArticulation() ) - {} - - - bool ArticulationsChoice::hasAttributes() const - { - return false; - } - - - std::ostream& ArticulationsChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ArticulationsChoice::streamName( std::ostream& os ) const - { - os << "articulations"; - return os; - } - - - bool ArticulationsChoice::hasContents() const - { - return true; - } - - - std::ostream& ArticulationsChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - - switch ( myChoice ) - { - case Choice::accent: - { - myAccent->toStream( os, indentLevel ); - } - break; - case Choice::strongAccent: - { - myStrongAccent->toStream( os, indentLevel ); - } - break; - case Choice::staccato: - { - myStaccato->toStream( os, indentLevel ); - } - break; - case Choice::tenuto: - { - myTenuto->toStream( os, indentLevel ); - } - break; - case Choice::detachedLegato: - { - myDetachedLegato->toStream( os, indentLevel ); - } - break; - case Choice::staccatissimo: - { - myStaccatissimo->toStream( os, indentLevel ); - } - break; - case Choice::spiccato: - { - mySpiccato->toStream( os, indentLevel ); - } - break; - case Choice::scoop: - { - myScoop->toStream( os, indentLevel ); - } - break; - case Choice::plop: - { - myPlop->toStream( os, indentLevel ); - } - break; - case Choice::doit: - { - myDoit->toStream( os, indentLevel ); - } - break; - case Choice::falloff: - { - myFalloff->toStream( os, indentLevel ); - } - break; - case Choice::breathMark: - { - myBreathMark->toStream( os, indentLevel ); - } - break; - case Choice::caesura: - { - myCaesura->toStream( os, indentLevel ); - } - break; - case Choice::stress: - { - myStress->toStream( os, indentLevel ); - } - break; - case Choice::unstress: - { - myUnstress->toStream( os, indentLevel ); - } - break; - case Choice::otherArticulation: - { - myOtherArticulation->toStream( os, indentLevel ); - } - break; - default: - break; - } - return os; - } - - - ArticulationsChoice::Choice ArticulationsChoice::getChoice() const - { - return myChoice; - } - - - void ArticulationsChoice::setChoice( const ArticulationsChoice::Choice value ) - { - myChoice = value; - } - - - AccentPtr ArticulationsChoice::getAccent() const - { - return myAccent; - } - - - void ArticulationsChoice::setAccent( const AccentPtr& value ) - { - if( value ) - { - myAccent = value; - } - } - - - StrongAccentPtr ArticulationsChoice::getStrongAccent() const - { - return myStrongAccent; - } - - - void ArticulationsChoice::setStrongAccent( const StrongAccentPtr& value ) - { - if( value ) - { - myStrongAccent = value; - } - } - - - StaccatoPtr ArticulationsChoice::getStaccato() const - { - return myStaccato; - } - - - void ArticulationsChoice::setStaccato( const StaccatoPtr& value ) - { - if( value ) - { - myStaccato = value; - } - } - - - TenutoPtr ArticulationsChoice::getTenuto() const - { - return myTenuto; - } - - - void ArticulationsChoice::setTenuto( const TenutoPtr& value ) - { - if( value ) - { - myTenuto = value; - } - } - - - DetachedLegatoPtr ArticulationsChoice::getDetachedLegato() const - { - return myDetachedLegato; - } +namespace core +{ +ArticulationsChoice::ArticulationsChoice() + : myChoice(Choice::accent), myAccent(makeAccent()), myStrongAccent(makeStrongAccent()), myStaccato(makeStaccato()), + myTenuto(makeTenuto()), myDetachedLegato(makeDetachedLegato()), myStaccatissimo(makeStaccatissimo()), + mySpiccato(makeSpiccato()), myScoop(makeScoop()), myPlop(makePlop()), myDoit(makeDoit()), + myFalloff(makeFalloff()), myBreathMark(makeBreathMark()), myCaesura(makeCaesura()), myStress(makeStress()), + myUnstress(makeUnstress()), myOtherArticulation(makeOtherArticulation()) +{ +} + +bool ArticulationsChoice::hasAttributes() const +{ + return false; +} + +std::ostream &ArticulationsChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &ArticulationsChoice::streamName(std::ostream &os) const +{ + os << "articulations"; + return os; +} + +bool ArticulationsChoice::hasContents() const +{ + return true; +} + +std::ostream &ArticulationsChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(isOneLineOnly); + + switch (myChoice) + { + case Choice::accent: { + myAccent->toStream(os, indentLevel); + } + break; + case Choice::strongAccent: { + myStrongAccent->toStream(os, indentLevel); + } + break; + case Choice::staccato: { + myStaccato->toStream(os, indentLevel); + } + break; + case Choice::tenuto: { + myTenuto->toStream(os, indentLevel); + } + break; + case Choice::detachedLegato: { + myDetachedLegato->toStream(os, indentLevel); + } + break; + case Choice::staccatissimo: { + myStaccatissimo->toStream(os, indentLevel); + } + break; + case Choice::spiccato: { + mySpiccato->toStream(os, indentLevel); + } + break; + case Choice::scoop: { + myScoop->toStream(os, indentLevel); + } + break; + case Choice::plop: { + myPlop->toStream(os, indentLevel); + } + break; + case Choice::doit: { + myDoit->toStream(os, indentLevel); + } + break; + case Choice::falloff: { + myFalloff->toStream(os, indentLevel); + } + break; + case Choice::breathMark: { + myBreathMark->toStream(os, indentLevel); + } + break; + case Choice::caesura: { + myCaesura->toStream(os, indentLevel); + } + break; + case Choice::stress: { + myStress->toStream(os, indentLevel); + } + break; + case Choice::unstress: { + myUnstress->toStream(os, indentLevel); + } + break; + case Choice::otherArticulation: { + myOtherArticulation->toStream(os, indentLevel); + } + break; + default: + break; + } + return os; +} + +ArticulationsChoice::Choice ArticulationsChoice::getChoice() const +{ + return myChoice; +} + +void ArticulationsChoice::setChoice(const ArticulationsChoice::Choice value) +{ + myChoice = value; +} + +AccentPtr ArticulationsChoice::getAccent() const +{ + return myAccent; +} + +void ArticulationsChoice::setAccent(const AccentPtr &value) +{ + if (value) + { + myAccent = value; + } +} + +StrongAccentPtr ArticulationsChoice::getStrongAccent() const +{ + return myStrongAccent; +} + +void ArticulationsChoice::setStrongAccent(const StrongAccentPtr &value) +{ + if (value) + { + myStrongAccent = value; + } +} + +StaccatoPtr ArticulationsChoice::getStaccato() const +{ + return myStaccato; +} + +void ArticulationsChoice::setStaccato(const StaccatoPtr &value) +{ + if (value) + { + myStaccato = value; + } +} + +TenutoPtr ArticulationsChoice::getTenuto() const +{ + return myTenuto; +} + +void ArticulationsChoice::setTenuto(const TenutoPtr &value) +{ + if (value) + { + myTenuto = value; + } +} + +DetachedLegatoPtr ArticulationsChoice::getDetachedLegato() const +{ + return myDetachedLegato; +} + +void ArticulationsChoice::setDetachedLegato(const DetachedLegatoPtr &value) +{ + if (value) + { + myDetachedLegato = value; + } +} + +StaccatissimoPtr ArticulationsChoice::getStaccatissimo() const +{ + return myStaccatissimo; +} + +void ArticulationsChoice::setStaccatissimo(const StaccatissimoPtr &value) +{ + if (value) + { + myStaccatissimo = value; + } +} + +SpiccatoPtr ArticulationsChoice::getSpiccato() const +{ + return mySpiccato; +} + +void ArticulationsChoice::setSpiccato(const SpiccatoPtr &value) +{ + if (value) + { + mySpiccato = value; + } +} +ScoopPtr ArticulationsChoice::getScoop() const +{ + return myScoop; +} - void ArticulationsChoice::setDetachedLegato( const DetachedLegatoPtr& value ) - { - if( value ) - { - myDetachedLegato = value; - } - } +void ArticulationsChoice::setScoop(const ScoopPtr &value) +{ + if (value) + { + myScoop = value; + } +} +PlopPtr ArticulationsChoice::getPlop() const +{ + return myPlop; +} - StaccatissimoPtr ArticulationsChoice::getStaccatissimo() const - { - return myStaccatissimo; - } +void ArticulationsChoice::setPlop(const PlopPtr &value) +{ + if (value) + { + myPlop = value; + } +} +DoitPtr ArticulationsChoice::getDoit() const +{ + return myDoit; +} - void ArticulationsChoice::setStaccatissimo( const StaccatissimoPtr& value ) - { - if( value ) - { - myStaccatissimo = value; - } - } +void ArticulationsChoice::setDoit(const DoitPtr &value) +{ + if (value) + { + myDoit = value; + } +} +FalloffPtr ArticulationsChoice::getFalloff() const +{ + return myFalloff; +} - SpiccatoPtr ArticulationsChoice::getSpiccato() const - { - return mySpiccato; - } +void ArticulationsChoice::setFalloff(const FalloffPtr &value) +{ + if (value) + { + myFalloff = value; + } +} +BreathMarkPtr ArticulationsChoice::getBreathMark() const +{ + return myBreathMark; +} - void ArticulationsChoice::setSpiccato( const SpiccatoPtr& value ) - { - if( value ) - { - mySpiccato = value; - } - } +void ArticulationsChoice::setBreathMark(const BreathMarkPtr &value) +{ + if (value) + { + myBreathMark = value; + } +} +CaesuraPtr ArticulationsChoice::getCaesura() const +{ + return myCaesura; +} - ScoopPtr ArticulationsChoice::getScoop() const - { - return myScoop; - } +void ArticulationsChoice::setCaesura(const CaesuraPtr &value) +{ + if (value) + { + myCaesura = value; + } +} +StressPtr ArticulationsChoice::getStress() const +{ + return myStress; +} - void ArticulationsChoice::setScoop( const ScoopPtr& value ) - { - if( value ) - { - myScoop = value; - } - } +void ArticulationsChoice::setStress(const StressPtr &value) +{ + if (value) + { + myStress = value; + } +} +UnstressPtr ArticulationsChoice::getUnstress() const +{ + return myUnstress; +} - PlopPtr ArticulationsChoice::getPlop() const - { - return myPlop; - } +void ArticulationsChoice::setUnstress(const UnstressPtr &value) +{ + if (value) + { + myUnstress = value; + } +} + +OtherArticulationPtr ArticulationsChoice::getOtherArticulation() const +{ + return myOtherArticulation; +} + +void ArticulationsChoice::setOtherArticulation(const OtherArticulationPtr &value) +{ + if (value) + { + myOtherArticulation = value; + } +} + +bool ArticulationsChoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + if (xelement.getName() == "accent") + { + myChoice = Choice::accent; + return getAccent()->fromXElement(message, xelement); + } + + if (xelement.getName() == "strong-accent") + { + myChoice = Choice::strongAccent; + return getStrongAccent()->fromXElement(message, xelement); + } + + if (xelement.getName() == "staccato") + { + myChoice = Choice::staccato; + return getStaccato()->fromXElement(message, xelement); + } + + if (xelement.getName() == "tenuto") + { + myChoice = Choice::tenuto; + return getTenuto()->fromXElement(message, xelement); + } + + if (xelement.getName() == "detached-legato") + { + myChoice = Choice::detachedLegato; + return getDetachedLegato()->fromXElement(message, xelement); + } + if (xelement.getName() == "staccatissimo") + { + myChoice = Choice::staccatissimo; + return getStaccatissimo()->fromXElement(message, xelement); + } - void ArticulationsChoice::setPlop( const PlopPtr& value ) - { - if( value ) - { - myPlop = value; - } - } + if (xelement.getName() == "spiccato") + { + myChoice = Choice::spiccato; + return getSpiccato()->fromXElement(message, xelement); + } + if (xelement.getName() == "scoop") + { + myChoice = Choice::scoop; + return getScoop()->fromXElement(message, xelement); + } - DoitPtr ArticulationsChoice::getDoit() const - { - return myDoit; - } + if (xelement.getName() == "plop") + { + myChoice = Choice::plop; + return getPlop()->fromXElement(message, xelement); + } + if (xelement.getName() == "doit") + { + myChoice = Choice::doit; + return getDoit()->fromXElement(message, xelement); + } - void ArticulationsChoice::setDoit( const DoitPtr& value ) - { - if( value ) - { - myDoit = value; - } - } + if (xelement.getName() == "falloff") + { + myChoice = Choice::falloff; + return getFalloff()->fromXElement(message, xelement); + } + if (xelement.getName() == "breath-mark") + { + myChoice = Choice::breathMark; + return getBreathMark()->fromXElement(message, xelement); + } - FalloffPtr ArticulationsChoice::getFalloff() const - { - return myFalloff; - } + if (xelement.getName() == "caesura") + { + myChoice = Choice::caesura; + return getCaesura()->fromXElement(message, xelement); + } + if (xelement.getName() == "stress") + { + myChoice = Choice::stress; + return getStress()->fromXElement(message, xelement); + } - void ArticulationsChoice::setFalloff( const FalloffPtr& value ) - { - if( value ) - { - myFalloff = value; - } - } - - - BreathMarkPtr ArticulationsChoice::getBreathMark() const - { - return myBreathMark; - } - - - void ArticulationsChoice::setBreathMark( const BreathMarkPtr& value ) - { - if( value ) - { - myBreathMark = value; - } - } - - - CaesuraPtr ArticulationsChoice::getCaesura() const - { - return myCaesura; - } - - - void ArticulationsChoice::setCaesura( const CaesuraPtr& value ) - { - if( value ) - { - myCaesura = value; - } - } - - - StressPtr ArticulationsChoice::getStress() const - { - return myStress; - } - - - void ArticulationsChoice::setStress( const StressPtr& value ) - { - if( value ) - { - myStress = value; - } - } - - - UnstressPtr ArticulationsChoice::getUnstress() const - { - return myUnstress; - } - - - void ArticulationsChoice::setUnstress( const UnstressPtr& value ) - { - if( value ) - { - myUnstress = value; - } - } - - - OtherArticulationPtr ArticulationsChoice::getOtherArticulation() const - { - return myOtherArticulation; - } - - - void ArticulationsChoice::setOtherArticulation( const OtherArticulationPtr& value ) - { - if( value ) - { - myOtherArticulation = value; - } - } - - - bool ArticulationsChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - if( xelement.getName() == "accent" ) - { - myChoice = Choice::accent; - return getAccent()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "strong-accent" ) - { - myChoice = Choice::strongAccent; - return getStrongAccent()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "staccato" ) - { - myChoice = Choice::staccato; - return getStaccato()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "tenuto" ) - { - myChoice = Choice::tenuto; - return getTenuto()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "detached-legato" ) - { - myChoice = Choice::detachedLegato; - return getDetachedLegato()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "staccatissimo" ) - { - myChoice = Choice::staccatissimo; - return getStaccatissimo()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "spiccato" ) - { - myChoice = Choice::spiccato; - return getSpiccato()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "scoop" ) - { - myChoice = Choice::scoop; - return getScoop()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "plop" ) - { - myChoice = Choice::plop; - return getPlop()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "doit" ) - { - myChoice = Choice::doit; - return getDoit()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "falloff" ) - { - myChoice = Choice::falloff; - return getFalloff()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "breath-mark" ) - { - myChoice = Choice::breathMark; - return getBreathMark()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "caesura" ) - { - myChoice = Choice::caesura; - return getCaesura()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stress" ) - { - myChoice = Choice::stress; - return getStress()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "unstress" ) - { - myChoice = Choice::unstress; - return getUnstress()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "other-articulation" ) - { - myChoice = Choice::otherArticulation; - return getOtherArticulation()->fromXElement( message, xelement ); - } - - message << "ArticulationsChoice: '" << xelement.getName() << "' is not allowed" << std::endl; - return false; - } + if (xelement.getName() == "unstress") + { + myChoice = Choice::unstress; + return getUnstress()->fromXElement(message, xelement); + } + if (xelement.getName() == "other-articulation") + { + myChoice = Choice::otherArticulation; + return getOtherArticulation()->fromXElement(message, xelement); } + + message << "ArticulationsChoice: '" << xelement.getName() << "' is not allowed" << std::endl; + return false; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ArticulationsChoice.h b/Sourcecode/private/mx/core/elements/ArticulationsChoice.h index 4d82061cd..92580ab21 100644 --- a/Sourcecode/private/mx/core/elements/ArticulationsChoice.h +++ b/Sourcecode/private/mx/core/elements/ArticulationsChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,148 +13,151 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Accent ) - MX_FORWARD_DECLARE_ELEMENT( BreathMark ) - MX_FORWARD_DECLARE_ELEMENT( Caesura ) - MX_FORWARD_DECLARE_ELEMENT( DetachedLegato ) - MX_FORWARD_DECLARE_ELEMENT( Doit ) - MX_FORWARD_DECLARE_ELEMENT( Falloff ) - MX_FORWARD_DECLARE_ELEMENT( OtherArticulation ) - MX_FORWARD_DECLARE_ELEMENT( Plop ) - MX_FORWARD_DECLARE_ELEMENT( Scoop ) - MX_FORWARD_DECLARE_ELEMENT( Spiccato ) - MX_FORWARD_DECLARE_ELEMENT( Staccatissimo ) - MX_FORWARD_DECLARE_ELEMENT( Staccato ) - MX_FORWARD_DECLARE_ELEMENT( Stress ) - MX_FORWARD_DECLARE_ELEMENT( StrongAccent ) - MX_FORWARD_DECLARE_ELEMENT( Tenuto ) - MX_FORWARD_DECLARE_ELEMENT( Unstress ) - MX_FORWARD_DECLARE_ELEMENT( ArticulationsChoice ) - - inline ArticulationsChoicePtr makeArticulationsChoice() { return std::make_shared(); } - - class ArticulationsChoice : public ElementInterface - { - public: - enum class Choice - { - accent = 1, - strongAccent = 2, - staccato = 3, - tenuto = 4, - detachedLegato = 5, - staccatissimo = 6, - spiccato = 7, - scoop = 8, - plop = 9, - doit = 10, - falloff = 11, - breathMark = 12, - caesura = 13, - stress = 14, - unstress = 15, - otherArticulation = 16 - }; - ArticulationsChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - ArticulationsChoice::Choice getChoice() const; - void setChoice( const ArticulationsChoice::Choice value ); - - /* _________ Accent minOccurs = 1, maxOccurs = 1 _________ */ - AccentPtr getAccent() const; - void setAccent( const AccentPtr& value ); - - /* _________ StrongAccent minOccurs = 1, maxOccurs = 1 _________ */ - StrongAccentPtr getStrongAccent() const; - void setStrongAccent( const StrongAccentPtr& value ); - - /* _________ Staccato minOccurs = 1, maxOccurs = 1 _________ */ - StaccatoPtr getStaccato() const; - void setStaccato( const StaccatoPtr& value ); - - /* _________ Tenuto minOccurs = 1, maxOccurs = 1 _________ */ - TenutoPtr getTenuto() const; - void setTenuto( const TenutoPtr& value ); - - /* _________ DetachedLegato minOccurs = 1, maxOccurs = 1 _________ */ - DetachedLegatoPtr getDetachedLegato() const; - void setDetachedLegato( const DetachedLegatoPtr& value ); - - /* _________ Staccatissimo minOccurs = 1, maxOccurs = 1 _________ */ - StaccatissimoPtr getStaccatissimo() const; - void setStaccatissimo( const StaccatissimoPtr& value ); - - /* _________ Spiccato minOccurs = 1, maxOccurs = 1 _________ */ - SpiccatoPtr getSpiccato() const; - void setSpiccato( const SpiccatoPtr& value ); - - /* _________ Scoop minOccurs = 1, maxOccurs = 1 _________ */ - ScoopPtr getScoop() const; - void setScoop( const ScoopPtr& value ); - - /* _________ Plop minOccurs = 1, maxOccurs = 1 _________ */ - PlopPtr getPlop() const; - void setPlop( const PlopPtr& value ); - - /* _________ Doit minOccurs = 1, maxOccurs = 1 _________ */ - DoitPtr getDoit() const; - void setDoit( const DoitPtr& value ); - - /* _________ Falloff minOccurs = 1, maxOccurs = 1 _________ */ - FalloffPtr getFalloff() const; - void setFalloff( const FalloffPtr& value ); - - /* _________ BreathMark minOccurs = 1, maxOccurs = 1 _________ */ - BreathMarkPtr getBreathMark() const; - void setBreathMark( const BreathMarkPtr& value ); - - /* _________ Caesura minOccurs = 1, maxOccurs = 1 _________ */ - CaesuraPtr getCaesura() const; - void setCaesura( const CaesuraPtr& value ); - - /* _________ Stress minOccurs = 1, maxOccurs = 1 _________ */ - StressPtr getStress() const; - void setStress( const StressPtr& value ); - - /* _________ Unstress minOccurs = 1, maxOccurs = 1 _________ */ - UnstressPtr getUnstress() const; - void setUnstress( const UnstressPtr& value ); - - /* _________ OtherArticulation minOccurs = 1, maxOccurs = 1 _________ */ - OtherArticulationPtr getOtherArticulation() const; - void setOtherArticulation( const OtherArticulationPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - AccentPtr myAccent; - StrongAccentPtr myStrongAccent; - StaccatoPtr myStaccato; - TenutoPtr myTenuto; - DetachedLegatoPtr myDetachedLegato; - StaccatissimoPtr myStaccatissimo; - SpiccatoPtr mySpiccato; - ScoopPtr myScoop; - PlopPtr myPlop; - DoitPtr myDoit; - FalloffPtr myFalloff; - BreathMarkPtr myBreathMark; - CaesuraPtr myCaesura; - StressPtr myStress; - UnstressPtr myUnstress; - OtherArticulationPtr myOtherArticulation; - }; - } +MX_FORWARD_DECLARE_ELEMENT(Accent) +MX_FORWARD_DECLARE_ELEMENT(BreathMark) +MX_FORWARD_DECLARE_ELEMENT(Caesura) +MX_FORWARD_DECLARE_ELEMENT(DetachedLegato) +MX_FORWARD_DECLARE_ELEMENT(Doit) +MX_FORWARD_DECLARE_ELEMENT(Falloff) +MX_FORWARD_DECLARE_ELEMENT(OtherArticulation) +MX_FORWARD_DECLARE_ELEMENT(Plop) +MX_FORWARD_DECLARE_ELEMENT(Scoop) +MX_FORWARD_DECLARE_ELEMENT(Spiccato) +MX_FORWARD_DECLARE_ELEMENT(Staccatissimo) +MX_FORWARD_DECLARE_ELEMENT(Staccato) +MX_FORWARD_DECLARE_ELEMENT(Stress) +MX_FORWARD_DECLARE_ELEMENT(StrongAccent) +MX_FORWARD_DECLARE_ELEMENT(Tenuto) +MX_FORWARD_DECLARE_ELEMENT(Unstress) +MX_FORWARD_DECLARE_ELEMENT(ArticulationsChoice) + +inline ArticulationsChoicePtr makeArticulationsChoice() +{ + return std::make_shared(); } + +class ArticulationsChoice : public ElementInterface +{ + public: + enum class Choice + { + accent = 1, + strongAccent = 2, + staccato = 3, + tenuto = 4, + detachedLegato = 5, + staccatissimo = 6, + spiccato = 7, + scoop = 8, + plop = 9, + doit = 10, + falloff = 11, + breathMark = 12, + caesura = 13, + stress = 14, + unstress = 15, + otherArticulation = 16 + }; + ArticulationsChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + ArticulationsChoice::Choice getChoice() const; + void setChoice(const ArticulationsChoice::Choice value); + + /* _________ Accent minOccurs = 1, maxOccurs = 1 _________ */ + AccentPtr getAccent() const; + void setAccent(const AccentPtr &value); + + /* _________ StrongAccent minOccurs = 1, maxOccurs = 1 _________ */ + StrongAccentPtr getStrongAccent() const; + void setStrongAccent(const StrongAccentPtr &value); + + /* _________ Staccato minOccurs = 1, maxOccurs = 1 _________ */ + StaccatoPtr getStaccato() const; + void setStaccato(const StaccatoPtr &value); + + /* _________ Tenuto minOccurs = 1, maxOccurs = 1 _________ */ + TenutoPtr getTenuto() const; + void setTenuto(const TenutoPtr &value); + + /* _________ DetachedLegato minOccurs = 1, maxOccurs = 1 _________ */ + DetachedLegatoPtr getDetachedLegato() const; + void setDetachedLegato(const DetachedLegatoPtr &value); + + /* _________ Staccatissimo minOccurs = 1, maxOccurs = 1 _________ */ + StaccatissimoPtr getStaccatissimo() const; + void setStaccatissimo(const StaccatissimoPtr &value); + + /* _________ Spiccato minOccurs = 1, maxOccurs = 1 _________ */ + SpiccatoPtr getSpiccato() const; + void setSpiccato(const SpiccatoPtr &value); + + /* _________ Scoop minOccurs = 1, maxOccurs = 1 _________ */ + ScoopPtr getScoop() const; + void setScoop(const ScoopPtr &value); + + /* _________ Plop minOccurs = 1, maxOccurs = 1 _________ */ + PlopPtr getPlop() const; + void setPlop(const PlopPtr &value); + + /* _________ Doit minOccurs = 1, maxOccurs = 1 _________ */ + DoitPtr getDoit() const; + void setDoit(const DoitPtr &value); + + /* _________ Falloff minOccurs = 1, maxOccurs = 1 _________ */ + FalloffPtr getFalloff() const; + void setFalloff(const FalloffPtr &value); + + /* _________ BreathMark minOccurs = 1, maxOccurs = 1 _________ */ + BreathMarkPtr getBreathMark() const; + void setBreathMark(const BreathMarkPtr &value); + + /* _________ Caesura minOccurs = 1, maxOccurs = 1 _________ */ + CaesuraPtr getCaesura() const; + void setCaesura(const CaesuraPtr &value); + + /* _________ Stress minOccurs = 1, maxOccurs = 1 _________ */ + StressPtr getStress() const; + void setStress(const StressPtr &value); + + /* _________ Unstress minOccurs = 1, maxOccurs = 1 _________ */ + UnstressPtr getUnstress() const; + void setUnstress(const UnstressPtr &value); + + /* _________ OtherArticulation minOccurs = 1, maxOccurs = 1 _________ */ + OtherArticulationPtr getOtherArticulation() const; + void setOtherArticulation(const OtherArticulationPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + AccentPtr myAccent; + StrongAccentPtr myStrongAccent; + StaccatoPtr myStaccato; + TenutoPtr myTenuto; + DetachedLegatoPtr myDetachedLegato; + StaccatissimoPtr myStaccatissimo; + SpiccatoPtr mySpiccato; + ScoopPtr myScoop; + PlopPtr myPlop; + DoitPtr myDoit; + FalloffPtr myFalloff; + BreathMarkPtr myBreathMark; + CaesuraPtr myCaesura; + StressPtr myStress; + UnstressPtr myUnstress; + OtherArticulationPtr myOtherArticulation; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Artificial.cpp b/Sourcecode/private/mx/core/elements/Artificial.cpp index 809ce27c1..78f7ee343 100644 --- a/Sourcecode/private/mx/core/elements/Artificial.cpp +++ b/Sourcecode/private/mx/core/elements/Artificial.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Artificial::Artificial() : ElementInterface() {} - +namespace core +{ +Artificial::Artificial() : ElementInterface() +{ +} - bool Artificial::hasAttributes() const { return false; } +bool Artificial::hasAttributes() const +{ + return false; +} +bool Artificial::hasContents() const +{ + return false; +} - bool Artificial::hasContents() const { return false; } - std::ostream& Artificial::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Artificial::streamName( std::ostream& os ) const { os << "artificial"; return os; } - std::ostream& Artificial::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Artificial::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Artificial::streamName(std::ostream &os) const +{ + os << "artificial"; + return os; +} - bool Artificial::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &Artificial::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Artificial::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Artificial.h b/Sourcecode/private/mx/core/elements/Artificial.h index 9f260b515..a29028059 100644 --- a/Sourcecode/private/mx/core/elements/Artificial.h +++ b/Sourcecode/private/mx/core/elements/Artificial.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Artificial ) - - inline ArtificialPtr makeArtificial() { return std::make_shared(); } - - class Artificial : public ElementInterface - { - public: - Artificial(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Artificial) + +inline ArtificialPtr makeArtificial() +{ + return std::make_shared(); } + +class Artificial : public ElementInterface +{ + public: + Artificial(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/AttributesIterface.h b/Sourcecode/private/mx/core/elements/AttributesIterface.h index e372e24e4..30b80e505 100644 --- a/Sourcecode/private/mx/core/elements/AttributesIterface.h +++ b/Sourcecode/private/mx/core/elements/AttributesIterface.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,17 +13,17 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( AttributesIterface ) +MX_FORWARD_DECLARE_ATTRIBUTES(AttributesIterface) - struct AttributesIterface : public AttributesInterface - { - public: - AttributesIterface(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - }; - } -} +struct AttributesIterface : public AttributesInterface +{ + public: + AttributesIterface(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Backup.cpp b/Sourcecode/private/mx/core/elements/Backup.cpp index 2af48365b..c3959c155 100644 --- a/Sourcecode/private/mx/core/elements/Backup.cpp +++ b/Sourcecode/private/mx/core/elements/Backup.cpp @@ -10,98 +10,90 @@ namespace mx { - namespace core - { - Backup::Backup() - :myDuration( makeDuration() ) - ,myEditorialGroup( makeEditorialGroup() ) - {} - - - bool Backup::hasAttributes() const - { - return false; - } - - - std::ostream& Backup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Backup::streamName( std::ostream& os ) const - { - os << "backup"; - return os; - } - - - bool Backup::hasContents() const - { - return true; - } - +namespace core +{ +Backup::Backup() : myDuration(makeDuration()), myEditorialGroup(makeEditorialGroup()) +{ +} - std::ostream& Backup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myDuration->toStream( os, indentLevel+1 ); - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - } - isOneLineOnly = false; - return os; - } +bool Backup::hasAttributes() const +{ + return false; +} +std::ostream &Backup::streamAttributes(std::ostream &os) const +{ + return os; +} - DurationPtr Backup::getDuration() const - { - return myDuration; - } +std::ostream &Backup::streamName(std::ostream &os) const +{ + os << "backup"; + return os; +} +bool Backup::hasContents() const +{ + return true; +} - void Backup::setDuration( const DurationPtr& value ) - { - if( value ) - { - myDuration = value; - } - } +std::ostream &Backup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myDuration->toStream(os, indentLevel + 1); + os << std::endl; + myEditorialGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + if (myEditorialGroup->hasContents()) + { + os << std::endl; + } + isOneLineOnly = false; + return os; +} +DurationPtr Backup::getDuration() const +{ + return myDuration; +} - EditorialGroupPtr Backup::getEditorialGroup() const - { - return myEditorialGroup; - } +void Backup::setDuration(const DurationPtr &value) +{ + if (value) + { + myDuration = value; + } +} +EditorialGroupPtr Backup::getEditorialGroup() const +{ + return myEditorialGroup; +} - void Backup::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } +void Backup::setEditorialGroup(const EditorialGroupPtr &value) +{ + if (value) + { + myEditorialGroup = value; + } +} +bool Backup::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isDurationFound = false; - bool Backup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myDuration, isDurationFound)) { - bool isSuccess = true; - bool isDurationFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myDuration, isDurationFound ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - } - - MX_RETURN_IS_SUCCESS; + continue; } - + importGroup(message, it, endIter, isSuccess, myEditorialGroup); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Backup.h b/Sourcecode/private/mx/core/elements/Backup.h index 9485a2b41..660bfbe7c 100644 --- a/Sourcecode/private/mx/core/elements/Backup.h +++ b/Sourcecode/private/mx/core/elements/Backup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,40 +13,43 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Backup ) - - inline BackupPtr makeBackup() { return std::make_shared(); } - - class Backup : public ElementInterface - { - public: - Backup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DurationPtr myDuration; - EditorialGroupPtr myEditorialGroup; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Duration) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) +MX_FORWARD_DECLARE_ELEMENT(Backup) + +inline BackupPtr makeBackup() +{ + return std::make_shared(); } + +class Backup : public ElementInterface +{ + public: + Backup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ + DurationPtr getDuration() const; + void setDuration(const DurationPtr &value); + + /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialGroupPtr getEditorialGroup() const; + void setEditorialGroup(const EditorialGroupPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DurationPtr myDuration; + EditorialGroupPtr myEditorialGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BarStyle.cpp b/Sourcecode/private/mx/core/elements/BarStyle.cpp index 82ab7be09..8524144ff 100644 --- a/Sourcecode/private/mx/core/elements/BarStyle.cpp +++ b/Sourcecode/private/mx/core/elements/BarStyle.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - BarStyle::BarStyle() - :myValue( BarStyleEnum::regular ) - ,myAttributes( std::make_shared() ) - {} - - - BarStyle::BarStyle( const BarStyleEnum& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool BarStyle::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool BarStyle::hasContents() const - { - return true; - } - - - std::ostream& BarStyle::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& BarStyle::streamName( std::ostream& os ) const - { - os << "bar-style"; - return os; - } - - - std::ostream& BarStyle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +BarStyle::BarStyle() : myValue(BarStyleEnum::regular), myAttributes(std::make_shared()) +{ +} +BarStyle::BarStyle(const BarStyleEnum &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - BarStyleAttributesPtr BarStyle::getAttributes() const - { - return myAttributes; - } +bool BarStyle::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool BarStyle::hasContents() const +{ + return true; +} - void BarStyle::setAttributes( const BarStyleAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &BarStyle::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &BarStyle::streamName(std::ostream &os) const +{ + os << "bar-style"; + return os; +} - BarStyleEnum BarStyle::getValue() const - { - return myValue; - } +std::ostream &BarStyle::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +BarStyleAttributesPtr BarStyle::getAttributes() const +{ + return myAttributes; +} - void BarStyle::setValue( const BarStyleEnum& value ) - { - myValue = value; - } +void BarStyle::setAttributes(const BarStyleAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +BarStyleEnum BarStyle::getValue() const +{ + return myValue; +} - bool BarStyle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBarStyleEnum( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void BarStyle::setValue(const BarStyleEnum &value) +{ + myValue = value; +} - } +bool BarStyle::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseBarStyleEnum(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BarStyle.h b/Sourcecode/private/mx/core/elements/BarStyle.h index 9488d453c..d5faf2ce0 100644 --- a/Sourcecode/private/mx/core/elements/BarStyle.h +++ b/Sourcecode/private/mx/core/elements/BarStyle.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BarStyleAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarStyleAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BarStyle ) - - inline BarStylePtr makeBarStyle() { return std::make_shared(); } - inline BarStylePtr makeBarStyle( const BarStyleEnum& value ) { return std::make_shared( value ); } - inline BarStylePtr makeBarStyle( BarStyleEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class BarStyle : public ElementInterface - { - public: - BarStyle(); - BarStyle( const BarStyleEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BarStyleAttributesPtr getAttributes() const; - void setAttributes( const BarStyleAttributesPtr& attributes ); - BarStyleEnum getValue() const; - void setValue( const BarStyleEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BarStyleEnum myValue; - BarStyleAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BarStyleAttributes) +MX_FORWARD_DECLARE_ELEMENT(BarStyle) + +inline BarStylePtr makeBarStyle() +{ + return std::make_shared(); +} + +inline BarStylePtr makeBarStyle(const BarStyleEnum &value) +{ + return std::make_shared(value); } + +inline BarStylePtr makeBarStyle(BarStyleEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class BarStyle : public ElementInterface +{ + public: + BarStyle(); + BarStyle(const BarStyleEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BarStyleAttributesPtr getAttributes() const; + void setAttributes(const BarStyleAttributesPtr &attributes); + BarStyleEnum getValue() const; + void setValue(const BarStyleEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BarStyleEnum myValue; + BarStyleAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp b/Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp index a3557b014..875cbb4c9 100644 --- a/Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - BarStyleAttributes::BarStyleAttributes() - :color() - ,hasColor( false ) - {} - +namespace core +{ +BarStyleAttributes::BarStyleAttributes() : color(), hasColor(false) +{ +} - bool BarStyleAttributes::hasValues() const - { - return hasColor; - } +bool BarStyleAttributes::hasValues() const +{ + return hasColor; +} +std::ostream &BarStyleAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, color, "color", hasColor); + } + return os; +} - std::ostream& BarStyleAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, color, "color", hasColor ); - } - return os; - } +bool BarStyleAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BarStyleAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BarStyleAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) { - const char* const className = "BarStyleAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BarStyleAttributes.h b/Sourcecode/private/mx/core/elements/BarStyleAttributes.h index 6ee38c5a1..33beff715 100644 --- a/Sourcecode/private/mx/core/elements/BarStyleAttributes.h +++ b/Sourcecode/private/mx/core/elements/BarStyleAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BarStyleAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BarStyleAttributes) - struct BarStyleAttributes : public AttributesInterface - { - public: - BarStyleAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - Color color; - bool hasColor; +struct BarStyleAttributes : public AttributesInterface +{ + public: + BarStyleAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + Color color; + bool hasColor; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Barline.cpp b/Sourcecode/private/mx/core/elements/Barline.cpp index 63f36efd0..7d51aed0e 100644 --- a/Sourcecode/private/mx/core/elements/Barline.cpp +++ b/Sourcecode/private/mx/core/elements/Barline.cpp @@ -16,368 +16,331 @@ namespace mx { - namespace core - { - Barline::Barline() - :myAttributes( std::make_shared() ) - ,myBarStyle( makeBarStyle() ) - ,myHasBarStyle( false ) - ,myEditorialGroup( makeEditorialGroup() ) - ,myWavyLine( makeWavyLine() ) - ,myHasWavyLine( false ) - ,mySegno( makeSegno() ) - ,myHasSegno( false ) - ,myCoda( makeCoda() ) - ,myHasCoda( false ) - ,myFermataSet() - ,myEnding( makeEnding() ) - ,myHasEnding( false ) - ,myRepeat( makeRepeat() ) - ,myHasRepeat( false ) - {} - - - bool Barline::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Barline::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Barline::streamName( std::ostream& os ) const - { - os << "barline"; - return os; - } - - - bool Barline::hasContents() const - { - return myHasBarStyle - || myEditorialGroup->hasContents() - || myHasWavyLine - || myHasSegno - || myHasCoda - || myFermataSet.size() > 0 - || myHasEnding - || myHasRepeat; - } - - - std::ostream& Barline::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasBarStyle ) - { - os << std::endl; - myBarStyle->toStream( os, indentLevel+1 ); - } - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasWavyLine ) - { - os << std::endl; - myWavyLine->toStream( os, indentLevel+1 ); - } - if ( myHasSegno ) - { - os << std::endl; - mySegno->toStream( os, indentLevel+1 ); - } - if ( myHasCoda ) - { - os << std::endl; - myCoda->toStream( os, indentLevel+1 ); - } - for ( auto x : myFermataSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasEnding ) - { - os << std::endl; - myEnding->toStream( os, indentLevel+1 ); - } - if ( myHasRepeat ) - { - os << std::endl; - myRepeat->toStream( os, indentLevel+1 ); - } - isOneLineOnly = ! hasContents(); - if ( ! isOneLineOnly ) - { - os << std::endl; - } - return os; - } - - - BarlineAttributesPtr Barline::getAttributes() const - { - return myAttributes; - } - - - void Barline::setAttributes( const BarlineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BarStylePtr Barline::getBarStyle() const - { - return myBarStyle; - } - - - void Barline::setBarStyle( const BarStylePtr& value ) - { - if( value ) - { - myBarStyle = value; - } - } - - - bool Barline::getHasBarStyle() const - { - return myHasBarStyle; - } - - - void Barline::setHasBarStyle( const bool value ) - { - myHasBarStyle = value; - } - - - EditorialGroupPtr Barline::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void Barline::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } - +namespace core +{ +Barline::Barline() + : myAttributes(std::make_shared()), myBarStyle(makeBarStyle()), myHasBarStyle(false), + myEditorialGroup(makeEditorialGroup()), myWavyLine(makeWavyLine()), myHasWavyLine(false), mySegno(makeSegno()), + myHasSegno(false), myCoda(makeCoda()), myHasCoda(false), myFermataSet(), myEnding(makeEnding()), + myHasEnding(false), myRepeat(makeRepeat()), myHasRepeat(false) +{ +} - WavyLinePtr Barline::getWavyLine() const - { - return myWavyLine; - } +bool Barline::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Barline::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void Barline::setWavyLine( const WavyLinePtr& value ) - { - if( value ) - { - myWavyLine = value; - } - } +std::ostream &Barline::streamName(std::ostream &os) const +{ + os << "barline"; + return os; +} +bool Barline::hasContents() const +{ + return myHasBarStyle || myEditorialGroup->hasContents() || myHasWavyLine || myHasSegno || myHasCoda || + myFermataSet.size() > 0 || myHasEnding || myHasRepeat; +} - bool Barline::getHasWavyLine() const - { - return myHasWavyLine; - } +std::ostream &Barline::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasBarStyle) + { + os << std::endl; + myBarStyle->toStream(os, indentLevel + 1); + } + if (myEditorialGroup->hasContents()) + { + os << std::endl; + myEditorialGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + } + if (myHasWavyLine) + { + os << std::endl; + myWavyLine->toStream(os, indentLevel + 1); + } + if (myHasSegno) + { + os << std::endl; + mySegno->toStream(os, indentLevel + 1); + } + if (myHasCoda) + { + os << std::endl; + myCoda->toStream(os, indentLevel + 1); + } + for (auto x : myFermataSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + if (myHasEnding) + { + os << std::endl; + myEnding->toStream(os, indentLevel + 1); + } + if (myHasRepeat) + { + os << std::endl; + myRepeat->toStream(os, indentLevel + 1); + } + isOneLineOnly = !hasContents(); + if (!isOneLineOnly) + { + os << std::endl; + } + return os; +} +BarlineAttributesPtr Barline::getAttributes() const +{ + return myAttributes; +} - void Barline::setHasWavyLine( const bool value ) - { - myHasWavyLine = value; - } +void Barline::setAttributes(const BarlineAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +BarStylePtr Barline::getBarStyle() const +{ + return myBarStyle; +} - SegnoPtr Barline::getSegno() const - { - return mySegno; - } +void Barline::setBarStyle(const BarStylePtr &value) +{ + if (value) + { + myBarStyle = value; + } +} +bool Barline::getHasBarStyle() const +{ + return myHasBarStyle; +} - void Barline::setSegno( const SegnoPtr& value ) - { - if( value ) - { - mySegno = value; - } - } +void Barline::setHasBarStyle(const bool value) +{ + myHasBarStyle = value; +} +EditorialGroupPtr Barline::getEditorialGroup() const +{ + return myEditorialGroup; +} - bool Barline::getHasSegno() const - { - return myHasSegno; - } +void Barline::setEditorialGroup(const EditorialGroupPtr &value) +{ + if (value) + { + myEditorialGroup = value; + } +} +WavyLinePtr Barline::getWavyLine() const +{ + return myWavyLine; +} - void Barline::setHasSegno( const bool value ) - { - myHasSegno = value; - } +void Barline::setWavyLine(const WavyLinePtr &value) +{ + if (value) + { + myWavyLine = value; + } +} +bool Barline::getHasWavyLine() const +{ + return myHasWavyLine; +} - CodaPtr Barline::getCoda() const - { - return myCoda; - } +void Barline::setHasWavyLine(const bool value) +{ + myHasWavyLine = value; +} +SegnoPtr Barline::getSegno() const +{ + return mySegno; +} - void Barline::setCoda( const CodaPtr& value ) - { - if( value ) - { - myCoda = value; - } - } +void Barline::setSegno(const SegnoPtr &value) +{ + if (value) + { + mySegno = value; + } +} +bool Barline::getHasSegno() const +{ + return myHasSegno; +} - bool Barline::getHasCoda() const - { - return myHasCoda; - } +void Barline::setHasSegno(const bool value) +{ + myHasSegno = value; +} +CodaPtr Barline::getCoda() const +{ + return myCoda; +} - void Barline::setHasCoda( const bool value ) - { - myHasCoda = value; - } +void Barline::setCoda(const CodaPtr &value) +{ + if (value) + { + myCoda = value; + } +} +bool Barline::getHasCoda() const +{ + return myHasCoda; +} - const FermataSet& Barline::getFermataSet() const - { - return myFermataSet; - } +void Barline::setHasCoda(const bool value) +{ + myHasCoda = value; +} +const FermataSet &Barline::getFermataSet() const +{ + return myFermataSet; +} - void Barline::removeFermata( const FermataSetIterConst& value ) +void Barline::removeFermata(const FermataSetIterConst &value) +{ + if (value != myFermataSet.cend()) + { + if (myFermataSet.size() > 0) { - if ( value != myFermataSet.cend() ) - { - if ( myFermataSet.size() > 0 ) - { - myFermataSet.erase( value ); - } - } + myFermataSet.erase(value); } + } +} - - void Barline::addFermata( const FermataPtr& value ) +void Barline::addFermata(const FermataPtr &value) +{ + if (value) + { + if (myFermataSet.size() < 2) { - if ( value ) - { - if ( myFermataSet.size() < 2 ) - { - myFermataSet.push_back( value ); - } - } + myFermataSet.push_back(value); } + } +} +void Barline::clearFermataSet() +{ + myFermataSet.clear(); +} - void Barline::clearFermataSet() - { - myFermataSet.clear(); - } +FermataPtr Barline::getFermata(const FermataSetIterConst &setIterator) const +{ + if (setIterator != myFermataSet.cend()) + { + return *setIterator; + } + return FermataPtr(); +} +EndingPtr Barline::getEnding() const +{ + return myEnding; +} - FermataPtr Barline::getFermata( const FermataSetIterConst& setIterator ) const - { - if( setIterator != myFermataSet.cend() ) - { - return *setIterator; - } - return FermataPtr(); - } +void Barline::setEnding(const EndingPtr &value) +{ + if (value) + { + myEnding = value; + } +} +bool Barline::getHasEnding() const +{ + return myHasEnding; +} - EndingPtr Barline::getEnding() const - { - return myEnding; - } +void Barline::setHasEnding(const bool value) +{ + myHasEnding = value; +} +RepeatPtr Barline::getRepeat() const +{ + return myRepeat; +} - void Barline::setEnding( const EndingPtr& value ) - { - if( value ) - { - myEnding = value; - } - } +void Barline::setRepeat(const RepeatPtr &value) +{ + if (value) + { + myRepeat = value; + } +} +bool Barline::getHasRepeat() const +{ + return myHasRepeat; +} - bool Barline::getHasEnding() const - { - return myHasEnding; - } +void Barline::setHasRepeat(const bool value) +{ + myHasRepeat = value; +} +bool Barline::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - void Barline::setHasEnding( const bool value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myBarStyle, myHasBarStyle)) { - myHasEnding = value; + continue; } - - - RepeatPtr Barline::getRepeat() const + importGroup(message, it, endIter, isSuccess, myEditorialGroup); + if (importElement(message, *it, isSuccess, *myWavyLine, myHasWavyLine)) { - return myRepeat; + continue; } - - - void Barline::setRepeat( const RepeatPtr& value ) + if (importElement(message, *it, isSuccess, *mySegno, myHasSegno)) { - if( value ) - { - myRepeat = value; - } + continue; } - - - bool Barline::getHasRepeat() const + if (importElement(message, *it, isSuccess, *myCoda, myHasCoda)) { - return myHasRepeat; + continue; } - - - void Barline::setHasRepeat( const bool value ) + importElementSet(message, it, endIter, isSuccess, "fermata", myFermataSet); + if (importElement(message, *it, isSuccess, *myEnding, myHasEnding)) { - myHasRepeat = value; + continue; } - - - bool Barline::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myRepeat, myHasRepeat)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myBarStyle, myHasBarStyle ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - if ( importElement( message, *it, isSuccess, *myWavyLine, myHasWavyLine ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySegno, myHasSegno ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myCoda, myHasCoda ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "fermata", myFermataSet ); - if ( importElement( message, *it, isSuccess, *myEnding, myHasEnding ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRepeat, myHasRepeat ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Barline.h b/Sourcecode/private/mx/core/elements/Barline.h index bb6b247be..6b9a072ee 100644 --- a/Sourcecode/private/mx/core/elements/Barline.h +++ b/Sourcecode/private/mx/core/elements/Barline.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BarlineAttributes.h" #include @@ -14,101 +14,104 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarlineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BarStyle ) - MX_FORWARD_DECLARE_ELEMENT( Coda ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Ending ) - MX_FORWARD_DECLARE_ELEMENT( Fermata ) - MX_FORWARD_DECLARE_ELEMENT( Repeat ) - MX_FORWARD_DECLARE_ELEMENT( Segno ) - MX_FORWARD_DECLARE_ELEMENT( WavyLine ) - MX_FORWARD_DECLARE_ELEMENT( Barline ) - - inline BarlinePtr makeBarline() { return std::make_shared(); } - - class Barline : public ElementInterface - { - public: - Barline(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BarlineAttributesPtr getAttributes() const; - void setAttributes( const BarlineAttributesPtr& value ); - - /* _________ BarStyle minOccurs = 0, maxOccurs = 1 _________ */ - BarStylePtr getBarStyle() const; - void setBarStyle( const BarStylePtr& value ); - bool getHasBarStyle() const; - void setHasBarStyle( const bool value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - /* _________ WavyLine minOccurs = 0, maxOccurs = 1 _________ */ - WavyLinePtr getWavyLine() const; - void setWavyLine( const WavyLinePtr& value ); - bool getHasWavyLine() const; - void setHasWavyLine( const bool value ); - - /* _________ Segno minOccurs = 0, maxOccurs = 1 _________ */ - SegnoPtr getSegno() const; - void setSegno( const SegnoPtr& value ); - bool getHasSegno() const; - void setHasSegno( const bool value ); - - /* _________ Coda minOccurs = 0, maxOccurs = 1 _________ */ - CodaPtr getCoda() const; - void setCoda( const CodaPtr& value ); - bool getHasCoda() const; - void setHasCoda( const bool value ); - - /* _________ Fermata minOccurs = 0, maxOccurs = 2 _________ */ - const FermataSet& getFermataSet() const; - void addFermata( const FermataPtr& value ); - void removeFermata( const FermataSetIterConst& value ); - void clearFermataSet(); - FermataPtr getFermata( const FermataSetIterConst& setIterator ) const; - - /* _________ Ending minOccurs = 0, maxOccurs = 1 _________ */ - EndingPtr getEnding() const; - void setEnding( const EndingPtr& value ); - bool getHasEnding() const; - void setHasEnding( const bool value ); - - /* _________ Repeat minOccurs = 0, maxOccurs = 1 _________ */ - RepeatPtr getRepeat() const; - void setRepeat( const RepeatPtr& value ); - bool getHasRepeat() const; - void setHasRepeat( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BarlineAttributesPtr myAttributes; - BarStylePtr myBarStyle; - bool myHasBarStyle; - EditorialGroupPtr myEditorialGroup; - WavyLinePtr myWavyLine; - bool myHasWavyLine; - SegnoPtr mySegno; - bool myHasSegno; - CodaPtr myCoda; - bool myHasCoda; - FermataSet myFermataSet; - EndingPtr myEnding; - bool myHasEnding; - RepeatPtr myRepeat; - bool myHasRepeat; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BarlineAttributes) +MX_FORWARD_DECLARE_ELEMENT(BarStyle) +MX_FORWARD_DECLARE_ELEMENT(Coda) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) +MX_FORWARD_DECLARE_ELEMENT(Ending) +MX_FORWARD_DECLARE_ELEMENT(Fermata) +MX_FORWARD_DECLARE_ELEMENT(Repeat) +MX_FORWARD_DECLARE_ELEMENT(Segno) +MX_FORWARD_DECLARE_ELEMENT(WavyLine) +MX_FORWARD_DECLARE_ELEMENT(Barline) + +inline BarlinePtr makeBarline() +{ + return std::make_shared(); } + +class Barline : public ElementInterface +{ + public: + Barline(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BarlineAttributesPtr getAttributes() const; + void setAttributes(const BarlineAttributesPtr &value); + + /* _________ BarStyle minOccurs = 0, maxOccurs = 1 _________ */ + BarStylePtr getBarStyle() const; + void setBarStyle(const BarStylePtr &value); + bool getHasBarStyle() const; + void setHasBarStyle(const bool value); + + /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialGroupPtr getEditorialGroup() const; + void setEditorialGroup(const EditorialGroupPtr &value); + + /* _________ WavyLine minOccurs = 0, maxOccurs = 1 _________ */ + WavyLinePtr getWavyLine() const; + void setWavyLine(const WavyLinePtr &value); + bool getHasWavyLine() const; + void setHasWavyLine(const bool value); + + /* _________ Segno minOccurs = 0, maxOccurs = 1 _________ */ + SegnoPtr getSegno() const; + void setSegno(const SegnoPtr &value); + bool getHasSegno() const; + void setHasSegno(const bool value); + + /* _________ Coda minOccurs = 0, maxOccurs = 1 _________ */ + CodaPtr getCoda() const; + void setCoda(const CodaPtr &value); + bool getHasCoda() const; + void setHasCoda(const bool value); + + /* _________ Fermata minOccurs = 0, maxOccurs = 2 _________ */ + const FermataSet &getFermataSet() const; + void addFermata(const FermataPtr &value); + void removeFermata(const FermataSetIterConst &value); + void clearFermataSet(); + FermataPtr getFermata(const FermataSetIterConst &setIterator) const; + + /* _________ Ending minOccurs = 0, maxOccurs = 1 _________ */ + EndingPtr getEnding() const; + void setEnding(const EndingPtr &value); + bool getHasEnding() const; + void setHasEnding(const bool value); + + /* _________ Repeat minOccurs = 0, maxOccurs = 1 _________ */ + RepeatPtr getRepeat() const; + void setRepeat(const RepeatPtr &value); + bool getHasRepeat() const; + void setHasRepeat(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BarlineAttributesPtr myAttributes; + BarStylePtr myBarStyle; + bool myHasBarStyle; + EditorialGroupPtr myEditorialGroup; + WavyLinePtr myWavyLine; + bool myHasWavyLine; + SegnoPtr mySegno; + bool myHasSegno; + CodaPtr myCoda; + bool myHasCoda; + FermataSet myFermataSet; + EndingPtr myEnding; + bool myHasEnding; + RepeatPtr myRepeat; + bool myHasRepeat; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BarlineAttributes.cpp b/Sourcecode/private/mx/core/elements/BarlineAttributes.cpp index 6a55db03c..f85a79a3c 100644 --- a/Sourcecode/private/mx/core/elements/BarlineAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BarlineAttributes.cpp @@ -8,61 +8,61 @@ namespace mx { - namespace core +namespace core +{ +BarlineAttributes::BarlineAttributes() + : location(RightLeftMiddle::right), segno(), coda(), divisions(), hasLocation(false), hasSegno(false), + hasCoda(false), hasDivisions(false) +{ +} + +bool BarlineAttributes::hasValues() const +{ + return hasLocation || hasSegno || hasCoda || hasDivisions; +} + +std::ostream &BarlineAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - BarlineAttributes::BarlineAttributes() - :location( RightLeftMiddle::right ) - ,segno() - ,coda() - ,divisions() - ,hasLocation( false ) - ,hasSegno( false ) - ,hasCoda( false ) - ,hasDivisions( false ) - {} + streamAttribute(os, location, "location", hasLocation); + streamAttribute(os, segno, "segno", hasSegno); + streamAttribute(os, coda, "coda", hasCoda); + streamAttribute(os, divisions, "divisions", hasDivisions); + } + return os; +} + +bool BarlineAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BarlineAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BarlineAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, location, hasLocation, "location", &parseRightLeftMiddle)) { - return hasLocation || - hasSegno || - hasCoda || - hasDivisions; + continue; } - - - std::ostream& BarlineAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, segno, hasSegno, "segno")) { - if ( hasValues() ) - { - streamAttribute( os, location, "location", hasLocation ); - streamAttribute( os, segno, "segno", hasSegno ); - streamAttribute( os, coda, "coda", hasCoda ); - streamAttribute( os, divisions, "divisions", hasDivisions ); - } - return os; + continue; } - - - bool BarlineAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, coda, hasCoda, "coda")) { - const char* const className = "BarlineAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseRightLeftMiddle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, segno, hasSegno, "segno" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, coda, hasCoda, "coda" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, divisions, hasDivisions, "divisions" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, divisions, hasDivisions, "divisions")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BarlineAttributes.h b/Sourcecode/private/mx/core/elements/BarlineAttributes.h index 360e8645f..f9ee96857 100644 --- a/Sourcecode/private/mx/core/elements/BarlineAttributes.h +++ b/Sourcecode/private/mx/core/elements/BarlineAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -16,28 +16,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BarlineAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BarlineAttributes) - struct BarlineAttributes : public AttributesInterface - { - public: - BarlineAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - RightLeftMiddle location; - XsToken segno; - XsToken coda; - DivisionsValue divisions; - bool hasLocation; - bool hasSegno; - bool hasCoda; - bool hasDivisions; +struct BarlineAttributes : public AttributesInterface +{ + public: + BarlineAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + RightLeftMiddle location; + XsToken segno; + XsToken coda; + DivisionsValue divisions; + bool hasLocation; + bool hasSegno; + bool hasCoda; + bool hasDivisions; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Barre.cpp b/Sourcecode/private/mx/core/elements/Barre.cpp index 494691071..781d44daa 100644 --- a/Sourcecode/private/mx/core/elements/Barre.cpp +++ b/Sourcecode/private/mx/core/elements/Barre.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Barre::Barre() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Barre::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Barre::hasContents() const { return false; } - std::ostream& Barre::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Barre::streamName( std::ostream& os ) const { os << "barre"; return os; } - std::ostream& Barre::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Barre::Barre() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Barre::hasAttributes() const +{ + return myAttributes->hasValues(); +} - BarreAttributesPtr Barre::getAttributes() const - { - return myAttributes; - } +bool Barre::hasContents() const +{ + return false; +} +std::ostream &Barre::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Barre::setAttributes( const BarreAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Barre::streamName(std::ostream &os) const +{ + os << "barre"; + return os; +} +std::ostream &Barre::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Barre::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +BarreAttributesPtr Barre::getAttributes() const +{ + return myAttributes; +} +void Barre::setAttributes(const BarreAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Barre::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Barre.h b/Sourcecode/private/mx/core/elements/Barre.h index 8447be667..e835ec7aa 100644 --- a/Sourcecode/private/mx/core/elements/Barre.h +++ b/Sourcecode/private/mx/core/elements/Barre.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BarreAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarreAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Barre ) - - inline BarrePtr makeBarre() { return std::make_shared(); } - - class Barre : public ElementInterface - { - public: - Barre(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BarreAttributesPtr getAttributes() const; - void setAttributes( const BarreAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BarreAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BarreAttributes) +MX_FORWARD_DECLARE_ELEMENT(Barre) + +inline BarrePtr makeBarre() +{ + return std::make_shared(); } + +class Barre : public ElementInterface +{ + public: + Barre(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BarreAttributesPtr getAttributes() const; + void setAttributes(const BarreAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BarreAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BarreAttributes.cpp b/Sourcecode/private/mx/core/elements/BarreAttributes.cpp index 5052fc9ac..a03675b5e 100644 --- a/Sourcecode/private/mx/core/elements/BarreAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BarreAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - BarreAttributes::BarreAttributes() - :type( StartStop::start ) - ,hasType( true ) - {} - +namespace core +{ +BarreAttributes::BarreAttributes() : type(StartStop::start), hasType(true) +{ +} - bool BarreAttributes::hasValues() const - { - return hasType; - } +bool BarreAttributes::hasValues() const +{ + return hasType; +} +std::ostream &BarreAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& BarreAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool BarreAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BarreAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BarreAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - const char* const className = "BarreAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BarreAttributes.h b/Sourcecode/private/mx/core/elements/BarreAttributes.h index 047a7c34a..85cdbda51 100644 --- a/Sourcecode/private/mx/core/elements/BarreAttributes.h +++ b/Sourcecode/private/mx/core/elements/BarreAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BarreAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BarreAttributes) - struct BarreAttributes : public AttributesInterface - { - public: - BarreAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - const bool hasType; +struct BarreAttributes : public AttributesInterface +{ + public: + BarreAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + const bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BasePitch.cpp b/Sourcecode/private/mx/core/elements/BasePitch.cpp index 1d7bdb4bd..749a9cdfb 100644 --- a/Sourcecode/private/mx/core/elements/BasePitch.cpp +++ b/Sourcecode/private/mx/core/elements/BasePitch.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - BasePitch::BasePitch() : ElementInterface() {} - +namespace core +{ +BasePitch::BasePitch() : ElementInterface() +{ +} - bool BasePitch::hasAttributes() const { return false; } +bool BasePitch::hasAttributes() const +{ + return false; +} +bool BasePitch::hasContents() const +{ + return false; +} - bool BasePitch::hasContents() const { return false; } - std::ostream& BasePitch::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& BasePitch::streamName( std::ostream& os ) const { os << "base-pitch"; return os; } - std::ostream& BasePitch::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &BasePitch::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &BasePitch::streamName(std::ostream &os) const +{ + os << "base-pitch"; + return os; +} - bool BasePitch::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &BasePitch::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool BasePitch::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BasePitch.h b/Sourcecode/private/mx/core/elements/BasePitch.h index d0d5f2ad0..2e9ff962c 100644 --- a/Sourcecode/private/mx/core/elements/BasePitch.h +++ b/Sourcecode/private/mx/core/elements/BasePitch.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BasePitch ) - - inline BasePitchPtr makeBasePitch() { return std::make_shared(); } - - class BasePitch : public ElementInterface - { - public: - BasePitch(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BasePitch) + +inline BasePitchPtr makeBasePitch() +{ + return std::make_shared(); } + +class BasePitch : public ElementInterface +{ + public: + BasePitch(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Bass.cpp b/Sourcecode/private/mx/core/elements/Bass.cpp index a1fa028ff..8b1088eda 100644 --- a/Sourcecode/private/mx/core/elements/Bass.cpp +++ b/Sourcecode/private/mx/core/elements/Bass.cpp @@ -10,115 +10,107 @@ namespace mx { - namespace core - { - Bass::Bass() - :myBassStep( makeBassStep() ) - ,myBassAlter( makeBassAlter() ) - ,myHasBassAlter( false ) - {} - - - bool Bass::hasAttributes() const - { - return false; - } - - - std::ostream& Bass::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Bass::streamName( std::ostream& os ) const - { - os << "bass"; - return os; - } - - - bool Bass::hasContents() const - { - return true; - } - +namespace core +{ +Bass::Bass() : myBassStep(makeBassStep()), myBassAlter(makeBassAlter()), myHasBassAlter(false) +{ +} - std::ostream& Bass::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myBassStep->toStream( os, indentLevel+1 ); - if ( myHasBassAlter ) - { - os << std::endl; - myBassAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } +bool Bass::hasAttributes() const +{ + return false; +} +std::ostream &Bass::streamAttributes(std::ostream &os) const +{ + return os; +} - BassStepPtr Bass::getBassStep() const - { - return myBassStep; - } +std::ostream &Bass::streamName(std::ostream &os) const +{ + os << "bass"; + return os; +} +bool Bass::hasContents() const +{ + return true; +} - void Bass::setBassStep( const BassStepPtr& value ) - { - if( value ) - { - myBassStep = value; - } - } +std::ostream &Bass::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myBassStep->toStream(os, indentLevel + 1); + if (myHasBassAlter) + { + os << std::endl; + myBassAlter->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} +BassStepPtr Bass::getBassStep() const +{ + return myBassStep; +} - BassAlterPtr Bass::getBassAlter() const - { - return myBassAlter; - } +void Bass::setBassStep(const BassStepPtr &value) +{ + if (value) + { + myBassStep = value; + } +} +BassAlterPtr Bass::getBassAlter() const +{ + return myBassAlter; +} - void Bass::setBassAlter( const BassAlterPtr& value ) - { - if( value ) - { - myBassAlter = value; - } - } +void Bass::setBassAlter(const BassAlterPtr &value) +{ + if (value) + { + myBassAlter = value; + } +} +bool Bass::getHasBassAlter() const +{ + return myHasBassAlter; +} - bool Bass::getHasBassAlter() const - { - return myHasBassAlter; - } +void Bass::setHasBassAlter(const bool value) +{ + myHasBassAlter = value; +} +bool Bass::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isBassStepFound = false; - void Bass::setHasBassAlter( const bool value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myBassStep, isBassStepFound)) { - myHasBassAlter = value; + continue; } - - - bool Bass::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myBassAlter, myHasBassAlter)) { - bool isSuccess = true; - bool isBassStepFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myBassStep, isBassStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBassAlter, myHasBassAlter ) ) { continue; } - } - - if( !isBassStepFound ) - { - message << "Bass: '" << myBassStep->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isBassStepFound) + { + message << "Bass: '" << myBassStep->getElementName() << "' is required but was not found" << std::endl; } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Bass.h b/Sourcecode/private/mx/core/elements/Bass.h index 4ac3b7c7d..d3a537e70 100644 --- a/Sourcecode/private/mx/core/elements/Bass.h +++ b/Sourcecode/private/mx/core/elements/Bass.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,43 +13,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BassAlter ) - MX_FORWARD_DECLARE_ELEMENT( BassStep ) - MX_FORWARD_DECLARE_ELEMENT( Bass ) - - inline BassPtr makeBass() { return std::make_shared(); } - - class Bass : public ElementInterface - { - public: - Bass(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ BassStep minOccurs = 1, maxOccurs = 1 _________ */ - BassStepPtr getBassStep() const; - void setBassStep( const BassStepPtr& value ); - - /* _________ BassAlter minOccurs = 0, maxOccurs = 1 _________ */ - BassAlterPtr getBassAlter() const; - void setBassAlter( const BassAlterPtr& value ); - bool getHasBassAlter() const; - void setHasBassAlter( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BassStepPtr myBassStep; - BassAlterPtr myBassAlter; - bool myHasBassAlter; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BassAlter) +MX_FORWARD_DECLARE_ELEMENT(BassStep) +MX_FORWARD_DECLARE_ELEMENT(Bass) + +inline BassPtr makeBass() +{ + return std::make_shared(); } + +class Bass : public ElementInterface +{ + public: + Bass(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ BassStep minOccurs = 1, maxOccurs = 1 _________ */ + BassStepPtr getBassStep() const; + void setBassStep(const BassStepPtr &value); + + /* _________ BassAlter minOccurs = 0, maxOccurs = 1 _________ */ + BassAlterPtr getBassAlter() const; + void setBassAlter(const BassAlterPtr &value); + bool getHasBassAlter() const; + void setHasBassAlter(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BassStepPtr myBassStep; + BassAlterPtr myBassAlter; + bool myHasBassAlter; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BassAlter.cpp b/Sourcecode/private/mx/core/elements/BassAlter.cpp index 5cc3c69d4..f1546412e 100644 --- a/Sourcecode/private/mx/core/elements/BassAlter.cpp +++ b/Sourcecode/private/mx/core/elements/BassAlter.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - BassAlter::BassAlter() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - BassAlter::BassAlter( const Semitones& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool BassAlter::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool BassAlter::hasContents() const - { - return true; - } - - - std::ostream& BassAlter::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& BassAlter::streamName( std::ostream& os ) const - { - os << "bass-alter"; - return os; - } - - - std::ostream& BassAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +BassAlter::BassAlter() : myValue(), myAttributes(std::make_shared()) +{ +} +BassAlter::BassAlter(const Semitones &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - BassAlterAttributesPtr BassAlter::getAttributes() const - { - return myAttributes; - } +bool BassAlter::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool BassAlter::hasContents() const +{ + return true; +} - void BassAlter::setAttributes( const BassAlterAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &BassAlter::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &BassAlter::streamName(std::ostream &os) const +{ + os << "bass-alter"; + return os; +} - Semitones BassAlter::getValue() const - { - return myValue; - } +std::ostream &BassAlter::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +BassAlterAttributesPtr BassAlter::getAttributes() const +{ + return myAttributes; +} - void BassAlter::setValue( const Semitones& value ) - { - myValue = value; - } +void BassAlter::setAttributes(const BassAlterAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +Semitones BassAlter::getValue() const +{ + return myValue; +} - bool BassAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void BassAlter::setValue(const Semitones &value) +{ + myValue = value; +} - } +bool BassAlter::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BassAlter.h b/Sourcecode/private/mx/core/elements/BassAlter.h index d635df68c..2e24cf249 100644 --- a/Sourcecode/private/mx/core/elements/BassAlter.h +++ b/Sourcecode/private/mx/core/elements/BassAlter.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BassAlterAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BassAlterAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BassAlter ) - - inline BassAlterPtr makeBassAlter() { return std::make_shared(); } - inline BassAlterPtr makeBassAlter( const Semitones& value ) { return std::make_shared( value ); } - inline BassAlterPtr makeBassAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class BassAlter : public ElementInterface - { - public: - BassAlter(); - BassAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BassAlterAttributesPtr getAttributes() const; - void setAttributes( const BassAlterAttributesPtr& attributes ); - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - BassAlterAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BassAlterAttributes) +MX_FORWARD_DECLARE_ELEMENT(BassAlter) + +inline BassAlterPtr makeBassAlter() +{ + return std::make_shared(); } + +inline BassAlterPtr makeBassAlter(const Semitones &value) +{ + return std::make_shared(value); +} + +inline BassAlterPtr makeBassAlter(Semitones &&value) +{ + return std::make_shared(std::move(value)); +} + +class BassAlter : public ElementInterface +{ + public: + BassAlter(); + BassAlter(const Semitones &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BassAlterAttributesPtr getAttributes() const; + void setAttributes(const BassAlterAttributesPtr &attributes); + Semitones getValue() const; + void setValue(const Semitones &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Semitones myValue; + BassAlterAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp b/Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp index dfb30752c..5a6d81ca4 100644 --- a/Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp @@ -8,91 +8,95 @@ namespace mx { - namespace core +namespace core +{ +BassAlterAttributes::BassAlterAttributes() + : printObject(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), location(), hasPrintObject(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasLocation(false) +{ +} + +bool BassAlterAttributes::hasValues() const +{ + return hasPrintObject || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight || hasLocation; +} + +std::ostream &BassAlterAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - BassAlterAttributes::BassAlterAttributes() - :printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,location() - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasLocation( false ) - {} + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, location, "location", hasLocation); + } + return os; +} + +bool BassAlterAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BassAlterAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BassAlterAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - return hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasLocation; + continue; } - - - std::ostream& BassAlterAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, location, "location", hasLocation ); - } - return os; + continue; } - - - bool BassAlterAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "BassAlterAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BassAlterAttributes.h b/Sourcecode/private/mx/core/elements/BassAlterAttributes.h index 6cea358b1..b935792f5 100644 --- a/Sourcecode/private/mx/core/elements/BassAlterAttributes.h +++ b/Sourcecode/private/mx/core/elements/BassAlterAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,40 +17,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BassAlterAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BassAlterAttributes) - struct BassAlterAttributes : public AttributesInterface - { - public: - BassAlterAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftRight location; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasLocation; +struct BassAlterAttributes : public AttributesInterface +{ + public: + BassAlterAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftRight location; + bool hasPrintObject; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasLocation; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BassStep.cpp b/Sourcecode/private/mx/core/elements/BassStep.cpp index cc511beb6..46bff9f89 100644 --- a/Sourcecode/private/mx/core/elements/BassStep.cpp +++ b/Sourcecode/private/mx/core/elements/BassStep.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - BassStep::BassStep() - :myValue( StepEnum::a ) - ,myAttributes( std::make_shared() ) - {} - - - BassStep::BassStep( const StepEnum& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool BassStep::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool BassStep::hasContents() const - { - return true; - } - - - std::ostream& BassStep::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& BassStep::streamName( std::ostream& os ) const - { - os << "bass-step"; - return os; - } - - - std::ostream& BassStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +BassStep::BassStep() : myValue(StepEnum::a), myAttributes(std::make_shared()) +{ +} +BassStep::BassStep(const StepEnum &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - BassStepAttributesPtr BassStep::getAttributes() const - { - return myAttributes; - } +bool BassStep::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool BassStep::hasContents() const +{ + return true; +} - void BassStep::setAttributes( const BassStepAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &BassStep::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &BassStep::streamName(std::ostream &os) const +{ + os << "bass-step"; + return os; +} - StepEnum BassStep::getValue() const - { - return myValue; - } +std::ostream &BassStep::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +BassStepAttributesPtr BassStep::getAttributes() const +{ + return myAttributes; +} - void BassStep::setValue( const StepEnum& value ) - { - myValue = value; - } +void BassStep::setAttributes(const BassStepAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +StepEnum BassStep::getValue() const +{ + return myValue; +} - bool BassStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseStepEnum( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void BassStep::setValue(const StepEnum &value) +{ + myValue = value; +} - } +bool BassStep::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseStepEnum(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BassStep.h b/Sourcecode/private/mx/core/elements/BassStep.h index 058c72ad6..c38e612f7 100644 --- a/Sourcecode/private/mx/core/elements/BassStep.h +++ b/Sourcecode/private/mx/core/elements/BassStep.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BassStepAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BassStepAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BassStep ) - - inline BassStepPtr makeBassStep() { return std::make_shared(); } - inline BassStepPtr makeBassStep( const StepEnum& value ) { return std::make_shared( value ); } - inline BassStepPtr makeBassStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class BassStep : public ElementInterface - { - public: - BassStep(); - BassStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BassStepAttributesPtr getAttributes() const; - void setAttributes( const BassStepAttributesPtr& attributes ); - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - BassStepAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BassStepAttributes) +MX_FORWARD_DECLARE_ELEMENT(BassStep) + +inline BassStepPtr makeBassStep() +{ + return std::make_shared(); +} + +inline BassStepPtr makeBassStep(const StepEnum &value) +{ + return std::make_shared(value); } + +inline BassStepPtr makeBassStep(StepEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class BassStep : public ElementInterface +{ + public: + BassStep(); + BassStep(const StepEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BassStepAttributesPtr getAttributes() const; + void setAttributes(const BassStepAttributesPtr &attributes); + StepEnum getValue() const; + void setValue(const StepEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StepEnum myValue; + BassStepAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BassStepAttributes.cpp b/Sourcecode/private/mx/core/elements/BassStepAttributes.cpp index c55d53cbf..4202e6910 100644 --- a/Sourcecode/private/mx/core/elements/BassStepAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BassStepAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +BassStepAttributes::BassStepAttributes() + : text(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasText(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false) +{ +} + +bool BassStepAttributes::hasValues() const +{ + return hasText || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight; +} + +std::ostream &BassStepAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - BassStepAttributes::BassStepAttributes() - :text() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasText( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, text, "text", hasText); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool BassStepAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BassStepAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BassStepAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, text, hasText, "text")) { - return hasText || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& BassStepAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool BassStepAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "BassStepAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BassStepAttributes.h b/Sourcecode/private/mx/core/elements/BassStepAttributes.h index 19b77ce46..9a18c04ed 100644 --- a/Sourcecode/private/mx/core/elements/BassStepAttributes.h +++ b/Sourcecode/private/mx/core/elements/BassStepAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BassStepAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BassStepAttributes) - struct BassStepAttributes : public AttributesInterface - { - public: - BassStepAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken text; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasText; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct BassStepAttributes : public AttributesInterface +{ + public: + BassStepAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken text; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasText; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Beam.cpp b/Sourcecode/private/mx/core/elements/Beam.cpp index ecb8937fe..c23df9ee3 100644 --- a/Sourcecode/private/mx/core/elements/Beam.cpp +++ b/Sourcecode/private/mx/core/elements/Beam.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Beam::Beam() - :myValue( BeamValue::begin ) - ,myAttributes( std::make_shared() ) - {} - - - Beam::Beam( const BeamValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Beam::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Beam::hasContents() const - { - return true; - } - - - std::ostream& Beam::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Beam::streamName( std::ostream& os ) const - { - os << "beam"; - return os; - } - - - std::ostream& Beam::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Beam::Beam() : myValue(BeamValue::begin), myAttributes(std::make_shared()) +{ +} +Beam::Beam(const BeamValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - BeamAttributesPtr Beam::getAttributes() const - { - return myAttributes; - } +bool Beam::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Beam::hasContents() const +{ + return true; +} - void Beam::setAttributes( const BeamAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Beam::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Beam::streamName(std::ostream &os) const +{ + os << "beam"; + return os; +} - BeamValue Beam::getValue() const - { - return myValue; - } +std::ostream &Beam::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +BeamAttributesPtr Beam::getAttributes() const +{ + return myAttributes; +} - void Beam::setValue( const BeamValue& value ) - { - myValue = value; - } +void Beam::setAttributes(const BeamAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +BeamValue Beam::getValue() const +{ + return myValue; +} - bool Beam::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBeamValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Beam::setValue(const BeamValue &value) +{ + myValue = value; +} - } +bool Beam::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseBeamValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Beam.h b/Sourcecode/private/mx/core/elements/Beam.h index b0a8bf64d..6b05f8c78 100644 --- a/Sourcecode/private/mx/core/elements/Beam.h +++ b/Sourcecode/private/mx/core/elements/Beam.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BeamAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeamAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Beam ) - - inline BeamPtr makeBeam() { return std::make_shared(); } - inline BeamPtr makeBeam( const BeamValue& value ) { return std::make_shared( value ); } - inline BeamPtr makeBeam( BeamValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Beam : public ElementInterface - { - public: - Beam(); - Beam( const BeamValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeamAttributesPtr getAttributes() const; - void setAttributes( const BeamAttributesPtr& attributes ); - BeamValue getValue() const; - void setValue( const BeamValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeamValue myValue; - BeamAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BeamAttributes) +MX_FORWARD_DECLARE_ELEMENT(Beam) + +inline BeamPtr makeBeam() +{ + return std::make_shared(); +} + +inline BeamPtr makeBeam(const BeamValue &value) +{ + return std::make_shared(value); } + +inline BeamPtr makeBeam(BeamValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Beam : public ElementInterface +{ + public: + Beam(); + Beam(const BeamValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BeamAttributesPtr getAttributes() const; + void setAttributes(const BeamAttributesPtr &attributes); + BeamValue getValue() const; + void setValue(const BeamValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BeamValue myValue; + BeamAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeamAttributes.cpp b/Sourcecode/private/mx/core/elements/BeamAttributes.cpp index 236b00c42..967c0c673 100644 --- a/Sourcecode/private/mx/core/elements/BeamAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BeamAttributes.cpp @@ -8,56 +8,54 @@ namespace mx { - namespace core +namespace core +{ +BeamAttributes::BeamAttributes() : number(1), repeater(), fan(), hasNumber(false), hasRepeater(false), hasFan(false) +{ +} + +bool BeamAttributes::hasValues() const +{ + return hasNumber || hasRepeater || hasFan; +} + +std::ostream &BeamAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - BeamAttributes::BeamAttributes() - :number( 1 ) - ,repeater() - ,fan() - ,hasNumber( false ) - ,hasRepeater( false ) - ,hasFan( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, repeater, "repeater", hasRepeater); + streamAttribute(os, fan, "fan", hasFan); + } + return os; +} +bool BeamAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BeamAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BeamAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasRepeater || - hasFan; + continue; } - - - std::ostream& BeamAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, repeater, hasRepeater, "repeater", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, repeater, "repeater", hasRepeater ); - streamAttribute( os, fan, "fan", hasFan ); - } - return os; + continue; } - - - bool BeamAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fan, hasFan, "fan", &parseFan)) { - const char* const className = "BeamAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, repeater, hasRepeater, "repeater", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fan, hasFan, "fan", &parseFan ) ) { continue; } - } - - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeamAttributes.h b/Sourcecode/private/mx/core/elements/BeamAttributes.h index ba0b12027..c3eb198e0 100644 --- a/Sourcecode/private/mx/core/elements/BeamAttributes.h +++ b/Sourcecode/private/mx/core/elements/BeamAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -15,26 +15,26 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BeamAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BeamAttributes) - struct BeamAttributes : public AttributesInterface - { - public: - BeamAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - BeamLevel number; - YesNo repeater; - Fan fan; - bool hasNumber; - bool hasRepeater; - bool hasFan; +struct BeamAttributes : public AttributesInterface +{ + public: + BeamAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + BeamLevel number; + YesNo repeater; + Fan fan; + bool hasNumber; + bool hasRepeater; + bool hasFan; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatRepeat.cpp b/Sourcecode/private/mx/core/elements/BeatRepeat.cpp index 841b6d94b..67c6f2d95 100644 --- a/Sourcecode/private/mx/core/elements/BeatRepeat.cpp +++ b/Sourcecode/private/mx/core/elements/BeatRepeat.cpp @@ -10,137 +10,125 @@ namespace mx { - namespace core - { - BeatRepeat::BeatRepeat() - :myAttributes( std::make_shared() ) - ,mySlashType( makeSlashType() ) - ,mySlashDotSet() - {} - - - bool BeatRepeat::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& BeatRepeat::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - +namespace core +{ +BeatRepeat::BeatRepeat() + : myAttributes(std::make_shared()), mySlashType(makeSlashType()), mySlashDotSet() +{ +} - std::ostream& BeatRepeat::streamName( std::ostream& os ) const - { - os << "beat-repeat"; - return os; - } +bool BeatRepeat::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &BeatRepeat::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - bool BeatRepeat::hasContents() const - { - return true; - } +std::ostream &BeatRepeat::streamName(std::ostream &os) const +{ + os << "beat-repeat"; + return os; +} +bool BeatRepeat::hasContents() const +{ + return true; +} - std::ostream& BeatRepeat::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const +std::ostream &BeatRepeat::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + mySlashType->toStream(os, indentLevel + 1); + for (auto x : mySlashDotSet) + { + if (x) { - isOneLineOnly = false; os << std::endl; - mySlashType->toStream( os, indentLevel+1 ); - for ( auto x : mySlashDotSet ) - { - if ( x ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - os << std::endl; - return os; - } - - - BeatRepeatAttributesPtr BeatRepeat::getAttributes() const - { - return myAttributes; - } - - - void BeatRepeat::setAttributes( const BeatRepeatAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - SlashTypePtr BeatRepeat::getSlashType() const - { - return mySlashType; - } - - - void BeatRepeat::setSlashType( const SlashTypePtr& value ) - { - if( value ) - { - mySlashType = value; - } + x->toStream(os, indentLevel + 1); } + } + os << std::endl; + return os; +} +BeatRepeatAttributesPtr BeatRepeat::getAttributes() const +{ + return myAttributes; +} - const SlashDotSet& BeatRepeat::getSlashDotSet() const - { - return mySlashDotSet; - } +void BeatRepeat::setAttributes(const BeatRepeatAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +SlashTypePtr BeatRepeat::getSlashType() const +{ + return mySlashType; +} - void BeatRepeat::removeSlashDot( const SlashDotSetIterConst& value ) - { - if ( value != mySlashDotSet.cend() ) - { - mySlashDotSet.erase( value ); - } - } +void BeatRepeat::setSlashType(const SlashTypePtr &value) +{ + if (value) + { + mySlashType = value; + } +} +const SlashDotSet &BeatRepeat::getSlashDotSet() const +{ + return mySlashDotSet; +} - void BeatRepeat::addSlashDot( const SlashDotPtr& value ) - { - if ( value ) - { - mySlashDotSet.push_back( value ); - } - } +void BeatRepeat::removeSlashDot(const SlashDotSetIterConst &value) +{ + if (value != mySlashDotSet.cend()) + { + mySlashDotSet.erase(value); + } +} +void BeatRepeat::addSlashDot(const SlashDotPtr &value) +{ + if (value) + { + mySlashDotSet.push_back(value); + } +} - void BeatRepeat::clearSlashDotSet() - { - mySlashDotSet.clear(); - } +void BeatRepeat::clearSlashDotSet() +{ + mySlashDotSet.clear(); +} +bool BeatRepeat::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isSlashTypeFound = false; - bool BeatRepeat::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *mySlashType, isSlashTypeFound)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isSlashTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *mySlashType, isSlashTypeFound ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "slash-dot", mySlashDotSet ); - } - - if( !isSlashTypeFound ) - { - message << "BeatRepeat: '" << mySlashType->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + importElementSet(message, it, endIter, isSuccess, "slash-dot", mySlashDotSet); + } + if (!isSlashTypeFound) + { + message << "BeatRepeat: '" << mySlashType->getElementName() << "' is required but was not found" << std::endl; } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatRepeat.h b/Sourcecode/private/mx/core/elements/BeatRepeat.h index 9b74bd1b3..b24c8833d 100644 --- a/Sourcecode/private/mx/core/elements/BeatRepeat.h +++ b/Sourcecode/private/mx/core/elements/BeatRepeat.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BeatRepeatAttributes.h" #include @@ -14,46 +14,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeatRepeatAttributes ) - MX_FORWARD_DECLARE_ELEMENT( SlashDot ) - MX_FORWARD_DECLARE_ELEMENT( SlashType ) - MX_FORWARD_DECLARE_ELEMENT( BeatRepeat ) - - inline BeatRepeatPtr makeBeatRepeat() { return std::make_shared(); } - - class BeatRepeat : public ElementInterface - { - public: - BeatRepeat(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeatRepeatAttributesPtr getAttributes() const; - void setAttributes( const BeatRepeatAttributesPtr& value ); - - /* _________ SlashType minOccurs = 1, maxOccurs = 1 _________ */ - SlashTypePtr getSlashType() const; - void setSlashType( const SlashTypePtr& value ); - - /* _________ SlashDot minOccurs = 0, maxOccurs = unbounded _________ */ - const SlashDotSet& getSlashDotSet() const; - void addSlashDot( const SlashDotPtr& value ); - void removeSlashDot( const SlashDotSetIterConst& value ); - void clearSlashDotSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeatRepeatAttributesPtr myAttributes; - SlashTypePtr mySlashType; - SlashDotSet mySlashDotSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BeatRepeatAttributes) +MX_FORWARD_DECLARE_ELEMENT(SlashDot) +MX_FORWARD_DECLARE_ELEMENT(SlashType) +MX_FORWARD_DECLARE_ELEMENT(BeatRepeat) + +inline BeatRepeatPtr makeBeatRepeat() +{ + return std::make_shared(); } + +class BeatRepeat : public ElementInterface +{ + public: + BeatRepeat(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BeatRepeatAttributesPtr getAttributes() const; + void setAttributes(const BeatRepeatAttributesPtr &value); + + /* _________ SlashType minOccurs = 1, maxOccurs = 1 _________ */ + SlashTypePtr getSlashType() const; + void setSlashType(const SlashTypePtr &value); + + /* _________ SlashDot minOccurs = 0, maxOccurs = unbounded _________ */ + const SlashDotSet &getSlashDotSet() const; + void addSlashDot(const SlashDotPtr &value); + void removeSlashDot(const SlashDotSetIterConst &value); + void clearSlashDotSet(); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BeatRepeatAttributesPtr myAttributes; + SlashTypePtr mySlashType; + SlashDotSet mySlashDotSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp b/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp index 19697ef6b..2a136e047 100644 --- a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp @@ -8,62 +8,62 @@ namespace mx { - namespace core +namespace core +{ +BeatRepeatAttributes::BeatRepeatAttributes() + : type(StartStop::start), slashes(1), useDots(YesNo::no), hasType(true), hasSlashes(false), hasUseDots(false) +{ +} + +bool BeatRepeatAttributes::hasValues() const +{ + return hasType || hasSlashes || hasUseDots; +} + +std::ostream &BeatRepeatAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - BeatRepeatAttributes::BeatRepeatAttributes() - :type( StartStop::start ) - ,slashes( 1 ) - ,useDots( YesNo::no ) - ,hasType( true ) - ,hasSlashes( false ) - ,hasUseDots( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, slashes, "slashes", hasSlashes); + streamAttribute(os, useDots, "use-dots", hasUseDots); + } + return os; +} +bool BeatRepeatAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BeatRepeatAttributes"; + bool isSuccess = true; + bool isTypeFound = false; - bool BeatRepeatAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - return hasType || - hasSlashes || - hasUseDots; + continue; } - - - std::ostream& BeatRepeatAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, slashes, hasSlashes, "slashes")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, slashes, "slashes", hasSlashes ); - streamAttribute( os, useDots, "use-dots", hasUseDots ); - } - return os; + continue; } - - - bool BeatRepeatAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, useDots, hasUseDots, "use-dots", &parseYesNo)) { - const char* const className = "BeatRepeatAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slashes, hasSlashes, "slashes" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, useDots, hasUseDots, "use-dots", &parseYesNo ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h b/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h index e10335668..93e97655a 100644 --- a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h +++ b/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -15,26 +15,26 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BeatRepeatAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BeatRepeatAttributes) - struct BeatRepeatAttributes : public AttributesInterface - { - public: - BeatRepeatAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - PositiveInteger slashes; - YesNo useDots; - const bool hasType; - bool hasSlashes; - bool hasUseDots; +struct BeatRepeatAttributes : public AttributesInterface +{ + public: + BeatRepeatAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + PositiveInteger slashes; + YesNo useDots; + const bool hasType; + bool hasSlashes; + bool hasUseDots; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatType.cpp b/Sourcecode/private/mx/core/elements/BeatType.cpp index 1a0117d9f..109b6205f 100644 --- a/Sourcecode/private/mx/core/elements/BeatType.cpp +++ b/Sourcecode/private/mx/core/elements/BeatType.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - BeatType::BeatType() - :myValue() - {} - - - BeatType::BeatType( const XsString& value ) - :myValue( value ) - {} - - - bool BeatType::hasAttributes() const - { - return false; - } - - - bool BeatType::hasContents() const - { - return true; - } - - - std::ostream& BeatType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatType::streamName( std::ostream& os ) const - { - os << "beat-type"; - return os; - } +namespace core +{ +BeatType::BeatType() : myValue() +{ +} +BeatType::BeatType(const XsString &value) : myValue(value) +{ +} - std::ostream& BeatType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool BeatType::hasAttributes() const +{ + return false; +} +bool BeatType::hasContents() const +{ + return true; +} - XsString BeatType::getValue() const - { - return myValue; - } +std::ostream &BeatType::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &BeatType::streamName(std::ostream &os) const +{ + os << "beat-type"; + return os; +} - void BeatType::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &BeatType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString BeatType::getValue() const +{ + return myValue; +} - bool BeatType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void BeatType::setValue(const XsString &value) +{ + myValue = value; +} - } +bool BeatType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatType.h b/Sourcecode/private/mx/core/elements/BeatType.h index f539026a5..b158dc066 100644 --- a/Sourcecode/private/mx/core/elements/BeatType.h +++ b/Sourcecode/private/mx/core/elements/BeatType.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatType ) - - inline BeatTypePtr makeBeatType() { return std::make_shared(); } - inline BeatTypePtr makeBeatType( const XsString& value ) { return std::make_shared( value ); } - inline BeatTypePtr makeBeatType( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class BeatType : public ElementInterface - { - public: - BeatType(); - BeatType( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BeatType) + +inline BeatTypePtr makeBeatType() +{ + return std::make_shared(); +} + +inline BeatTypePtr makeBeatType(const XsString &value) +{ + return std::make_shared(value); } + +inline BeatTypePtr makeBeatType(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class BeatType : public ElementInterface +{ + public: + BeatType(); + BeatType(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnit.cpp b/Sourcecode/private/mx/core/elements/BeatUnit.cpp index 447b61414..09d6077ac 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnit.cpp +++ b/Sourcecode/private/mx/core/elements/BeatUnit.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - BeatUnit::BeatUnit() - :myValue( NoteTypeValue::eighth ) - {} - - - BeatUnit::BeatUnit( const NoteTypeValue& value ) - :myValue( value ) - {} - - - bool BeatUnit::hasAttributes() const - { - return false; - } - - - bool BeatUnit::hasContents() const - { - return true; - } - - - std::ostream& BeatUnit::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatUnit::streamName( std::ostream& os ) const - { - os << "beat-unit"; - return os; - } +namespace core +{ +BeatUnit::BeatUnit() : myValue(NoteTypeValue::eighth) +{ +} +BeatUnit::BeatUnit(const NoteTypeValue &value) : myValue(value) +{ +} - std::ostream& BeatUnit::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool BeatUnit::hasAttributes() const +{ + return false; +} +bool BeatUnit::hasContents() const +{ + return true; +} - NoteTypeValue BeatUnit::getValue() const - { - return myValue; - } +std::ostream &BeatUnit::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &BeatUnit::streamName(std::ostream &os) const +{ + os << "beat-unit"; + return os; +} - void BeatUnit::setValue( const NoteTypeValue& value ) - { - myValue = value; - } +std::ostream &BeatUnit::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NoteTypeValue BeatUnit::getValue() const +{ + return myValue; +} - bool BeatUnit::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseNoteTypeValue( xelement.getValue() ); - return true; - } +void BeatUnit::setValue(const NoteTypeValue &value) +{ + myValue = value; +} - } +bool BeatUnit::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseNoteTypeValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnit.h b/Sourcecode/private/mx/core/elements/BeatUnit.h index 303f7e086..9b3b49b01 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnit.h +++ b/Sourcecode/private/mx/core/elements/BeatUnit.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnit ) - - inline BeatUnitPtr makeBeatUnit() { return std::make_shared(); } - inline BeatUnitPtr makeBeatUnit( const NoteTypeValue& value ) { return std::make_shared( value ); } - inline BeatUnitPtr makeBeatUnit( NoteTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class BeatUnit : public ElementInterface - { - public: - BeatUnit(); - BeatUnit( const NoteTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteTypeValue getValue() const; - void setValue( const NoteTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteTypeValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BeatUnit) + +inline BeatUnitPtr makeBeatUnit() +{ + return std::make_shared(); +} + +inline BeatUnitPtr makeBeatUnit(const NoteTypeValue &value) +{ + return std::make_shared(value); } + +inline BeatUnitPtr makeBeatUnit(NoteTypeValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class BeatUnit : public ElementInterface +{ + public: + BeatUnit(); + BeatUnit(const NoteTypeValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NoteTypeValue getValue() const; + void setValue(const NoteTypeValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NoteTypeValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnitDot.cpp b/Sourcecode/private/mx/core/elements/BeatUnitDot.cpp index c1809da03..d1dd3361c 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnitDot.cpp +++ b/Sourcecode/private/mx/core/elements/BeatUnitDot.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - BeatUnitDot::BeatUnitDot() : ElementInterface() {} - +namespace core +{ +BeatUnitDot::BeatUnitDot() : ElementInterface() +{ +} - bool BeatUnitDot::hasAttributes() const { return false; } +bool BeatUnitDot::hasAttributes() const +{ + return false; +} +bool BeatUnitDot::hasContents() const +{ + return false; +} - bool BeatUnitDot::hasContents() const { return false; } - std::ostream& BeatUnitDot::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& BeatUnitDot::streamName( std::ostream& os ) const { os << "beat-unit-dot"; return os; } - std::ostream& BeatUnitDot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &BeatUnitDot::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &BeatUnitDot::streamName(std::ostream &os) const +{ + os << "beat-unit-dot"; + return os; +} - bool BeatUnitDot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &BeatUnitDot::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool BeatUnitDot::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnitDot.h b/Sourcecode/private/mx/core/elements/BeatUnitDot.h index 413954739..dd2693b29 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnitDot.h +++ b/Sourcecode/private/mx/core/elements/BeatUnitDot.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnitDot ) - - inline BeatUnitDotPtr makeBeatUnitDot() { return std::make_shared(); } - - class BeatUnitDot : public ElementInterface - { - public: - BeatUnitDot(); +namespace core +{ - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; +MX_FORWARD_DECLARE_ELEMENT(BeatUnitDot) - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +inline BeatUnitDotPtr makeBeatUnitDot() +{ + return std::make_shared(); } + +class BeatUnitDot : public ElementInterface +{ + public: + BeatUnitDot(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp b/Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp index 233ed5d33..19e7faa8f 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp +++ b/Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp @@ -10,138 +10,126 @@ namespace mx { - namespace core - { - BeatUnitGroup::BeatUnitGroup() - :myBeatUnit( makeBeatUnit() ) - ,myBeatUnitDotSet() - {} +namespace core +{ +BeatUnitGroup::BeatUnitGroup() : myBeatUnit(makeBeatUnit()), myBeatUnitDotSet() +{ +} +bool BeatUnitGroup::hasAttributes() const +{ + return false; +} - bool BeatUnitGroup::hasAttributes() const - { - return false; - } +std::ostream &BeatUnitGroup::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &BeatUnitGroup::streamName(std::ostream &os) const +{ + return os; +} - std::ostream& BeatUnitGroup::streamAttributes( std::ostream& os ) const - { - return os; - } +bool BeatUnitGroup::hasContents() const +{ + return true; +} +std::ostream &BeatUnitGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + myBeatUnit->toStream(os, indentLevel); + for (auto x : myBeatUnitDotSet) + { + os << std::endl; + x->toStream(os, indentLevel); + } + return os; +} - std::ostream& BeatUnitGroup::streamName( std::ostream& os ) const - { - return os; - } +BeatUnitPtr BeatUnitGroup::getBeatUnit() const +{ + return myBeatUnit; +} +void BeatUnitGroup::setBeatUnit(const BeatUnitPtr &value) +{ + if (value) + { + myBeatUnit = value; + } +} - bool BeatUnitGroup::hasContents() const - { - return true; - } +const BeatUnitDotSet &BeatUnitGroup::getBeatUnitDotSet() const +{ + return myBeatUnitDotSet; +} +void BeatUnitGroup::addBeatUnitDot(const BeatUnitDotPtr &value) +{ + if (value) + { + myBeatUnitDotSet.push_back(value); + } +} - std::ostream& BeatUnitGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - myBeatUnit->toStream( os, indentLevel ); - for ( auto x : myBeatUnitDotSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - return os; - } +void BeatUnitGroup::removeBeatUnitDot(const BeatUnitDotSetIterConst &setIterator) +{ + if (setIterator != myBeatUnitDotSet.cend()) + { + myBeatUnitDotSet.erase(setIterator); + } +} +void BeatUnitGroup::clearBeatUnitDotSet() +{ + myBeatUnitDotSet.clear(); +} - BeatUnitPtr BeatUnitGroup::getBeatUnit() const - { - return myBeatUnit; - } +bool BeatUnitGroup::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isBeatUnitFound = false; + bool isFirstBeatUnitDotAdded = false; + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); - void BeatUnitGroup::setBeatUnit( const BeatUnitPtr& value ) + if (elementName == "beat-unit") { - if ( value ) - { - myBeatUnit = value; - } + isBeatUnitFound = true; + isSuccess &= myBeatUnit->fromXElement(message, *it); } - - - const BeatUnitDotSet& BeatUnitGroup::getBeatUnitDotSet() const + else if (elementName == "beat-unit-dot") { - return myBeatUnitDotSet; - } + auto beatUnitDot = makeBeatUnitDot(); + isSuccess &= beatUnitDot->fromXElement(message, *it); - - void BeatUnitGroup::addBeatUnitDot( const BeatUnitDotPtr& value ) - { - if ( value ) + if (!isFirstBeatUnitDotAdded && myBeatUnitDotSet.size() == 1) { - myBeatUnitDotSet.push_back( value ); + *(myBeatUnitDotSet.begin()) = beatUnitDot; + isFirstBeatUnitDotAdded = true; } - } - - - void BeatUnitGroup::removeBeatUnitDot( const BeatUnitDotSetIterConst& setIterator ) - { - if ( setIterator != myBeatUnitDotSet.cend() ) + else { - myBeatUnitDotSet.erase( setIterator ); + myBeatUnitDotSet.push_back(beatUnitDot); + isFirstBeatUnitDotAdded = true; } } - - - void BeatUnitGroup::clearBeatUnitDotSet() - { - myBeatUnitDotSet.clear(); - } - - bool BeatUnitGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + else { - bool isSuccess = true; - bool isBeatUnitFound = false; - bool isFirstBeatUnitDotAdded = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + if (!isBeatUnitFound) { - const std::string elementName = it->getName(); - - if( elementName == "beat-unit" ) - { - isBeatUnitFound = true; - isSuccess &= myBeatUnit->fromXElement( message, *it ); - } - else if( elementName == "beat-unit-dot" ) - { - auto beatUnitDot = makeBeatUnitDot(); - isSuccess &= beatUnitDot->fromXElement( message, *it ); - - if( !isFirstBeatUnitDotAdded && myBeatUnitDotSet.size() == 1 ) - { - *( myBeatUnitDotSet.begin() ) = beatUnitDot; - isFirstBeatUnitDotAdded = true; - } - else - { - myBeatUnitDotSet.push_back( beatUnitDot ); - isFirstBeatUnitDotAdded = true; - } - } - else - { - if( !isBeatUnitFound ) - { - isSuccess = false; - message << "BeatUnitGroup: 'beat-unit' element is required but was not found" << std::endl; - } - break; - } + isSuccess = false; + message << "BeatUnitGroup: 'beat-unit' element is required but was not found" << std::endl; } - MX_RETURN_IS_SUCCESS; + break; } - } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnitGroup.h b/Sourcecode/private/mx/core/elements/BeatUnitGroup.h index 7dfca15c2..952893f9b 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnitGroup.h +++ b/Sourcecode/private/mx/core/elements/BeatUnitGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,42 +13,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnit ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitDot ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitGroup ) - - inline BeatUnitGroupPtr makeBeatUnitGroup() { return std::make_shared(); } - - class BeatUnitGroup : public ElementInterface - { - public: - BeatUnitGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ BeatUnit minOccurs = 1, maxOccurs = 1 _________ */ - BeatUnitPtr getBeatUnit() const; - void setBeatUnit( const BeatUnitPtr& value ); - - /* _________ BeatUnitDot minOccurs = 0, maxOccurs = unbounded _________ */ - const BeatUnitDotSet& getBeatUnitDotSet() const; - void addBeatUnitDot( const BeatUnitDotPtr& value ); - void removeBeatUnitDot( const BeatUnitDotSetIterConst& setIterator ); - void clearBeatUnitDotSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeatUnitPtr myBeatUnit; - BeatUnitDotSet myBeatUnitDotSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BeatUnit) +MX_FORWARD_DECLARE_ELEMENT(BeatUnitDot) +MX_FORWARD_DECLARE_ELEMENT(BeatUnitGroup) + +inline BeatUnitGroupPtr makeBeatUnitGroup() +{ + return std::make_shared(); } + +class BeatUnitGroup : public ElementInterface +{ + public: + BeatUnitGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ BeatUnit minOccurs = 1, maxOccurs = 1 _________ */ + BeatUnitPtr getBeatUnit() const; + void setBeatUnit(const BeatUnitPtr &value); + + /* _________ BeatUnitDot minOccurs = 0, maxOccurs = unbounded _________ */ + const BeatUnitDotSet &getBeatUnitDotSet() const; + void addBeatUnitDot(const BeatUnitDotPtr &value); + void removeBeatUnitDot(const BeatUnitDotSetIterConst &setIterator); + void clearBeatUnitDotSet(); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BeatUnitPtr myBeatUnit; + BeatUnitDotSet myBeatUnitDotSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPer.cpp b/Sourcecode/private/mx/core/elements/BeatUnitPer.cpp index 6d6046a0c..a113d0c0c 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnitPer.cpp +++ b/Sourcecode/private/mx/core/elements/BeatUnitPer.cpp @@ -10,94 +10,84 @@ namespace mx { - namespace core - { - BeatUnitPer::BeatUnitPer() - :myBeatUnitGroup( makeBeatUnitGroup() ) - ,myPerMinuteOrBeatUnitChoice( makePerMinuteOrBeatUnitChoice() ) - {} - - - bool BeatUnitPer::hasAttributes() const - { - return false; - } - - - std::ostream& BeatUnitPer::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatUnitPer::streamName( std::ostream& os ) const - { - return os; - } - - - bool BeatUnitPer::hasContents() const - { - return true; - } - +namespace core +{ +BeatUnitPer::BeatUnitPer() + : myBeatUnitGroup(makeBeatUnitGroup()), myPerMinuteOrBeatUnitChoice(makePerMinuteOrBeatUnitChoice()) +{ +} - std::ostream& BeatUnitPer::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myBeatUnitGroup->streamContents( os, indentLevel, isOneLineOnly ); - os << std::endl; - myPerMinuteOrBeatUnitChoice->streamContents( os, indentLevel, isOneLineOnly ); - isOneLineOnly = false; - return os; - } +bool BeatUnitPer::hasAttributes() const +{ + return false; +} +std::ostream &BeatUnitPer::streamAttributes(std::ostream &os) const +{ + return os; +} - BeatUnitGroupPtr BeatUnitPer::getBeatUnitGroup() const - { - return myBeatUnitGroup; - } +std::ostream &BeatUnitPer::streamName(std::ostream &os) const +{ + return os; +} +bool BeatUnitPer::hasContents() const +{ + return true; +} - void BeatUnitPer::setBeatUnitGroup( const BeatUnitGroupPtr& value ) - { - if ( value ) - { - myBeatUnitGroup = value; - } - } +std::ostream &BeatUnitPer::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + myBeatUnitGroup->streamContents(os, indentLevel, isOneLineOnly); + os << std::endl; + myPerMinuteOrBeatUnitChoice->streamContents(os, indentLevel, isOneLineOnly); + isOneLineOnly = false; + return os; +} +BeatUnitGroupPtr BeatUnitPer::getBeatUnitGroup() const +{ + return myBeatUnitGroup; +} - PerMinuteOrBeatUnitChoicePtr BeatUnitPer::getPerMinuteOrBeatUnitChoice() const - { - return myPerMinuteOrBeatUnitChoice; - } +void BeatUnitPer::setBeatUnitGroup(const BeatUnitGroupPtr &value) +{ + if (value) + { + myBeatUnitGroup = value; + } +} +PerMinuteOrBeatUnitChoicePtr BeatUnitPer::getPerMinuteOrBeatUnitChoice() const +{ + return myPerMinuteOrBeatUnitChoice; +} - void BeatUnitPer::setPerMinuteOtBeatUnitChoice( const PerMinuteOrBeatUnitChoicePtr& value ) - { - if ( value ) - { - myPerMinuteOrBeatUnitChoice = value; - } - } +void BeatUnitPer::setPerMinuteOtBeatUnitChoice(const PerMinuteOrBeatUnitChoicePtr &value) +{ + if (value) + { + myPerMinuteOrBeatUnitChoice = value; + } +} +bool BeatUnitPer::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; - bool BeatUnitPer::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importGroup(message, it, endIter, isSuccess, myBeatUnitGroup); + if (it->getName() == "beat-unit-per" || it->getName() == "note-relation-note") { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importGroup( message, it, endIter, isSuccess, myBeatUnitGroup ); - if( it->getName() == "beat-unit-per" || it->getName() == "note-relation-note" ) - { - isSuccess &= myPerMinuteOrBeatUnitChoice->fromXElement( message, *it ); - } - } - - MX_RETURN_IS_SUCCESS; + isSuccess &= myPerMinuteOrBeatUnitChoice->fromXElement(message, *it); } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPer.h b/Sourcecode/private/mx/core/elements/BeatUnitPer.h index e503aafcd..6d283b83e 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnitPer.h +++ b/Sourcecode/private/mx/core/elements/BeatUnitPer.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,36 +13,39 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnitGroup ) - MX_FORWARD_DECLARE_ELEMENT( PerMinuteOrBeatUnitChoice ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitPer ) - - inline BeatUnitPerPtr makeBeatUnitPer() { return std::make_shared(); } - - class BeatUnitPer : public ElementInterface - { - public: - BeatUnitPer(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeatUnitGroupPtr getBeatUnitGroup() const; - void setBeatUnitGroup( const BeatUnitGroupPtr& value ); - PerMinuteOrBeatUnitChoicePtr getPerMinuteOrBeatUnitChoice() const; - void setPerMinuteOtBeatUnitChoice( const PerMinuteOrBeatUnitChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeatUnitGroupPtr myBeatUnitGroup; - PerMinuteOrBeatUnitChoicePtr myPerMinuteOrBeatUnitChoice; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BeatUnitGroup) +MX_FORWARD_DECLARE_ELEMENT(PerMinuteOrBeatUnitChoice) +MX_FORWARD_DECLARE_ELEMENT(BeatUnitPer) + +inline BeatUnitPerPtr makeBeatUnitPer() +{ + return std::make_shared(); } + +class BeatUnitPer : public ElementInterface +{ + public: + BeatUnitPer(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BeatUnitGroupPtr getBeatUnitGroup() const; + void setBeatUnitGroup(const BeatUnitGroupPtr &value); + PerMinuteOrBeatUnitChoicePtr getPerMinuteOrBeatUnitChoice() const; + void setPerMinuteOtBeatUnitChoice(const PerMinuteOrBeatUnitChoicePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BeatUnitGroupPtr myBeatUnitGroup; + PerMinuteOrBeatUnitChoicePtr myPerMinuteOrBeatUnitChoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp b/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp index 6dee9d594..b97c3c72d 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp +++ b/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp @@ -10,106 +10,92 @@ namespace mx { - namespace core - { - BeatUnitPerOrNoteRelationNoteChoice::BeatUnitPerOrNoteRelationNoteChoice() - :myChoice( Choice::beatUnitPer ) - ,myBeatUnitPer( makeBeatUnitPer() ) - ,myNoteRelationNote( makeNoteRelationNote() ) - {} - - - bool BeatUnitPerOrNoteRelationNoteChoice::hasAttributes() const - { - return false; - } - - - std::ostream& BeatUnitPerOrNoteRelationNoteChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatUnitPerOrNoteRelationNoteChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool BeatUnitPerOrNoteRelationNoteChoice::hasContents() const - { - return true; - } - - - std::ostream& BeatUnitPerOrNoteRelationNoteChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::beatUnitPer: - { - myBeatUnitPer->streamContents( os, indentLevel, isOneLineOnly ); - } - break; - case Choice::noteRelationNote: - { - myNoteRelationNote->streamContents( os, indentLevel, isOneLineOnly ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - BeatUnitPerOrNoteRelationNoteChoice::Choice BeatUnitPerOrNoteRelationNoteChoice::getChoice() const - { - return myChoice; - } - +namespace core +{ +BeatUnitPerOrNoteRelationNoteChoice::BeatUnitPerOrNoteRelationNoteChoice() + : myChoice(Choice::beatUnitPer), myBeatUnitPer(makeBeatUnitPer()), myNoteRelationNote(makeNoteRelationNote()) +{ +} - void BeatUnitPerOrNoteRelationNoteChoice::setChoice( const BeatUnitPerOrNoteRelationNoteChoice::Choice value ) - { - myChoice = value; - } +bool BeatUnitPerOrNoteRelationNoteChoice::hasAttributes() const +{ + return false; +} +std::ostream &BeatUnitPerOrNoteRelationNoteChoice::streamAttributes(std::ostream &os) const +{ + return os; +} - BeatUnitPerPtr BeatUnitPerOrNoteRelationNoteChoice::getBeatUnitPer() const - { - return myBeatUnitPer; - } +std::ostream &BeatUnitPerOrNoteRelationNoteChoice::streamName(std::ostream &os) const +{ + return os; +} +bool BeatUnitPerOrNoteRelationNoteChoice::hasContents() const +{ + return true; +} - void BeatUnitPerOrNoteRelationNoteChoice::setBeatUnitPer( const BeatUnitPerPtr& value ) - { - if ( value ) - { - myBeatUnitPer = value; - } - } +std::ostream &BeatUnitPerOrNoteRelationNoteChoice::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::beatUnitPer: { + myBeatUnitPer->streamContents(os, indentLevel, isOneLineOnly); + } + break; + case Choice::noteRelationNote: { + myNoteRelationNote->streamContents(os, indentLevel, isOneLineOnly); + } + break; + default: + break; + } + isOneLineOnly = false; + return os; +} +BeatUnitPerOrNoteRelationNoteChoice::Choice BeatUnitPerOrNoteRelationNoteChoice::getChoice() const +{ + return myChoice; +} - NoteRelationNotePtr BeatUnitPerOrNoteRelationNoteChoice::getNoteRelationNote() const - { - return myNoteRelationNote; - } +void BeatUnitPerOrNoteRelationNoteChoice::setChoice(const BeatUnitPerOrNoteRelationNoteChoice::Choice value) +{ + myChoice = value; +} +BeatUnitPerPtr BeatUnitPerOrNoteRelationNoteChoice::getBeatUnitPer() const +{ + return myBeatUnitPer; +} - void BeatUnitPerOrNoteRelationNoteChoice::setNoteRelationNote( const NoteRelationNotePtr& value ) - { - myNoteRelationNote = value; - } +void BeatUnitPerOrNoteRelationNoteChoice::setBeatUnitPer(const BeatUnitPerPtr &value) +{ + if (value) + { + myBeatUnitPer = value; + } +} +NoteRelationNotePtr BeatUnitPerOrNoteRelationNoteChoice::getNoteRelationNote() const +{ + return myNoteRelationNote; +} - bool BeatUnitPerOrNoteRelationNoteChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( beatUnitPer, "beat-unit-per", BeatUnitPer ); - MX_CHOICE_IF( noteRelationNote, "note-relation-note", NoteRelationNote ); - MX_BAD_ELEMENT_FAILURE( BeatUnitPerOrNoteRelationNoteChoice ); - } +void BeatUnitPerOrNoteRelationNoteChoice::setNoteRelationNote(const NoteRelationNotePtr &value) +{ + myNoteRelationNote = value; +} - } +bool BeatUnitPerOrNoteRelationNoteChoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_CHOICE_IF(beatUnitPer, "beat-unit-per", BeatUnitPer); + MX_CHOICE_IF(noteRelationNote, "note-relation-note", NoteRelationNote); + MX_BAD_ELEMENT_FAILURE(BeatUnitPerOrNoteRelationNoteChoice); } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h b/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h index de6980b15..922c3636f 100644 --- a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h +++ b/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,44 +13,47 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BeatUnitPer) +MX_FORWARD_DECLARE_ELEMENT(NoteRelationNote) +MX_FORWARD_DECLARE_ELEMENT(BeatUnitPerOrNoteRelationNoteChoice) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitPer ) - MX_FORWARD_DECLARE_ELEMENT( NoteRelationNote ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitPerOrNoteRelationNoteChoice ) - - inline BeatUnitPerOrNoteRelationNoteChoicePtr makeBeatUnitPerOrNoteRelationNoteChoice() { return std::make_shared(); } - - class BeatUnitPerOrNoteRelationNoteChoice : public ElementInterface - { - public: - enum class Choice - { - beatUnitPer = 0, - noteRelationNote = 1 - }; - BeatUnitPerOrNoteRelationNoteChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeatUnitPerOrNoteRelationNoteChoice::Choice getChoice() const; - void setChoice( const BeatUnitPerOrNoteRelationNoteChoice::Choice value ); - BeatUnitPerPtr getBeatUnitPer() const; - void setBeatUnitPer( const BeatUnitPerPtr& value ); - NoteRelationNotePtr getNoteRelationNote() const; - void setNoteRelationNote( const NoteRelationNotePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - BeatUnitPerPtr myBeatUnitPer; - NoteRelationNotePtr myNoteRelationNote; - }; - } +inline BeatUnitPerOrNoteRelationNoteChoicePtr makeBeatUnitPerOrNoteRelationNoteChoice() +{ + return std::make_shared(); } + +class BeatUnitPerOrNoteRelationNoteChoice : public ElementInterface +{ + public: + enum class Choice + { + beatUnitPer = 0, + noteRelationNote = 1 + }; + BeatUnitPerOrNoteRelationNoteChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BeatUnitPerOrNoteRelationNoteChoice::Choice getChoice() const; + void setChoice(const BeatUnitPerOrNoteRelationNoteChoice::Choice value); + BeatUnitPerPtr getBeatUnitPer() const; + void setBeatUnitPer(const BeatUnitPerPtr &value); + NoteRelationNotePtr getNoteRelationNote() const; + void setNoteRelationNote(const NoteRelationNotePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + BeatUnitPerPtr myBeatUnitPer; + NoteRelationNotePtr myNoteRelationNote; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Beater.cpp b/Sourcecode/private/mx/core/elements/Beater.cpp index 7341a60d4..95a75bc27 100644 --- a/Sourcecode/private/mx/core/elements/Beater.cpp +++ b/Sourcecode/private/mx/core/elements/Beater.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Beater::Beater() - :myValue( BeaterValue::snareStick ) - ,myAttributes( std::make_shared() ) - {} - - - Beater::Beater( const BeaterValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Beater::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Beater::hasContents() const - { - return true; - } - - - std::ostream& Beater::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Beater::streamName( std::ostream& os ) const - { - os << "beater"; - return os; - } - - - std::ostream& Beater::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Beater::Beater() : myValue(BeaterValue::snareStick), myAttributes(std::make_shared()) +{ +} +Beater::Beater(const BeaterValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - BeaterAttributesPtr Beater::getAttributes() const - { - return myAttributes; - } +bool Beater::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Beater::hasContents() const +{ + return true; +} - void Beater::setAttributes( const BeaterAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Beater::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Beater::streamName(std::ostream &os) const +{ + os << "beater"; + return os; +} - BeaterValue Beater::getValue() const - { - return myValue; - } +std::ostream &Beater::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +BeaterAttributesPtr Beater::getAttributes() const +{ + return myAttributes; +} - void Beater::setValue( const BeaterValue& value ) - { - myValue = value; - } +void Beater::setAttributes(const BeaterAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +BeaterValue Beater::getValue() const +{ + return myValue; +} - bool Beater::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBeaterValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Beater::setValue(const BeaterValue &value) +{ + myValue = value; +} - } +bool Beater::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseBeaterValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Beater.h b/Sourcecode/private/mx/core/elements/Beater.h index 2340150cd..232cf8882 100644 --- a/Sourcecode/private/mx/core/elements/Beater.h +++ b/Sourcecode/private/mx/core/elements/Beater.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BeaterAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeaterAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Beater ) - - inline BeaterPtr makeBeater() { return std::make_shared(); } - inline BeaterPtr makeBeater( const BeaterValue& value ) { return std::make_shared( value ); } - inline BeaterPtr makeBeater( BeaterValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Beater : public ElementInterface - { - public: - Beater(); - Beater( const BeaterValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeaterAttributesPtr getAttributes() const; - void setAttributes( const BeaterAttributesPtr& attributes ); - BeaterValue getValue() const; - void setValue( const BeaterValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeaterValue myValue; - BeaterAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BeaterAttributes) +MX_FORWARD_DECLARE_ELEMENT(Beater) + +inline BeaterPtr makeBeater() +{ + return std::make_shared(); +} + +inline BeaterPtr makeBeater(const BeaterValue &value) +{ + return std::make_shared(value); } + +inline BeaterPtr makeBeater(BeaterValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Beater : public ElementInterface +{ + public: + Beater(); + Beater(const BeaterValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BeaterAttributesPtr getAttributes() const; + void setAttributes(const BeaterAttributesPtr &attributes); + BeaterValue getValue() const; + void setValue(const BeaterValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BeaterValue myValue; + BeaterAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeaterAttributes.cpp b/Sourcecode/private/mx/core/elements/BeaterAttributes.cpp index ca96c39d1..e2e1d9864 100644 --- a/Sourcecode/private/mx/core/elements/BeaterAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BeaterAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - BeaterAttributes::BeaterAttributes() - :tip() - ,hasTip( false ) - {} - +namespace core +{ +BeaterAttributes::BeaterAttributes() : tip(), hasTip(false) +{ +} - bool BeaterAttributes::hasValues() const - { - return hasTip; - } +bool BeaterAttributes::hasValues() const +{ + return hasTip; +} +std::ostream &BeaterAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, tip, "tip", hasTip); + } + return os; +} - std::ostream& BeaterAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, tip, "tip", hasTip ); - } - return os; - } +bool BeaterAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BeaterAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BeaterAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, tip, hasTip, "tip", &parseTipDirection)) { - const char* const className = "BeaterAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, tip, hasTip, "tip", &parseTipDirection ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BeaterAttributes.h b/Sourcecode/private/mx/core/elements/BeaterAttributes.h index 18d78a099..cd2d9c7e8 100644 --- a/Sourcecode/private/mx/core/elements/BeaterAttributes.h +++ b/Sourcecode/private/mx/core/elements/BeaterAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BeaterAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BeaterAttributes) - struct BeaterAttributes : public AttributesInterface - { - public: - BeaterAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TipDirection tip; - bool hasTip; +struct BeaterAttributes : public AttributesInterface +{ + public: + BeaterAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TipDirection tip; + bool hasTip; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Beats.cpp b/Sourcecode/private/mx/core/elements/Beats.cpp index 76f1db1b8..0f8f5c0f5 100644 --- a/Sourcecode/private/mx/core/elements/Beats.cpp +++ b/Sourcecode/private/mx/core/elements/Beats.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Beats::Beats() - :myValue() - {} - - - Beats::Beats( const XsString& value ) - :myValue( value ) - {} - - - bool Beats::hasAttributes() const - { - return false; - } - - - bool Beats::hasContents() const - { - return true; - } - - - std::ostream& Beats::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Beats::streamName( std::ostream& os ) const - { - os << "beats"; - return os; - } +namespace core +{ +Beats::Beats() : myValue() +{ +} +Beats::Beats(const XsString &value) : myValue(value) +{ +} - std::ostream& Beats::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Beats::hasAttributes() const +{ + return false; +} +bool Beats::hasContents() const +{ + return true; +} - XsString Beats::getValue() const - { - return myValue; - } +std::ostream &Beats::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Beats::streamName(std::ostream &os) const +{ + os << "beats"; + return os; +} - void Beats::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &Beats::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString Beats::getValue() const +{ + return myValue; +} - bool Beats::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void Beats::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Beats::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Beats.h b/Sourcecode/private/mx/core/elements/Beats.h index 0305e4fe1..0116ce53f 100644 --- a/Sourcecode/private/mx/core/elements/Beats.h +++ b/Sourcecode/private/mx/core/elements/Beats.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Beats ) - - inline BeatsPtr makeBeats() { return std::make_shared(); } - inline BeatsPtr makeBeats( const XsString& value ) { return std::make_shared( value ); } - inline BeatsPtr makeBeats( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Beats : public ElementInterface - { - public: - Beats(); - Beats( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Beats) + +inline BeatsPtr makeBeats() +{ + return std::make_shared(); +} + +inline BeatsPtr makeBeats(const XsString &value) +{ + return std::make_shared(value); } + +inline BeatsPtr makeBeats(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Beats : public ElementInterface +{ + public: + Beats(); + Beats(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Bend.cpp b/Sourcecode/private/mx/core/elements/Bend.cpp index 752e82e89..0f9b7cff7 100644 --- a/Sourcecode/private/mx/core/elements/Bend.cpp +++ b/Sourcecode/private/mx/core/elements/Bend.cpp @@ -13,179 +13,165 @@ namespace mx { - namespace core - { - Bend::Bend() - :myAttributes( std::make_shared() ) - ,myBendAlter( makeBendAlter() ) - ,myBendChoice( makeBendChoice() ) - ,myHasBendChoice( false ) - ,myWithBar( makeWithBar() ) - ,myHasWithBar( false ) - {} - - - bool Bend::hasAttributes() const - { - return myAttributes->hasValues(); - } - +namespace core +{ +Bend::Bend() + : myAttributes(std::make_shared()), myBendAlter(makeBendAlter()), myBendChoice(makeBendChoice()), + myHasBendChoice(false), myWithBar(makeWithBar()), myHasWithBar(false) +{ +} - std::ostream& Bend::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +bool Bend::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Bend::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - std::ostream& Bend::streamName( std::ostream& os ) const - { - os << "bend"; - return os; - } +std::ostream &Bend::streamName(std::ostream &os) const +{ + os << "bend"; + return os; +} +bool Bend::hasContents() const +{ + return true; +} - bool Bend::hasContents() const - { - return true; - } +std::ostream &Bend::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myBendAlter->toStream(os, indentLevel + 1); + if (myHasBendChoice) + { + os << std::endl; + myBendChoice->streamContents(os, indentLevel + 1, isOneLineOnly); + } - std::ostream& Bend::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myBendAlter->toStream( os, indentLevel+1 ); - - if( myHasBendChoice ) - { - os << std::endl; - myBendChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - - if ( myHasWithBar ) - { - os << std::endl; - myWithBar->toStream( os, indentLevel+1 ); - } - - os << std::endl; - isOneLineOnly = false; - return os; - } + if (myHasWithBar) + { + os << std::endl; + myWithBar->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} - BendAttributesPtr Bend::getAttributes() const - { - return myAttributes; - } +BendAttributesPtr Bend::getAttributes() const +{ + return myAttributes; +} +void Bend::setAttributes(const BendAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - void Bend::setAttributes( const BendAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +BendAlterPtr Bend::getBendAlter() const +{ + return myBendAlter; +} +void Bend::setBendAlter(const BendAlterPtr &value) +{ + if (value) + { + myBendAlter = value; + } +} - BendAlterPtr Bend::getBendAlter() const - { - return myBendAlter; - } +BendChoicePtr Bend::getBendChoice() const +{ + return myBendChoice; +} +void Bend::setBendChoice(const BendChoicePtr &value) +{ + if (value) + { + myBendChoice = value; + } +} - void Bend::setBendAlter( const BendAlterPtr& value ) - { - if( value ) - { - myBendAlter = value; - } - } +bool Bend::getHasBendChoice() const +{ + return myHasBendChoice; +} +void Bend::setHasBendChoice(const bool value) +{ + myHasBendChoice = value; +} - BendChoicePtr Bend::getBendChoice() const - { - return myBendChoice; - } +WithBarPtr Bend::getWithBar() const +{ + return myWithBar; +} +void Bend::setWithBar(const WithBarPtr &value) +{ + if (value) + { + myWithBar = value; + } +} - void Bend::setBendChoice( const BendChoicePtr& value ) - { - if ( value ) - { - myBendChoice = value; - } - } - - - bool Bend::getHasBendChoice() const - { - return myHasBendChoice; - } - - - void Bend::setHasBendChoice( const bool value ) - { - myHasBendChoice = value; - } - - +bool Bend::getHasWithBar() const +{ + return myHasWithBar; +} - WithBarPtr Bend::getWithBar() const - { - return myWithBar; - } +void Bend::setHasWithBar(const bool value) +{ + myHasWithBar = value; +} +bool Bend::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isBendAlterFound = false; - void Bend::setWithBar( const WithBarPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myBendAlter, isBendAlterFound)) { - if( value ) - { - myWithBar = value; - } + continue; } - - bool Bend::getHasWithBar() const + if (checkSetChoiceMember(message, *it, isSuccess, myBendChoice, "pre-bend", &BendChoice::getPreBend, + static_cast(BendChoice::Choice::preBend))) { - return myHasWithBar; + myHasBendChoice = true; + continue; } - - void Bend::setHasWithBar( const bool value ) + if (checkSetChoiceMember(message, *it, isSuccess, myBendChoice, "release", &BendChoice::getRelease, + static_cast(BendChoice::Choice::release))) { - myHasWithBar = value; + myHasBendChoice = true; + continue; } - - bool Bend::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myWithBar, myHasWithBar)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isBendAlterFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myBendAlter, isBendAlterFound ) ) { continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myBendChoice, - "pre-bend", &BendChoice::getPreBend, - static_cast( BendChoice::Choice::preBend ) ) ) - { myHasBendChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myBendChoice, - "release", &BendChoice::getRelease, - static_cast( BendChoice::Choice::release ) ) ) - { myHasBendChoice = true; continue; } - - if ( importElement( message, *it, isSuccess, *myWithBar, myHasWithBar ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Bend.h b/Sourcecode/private/mx/core/elements/Bend.h index b65a792f9..14c05ecc9 100644 --- a/Sourcecode/private/mx/core/elements/Bend.h +++ b/Sourcecode/private/mx/core/elements/Bend.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BendAttributes.h" #include @@ -14,56 +14,59 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BendAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BendAlter ) - MX_FORWARD_DECLARE_ELEMENT( BendChoice ) - MX_FORWARD_DECLARE_ELEMENT( WithBar ) - MX_FORWARD_DECLARE_ELEMENT( Bend ) +MX_FORWARD_DECLARE_ATTRIBUTES(BendAttributes) +MX_FORWARD_DECLARE_ELEMENT(BendAlter) +MX_FORWARD_DECLARE_ELEMENT(BendChoice) +MX_FORWARD_DECLARE_ELEMENT(WithBar) +MX_FORWARD_DECLARE_ELEMENT(Bend) - inline BendPtr makeBend() { return std::make_shared(); } +inline BendPtr makeBend() +{ + return std::make_shared(); +} - class Bend : public ElementInterface - { - public: - Bend(); +class Bend : public ElementInterface +{ + public: + Bend(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BendAttributesPtr getAttributes() const; - void setAttributes( const BendAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BendAttributesPtr getAttributes() const; + void setAttributes(const BendAttributesPtr &value); - /* _________ BendAlter minOccurs = 1, maxOccurs = 1 _________ */ - BendAlterPtr getBendAlter() const; - void setBendAlter( const BendAlterPtr& value ); + /* _________ BendAlter minOccurs = 1, maxOccurs = 1 _________ */ + BendAlterPtr getBendAlter() const; + void setBendAlter(const BendAlterPtr &value); - /* _________ BendChoice minOccurs = 0, maxOccurs = 1 _________ */ - BendChoicePtr getBendChoice() const; - void setBendChoice( const BendChoicePtr& value ); - bool getHasBendChoice() const; - void setHasBendChoice( const bool value ); + /* _________ BendChoice minOccurs = 0, maxOccurs = 1 _________ */ + BendChoicePtr getBendChoice() const; + void setBendChoice(const BendChoicePtr &value); + bool getHasBendChoice() const; + void setHasBendChoice(const bool value); - /* _________ WithBar minOccurs = 0, maxOccurs = 1 _________ */ - WithBarPtr getWithBar() const; - void setWithBar( const WithBarPtr& value ); - bool getHasWithBar() const; - void setHasWithBar( const bool value ); + /* _________ WithBar minOccurs = 0, maxOccurs = 1 _________ */ + WithBarPtr getWithBar() const; + void setWithBar(const WithBarPtr &value); + bool getHasWithBar() const; + void setHasWithBar(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - BendAttributesPtr myAttributes; - BendAlterPtr myBendAlter; - BendChoicePtr myBendChoice; - bool myHasBendChoice; - WithBarPtr myWithBar; - bool myHasWithBar; - }; - } -} + private: + BendAttributesPtr myAttributes; + BendAlterPtr myBendAlter; + BendChoicePtr myBendChoice; + bool myHasBendChoice; + WithBarPtr myWithBar; + bool myHasWithBar; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BendAlter.cpp b/Sourcecode/private/mx/core/elements/BendAlter.cpp index 415542d24..1578e62c5 100644 --- a/Sourcecode/private/mx/core/elements/BendAlter.cpp +++ b/Sourcecode/private/mx/core/elements/BendAlter.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - BendAlter::BendAlter() - :myValue() - {} - - - BendAlter::BendAlter( const Semitones& value ) - :myValue( value ) - {} - - - bool BendAlter::hasAttributes() const - { - return false; - } - - - bool BendAlter::hasContents() const - { - return true; - } - - - std::ostream& BendAlter::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BendAlter::streamName( std::ostream& os ) const - { - os << "bend-alter"; - return os; - } +namespace core +{ +BendAlter::BendAlter() : myValue() +{ +} +BendAlter::BendAlter(const Semitones &value) : myValue(value) +{ +} - std::ostream& BendAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool BendAlter::hasAttributes() const +{ + return false; +} +bool BendAlter::hasContents() const +{ + return true; +} - Semitones BendAlter::getValue() const - { - return myValue; - } +std::ostream &BendAlter::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &BendAlter::streamName(std::ostream &os) const +{ + os << "bend-alter"; + return os; +} - void BendAlter::setValue( const Semitones& value ) - { - myValue = value; - } +std::ostream &BendAlter::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Semitones BendAlter::getValue() const +{ + return myValue; +} - bool BendAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void BendAlter::setValue(const Semitones &value) +{ + myValue = value; +} - } +bool BendAlter::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BendAlter.h b/Sourcecode/private/mx/core/elements/BendAlter.h index 7f6cdafe5..856afa65d 100644 --- a/Sourcecode/private/mx/core/elements/BendAlter.h +++ b/Sourcecode/private/mx/core/elements/BendAlter.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BendAlter ) - - inline BendAlterPtr makeBendAlter() { return std::make_shared(); } - inline BendAlterPtr makeBendAlter( const Semitones& value ) { return std::make_shared( value ); } - inline BendAlterPtr makeBendAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class BendAlter : public ElementInterface - { - public: - BendAlter(); - BendAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BendAlter) + +inline BendAlterPtr makeBendAlter() +{ + return std::make_shared(); } + +inline BendAlterPtr makeBendAlter(const Semitones &value) +{ + return std::make_shared(value); +} + +inline BendAlterPtr makeBendAlter(Semitones &&value) +{ + return std::make_shared(std::move(value)); +} + +class BendAlter : public ElementInterface +{ + public: + BendAlter(); + BendAlter(const Semitones &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Semitones getValue() const; + void setValue(const Semitones &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Semitones myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BendAttributes.cpp b/Sourcecode/private/mx/core/elements/BendAttributes.cpp index 7ae010823..261c86337 100644 --- a/Sourcecode/private/mx/core/elements/BendAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BendAttributes.cpp @@ -8,106 +8,111 @@ namespace mx { - namespace core +namespace core +{ +BendAttributes::BendAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), accelerate(YesNo::no), beats(), + firstBeat(), lastBeat(), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), + hasAccelerate(false), hasBeats(false), hasFirstBeat(false), hasLastBeat(false) +{ +} + +bool BendAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasAccelerate || hasBeats || hasFirstBeat || hasLastBeat; +} + +std::ostream &BendAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - BendAttributes::BendAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,accelerate( YesNo::no ) - ,beats() - ,firstBeat() - ,lastBeat() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasFirstBeat( false ) - ,hasLastBeat( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, accelerate, "accelerate", hasAccelerate); + streamAttribute(os, beats, "beats", hasBeats); + streamAttribute(os, firstBeat, "first-beat", hasFirstBeat); + streamAttribute(os, lastBeat, "last-beat", hasLastBeat); + } + return os; +} +bool BendAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BendAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BendAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasAccelerate || - hasBeats || - hasFirstBeat || - hasLastBeat; + continue; } - - - std::ostream& BendAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, firstBeat, "first-beat", hasFirstBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - } - return os; + continue; } - - - bool BendAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "BendAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, firstBeat, hasFirstBeat, "first-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, beats, hasBeats, "beats")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, firstBeat, hasFirstBeat, "first-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BendAttributes.h b/Sourcecode/private/mx/core/elements/BendAttributes.h index 407602fcd..8c0775f31 100644 --- a/Sourcecode/private/mx/core/elements/BendAttributes.h +++ b/Sourcecode/private/mx/core/elements/BendAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,46 +18,46 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BendAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BendAttributes) - struct BendAttributes : public AttributesInterface - { - public: - BendAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo accelerate; - TrillBeats beats; - Percent firstBeat; - Percent lastBeat; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasAccelerate; - bool hasBeats; - bool hasFirstBeat; - bool hasLastBeat; +struct BendAttributes : public AttributesInterface +{ + public: + BendAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + YesNo accelerate; + TrillBeats beats; + Percent firstBeat; + Percent lastBeat; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasAccelerate; + bool hasBeats; + bool hasFirstBeat; + bool hasLastBeat; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BendChoice.cpp b/Sourcecode/private/mx/core/elements/BendChoice.cpp index cdf43e71b..315dcb572 100644 --- a/Sourcecode/private/mx/core/elements/BendChoice.cpp +++ b/Sourcecode/private/mx/core/elements/BendChoice.cpp @@ -10,104 +10,88 @@ namespace mx { - namespace core - { - BendChoice::BendChoice() - :myChoice( Choice::preBend ) - ,myPreBend( makePreBend() ) - ,myRelease( makeRelease() ) - {} - - - bool BendChoice::hasAttributes() const - { - return false; - } - - - std::ostream& BendChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BendChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool BendChoice::hasContents() const - { - return true; - } - - - std::ostream& BendChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - switch ( myChoice ) - { - case Choice::preBend: - { - myPreBend->toStream( os, indentLevel ); - } - break; - case Choice::release: - { - myRelease->toStream( os, indentLevel ); - } - break; - default: - break; - } - return os; - } - - - BendChoice::Choice BendChoice::getChoice() const - { - return myChoice; - } - - - void BendChoice::setChoice( BendChoice::Choice value ) - { - myChoice = value; - } +namespace core +{ +BendChoice::BendChoice() : myChoice(Choice::preBend), myPreBend(makePreBend()), myRelease(makeRelease()) +{ +} +bool BendChoice::hasAttributes() const +{ + return false; +} - PreBendPtr BendChoice::getPreBend() const - { - return myPreBend; - } +std::ostream &BendChoice::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &BendChoice::streamName(std::ostream &os) const +{ + return os; +} - void BendChoice::setPreBend( const PreBendPtr& value ) - { - if ( value ) - { - myPreBend = value; - } - } +bool BendChoice::hasContents() const +{ + return true; +} +std::ostream &BendChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(isOneLineOnly); + switch (myChoice) + { + case Choice::preBend: { + myPreBend->toStream(os, indentLevel); + } + break; + case Choice::release: { + myRelease->toStream(os, indentLevel); + } + break; + default: + break; + } + return os; +} - ReleasePtr BendChoice::getRelease() const - { - return myRelease; - } +BendChoice::Choice BendChoice::getChoice() const +{ + return myChoice; +} +void BendChoice::setChoice(BendChoice::Choice value) +{ + myChoice = value; +} - void BendChoice::setRelease( const ReleasePtr& value ) - { - if ( value ) - { - myRelease = value; - } - } +PreBendPtr BendChoice::getPreBend() const +{ + return myPreBend; +} +void BendChoice::setPreBend(const PreBendPtr &value) +{ + if (value) + { + myPreBend = value; + } +} - MX_FROM_XELEMENT_UNUSED( BendChoice ); +ReleasePtr BendChoice::getRelease() const +{ + return myRelease; +} +void BendChoice::setRelease(const ReleasePtr &value) +{ + if (value) + { + myRelease = value; } } + +MX_FROM_XELEMENT_UNUSED(BendChoice); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BendChoice.h b/Sourcecode/private/mx/core/elements/BendChoice.h index 2efc63f3d..a492ced47 100644 --- a/Sourcecode/private/mx/core/elements/BendChoice.h +++ b/Sourcecode/private/mx/core/elements/BendChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,48 +13,51 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PreBend) +MX_FORWARD_DECLARE_ELEMENT(Release) +MX_FORWARD_DECLARE_ELEMENT(BendChoice) - MX_FORWARD_DECLARE_ELEMENT( PreBend ) - MX_FORWARD_DECLARE_ELEMENT( Release ) - MX_FORWARD_DECLARE_ELEMENT( BendChoice ) - - inline BendChoicePtr makeBendChoice() { return std::make_shared(); } - - class BendChoice : public ElementInterface - { - public: - enum class Choice - { - preBend = 1, - release = 2 - }; - BendChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BendChoice::Choice getChoice() const; - void setChoice( BendChoice::Choice value ); - - /* _________ PreBend minOccurs = 1, maxOccurs = 1 _________ */ - PreBendPtr getPreBend() const; - void setPreBend( const PreBendPtr& value ); - - /* _________ Release minOccurs = 1, maxOccurs = 1 _________ */ - ReleasePtr getRelease() const; - void setRelease( const ReleasePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - PreBendPtr myPreBend; - ReleasePtr myRelease; - }; - } +inline BendChoicePtr makeBendChoice() +{ + return std::make_shared(); } + +class BendChoice : public ElementInterface +{ + public: + enum class Choice + { + preBend = 1, + release = 2 + }; + BendChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BendChoice::Choice getChoice() const; + void setChoice(BendChoice::Choice value); + + /* _________ PreBend minOccurs = 1, maxOccurs = 1 _________ */ + PreBendPtr getPreBend() const; + void setPreBend(const PreBendPtr &value); + + /* _________ Release minOccurs = 1, maxOccurs = 1 _________ */ + ReleasePtr getRelease() const; + void setRelease(const ReleasePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + PreBendPtr myPreBend; + ReleasePtr myRelease; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Bookmark.cpp b/Sourcecode/private/mx/core/elements/Bookmark.cpp index 01d77ba79..9a0620616 100644 --- a/Sourcecode/private/mx/core/elements/Bookmark.cpp +++ b/Sourcecode/private/mx/core/elements/Bookmark.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Bookmark::Bookmark() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Bookmark::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Bookmark::hasContents() const { return false; } - std::ostream& Bookmark::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Bookmark::streamName( std::ostream& os ) const { os << "bookmark"; return os; } - std::ostream& Bookmark::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Bookmark::Bookmark() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Bookmark::hasAttributes() const +{ + return myAttributes->hasValues(); +} - BookmarkAttributesPtr Bookmark::getAttributes() const - { - return myAttributes; - } +bool Bookmark::hasContents() const +{ + return false; +} +std::ostream &Bookmark::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Bookmark::setAttributes( const BookmarkAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Bookmark::streamName(std::ostream &os) const +{ + os << "bookmark"; + return os; +} +std::ostream &Bookmark::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Bookmark::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +BookmarkAttributesPtr Bookmark::getAttributes() const +{ + return myAttributes; +} +void Bookmark::setAttributes(const BookmarkAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Bookmark::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Bookmark.h b/Sourcecode/private/mx/core/elements/Bookmark.h index b99dbf27b..ec409d34b 100644 --- a/Sourcecode/private/mx/core/elements/Bookmark.h +++ b/Sourcecode/private/mx/core/elements/Bookmark.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BookmarkAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BookmarkAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Bookmark ) - - inline BookmarkPtr makeBookmark() { return std::make_shared(); } - - class Bookmark : public ElementInterface - { - public: - Bookmark(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BookmarkAttributesPtr getAttributes() const; - void setAttributes( const BookmarkAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BookmarkAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BookmarkAttributes) +MX_FORWARD_DECLARE_ELEMENT(Bookmark) + +inline BookmarkPtr makeBookmark() +{ + return std::make_shared(); } + +class Bookmark : public ElementInterface +{ + public: + Bookmark(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BookmarkAttributesPtr getAttributes() const; + void setAttributes(const BookmarkAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BookmarkAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp b/Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp index a3490808c..9dbe224a8 100644 --- a/Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp @@ -8,67 +8,67 @@ namespace mx { - namespace core +namespace core +{ +BookmarkAttributes::BookmarkAttributes() + : id(), name(), element(), position(), hasId(true), hasName(false), hasElement(false), hasPosition(false) +{ +} + +bool BookmarkAttributes::hasValues() const +{ + return hasId || hasName || hasElement || hasPosition; +} + +std::ostream &BookmarkAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - BookmarkAttributes::BookmarkAttributes() - :id() - ,name() - ,element() - ,position() - ,hasId( true ) - ,hasName( false ) - ,hasElement( false ) - ,hasPosition( false ) - {} + streamAttribute(os, id, "id", hasId); + streamAttribute(os, name, "name", hasName); + streamAttribute(os, element, "element", hasElement); + streamAttribute(os, position, "position", hasPosition); + } + return os; +} + +bool BookmarkAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BookmarkAttributes"; + bool isSuccess = true; + bool isIdFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BookmarkAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, id, isIdFound, "id")) { - return hasId || - hasName || - hasElement || - hasPosition; + continue; } - - - std::ostream& BookmarkAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, name, hasName, "name")) { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, element, "element", hasElement ); - streamAttribute( os, position, "position", hasPosition ); - } - return os; + continue; } - - - bool BookmarkAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, element, hasElement, "element")) { - const char* const className = "BookmarkAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, element, hasElement, "element" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, position, hasPosition, "position" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, position, hasPosition, "position")) + { + continue; + } + } + if (!isIdFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BookmarkAttributes.h b/Sourcecode/private/mx/core/elements/BookmarkAttributes.h index 3ff5eb037..34dc4a72e 100644 --- a/Sourcecode/private/mx/core/elements/BookmarkAttributes.h +++ b/Sourcecode/private/mx/core/elements/BookmarkAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/XsID.h" #include "mx/core/XsNMToken.h" @@ -16,28 +16,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BookmarkAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BookmarkAttributes) - struct BookmarkAttributes : public AttributesInterface - { - public: - BookmarkAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsID id; - XsToken name; - XsNMToken element; - PositiveInteger position; - const bool hasId; - bool hasName; - bool hasElement; - bool hasPosition; +struct BookmarkAttributes : public AttributesInterface +{ + public: + BookmarkAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsID id; + XsToken name; + XsNMToken element; + PositiveInteger position; + const bool hasId; + bool hasName; + bool hasElement; + bool hasPosition; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BottomMargin.cpp b/Sourcecode/private/mx/core/elements/BottomMargin.cpp index 5abf2e5d8..3adf4736e 100644 --- a/Sourcecode/private/mx/core/elements/BottomMargin.cpp +++ b/Sourcecode/private/mx/core/elements/BottomMargin.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - BottomMargin::BottomMargin() - :myValue() - {} - - - BottomMargin::BottomMargin( const TenthsValue& value ) - :myValue( value ) - {} - - - bool BottomMargin::hasAttributes() const - { - return false; - } - - - bool BottomMargin::hasContents() const - { - return true; - } - - - std::ostream& BottomMargin::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BottomMargin::streamName( std::ostream& os ) const - { - os << "bottom-margin"; - return os; - } +namespace core +{ +BottomMargin::BottomMargin() : myValue() +{ +} +BottomMargin::BottomMargin(const TenthsValue &value) : myValue(value) +{ +} - std::ostream& BottomMargin::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool BottomMargin::hasAttributes() const +{ + return false; +} +bool BottomMargin::hasContents() const +{ + return true; +} - TenthsValue BottomMargin::getValue() const - { - return myValue; - } +std::ostream &BottomMargin::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &BottomMargin::streamName(std::ostream &os) const +{ + os << "bottom-margin"; + return os; +} - void BottomMargin::setValue( const TenthsValue& value ) - { - myValue = value; - } +std::ostream &BottomMargin::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TenthsValue BottomMargin::getValue() const +{ + return myValue; +} - bool BottomMargin::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void BottomMargin::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool BottomMargin::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BottomMargin.h b/Sourcecode/private/mx/core/elements/BottomMargin.h index 1fc2eb0b6..38d794631 100644 --- a/Sourcecode/private/mx/core/elements/BottomMargin.h +++ b/Sourcecode/private/mx/core/elements/BottomMargin.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BottomMargin ) - - inline BottomMarginPtr makeBottomMargin() { return std::make_shared(); } - inline BottomMarginPtr makeBottomMargin( const TenthsValue& value ) { return std::make_shared( value ); } - inline BottomMarginPtr makeBottomMargin( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class BottomMargin : public ElementInterface - { - public: - BottomMargin(); - BottomMargin( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BottomMargin) + +inline BottomMarginPtr makeBottomMargin() +{ + return std::make_shared(); } + +inline BottomMarginPtr makeBottomMargin(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline BottomMarginPtr makeBottomMargin(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class BottomMargin : public ElementInterface +{ + public: + BottomMargin(); + BottomMargin(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Bracket.cpp b/Sourcecode/private/mx/core/elements/Bracket.cpp index 40ccdc0b3..1d475006f 100644 --- a/Sourcecode/private/mx/core/elements/Bracket.cpp +++ b/Sourcecode/private/mx/core/elements/Bracket.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Bracket::Bracket() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Bracket::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Bracket::hasContents() const { return false; } - std::ostream& Bracket::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Bracket::streamName( std::ostream& os ) const { os << "bracket"; return os; } - std::ostream& Bracket::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Bracket::Bracket() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Bracket::hasAttributes() const +{ + return myAttributes->hasValues(); +} - BracketAttributesPtr Bracket::getAttributes() const - { - return myAttributes; - } +bool Bracket::hasContents() const +{ + return false; +} +std::ostream &Bracket::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Bracket::setAttributes( const BracketAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Bracket::streamName(std::ostream &os) const +{ + os << "bracket"; + return os; +} +std::ostream &Bracket::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Bracket::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +BracketAttributesPtr Bracket::getAttributes() const +{ + return myAttributes; +} +void Bracket::setAttributes(const BracketAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Bracket::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Bracket.h b/Sourcecode/private/mx/core/elements/Bracket.h index 8f2aff7f0..6d6336ec3 100644 --- a/Sourcecode/private/mx/core/elements/Bracket.h +++ b/Sourcecode/private/mx/core/elements/Bracket.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BracketAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BracketAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Bracket ) - - inline BracketPtr makeBracket() { return std::make_shared(); } - - class Bracket : public ElementInterface - { - public: - Bracket(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BracketAttributesPtr getAttributes() const; - void setAttributes( const BracketAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BracketAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BracketAttributes) +MX_FORWARD_DECLARE_ELEMENT(Bracket) + +inline BracketPtr makeBracket() +{ + return std::make_shared(); } + +class Bracket : public ElementInterface +{ + public: + Bracket(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BracketAttributesPtr getAttributes() const; + void setAttributes(const BracketAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BracketAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BracketAttributes.cpp b/Sourcecode/private/mx/core/elements/BracketAttributes.cpp index 5bd4d456d..701fc949d 100644 --- a/Sourcecode/private/mx/core/elements/BracketAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BracketAttributes.cpp @@ -8,93 +8,106 @@ namespace mx { - namespace core +namespace core +{ +BracketAttributes::BracketAttributes() + : type(), number(), lineEnd(LineEnd::down), endLength(), lineType(), dashLength(), spaceLength(), defaultX(), + defaultY(), relativeX(), relativeY(), color(), hasType(true), hasNumber(false), hasLineEnd(true), + hasEndLength(false), hasLineType(false), hasDashLength(false), hasSpaceLength(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasColor(false) +{ +} + +bool BracketAttributes::hasValues() const +{ + return hasType || hasLineEnd; +} + +std::ostream &BracketAttributes::toStream(std::ostream &os) const +{ + if (!hasValues()) { - BracketAttributes::BracketAttributes() - :type() - ,number() - ,lineEnd( LineEnd::down ) - ,endLength() - ,lineType() - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,color() - ,hasType( true ) - ,hasNumber( false ) - ,hasLineEnd( true ) - ,hasEndLength( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasColor( false ) - {} + return os; + } + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, lineEnd, "line-end", hasLineEnd); + streamAttribute(os, endLength, "end-length", hasEndLength); + streamAttribute(os, lineType, "line-type", hasLineType); + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, spaceLength, "space-length", hasSpaceLength); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, color, "color", hasColor); + return os; +} +bool BracketAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BracketAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + bool isLineEndFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BracketAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue)) { - return hasType || hasLineEnd; + continue; } - - - std::ostream& BracketAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if( !hasValues() ) - { - return os; - } - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineEnd, "line-end", hasLineEnd ); - streamAttribute( os, endLength, "end-length", hasEndLength ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, color, "color", hasColor ); - return os; + continue; } - - - bool BracketAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, lineEnd, isLineEndFound, "line-end", &parseLineEnd)) { - const char* const className = "BracketAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - bool isLineEndFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineEnd, isLineEndFound, "line-end", &parseLineEnd ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, endLength, hasEndLength, "end-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, endLength, hasEndLength, "end-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dashLength, hasDashLength, "dash-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BracketAttributes.h b/Sourcecode/private/mx/core/elements/BracketAttributes.h index 2585fdc89..32ea6e105 100644 --- a/Sourcecode/private/mx/core/elements/BracketAttributes.h +++ b/Sourcecode/private/mx/core/elements/BracketAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/Color.h" +#include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" -#include "mx/core/Decimals.h" -#include "mx/core/Color.h" #include #include @@ -17,10 +17,11 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BracketAttributes) - MX_FORWARD_DECLARE_ATTRIBUTES( BracketAttributes ) /* @@ -31,39 +32,39 @@ namespace mx */ - struct BracketAttributes : public AttributesInterface - { - public: - BracketAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopContinue type; - NumberLevel number; - LineEnd lineEnd; - TenthsValue endLength; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - Color color; - const bool hasType; - bool hasNumber; - const bool hasLineEnd; - bool hasEndLength; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasColor; +struct BracketAttributes : public AttributesInterface +{ + public: + BracketAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStopContinue type; + NumberLevel number; + LineEnd lineEnd; + TenthsValue endLength; + LineType lineType; + TenthsValue dashLength; + TenthsValue spaceLength; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + Color color; + const bool hasType; + bool hasNumber; + const bool hasLineEnd; + bool hasEndLength; + bool hasLineType; + bool hasDashLength; + bool hasSpaceLength; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasColor; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BreathMark.cpp b/Sourcecode/private/mx/core/elements/BreathMark.cpp index faf3b042a..b5a1779f7 100644 --- a/Sourcecode/private/mx/core/elements/BreathMark.cpp +++ b/Sourcecode/private/mx/core/elements/BreathMark.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - BreathMark::BreathMark() - :myValue( BreathMarkValue::emptystring ) - ,myAttributes( std::make_shared() ) - {} - - - BreathMark::BreathMark( const BreathMarkValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool BreathMark::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool BreathMark::hasContents() const - { - return true; - } - - - std::ostream& BreathMark::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& BreathMark::streamName( std::ostream& os ) const - { - os << "breath-mark"; - return os; - } - - - std::ostream& BreathMark::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +BreathMark::BreathMark() : myValue(BreathMarkValue::emptystring), myAttributes(std::make_shared()) +{ +} +BreathMark::BreathMark(const BreathMarkValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - BreathMarkAttributesPtr BreathMark::getAttributes() const - { - return myAttributes; - } +bool BreathMark::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool BreathMark::hasContents() const +{ + return true; +} - void BreathMark::setAttributes( const BreathMarkAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &BreathMark::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &BreathMark::streamName(std::ostream &os) const +{ + os << "breath-mark"; + return os; +} - BreathMarkValue BreathMark::getValue() const - { - return myValue; - } +std::ostream &BreathMark::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +BreathMarkAttributesPtr BreathMark::getAttributes() const +{ + return myAttributes; +} - void BreathMark::setValue( const BreathMarkValue& value ) - { - myValue = value; - } +void BreathMark::setAttributes(const BreathMarkAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +BreathMarkValue BreathMark::getValue() const +{ + return myValue; +} - bool BreathMark::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBreathMarkValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void BreathMark::setValue(const BreathMarkValue &value) +{ + myValue = value; +} - } +bool BreathMark::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseBreathMarkValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BreathMark.h b/Sourcecode/private/mx/core/elements/BreathMark.h index 706e906c3..fee53e2ef 100644 --- a/Sourcecode/private/mx/core/elements/BreathMark.h +++ b/Sourcecode/private/mx/core/elements/BreathMark.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/BreathMarkAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BreathMarkAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BreathMark ) - - inline BreathMarkPtr makeBreathMark() { return std::make_shared(); } - inline BreathMarkPtr makeBreathMark( const BreathMarkValue& value ) { return std::make_shared( value ); } - inline BreathMarkPtr makeBreathMark( BreathMarkValue&& value ) { return std::make_shared( std::move( value ) ); } - - class BreathMark : public ElementInterface - { - public: - BreathMark(); - BreathMark( const BreathMarkValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BreathMarkAttributesPtr getAttributes() const; - void setAttributes( const BreathMarkAttributesPtr& attributes ); - BreathMarkValue getValue() const; - void setValue( const BreathMarkValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BreathMarkValue myValue; - BreathMarkAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(BreathMarkAttributes) +MX_FORWARD_DECLARE_ELEMENT(BreathMark) + +inline BreathMarkPtr makeBreathMark() +{ + return std::make_shared(); +} + +inline BreathMarkPtr makeBreathMark(const BreathMarkValue &value) +{ + return std::make_shared(value); } + +inline BreathMarkPtr makeBreathMark(BreathMarkValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class BreathMark : public ElementInterface +{ + public: + BreathMark(); + BreathMark(const BreathMarkValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + BreathMarkAttributesPtr getAttributes() const; + void setAttributes(const BreathMarkAttributesPtr &attributes); + BreathMarkValue getValue() const; + void setValue(const BreathMarkValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BreathMarkValue myValue; + BreathMarkAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp b/Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp index ba819fdb1..42c89e884 100644 --- a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +BreathMarkAttributes::BreathMarkAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), placement(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool BreathMarkAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &BreathMarkAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - BreathMarkAttributes::BreathMarkAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool BreathMarkAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "BreathMarkAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool BreathMarkAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& BreathMarkAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool BreathMarkAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "BreathMarkAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.h b/Sourcecode/private/mx/core/elements/BreathMarkAttributes.h index d023727cb..fec92d1bf 100644 --- a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.h +++ b/Sourcecode/private/mx/core/elements/BreathMarkAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -18,38 +18,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( BreathMarkAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(BreathMarkAttributes) - struct BreathMarkAttributes : public AttributesInterface - { - public: - BreathMarkAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct BreathMarkAttributes : public AttributesInterface +{ + public: + BreathMarkAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Caesura.cpp b/Sourcecode/private/mx/core/elements/Caesura.cpp index 2ce3319ce..b19cb0656 100644 --- a/Sourcecode/private/mx/core/elements/Caesura.cpp +++ b/Sourcecode/private/mx/core/elements/Caesura.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Caesura::Caesura() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Caesura::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Caesura::hasContents() const { return false; } - std::ostream& Caesura::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Caesura::streamName( std::ostream& os ) const { os << "caesura"; return os; } - std::ostream& Caesura::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Caesura::Caesura() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Caesura::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Caesura::getAttributes() const - { - return myAttributes; - } +bool Caesura::hasContents() const +{ + return false; +} +std::ostream &Caesura::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Caesura::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Caesura::streamName(std::ostream &os) const +{ + os << "caesura"; + return os; +} +std::ostream &Caesura::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Caesura::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Caesura::getAttributes() const +{ + return myAttributes; +} +void Caesura::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Caesura::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Caesura.h b/Sourcecode/private/mx/core/elements/Caesura.h index 08fa65606..dcf1de216 100644 --- a/Sourcecode/private/mx/core/elements/Caesura.h +++ b/Sourcecode/private/mx/core/elements/Caesura.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Caesura ) - - inline CaesuraPtr makeCaesura() { return std::make_shared(); } - - class Caesura : public ElementInterface - { - public: - Caesura(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Caesura) + +inline CaesuraPtr makeCaesura() +{ + return std::make_shared(); } + +class Caesura : public ElementInterface +{ + public: + Caesura(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Cancel.cpp b/Sourcecode/private/mx/core/elements/Cancel.cpp index e63b2a80d..3a88c09f2 100644 --- a/Sourcecode/private/mx/core/elements/Cancel.cpp +++ b/Sourcecode/private/mx/core/elements/Cancel.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Cancel::Cancel() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Cancel::Cancel( const FifthsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Cancel::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Cancel::hasContents() const - { - return true; - } - - - std::ostream& Cancel::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Cancel::streamName( std::ostream& os ) const - { - os << "cancel"; - return os; - } - - - std::ostream& Cancel::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Cancel::Cancel() : myValue(), myAttributes(std::make_shared()) +{ +} +Cancel::Cancel(const FifthsValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - CancelAttributesPtr Cancel::getAttributes() const - { - return myAttributes; - } +bool Cancel::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Cancel::hasContents() const +{ + return true; +} - void Cancel::setAttributes( const CancelAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Cancel::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Cancel::streamName(std::ostream &os) const +{ + os << "cancel"; + return os; +} - FifthsValue Cancel::getValue() const - { - return myValue; - } +std::ostream &Cancel::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +CancelAttributesPtr Cancel::getAttributes() const +{ + return myAttributes; +} - void Cancel::setValue( const FifthsValue& value ) - { - myValue = value; - } +void Cancel::setAttributes(const CancelAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +FifthsValue Cancel::getValue() const +{ + return myValue; +} - bool Cancel::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Cancel::setValue(const FifthsValue &value) +{ + myValue = value; +} - } +bool Cancel::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Cancel.h b/Sourcecode/private/mx/core/elements/Cancel.h index 62f582daf..2cf1eb2fd 100644 --- a/Sourcecode/private/mx/core/elements/Cancel.h +++ b/Sourcecode/private/mx/core/elements/Cancel.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/elements/CancelAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CancelAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Cancel ) - - inline CancelPtr makeCancel() { return std::make_shared(); } - inline CancelPtr makeCancel( const FifthsValue& value ) { return std::make_shared( value ); } - inline CancelPtr makeCancel( FifthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Cancel : public ElementInterface - { - public: - Cancel(); - Cancel( const FifthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CancelAttributesPtr getAttributes() const; - void setAttributes( const CancelAttributesPtr& attributes ); - FifthsValue getValue() const; - void setValue( const FifthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FifthsValue myValue; - CancelAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(CancelAttributes) +MX_FORWARD_DECLARE_ELEMENT(Cancel) + +inline CancelPtr makeCancel() +{ + return std::make_shared(); +} + +inline CancelPtr makeCancel(const FifthsValue &value) +{ + return std::make_shared(value); } + +inline CancelPtr makeCancel(FifthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Cancel : public ElementInterface +{ + public: + Cancel(); + Cancel(const FifthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + CancelAttributesPtr getAttributes() const; + void setAttributes(const CancelAttributesPtr &attributes); + FifthsValue getValue() const; + void setValue(const FifthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + FifthsValue myValue; + CancelAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CancelAttributes.cpp b/Sourcecode/private/mx/core/elements/CancelAttributes.cpp index e00de9d50..60b3a6f4e 100644 --- a/Sourcecode/private/mx/core/elements/CancelAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/CancelAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - CancelAttributes::CancelAttributes() - :location() - ,hasLocation( false ) - {} - +namespace core +{ +CancelAttributes::CancelAttributes() : location(), hasLocation(false) +{ +} - bool CancelAttributes::hasValues() const - { - return hasLocation; - } +bool CancelAttributes::hasValues() const +{ + return hasLocation; +} +std::ostream &CancelAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, location, "location", hasLocation); + } + return os; +} - std::ostream& CancelAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, location, "location", hasLocation ); - } - return os; - } +bool CancelAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "CancelAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool CancelAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, location, hasLocation, "location", &parseCancelLocation)) { - const char* const className = "CancelAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseCancelLocation ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CancelAttributes.h b/Sourcecode/private/mx/core/elements/CancelAttributes.h index 02a793e7e..5d7c3ff7d 100644 --- a/Sourcecode/private/mx/core/elements/CancelAttributes.h +++ b/Sourcecode/private/mx/core/elements/CancelAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( CancelAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(CancelAttributes) - struct CancelAttributes : public AttributesInterface - { - public: - CancelAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CancelLocation location; - bool hasLocation; +struct CancelAttributes : public AttributesInterface +{ + public: + CancelAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + CancelLocation location; + bool hasLocation; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Capo.cpp b/Sourcecode/private/mx/core/elements/Capo.cpp index faecb59fc..2a558b92c 100644 --- a/Sourcecode/private/mx/core/elements/Capo.cpp +++ b/Sourcecode/private/mx/core/elements/Capo.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Capo::Capo() - :myValue() - {} - - - Capo::Capo( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool Capo::hasAttributes() const - { - return false; - } - - - bool Capo::hasContents() const - { - return true; - } - - - std::ostream& Capo::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Capo::streamName( std::ostream& os ) const - { - os << "capo"; - return os; - } +namespace core +{ +Capo::Capo() : myValue() +{ +} +Capo::Capo(const NonNegativeInteger &value) : myValue(value) +{ +} - std::ostream& Capo::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Capo::hasAttributes() const +{ + return false; +} +bool Capo::hasContents() const +{ + return true; +} - NonNegativeInteger Capo::getValue() const - { - return myValue; - } +std::ostream &Capo::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Capo::streamName(std::ostream &os) const +{ + os << "capo"; + return os; +} - void Capo::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } +std::ostream &Capo::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NonNegativeInteger Capo::getValue() const +{ + return myValue; +} - bool Capo::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Capo::setValue(const NonNegativeInteger &value) +{ + myValue = value; +} - } +bool Capo::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Capo.h b/Sourcecode/private/mx/core/elements/Capo.h index 82589bb5c..90563b8af 100644 --- a/Sourcecode/private/mx/core/elements/Capo.h +++ b/Sourcecode/private/mx/core/elements/Capo.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Capo ) - - inline CapoPtr makeCapo() { return std::make_shared(); } - inline CapoPtr makeCapo( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline CapoPtr makeCapo( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Capo : public ElementInterface - { - public: - Capo(); - Capo( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Capo) + +inline CapoPtr makeCapo() +{ + return std::make_shared(); +} + +inline CapoPtr makeCapo(const NonNegativeInteger &value) +{ + return std::make_shared(value); } + +inline CapoPtr makeCapo(NonNegativeInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class Capo : public ElementInterface +{ + public: + Capo(); + Capo(const NonNegativeInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NonNegativeInteger getValue() const; + void setValue(const NonNegativeInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Chord.cpp b/Sourcecode/private/mx/core/elements/Chord.cpp index 221b0f274..7ba31f317 100644 --- a/Sourcecode/private/mx/core/elements/Chord.cpp +++ b/Sourcecode/private/mx/core/elements/Chord.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Chord::Chord() : ElementInterface() {} - +namespace core +{ +Chord::Chord() : ElementInterface() +{ +} - bool Chord::hasAttributes() const { return false; } +bool Chord::hasAttributes() const +{ + return false; +} +bool Chord::hasContents() const +{ + return false; +} - bool Chord::hasContents() const { return false; } - std::ostream& Chord::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Chord::streamName( std::ostream& os ) const { os << "chord"; return os; } - std::ostream& Chord::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Chord::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Chord::streamName(std::ostream &os) const +{ + os << "chord"; + return os; +} - bool Chord::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &Chord::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Chord::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Chord.h b/Sourcecode/private/mx/core/elements/Chord.h index 6142c9dcc..f6025bb96 100644 --- a/Sourcecode/private/mx/core/elements/Chord.h +++ b/Sourcecode/private/mx/core/elements/Chord.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Chord ) - - inline ChordPtr makeChord() { return std::make_shared(); } - - class Chord : public ElementInterface - { - public: - Chord(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Chord) + +inline ChordPtr makeChord() +{ + return std::make_shared(); } + +class Chord : public ElementInterface +{ + public: + Chord(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Chromatic.cpp b/Sourcecode/private/mx/core/elements/Chromatic.cpp index f6792a76b..56e65ccd1 100644 --- a/Sourcecode/private/mx/core/elements/Chromatic.cpp +++ b/Sourcecode/private/mx/core/elements/Chromatic.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Chromatic::Chromatic() - :myValue() - {} - - - Chromatic::Chromatic( const Semitones& value ) - :myValue( value ) - {} - - - bool Chromatic::hasAttributes() const - { - return false; - } - - - bool Chromatic::hasContents() const - { - return true; - } - - - std::ostream& Chromatic::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Chromatic::streamName( std::ostream& os ) const - { - os << "chromatic"; - return os; - } +namespace core +{ +Chromatic::Chromatic() : myValue() +{ +} +Chromatic::Chromatic(const Semitones &value) : myValue(value) +{ +} - std::ostream& Chromatic::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Chromatic::hasAttributes() const +{ + return false; +} +bool Chromatic::hasContents() const +{ + return true; +} - Semitones Chromatic::getValue() const - { - return myValue; - } +std::ostream &Chromatic::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Chromatic::streamName(std::ostream &os) const +{ + os << "chromatic"; + return os; +} - void Chromatic::setValue( const Semitones& value ) - { - myValue = value; - } +std::ostream &Chromatic::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Semitones Chromatic::getValue() const +{ + return myValue; +} - bool Chromatic::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Chromatic::setValue(const Semitones &value) +{ + myValue = value; +} - } +bool Chromatic::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Chromatic.h b/Sourcecode/private/mx/core/elements/Chromatic.h index bef306800..54e658a6d 100644 --- a/Sourcecode/private/mx/core/elements/Chromatic.h +++ b/Sourcecode/private/mx/core/elements/Chromatic.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Chromatic ) - - inline ChromaticPtr makeChromatic() { return std::make_shared(); } - inline ChromaticPtr makeChromatic( const Semitones& value ) { return std::make_shared( value ); } - inline ChromaticPtr makeChromatic( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class Chromatic : public ElementInterface - { - public: - Chromatic(); - Chromatic( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Chromatic) + +inline ChromaticPtr makeChromatic() +{ + return std::make_shared(); } + +inline ChromaticPtr makeChromatic(const Semitones &value) +{ + return std::make_shared(value); +} + +inline ChromaticPtr makeChromatic(Semitones &&value) +{ + return std::make_shared(std::move(value)); +} + +class Chromatic : public ElementInterface +{ + public: + Chromatic(); + Chromatic(const Semitones &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Semitones getValue() const; + void setValue(const Semitones &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Semitones myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CircularArrow.cpp b/Sourcecode/private/mx/core/elements/CircularArrow.cpp index 8d690236a..ae544d1a6 100644 --- a/Sourcecode/private/mx/core/elements/CircularArrow.cpp +++ b/Sourcecode/private/mx/core/elements/CircularArrow.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - CircularArrow::CircularArrow() - :myValue( CircularArrowEnum::clockwise ) - {} - - - CircularArrow::CircularArrow( const CircularArrowEnum& value ) - :myValue( value ) - {} - - - bool CircularArrow::hasAttributes() const - { - return false; - } - - - bool CircularArrow::hasContents() const - { - return true; - } - - - std::ostream& CircularArrow::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CircularArrow::streamName( std::ostream& os ) const - { - os << "circular-arrow"; - return os; - } +namespace core +{ +CircularArrow::CircularArrow() : myValue(CircularArrowEnum::clockwise) +{ +} +CircularArrow::CircularArrow(const CircularArrowEnum &value) : myValue(value) +{ +} - std::ostream& CircularArrow::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool CircularArrow::hasAttributes() const +{ + return false; +} +bool CircularArrow::hasContents() const +{ + return true; +} - CircularArrowEnum CircularArrow::getValue() const - { - return myValue; - } +std::ostream &CircularArrow::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &CircularArrow::streamName(std::ostream &os) const +{ + os << "circular-arrow"; + return os; +} - void CircularArrow::setValue( const CircularArrowEnum& value ) - { - myValue = value; - } +std::ostream &CircularArrow::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +CircularArrowEnum CircularArrow::getValue() const +{ + return myValue; +} - bool CircularArrow::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseCircularArrowEnum( xelement.getValue() ); - return true; - } +void CircularArrow::setValue(const CircularArrowEnum &value) +{ + myValue = value; +} - } +bool CircularArrow::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseCircularArrowEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CircularArrow.h b/Sourcecode/private/mx/core/elements/CircularArrow.h index 20053634c..59a581262 100644 --- a/Sourcecode/private/mx/core/elements/CircularArrow.h +++ b/Sourcecode/private/mx/core/elements/CircularArrow.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( CircularArrow ) - - inline CircularArrowPtr makeCircularArrow() { return std::make_shared(); } - inline CircularArrowPtr makeCircularArrow( const CircularArrowEnum& value ) { return std::make_shared( value ); } - inline CircularArrowPtr makeCircularArrow( CircularArrowEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class CircularArrow : public ElementInterface - { - public: - CircularArrow(); - CircularArrow( const CircularArrowEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CircularArrowEnum getValue() const; - void setValue( const CircularArrowEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CircularArrowEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(CircularArrow) + +inline CircularArrowPtr makeCircularArrow() +{ + return std::make_shared(); +} + +inline CircularArrowPtr makeCircularArrow(const CircularArrowEnum &value) +{ + return std::make_shared(value); } + +inline CircularArrowPtr makeCircularArrow(CircularArrowEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class CircularArrow : public ElementInterface +{ + public: + CircularArrow(); + CircularArrow(const CircularArrowEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + CircularArrowEnum getValue() const; + void setValue(const CircularArrowEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + CircularArrowEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Clef.cpp b/Sourcecode/private/mx/core/elements/Clef.cpp index f234a191e..526eceb2b 100644 --- a/Sourcecode/private/mx/core/elements/Clef.cpp +++ b/Sourcecode/private/mx/core/elements/Clef.cpp @@ -11,167 +11,155 @@ namespace mx { - namespace core - { - Clef::Clef() - :myAttributes( std::make_shared() ) - ,mySign( makeSign() ) - ,myLine( makeLine() ) - ,myHasLine( false ) - ,myClefOctaveChange( makeClefOctaveChange() ) - ,myHasClefOctaveChange( false ) - {} - - - bool Clef::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Clef::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Clef::streamName( std::ostream& os ) const - { - os << "clef"; - return os; - } - - - bool Clef::hasContents() const - { - return true; - } - - - std::ostream& Clef::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - mySign->toStream( os, indentLevel+1 ); - if ( myHasLine ) - { - os << std::endl; - myLine->toStream( os, indentLevel+1 ); - } - if ( myHasClefOctaveChange ) - { - os << std::endl; - myClefOctaveChange->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - ClefAttributesPtr Clef::getAttributes() const - { - return myAttributes; - } - +namespace core +{ +Clef::Clef() + : myAttributes(std::make_shared()), mySign(makeSign()), myLine(makeLine()), myHasLine(false), + myClefOctaveChange(makeClefOctaveChange()), myHasClefOctaveChange(false) +{ +} - void Clef::setAttributes( const ClefAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool Clef::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Clef::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - SignPtr Clef::getSign() const - { - return mySign; - } +std::ostream &Clef::streamName(std::ostream &os) const +{ + os << "clef"; + return os; +} +bool Clef::hasContents() const +{ + return true; +} - void Clef::setSign( const SignPtr& value ) - { - if( value ) - { - mySign = value; - } - } +std::ostream &Clef::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + mySign->toStream(os, indentLevel + 1); + if (myHasLine) + { + os << std::endl; + myLine->toStream(os, indentLevel + 1); + } + if (myHasClefOctaveChange) + { + os << std::endl; + myClefOctaveChange->toStream(os, indentLevel + 1); + } + os << std::endl; + return os; +} +ClefAttributesPtr Clef::getAttributes() const +{ + return myAttributes; +} - LinePtr Clef::getLine() const - { - return myLine; - } +void Clef::setAttributes(const ClefAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +SignPtr Clef::getSign() const +{ + return mySign; +} - void Clef::setLine( const LinePtr& value ) - { - if( value ) - { - myLine = value; - } - } +void Clef::setSign(const SignPtr &value) +{ + if (value) + { + mySign = value; + } +} +LinePtr Clef::getLine() const +{ + return myLine; +} - bool Clef::getHasLine() const - { - return myHasLine; - } +void Clef::setLine(const LinePtr &value) +{ + if (value) + { + myLine = value; + } +} +bool Clef::getHasLine() const +{ + return myHasLine; +} - void Clef::setHasLine( const bool value ) - { - myHasLine = value; - } +void Clef::setHasLine(const bool value) +{ + myHasLine = value; +} +ClefOctaveChangePtr Clef::getClefOctaveChange() const +{ + return myClefOctaveChange; +} - ClefOctaveChangePtr Clef::getClefOctaveChange() const - { - return myClefOctaveChange; - } +void Clef::setClefOctaveChange(const ClefOctaveChangePtr &value) +{ + if (value) + { + myClefOctaveChange = value; + } +} +bool Clef::getHasClefOctaveChange() const +{ + return myHasClefOctaveChange; +} - void Clef::setClefOctaveChange( const ClefOctaveChangePtr& value ) - { - if( value ) - { - myClefOctaveChange = value; - } - } +void Clef::setHasClefOctaveChange(const bool value) +{ + myHasClefOctaveChange = value; +} +bool Clef::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isSignFound = false; - bool Clef::getHasClefOctaveChange() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *mySign, isSignFound)) { - return myHasClefOctaveChange; + continue; } - - - void Clef::setHasClefOctaveChange( const bool value ) + if (importElement(message, *it, isSuccess, *myLine, myHasLine)) { - myHasClefOctaveChange = value; + continue; } - - - bool Clef::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myClefOctaveChange, myHasClefOctaveChange)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isSignFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *mySign, isSignFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myLine, myHasLine ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myClefOctaveChange, myHasClefOctaveChange ) ) { continue; } - } - - if( !isSignFound ) - { - message << "Clef: '" << mySign->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isSignFound) + { + message << "Clef: '" << mySign->getElementName() << "' is required but was not found" << std::endl; } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Clef.h b/Sourcecode/private/mx/core/elements/Clef.h index 9181c5208..898947009 100644 --- a/Sourcecode/private/mx/core/elements/Clef.h +++ b/Sourcecode/private/mx/core/elements/Clef.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ClefAttributes.h" #include @@ -14,56 +14,59 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ClefAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ClefOctaveChange ) - MX_FORWARD_DECLARE_ELEMENT( Line ) - MX_FORWARD_DECLARE_ELEMENT( Sign ) - MX_FORWARD_DECLARE_ELEMENT( Clef ) +MX_FORWARD_DECLARE_ATTRIBUTES(ClefAttributes) +MX_FORWARD_DECLARE_ELEMENT(ClefOctaveChange) +MX_FORWARD_DECLARE_ELEMENT(Line) +MX_FORWARD_DECLARE_ELEMENT(Sign) +MX_FORWARD_DECLARE_ELEMENT(Clef) - inline ClefPtr makeClef() { return std::make_shared(); } +inline ClefPtr makeClef() +{ + return std::make_shared(); +} - class Clef : public ElementInterface - { - public: - Clef(); +class Clef : public ElementInterface +{ + public: + Clef(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ClefAttributesPtr getAttributes() const; - void setAttributes( const ClefAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ClefAttributesPtr getAttributes() const; + void setAttributes(const ClefAttributesPtr &value); - /* _________ Sign minOccurs = 1, maxOccurs = 1 _________ */ - SignPtr getSign() const; - void setSign( const SignPtr& value ); + /* _________ Sign minOccurs = 1, maxOccurs = 1 _________ */ + SignPtr getSign() const; + void setSign(const SignPtr &value); - /* _________ Line minOccurs = 0, maxOccurs = 1 _________ */ - LinePtr getLine() const; - void setLine( const LinePtr& value ); - bool getHasLine() const; - void setHasLine( const bool value ); + /* _________ Line minOccurs = 0, maxOccurs = 1 _________ */ + LinePtr getLine() const; + void setLine(const LinePtr &value); + bool getHasLine() const; + void setHasLine(const bool value); - /* _________ ClefOctaveChange minOccurs = 0, maxOccurs = 1 _________ */ - ClefOctaveChangePtr getClefOctaveChange() const; - void setClefOctaveChange( const ClefOctaveChangePtr& value ); - bool getHasClefOctaveChange() const; - void setHasClefOctaveChange( const bool value ); + /* _________ ClefOctaveChange minOccurs = 0, maxOccurs = 1 _________ */ + ClefOctaveChangePtr getClefOctaveChange() const; + void setClefOctaveChange(const ClefOctaveChangePtr &value); + bool getHasClefOctaveChange() const; + void setHasClefOctaveChange(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - ClefAttributesPtr myAttributes; - SignPtr mySign; - LinePtr myLine; - bool myHasLine; - ClefOctaveChangePtr myClefOctaveChange; - bool myHasClefOctaveChange; - }; - } -} + private: + ClefAttributesPtr myAttributes; + SignPtr mySign; + LinePtr myLine; + bool myHasLine; + ClefOctaveChangePtr myClefOctaveChange; + bool myHasClefOctaveChange; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ClefAttributes.cpp b/Sourcecode/private/mx/core/elements/ClefAttributes.cpp index d24008352..7cf6e9b1c 100644 --- a/Sourcecode/private/mx/core/elements/ClefAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ClefAttributes.cpp @@ -8,111 +8,118 @@ namespace mx { - namespace core +namespace core +{ +ClefAttributes::ClefAttributes() + : number(), additional(YesNo::no), size(), afterBarline(YesNo::no), defaultX(), defaultY(), relativeX(), + relativeY(), fontFamily(), fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), + fontWeight(FontWeight::normal), color(), printObject(YesNo::no), hasNumber(false), hasAdditional(false), + hasSize(false), hasAfterBarline(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasColor(false), hasPrintObject(false) +{ +} + +bool ClefAttributes::hasValues() const +{ + return hasNumber || hasAdditional || hasSize || hasAfterBarline || hasDefaultX || hasDefaultY || hasRelativeX || + hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasColor || hasPrintObject; +} + +std::ostream &ClefAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - ClefAttributes::ClefAttributes() - :number() - ,additional( YesNo::no ) - ,size() - ,afterBarline( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject( YesNo::no ) - ,hasNumber( false ) - ,hasAdditional( false ) - ,hasSize( false ) - ,hasAfterBarline( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, additional, "additional", hasAdditional); + streamAttribute(os, size, "size", hasSize); + streamAttribute(os, afterBarline, "after-barline", hasAfterBarline); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} +bool ClefAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ClefAttributes"; + bool isSuccess = true; - bool ClefAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasAdditional || - hasSize || - hasAfterBarline || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject; + continue; } - - - std::ostream& ClefAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, additional, hasAdditional, "additional", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, additional, "additional", hasAdditional ); - streamAttribute( os, size, "size", hasSize ); - streamAttribute( os, afterBarline, "after-barline", hasAfterBarline ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; + continue; } - - - bool ClefAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize)) { - const char* const className = "ClefAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, additional, hasAdditional, "additional", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, afterBarline, hasAfterBarline, "after-barline", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, afterBarline, hasAfterBarline, "after-barline", + &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ClefAttributes.h b/Sourcecode/private/mx/core/elements/ClefAttributes.h index 6f96f9e50..6e6adc82e 100644 --- a/Sourcecode/private/mx/core/elements/ClefAttributes.h +++ b/Sourcecode/private/mx/core/elements/ClefAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -19,48 +19,48 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ClefAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(ClefAttributes) - struct ClefAttributes : public AttributesInterface - { - public: - ClefAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - YesNo additional; - SymbolSize size; - YesNo afterBarline; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - bool hasNumber; - bool hasAdditional; - bool hasSize; - bool hasAfterBarline; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; +struct ClefAttributes : public AttributesInterface +{ + public: + ClefAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StaffNumber number; + YesNo additional; + SymbolSize size; + YesNo afterBarline; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + YesNo printObject; + bool hasNumber; + bool hasAdditional; + bool hasSize; + bool hasAfterBarline; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp b/Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp index 42cff2ed3..2b2cfdd1f 100644 --- a/Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp +++ b/Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - ClefOctaveChange::ClefOctaveChange() - :myValue() - {} - - - ClefOctaveChange::ClefOctaveChange( const Integer& value ) - :myValue( value ) - {} - - - bool ClefOctaveChange::hasAttributes() const - { - return false; - } - - - bool ClefOctaveChange::hasContents() const - { - return true; - } - - - std::ostream& ClefOctaveChange::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ClefOctaveChange::streamName( std::ostream& os ) const - { - os << "clef-octave-change"; - return os; - } +namespace core +{ +ClefOctaveChange::ClefOctaveChange() : myValue() +{ +} +ClefOctaveChange::ClefOctaveChange(const Integer &value) : myValue(value) +{ +} - std::ostream& ClefOctaveChange::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool ClefOctaveChange::hasAttributes() const +{ + return false; +} +bool ClefOctaveChange::hasContents() const +{ + return true; +} - Integer ClefOctaveChange::getValue() const - { - return myValue; - } +std::ostream &ClefOctaveChange::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &ClefOctaveChange::streamName(std::ostream &os) const +{ + os << "clef-octave-change"; + return os; +} - void ClefOctaveChange::setValue( const Integer& value ) - { - myValue = value; - } +std::ostream &ClefOctaveChange::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Integer ClefOctaveChange::getValue() const +{ + return myValue; +} - bool ClefOctaveChange::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void ClefOctaveChange::setValue(const Integer &value) +{ + myValue = value; +} - } +bool ClefOctaveChange::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ClefOctaveChange.h b/Sourcecode/private/mx/core/elements/ClefOctaveChange.h index 09066bca6..62bfac92b 100644 --- a/Sourcecode/private/mx/core/elements/ClefOctaveChange.h +++ b/Sourcecode/private/mx/core/elements/ClefOctaveChange.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ClefOctaveChange ) - - inline ClefOctaveChangePtr makeClefOctaveChange() { return std::make_shared(); } - inline ClefOctaveChangePtr makeClefOctaveChange( const Integer& value ) { return std::make_shared( value ); } - inline ClefOctaveChangePtr makeClefOctaveChange( Integer&& value ) { return std::make_shared( std::move( value ) ); } - - class ClefOctaveChange : public ElementInterface - { - public: - ClefOctaveChange(); - ClefOctaveChange( const Integer& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Integer getValue() const; - void setValue( const Integer& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Integer myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(ClefOctaveChange) + +inline ClefOctaveChangePtr makeClefOctaveChange() +{ + return std::make_shared(); +} + +inline ClefOctaveChangePtr makeClefOctaveChange(const Integer &value) +{ + return std::make_shared(value); } + +inline ClefOctaveChangePtr makeClefOctaveChange(Integer &&value) +{ + return std::make_shared(std::move(value)); +} + +class ClefOctaveChange : public ElementInterface +{ + public: + ClefOctaveChange(); + ClefOctaveChange(const Integer &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Integer getValue() const; + void setValue(const Integer &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Integer myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Coda.cpp b/Sourcecode/private/mx/core/elements/Coda.cpp index d38f2bb7b..17ff6d675 100644 --- a/Sourcecode/private/mx/core/elements/Coda.cpp +++ b/Sourcecode/private/mx/core/elements/Coda.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Coda::Coda() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Coda::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Coda::hasContents() const { return false; } - std::ostream& Coda::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Coda::streamName( std::ostream& os ) const { os << "coda"; return os; } - std::ostream& Coda::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Coda::Coda() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Coda::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPrintObjectStyleAlignAttributesPtr Coda::getAttributes() const - { - return myAttributes; - } +bool Coda::hasContents() const +{ + return false; +} +std::ostream &Coda::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Coda::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Coda::streamName(std::ostream &os) const +{ + os << "coda"; + return os; +} +std::ostream &Coda::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Coda::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPrintObjectStyleAlignAttributesPtr Coda::getAttributes() const +{ + return myAttributes; +} +void Coda::setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Coda::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Coda.h b/Sourcecode/private/mx/core/elements/Coda.h index 06802c601..bec81c935 100644 --- a/Sourcecode/private/mx/core/elements/Coda.h +++ b/Sourcecode/private/mx/core/elements/Coda.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,31 +14,34 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Coda ) - - inline CodaPtr makeCoda() { return std::make_shared(); } - - class Coda : public ElementInterface - { - public: - Coda(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); +namespace core +{ - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); +MX_FORWARD_DECLARE_ELEMENT(Coda) - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } +inline CodaPtr makeCoda() +{ + return std::make_shared(); } + +class Coda : public ElementInterface +{ + public: + Coda(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; + void setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPrintObjectStyleAlignAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Creator.cpp b/Sourcecode/private/mx/core/elements/Creator.cpp index ab7b98bdf..498dbbc35 100644 --- a/Sourcecode/private/mx/core/elements/Creator.cpp +++ b/Sourcecode/private/mx/core/elements/Creator.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Creator::Creator() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Creator::Creator( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Creator::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Creator::hasContents() const - { - return true; - } - - - std::ostream& Creator::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Creator::streamName( std::ostream& os ) const - { - os << "creator"; - return os; - } - - - std::ostream& Creator::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Creator::Creator() : myValue(), myAttributes(std::make_shared()) +{ +} +Creator::Creator(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - CreatorAttributesPtr Creator::getAttributes() const - { - return myAttributes; - } +bool Creator::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Creator::hasContents() const +{ + return true; +} - void Creator::setAttributes( const CreatorAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Creator::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Creator::streamName(std::ostream &os) const +{ + os << "creator"; + return os; +} - XsString Creator::getValue() const - { - return myValue; - } +std::ostream &Creator::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +CreatorAttributesPtr Creator::getAttributes() const +{ + return myAttributes; +} - void Creator::setValue( const XsString& value ) - { - myValue = value; - } +void Creator::setAttributes(const CreatorAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Creator::getValue() const +{ + return myValue; +} - bool Creator::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } +void Creator::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Creator::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Creator.h b/Sourcecode/private/mx/core/elements/Creator.h index c316927f2..667b0caa9 100644 --- a/Sourcecode/private/mx/core/elements/Creator.h +++ b/Sourcecode/private/mx/core/elements/Creator.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/CreatorAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreatorAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Creator ) - - inline CreatorPtr makeCreator() { return std::make_shared(); } - inline CreatorPtr makeCreator( const XsString& value ) { return std::make_shared( value ); } - inline CreatorPtr makeCreator( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Creator : public ElementInterface - { - public: - Creator(); - Creator( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CreatorAttributesPtr getAttributes() const; - void setAttributes( const CreatorAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - CreatorAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(CreatorAttributes) +MX_FORWARD_DECLARE_ELEMENT(Creator) + +inline CreatorPtr makeCreator() +{ + return std::make_shared(); +} + +inline CreatorPtr makeCreator(const XsString &value) +{ + return std::make_shared(value); } + +inline CreatorPtr makeCreator(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Creator : public ElementInterface +{ + public: + Creator(); + Creator(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + CreatorAttributesPtr getAttributes() const; + void setAttributes(const CreatorAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + CreatorAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreatorAttributes.cpp b/Sourcecode/private/mx/core/elements/CreatorAttributes.cpp index 197a1fcff..5b3d10ea6 100644 --- a/Sourcecode/private/mx/core/elements/CreatorAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/CreatorAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - CreatorAttributes::CreatorAttributes() - :type() - ,hasType( false ) - {} - +namespace core +{ +CreatorAttributes::CreatorAttributes() : type(), hasType(false) +{ +} - bool CreatorAttributes::hasValues() const - { - return hasType; - } +bool CreatorAttributes::hasValues() const +{ + return hasType; +} +std::ostream &CreatorAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& CreatorAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool CreatorAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "CreatorAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool CreatorAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type")) { - const char* const className = "CreatorAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreatorAttributes.h b/Sourcecode/private/mx/core/elements/CreatorAttributes.h index 73c948dbe..05f4b472b 100644 --- a/Sourcecode/private/mx/core/elements/CreatorAttributes.h +++ b/Sourcecode/private/mx/core/elements/CreatorAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( CreatorAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(CreatorAttributes) - struct CreatorAttributes : public AttributesInterface - { - public: - CreatorAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; +struct CreatorAttributes : public AttributesInterface +{ + public: + CreatorAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken type; + bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Credit.cpp b/Sourcecode/private/mx/core/elements/Credit.cpp index aa3d20067..687c43469 100644 --- a/Sourcecode/private/mx/core/elements/Credit.cpp +++ b/Sourcecode/private/mx/core/elements/Credit.cpp @@ -15,326 +15,302 @@ namespace mx { - namespace core - { - Credit::Credit() - :myAttributes( std::make_shared() ) - ,myCreditTypeSet() - ,myLinkSet() - ,myBookmarkSet() - ,myCreditChoice( makeCreditChoice() ) - {} - - - bool Credit::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Credit::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Credit::streamName( std::ostream& os ) const - { - os << "credit"; - return os; - } - - - bool Credit::hasContents() const - { - return true; - } - - - std::ostream& Credit::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for( auto x : myCreditTypeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for( auto x : myLinkSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for( auto x : myBookmarkSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - myCreditChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - return os; - } - - - CreditAttributesPtr Credit::getAttributes() const - { - return myAttributes; - } +namespace core +{ +Credit::Credit() + : myAttributes(std::make_shared()), myCreditTypeSet(), myLinkSet(), myBookmarkSet(), + myCreditChoice(makeCreditChoice()) +{ +} +bool Credit::hasAttributes() const +{ + return myAttributes->hasValues(); +} - void Credit::setAttributes( const CreditAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Credit::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Credit::streamName(std::ostream &os) const +{ + os << "credit"; + return os; +} - const CreditTypeSet& Credit::getCreditTypeSet() const - { - return myCreditTypeSet; - } +bool Credit::hasContents() const +{ + return true; +} +std::ostream &Credit::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto x : myCreditTypeSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myLinkSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myBookmarkSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + os << std::endl; + myCreditChoice->streamContents(os, indentLevel + 1, isOneLineOnly); + os << std::endl; + isOneLineOnly = false; + return os; +} - void Credit::removeCreditType( const CreditTypeSetIterConst& value ) - { - if ( value != myCreditTypeSet.cend() ) - { - myCreditTypeSet.erase( value ); - } - } +CreditAttributesPtr Credit::getAttributes() const +{ + return myAttributes; +} +void Credit::setAttributes(const CreditAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - void Credit::addCreditType( const CreditTypePtr& value ) - { - if ( value ) - { - myCreditTypeSet.push_back( value ); - } - } +const CreditTypeSet &Credit::getCreditTypeSet() const +{ + return myCreditTypeSet; +} +void Credit::removeCreditType(const CreditTypeSetIterConst &value) +{ + if (value != myCreditTypeSet.cend()) + { + myCreditTypeSet.erase(value); + } +} - void Credit::clearCreditTypeSet() - { - myCreditTypeSet.clear(); - } +void Credit::addCreditType(const CreditTypePtr &value) +{ + if (value) + { + myCreditTypeSet.push_back(value); + } +} +void Credit::clearCreditTypeSet() +{ + myCreditTypeSet.clear(); +} - CreditTypePtr Credit::getCreditType( const CreditTypeSetIterConst& setIterator ) const - { - if( setIterator != myCreditTypeSet.cend() ) - { - return *setIterator; - } - return CreditTypePtr(); - } +CreditTypePtr Credit::getCreditType(const CreditTypeSetIterConst &setIterator) const +{ + if (setIterator != myCreditTypeSet.cend()) + { + return *setIterator; + } + return CreditTypePtr(); +} +const LinkSet &Credit::getLinkSet() const +{ + return myLinkSet; +} - const LinkSet& Credit::getLinkSet() const - { - return myLinkSet; - } +void Credit::removeLink(const LinkSetIterConst &value) +{ + if (value != myLinkSet.cend()) + { + myLinkSet.erase(value); + } +} +void Credit::addLink(const LinkPtr &value) +{ + if (value) + { + myLinkSet.push_back(value); + } +} - void Credit::removeLink( const LinkSetIterConst& value ) - { - if ( value != myLinkSet.cend() ) - { - myLinkSet.erase( value ); - } - } +void Credit::clearLinkSet() +{ + myLinkSet.clear(); +} +LinkPtr Credit::getLink(const LinkSetIterConst &setIterator) const +{ + if (setIterator != myLinkSet.cend()) + { + return *setIterator; + } + return LinkPtr(); +} - void Credit::addLink( const LinkPtr& value ) - { - if ( value ) - { - myLinkSet.push_back( value ); - } - } +const BookmarkSet &Credit::getBookmarkSet() const +{ + return myBookmarkSet; +} +void Credit::removeBookmark(const BookmarkSetIterConst &value) +{ + if (value != myBookmarkSet.cend()) + { + myBookmarkSet.erase(value); + } +} - void Credit::clearLinkSet() - { - myLinkSet.clear(); - } +void Credit::addBookmark(const BookmarkPtr &value) +{ + if (value) + { + myBookmarkSet.push_back(value); + } +} +void Credit::clearBookmarkSet() +{ + myBookmarkSet.clear(); +} - LinkPtr Credit::getLink( const LinkSetIterConst& setIterator ) const - { - if( setIterator != myLinkSet.cend() ) - { - return *setIterator; - } - return LinkPtr(); - } +BookmarkPtr Credit::getBookmark(const BookmarkSetIterConst &setIterator) const +{ + if (setIterator != myBookmarkSet.cend()) + { + return *setIterator; + } + return BookmarkPtr(); +} +CreditChoicePtr Credit::getCreditChoice() const +{ + return myCreditChoice; +} - const BookmarkSet& Credit::getBookmarkSet() const - { - return myBookmarkSet; - } +void Credit::setCreditChoice(const CreditChoicePtr &value) +{ + if (value) + { + myCreditChoice = value; + } +} +#ifndef MX_CREDIT_RETURN_IF_END +#define MX_CREDIT_RETURN_IF_END \ + if (i == endIter) \ + { \ + if (!isCreditImageOrCreditWordsFound) \ + { \ + message << "Credit: neither 'credit-words' nor 'credit-image' was present - one of these is required" \ + << std::endl; \ + isSuccess = false; \ + } \ + return isSuccess; \ + } +#endif - void Credit::removeBookmark( const BookmarkSetIterConst& value ) - { - if ( value != myBookmarkSet.cend() ) - { - myBookmarkSet.erase( value ); - } - } +bool Credit::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isCreditImageOrCreditWordsFound = false; + ::ezxml::XElementIterator i = xelement.begin(); + ::ezxml::XElementIterator endIter = xelement.end(); + MX_CREDIT_RETURN_IF_END; - void Credit::addBookmark( const BookmarkPtr& value ) + if (i->getName() == "credit-type") + { + while (i != endIter && i->getName() == "credit-type") { - if ( value ) - { - myBookmarkSet.push_back( value ); - } + auto item = makeCreditType(); + isSuccess &= item->fromXElement(message, *i); + addCreditType(item); + ++i; } + } + MX_CREDIT_RETURN_IF_END; - - void Credit::clearBookmarkSet() + if (i->getName() == "link") + { + while (i != endIter && i->getName() == "link") { - myBookmarkSet.clear(); + auto item = makeLink(); + isSuccess &= item->fromXElement(message, *i); + addLink(item); + ++i; } + } + MX_CREDIT_RETURN_IF_END; - - BookmarkPtr Credit::getBookmark( const BookmarkSetIterConst& setIterator ) const + if (i->getName() == "bookmark") + { + while (i != endIter && i->getName() == "bookmark") { - if( setIterator != myBookmarkSet.cend() ) - { - return *setIterator; - } - return BookmarkPtr(); + auto item = makeBookmark(); + isSuccess &= item->fromXElement(message, *i); + addBookmark(item); + ++i; } + } + MX_CREDIT_RETURN_IF_END; - - CreditChoicePtr Credit::getCreditChoice() const + if (i->getName() == "credit-image" || i->getName() == "credit-words") + { + isCreditImageOrCreditWordsFound = true; + if (i->getName() == "credit-image") { - return myCreditChoice; + myCreditChoice->setChoice(CreditChoice::Choice::creditImage); + isSuccess &= myCreditChoice->getCreditImage()->fromXElement(message, *i); + MX_RETURN_IS_SUCCESS; } - - void Credit::setCreditChoice( const CreditChoicePtr& value ) + if (i->getName() == "credit-words") { - if( value ) - { - myCreditChoice = value; - } - } - -#ifndef MX_CREDIT_RETURN_IF_END -#define MX_CREDIT_RETURN_IF_END \ - if( i == endIter ) \ - { \ - if( !isCreditImageOrCreditWordsFound ) \ - { \ - message << "Credit: neither 'credit-words' nor 'credit-image' was present - one of these is required" << std::endl; \ - isSuccess = false; \ - } \ - return isSuccess; \ - } -#endif - - bool Credit::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isCreditImageOrCreditWordsFound = false; - - ::ezxml::XElementIterator i = xelement.begin(); - ::ezxml::XElementIterator endIter = xelement.end(); - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "credit-type" ) - { - while( i != endIter && i->getName() == "credit-type" ) - { - auto item = makeCreditType(); - isSuccess &= item->fromXElement( message, *i ); - addCreditType( item ); - ++i; - } - } + myCreditChoice->setChoice(CreditChoice::Choice::creditWords); + isSuccess &= myCreditChoice->getCreditWords()->fromXElement(message, *i); + ++i; MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "link" ) + + auto creditWordsGroup = makeCreditWordsGroup(); + while (i != endIter && + ((i->getName() == "link") || (i->getName() == "bookmark") || (i->getName() == "credit-words"))) { - while( i != endIter && i->getName() == "link" ) + while (i != endIter && i->getName() == "link") { - auto item = makeLink(); - isSuccess &= item->fromXElement( message, *i ); - addLink( item ); + auto link = makeLink(); + isSuccess &= link->fromXElement(message, xelement); + creditWordsGroup->addLink(link); ++i; } - } - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "bookmark" ) - { - while( i != endIter && i->getName() == "bookmark" ) + MX_CREDIT_RETURN_IF_END; + + while (i != endIter && i->getName() == "bookmark") { - auto item = makeBookmark(); - isSuccess &= item->fromXElement( message, *i ); - addBookmark( item ); + auto bookmark = makeBookmark(); + isSuccess &= bookmark->fromXElement(message, xelement); + creditWordsGroup->addBookmark(bookmark); ++i; } - } - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "credit-image" || i->getName() == "credit-words" ) - { - isCreditImageOrCreditWordsFound = true; - if( i->getName() == "credit-image" ) - { - myCreditChoice->setChoice( CreditChoice::Choice::creditImage ); - isSuccess &= myCreditChoice->getCreditImage()->fromXElement( message, *i ); - MX_RETURN_IS_SUCCESS; - } - - if( i->getName() == "credit-words" ) + MX_CREDIT_RETURN_IF_END; + + if (i->getName() == "credit-words") { - myCreditChoice->setChoice( CreditChoice::Choice::creditWords ); - isSuccess &= myCreditChoice->getCreditWords()->fromXElement( message, *i ); + isSuccess &= creditWordsGroup->getCreditWords()->fromXElement(message, *i); + myCreditChoice->addCreditWordsGroup(creditWordsGroup); + creditWordsGroup = makeCreditWordsGroup(); ++i; - MX_CREDIT_RETURN_IF_END; - - auto creditWordsGroup = makeCreditWordsGroup(); - while( i != endIter && ((i->getName() == "link")||(i->getName() == "bookmark")||(i->getName() == "credit-words" ))) - { - while( i != endIter && i->getName() == "link" ) - { - auto link = makeLink(); - isSuccess &= link->fromXElement( message, xelement ); - creditWordsGroup->addLink( link ); - ++i; - } - MX_CREDIT_RETURN_IF_END; - - while( i != endIter && i->getName() == "bookmark" ) - { - auto bookmark = makeBookmark(); - isSuccess &= bookmark->fromXElement( message, xelement ); - creditWordsGroup->addBookmark( bookmark ); - ++i; - } - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "credit-words" ) - { - isSuccess &= creditWordsGroup->getCreditWords()->fromXElement( message, *i ); - myCreditChoice->addCreditWordsGroup( creditWordsGroup ); - creditWordsGroup = makeCreditWordsGroup(); - ++i; - } - MX_CREDIT_RETURN_IF_END; - } } + MX_CREDIT_RETURN_IF_END; } - MX_RETURN_IS_SUCCESS; } - } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Credit.h b/Sourcecode/private/mx/core/elements/Credit.h index 379b17a1d..4dd6e3e8e 100644 --- a/Sourcecode/private/mx/core/elements/Credit.h +++ b/Sourcecode/private/mx/core/elements/Credit.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/CreditAttributes.h" #include @@ -14,71 +14,73 @@ namespace ezxml { - class XElementIterator; +class XElementIterator; } namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Bookmark ) - MX_FORWARD_DECLARE_ELEMENT( CreditChoice ) - MX_FORWARD_DECLARE_ELEMENT( CreditType ) - MX_FORWARD_DECLARE_ELEMENT( Link ) - MX_FORWARD_DECLARE_ELEMENT( Credit ) - - inline CreditPtr makeCredit() { return std::make_shared(); } - - class Credit : public ElementInterface - { - public: - Credit(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CreditAttributesPtr getAttributes() const; - void setAttributes( const CreditAttributesPtr& value ); - - /* _________ CreditType minOccurs = 0, maxOccurs = unbounded _________ */ - const CreditTypeSet& getCreditTypeSet() const; - void addCreditType( const CreditTypePtr& value ); - void removeCreditType( const CreditTypeSetIterConst& value ); - void clearCreditTypeSet(); - CreditTypePtr getCreditType( const CreditTypeSetIterConst& setIterator ) const; - - /* _________ Link minOccurs = 0, maxOccurs = unbounded _________ */ - const LinkSet& getLinkSet() const; - void addLink( const LinkPtr& value ); - void removeLink( const LinkSetIterConst& value ); - void clearLinkSet(); - LinkPtr getLink( const LinkSetIterConst& setIterator ) const; - - /* _________ Bookmark minOccurs = 0, maxOccurs = unbounded _________ */ - const BookmarkSet& getBookmarkSet() const; - void addBookmark( const BookmarkPtr& value ); - void removeBookmark( const BookmarkSetIterConst& value ); - void clearBookmarkSet(); - BookmarkPtr getBookmark( const BookmarkSetIterConst& setIterator ) const; - - /* _________ CreditChoice minOccurs = 1, maxOccurs = 1 _________ */ - CreditChoicePtr getCreditChoice() const; - void setCreditChoice( const CreditChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); +namespace core +{ - private: - CreditAttributesPtr myAttributes; - CreditTypeSet myCreditTypeSet; - LinkSet myLinkSet; - BookmarkSet myBookmarkSet; - CreditChoicePtr myCreditChoice; +MX_FORWARD_DECLARE_ATTRIBUTES(CreditAttributes) +MX_FORWARD_DECLARE_ELEMENT(Bookmark) +MX_FORWARD_DECLARE_ELEMENT(CreditChoice) +MX_FORWARD_DECLARE_ELEMENT(CreditType) +MX_FORWARD_DECLARE_ELEMENT(Link) +MX_FORWARD_DECLARE_ELEMENT(Credit) - }; - } +inline CreditPtr makeCredit() +{ + return std::make_shared(); } + +class Credit : public ElementInterface +{ + public: + Credit(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + CreditAttributesPtr getAttributes() const; + void setAttributes(const CreditAttributesPtr &value); + + /* _________ CreditType minOccurs = 0, maxOccurs = unbounded _________ */ + const CreditTypeSet &getCreditTypeSet() const; + void addCreditType(const CreditTypePtr &value); + void removeCreditType(const CreditTypeSetIterConst &value); + void clearCreditTypeSet(); + CreditTypePtr getCreditType(const CreditTypeSetIterConst &setIterator) const; + + /* _________ Link minOccurs = 0, maxOccurs = unbounded _________ */ + const LinkSet &getLinkSet() const; + void addLink(const LinkPtr &value); + void removeLink(const LinkSetIterConst &value); + void clearLinkSet(); + LinkPtr getLink(const LinkSetIterConst &setIterator) const; + + /* _________ Bookmark minOccurs = 0, maxOccurs = unbounded _________ */ + const BookmarkSet &getBookmarkSet() const; + void addBookmark(const BookmarkPtr &value); + void removeBookmark(const BookmarkSetIterConst &value); + void clearBookmarkSet(); + BookmarkPtr getBookmark(const BookmarkSetIterConst &setIterator) const; + + /* _________ CreditChoice minOccurs = 1, maxOccurs = 1 _________ */ + CreditChoicePtr getCreditChoice() const; + void setCreditChoice(const CreditChoicePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + CreditAttributesPtr myAttributes; + CreditTypeSet myCreditTypeSet; + LinkSet myLinkSet; + BookmarkSet myBookmarkSet; + CreditChoicePtr myCreditChoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditAttributes.cpp b/Sourcecode/private/mx/core/elements/CreditAttributes.cpp index 71638829e..771b0cc68 100644 --- a/Sourcecode/private/mx/core/elements/CreditAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/CreditAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - CreditAttributes::CreditAttributes() - :page() - ,hasPage( false ) - {} - +namespace core +{ +CreditAttributes::CreditAttributes() : page(), hasPage(false) +{ +} - bool CreditAttributes::hasValues() const - { - return hasPage; - } +bool CreditAttributes::hasValues() const +{ + return hasPage; +} +std::ostream &CreditAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, page, "page", hasPage); + } + return os; +} - std::ostream& CreditAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, page, "page", hasPage ); - } - return os; - } +bool CreditAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "CreditAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool CreditAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, page, hasPage, "page")) { - const char* const className = "CreditAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, page, hasPage, "page" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditAttributes.h b/Sourcecode/private/mx/core/elements/CreditAttributes.h index ef4241e71..2762bbf83 100644 --- a/Sourcecode/private/mx/core/elements/CreditAttributes.h +++ b/Sourcecode/private/mx/core/elements/CreditAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( CreditAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(CreditAttributes) - struct CreditAttributes : public AttributesInterface - { - public: - CreditAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - PositiveInteger page; - bool hasPage; +struct CreditAttributes : public AttributesInterface +{ + public: + CreditAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + PositiveInteger page; + bool hasPage; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditChoice.cpp b/Sourcecode/private/mx/core/elements/CreditChoice.cpp index f477a661e..f374d7795 100644 --- a/Sourcecode/private/mx/core/elements/CreditChoice.cpp +++ b/Sourcecode/private/mx/core/elements/CreditChoice.cpp @@ -4,163 +4,144 @@ #include "mx/core/elements/CreditChoice.h" #include "mx/core/FromXElement.h" +#include "mx/core/elements/Bookmark.h" #include "mx/core/elements/CreditImage.h" #include "mx/core/elements/CreditWords.h" -#include "mx/core/elements/Bookmark.h" -#include "mx/core/elements/Link.h" #include "mx/core/elements/CreditWordsGroup.h" +#include "mx/core/elements/Link.h" #include namespace mx { - namespace core - { - CreditChoice::CreditChoice() - :myChoice( Choice::creditWords ) - ,myCreditImage( makeCreditImage() ) - ,myCreditWords( makeCreditWords() ) - ,myCreditWordsGroupSet() - {} - - - bool CreditChoice::hasAttributes() const - { - return false; - } - - - std::ostream& CreditChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CreditChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool CreditChoice::hasContents() const - { - return true; - } - - - std::ostream& CreditChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::creditImage: - myCreditImage->toStream( os, indentLevel ); - break; - case Choice::creditWords: - { - myCreditWords->toStream( os, indentLevel ); - - if ( myCreditWordsGroupSet.size() > 0 ) - { - os << std::endl; - } - - for( auto x : myCreditWordsGroupSet ) - { - x->streamContents( os, indentLevel, isOneLineOnly ); - } - - break; - } - default: - break; - } - isOneLineOnly = false; - return os; - } - - - CreditChoice::Choice CreditChoice::getChoice() const - { - return myChoice; - } - - - void CreditChoice::setChoice( const CreditChoice::Choice value ) - { - myChoice = value; - } +namespace core +{ +CreditChoice::CreditChoice() + : myChoice(Choice::creditWords), myCreditImage(makeCreditImage()), myCreditWords(makeCreditWords()), + myCreditWordsGroupSet() +{ +} +bool CreditChoice::hasAttributes() const +{ + return false; +} - CreditImagePtr CreditChoice::getCreditImage() const - { - return myCreditImage; - } +std::ostream &CreditChoice::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &CreditChoice::streamName(std::ostream &os) const +{ + return os; +} - void CreditChoice::setCreditImage( const CreditImagePtr& value ) - { - if ( value ) - { - myCreditImage = value; - } - } +bool CreditChoice::hasContents() const +{ + return true; +} +std::ostream &CreditChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::creditImage: + myCreditImage->toStream(os, indentLevel); + break; + case Choice::creditWords: { + myCreditWords->toStream(os, indentLevel); - CreditWordsPtr CreditChoice::getCreditWords() const + if (myCreditWordsGroupSet.size() > 0) { - return myCreditWords; + os << std::endl; } - - void CreditChoice::setCreditWords( const CreditWordsPtr& value ) + for (auto x : myCreditWordsGroupSet) { - if ( value ) - { - myCreditWords = value; - } + x->streamContents(os, indentLevel, isOneLineOnly); } + break; + } + default: + break; + } + isOneLineOnly = false; + return os; +} - const CreditWordsGroupSet& CreditChoice::getCreditWordsGroupSet() const - { - return myCreditWordsGroupSet; - } - +CreditChoice::Choice CreditChoice::getChoice() const +{ + return myChoice; +} - void CreditChoice::removeCreditWordsGroup( const CreditWordsGroupSetIterConst& value ) - { - if ( value != myCreditWordsGroupSet.cend() ) - { - myCreditWordsGroupSet.erase( value ); - } - } +void CreditChoice::setChoice(const CreditChoice::Choice value) +{ + myChoice = value; +} +CreditImagePtr CreditChoice::getCreditImage() const +{ + return myCreditImage; +} - void CreditChoice::addCreditWordsGroup( const CreditWordsGroupPtr& value ) - { - if ( value ) - { - myCreditWordsGroupSet.push_back( value ); - } - } +void CreditChoice::setCreditImage(const CreditImagePtr &value) +{ + if (value) + { + myCreditImage = value; + } +} +CreditWordsPtr CreditChoice::getCreditWords() const +{ + return myCreditWords; +} - void CreditChoice::clearCreditWordsGroupSet() - { - myCreditWordsGroupSet.clear(); - } +void CreditChoice::setCreditWords(const CreditWordsPtr &value) +{ + if (value) + { + myCreditWords = value; + } +} +const CreditWordsGroupSet &CreditChoice::getCreditWordsGroupSet() const +{ + return myCreditWordsGroupSet; +} - CreditWordsGroupPtr CreditChoice::getCreditWordsGroup( const CreditWordsGroupSetIterConst& setIterator ) const - { - if( setIterator != myCreditWordsGroupSet.cend() ) - { - return *setIterator; - } - return CreditWordsGroupPtr(); - } +void CreditChoice::removeCreditWordsGroup(const CreditWordsGroupSetIterConst &value) +{ + if (value != myCreditWordsGroupSet.cend()) + { + myCreditWordsGroupSet.erase(value); + } +} +void CreditChoice::addCreditWordsGroup(const CreditWordsGroupPtr &value) +{ + if (value) + { + myCreditWordsGroupSet.push_back(value); + } +} - MX_FROM_XELEMENT_UNUSED( CreditChoice ); +void CreditChoice::clearCreditWordsGroupSet() +{ + myCreditWordsGroupSet.clear(); +} +CreditWordsGroupPtr CreditChoice::getCreditWordsGroup(const CreditWordsGroupSetIterConst &setIterator) const +{ + if (setIterator != myCreditWordsGroupSet.cend()) + { + return *setIterator; } + return CreditWordsGroupPtr(); } + +MX_FROM_XELEMENT_UNUSED(CreditChoice); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditChoice.h b/Sourcecode/private/mx/core/elements/CreditChoice.h index a49cebc27..20bd127cc 100644 --- a/Sourcecode/private/mx/core/elements/CreditChoice.h +++ b/Sourcecode/private/mx/core/elements/CreditChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,59 +13,62 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( CreditImage ) - MX_FORWARD_DECLARE_ELEMENT( CreditWordsGroup ) - MX_FORWARD_DECLARE_ELEMENT( CreditWords ) - MX_FORWARD_DECLARE_ELEMENT( CreditChoice ) +MX_FORWARD_DECLARE_ELEMENT(CreditImage) +MX_FORWARD_DECLARE_ELEMENT(CreditWordsGroup) +MX_FORWARD_DECLARE_ELEMENT(CreditWords) +MX_FORWARD_DECLARE_ELEMENT(CreditChoice) - inline CreditChoicePtr makeCreditChoice() { return std::make_shared(); } +inline CreditChoicePtr makeCreditChoice() +{ + return std::make_shared(); +} - class CreditChoice : public ElementInterface - { - public: - enum class Choice - { - creditImage = 1, - creditWords = 2 - }; - CreditChoice(); +class CreditChoice : public ElementInterface +{ + public: + enum class Choice + { + creditImage = 1, + creditWords = 2 + }; + CreditChoice(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - CreditChoice::Choice getChoice() const; - void setChoice( const CreditChoice::Choice value ); + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + CreditChoice::Choice getChoice() const; + void setChoice(const CreditChoice::Choice value); - /* _________ CreditImage minOccurs = 1, maxOccurs = 1 _________ */ - CreditImagePtr getCreditImage() const; - void setCreditImage( const CreditImagePtr& value ); + /* _________ CreditImage minOccurs = 1, maxOccurs = 1 _________ */ + CreditImagePtr getCreditImage() const; + void setCreditImage(const CreditImagePtr &value); - /* _________ CreditWords minOccurs = 1, maxOccurs = 1 _________ */ - CreditWordsPtr getCreditWords() const; - void setCreditWords( const CreditWordsPtr& value ); + /* _________ CreditWords minOccurs = 1, maxOccurs = 1 _________ */ + CreditWordsPtr getCreditWords() const; + void setCreditWords(const CreditWordsPtr &value); - /* _________ CreditWordsGroup minOccurs = 0, maxOccurs = unbounded _________ */ - const CreditWordsGroupSet& getCreditWordsGroupSet() const; - void addCreditWordsGroup( const CreditWordsGroupPtr& value ); - void removeCreditWordsGroup( const CreditWordsGroupSetIterConst& value ); - void clearCreditWordsGroupSet(); - CreditWordsGroupPtr getCreditWordsGroup( const CreditWordsGroupSetIterConst& setIterator ) const; + /* _________ CreditWordsGroup minOccurs = 0, maxOccurs = unbounded _________ */ + const CreditWordsGroupSet &getCreditWordsGroupSet() const; + void addCreditWordsGroup(const CreditWordsGroupPtr &value); + void removeCreditWordsGroup(const CreditWordsGroupSetIterConst &value); + void clearCreditWordsGroupSet(); + CreditWordsGroupPtr getCreditWordsGroup(const CreditWordsGroupSetIterConst &setIterator) const; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - Choice myChoice; - CreditImagePtr myCreditImage; - CreditWordsPtr myCreditWords; - CreditWordsGroupSet myCreditWordsGroupSet; - }; - } -} + private: + Choice myChoice; + CreditImagePtr myCreditImage; + CreditWordsPtr myCreditWords; + CreditWordsGroupSet myCreditWordsGroupSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditImage.cpp b/Sourcecode/private/mx/core/elements/CreditImage.cpp index f494a6447..1c8c0ee82 100644 --- a/Sourcecode/private/mx/core/elements/CreditImage.cpp +++ b/Sourcecode/private/mx/core/elements/CreditImage.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - CreditImage::CreditImage() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool CreditImage::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool CreditImage::hasContents() const { return false; } - std::ostream& CreditImage::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& CreditImage::streamName( std::ostream& os ) const { os << "credit-image"; return os; } - std::ostream& CreditImage::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +CreditImage::CreditImage() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool CreditImage::hasAttributes() const +{ + return myAttributes->hasValues(); +} - CreditImageAttributesPtr CreditImage::getAttributes() const - { - return myAttributes; - } +bool CreditImage::hasContents() const +{ + return false; +} +std::ostream &CreditImage::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void CreditImage::setAttributes( const CreditImageAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &CreditImage::streamName(std::ostream &os) const +{ + os << "credit-image"; + return os; +} +std::ostream &CreditImage::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool CreditImage::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +CreditImageAttributesPtr CreditImage::getAttributes() const +{ + return myAttributes; +} +void CreditImage::setAttributes(const CreditImageAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool CreditImage::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditImage.h b/Sourcecode/private/mx/core/elements/CreditImage.h index 17550f71b..91b0f7aad 100644 --- a/Sourcecode/private/mx/core/elements/CreditImage.h +++ b/Sourcecode/private/mx/core/elements/CreditImage.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/CreditImageAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditImageAttributes ) - MX_FORWARD_DECLARE_ELEMENT( CreditImage ) - - inline CreditImagePtr makeCreditImage() { return std::make_shared(); } - - class CreditImage : public ElementInterface - { - public: - CreditImage(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CreditImageAttributesPtr getAttributes() const; - void setAttributes( const CreditImageAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CreditImageAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(CreditImageAttributes) +MX_FORWARD_DECLARE_ELEMENT(CreditImage) + +inline CreditImagePtr makeCreditImage() +{ + return std::make_shared(); } + +class CreditImage : public ElementInterface +{ + public: + CreditImage(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + CreditImageAttributesPtr getAttributes() const; + void setAttributes(const CreditImageAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + CreditImageAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp b/Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp index cc538bb16..0a32873f5 100644 --- a/Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp @@ -8,88 +8,90 @@ namespace mx { - namespace core +namespace core +{ +CreditImageAttributes::CreditImageAttributes() + : source(), type(), defaultX(), defaultY(), relativeX(), relativeY(), halign(LeftCenterRight::center), + hasSource(true), hasType(true), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasHalign(false) +{ +} + +bool CreditImageAttributes::hasValues() const +{ + return hasSource || hasType || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasHalign; +} + +std::ostream &CreditImageAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - CreditImageAttributes::CreditImageAttributes() - :source() - ,type() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,halign( LeftCenterRight::center ) - ,hasSource( true ) - ,hasType( true ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasHalign( false ) - {} + streamAttribute(os, source, "source", hasSource); + streamAttribute(os, type, "type", hasType); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, halign, "halign", hasHalign); + } + return os; +} + +bool CreditImageAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "CreditImageAttributes"; + bool isSuccess = true; + bool isSourceFound = false; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool CreditImageAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, source, isSourceFound, "source")) { - return hasSource || - hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasHalign; + continue; } - - - std::ostream& CreditImageAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type")) { - if ( hasValues() ) - { - streamAttribute( os, source, "source", hasSource ); - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; + continue; } - - - bool CreditImageAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) { - const char* const className = "CreditImageAttributes"; - bool isSuccess = true; - bool isSourceFound = false; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, source, isSourceFound, "source" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isSourceFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + } + if (!isSourceFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; + } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditImageAttributes.h b/Sourcecode/private/mx/core/elements/CreditImageAttributes.h index 86c76843c..b05c895ad 100644 --- a/Sourcecode/private/mx/core/elements/CreditImageAttributes.h +++ b/Sourcecode/private/mx/core/elements/CreditImageAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsAnyUri.h" #include "mx/core/XsToken.h" @@ -17,34 +17,34 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( CreditImageAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(CreditImageAttributes) - struct CreditImageAttributes : public AttributesInterface - { - public: - CreditImageAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsAnyUri source; - XsToken type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - LeftCenterRight halign; - const bool hasSource; - const bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasHalign; +struct CreditImageAttributes : public AttributesInterface +{ + public: + CreditImageAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsAnyUri source; + XsToken type; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + LeftCenterRight halign; + const bool hasSource; + const bool hasType; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasHalign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditType.cpp b/Sourcecode/private/mx/core/elements/CreditType.cpp index f71ec4e3d..850cb3442 100644 --- a/Sourcecode/private/mx/core/elements/CreditType.cpp +++ b/Sourcecode/private/mx/core/elements/CreditType.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - CreditType::CreditType() - :myValue() - {} - - - CreditType::CreditType( const XsString& value ) - :myValue( value ) - {} - - - bool CreditType::hasAttributes() const - { - return false; - } - - - bool CreditType::hasContents() const - { - return true; - } - - - std::ostream& CreditType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CreditType::streamName( std::ostream& os ) const - { - os << "credit-type"; - return os; - } +namespace core +{ +CreditType::CreditType() : myValue() +{ +} +CreditType::CreditType(const XsString &value) : myValue(value) +{ +} - std::ostream& CreditType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool CreditType::hasAttributes() const +{ + return false; +} +bool CreditType::hasContents() const +{ + return true; +} - XsString CreditType::getValue() const - { - return myValue; - } +std::ostream &CreditType::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &CreditType::streamName(std::ostream &os) const +{ + os << "credit-type"; + return os; +} - void CreditType::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &CreditType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString CreditType::getValue() const +{ + return myValue; +} - bool CreditType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue.setValue( xelement.getValue() ); - return true; - } +void CreditType::setValue(const XsString &value) +{ + myValue = value; +} - } +bool CreditType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditType.h b/Sourcecode/private/mx/core/elements/CreditType.h index 867c92459..3cc7cdcd3 100644 --- a/Sourcecode/private/mx/core/elements/CreditType.h +++ b/Sourcecode/private/mx/core/elements/CreditType.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( CreditType ) - - inline CreditTypePtr makeCreditType() { return std::make_shared(); } - inline CreditTypePtr makeCreditType( const XsString& value ) { return std::make_shared( value ); } - inline CreditTypePtr makeCreditType( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class CreditType : public ElementInterface - { - public: - CreditType(); - CreditType( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(CreditType) + +inline CreditTypePtr makeCreditType() +{ + return std::make_shared(); +} + +inline CreditTypePtr makeCreditType(const XsString &value) +{ + return std::make_shared(value); } + +inline CreditTypePtr makeCreditType(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class CreditType : public ElementInterface +{ + public: + CreditType(); + CreditType(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditWords.cpp b/Sourcecode/private/mx/core/elements/CreditWords.cpp index b6ed1b1dd..778e13973 100644 --- a/Sourcecode/private/mx/core/elements/CreditWords.cpp +++ b/Sourcecode/private/mx/core/elements/CreditWords.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - CreditWords::CreditWords() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - CreditWords::CreditWords( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool CreditWords::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool CreditWords::hasContents() const - { - return true; - } - - - std::ostream& CreditWords::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& CreditWords::streamName( std::ostream& os ) const - { - os << "credit-words"; - return os; - } - - - std::ostream& CreditWords::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +CreditWords::CreditWords() : myValue(), myAttributes(std::make_shared()) +{ +} +CreditWords::CreditWords(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - CreditWordsAttributesPtr CreditWords::getAttributes() const - { - return myAttributes; - } +bool CreditWords::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool CreditWords::hasContents() const +{ + return true; +} - void CreditWords::setAttributes( const CreditWordsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &CreditWords::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &CreditWords::streamName(std::ostream &os) const +{ + os << "credit-words"; + return os; +} - XsString CreditWords::getValue() const - { - return myValue; - } +std::ostream &CreditWords::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +CreditWordsAttributesPtr CreditWords::getAttributes() const +{ + return myAttributes; +} - void CreditWords::setValue( const XsString& value ) - { - myValue = value; - } +void CreditWords::setAttributes(const CreditWordsAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString CreditWords::getValue() const +{ + return myValue; +} - bool CreditWords::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void CreditWords::setValue(const XsString &value) +{ + myValue = value; +} - } +bool CreditWords::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditWords.h b/Sourcecode/private/mx/core/elements/CreditWords.h index a2dc7a5dd..9c805e2f2 100644 --- a/Sourcecode/private/mx/core/elements/CreditWords.h +++ b/Sourcecode/private/mx/core/elements/CreditWords.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/CreditWordsAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditWordsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( CreditWords ) - - inline CreditWordsPtr makeCreditWords() { return std::make_shared(); } - inline CreditWordsPtr makeCreditWords( const XsString& value ) { return std::make_shared( value ); } - inline CreditWordsPtr makeCreditWords( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class CreditWords : public ElementInterface - { - public: - CreditWords(); - CreditWords( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CreditWordsAttributesPtr getAttributes() const; - void setAttributes( const CreditWordsAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - CreditWordsAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(CreditWordsAttributes) +MX_FORWARD_DECLARE_ELEMENT(CreditWords) + +inline CreditWordsPtr makeCreditWords() +{ + return std::make_shared(); +} + +inline CreditWordsPtr makeCreditWords(const XsString &value) +{ + return std::make_shared(value); } + +inline CreditWordsPtr makeCreditWords(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class CreditWords : public ElementInterface +{ + public: + CreditWords(); + CreditWords(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + CreditWordsAttributesPtr getAttributes() const; + void setAttributes(const CreditWordsAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + CreditWordsAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp b/Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp index 817f2b903..d82013f1a 100644 --- a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp @@ -8,148 +8,164 @@ namespace mx { - namespace core - { - CreditWordsAttributes::CreditWordsAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign() - ,valign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( XmlLang{ "it" } ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - +namespace core +{ +CreditWordsAttributes::CreditWordsAttributes() + : justify(LeftCenterRight::center), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), color(), + halign(), valign(), underline(), overline(), lineThrough(), rotation(), letterSpacing(), lineHeight(), + lang(XmlLang{"it"}), space(XmlSpace::default_), enclosure(EnclosureShape::rectangle), hasJustify(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasHalign(false), + hasValign(false), hasUnderline(false), hasOverline(false), hasLineThrough(false), hasRotation(false), + hasLetterSpacing(false), hasLineHeight(false), hasLang(false), hasSpace(false), hasEnclosure(false) +{ +} - bool CreditWordsAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } +bool CreditWordsAttributes::hasValues() const +{ + return hasJustify || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight || hasColor || hasHalign || hasValign || hasUnderline || hasOverline || + hasLineThrough || hasRotation || hasLetterSpacing || hasLineHeight || hasLang || hasSpace || hasEnclosure; +} +std::ostream &CreditWordsAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, justify, "justify", hasJustify); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, valign, "valign", hasValign); + streamAttribute(os, underline, "underline", hasUnderline); + streamAttribute(os, overline, "overline", hasOverline); + streamAttribute(os, lineThrough, "line-through", hasLineThrough); + streamAttribute(os, rotation, "rotation", hasRotation); + streamAttribute(os, letterSpacing, "letter-spacing", hasLetterSpacing); + streamAttribute(os, lineHeight, "line-height", hasLineHeight); + streamAttribute(os, lang, "xml:lang", hasLang); + streamAttribute(os, space, "xml:space", hasSpace); + streamAttribute(os, enclosure, "enclosure", hasEnclosure); + } + return os; +} - std::ostream& CreditWordsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } +bool CreditWordsAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "CreditWordsAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool CreditWordsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "CreditWordsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, valign, hasValign, "valign", &parseValign)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, underline, hasUnderline, "underline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, overline, hasOverline, "overline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, rotation, hasRotation, "rotation")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "xml:lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", + &parseEnclosureShape)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.h b/Sourcecode/private/mx/core/elements/CreditWordsAttributes.h index 1cdde9c0b..88c878eb9 100644 --- a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.h +++ b/Sourcecode/private/mx/core/elements/CreditWordsAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/NumberOrNormal.h" #include "mx/core/XmlLang.h" @@ -21,62 +21,62 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( CreditWordsAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(CreditWordsAttributes) - struct CreditWordsAttributes : public AttributesInterface - { - public: - CreditWordsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; +struct CreditWordsAttributes : public AttributesInterface +{ + public: + CreditWordsAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + LeftCenterRight justify; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + LeftCenterRight halign; + Valign valign; + NumberOfLines underline; + NumberOfLines overline; + NumberOfLines lineThrough; + RotationDegrees rotation; + NumberOrNormal letterSpacing; + NumberOrNormal lineHeight; + XmlLang lang; + XmlSpace space; + EnclosureShape enclosure; + bool hasJustify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasHalign; + bool hasValign; + bool hasUnderline; + bool hasOverline; + bool hasLineThrough; + bool hasRotation; + bool hasLetterSpacing; + bool hasLineHeight; + bool hasLang; + bool hasSpace; + bool hasEnclosure; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp b/Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp index 43c3dc883..8421fd8f2 100644 --- a/Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp +++ b/Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp @@ -11,166 +11,146 @@ namespace mx { - namespace core - { - CreditWordsGroup::CreditWordsGroup() - :myLinkSet() - ,myBookmarkSet() - ,myCreditWords( makeCreditWords() ) - {} - - - bool CreditWordsGroup::hasAttributes() const - { - return false; - } - - - std::ostream& CreditWordsGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CreditWordsGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool CreditWordsGroup::hasContents() const - { - return true; - } - - - std::ostream& CreditWordsGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - bool isFirst = true; - for ( auto x : myLinkSet ) - { - if ( !isFirst ) - { - os << std::endl; - } - x->toStream( os, indentLevel ); - isFirst = false; - } - for ( auto x : myBookmarkSet ) - { - if ( !isFirst ) - { - os << std::endl; - } - x->toStream( os, indentLevel ); - isFirst = false; - } - if ( !isFirst ) - { - os << std::endl; - } - myCreditWords->toStream( os, indentLevel ); - isOneLineOnly = false; - return os; - } - - - const LinkSet& CreditWordsGroup::getLinkSet() const - { - return myLinkSet; - } - - - void CreditWordsGroup::addLink( const LinkPtr& value ) - { - if ( value ) - { - myLinkSet.push_back( value ); - } - } - +namespace core +{ +CreditWordsGroup::CreditWordsGroup() : myLinkSet(), myBookmarkSet(), myCreditWords(makeCreditWords()) +{ +} - void CreditWordsGroup::removeLink( const LinkSetIterConst& value ) - { - if ( value != myLinkSet.cend() ) - { - myLinkSet.erase( value ); - } - } +bool CreditWordsGroup::hasAttributes() const +{ + return false; +} +std::ostream &CreditWordsGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - void CreditWordsGroup::clearLinkSet() - { - myLinkSet.clear(); - } +std::ostream &CreditWordsGroup::streamName(std::ostream &os) const +{ + return os; +} +bool CreditWordsGroup::hasContents() const +{ + return true; +} - LinkPtr CreditWordsGroup::getLink( const LinkSetIterConst& setIterator ) const +std::ostream &CreditWordsGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + bool isFirst = true; + for (auto x : myLinkSet) + { + if (!isFirst) { - if( setIterator != myLinkSet.cend() ) - { - return *setIterator; - } - return LinkPtr(); + os << std::endl; } - - - const BookmarkSet& CreditWordsGroup::getBookmarkSet() const + x->toStream(os, indentLevel); + isFirst = false; + } + for (auto x : myBookmarkSet) + { + if (!isFirst) { - return myBookmarkSet; + os << std::endl; } + x->toStream(os, indentLevel); + isFirst = false; + } + if (!isFirst) + { + os << std::endl; + } + myCreditWords->toStream(os, indentLevel); + isOneLineOnly = false; + return os; +} +const LinkSet &CreditWordsGroup::getLinkSet() const +{ + return myLinkSet; +} - void CreditWordsGroup::addBookmark( const BookmarkPtr& value ) - { - if ( value ) - { - myBookmarkSet.push_back( value ); - } - } - +void CreditWordsGroup::addLink(const LinkPtr &value) +{ + if (value) + { + myLinkSet.push_back(value); + } +} - void CreditWordsGroup::removeBookmark( const BookmarkSetIterConst& value ) - { - if ( value != myBookmarkSet.cend() ) - { - myBookmarkSet.erase( value ); - } - } +void CreditWordsGroup::removeLink(const LinkSetIterConst &value) +{ + if (value != myLinkSet.cend()) + { + myLinkSet.erase(value); + } +} +void CreditWordsGroup::clearLinkSet() +{ + myLinkSet.clear(); +} - void CreditWordsGroup::clearBookmarkSet() - { - myBookmarkSet.clear(); - } +LinkPtr CreditWordsGroup::getLink(const LinkSetIterConst &setIterator) const +{ + if (setIterator != myLinkSet.cend()) + { + return *setIterator; + } + return LinkPtr(); +} +const BookmarkSet &CreditWordsGroup::getBookmarkSet() const +{ + return myBookmarkSet; +} - BookmarkPtr CreditWordsGroup::getBookmark( const BookmarkSetIterConst& setIterator ) const - { - if( setIterator != myBookmarkSet.cend() ) - { - return *setIterator; - } - return BookmarkPtr(); - } +void CreditWordsGroup::addBookmark(const BookmarkPtr &value) +{ + if (value) + { + myBookmarkSet.push_back(value); + } +} +void CreditWordsGroup::removeBookmark(const BookmarkSetIterConst &value) +{ + if (value != myBookmarkSet.cend()) + { + myBookmarkSet.erase(value); + } +} - CreditWordsPtr CreditWordsGroup::getCreditWords() const - { - return myCreditWords; - } +void CreditWordsGroup::clearBookmarkSet() +{ + myBookmarkSet.clear(); +} +BookmarkPtr CreditWordsGroup::getBookmark(const BookmarkSetIterConst &setIterator) const +{ + if (setIterator != myBookmarkSet.cend()) + { + return *setIterator; + } + return BookmarkPtr(); +} - void CreditWordsGroup::setCreditWords( const CreditWordsPtr& value ) - { - if ( value ) - { - myCreditWords = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( CreditWordsGroup ); +CreditWordsPtr CreditWordsGroup::getCreditWords() const +{ + return myCreditWords; +} +void CreditWordsGroup::setCreditWords(const CreditWordsPtr &value) +{ + if (value) + { + myCreditWords = value; } } + +MX_FROM_XELEMENT_UNUSED(CreditWordsGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CreditWordsGroup.h b/Sourcecode/private/mx/core/elements/CreditWordsGroup.h index 24393a8ab..c4e0d3807 100644 --- a/Sourcecode/private/mx/core/elements/CreditWordsGroup.h +++ b/Sourcecode/private/mx/core/elements/CreditWordsGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,52 +13,55 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Bookmark ) - MX_FORWARD_DECLARE_ELEMENT( CreditWords ) - MX_FORWARD_DECLARE_ELEMENT( Link ) - MX_FORWARD_DECLARE_ELEMENT( CreditWordsGroup ) +MX_FORWARD_DECLARE_ELEMENT(Bookmark) +MX_FORWARD_DECLARE_ELEMENT(CreditWords) +MX_FORWARD_DECLARE_ELEMENT(Link) +MX_FORWARD_DECLARE_ELEMENT(CreditWordsGroup) - inline CreditWordsGroupPtr makeCreditWordsGroup() { return std::make_shared(); } +inline CreditWordsGroupPtr makeCreditWordsGroup() +{ + return std::make_shared(); +} - class CreditWordsGroup : public ElementInterface - { - public: - CreditWordsGroup(); +class CreditWordsGroup : public ElementInterface +{ + public: + CreditWordsGroup(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ LinkSet minOccurs = 0, maxOccurs = unbounded _________ */ - const LinkSet& getLinkSet() const; - void addLink( const LinkPtr& value ); - void removeLink( const LinkSetIterConst& value ); - void clearLinkSet(); - LinkPtr getLink( const LinkSetIterConst& setIterator ) const; + /* _________ LinkSet minOccurs = 0, maxOccurs = unbounded _________ */ + const LinkSet &getLinkSet() const; + void addLink(const LinkPtr &value); + void removeLink(const LinkSetIterConst &value); + void clearLinkSet(); + LinkPtr getLink(const LinkSetIterConst &setIterator) const; - /* _________ Bookmark minOccurs = 0, maxOccurs = unbounded _________ */ - const BookmarkSet& getBookmarkSet() const; - void addBookmark( const BookmarkPtr& value ); - void removeBookmark( const BookmarkSetIterConst& value ); - void clearBookmarkSet(); - BookmarkPtr getBookmark( const BookmarkSetIterConst& setIterator ) const; + /* _________ Bookmark minOccurs = 0, maxOccurs = unbounded _________ */ + const BookmarkSet &getBookmarkSet() const; + void addBookmark(const BookmarkPtr &value); + void removeBookmark(const BookmarkSetIterConst &value); + void clearBookmarkSet(); + BookmarkPtr getBookmark(const BookmarkSetIterConst &setIterator) const; - /* _________ CreditWords minOccurs = 1, maxOccurs = 1 _________ */ - CreditWordsPtr getCreditWords() const; - void setCreditWords( const CreditWordsPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LinkSet myLinkSet; - BookmarkSet myBookmarkSet; - CreditWordsPtr myCreditWords; - }; - } -} + /* _________ CreditWords minOccurs = 1, maxOccurs = 1 _________ */ + CreditWordsPtr getCreditWords() const; + void setCreditWords(const CreditWordsPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + LinkSet myLinkSet; + BookmarkSet myBookmarkSet; + CreditWordsPtr myCreditWords; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Cue.cpp b/Sourcecode/private/mx/core/elements/Cue.cpp index d99543523..c12c21a2c 100644 --- a/Sourcecode/private/mx/core/elements/Cue.cpp +++ b/Sourcecode/private/mx/core/elements/Cue.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Cue::Cue() : ElementInterface() {} - +namespace core +{ +Cue::Cue() : ElementInterface() +{ +} - bool Cue::hasAttributes() const { return false; } +bool Cue::hasAttributes() const +{ + return false; +} +bool Cue::hasContents() const +{ + return false; +} - bool Cue::hasContents() const { return false; } - std::ostream& Cue::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Cue::streamName( std::ostream& os ) const { os << "cue"; return os; } - std::ostream& Cue::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Cue::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Cue::streamName(std::ostream &os) const +{ + os << "cue"; + return os; +} - bool Cue::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &Cue::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Cue::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Cue.h b/Sourcecode/private/mx/core/elements/Cue.h index 2a31fd358..bc9028ffa 100644 --- a/Sourcecode/private/mx/core/elements/Cue.h +++ b/Sourcecode/private/mx/core/elements/Cue.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Cue ) - - inline CuePtr makeCue() { return std::make_shared(); } - - class Cue : public ElementInterface - { - public: - Cue(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Cue) + +inline CuePtr makeCue() +{ + return std::make_shared(); } + +class Cue : public ElementInterface +{ + public: + Cue(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CueNoteGroup.cpp b/Sourcecode/private/mx/core/elements/CueNoteGroup.cpp index c76089250..d2f4349eb 100644 --- a/Sourcecode/private/mx/core/elements/CueNoteGroup.cpp +++ b/Sourcecode/private/mx/core/elements/CueNoteGroup.cpp @@ -11,97 +11,83 @@ namespace mx { - namespace core - { - CueNoteGroup::CueNoteGroup() - :myCue( makeCue() ) - ,myFullNoteGroup( makeFullNoteGroup() ) - ,myDuration( makeDuration() ) - {} - - - bool CueNoteGroup::hasAttributes() const - { - return false; - } - - - std::ostream& CueNoteGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CueNoteGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool CueNoteGroup::hasContents() const - { - return true; - } - - - std::ostream& CueNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myCue->toStream( os, indentLevel ); - os << std::endl; - myFullNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - os << std::endl; - myDuration->toStream( os, indentLevel ); - isOneLineOnly = false; - return os; - } - +namespace core +{ +CueNoteGroup::CueNoteGroup() : myCue(makeCue()), myFullNoteGroup(makeFullNoteGroup()), myDuration(makeDuration()) +{ +} - CuePtr CueNoteGroup::getCue() const - { - return myCue; - } +bool CueNoteGroup::hasAttributes() const +{ + return false; +} +std::ostream &CueNoteGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - void CueNoteGroup::setCue( const CuePtr& value ) - { - if ( value ) - { - myCue = value; - } - } +std::ostream &CueNoteGroup::streamName(std::ostream &os) const +{ + return os; +} +bool CueNoteGroup::hasContents() const +{ + return true; +} - FullNoteGroupPtr CueNoteGroup::getFullNoteGroup() const - { - return myFullNoteGroup; - } +std::ostream &CueNoteGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + myCue->toStream(os, indentLevel); + os << std::endl; + myFullNoteGroup->streamContents(os, indentLevel, isOneLineOnly); + os << std::endl; + myDuration->toStream(os, indentLevel); + isOneLineOnly = false; + return os; +} +CuePtr CueNoteGroup::getCue() const +{ + return myCue; +} - void CueNoteGroup::setFullNoteGroup( const FullNoteGroupPtr& value ) - { - if ( value ) - { - myFullNoteGroup = value; - } - } +void CueNoteGroup::setCue(const CuePtr &value) +{ + if (value) + { + myCue = value; + } +} +FullNoteGroupPtr CueNoteGroup::getFullNoteGroup() const +{ + return myFullNoteGroup; +} - DurationPtr CueNoteGroup::getDuration() const - { - return myDuration; - } +void CueNoteGroup::setFullNoteGroup(const FullNoteGroupPtr &value) +{ + if (value) + { + myFullNoteGroup = value; + } +} +DurationPtr CueNoteGroup::getDuration() const +{ + return myDuration; +} - void CueNoteGroup::setDuration( const DurationPtr& value ) - { - if ( value ) - { - myDuration = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( CueNoteGroup ); - +void CueNoteGroup::setDuration(const DurationPtr &value) +{ + if (value) + { + myDuration = value; } } + +MX_FROM_XELEMENT_UNUSED(CueNoteGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/CueNoteGroup.h b/Sourcecode/private/mx/core/elements/CueNoteGroup.h index fd8ce989c..0192f9438 100644 --- a/Sourcecode/private/mx/core/elements/CueNoteGroup.h +++ b/Sourcecode/private/mx/core/elements/CueNoteGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,46 +13,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Cue ) - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( CueNoteGroup ) - - inline CueNoteGroupPtr makeCueNoteGroup() { return std::make_shared(); } - - class CueNoteGroup : public ElementInterface - { - public: - CueNoteGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Cue minOccurs = 1, maxOccurs = 1 _________ */ - CuePtr getCue() const; - void setCue( const CuePtr& value ); - - /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteGroupPtr getFullNoteGroup() const; - void setFullNoteGroup( const FullNoteGroupPtr& value ); - - /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CuePtr myCue; - FullNoteGroupPtr myFullNoteGroup; - DurationPtr myDuration; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Cue) +MX_FORWARD_DECLARE_ELEMENT(Duration) +MX_FORWARD_DECLARE_ELEMENT(FullNoteGroup) +MX_FORWARD_DECLARE_ELEMENT(CueNoteGroup) + +inline CueNoteGroupPtr makeCueNoteGroup() +{ + return std::make_shared(); } + +class CueNoteGroup : public ElementInterface +{ + public: + CueNoteGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Cue minOccurs = 1, maxOccurs = 1 _________ */ + CuePtr getCue() const; + void setCue(const CuePtr &value); + + /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ + FullNoteGroupPtr getFullNoteGroup() const; + void setFullNoteGroup(const FullNoteGroupPtr &value); + + /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ + DurationPtr getDuration() const; + void setDuration(const DurationPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + CuePtr myCue; + FullNoteGroupPtr myFullNoteGroup; + DurationPtr myDuration; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Damp.cpp b/Sourcecode/private/mx/core/elements/Damp.cpp index c8b204829..b65cf3730 100644 --- a/Sourcecode/private/mx/core/elements/Damp.cpp +++ b/Sourcecode/private/mx/core/elements/Damp.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Damp::Damp() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Damp::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Damp::hasContents() const { return false; } - std::ostream& Damp::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Damp::streamName( std::ostream& os ) const { os << "damp"; return os; } - std::ostream& Damp::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Damp::Damp() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Damp::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPrintObjectStyleAlignAttributesPtr Damp::getAttributes() const - { - return myAttributes; - } +bool Damp::hasContents() const +{ + return false; +} +std::ostream &Damp::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Damp::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Damp::streamName(std::ostream &os) const +{ + os << "damp"; + return os; +} +std::ostream &Damp::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Damp::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPrintObjectStyleAlignAttributesPtr Damp::getAttributes() const +{ + return myAttributes; +} +void Damp::setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Damp::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Damp.h b/Sourcecode/private/mx/core/elements/Damp.h index 1915764a7..2bd1130a7 100644 --- a/Sourcecode/private/mx/core/elements/Damp.h +++ b/Sourcecode/private/mx/core/elements/Damp.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,31 +14,34 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Damp ) - - inline DampPtr makeDamp() { return std::make_shared(); } - - class Damp : public ElementInterface - { - public: - Damp(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); +namespace core +{ - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); +MX_FORWARD_DECLARE_ELEMENT(Damp) - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } +inline DampPtr makeDamp() +{ + return std::make_shared(); } + +class Damp : public ElementInterface +{ + public: + Damp(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; + void setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPrintObjectStyleAlignAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DampAll.cpp b/Sourcecode/private/mx/core/elements/DampAll.cpp index 00c84a953..39854083b 100644 --- a/Sourcecode/private/mx/core/elements/DampAll.cpp +++ b/Sourcecode/private/mx/core/elements/DampAll.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - DampAll::DampAll() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DampAll::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DampAll::hasContents() const { return false; } - std::ostream& DampAll::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DampAll::streamName( std::ostream& os ) const { os << "damp-all"; return os; } - std::ostream& DampAll::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +DampAll::DampAll() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool DampAll::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPrintObjectStyleAlignAttributesPtr DampAll::getAttributes() const - { - return myAttributes; - } +bool DampAll::hasContents() const +{ + return false; +} +std::ostream &DampAll::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void DampAll::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DampAll::streamName(std::ostream &os) const +{ + os << "damp-all"; + return os; +} +std::ostream &DampAll::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool DampAll::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPrintObjectStyleAlignAttributesPtr DampAll::getAttributes() const +{ + return myAttributes; +} +void DampAll::setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool DampAll::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DampAll.h b/Sourcecode/private/mx/core/elements/DampAll.h index 95f4dee34..55652b577 100644 --- a/Sourcecode/private/mx/core/elements/DampAll.h +++ b/Sourcecode/private/mx/core/elements/DampAll.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,31 +14,34 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DampAll ) - - inline DampAllPtr makeDampAll() { return std::make_shared(); } - - class DampAll : public ElementInterface - { - public: - DampAll(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); +namespace core +{ - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); +MX_FORWARD_DECLARE_ELEMENT(DampAll) - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } +inline DampAllPtr makeDampAll() +{ + return std::make_shared(); } + +class DampAll : public ElementInterface +{ + public: + DampAll(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; + void setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPrintObjectStyleAlignAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Dashes.cpp b/Sourcecode/private/mx/core/elements/Dashes.cpp index 78d64d8bd..af5cde598 100644 --- a/Sourcecode/private/mx/core/elements/Dashes.cpp +++ b/Sourcecode/private/mx/core/elements/Dashes.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Dashes::Dashes() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Dashes::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Dashes::hasContents() const { return false; } - std::ostream& Dashes::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Dashes::streamName( std::ostream& os ) const { os << "dashes"; return os; } - std::ostream& Dashes::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Dashes::Dashes() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Dashes::hasAttributes() const +{ + return myAttributes->hasValues(); +} - DashesAttributesPtr Dashes::getAttributes() const - { - return myAttributes; - } +bool Dashes::hasContents() const +{ + return false; +} +std::ostream &Dashes::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Dashes::setAttributes( const DashesAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Dashes::streamName(std::ostream &os) const +{ + os << "dashes"; + return os; +} +std::ostream &Dashes::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Dashes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +DashesAttributesPtr Dashes::getAttributes() const +{ + return myAttributes; +} +void Dashes::setAttributes(const DashesAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Dashes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Dashes.h b/Sourcecode/private/mx/core/elements/Dashes.h index d1ba504b3..f2b3e8622 100644 --- a/Sourcecode/private/mx/core/elements/Dashes.h +++ b/Sourcecode/private/mx/core/elements/Dashes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DashesAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DashesAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Dashes ) - - inline DashesPtr makeDashes() { return std::make_shared(); } - - class Dashes : public ElementInterface - { - public: - Dashes(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DashesAttributesPtr getAttributes() const; - void setAttributes( const DashesAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DashesAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DashesAttributes) +MX_FORWARD_DECLARE_ELEMENT(Dashes) + +inline DashesPtr makeDashes() +{ + return std::make_shared(); } + +class Dashes : public ElementInterface +{ + public: + Dashes(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DashesAttributesPtr getAttributes() const; + void setAttributes(const DashesAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DashesAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DashesAttributes.cpp b/Sourcecode/private/mx/core/elements/DashesAttributes.cpp index 31998060a..c4d224515 100644 --- a/Sourcecode/private/mx/core/elements/DashesAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DashesAttributes.cpp @@ -8,87 +8,90 @@ namespace mx { - namespace core +namespace core +{ +DashesAttributes::DashesAttributes() + : type(StartStopContinue::start), number(), dashLength(), spaceLength(), defaultX(), defaultY(), relativeX(), + relativeY(), hasType(true), hasNumber(false), hasDashLength(false), hasSpaceLength(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false) +{ +} + +bool DashesAttributes::hasValues() const +{ + return hasType || hasNumber || hasDashLength || hasSpaceLength || hasDefaultX || hasDefaultY || hasRelativeX || + hasRelativeY; +} + +std::ostream &DashesAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - DashesAttributes::DashesAttributes() - :type( StartStopContinue::start ) - ,number() - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasType( true ) - ,hasNumber( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, spaceLength, "space-length", hasSpaceLength); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + } + return os; +} + +bool DashesAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DashesAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DashesAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue)) { - return hasType || - hasNumber || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; + continue; } - - - std::ostream& DashesAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; + continue; } - - - bool DashesAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, dashLength, hasDashLength, "dash-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "DashesAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DashesAttributes.h b/Sourcecode/private/mx/core/elements/DashesAttributes.h index 05dcc9376..2e4f6f3fb 100644 --- a/Sourcecode/private/mx/core/elements/DashesAttributes.h +++ b/Sourcecode/private/mx/core/elements/DashesAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -16,36 +16,36 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DashesAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DashesAttributes) - struct DashesAttributes : public AttributesInterface - { - public: - DashesAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopContinue type; - NumberLevel number; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - const bool hasType; - bool hasNumber; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; +struct DashesAttributes : public AttributesInterface +{ + public: + DashesAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStopContinue type; + NumberLevel number; + TenthsValue dashLength; + TenthsValue spaceLength; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + const bool hasType; + bool hasNumber; + bool hasDashLength; + bool hasSpaceLength; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Defaults.cpp b/Sourcecode/private/mx/core/elements/Defaults.cpp index 3f25dc772..4f400d9fa 100644 --- a/Sourcecode/private/mx/core/elements/Defaults.cpp +++ b/Sourcecode/private/mx/core/elements/Defaults.cpp @@ -15,325 +15,291 @@ namespace mx { - namespace core - { - Defaults::Defaults() - :myScaling( makeScaling() ) - ,myHasScaling( false ) - ,myLayoutGroup( makeLayoutGroup() ) - ,myAppearance( makeAppearance() ) - ,myHasAppearance( false ) - ,myMusicFont( makeMusicFont() ) - ,myHasMusicFont( false ) - ,myWordFont( makeWordFont() ) - ,myHasWordFont( false ) - ,myLyricFontSet() - ,myLyricLanguageSet() - {} - - - bool Defaults::hasAttributes() const - { - return false; - } - - - std::ostream& Defaults::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Defaults::streamName( std::ostream& os ) const - { - os << "defaults"; - return os; - } - - - bool Defaults::hasContents() const - { - return myHasScaling - || myLayoutGroup->hasContents() - || myHasAppearance - || myHasMusicFont - || myHasWordFont - || myLyricFontSet.size() > 0 - || myLyricLanguageSet.size() > 0; - } - +namespace core +{ +Defaults::Defaults() + : myScaling(makeScaling()), myHasScaling(false), myLayoutGroup(makeLayoutGroup()), myAppearance(makeAppearance()), + myHasAppearance(false), myMusicFont(makeMusicFont()), myHasMusicFont(false), myWordFont(makeWordFont()), + myHasWordFont(false), myLyricFontSet(), myLyricLanguageSet() +{ +} - std::ostream& Defaults::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myHasScaling ) - { - os << std::endl; - myScaling->toStream( os, indentLevel+1 ); - } - if ( myLayoutGroup->hasContents() ) - { - os << std::endl; - myLayoutGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasAppearance ) - { - os << std::endl; - myAppearance->toStream( os, indentLevel+1 ); - } - if ( myHasMusicFont ) - { - os << std::endl; - myMusicFont->toStream( os, indentLevel+1 ); - } - if ( myHasWordFont ) - { - os << std::endl; - myWordFont->toStream( os, indentLevel+1 ); - } - for ( auto x : myLyricFontSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myLyricLanguageSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } +bool Defaults::hasAttributes() const +{ + return false; +} +std::ostream &Defaults::streamAttributes(std::ostream &os) const +{ + return os; +} - ScalingPtr Defaults::getScaling() const - { - return myScaling; - } +std::ostream &Defaults::streamName(std::ostream &os) const +{ + os << "defaults"; + return os; +} +bool Defaults::hasContents() const +{ + return myHasScaling || myLayoutGroup->hasContents() || myHasAppearance || myHasMusicFont || myHasWordFont || + myLyricFontSet.size() > 0 || myLyricLanguageSet.size() > 0; +} - void Defaults::setScaling( const ScalingPtr& value ) +std::ostream &Defaults::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + if (myHasScaling) { - if( value ) - { - myScaling = value; - } + os << std::endl; + myScaling->toStream(os, indentLevel + 1); } - - - bool Defaults::getHasScaling() const + if (myLayoutGroup->hasContents()) { - return myHasScaling; + os << std::endl; + myLayoutGroup->streamContents(os, indentLevel + 1, isOneLineOnly); } - - - void Defaults::setHasScaling( const bool value ) + if (myHasAppearance) { - myHasScaling = value; + os << std::endl; + myAppearance->toStream(os, indentLevel + 1); } - - - LayoutGroupPtr Defaults::getLayoutGroup() const + if (myHasMusicFont) { - return myLayoutGroup; + os << std::endl; + myMusicFont->toStream(os, indentLevel + 1); } - - - void Defaults::setLayoutGroup( const LayoutGroupPtr& value ) + if (myHasWordFont) { - if ( value ) - { - myLayoutGroup = value; - } + os << std::endl; + myWordFont->toStream(os, indentLevel + 1); } - - - AppearancePtr Defaults::getAppearance() const + for (auto x : myLyricFontSet) { - return myAppearance; + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - void Defaults::setAppearance( const AppearancePtr& value ) + for (auto x : myLyricLanguageSet) { - if( value ) - { - myAppearance = value; - } - } - - - bool Defaults::getHasAppearance() const - { - return myHasAppearance; - } - - - void Defaults::setHasAppearance( const bool value ) - { - myHasAppearance = value; - } - - - MusicFontPtr Defaults::getMusicFont() const - { - return myMusicFont; + os << std::endl; + x->toStream(os, indentLevel + 1); } + isOneLineOnly = false; + os << std::endl; + } + else + { + isOneLineOnly = true; + } + return os; +} +ScalingPtr Defaults::getScaling() const +{ + return myScaling; +} - void Defaults::setMusicFont( const MusicFontPtr& value ) - { - if( value ) - { - myMusicFont = value; - } - } +void Defaults::setScaling(const ScalingPtr &value) +{ + if (value) + { + myScaling = value; + } +} +bool Defaults::getHasScaling() const +{ + return myHasScaling; +} - bool Defaults::getHasMusicFont() const - { - return myHasMusicFont; - } +void Defaults::setHasScaling(const bool value) +{ + myHasScaling = value; +} +LayoutGroupPtr Defaults::getLayoutGroup() const +{ + return myLayoutGroup; +} - void Defaults::setHasMusicFont( const bool value ) - { - myHasMusicFont = value; - } +void Defaults::setLayoutGroup(const LayoutGroupPtr &value) +{ + if (value) + { + myLayoutGroup = value; + } +} +AppearancePtr Defaults::getAppearance() const +{ + return myAppearance; +} - WordFontPtr Defaults::getWordFont() const - { - return myWordFont; - } +void Defaults::setAppearance(const AppearancePtr &value) +{ + if (value) + { + myAppearance = value; + } +} +bool Defaults::getHasAppearance() const +{ + return myHasAppearance; +} - void Defaults::setWordFont( const WordFontPtr& value ) - { - if( value ) - { - myWordFont = value; - } - } +void Defaults::setHasAppearance(const bool value) +{ + myHasAppearance = value; +} +MusicFontPtr Defaults::getMusicFont() const +{ + return myMusicFont; +} - bool Defaults::getHasWordFont() const - { - return myHasWordFont; - } +void Defaults::setMusicFont(const MusicFontPtr &value) +{ + if (value) + { + myMusicFont = value; + } +} +bool Defaults::getHasMusicFont() const +{ + return myHasMusicFont; +} - void Defaults::setHasWordFont( const bool value ) - { - myHasWordFont = value; - } +void Defaults::setHasMusicFont(const bool value) +{ + myHasMusicFont = value; +} +WordFontPtr Defaults::getWordFont() const +{ + return myWordFont; +} - const LyricFontSet& Defaults::getLyricFontSet() const - { - return myLyricFontSet; - } +void Defaults::setWordFont(const WordFontPtr &value) +{ + if (value) + { + myWordFont = value; + } +} +bool Defaults::getHasWordFont() const +{ + return myHasWordFont; +} - void Defaults::removeLyricFont( const LyricFontSetIterConst& value ) - { - if ( value != myLyricFontSet.cend() ) - { - myLyricFontSet.erase( value ); - } - } +void Defaults::setHasWordFont(const bool value) +{ + myHasWordFont = value; +} +const LyricFontSet &Defaults::getLyricFontSet() const +{ + return myLyricFontSet; +} - void Defaults::addLyricFont( const LyricFontPtr& value ) - { - if ( value ) - { - myLyricFontSet.push_back( value ); - } - } +void Defaults::removeLyricFont(const LyricFontSetIterConst &value) +{ + if (value != myLyricFontSet.cend()) + { + myLyricFontSet.erase(value); + } +} +void Defaults::addLyricFont(const LyricFontPtr &value) +{ + if (value) + { + myLyricFontSet.push_back(value); + } +} - void Defaults::clearLyricFontSet() - { - myLyricFontSet.clear(); - } +void Defaults::clearLyricFontSet() +{ + myLyricFontSet.clear(); +} +LyricFontPtr Defaults::getLyricFont(const LyricFontSetIterConst &setIterator) const +{ + if (setIterator != myLyricFontSet.cend()) + { + return *setIterator; + } + return LyricFontPtr(); +} - LyricFontPtr Defaults::getLyricFont( const LyricFontSetIterConst& setIterator ) const - { - if( setIterator != myLyricFontSet.cend() ) - { - return *setIterator; - } - return LyricFontPtr(); - } +const LyricLanguageSet &Defaults::getLyricLanguageSet() const +{ + return myLyricLanguageSet; +} +void Defaults::removeLyricLanguage(const LyricLanguageSetIterConst &value) +{ + if (value != myLyricLanguageSet.cend()) + { + myLyricLanguageSet.erase(value); + } +} - const LyricLanguageSet& Defaults::getLyricLanguageSet() const - { - return myLyricLanguageSet; - } +void Defaults::addLyricLanguage(const LyricLanguagePtr &value) +{ + if (value) + { + myLyricLanguageSet.push_back(value); + } +} +void Defaults::clearLyricLanguageSet() +{ + myLyricLanguageSet.clear(); +} - void Defaults::removeLyricLanguage( const LyricLanguageSetIterConst& value ) - { - if ( value != myLyricLanguageSet.cend() ) - { - myLyricLanguageSet.erase( value ); - } - } +LyricLanguagePtr Defaults::getLyricLanguage(const LyricLanguageSetIterConst &setIterator) const +{ + if (setIterator != myLyricLanguageSet.cend()) + { + return *setIterator; + } + return LyricLanguagePtr(); +} +bool Defaults::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; - void Defaults::addLyricLanguage( const LyricLanguagePtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myScaling, myHasScaling)) { - if ( value ) - { - myLyricLanguageSet.push_back( value ); - } + continue; } - - - void Defaults::clearLyricLanguageSet() + importGroup(message, it, endIter, isSuccess, myLayoutGroup); + if (importElement(message, *it, isSuccess, *myAppearance, myHasAppearance)) { - myLyricLanguageSet.clear(); + continue; } - - - LyricLanguagePtr Defaults::getLyricLanguage( const LyricLanguageSetIterConst& setIterator ) const + if (importElement(message, *it, isSuccess, *myMusicFont, myHasMusicFont)) { - if( setIterator != myLyricLanguageSet.cend() ) - { - return *setIterator; - } - return LyricLanguagePtr(); + continue; } - - - bool Defaults::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myWordFont, myHasWordFont)) { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myScaling, myHasScaling ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myLayoutGroup ); - if ( importElement( message, *it, isSuccess, *myAppearance, myHasAppearance ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMusicFont, myHasMusicFont ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myWordFont, myHasWordFont ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "lyric-font", myLyricFontSet ); - importElementSet( message, it, endIter, isSuccess, "lyric-language", myLyricLanguageSet ); - } - - MX_RETURN_IS_SUCCESS; + continue; } - + importElementSet(message, it, endIter, isSuccess, "lyric-font", myLyricFontSet); + importElementSet(message, it, endIter, isSuccess, "lyric-language", myLyricLanguageSet); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Defaults.h b/Sourcecode/private/mx/core/elements/Defaults.h index ebe5e9f7c..3f49433e4 100644 --- a/Sourcecode/private/mx/core/elements/Defaults.h +++ b/Sourcecode/private/mx/core/elements/Defaults.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,88 +13,91 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Appearance ) - MX_FORWARD_DECLARE_ELEMENT( LayoutGroup ) - MX_FORWARD_DECLARE_ELEMENT( LyricFont ) - MX_FORWARD_DECLARE_ELEMENT( LyricLanguage ) - MX_FORWARD_DECLARE_ELEMENT( MusicFont ) - MX_FORWARD_DECLARE_ELEMENT( Scaling ) - MX_FORWARD_DECLARE_ELEMENT( WordFont ) - MX_FORWARD_DECLARE_ELEMENT( Defaults ) - - inline DefaultsPtr makeDefaults() { return std::make_shared(); } - - class Defaults : public ElementInterface - { - public: - Defaults(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Scaling minOccurs = 0, maxOccurs = 1 _________ */ - ScalingPtr getScaling() const; - void setScaling( const ScalingPtr& value ); - bool getHasScaling() const; - void setHasScaling( const bool value ); - - /* _________ LayoutGroup minOccurs = 1, maxOccurs = 1 _________ */ - LayoutGroupPtr getLayoutGroup() const; - void setLayoutGroup( const LayoutGroupPtr& value ); - - /* _________ Appearance minOccurs = 0, maxOccurs = 1 _________ */ - AppearancePtr getAppearance() const; - void setAppearance( const AppearancePtr& value ); - bool getHasAppearance() const; - void setHasAppearance( const bool value ); - - /* _________ MusicFont minOccurs = 0, maxOccurs = 1 _________ */ - MusicFontPtr getMusicFont() const; - void setMusicFont( const MusicFontPtr& value ); - bool getHasMusicFont() const; - void setHasMusicFont( const bool value ); - - /* _________ WordFont minOccurs = 0, maxOccurs = 1 _________ */ - WordFontPtr getWordFont() const; - void setWordFont( const WordFontPtr& value ); - bool getHasWordFont() const; - void setHasWordFont( const bool value ); - - /* _________ LyricFont minOccurs = 0, maxOccurs = unbounded _________ */ - const LyricFontSet& getLyricFontSet() const; - void addLyricFont( const LyricFontPtr& value ); - void removeLyricFont( const LyricFontSetIterConst& value ); - void clearLyricFontSet(); - LyricFontPtr getLyricFont( const LyricFontSetIterConst& setIterator ) const; - - /* _________ LyricLanguage minOccurs = 0, maxOccurs = unbounded _________ */ - const LyricLanguageSet& getLyricLanguageSet() const; - void addLyricLanguage( const LyricLanguagePtr& value ); - void removeLyricLanguage( const LyricLanguageSetIterConst& value ); - void clearLyricLanguageSet(); - LyricLanguagePtr getLyricLanguage( const LyricLanguageSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScalingPtr myScaling; - bool myHasScaling; - LayoutGroupPtr myLayoutGroup; - AppearancePtr myAppearance; - bool myHasAppearance; - MusicFontPtr myMusicFont; - bool myHasMusicFont; - WordFontPtr myWordFont; - bool myHasWordFont; - LyricFontSet myLyricFontSet; - LyricLanguageSet myLyricLanguageSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Appearance) +MX_FORWARD_DECLARE_ELEMENT(LayoutGroup) +MX_FORWARD_DECLARE_ELEMENT(LyricFont) +MX_FORWARD_DECLARE_ELEMENT(LyricLanguage) +MX_FORWARD_DECLARE_ELEMENT(MusicFont) +MX_FORWARD_DECLARE_ELEMENT(Scaling) +MX_FORWARD_DECLARE_ELEMENT(WordFont) +MX_FORWARD_DECLARE_ELEMENT(Defaults) + +inline DefaultsPtr makeDefaults() +{ + return std::make_shared(); } + +class Defaults : public ElementInterface +{ + public: + Defaults(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Scaling minOccurs = 0, maxOccurs = 1 _________ */ + ScalingPtr getScaling() const; + void setScaling(const ScalingPtr &value); + bool getHasScaling() const; + void setHasScaling(const bool value); + + /* _________ LayoutGroup minOccurs = 1, maxOccurs = 1 _________ */ + LayoutGroupPtr getLayoutGroup() const; + void setLayoutGroup(const LayoutGroupPtr &value); + + /* _________ Appearance minOccurs = 0, maxOccurs = 1 _________ */ + AppearancePtr getAppearance() const; + void setAppearance(const AppearancePtr &value); + bool getHasAppearance() const; + void setHasAppearance(const bool value); + + /* _________ MusicFont minOccurs = 0, maxOccurs = 1 _________ */ + MusicFontPtr getMusicFont() const; + void setMusicFont(const MusicFontPtr &value); + bool getHasMusicFont() const; + void setHasMusicFont(const bool value); + + /* _________ WordFont minOccurs = 0, maxOccurs = 1 _________ */ + WordFontPtr getWordFont() const; + void setWordFont(const WordFontPtr &value); + bool getHasWordFont() const; + void setHasWordFont(const bool value); + + /* _________ LyricFont minOccurs = 0, maxOccurs = unbounded _________ */ + const LyricFontSet &getLyricFontSet() const; + void addLyricFont(const LyricFontPtr &value); + void removeLyricFont(const LyricFontSetIterConst &value); + void clearLyricFontSet(); + LyricFontPtr getLyricFont(const LyricFontSetIterConst &setIterator) const; + + /* _________ LyricLanguage minOccurs = 0, maxOccurs = unbounded _________ */ + const LyricLanguageSet &getLyricLanguageSet() const; + void addLyricLanguage(const LyricLanguagePtr &value); + void removeLyricLanguage(const LyricLanguageSetIterConst &value); + void clearLyricLanguageSet(); + LyricLanguagePtr getLyricLanguage(const LyricLanguageSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ScalingPtr myScaling; + bool myHasScaling; + LayoutGroupPtr myLayoutGroup; + AppearancePtr myAppearance; + bool myHasAppearance; + MusicFontPtr myMusicFont; + bool myHasMusicFont; + WordFontPtr myWordFont; + bool myHasWordFont; + LyricFontSet myLyricFontSet; + LyricLanguageSet myLyricLanguageSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Degree.cpp b/Sourcecode/private/mx/core/elements/Degree.cpp index 1acd0d7c4..8adc9af30 100644 --- a/Sourcecode/private/mx/core/elements/Degree.cpp +++ b/Sourcecode/private/mx/core/elements/Degree.cpp @@ -11,145 +11,139 @@ namespace mx { - namespace core - { - Degree::Degree() - :myAttributes( std::make_shared() ) - ,myDegreeValue( makeDegreeValue() ) - ,myDegreeAlter( makeDegreeAlter() ) - ,myDegreeType( makeDegreeType( DegreeTypeValue::add ) ) - {} - - - bool Degree::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Degree::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Degree::streamName( std::ostream& os ) const - { - os << "degree"; - return os; - } - - - bool Degree::hasContents() const - { - return true; - } - - - std::ostream& Degree::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myDegreeValue->toStream( os, indentLevel+1 ); - os << std::endl; - myDegreeAlter->toStream( os, indentLevel+1 ); - os << std::endl; - myDegreeType->toStream( os, indentLevel+1 ); - os << std::endl; - isOneLineOnly = false; - return os; - } +namespace core +{ +Degree::Degree() + : myAttributes(std::make_shared()), myDegreeValue(makeDegreeValue()), + myDegreeAlter(makeDegreeAlter()), myDegreeType(makeDegreeType(DegreeTypeValue::add)) +{ +} +bool Degree::hasAttributes() const +{ + return myAttributes->hasValues(); +} - DegreeAttributesPtr Degree::getAttributes() const - { - return myAttributes; - } +std::ostream &Degree::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Degree::streamName(std::ostream &os) const +{ + os << "degree"; + return os; +} - void Degree::setAttributes( const DegreeAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool Degree::hasContents() const +{ + return true; +} +std::ostream &Degree::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myDegreeValue->toStream(os, indentLevel + 1); + os << std::endl; + myDegreeAlter->toStream(os, indentLevel + 1); + os << std::endl; + myDegreeType->toStream(os, indentLevel + 1); + os << std::endl; + isOneLineOnly = false; + return os; +} - DegreeValuePtr Degree::getDegreeValue() const - { - return myDegreeValue; - } +DegreeAttributesPtr Degree::getAttributes() const +{ + return myAttributes; +} +void Degree::setAttributes(const DegreeAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - void Degree::setDegreeValue( const DegreeValuePtr& value ) - { - if( value ) - { - myDegreeValue = value; - } - } +DegreeValuePtr Degree::getDegreeValue() const +{ + return myDegreeValue; +} +void Degree::setDegreeValue(const DegreeValuePtr &value) +{ + if (value) + { + myDegreeValue = value; + } +} - DegreeAlterPtr Degree::getDegreeAlter() const - { - return myDegreeAlter; - } +DegreeAlterPtr Degree::getDegreeAlter() const +{ + return myDegreeAlter; +} +void Degree::setDegreeAlter(const DegreeAlterPtr &value) +{ + if (value) + { + myDegreeAlter = value; + } +} - void Degree::setDegreeAlter( const DegreeAlterPtr& value ) - { - if( value ) - { - myDegreeAlter = value; - } - } +DegreeTypePtr Degree::getDegreeType() const +{ + return myDegreeType; +} +void Degree::setDegreeType(const DegreeTypePtr &value) +{ + if (value) + { + myDegreeType = value; + } +} - DegreeTypePtr Degree::getDegreeType() const +bool Degree::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isDegreeValueFound = false; + bool isDegreeAlterFound = false; + bool isDegreeTypeFound = false; + + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myDegreeValue, isDegreeValueFound)) { - return myDegreeType; + continue; } - - - void Degree::setDegreeType( const DegreeTypePtr& value ) + if (importElement(message, *it, isSuccess, *myDegreeAlter, isDegreeAlterFound)) { - if( value ) - { - myDegreeType = value; - } + continue; } - - - bool Degree::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myDegreeType, isDegreeTypeFound)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isDegreeValueFound = false; - bool isDegreeAlterFound = false; - bool isDegreeTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myDegreeValue, isDegreeValueFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myDegreeAlter, isDegreeAlterFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myDegreeType, isDegreeTypeFound ) ) { continue; } - } - - if( !isDegreeValueFound ) - { - message << "Degree: '" << myDegreeValue->getElementName() << "' is required but was not found" << std::endl; - } - if( !isDegreeAlterFound ) - { - message << "Degree: '" << myDegreeAlter->getElementName() << "' is required but was not found" << std::endl; - } - if( !isDegreeTypeFound ) - { - message << "Degree: '" << myDegreeType->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isDegreeValueFound) + { + message << "Degree: '" << myDegreeValue->getElementName() << "' is required but was not found" << std::endl; } + if (!isDegreeAlterFound) + { + message << "Degree: '" << myDegreeAlter->getElementName() << "' is required but was not found" << std::endl; + } + if (!isDegreeTypeFound) + { + message << "Degree: '" << myDegreeType->getElementName() << "' is required but was not found" << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Degree.h b/Sourcecode/private/mx/core/elements/Degree.h index 47dd16194..edb88b839 100644 --- a/Sourcecode/private/mx/core/elements/Degree.h +++ b/Sourcecode/private/mx/core/elements/Degree.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DegreeAttributes.h" #include @@ -14,50 +14,53 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DegreeAlter ) - MX_FORWARD_DECLARE_ELEMENT( DegreeType ) - MX_FORWARD_DECLARE_ELEMENT( DegreeValue ) - MX_FORWARD_DECLARE_ELEMENT( Degree ) - - inline DegreePtr makeDegree() { return std::make_shared(); } - - class Degree : public ElementInterface - { - public: - Degree(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DegreeAttributesPtr getAttributes() const; - void setAttributes( const DegreeAttributesPtr& value ); - - /* _________ DegreeValue minOccurs = 1, maxOccurs = 1 _________ */ - DegreeValuePtr getDegreeValue() const; - void setDegreeValue( const DegreeValuePtr& value ); - - /* _________ DegreeAlter minOccurs = 1, maxOccurs = 1 _________ */ - DegreeAlterPtr getDegreeAlter() const; - void setDegreeAlter( const DegreeAlterPtr& value ); - - /* _________ DegreeType minOccurs = 1, maxOccurs = 1 _________ */ - DegreeTypePtr getDegreeType() const; - void setDegreeType( const DegreeTypePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DegreeAttributesPtr myAttributes; - DegreeValuePtr myDegreeValue; - DegreeAlterPtr myDegreeAlter; - DegreeTypePtr myDegreeType; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DegreeAttributes) +MX_FORWARD_DECLARE_ELEMENT(DegreeAlter) +MX_FORWARD_DECLARE_ELEMENT(DegreeType) +MX_FORWARD_DECLARE_ELEMENT(DegreeValue) +MX_FORWARD_DECLARE_ELEMENT(Degree) + +inline DegreePtr makeDegree() +{ + return std::make_shared(); } + +class Degree : public ElementInterface +{ + public: + Degree(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DegreeAttributesPtr getAttributes() const; + void setAttributes(const DegreeAttributesPtr &value); + + /* _________ DegreeValue minOccurs = 1, maxOccurs = 1 _________ */ + DegreeValuePtr getDegreeValue() const; + void setDegreeValue(const DegreeValuePtr &value); + + /* _________ DegreeAlter minOccurs = 1, maxOccurs = 1 _________ */ + DegreeAlterPtr getDegreeAlter() const; + void setDegreeAlter(const DegreeAlterPtr &value); + + /* _________ DegreeType minOccurs = 1, maxOccurs = 1 _________ */ + DegreeTypePtr getDegreeType() const; + void setDegreeType(const DegreeTypePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DegreeAttributesPtr myAttributes; + DegreeValuePtr myDegreeValue; + DegreeAlterPtr myDegreeAlter; + DegreeTypePtr myDegreeType; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeAlter.cpp b/Sourcecode/private/mx/core/elements/DegreeAlter.cpp index 577f9a1d3..ada46e31d 100644 --- a/Sourcecode/private/mx/core/elements/DegreeAlter.cpp +++ b/Sourcecode/private/mx/core/elements/DegreeAlter.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - DegreeAlter::DegreeAlter() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - DegreeAlter::DegreeAlter( const Semitones& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool DegreeAlter::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DegreeAlter::hasContents() const - { - return true; - } - - - std::ostream& DegreeAlter::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DegreeAlter::streamName( std::ostream& os ) const - { - os << "degree-alter"; - return os; - } - - - std::ostream& DegreeAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +DegreeAlter::DegreeAlter() : myValue(), myAttributes(std::make_shared()) +{ +} +DegreeAlter::DegreeAlter(const Semitones &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - DegreeAlterAttributesPtr DegreeAlter::getAttributes() const - { - return myAttributes; - } +bool DegreeAlter::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool DegreeAlter::hasContents() const +{ + return true; +} - void DegreeAlter::setAttributes( const DegreeAlterAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DegreeAlter::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &DegreeAlter::streamName(std::ostream &os) const +{ + os << "degree-alter"; + return os; +} - Semitones DegreeAlter::getValue() const - { - return myValue; - } +std::ostream &DegreeAlter::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +DegreeAlterAttributesPtr DegreeAlter::getAttributes() const +{ + return myAttributes; +} - void DegreeAlter::setValue( const Semitones& value ) - { - myValue = value; - } +void DegreeAlter::setAttributes(const DegreeAlterAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +Semitones DegreeAlter::getValue() const +{ + return myValue; +} - bool DegreeAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void DegreeAlter::setValue(const Semitones &value) +{ + myValue = value; +} - } +bool DegreeAlter::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeAlter.h b/Sourcecode/private/mx/core/elements/DegreeAlter.h index 8bc855ca1..f1894f581 100644 --- a/Sourcecode/private/mx/core/elements/DegreeAlter.h +++ b/Sourcecode/private/mx/core/elements/DegreeAlter.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DegreeAlterAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeAlterAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DegreeAlter ) - - inline DegreeAlterPtr makeDegreeAlter() { return std::make_shared(); } - inline DegreeAlterPtr makeDegreeAlter( const Semitones& value ) { return std::make_shared( value ); } - inline DegreeAlterPtr makeDegreeAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class DegreeAlter : public ElementInterface - { - public: - DegreeAlter(); - DegreeAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DegreeAlterAttributesPtr getAttributes() const; - void setAttributes( const DegreeAlterAttributesPtr& attributes ); - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - DegreeAlterAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DegreeAlterAttributes) +MX_FORWARD_DECLARE_ELEMENT(DegreeAlter) + +inline DegreeAlterPtr makeDegreeAlter() +{ + return std::make_shared(); } + +inline DegreeAlterPtr makeDegreeAlter(const Semitones &value) +{ + return std::make_shared(value); +} + +inline DegreeAlterPtr makeDegreeAlter(Semitones &&value) +{ + return std::make_shared(std::move(value)); +} + +class DegreeAlter : public ElementInterface +{ + public: + DegreeAlter(); + DegreeAlter(const Semitones &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DegreeAlterAttributesPtr getAttributes() const; + void setAttributes(const DegreeAlterAttributesPtr &attributes); + Semitones getValue() const; + void setValue(const Semitones &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Semitones myValue; + DegreeAlterAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp b/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp index 976a1dc90..348d6d7ab 100644 --- a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +DegreeAlterAttributes::DegreeAlterAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), plusMinus(YesNo::no), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlusMinus(false) +{ +} + +bool DegreeAlterAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlusMinus; +} + +std::ostream &DegreeAlterAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - DegreeAlterAttributes::DegreeAlterAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,plusMinus( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlusMinus( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, plusMinus, "plus-minus", hasPlusMinus); + } + return os; +} + +bool DegreeAlterAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DegreeAlterAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DegreeAlterAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlusMinus; + continue; } - - - std::ostream& DegreeAlterAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, plusMinus, "plus-minus", hasPlusMinus ); - } - return os; + continue; } - - - bool DegreeAlterAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "DegreeAlterAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, plusMinus, hasPlusMinus, "plus-minus", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, plusMinus, hasPlusMinus, "plus-minus", &parseYesNo)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h b/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h index 796a9c81a..d508270ee 100644 --- a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h +++ b/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeAlterAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DegreeAlterAttributes) - struct DegreeAlterAttributes : public AttributesInterface - { - public: - DegreeAlterAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - YesNo plusMinus; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlusMinus; +struct DegreeAlterAttributes : public AttributesInterface +{ + public: + DegreeAlterAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + YesNo plusMinus; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlusMinus; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeAttributes.cpp b/Sourcecode/private/mx/core/elements/DegreeAttributes.cpp index 4ba2969aa..4994b4ebe 100644 --- a/Sourcecode/private/mx/core/elements/DegreeAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DegreeAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - DegreeAttributes::DegreeAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - +namespace core +{ +DegreeAttributes::DegreeAttributes() : printObject(YesNo::no), hasPrintObject(false) +{ +} - bool DegreeAttributes::hasValues() const - { - return hasPrintObject; - } +bool DegreeAttributes::hasValues() const +{ + return hasPrintObject; +} +std::ostream &DegreeAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} - std::ostream& DegreeAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } +bool DegreeAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DegreeAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DegreeAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - const char* const className = "DegreeAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeAttributes.h b/Sourcecode/private/mx/core/elements/DegreeAttributes.h index c94899a05..5d6ffc411 100644 --- a/Sourcecode/private/mx/core/elements/DegreeAttributes.h +++ b/Sourcecode/private/mx/core/elements/DegreeAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DegreeAttributes) - struct DegreeAttributes : public AttributesInterface - { - public: - DegreeAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; +struct DegreeAttributes : public AttributesInterface +{ + public: + DegreeAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeType.cpp b/Sourcecode/private/mx/core/elements/DegreeType.cpp index 16d337a72..d43729896 100644 --- a/Sourcecode/private/mx/core/elements/DegreeType.cpp +++ b/Sourcecode/private/mx/core/elements/DegreeType.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - DegreeType::DegreeType() - :myValue( DegreeTypeValue::add ) - ,myAttributes( std::make_shared() ) - {} - - - DegreeType::DegreeType( const DegreeTypeValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool DegreeType::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DegreeType::hasContents() const - { - return true; - } - - - std::ostream& DegreeType::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DegreeType::streamName( std::ostream& os ) const - { - os << "degree-type"; - return os; - } - - - std::ostream& DegreeType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +DegreeType::DegreeType() : myValue(DegreeTypeValue::add), myAttributes(std::make_shared()) +{ +} +DegreeType::DegreeType(const DegreeTypeValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - DegreeTypeAttributesPtr DegreeType::getAttributes() const - { - return myAttributes; - } +bool DegreeType::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool DegreeType::hasContents() const +{ + return true; +} - void DegreeType::setAttributes( const DegreeTypeAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DegreeType::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &DegreeType::streamName(std::ostream &os) const +{ + os << "degree-type"; + return os; +} - DegreeTypeValue DegreeType::getValue() const - { - return myValue; - } +std::ostream &DegreeType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +DegreeTypeAttributesPtr DegreeType::getAttributes() const +{ + return myAttributes; +} - void DegreeType::setValue( const DegreeTypeValue& value ) - { - myValue = value; - } +void DegreeType::setAttributes(const DegreeTypeAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +DegreeTypeValue DegreeType::getValue() const +{ + return myValue; +} - bool DegreeType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseDegreeTypeValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void DegreeType::setValue(const DegreeTypeValue &value) +{ + myValue = value; +} - } +bool DegreeType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseDegreeTypeValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeType.h b/Sourcecode/private/mx/core/elements/DegreeType.h index 537862b96..2eca76d53 100644 --- a/Sourcecode/private/mx/core/elements/DegreeType.h +++ b/Sourcecode/private/mx/core/elements/DegreeType.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DegreeTypeAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeTypeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DegreeType ) - - inline DegreeTypePtr makeDegreeType() { return std::make_shared(); } - inline DegreeTypePtr makeDegreeType( const DegreeTypeValue& value ) { return std::make_shared( value ); } - inline DegreeTypePtr makeDegreeType( DegreeTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class DegreeType : public ElementInterface - { - public: - DegreeType(); - DegreeType( const DegreeTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DegreeTypeAttributesPtr getAttributes() const; - void setAttributes( const DegreeTypeAttributesPtr& attributes ); - DegreeTypeValue getValue() const; - void setValue( const DegreeTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DegreeTypeValue myValue; - DegreeTypeAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DegreeTypeAttributes) +MX_FORWARD_DECLARE_ELEMENT(DegreeType) + +inline DegreeTypePtr makeDegreeType() +{ + return std::make_shared(); +} + +inline DegreeTypePtr makeDegreeType(const DegreeTypeValue &value) +{ + return std::make_shared(value); } + +inline DegreeTypePtr makeDegreeType(DegreeTypeValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class DegreeType : public ElementInterface +{ + public: + DegreeType(); + DegreeType(const DegreeTypeValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DegreeTypeAttributesPtr getAttributes() const; + void setAttributes(const DegreeTypeAttributesPtr &attributes); + DegreeTypeValue getValue() const; + void setValue(const DegreeTypeValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DegreeTypeValue myValue; + DegreeTypeAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp b/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp index 7e9c1cc88..c6cf54376 100644 --- a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +DegreeTypeAttributes::DegreeTypeAttributes() + : text(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasText(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false) +{ +} + +bool DegreeTypeAttributes::hasValues() const +{ + return hasText || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight; +} + +std::ostream &DegreeTypeAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - DegreeTypeAttributes::DegreeTypeAttributes() - :text() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasText( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, text, "text", hasText); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool DegreeTypeAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DegreeTypeAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DegreeTypeAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, text, hasText, "text")) { - return hasText || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& DegreeTypeAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool DegreeTypeAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "DegreeTypeAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h b/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h index 52a7b3284..9393737cf 100644 --- a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h +++ b/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeTypeAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DegreeTypeAttributes) - struct DegreeTypeAttributes : public AttributesInterface - { - public: - DegreeTypeAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken text; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasText; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct DegreeTypeAttributes : public AttributesInterface +{ + public: + DegreeTypeAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken text; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasText; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeValue.cpp b/Sourcecode/private/mx/core/elements/DegreeValue.cpp index 415f907dd..efc260f60 100644 --- a/Sourcecode/private/mx/core/elements/DegreeValue.cpp +++ b/Sourcecode/private/mx/core/elements/DegreeValue.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - DegreeValue::DegreeValue() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - DegreeValue::DegreeValue( const PositiveInteger& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool DegreeValue::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DegreeValue::hasContents() const - { - return true; - } - - - std::ostream& DegreeValue::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DegreeValue::streamName( std::ostream& os ) const - { - os << "degree-value"; - return os; - } - - - std::ostream& DegreeValue::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +DegreeValue::DegreeValue() : myValue(), myAttributes(std::make_shared()) +{ +} +DegreeValue::DegreeValue(const PositiveInteger &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - DegreeValueAttributesPtr DegreeValue::getAttributes() const - { - return myAttributes; - } +bool DegreeValue::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool DegreeValue::hasContents() const +{ + return true; +} - void DegreeValue::setAttributes( const DegreeValueAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DegreeValue::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &DegreeValue::streamName(std::ostream &os) const +{ + os << "degree-value"; + return os; +} - PositiveInteger DegreeValue::getValue() const - { - return myValue; - } +std::ostream &DegreeValue::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +DegreeValueAttributesPtr DegreeValue::getAttributes() const +{ + return myAttributes; +} - void DegreeValue::setValue( const PositiveInteger& value ) - { - myValue = value; - } +void DegreeValue::setAttributes(const DegreeValueAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +PositiveInteger DegreeValue::getValue() const +{ + return myValue; +} - bool DegreeValue::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void DegreeValue::setValue(const PositiveInteger &value) +{ + myValue = value; +} - } +bool DegreeValue::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeValue.h b/Sourcecode/private/mx/core/elements/DegreeValue.h index 45df3fbce..07e7acf21 100644 --- a/Sourcecode/private/mx/core/elements/DegreeValue.h +++ b/Sourcecode/private/mx/core/elements/DegreeValue.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/elements/DegreeValueAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeValueAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DegreeValue ) - - inline DegreeValuePtr makeDegreeValue() { return std::make_shared(); } - inline DegreeValuePtr makeDegreeValue( const PositiveInteger& value ) { return std::make_shared( value ); } - inline DegreeValuePtr makeDegreeValue( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class DegreeValue : public ElementInterface - { - public: - DegreeValue(); - DegreeValue( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DegreeValueAttributesPtr getAttributes() const; - void setAttributes( const DegreeValueAttributesPtr& attributes ); - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - DegreeValueAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DegreeValueAttributes) +MX_FORWARD_DECLARE_ELEMENT(DegreeValue) + +inline DegreeValuePtr makeDegreeValue() +{ + return std::make_shared(); +} + +inline DegreeValuePtr makeDegreeValue(const PositiveInteger &value) +{ + return std::make_shared(value); } + +inline DegreeValuePtr makeDegreeValue(PositiveInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class DegreeValue : public ElementInterface +{ + public: + DegreeValue(); + DegreeValue(const PositiveInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DegreeValueAttributesPtr getAttributes() const; + void setAttributes(const DegreeValueAttributesPtr &attributes); + PositiveInteger getValue() const; + void setValue(const PositiveInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveInteger myValue; + DegreeValueAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp b/Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp index c7165edc8..1d1b65a0d 100644 --- a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp @@ -8,91 +8,95 @@ namespace mx { - namespace core +namespace core +{ +DegreeValueAttributes::DegreeValueAttributes() + : symbol(), text(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasSymbol(false), hasText(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false) +{ +} + +bool DegreeValueAttributes::hasValues() const +{ + return hasSymbol || hasText || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight; +} + +std::ostream &DegreeValueAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - DegreeValueAttributes::DegreeValueAttributes() - :symbol() - ,text() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasSymbol( false ) - ,hasText( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, symbol, "symbol", hasSymbol); + streamAttribute(os, text, "text", hasText); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool DegreeValueAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DegreeValueAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DegreeValueAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, symbol, hasSymbol, "symbol", &parseDegreeSymbolValue)) { - return hasSymbol || - hasText || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& DegreeValueAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, text, hasText, "text")) { - if ( hasValues() ) - { - streamAttribute( os, symbol, "symbol", hasSymbol ); - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool DegreeValueAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - const char* const className = "DegreeValueAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, symbol, hasSymbol, "symbol", &parseDegreeSymbolValue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.h b/Sourcecode/private/mx/core/elements/DegreeValueAttributes.h index b82046808..a6ca67ed6 100644 --- a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.h +++ b/Sourcecode/private/mx/core/elements/DegreeValueAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,40 +17,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeValueAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DegreeValueAttributes) - struct DegreeValueAttributes : public AttributesInterface - { - public: - DegreeValueAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - DegreeSymbolValue symbol; - XsToken text; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasSymbol; - bool hasText; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct DegreeValueAttributes : public AttributesInterface +{ + public: + DegreeValueAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + DegreeSymbolValue symbol; + XsToken text; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasSymbol; + bool hasText; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp b/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp index b1dbd429d..356c71942 100644 --- a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp +++ b/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp @@ -8,59 +8,62 @@ namespace mx { - namespace core - { - DelayedInvertedTurn::DelayedInvertedTurn() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DelayedInvertedTurn::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DelayedInvertedTurn::hasContents() const { return false; } - std::ostream& DelayedInvertedTurn::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DelayedInvertedTurn::streamName( std::ostream& os ) const { os << "delayed-inverted-turn"; return os; } - std::ostream& DelayedInvertedTurn::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +DelayedInvertedTurn::DelayedInvertedTurn() + : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool DelayedInvertedTurn::hasAttributes() const +{ + return myAttributes->hasValues(); +} - DelayedInvertedTurnAttributesPtr DelayedInvertedTurn::getAttributes() const - { - return myAttributes; - } +bool DelayedInvertedTurn::hasContents() const +{ + return false; +} +std::ostream &DelayedInvertedTurn::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void DelayedInvertedTurn::setAttributes( const DelayedInvertedTurnAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DelayedInvertedTurn::streamName(std::ostream &os) const +{ + os << "delayed-inverted-turn"; + return os; +} +std::ostream &DelayedInvertedTurn::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool DelayedInvertedTurn::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +DelayedInvertedTurnAttributesPtr DelayedInvertedTurn::getAttributes() const +{ + return myAttributes; +} +void DelayedInvertedTurn::setAttributes(const DelayedInvertedTurnAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool DelayedInvertedTurn::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h b/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h index eda170488..6f0557c67 100644 --- a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h +++ b/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DelayedInvertedTurnAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DelayedInvertedTurnAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DelayedInvertedTurn ) - - inline DelayedInvertedTurnPtr makeDelayedInvertedTurn() { return std::make_shared(); } - - class DelayedInvertedTurn : public ElementInterface - { - public: - DelayedInvertedTurn(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DelayedInvertedTurnAttributesPtr getAttributes() const; - void setAttributes( const DelayedInvertedTurnAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DelayedInvertedTurnAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DelayedInvertedTurnAttributes) +MX_FORWARD_DECLARE_ELEMENT(DelayedInvertedTurn) + +inline DelayedInvertedTurnPtr makeDelayedInvertedTurn() +{ + return std::make_shared(); } + +class DelayedInvertedTurn : public ElementInterface +{ + public: + DelayedInvertedTurn(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DelayedInvertedTurnAttributesPtr getAttributes() const; + void setAttributes(const DelayedInvertedTurnAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DelayedInvertedTurnAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp b/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp index cb53ade94..e182aa672 100644 --- a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp @@ -8,126 +8,135 @@ namespace mx { - namespace core - { - DelayedInvertedTurnAttributes::DelayedInvertedTurnAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep() - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,slash( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasSlash( false ) - {} - +namespace core +{ +DelayedInvertedTurnAttributes::DelayedInvertedTurnAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), placement(AboveBelow::below), + startNote(StartNote::main), trillStep(), twoNoteTurn(TwoNoteTurn::none), accelerate(YesNo::no), beats(), + secondBeat(), lastBeat(), slash(YesNo::no), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasPlacement(false), hasStartNote(false), hasTrillStep(false), hasTwoNoteTurn(false), hasAccelerate(false), + hasBeats(false), hasSecondBeat(false), hasLastBeat(false), hasSlash(false) +{ +} - bool DelayedInvertedTurnAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasSlash; - } +bool DelayedInvertedTurnAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement || hasStartNote || hasTrillStep || hasTwoNoteTurn || hasAccelerate || + hasBeats || hasSecondBeat || hasLastBeat || hasSlash; +} +std::ostream &DelayedInvertedTurnAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, startNote, "start-note", hasStartNote); + streamAttribute(os, trillStep, "trill-step", hasTrillStep); + streamAttribute(os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn); + streamAttribute(os, accelerate, "accelerate", hasAccelerate); + streamAttribute(os, beats, "beats", hasBeats); + streamAttribute(os, secondBeat, "second-beat", hasSecondBeat); + streamAttribute(os, lastBeat, "last-beat", hasLastBeat); + streamAttribute(os, slash, "slash", hasSlash); + } + return os; +} - std::ostream& DelayedInvertedTurnAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, slash, "slash", hasSlash ); - } - return os; - } +bool DelayedInvertedTurnAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DelayedInvertedTurnAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DelayedInvertedTurnAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DelayedInvertedTurnAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo ) ) { continue; } - } - - - return isSuccess; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", + &parseTwoNoteTurn)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, beats, hasBeats, "beats")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h b/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h index f5fbbf9b6..4bf5da46f 100644 --- a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h +++ b/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,54 +17,54 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DelayedInvertedTurnAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DelayedInvertedTurnAttributes) - struct DelayedInvertedTurnAttributes : public AttributesInterface - { - public: - DelayedInvertedTurnAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo slash; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasSlash; +struct DelayedInvertedTurnAttributes : public AttributesInterface +{ + public: + DelayedInvertedTurnAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + StartNote startNote; + TrillStep trillStep; + TwoNoteTurn twoNoteTurn; + YesNo accelerate; + TrillBeats beats; + Percent secondBeat; + Percent lastBeat; + YesNo slash; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; + bool hasStartNote; + bool hasTrillStep; + bool hasTwoNoteTurn; + bool hasAccelerate; + bool hasBeats; + bool hasSecondBeat; + bool hasLastBeat; + bool hasSlash; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DelayedTurn.cpp b/Sourcecode/private/mx/core/elements/DelayedTurn.cpp index 7cab64b7c..9fe208883 100644 --- a/Sourcecode/private/mx/core/elements/DelayedTurn.cpp +++ b/Sourcecode/private/mx/core/elements/DelayedTurn.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - DelayedTurn::DelayedTurn() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DelayedTurn::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DelayedTurn::hasContents() const { return false; } - std::ostream& DelayedTurn::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DelayedTurn::streamName( std::ostream& os ) const { os << "delayed-turn"; return os; } - std::ostream& DelayedTurn::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +DelayedTurn::DelayedTurn() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool DelayedTurn::hasAttributes() const +{ + return myAttributes->hasValues(); +} - DelayedTurnAttributesPtr DelayedTurn::getAttributes() const - { - return myAttributes; - } +bool DelayedTurn::hasContents() const +{ + return false; +} +std::ostream &DelayedTurn::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void DelayedTurn::setAttributes( const DelayedTurnAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DelayedTurn::streamName(std::ostream &os) const +{ + os << "delayed-turn"; + return os; +} +std::ostream &DelayedTurn::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool DelayedTurn::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +DelayedTurnAttributesPtr DelayedTurn::getAttributes() const +{ + return myAttributes; +} +void DelayedTurn::setAttributes(const DelayedTurnAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool DelayedTurn::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DelayedTurn.h b/Sourcecode/private/mx/core/elements/DelayedTurn.h index f14ecf259..40a045907 100644 --- a/Sourcecode/private/mx/core/elements/DelayedTurn.h +++ b/Sourcecode/private/mx/core/elements/DelayedTurn.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DelayedTurnAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DelayedTurnAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DelayedTurn ) - - inline DelayedTurnPtr makeDelayedTurn() { return std::make_shared(); } - - class DelayedTurn : public ElementInterface - { - public: - DelayedTurn(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DelayedTurnAttributesPtr getAttributes() const; - void setAttributes( const DelayedTurnAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DelayedTurnAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DelayedTurnAttributes) +MX_FORWARD_DECLARE_ELEMENT(DelayedTurn) + +inline DelayedTurnPtr makeDelayedTurn() +{ + return std::make_shared(); } + +class DelayedTurn : public ElementInterface +{ + public: + DelayedTurn(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DelayedTurnAttributesPtr getAttributes() const; + void setAttributes(const DelayedTurnAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DelayedTurnAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp b/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp index e38b8d826..30fee6c5e 100644 --- a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp @@ -8,126 +8,135 @@ namespace mx { - namespace core - { - DelayedTurnAttributes::DelayedTurnAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep() - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,slash( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasSlash( false ) - {} - +namespace core +{ +DelayedTurnAttributes::DelayedTurnAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), placement(AboveBelow::below), + startNote(StartNote::main), trillStep(), twoNoteTurn(TwoNoteTurn::none), accelerate(YesNo::no), beats(), + secondBeat(), lastBeat(), slash(YesNo::no), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasPlacement(false), hasStartNote(false), hasTrillStep(false), hasTwoNoteTurn(false), hasAccelerate(false), + hasBeats(false), hasSecondBeat(false), hasLastBeat(false), hasSlash(false) +{ +} - bool DelayedTurnAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasSlash; - } +bool DelayedTurnAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement || hasStartNote || hasTrillStep || hasTwoNoteTurn || hasAccelerate || + hasBeats || hasSecondBeat || hasLastBeat || hasSlash; +} +std::ostream &DelayedTurnAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, startNote, "start-note", hasStartNote); + streamAttribute(os, trillStep, "trill-step", hasTrillStep); + streamAttribute(os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn); + streamAttribute(os, accelerate, "accelerate", hasAccelerate); + streamAttribute(os, beats, "beats", hasBeats); + streamAttribute(os, secondBeat, "second-beat", hasSecondBeat); + streamAttribute(os, lastBeat, "last-beat", hasLastBeat); + streamAttribute(os, slash, "slash", hasSlash); + } + return os; +} - std::ostream& DelayedTurnAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, slash, "slash", hasSlash ); - } - return os; - } +bool DelayedTurnAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DelayedTurnAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DelayedTurnAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DelayedTurnAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", + &parseTwoNoteTurn)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, beats, hasBeats, "beats")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h b/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h index 83dfcbaf7..e09c47092 100644 --- a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h +++ b/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,54 +17,54 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DelayedTurnAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DelayedTurnAttributes) - struct DelayedTurnAttributes : public AttributesInterface - { - public: - DelayedTurnAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo slash; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasSlash; +struct DelayedTurnAttributes : public AttributesInterface +{ + public: + DelayedTurnAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + StartNote startNote; + TrillStep trillStep; + TwoNoteTurn twoNoteTurn; + YesNo accelerate; + TrillBeats beats; + Percent secondBeat; + Percent lastBeat; + YesNo slash; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; + bool hasStartNote; + bool hasTrillStep; + bool hasTwoNoteTurn; + bool hasAccelerate; + bool hasBeats; + bool hasSecondBeat; + bool hasLastBeat; + bool hasSlash; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DetachedLegato.cpp b/Sourcecode/private/mx/core/elements/DetachedLegato.cpp index 5cfba02a5..0510ab7a1 100644 --- a/Sourcecode/private/mx/core/elements/DetachedLegato.cpp +++ b/Sourcecode/private/mx/core/elements/DetachedLegato.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - DetachedLegato::DetachedLegato() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DetachedLegato::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DetachedLegato::hasContents() const { return false; } - std::ostream& DetachedLegato::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DetachedLegato::streamName( std::ostream& os ) const { os << "detached-legato"; return os; } - std::ostream& DetachedLegato::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +DetachedLegato::DetachedLegato() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool DetachedLegato::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr DetachedLegato::getAttributes() const - { - return myAttributes; - } +bool DetachedLegato::hasContents() const +{ + return false; +} +std::ostream &DetachedLegato::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void DetachedLegato::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DetachedLegato::streamName(std::ostream &os) const +{ + os << "detached-legato"; + return os; +} +std::ostream &DetachedLegato::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool DetachedLegato::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr DetachedLegato::getAttributes() const +{ + return myAttributes; +} +void DetachedLegato::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool DetachedLegato::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DetachedLegato.h b/Sourcecode/private/mx/core/elements/DetachedLegato.h index feef90c79..3c9f46af0 100644 --- a/Sourcecode/private/mx/core/elements/DetachedLegato.h +++ b/Sourcecode/private/mx/core/elements/DetachedLegato.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DetachedLegato ) - - inline DetachedLegatoPtr makeDetachedLegato() { return std::make_shared(); } - - class DetachedLegato : public ElementInterface - { - public: - DetachedLegato(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(DetachedLegato) + +inline DetachedLegatoPtr makeDetachedLegato() +{ + return std::make_shared(); } + +class DetachedLegato : public ElementInterface +{ + public: + DetachedLegato(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Diatonic.cpp b/Sourcecode/private/mx/core/elements/Diatonic.cpp index 6e9e6ef8f..2c91ba17a 100644 --- a/Sourcecode/private/mx/core/elements/Diatonic.cpp +++ b/Sourcecode/private/mx/core/elements/Diatonic.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Diatonic::Diatonic() - :myValue() - {} - - - Diatonic::Diatonic( const Integer& value ) - :myValue( value ) - {} - - - bool Diatonic::hasAttributes() const - { - return false; - } - - - bool Diatonic::hasContents() const - { - return true; - } - - - std::ostream& Diatonic::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Diatonic::streamName( std::ostream& os ) const - { - os << "diatonic"; - return os; - } +namespace core +{ +Diatonic::Diatonic() : myValue() +{ +} +Diatonic::Diatonic(const Integer &value) : myValue(value) +{ +} - std::ostream& Diatonic::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Diatonic::hasAttributes() const +{ + return false; +} +bool Diatonic::hasContents() const +{ + return true; +} - Integer Diatonic::getValue() const - { - return myValue; - } +std::ostream &Diatonic::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Diatonic::streamName(std::ostream &os) const +{ + os << "diatonic"; + return os; +} - void Diatonic::setValue( const Integer& value ) - { - myValue = value; - } +std::ostream &Diatonic::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Integer Diatonic::getValue() const +{ + return myValue; +} - bool Diatonic::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Diatonic::setValue(const Integer &value) +{ + myValue = value; +} - } +bool Diatonic::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Diatonic.h b/Sourcecode/private/mx/core/elements/Diatonic.h index c7014a3b8..9f690b4f2 100644 --- a/Sourcecode/private/mx/core/elements/Diatonic.h +++ b/Sourcecode/private/mx/core/elements/Diatonic.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Diatonic ) - - inline DiatonicPtr makeDiatonic() { return std::make_shared(); } - inline DiatonicPtr makeDiatonic( const Integer& value ) { return std::make_shared( value ); } - inline DiatonicPtr makeDiatonic( Integer&& value ) { return std::make_shared( std::move( value ) ); } - - class Diatonic : public ElementInterface - { - public: - Diatonic(); - Diatonic( const Integer& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Integer getValue() const; - void setValue( const Integer& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Integer myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Diatonic) + +inline DiatonicPtr makeDiatonic() +{ + return std::make_shared(); +} + +inline DiatonicPtr makeDiatonic(const Integer &value) +{ + return std::make_shared(value); } + +inline DiatonicPtr makeDiatonic(Integer &&value) +{ + return std::make_shared(std::move(value)); +} + +class Diatonic : public ElementInterface +{ + public: + Diatonic(); + Diatonic(const Integer &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Integer getValue() const; + void setValue(const Integer &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Integer myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Direction.cpp b/Sourcecode/private/mx/core/elements/Direction.cpp index 210142971..f137368a3 100644 --- a/Sourcecode/private/mx/core/elements/Direction.cpp +++ b/Sourcecode/private/mx/core/elements/Direction.cpp @@ -13,7 +13,6 @@ #include "mx/core/elements/Staff.h" #include "mx/core/elements/Voice.h" - #include "mx/core/elements/AccordionRegistration.h" #include "mx/core/elements/Bracket.h" #include "mx/core/elements/Coda.h" @@ -43,689 +42,639 @@ namespace { - - constexpr const size_t directionsSize = 22; - constexpr const char* const directions[] = - { - "rehearsal", - "segno", - "words", - "coda", - "wedge", - "dynamics", - "dashes", - "bracket", - "pedal", - "metronome", - "octave-shift", - "harp-pedals", - "damp", - "damp-all", - "eyeglasses", - "string-mute", - "scordatura", - "image", - "principal-voice", - "accordion-registration", - "percussion", - "other-direction" - }; - - - constexpr const size_t multiDirectionsSize = 6; - constexpr const char* const multiDirections[] = - { - "rehearsal", - "segno", - "words", - "coda", - "dynamics", - "percussion" - }; -} + +constexpr const size_t directionsSize = 22; +constexpr const char *const directions[] = {"rehearsal", "segno", "words", "coda", + "wedge", "dynamics", "dashes", "bracket", + "pedal", "metronome", "octave-shift", "harp-pedals", + "damp", "damp-all", "eyeglasses", "string-mute", + "scordatura", "image", "principal-voice", "accordion-registration", + "percussion", "other-direction"}; + +constexpr const size_t multiDirectionsSize = 6; +constexpr const char *const multiDirections[] = {"rehearsal", "segno", "words", "coda", "dynamics", "percussion"}; +} // namespace namespace mx { - namespace core - { - Direction::Direction() - :myAttributes( std::make_shared() ) - ,myDirectionTypeSet() - ,myOffset( makeOffset() ) - ,myHasOffset( false ) - ,myEditorialVoiceDirectionGroup( makeEditorialVoiceDirectionGroup() ) - ,myStaff( makeStaff() ) - ,myHasStaff( false ) - ,mySound( makeSound() ) - ,myHasSound( false ) - { - myDirectionTypeSet.push_back( makeDirectionType() ); - } +namespace core +{ +Direction::Direction() + : myAttributes(std::make_shared()), myDirectionTypeSet(), myOffset(makeOffset()), + myHasOffset(false), myEditorialVoiceDirectionGroup(makeEditorialVoiceDirectionGroup()), myStaff(makeStaff()), + myHasStaff(false), mySound(makeSound()), myHasSound(false) +{ + myDirectionTypeSet.push_back(makeDirectionType()); +} +bool Direction::hasAttributes() const +{ + return myAttributes->hasValues(); +} - bool Direction::hasAttributes() const - { - return myAttributes->hasValues(); - } +std::ostream &Direction::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Direction::streamName(std::ostream &os) const +{ + os << "direction"; + return os; +} - std::ostream& Direction::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +bool Direction::hasContents() const +{ + return true; +} +std::ostream &Direction::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto x : myDirectionTypeSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + if (myHasOffset) + { + os << std::endl; + myOffset->toStream(os, indentLevel + 1); + } + if (myEditorialVoiceDirectionGroup->hasContents()) + { + os << std::endl; + myEditorialVoiceDirectionGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + } + if (myHasStaff) + { + os << std::endl; + myStaff->toStream(os, indentLevel + 1); + } + if (myHasSound) + { + os << std::endl; + mySound->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} - std::ostream& Direction::streamName( std::ostream& os ) const - { - os << "direction"; - return os; - } +DirectionAttributesPtr Direction::getAttributes() const +{ + return myAttributes; +} +void Direction::setAttributes(const DirectionAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - bool Direction::hasContents() const - { - return true; - } +const DirectionTypeSet &Direction::getDirectionTypeSet() const +{ + return myDirectionTypeSet; +} +void Direction::addDirectionType(const DirectionTypePtr &value) +{ + if (value) + { + myDirectionTypeSet.push_back(value); + } +} - std::ostream& Direction::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const +void Direction::removeDirectionType(const DirectionTypeSetIterConst &value) +{ + if (value != myDirectionTypeSet.cend()) + { + if (myDirectionTypeSet.size() > 1) { - for ( auto x : myDirectionTypeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasOffset ) - { - os << std::endl; - myOffset->toStream( os, indentLevel+1 ); - } - if ( myEditorialVoiceDirectionGroup->hasContents() ) - { - os << std::endl; - myEditorialVoiceDirectionGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasStaff ) - { - os << std::endl; - myStaff->toStream( os, indentLevel+1 ); - } - if ( myHasSound ) - { - os << std::endl; - mySound->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; + myDirectionTypeSet.erase(value); } + } +} +void Direction::clearDirectionTypeSet() +{ + myDirectionTypeSet.clear(); + myDirectionTypeSet.push_back(makeDirectionType()); +} - DirectionAttributesPtr Direction::getAttributes() const - { - return myAttributes; - } +DirectionTypePtr Direction::getDirectionType(const DirectionTypeSetIterConst &setIterator) const +{ + if (setIterator != myDirectionTypeSet.cend()) + { + return *setIterator; + } + return DirectionTypePtr(); +} +OffsetPtr Direction::getOffset() const +{ + return myOffset; +} - void Direction::setAttributes( const DirectionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +void Direction::setOffset(const OffsetPtr &value) +{ + if (value) + { + myOffset = value; + } +} +bool Direction::getHasOffset() const +{ + return myHasOffset; +} - const DirectionTypeSet& Direction::getDirectionTypeSet() const - { - return myDirectionTypeSet; - } +void Direction::setHasOffset(const bool value) +{ + myHasOffset = value; +} +EditorialVoiceDirectionGroupPtr Direction::getEditorialVoiceDirectionGroup() const +{ + return myEditorialVoiceDirectionGroup; +} - void Direction::addDirectionType( const DirectionTypePtr& value ) - { - if ( value ) - { - myDirectionTypeSet.push_back( value ); - } - } +void Direction::setEditorialVoiceDirectionGroup(const EditorialVoiceDirectionGroupPtr &value) +{ + if (value) + { + myEditorialVoiceDirectionGroup = value; + } +} +StaffPtr Direction::getStaff() const +{ + return myStaff; +} - void Direction::removeDirectionType( const DirectionTypeSetIterConst& value ) - { - if ( value != myDirectionTypeSet.cend() ) - { - if( myDirectionTypeSet.size() > 1 ) - { - myDirectionTypeSet.erase( value ); - } - } - } +void Direction::setStaff(const StaffPtr &value) +{ + if (value) + { + myStaff = value; + } +} +bool Direction::getHasStaff() const +{ + return myHasStaff; +} - void Direction::clearDirectionTypeSet() - { - myDirectionTypeSet.clear(); - myDirectionTypeSet.push_back( makeDirectionType() ); - } +void Direction::setHasStaff(const bool value) +{ + myHasStaff = value; +} +SoundPtr Direction::getSound() const +{ + return mySound; +} - DirectionTypePtr Direction::getDirectionType( const DirectionTypeSetIterConst& setIterator ) const - { - if( setIterator != myDirectionTypeSet.cend() ) - { - return *setIterator; - } - return DirectionTypePtr(); - } +void Direction::setSound(const SoundPtr &value) +{ + if (value) + { + mySound = value; + } +} +bool Direction::getHasSound() const +{ + return myHasSound; +} - OffsetPtr Direction::getOffset() const - { - return myOffset; - } +void Direction::setHasSound(const bool value) +{ + myHasSound = value; +} +bool Direction::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isDirectionTypeFound = false; + isSuccess &= myAttributes->fromXElement(message, xelement); - void Direction::setOffset( const OffsetPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importDirectionTypeSet(message, it, endIter, isSuccess, isDirectionTypeFound)) { - if ( value ) - { - myOffset = value; - } + continue; } - - - bool Direction::getHasOffset() const + if (importElement(message, *it, isSuccess, *myOffset, myHasOffset)) { - return myHasOffset; + continue; } - - - void Direction::setHasOffset( const bool value ) + importGroup(message, it, endIter, isSuccess, myEditorialVoiceDirectionGroup); + if (importElement(message, *it, isSuccess, *myStaff, myHasStaff)) { - myHasOffset = value; + continue; } - - - EditorialVoiceDirectionGroupPtr Direction::getEditorialVoiceDirectionGroup() const + if (importElement(message, *it, isSuccess, *mySound, myHasSound)) { - return myEditorialVoiceDirectionGroup; + continue; } + } + MX_RETURN_IS_SUCCESS; +} - void Direction::setEditorialVoiceDirectionGroup( const EditorialVoiceDirectionGroupPtr& value ) - { - if ( value ) - { - myEditorialVoiceDirectionGroup = value; - } - } +bool Direction::importDirectionTypeSet(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess, bool &isFound) +{ + if (iter == endIter) + { + isFound = false; + return false; + } + if (iter->getName() != "direction-type") + { + isFound = false; + return false; + } - StaffPtr Direction::getStaff() const - { - return myStaff; - } + isFound = true; + bool isIterIncremented = false; + bool isFirstDirectionTypeAdded = false; + while ((iter != endIter) && (iter->getName() == "direction-type")) + { + auto subiter = iter->begin(); + auto subiterEnd = iter->end(); - void Direction::setStaff( const StaffPtr& value ) + auto directionType = createDirectionType(message, subiter, subiterEnd, isSuccess); + + if (!isFirstDirectionTypeAdded && myDirectionTypeSet.size() == 1) { - if ( value ) - { - myStaff = value; - } + *myDirectionTypeSet.begin() = directionType; + isFirstDirectionTypeAdded = true; } - - - bool Direction::getHasStaff() const + else { - return myHasStaff; + myDirectionTypeSet.push_back(directionType); + isFirstDirectionTypeAdded = true; } + isIterIncremented = true; + ++iter; + } - void Direction::setHasStaff( const bool value ) + if (isIterIncremented) + { + --iter; + } + return isFirstDirectionTypeAdded; +} + +bool Direction::isDirectionType(const std::string &elementName) const +{ + for (size_t i = 0; i < directionsSize; ++i) + { + if (strcmp(directions[i], elementName.c_str()) == 0) { - myHasStaff = value; + return true; } + } + return false; +} - - SoundPtr Direction::getSound() const +bool Direction::isMultiDirectionType(const std::string &elementName) const +{ + for (size_t i = 0; i < multiDirectionsSize; ++i) + { + if (strcmp(multiDirections[i], elementName.c_str()) == 0) { - return mySound; + return true; } + } + return false; +} +DirectionTypePtr Direction::createDirectionType(std::ostream &message, ::ezxml::XElementIterator &subIter, + ::ezxml::XElementIterator &subIterEnd, bool &isSuccess) +{ + auto directionType = makeDirectionType(); - void Direction::setSound( const SoundPtr& value ) - { - if ( value ) - { - mySound = value; - } - } + if (subIter == subIterEnd) + { + message << "Direction: well thats weird - should not get here" << std::endl; + isSuccess = false; + return directionType; + } + if (subIter->getName() == "wedge") + { + directionType->setChoice(DirectionType::Choice::wedge); + isSuccess &= directionType->getWedge()->fromXElement(message, *subIter); + return directionType; + } - bool Direction::getHasSound() const - { - return myHasSound; - } + if (subIter->getName() == "dashes") + { + directionType->setChoice(DirectionType::Choice::dashes); + isSuccess &= directionType->getDashes()->fromXElement(message, *subIter); + return directionType; + } + if (subIter->getName() == "bracket") + { + directionType->setChoice(DirectionType::Choice::bracket); + isSuccess &= directionType->getBracket()->fromXElement(message, *subIter); + return directionType; + } - void Direction::setHasSound( const bool value ) - { - myHasSound = value; - } - + if (subIter->getName() == "pedal") + { + directionType->setChoice(DirectionType::Choice::pedal); + isSuccess &= directionType->getPedal()->fromXElement(message, *subIter); + return directionType; + } - bool Direction::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isDirectionTypeFound = false; - isSuccess &= myAttributes->fromXElement( message, xelement ); + if (subIter->getName() == "metronome") + { + directionType->setChoice(DirectionType::Choice::metronome); + isSuccess &= directionType->getMetronome()->fromXElement(message, *subIter); + return directionType; + } - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importDirectionTypeSet( message, it, endIter, isSuccess, isDirectionTypeFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myOffset, myHasOffset ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialVoiceDirectionGroup ); - if ( importElement( message, *it, isSuccess, *myStaff, myHasStaff ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySound, myHasSound ) ) { continue; } - } + if (subIter->getName() == "octave-shift") + { + directionType->setChoice(DirectionType::Choice::octaveShift); + isSuccess &= directionType->getOctaveShift()->fromXElement(message, *subIter); + return directionType; + } - MX_RETURN_IS_SUCCESS; - } - - - bool Direction::importDirectionTypeSet( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess, bool& isFound ) + if (subIter->getName() == "harp-pedals") + { + directionType->setChoice(DirectionType::Choice::harpPedals); + isSuccess &= directionType->getHarpPedals()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "damp") + { + directionType->setChoice(DirectionType::Choice::damp); + isSuccess &= directionType->getDamp()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "damp-all") + { + directionType->setChoice(DirectionType::Choice::dampAll); + isSuccess &= directionType->getDampAll()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "eyeglasses") + { + directionType->setChoice(DirectionType::Choice::eyeglasses); + isSuccess &= directionType->getEyeglasses()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "string-mute") + { + directionType->setChoice(DirectionType::Choice::stringMute); + isSuccess &= directionType->getStringMute()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "scordatura") + { + directionType->setChoice(DirectionType::Choice::scordatura); + isSuccess &= directionType->getScordatura()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "image") + { + directionType->setChoice(DirectionType::Choice::image); + isSuccess &= directionType->getImage()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "principal-voice") + { + directionType->setChoice(DirectionType::Choice::principalVoice); + isSuccess &= directionType->getPrincipalVoice()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "accordion-registration") + { + directionType->setChoice(DirectionType::Choice::accordionRegistration); + isSuccess &= directionType->getAccordionRegistration()->fromXElement(message, *subIter); + return directionType; + } + + if (subIter->getName() == "other-direction") + { + directionType->setChoice(DirectionType::Choice::otherDirection); + isSuccess &= directionType->getOtherDirection()->fromXElement(message, *subIter); + return directionType; + } + + std::string name = "rehearsal"; + if (subIter->getName() == name) + { + directionType->setChoice(DirectionType::Choice::rehearsal); + bool isFirstSubItemAdded = false; + + while (subIter != subIterEnd) { - if( iter == endIter ) - { - isFound = false; - return false; - } - - if( iter->getName() != "direction-type" ) + if (subIter->getName() != name) { - isFound = false; - return false; - } - - isFound = true; - bool isIterIncremented = false; - bool isFirstDirectionTypeAdded = false; - - while( ( iter != endIter ) && ( iter->getName() == "direction-type" ) ) - { - auto subiter = iter->begin(); - auto subiterEnd = iter->end(); - - auto directionType = createDirectionType( message, subiter, subiterEnd, isSuccess ); - - if( !isFirstDirectionTypeAdded && myDirectionTypeSet.size() == 1 ) - { - *myDirectionTypeSet.begin() = directionType; - isFirstDirectionTypeAdded = true; - } - else - { - myDirectionTypeSet.push_back( directionType ); - isFirstDirectionTypeAdded = true; - } - - isIterIncremented = true; - ++iter; - } - - if( isIterIncremented ) - { - --iter; + message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() + << "' while parsing a collection of '" << name << "' elements" << std::endl; + isSuccess = false; + return directionType; } - return isFirstDirectionTypeAdded; - } - - - bool Direction::isDirectionType( const std::string& elementName ) const - { - for( size_t i = 0; i < directionsSize; ++i ) + auto itemToAdd = makeRehearsal(); + isSuccess &= itemToAdd->fromXElement(message, *subIter); + if (!isFirstSubItemAdded && directionType->getRehearsalSet().size() == 1) { - if( strcmp( directions[i], elementName.c_str() ) == 0 ) - { - return true; - } + directionType->addRehearsal(itemToAdd); + directionType->removeRehearsal(directionType->getRehearsalSet().cbegin()); } - return false; - } - - - bool Direction::isMultiDirectionType( const std::string& elementName ) const - { - for( size_t i = 0; i < multiDirectionsSize; ++i ) + else { - if( strcmp( multiDirections[i], elementName.c_str() ) == 0 ) - { - return true; - } + directionType->addRehearsal(itemToAdd); } - return false; - } - - - DirectionTypePtr Direction::createDirectionType( std::ostream& message, ::ezxml::XElementIterator& subIter, ::ezxml::XElementIterator& subIterEnd, bool& isSuccess ) + isFirstSubItemAdded = true; + ++subIter; + } // end loop + return directionType; + } // end rehearsal + + name = "segno"; + if (subIter->getName() == name) + { + directionType->setChoice(DirectionType::Choice::segno); + bool isFirstSubItemAdded = false; + + while (subIter != subIterEnd) { - auto directionType = makeDirectionType(); - - if( subIter == subIterEnd ) + if (subIter->getName() != name) { - message << "Direction: well thats weird - should not get here" << std::endl; + message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() + << "' while parsing a collection of '" << name << "' elements" << std::endl; isSuccess = false; return directionType; } - - if( subIter->getName() == "wedge" ) + auto itemToAdd = makeSegno(); + isSuccess &= itemToAdd->fromXElement(message, *subIter); + if (!isFirstSubItemAdded && directionType->getSegnoSet().size() == 1) { - directionType->setChoice( DirectionType::Choice::wedge ); - isSuccess &= directionType->getWedge()->fromXElement( message, *subIter ); - return directionType; + directionType->addSegno(itemToAdd); + directionType->removeSegno(directionType->getSegnoSet().cbegin()); } - - if( subIter->getName() == "dashes" ) + else { - directionType->setChoice( DirectionType::Choice::dashes ); - isSuccess &= directionType->getDashes()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "bracket" ) - { - directionType->setChoice( DirectionType::Choice::bracket ); - isSuccess &= directionType->getBracket()->fromXElement( message, *subIter ); - return directionType; + directionType->addSegno(itemToAdd); } - - if( subIter->getName() == "pedal" ) + isFirstSubItemAdded = true; + ++subIter; + } // end loop + return directionType; + } // end segno + + name = "words"; + if (subIter->getName() == name) + { + directionType->setChoice(DirectionType::Choice::words); + bool isFirstSubItemAdded = false; + + while (subIter != subIterEnd) + { + if (subIter->getName() != name) { - directionType->setChoice( DirectionType::Choice::pedal ); - isSuccess &= directionType->getPedal()->fromXElement( message, *subIter ); + message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() + << "' while parsing a collection of '" << name << "' elements" << std::endl; + isSuccess = false; return directionType; } - - if( subIter->getName() == "metronome" ) + auto itemToAdd = makeWords(); + isSuccess &= itemToAdd->fromXElement(message, *subIter); + if (!isFirstSubItemAdded && directionType->getWordsSet().size() == 1) { - directionType->setChoice( DirectionType::Choice::metronome ); - isSuccess &= directionType->getMetronome()->fromXElement( message, *subIter ); - return directionType; + directionType->addWords(itemToAdd); + directionType->removeWords(directionType->getWordsSet().cbegin()); } - - if( subIter->getName() == "octave-shift" ) + else { - directionType->setChoice( DirectionType::Choice::octaveShift ); - isSuccess &= directionType->getOctaveShift()->fromXElement( message, *subIter ); - return directionType; + directionType->addWords(itemToAdd); } - - if( subIter->getName() == "harp-pedals" ) - { - directionType->setChoice( DirectionType::Choice::harpPedals ); - isSuccess &= directionType->getHarpPedals()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "damp" ) + isFirstSubItemAdded = true; + ++subIter; + } // end loop + return directionType; + } // end words + + name = "coda"; + if (subIter->getName() == name) + { + directionType->setChoice(DirectionType::Choice::coda); + bool isFirstSubItemAdded = false; + + while (subIter != subIterEnd) + { + if (subIter->getName() != name) { - directionType->setChoice( DirectionType::Choice::damp ); - isSuccess &= directionType->getDamp()->fromXElement( message, *subIter ); + message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() + << "' while parsing a collection of '" << name << "' elements" << std::endl; + isSuccess = false; return directionType; } - - if( subIter->getName() == "damp-all" ) + auto itemToAdd = makeCoda(); + isSuccess &= itemToAdd->fromXElement(message, *subIter); + if (!isFirstSubItemAdded && directionType->getCodaSet().size() == 1) { - directionType->setChoice( DirectionType::Choice::dampAll ); - isSuccess &= directionType->getDampAll()->fromXElement( message, *subIter ); - return directionType; + directionType->addCoda(itemToAdd); + directionType->removeCoda(directionType->getCodaSet().cbegin()); } - - if( subIter->getName() == "eyeglasses" ) + else { - directionType->setChoice( DirectionType::Choice::eyeglasses ); - isSuccess &= directionType->getEyeglasses()->fromXElement( message, *subIter ); - return directionType; + directionType->addCoda(itemToAdd); } - - if( subIter->getName() == "string-mute" ) + isFirstSubItemAdded = true; + ++subIter; + } // end loop + return directionType; + } // end coda + + name = "dynamics"; + if (subIter->getName() == name) + { + directionType->setChoice(DirectionType::Choice::dynamics); + bool isFirstSubItemAdded = false; + + while (subIter != subIterEnd) + { + if (subIter->getName() != name) { - directionType->setChoice( DirectionType::Choice::stringMute ); - isSuccess &= directionType->getStringMute()->fromXElement( message, *subIter ); + message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() + << "' while parsing a collection of '" << name << "' elements" << std::endl; + isSuccess = false; return directionType; } - - if( subIter->getName() == "scordatura" ) + auto itemToAdd = makeDynamics(); + isSuccess &= itemToAdd->fromXElement(message, *subIter); + if (!isFirstSubItemAdded && directionType->getDynamicsSet().size() == 1) { - directionType->setChoice( DirectionType::Choice::scordatura ); - isSuccess &= directionType->getScordatura()->fromXElement( message, *subIter ); - return directionType; + directionType->addDynamics(itemToAdd); + directionType->removeDynamics(directionType->getDynamicsSet().cbegin()); } - - if( subIter->getName() == "image" ) + else { - directionType->setChoice( DirectionType::Choice::image ); - isSuccess &= directionType->getImage()->fromXElement( message, *subIter ); - return directionType; + directionType->addDynamics(itemToAdd); } - - if( subIter->getName() == "principal-voice" ) + isFirstSubItemAdded = true; + ++subIter; + } // end loop + return directionType; + } // end dynamics + + name = "percussion"; + if (subIter->getName() == name) + { + directionType->setChoice(DirectionType::Choice::percussion); + bool isFirstSubItemAdded = false; + + while (subIter != subIterEnd) + { + if (subIter->getName() != name) { - directionType->setChoice( DirectionType::Choice::principalVoice ); - isSuccess &= directionType->getPrincipalVoice()->fromXElement( message, *subIter ); + message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() + << "' while parsing a collection of '" << name << "' elements" << std::endl; + isSuccess = false; return directionType; } - - if( subIter->getName() == "accordion-registration" ) + auto itemToAdd = makePercussion(); + isSuccess &= itemToAdd->fromXElement(message, *subIter); + if (!isFirstSubItemAdded && directionType->getPercussionSet().size() == 1) { - directionType->setChoice( DirectionType::Choice::accordionRegistration ); - isSuccess &= directionType->getAccordionRegistration()->fromXElement( message, *subIter ); - return directionType; + directionType->addPercussion(itemToAdd); + directionType->removePercussion(directionType->getPercussionSet().cbegin()); } - - if( subIter->getName() == "other-direction" ) + else { - directionType->setChoice( DirectionType::Choice::otherDirection ); - isSuccess &= directionType->getOtherDirection()->fromXElement( message, *subIter ); - return directionType; + directionType->addPercussion(itemToAdd); } - - std::string name = "rehearsal"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::rehearsal ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeRehearsal(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getRehearsalSet().size() == 1 ) - { - directionType->addRehearsal( itemToAdd ); - directionType->removeRehearsal( directionType->getRehearsalSet().cbegin() ); - } - else - { - directionType->addRehearsal( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end rehearsal - - - name = "segno"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::segno ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeSegno(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getSegnoSet().size() == 1 ) - { - directionType->addSegno( itemToAdd ); - directionType->removeSegno( directionType->getSegnoSet().cbegin() ); - } - else - { - directionType->addSegno( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end segno - - - name = "words"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::words ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeWords(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getWordsSet().size() == 1 ) - { - directionType->addWords( itemToAdd ); - directionType->removeWords( directionType->getWordsSet().cbegin() ); - } - else - { - directionType->addWords( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end words - - - name = "coda"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::coda ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeCoda(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getCodaSet().size() == 1 ) - { - directionType->addCoda( itemToAdd ); - directionType->removeCoda( directionType->getCodaSet().cbegin() ); - } - else - { - directionType->addCoda( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end coda - - - name = "dynamics"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::dynamics ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeDynamics(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getDynamicsSet().size() == 1 ) - { - directionType->addDynamics( itemToAdd ); - directionType->removeDynamics( directionType->getDynamicsSet().cbegin() ); - } - else - { - directionType->addDynamics( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end dynamics - - - name = "percussion"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::percussion ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makePercussion(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getPercussionSet().size() == 1 ) - { - directionType->addPercussion( itemToAdd ); - directionType->removePercussion( directionType->getPercussionSet().cbegin() ); - } - else - { - directionType->addPercussion( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end percussion + isFirstSubItemAdded = true; + ++subIter; + } // end loop + return directionType; + } // end percussion - return directionType; - } - - } + return directionType; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Direction.h b/Sourcecode/private/mx/core/elements/Direction.h index 9e56128f3..2b84438e2 100644 --- a/Sourcecode/private/mx/core/elements/Direction.h +++ b/Sourcecode/private/mx/core/elements/Direction.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DirectionAttributes.h" #include @@ -14,86 +14,90 @@ namespace ezxml { - class XElementIterator; +class XElementIterator; } namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DirectionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DirectionType ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceDirectionGroup ) - MX_FORWARD_DECLARE_ELEMENT( Offset ) - MX_FORWARD_DECLARE_ELEMENT( Sound ) - MX_FORWARD_DECLARE_ELEMENT( Staff ) - MX_FORWARD_DECLARE_ELEMENT( Direction ) - - inline DirectionPtr makeDirection() { return std::make_shared(); } - - class Direction : public ElementInterface - { - public: - Direction(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DirectionAttributesPtr getAttributes() const; - void setAttributes( const DirectionAttributesPtr& value ); - - /* _________ DirectionType minOccurs = 1, maxOccurs = unbounded _________ */ - const DirectionTypeSet& getDirectionTypeSet() const; - void addDirectionType( const DirectionTypePtr& value ); - void removeDirectionType( const DirectionTypeSetIterConst& value ); - void clearDirectionTypeSet(); - DirectionTypePtr getDirectionType( const DirectionTypeSetIterConst& setIterator ) const; - - /* _________ Offset minOccurs = 0, maxOccurs = 1 _________ */ - OffsetPtr getOffset() const; - void setOffset( const OffsetPtr& value ); - bool getHasOffset() const; - void setHasOffset( const bool value ); - - /* _________ EditorialVoiceDirectionGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialVoiceDirectionGroupPtr getEditorialVoiceDirectionGroup() const; - void setEditorialVoiceDirectionGroup( const EditorialVoiceDirectionGroupPtr& value ); - - /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ - StaffPtr getStaff() const; - void setStaff( const StaffPtr& value ); - bool getHasStaff() const; - void setHasStaff( const bool value ); - - /* _________ Sound minOccurs = 0, maxOccurs = 1 _________ */ - SoundPtr getSound() const; - void setSound( const SoundPtr& value ); - bool getHasSound() const; - void setHasSound( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DirectionAttributesPtr myAttributes; - DirectionTypeSet myDirectionTypeSet; - OffsetPtr myOffset; - bool myHasOffset; - EditorialVoiceDirectionGroupPtr myEditorialVoiceDirectionGroup; - StaffPtr myStaff; - bool myHasStaff; - SoundPtr mySound; - bool myHasSound; - - bool importDirectionTypeSet( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess, bool& isFound ); - DirectionTypePtr createDirectionType( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ); - - bool isDirectionType( const std::string& elementName ) const; - bool isMultiDirectionType( const std::string& elementName ) const; - - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DirectionAttributes) +MX_FORWARD_DECLARE_ELEMENT(DirectionType) +MX_FORWARD_DECLARE_ELEMENT(EditorialVoiceDirectionGroup) +MX_FORWARD_DECLARE_ELEMENT(Offset) +MX_FORWARD_DECLARE_ELEMENT(Sound) +MX_FORWARD_DECLARE_ELEMENT(Staff) +MX_FORWARD_DECLARE_ELEMENT(Direction) + +inline DirectionPtr makeDirection() +{ + return std::make_shared(); } + +class Direction : public ElementInterface +{ + public: + Direction(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DirectionAttributesPtr getAttributes() const; + void setAttributes(const DirectionAttributesPtr &value); + + /* _________ DirectionType minOccurs = 1, maxOccurs = unbounded _________ */ + const DirectionTypeSet &getDirectionTypeSet() const; + void addDirectionType(const DirectionTypePtr &value); + void removeDirectionType(const DirectionTypeSetIterConst &value); + void clearDirectionTypeSet(); + DirectionTypePtr getDirectionType(const DirectionTypeSetIterConst &setIterator) const; + + /* _________ Offset minOccurs = 0, maxOccurs = 1 _________ */ + OffsetPtr getOffset() const; + void setOffset(const OffsetPtr &value); + bool getHasOffset() const; + void setHasOffset(const bool value); + + /* _________ EditorialVoiceDirectionGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialVoiceDirectionGroupPtr getEditorialVoiceDirectionGroup() const; + void setEditorialVoiceDirectionGroup(const EditorialVoiceDirectionGroupPtr &value); + + /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ + StaffPtr getStaff() const; + void setStaff(const StaffPtr &value); + bool getHasStaff() const; + void setHasStaff(const bool value); + + /* _________ Sound minOccurs = 0, maxOccurs = 1 _________ */ + SoundPtr getSound() const; + void setSound(const SoundPtr &value); + bool getHasSound() const; + void setHasSound(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DirectionAttributesPtr myAttributes; + DirectionTypeSet myDirectionTypeSet; + OffsetPtr myOffset; + bool myHasOffset; + EditorialVoiceDirectionGroupPtr myEditorialVoiceDirectionGroup; + StaffPtr myStaff; + bool myHasStaff; + SoundPtr mySound; + bool myHasSound; + + bool importDirectionTypeSet(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess, bool &isFound); + DirectionTypePtr createDirectionType(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess); + + bool isDirectionType(const std::string &elementName) const; + bool isMultiDirectionType(const std::string &elementName) const; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DirectionAttributes.cpp b/Sourcecode/private/mx/core/elements/DirectionAttributes.cpp index 91189d6dd..dafff837c 100644 --- a/Sourcecode/private/mx/core/elements/DirectionAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DirectionAttributes.cpp @@ -8,51 +8,50 @@ namespace mx { - namespace core - { - DirectionAttributes::DirectionAttributes() - :placement( AboveBelow::below ) - ,directive( YesNo::no ) - ,hasPlacement( false ) - ,hasDirective( false ) - {} +namespace core +{ +DirectionAttributes::DirectionAttributes() + : placement(AboveBelow::below), directive(YesNo::no), hasPlacement(false), hasDirective(false) +{ +} +bool DirectionAttributes::hasValues() const +{ + return hasPlacement || hasDirective; +} - bool DirectionAttributes::hasValues() const - { - return hasPlacement || - hasDirective; - } +std::ostream &DirectionAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, directive, "directive", hasDirective); + } + return os; +} +bool DirectionAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DirectionAttributes"; + bool isSuccess = true; - std::ostream& DirectionAttributes::toStream( std::ostream& os ) const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) { - if ( hasValues() ) - { - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, directive, "directive", hasDirective ); - } - return os; + continue; } - - - bool DirectionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, directive, hasDirective, "directive", &parseYesNo)) { - const char* const className = "DirectionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, directive, hasDirective, "directive", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DirectionAttributes.h b/Sourcecode/private/mx/core/elements/DirectionAttributes.h index 80a611eb2..711995488 100644 --- a/Sourcecode/private/mx/core/elements/DirectionAttributes.h +++ b/Sourcecode/private/mx/core/elements/DirectionAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,24 +14,24 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DirectionAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DirectionAttributes) - struct DirectionAttributes : public AttributesInterface - { - public: - DirectionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - AboveBelow placement; - YesNo directive; - bool hasPlacement; - bool hasDirective; +struct DirectionAttributes : public AttributesInterface +{ + public: + DirectionAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + AboveBelow placement; + YesNo directive; + bool hasPlacement; + bool hasDirective; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DirectionType.cpp b/Sourcecode/private/mx/core/elements/DirectionType.cpp index b6a664d9f..e83fdbb90 100644 --- a/Sourcecode/private/mx/core/elements/DirectionType.cpp +++ b/Sourcecode/private/mx/core/elements/DirectionType.cpp @@ -30,770 +30,661 @@ namespace mx { - namespace core - { - DirectionType::DirectionType() - :myChoice( Choice::rehearsal ) - ,myRehearsalSet() - ,mySegnoSet() - ,myWordsSet() - ,myCodaSet() - ,myWedge( makeWedge() ) - ,myDynamicsSet() - ,myDashes( makeDashes() ) - ,myBracket( makeBracket() ) - ,myPedal( makePedal() ) - ,myMetronome( makeMetronome() ) - ,myOctaveShift( makeOctaveShift() ) - ,myHarpPedals( makeHarpPedals() ) - ,myDamp( makeDamp() ) - ,myDampAll( makeDampAll() ) - ,myEyeglasses( makeEyeglasses() ) - ,myStringMute( makeStringMute() ) - ,myScordatura( makeScordatura() ) - ,myImage( makeImage() ) - ,myPrincipalVoice( makePrincipalVoice() ) - ,myAccordionRegistration( makeAccordionRegistration() ) - ,myPercussionSet() - ,myOtherDirection( makeOtherDirection() ) - { - myRehearsalSet.push_back( makeRehearsal() ); - mySegnoSet.push_back( makeSegno() ); - myWordsSet.push_back( makeWords() ); - myCodaSet.push_back( makeCoda() ); - myDynamicsSet.push_back( makeDynamics() ); - myPercussionSet.push_back( makePercussion() ); - } - - - bool DirectionType::hasAttributes() const - { - return false; - } - - - std::ostream& DirectionType::streamAttributes( std::ostream& os ) const - { - return os; - } - +namespace core +{ +DirectionType::DirectionType() + : myChoice(Choice::rehearsal), myRehearsalSet(), mySegnoSet(), myWordsSet(), myCodaSet(), myWedge(makeWedge()), + myDynamicsSet(), myDashes(makeDashes()), myBracket(makeBracket()), myPedal(makePedal()), + myMetronome(makeMetronome()), myOctaveShift(makeOctaveShift()), myHarpPedals(makeHarpPedals()), + myDamp(makeDamp()), myDampAll(makeDampAll()), myEyeglasses(makeEyeglasses()), myStringMute(makeStringMute()), + myScordatura(makeScordatura()), myImage(makeImage()), myPrincipalVoice(makePrincipalVoice()), + myAccordionRegistration(makeAccordionRegistration()), myPercussionSet(), myOtherDirection(makeOtherDirection()) +{ + myRehearsalSet.push_back(makeRehearsal()); + mySegnoSet.push_back(makeSegno()); + myWordsSet.push_back(makeWords()); + myCodaSet.push_back(makeCoda()); + myDynamicsSet.push_back(makeDynamics()); + myPercussionSet.push_back(makePercussion()); +} - std::ostream& DirectionType::streamName( std::ostream& os ) const - { - os << "direction-type"; - return os; - } +bool DirectionType::hasAttributes() const +{ + return false; +} +std::ostream &DirectionType::streamAttributes(std::ostream &os) const +{ + return os; +} - bool DirectionType::hasContents() const - { - return true; - } +std::ostream &DirectionType::streamName(std::ostream &os) const +{ + os << "direction-type"; + return os; +} +bool DirectionType::hasContents() const +{ + return true; +} - std::ostream& DirectionType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const +std::ostream &DirectionType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + // streamOpenTag( os ); + // os << std::endl; + switch (myChoice) + { + case Choice::rehearsal: { + for (auto x : myRehearsalSet) { - isOneLineOnly = false; - //streamOpenTag( os ); - //os << std::endl; - switch ( myChoice ) - { - case Choice::rehearsal: - { - for( auto x : myRehearsalSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::segno: - { - for( auto x : mySegnoSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::words: - { - for( auto x : myWordsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::coda: - { - for( auto x : myCodaSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::wedge: - { - os << std::endl; - myWedge->toStream( os, indentLevel+1 ); - } - break; - case Choice::dynamics: - { - for( auto x : myDynamicsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::dashes: - { - os << std::endl; - myDashes->toStream( os, indentLevel+1 ); - } - break; - case Choice::bracket: - { - os << std::endl; - myBracket->toStream( os, indentLevel+1 ); - } - break; - case Choice::pedal: - { - os << std::endl; - myPedal->toStream( os, indentLevel+1 ); - } - break; - case Choice::metronome: - { - os << std::endl; - myMetronome->toStream( os, indentLevel+1 ); - } - break; - case Choice::octaveShift: - { - os << std::endl; - myOctaveShift->toStream( os, indentLevel+1 ); - } - break; - case Choice::harpPedals: - { - os << std::endl; - myHarpPedals->toStream( os, indentLevel+1 ); - } - break; - case Choice::damp: - { - os << std::endl; - myDamp->toStream( os, indentLevel+1 ); - } - break; - case Choice::dampAll: - { - os << std::endl; - myDampAll->toStream( os, indentLevel+1 ); - } - break; - case Choice::eyeglasses: - { - os << std::endl; - myEyeglasses->toStream( os, indentLevel+1 ); - } - break; - case Choice::stringMute: - { - os << std::endl; - myStringMute->toStream( os, indentLevel+1 ); - } - break; - case Choice::scordatura: - { - os << std::endl; - myScordatura->toStream( os, indentLevel+1 ); - } - break; - case Choice::image: - { - os << std::endl; - myImage->toStream( os, indentLevel+1 ); - } - break; - case Choice::principalVoice: - { - os << std::endl; - myPrincipalVoice->toStream( os, indentLevel+1 ); - } - break; - case Choice::accordionRegistration: - { - os << std::endl; - myAccordionRegistration->toStream( os, indentLevel+1 ); - } - break; - case Choice::percussion: - { - for( auto x : myPercussionSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::otherDirection: - { - os << std::endl; - myOtherDirection->toStream( os, indentLevel+1 ); - } - break; - default: - break; - } - //os << std::endl; - //streamCloseTag( os ); os << std::endl; - isOneLineOnly = false; - return os; - } - - - DirectionType::Choice DirectionType::getChoice() const - { - return myChoice; - } - - - void DirectionType::setChoice( const DirectionType::Choice value ) - { - myChoice = value; - } - - - const RehearsalSet& DirectionType::getRehearsalSet() const - { - return myRehearsalSet; - } - - - void DirectionType::removeRehearsal( const RehearsalSetIterConst& value ) - { - if ( value != myRehearsalSet.cend() ) - { - if ( myRehearsalSet.size() > 1 ) - { - myRehearsalSet.erase( value ); - } - } - } - - - void DirectionType::addRehearsal( const RehearsalPtr& value ) - { - if ( value ) - { - myRehearsalSet.push_back( value ); - } - } - - - void DirectionType::clearRehearsalSet() - { - myRehearsalSet.clear(); - while( myRehearsalSet.size() < 1 ) - { - myRehearsalSet.push_back( makeRehearsal() ); - } - } - - - RehearsalPtr DirectionType::getRehearsal( const RehearsalSetIterConst& setIterator ) const - { - if( setIterator != myRehearsalSet.cend() ) - { - return *setIterator; - } - return RehearsalPtr(); - } - - - const SegnoSet& DirectionType::getSegnoSet() const - { - return mySegnoSet; - } - - - void DirectionType::removeSegno( const SegnoSetIterConst& value ) - { - if ( value != mySegnoSet.cend() ) - { - if ( mySegnoSet.size() > 1 ) - { - mySegnoSet.erase( value ); - } - } - } - - - void DirectionType::addSegno( const SegnoPtr& value ) - { - if ( value ) - { - mySegnoSet.push_back( value ); - } - } - - - void DirectionType::clearSegnoSet() - { - mySegnoSet.clear(); - while( mySegnoSet.size() < 1 ) - { - mySegnoSet.push_back( makeSegno() ); - } - } - - - SegnoPtr DirectionType::getSegno( const SegnoSetIterConst& setIterator ) const - { - if( setIterator != mySegnoSet.cend() ) - { - return *setIterator; - } - return SegnoPtr(); + x->toStream(os, indentLevel + 1); } - - - const WordsSet& DirectionType::getWordsSet() const - { - return myWordsSet; - } - - - void DirectionType::removeWords( const WordsSetIterConst& value ) - { - if ( value != myWordsSet.cend() ) - { - if ( myWordsSet.size() > 1 ) - { - myWordsSet.erase( value ); - } - } - } - - - void DirectionType::addWords( const WordsPtr& value ) - { - if ( value ) - { - myWordsSet.push_back( value ); - } - } - - - void DirectionType::clearWordsSet() - { - myWordsSet.clear(); - while( myWordsSet.size() < 1 ) - { - myWordsSet.push_back( makeWords() ); - } - } - - - WordsPtr DirectionType::getWords( const WordsSetIterConst& setIterator ) const - { - if( setIterator != myWordsSet.cend() ) - { - return *setIterator; - } - return WordsPtr(); - } - - - const CodaSet& DirectionType::getCodaSet() const - { - return myCodaSet; - } - - - void DirectionType::removeCoda( const CodaSetIterConst& value ) - { - if ( value != myCodaSet.cend() ) - { - if ( myCodaSet.size() > 1 ) - { - myCodaSet.erase( value ); - } - } - } - - - void DirectionType::addCoda( const CodaPtr& value ) - { - if ( value ) - { - myCodaSet.push_back( value ); - } - } - - - void DirectionType::clearCodaSet() - { - myCodaSet.clear(); - while( myCodaSet.size() < 1 ) - { - myCodaSet.push_back( makeCoda() ); - } - } - - - CodaPtr DirectionType::getCoda( const CodaSetIterConst& setIterator ) const - { - if( setIterator != myCodaSet.cend() ) - { - return *setIterator; - } - return CodaPtr(); - } - - - WedgePtr DirectionType::getWedge() const - { - return myWedge; - } - - - void DirectionType::setWedge( const WedgePtr& value ) - { - if( value ) - { - myWedge = value; - } - } - - - const DynamicsSet& DirectionType::getDynamicsSet() const - { - return myDynamicsSet; - } - - - void DirectionType::removeDynamics( const DynamicsSetIterConst& value ) - { - if ( value != myDynamicsSet.cend() ) - { - if ( myDynamicsSet.size() > 1 ) - { - myDynamicsSet.erase( value ); - } - } - } - - - void DirectionType::addDynamics( const DynamicsPtr& value ) + } + break; + case Choice::segno: { + for (auto x : mySegnoSet) { - if ( value ) - { - myDynamicsSet.push_back( value ); - } + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - void DirectionType::clearDynamicsSet() + } + break; + case Choice::words: { + for (auto x : myWordsSet) { - myDynamicsSet.clear(); - while( myDynamicsSet.size() < 1 ) - { - myDynamicsSet.push_back( makeDynamics() ); - } + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - DynamicsPtr DirectionType::getDynamics( const DynamicsSetIterConst& setIterator ) const + } + break; + case Choice::coda: { + for (auto x : myCodaSet) { - if( setIterator != myDynamicsSet.cend() ) - { - return *setIterator; - } - return DynamicsPtr(); + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - DashesPtr DirectionType::getDashes() const + } + break; + case Choice::wedge: { + os << std::endl; + myWedge->toStream(os, indentLevel + 1); + } + break; + case Choice::dynamics: { + for (auto x : myDynamicsSet) { - return myDashes; + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - void DirectionType::setDashes( const DashesPtr& value ) + } + break; + case Choice::dashes: { + os << std::endl; + myDashes->toStream(os, indentLevel + 1); + } + break; + case Choice::bracket: { + os << std::endl; + myBracket->toStream(os, indentLevel + 1); + } + break; + case Choice::pedal: { + os << std::endl; + myPedal->toStream(os, indentLevel + 1); + } + break; + case Choice::metronome: { + os << std::endl; + myMetronome->toStream(os, indentLevel + 1); + } + break; + case Choice::octaveShift: { + os << std::endl; + myOctaveShift->toStream(os, indentLevel + 1); + } + break; + case Choice::harpPedals: { + os << std::endl; + myHarpPedals->toStream(os, indentLevel + 1); + } + break; + case Choice::damp: { + os << std::endl; + myDamp->toStream(os, indentLevel + 1); + } + break; + case Choice::dampAll: { + os << std::endl; + myDampAll->toStream(os, indentLevel + 1); + } + break; + case Choice::eyeglasses: { + os << std::endl; + myEyeglasses->toStream(os, indentLevel + 1); + } + break; + case Choice::stringMute: { + os << std::endl; + myStringMute->toStream(os, indentLevel + 1); + } + break; + case Choice::scordatura: { + os << std::endl; + myScordatura->toStream(os, indentLevel + 1); + } + break; + case Choice::image: { + os << std::endl; + myImage->toStream(os, indentLevel + 1); + } + break; + case Choice::principalVoice: { + os << std::endl; + myPrincipalVoice->toStream(os, indentLevel + 1); + } + break; + case Choice::accordionRegistration: { + os << std::endl; + myAccordionRegistration->toStream(os, indentLevel + 1); + } + break; + case Choice::percussion: { + for (auto x : myPercussionSet) { - if( value ) - { - myDashes = value; - } + os << std::endl; + x->toStream(os, indentLevel + 1); } + } + break; + case Choice::otherDirection: { + os << std::endl; + myOtherDirection->toStream(os, indentLevel + 1); + } + break; + default: + break; + } + // os << std::endl; + // streamCloseTag( os ); + os << std::endl; + isOneLineOnly = false; + return os; +} +DirectionType::Choice DirectionType::getChoice() const +{ + return myChoice; +} - BracketPtr DirectionType::getBracket() const - { - return myBracket; - } +void DirectionType::setChoice(const DirectionType::Choice value) +{ + myChoice = value; +} +const RehearsalSet &DirectionType::getRehearsalSet() const +{ + return myRehearsalSet; +} - void DirectionType::setBracket( const BracketPtr& value ) +void DirectionType::removeRehearsal(const RehearsalSetIterConst &value) +{ + if (value != myRehearsalSet.cend()) + { + if (myRehearsalSet.size() > 1) { - if( value ) - { - myBracket = value; - } + myRehearsalSet.erase(value); } + } +} +void DirectionType::addRehearsal(const RehearsalPtr &value) +{ + if (value) + { + myRehearsalSet.push_back(value); + } +} - PedalPtr DirectionType::getPedal() const - { - return myPedal; - } - +void DirectionType::clearRehearsalSet() +{ + myRehearsalSet.clear(); + while (myRehearsalSet.size() < 1) + { + myRehearsalSet.push_back(makeRehearsal()); + } +} - void DirectionType::setPedal( const PedalPtr& value ) - { - if( value ) - { - myPedal = value; - } - } +RehearsalPtr DirectionType::getRehearsal(const RehearsalSetIterConst &setIterator) const +{ + if (setIterator != myRehearsalSet.cend()) + { + return *setIterator; + } + return RehearsalPtr(); +} +const SegnoSet &DirectionType::getSegnoSet() const +{ + return mySegnoSet; +} - MetronomePtr DirectionType::getMetronome() const +void DirectionType::removeSegno(const SegnoSetIterConst &value) +{ + if (value != mySegnoSet.cend()) + { + if (mySegnoSet.size() > 1) { - return myMetronome; + mySegnoSet.erase(value); } + } +} +void DirectionType::addSegno(const SegnoPtr &value) +{ + if (value) + { + mySegnoSet.push_back(value); + } +} - void DirectionType::setMetronome( const MetronomePtr& value ) - { - if( value ) - { - myMetronome = value; - } - } - +void DirectionType::clearSegnoSet() +{ + mySegnoSet.clear(); + while (mySegnoSet.size() < 1) + { + mySegnoSet.push_back(makeSegno()); + } +} - OctaveShiftPtr DirectionType::getOctaveShift() const - { - return myOctaveShift; - } +SegnoPtr DirectionType::getSegno(const SegnoSetIterConst &setIterator) const +{ + if (setIterator != mySegnoSet.cend()) + { + return *setIterator; + } + return SegnoPtr(); +} +const WordsSet &DirectionType::getWordsSet() const +{ + return myWordsSet; +} - void DirectionType::setOctaveShift( const OctaveShiftPtr& value ) +void DirectionType::removeWords(const WordsSetIterConst &value) +{ + if (value != myWordsSet.cend()) + { + if (myWordsSet.size() > 1) { - if( value ) - { - myOctaveShift = value; - } + myWordsSet.erase(value); } + } +} +void DirectionType::addWords(const WordsPtr &value) +{ + if (value) + { + myWordsSet.push_back(value); + } +} - HarpPedalsPtr DirectionType::getHarpPedals() const - { - return myHarpPedals; - } - +void DirectionType::clearWordsSet() +{ + myWordsSet.clear(); + while (myWordsSet.size() < 1) + { + myWordsSet.push_back(makeWords()); + } +} - void DirectionType::setHarpPedals( const HarpPedalsPtr& value ) - { - if( value ) - { - myHarpPedals = value; - } - } +WordsPtr DirectionType::getWords(const WordsSetIterConst &setIterator) const +{ + if (setIterator != myWordsSet.cend()) + { + return *setIterator; + } + return WordsPtr(); +} +const CodaSet &DirectionType::getCodaSet() const +{ + return myCodaSet; +} - DampPtr DirectionType::getDamp() const +void DirectionType::removeCoda(const CodaSetIterConst &value) +{ + if (value != myCodaSet.cend()) + { + if (myCodaSet.size() > 1) { - return myDamp; + myCodaSet.erase(value); } + } +} +void DirectionType::addCoda(const CodaPtr &value) +{ + if (value) + { + myCodaSet.push_back(value); + } +} - void DirectionType::setDamp( const DampPtr& value ) - { - if( value ) - { - myDamp = value; - } - } - +void DirectionType::clearCodaSet() +{ + myCodaSet.clear(); + while (myCodaSet.size() < 1) + { + myCodaSet.push_back(makeCoda()); + } +} - DampAllPtr DirectionType::getDampAll() const - { - return myDampAll; - } +CodaPtr DirectionType::getCoda(const CodaSetIterConst &setIterator) const +{ + if (setIterator != myCodaSet.cend()) + { + return *setIterator; + } + return CodaPtr(); +} +WedgePtr DirectionType::getWedge() const +{ + return myWedge; +} - void DirectionType::setDampAll( const DampAllPtr& value ) - { - if( value ) - { - myDampAll = value; - } - } +void DirectionType::setWedge(const WedgePtr &value) +{ + if (value) + { + myWedge = value; + } +} +const DynamicsSet &DirectionType::getDynamicsSet() const +{ + return myDynamicsSet; +} - EyeglassesPtr DirectionType::getEyeglasses() const +void DirectionType::removeDynamics(const DynamicsSetIterConst &value) +{ + if (value != myDynamicsSet.cend()) + { + if (myDynamicsSet.size() > 1) { - return myEyeglasses; + myDynamicsSet.erase(value); } + } +} +void DirectionType::addDynamics(const DynamicsPtr &value) +{ + if (value) + { + myDynamicsSet.push_back(value); + } +} - void DirectionType::setEyeglasses( const EyeglassesPtr& value ) - { - if( value ) - { - myEyeglasses = value; - } - } - +void DirectionType::clearDynamicsSet() +{ + myDynamicsSet.clear(); + while (myDynamicsSet.size() < 1) + { + myDynamicsSet.push_back(makeDynamics()); + } +} - StringMutePtr DirectionType::getStringMute() const - { - return myStringMute; - } +DynamicsPtr DirectionType::getDynamics(const DynamicsSetIterConst &setIterator) const +{ + if (setIterator != myDynamicsSet.cend()) + { + return *setIterator; + } + return DynamicsPtr(); +} +DashesPtr DirectionType::getDashes() const +{ + return myDashes; +} - void DirectionType::setStringMute( const StringMutePtr& value ) - { - if( value ) - { - myStringMute = value; - } - } +void DirectionType::setDashes(const DashesPtr &value) +{ + if (value) + { + myDashes = value; + } +} +BracketPtr DirectionType::getBracket() const +{ + return myBracket; +} - ScordaturaPtr DirectionType::getScordatura() const - { - return myScordatura; - } +void DirectionType::setBracket(const BracketPtr &value) +{ + if (value) + { + myBracket = value; + } +} +PedalPtr DirectionType::getPedal() const +{ + return myPedal; +} - void DirectionType::setScordatura( const ScordaturaPtr& value ) - { - if( value ) - { - myScordatura = value; - } - } +void DirectionType::setPedal(const PedalPtr &value) +{ + if (value) + { + myPedal = value; + } +} +MetronomePtr DirectionType::getMetronome() const +{ + return myMetronome; +} - ImagePtr DirectionType::getImage() const - { - return myImage; - } +void DirectionType::setMetronome(const MetronomePtr &value) +{ + if (value) + { + myMetronome = value; + } +} +OctaveShiftPtr DirectionType::getOctaveShift() const +{ + return myOctaveShift; +} - void DirectionType::setImage( const ImagePtr& value ) - { - if( value ) - { - myImage = value; - } - } +void DirectionType::setOctaveShift(const OctaveShiftPtr &value) +{ + if (value) + { + myOctaveShift = value; + } +} +HarpPedalsPtr DirectionType::getHarpPedals() const +{ + return myHarpPedals; +} - PrincipalVoicePtr DirectionType::getPrincipalVoice() const - { - return myPrincipalVoice; - } +void DirectionType::setHarpPedals(const HarpPedalsPtr &value) +{ + if (value) + { + myHarpPedals = value; + } +} +DampPtr DirectionType::getDamp() const +{ + return myDamp; +} - void DirectionType::setPrincipalVoice( const PrincipalVoicePtr& value ) - { - if( value ) - { - myPrincipalVoice = value; - } - } +void DirectionType::setDamp(const DampPtr &value) +{ + if (value) + { + myDamp = value; + } +} +DampAllPtr DirectionType::getDampAll() const +{ + return myDampAll; +} - AccordionRegistrationPtr DirectionType::getAccordionRegistration() const - { - return myAccordionRegistration; - } +void DirectionType::setDampAll(const DampAllPtr &value) +{ + if (value) + { + myDampAll = value; + } +} +EyeglassesPtr DirectionType::getEyeglasses() const +{ + return myEyeglasses; +} - void DirectionType::setAccordionRegistration( const AccordionRegistrationPtr& value ) - { - if( value ) - { - myAccordionRegistration = value; - } - } +void DirectionType::setEyeglasses(const EyeglassesPtr &value) +{ + if (value) + { + myEyeglasses = value; + } +} +StringMutePtr DirectionType::getStringMute() const +{ + return myStringMute; +} - const PercussionSet& DirectionType::getPercussionSet() const - { - return myPercussionSet; - } +void DirectionType::setStringMute(const StringMutePtr &value) +{ + if (value) + { + myStringMute = value; + } +} +ScordaturaPtr DirectionType::getScordatura() const +{ + return myScordatura; +} - void DirectionType::removePercussion( const PercussionSetIterConst& value ) - { - if ( value != myPercussionSet.cend() ) - { - if ( myPercussionSet.size() > 1 ) - { - myPercussionSet.erase( value ); - } - } - } +void DirectionType::setScordatura(const ScordaturaPtr &value) +{ + if (value) + { + myScordatura = value; + } +} +ImagePtr DirectionType::getImage() const +{ + return myImage; +} - void DirectionType::addPercussion( const PercussionPtr& value ) - { - if ( value ) - { - myPercussionSet.push_back( value ); - } - } +void DirectionType::setImage(const ImagePtr &value) +{ + if (value) + { + myImage = value; + } +} +PrincipalVoicePtr DirectionType::getPrincipalVoice() const +{ + return myPrincipalVoice; +} - void DirectionType::clearPercussionSet() - { - myPercussionSet.clear(); - while( myPercussionSet.size() < 1 ) - { - myPercussionSet.push_back( makePercussion() ); - } - } +void DirectionType::setPrincipalVoice(const PrincipalVoicePtr &value) +{ + if (value) + { + myPrincipalVoice = value; + } +} +AccordionRegistrationPtr DirectionType::getAccordionRegistration() const +{ + return myAccordionRegistration; +} - PercussionPtr DirectionType::getPercussion( const PercussionSetIterConst& setIterator ) const - { - if( setIterator != myPercussionSet.cend() ) - { - return *setIterator; - } - return PercussionPtr(); - } +void DirectionType::setAccordionRegistration(const AccordionRegistrationPtr &value) +{ + if (value) + { + myAccordionRegistration = value; + } +} +const PercussionSet &DirectionType::getPercussionSet() const +{ + return myPercussionSet; +} - OtherDirectionPtr DirectionType::getOtherDirection() const +void DirectionType::removePercussion(const PercussionSetIterConst &value) +{ + if (value != myPercussionSet.cend()) + { + if (myPercussionSet.size() > 1) { - return myOtherDirection; + myPercussionSet.erase(value); } + } +} +void DirectionType::addPercussion(const PercussionPtr &value) +{ + if (value) + { + myPercussionSet.push_back(value); + } +} - void DirectionType::setOtherDirection( const OtherDirectionPtr& value ) - { - if( value ) - { - myOtherDirection = value; - } - } +void DirectionType::clearPercussionSet() +{ + myPercussionSet.clear(); + while (myPercussionSet.size() < 1) + { + myPercussionSet.push_back(makePercussion()); + } +} +PercussionPtr DirectionType::getPercussion(const PercussionSetIterConst &setIterator) const +{ + if (setIterator != myPercussionSet.cend()) + { + return *setIterator; + } + return PercussionPtr(); +} - MX_FROM_XELEMENT_UNUSED( DirectionType ); +OtherDirectionPtr DirectionType::getOtherDirection() const +{ + return myOtherDirection; +} +void DirectionType::setOtherDirection(const OtherDirectionPtr &value) +{ + if (value) + { + myOtherDirection = value; } } + +MX_FROM_XELEMENT_UNUSED(DirectionType); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DirectionType.h b/Sourcecode/private/mx/core/elements/DirectionType.h index 7a59aeb56..0f5fe7aff 100644 --- a/Sourcecode/private/mx/core/elements/DirectionType.h +++ b/Sourcecode/private/mx/core/elements/DirectionType.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,206 +13,209 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( AccordionRegistration ) - MX_FORWARD_DECLARE_ELEMENT( Bracket ) - MX_FORWARD_DECLARE_ELEMENT( Coda ) - MX_FORWARD_DECLARE_ELEMENT( Damp ) - MX_FORWARD_DECLARE_ELEMENT( DampAll ) - MX_FORWARD_DECLARE_ELEMENT( Dashes ) - MX_FORWARD_DECLARE_ELEMENT( Dynamics ) - MX_FORWARD_DECLARE_ELEMENT( Eyeglasses ) - MX_FORWARD_DECLARE_ELEMENT( HarpPedals ) - MX_FORWARD_DECLARE_ELEMENT( Image ) - MX_FORWARD_DECLARE_ELEMENT( Metronome ) - MX_FORWARD_DECLARE_ELEMENT( OctaveShift ) - MX_FORWARD_DECLARE_ELEMENT( OtherDirection ) - MX_FORWARD_DECLARE_ELEMENT( Pedal ) - MX_FORWARD_DECLARE_ELEMENT( Percussion ) - MX_FORWARD_DECLARE_ELEMENT( PrincipalVoice ) - MX_FORWARD_DECLARE_ELEMENT( Rehearsal ) - MX_FORWARD_DECLARE_ELEMENT( Scordatura ) - MX_FORWARD_DECLARE_ELEMENT( Segno ) - MX_FORWARD_DECLARE_ELEMENT( StringMute ) - MX_FORWARD_DECLARE_ELEMENT( Wedge ) - MX_FORWARD_DECLARE_ELEMENT( Words ) - MX_FORWARD_DECLARE_ELEMENT( DirectionType ) - - inline DirectionTypePtr makeDirectionType() { return std::make_shared(); } - - class DirectionType : public ElementInterface - { - public: - enum class Choice - { - rehearsal = 1, - segno = 2, - words = 3, - coda = 4, - wedge = 5, - dynamics = 6, - dashes = 7, - bracket = 8, - pedal = 9, - metronome = 10, - octaveShift = 11, - harpPedals = 12, - damp = 13, - dampAll = 14, - eyeglasses = 15, - stringMute = 16, - scordatura = 17, - image = 18, - principalVoice = 19, - accordionRegistration = 20, - percussion = 21, - otherDirection = 22 - }; - DirectionType(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DirectionType::Choice getChoice() const; - void setChoice( const DirectionType::Choice value ); - - /* _________ Rehearsal minOccurs = 1, maxOccurs = unbounded _________ */ - const RehearsalSet& getRehearsalSet() const; - void addRehearsal( const RehearsalPtr& value ); - void removeRehearsal( const RehearsalSetIterConst& value ); - void clearRehearsalSet(); - RehearsalPtr getRehearsal( const RehearsalSetIterConst& setIterator ) const; - - /* _________ Segno minOccurs = 1, maxOccurs = unbounded _________ */ - const SegnoSet& getSegnoSet() const; - void addSegno( const SegnoPtr& value ); - void removeSegno( const SegnoSetIterConst& value ); - void clearSegnoSet(); - SegnoPtr getSegno( const SegnoSetIterConst& setIterator ) const; - - /* _________ Words minOccurs = 1, maxOccurs = unbounded _________ */ - const WordsSet& getWordsSet() const; - void addWords( const WordsPtr& value ); - void removeWords( const WordsSetIterConst& value ); - void clearWordsSet(); - WordsPtr getWords( const WordsSetIterConst& setIterator ) const; - - /* _________ Coda minOccurs = 1, maxOccurs = unbounded _________ */ - const CodaSet& getCodaSet() const; - void addCoda( const CodaPtr& value ); - void removeCoda( const CodaSetIterConst& value ); - void clearCodaSet(); - CodaPtr getCoda( const CodaSetIterConst& setIterator ) const; - - /* _________ Wedge minOccurs = 1, maxOccurs = 1 _________ */ - WedgePtr getWedge() const; - void setWedge( const WedgePtr& value ); - - /* _________ Dynamics minOccurs = 1, maxOccurs = unbounded _________ */ - const DynamicsSet& getDynamicsSet() const; - void addDynamics( const DynamicsPtr& value ); - void removeDynamics( const DynamicsSetIterConst& value ); - void clearDynamicsSet(); - DynamicsPtr getDynamics( const DynamicsSetIterConst& setIterator ) const; - - /* _________ Dashes minOccurs = 1, maxOccurs = 1 _________ */ - DashesPtr getDashes() const; - void setDashes( const DashesPtr& value ); - - /* _________ Bracket minOccurs = 1, maxOccurs = 1 _________ */ - BracketPtr getBracket() const; - void setBracket( const BracketPtr& value ); - - /* _________ Pedal minOccurs = 1, maxOccurs = 1 _________ */ - PedalPtr getPedal() const; - void setPedal( const PedalPtr& value ); - - /* _________ Metronome minOccurs = 1, maxOccurs = 1 _________ */ - MetronomePtr getMetronome() const; - void setMetronome( const MetronomePtr& value ); - - /* _________ OctaveShift minOccurs = 1, maxOccurs = 1 _________ */ - OctaveShiftPtr getOctaveShift() const; - void setOctaveShift( const OctaveShiftPtr& value ); - - /* _________ HarpPedals minOccurs = 1, maxOccurs = 1 _________ */ - HarpPedalsPtr getHarpPedals() const; - void setHarpPedals( const HarpPedalsPtr& value ); - - /* _________ Damp minOccurs = 1, maxOccurs = 1 _________ */ - DampPtr getDamp() const; - void setDamp( const DampPtr& value ); - - /* _________ DampAll minOccurs = 1, maxOccurs = 1 _________ */ - DampAllPtr getDampAll() const; - void setDampAll( const DampAllPtr& value ); - - /* _________ Eyeglasses minOccurs = 1, maxOccurs = 1 _________ */ - EyeglassesPtr getEyeglasses() const; - void setEyeglasses( const EyeglassesPtr& value ); - - /* _________ StringMute minOccurs = 1, maxOccurs = 1 _________ */ - StringMutePtr getStringMute() const; - void setStringMute( const StringMutePtr& value ); - - /* _________ Scordatura minOccurs = 1, maxOccurs = 1 _________ */ - ScordaturaPtr getScordatura() const; - void setScordatura( const ScordaturaPtr& value ); - - /* _________ Image minOccurs = 1, maxOccurs = 1 _________ */ - ImagePtr getImage() const; - void setImage( const ImagePtr& value ); - - /* _________ PrincipalVoice minOccurs = 1, maxOccurs = 1 _________ */ - PrincipalVoicePtr getPrincipalVoice() const; - void setPrincipalVoice( const PrincipalVoicePtr& value ); - - /* _________ AccordionRegistration minOccurs = 1, maxOccurs = 1 _________ */ - AccordionRegistrationPtr getAccordionRegistration() const; - void setAccordionRegistration( const AccordionRegistrationPtr& value ); - - /* _________ Percussion minOccurs = 1, maxOccurs = unbounded _________ */ - const PercussionSet& getPercussionSet() const; - void addPercussion( const PercussionPtr& value ); - void removePercussion( const PercussionSetIterConst& value ); - void clearPercussionSet(); - PercussionPtr getPercussion( const PercussionSetIterConst& setIterator ) const; - - /* _________ OtherDirection minOccurs = 1, maxOccurs = 1 _________ */ - OtherDirectionPtr getOtherDirection() const; - void setOtherDirection( const OtherDirectionPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - RehearsalSet myRehearsalSet; - SegnoSet mySegnoSet; - WordsSet myWordsSet; - CodaSet myCodaSet; - WedgePtr myWedge; - DynamicsSet myDynamicsSet; - DashesPtr myDashes; - BracketPtr myBracket; - PedalPtr myPedal; - MetronomePtr myMetronome; - OctaveShiftPtr myOctaveShift; - HarpPedalsPtr myHarpPedals; - DampPtr myDamp; - DampAllPtr myDampAll; - EyeglassesPtr myEyeglasses; - StringMutePtr myStringMute; - ScordaturaPtr myScordatura; - ImagePtr myImage; - PrincipalVoicePtr myPrincipalVoice; - AccordionRegistrationPtr myAccordionRegistration; - PercussionSet myPercussionSet; - OtherDirectionPtr myOtherDirection; - }; - } +MX_FORWARD_DECLARE_ELEMENT(AccordionRegistration) +MX_FORWARD_DECLARE_ELEMENT(Bracket) +MX_FORWARD_DECLARE_ELEMENT(Coda) +MX_FORWARD_DECLARE_ELEMENT(Damp) +MX_FORWARD_DECLARE_ELEMENT(DampAll) +MX_FORWARD_DECLARE_ELEMENT(Dashes) +MX_FORWARD_DECLARE_ELEMENT(Dynamics) +MX_FORWARD_DECLARE_ELEMENT(Eyeglasses) +MX_FORWARD_DECLARE_ELEMENT(HarpPedals) +MX_FORWARD_DECLARE_ELEMENT(Image) +MX_FORWARD_DECLARE_ELEMENT(Metronome) +MX_FORWARD_DECLARE_ELEMENT(OctaveShift) +MX_FORWARD_DECLARE_ELEMENT(OtherDirection) +MX_FORWARD_DECLARE_ELEMENT(Pedal) +MX_FORWARD_DECLARE_ELEMENT(Percussion) +MX_FORWARD_DECLARE_ELEMENT(PrincipalVoice) +MX_FORWARD_DECLARE_ELEMENT(Rehearsal) +MX_FORWARD_DECLARE_ELEMENT(Scordatura) +MX_FORWARD_DECLARE_ELEMENT(Segno) +MX_FORWARD_DECLARE_ELEMENT(StringMute) +MX_FORWARD_DECLARE_ELEMENT(Wedge) +MX_FORWARD_DECLARE_ELEMENT(Words) +MX_FORWARD_DECLARE_ELEMENT(DirectionType) + +inline DirectionTypePtr makeDirectionType() +{ + return std::make_shared(); } + +class DirectionType : public ElementInterface +{ + public: + enum class Choice + { + rehearsal = 1, + segno = 2, + words = 3, + coda = 4, + wedge = 5, + dynamics = 6, + dashes = 7, + bracket = 8, + pedal = 9, + metronome = 10, + octaveShift = 11, + harpPedals = 12, + damp = 13, + dampAll = 14, + eyeglasses = 15, + stringMute = 16, + scordatura = 17, + image = 18, + principalVoice = 19, + accordionRegistration = 20, + percussion = 21, + otherDirection = 22 + }; + DirectionType(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DirectionType::Choice getChoice() const; + void setChoice(const DirectionType::Choice value); + + /* _________ Rehearsal minOccurs = 1, maxOccurs = unbounded _________ */ + const RehearsalSet &getRehearsalSet() const; + void addRehearsal(const RehearsalPtr &value); + void removeRehearsal(const RehearsalSetIterConst &value); + void clearRehearsalSet(); + RehearsalPtr getRehearsal(const RehearsalSetIterConst &setIterator) const; + + /* _________ Segno minOccurs = 1, maxOccurs = unbounded _________ */ + const SegnoSet &getSegnoSet() const; + void addSegno(const SegnoPtr &value); + void removeSegno(const SegnoSetIterConst &value); + void clearSegnoSet(); + SegnoPtr getSegno(const SegnoSetIterConst &setIterator) const; + + /* _________ Words minOccurs = 1, maxOccurs = unbounded _________ */ + const WordsSet &getWordsSet() const; + void addWords(const WordsPtr &value); + void removeWords(const WordsSetIterConst &value); + void clearWordsSet(); + WordsPtr getWords(const WordsSetIterConst &setIterator) const; + + /* _________ Coda minOccurs = 1, maxOccurs = unbounded _________ */ + const CodaSet &getCodaSet() const; + void addCoda(const CodaPtr &value); + void removeCoda(const CodaSetIterConst &value); + void clearCodaSet(); + CodaPtr getCoda(const CodaSetIterConst &setIterator) const; + + /* _________ Wedge minOccurs = 1, maxOccurs = 1 _________ */ + WedgePtr getWedge() const; + void setWedge(const WedgePtr &value); + + /* _________ Dynamics minOccurs = 1, maxOccurs = unbounded _________ */ + const DynamicsSet &getDynamicsSet() const; + void addDynamics(const DynamicsPtr &value); + void removeDynamics(const DynamicsSetIterConst &value); + void clearDynamicsSet(); + DynamicsPtr getDynamics(const DynamicsSetIterConst &setIterator) const; + + /* _________ Dashes minOccurs = 1, maxOccurs = 1 _________ */ + DashesPtr getDashes() const; + void setDashes(const DashesPtr &value); + + /* _________ Bracket minOccurs = 1, maxOccurs = 1 _________ */ + BracketPtr getBracket() const; + void setBracket(const BracketPtr &value); + + /* _________ Pedal minOccurs = 1, maxOccurs = 1 _________ */ + PedalPtr getPedal() const; + void setPedal(const PedalPtr &value); + + /* _________ Metronome minOccurs = 1, maxOccurs = 1 _________ */ + MetronomePtr getMetronome() const; + void setMetronome(const MetronomePtr &value); + + /* _________ OctaveShift minOccurs = 1, maxOccurs = 1 _________ */ + OctaveShiftPtr getOctaveShift() const; + void setOctaveShift(const OctaveShiftPtr &value); + + /* _________ HarpPedals minOccurs = 1, maxOccurs = 1 _________ */ + HarpPedalsPtr getHarpPedals() const; + void setHarpPedals(const HarpPedalsPtr &value); + + /* _________ Damp minOccurs = 1, maxOccurs = 1 _________ */ + DampPtr getDamp() const; + void setDamp(const DampPtr &value); + + /* _________ DampAll minOccurs = 1, maxOccurs = 1 _________ */ + DampAllPtr getDampAll() const; + void setDampAll(const DampAllPtr &value); + + /* _________ Eyeglasses minOccurs = 1, maxOccurs = 1 _________ */ + EyeglassesPtr getEyeglasses() const; + void setEyeglasses(const EyeglassesPtr &value); + + /* _________ StringMute minOccurs = 1, maxOccurs = 1 _________ */ + StringMutePtr getStringMute() const; + void setStringMute(const StringMutePtr &value); + + /* _________ Scordatura minOccurs = 1, maxOccurs = 1 _________ */ + ScordaturaPtr getScordatura() const; + void setScordatura(const ScordaturaPtr &value); + + /* _________ Image minOccurs = 1, maxOccurs = 1 _________ */ + ImagePtr getImage() const; + void setImage(const ImagePtr &value); + + /* _________ PrincipalVoice minOccurs = 1, maxOccurs = 1 _________ */ + PrincipalVoicePtr getPrincipalVoice() const; + void setPrincipalVoice(const PrincipalVoicePtr &value); + + /* _________ AccordionRegistration minOccurs = 1, maxOccurs = 1 _________ */ + AccordionRegistrationPtr getAccordionRegistration() const; + void setAccordionRegistration(const AccordionRegistrationPtr &value); + + /* _________ Percussion minOccurs = 1, maxOccurs = unbounded _________ */ + const PercussionSet &getPercussionSet() const; + void addPercussion(const PercussionPtr &value); + void removePercussion(const PercussionSetIterConst &value); + void clearPercussionSet(); + PercussionPtr getPercussion(const PercussionSetIterConst &setIterator) const; + + /* _________ OtherDirection minOccurs = 1, maxOccurs = 1 _________ */ + OtherDirectionPtr getOtherDirection() const; + void setOtherDirection(const OtherDirectionPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + RehearsalSet myRehearsalSet; + SegnoSet mySegnoSet; + WordsSet myWordsSet; + CodaSet myCodaSet; + WedgePtr myWedge; + DynamicsSet myDynamicsSet; + DashesPtr myDashes; + BracketPtr myBracket; + PedalPtr myPedal; + MetronomePtr myMetronome; + OctaveShiftPtr myOctaveShift; + HarpPedalsPtr myHarpPedals; + DampPtr myDamp; + DampAllPtr myDampAll; + EyeglassesPtr myEyeglasses; + StringMutePtr myStringMute; + ScordaturaPtr myScordatura; + ImagePtr myImage; + PrincipalVoicePtr myPrincipalVoice; + AccordionRegistrationPtr myAccordionRegistration; + PercussionSet myPercussionSet; + OtherDirectionPtr myOtherDirection; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Directive.cpp b/Sourcecode/private/mx/core/elements/Directive.cpp index 54d72f123..bd0b6f9e0 100644 --- a/Sourcecode/private/mx/core/elements/Directive.cpp +++ b/Sourcecode/private/mx/core/elements/Directive.cpp @@ -8,89 +8,76 @@ namespace mx { - namespace core - { - Directive::Directive() - :myAttributes( std::make_shared() ) - ,myValue() - {} - - - Directive::Directive( const XsString& value ) - :myAttributes( std::make_shared() ) - ,myValue( value ) - {} - - - bool Directive::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Directive::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Directive::streamName( std::ostream& os ) const - { - os << "directive"; - return os; - } - - - bool Directive::hasContents() const - { - return true; - } - - - std::ostream& Directive::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - MX_UNUSED( isOneLineOnly ); - isOneLineOnly = true; - core::toStream( os, myValue ); - return os; - } +namespace core +{ +Directive::Directive() : myAttributes(std::make_shared()), myValue() +{ +} +Directive::Directive(const XsString &value) : myAttributes(std::make_shared()), myValue(value) +{ +} - DirectiveAttributesPtr Directive::getAttributes() const - { - return myAttributes; - } +bool Directive::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Directive::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void Directive::setAttributes( const DirectiveAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Directive::streamName(std::ostream &os) const +{ + os << "directive"; + return os; +} +bool Directive::hasContents() const +{ + return true; +} - XsString Directive::getValue() const - { - return myValue; - } +std::ostream &Directive::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + MX_UNUSED(isOneLineOnly); + isOneLineOnly = true; + core::toStream(os, myValue); + return os; +} +DirectiveAttributesPtr Directive::getAttributes() const +{ + return myAttributes; +} - void Directive::setValue( const XsString& value ) - { - myValue = value; - } +void Directive::setAttributes(const DirectiveAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Directive::getValue() const +{ + return myValue; +} - bool Directive::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Directive::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Directive::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Directive.h b/Sourcecode/private/mx/core/elements/Directive.h index 22f324cec..629824934 100644 --- a/Sourcecode/private/mx/core/elements/Directive.h +++ b/Sourcecode/private/mx/core/elements/Directive.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/DirectiveAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DirectiveAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Directive ) - - inline DirectivePtr makeDirective() { return std::make_shared(); } - inline DirectivePtr makeDirective( const XsString& value ) { return std::make_shared( value ); } - inline DirectivePtr makeDirective( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Directive : public ElementInterface - { - public: - Directive(); - Directive( const XsString& value ); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DirectiveAttributesPtr getAttributes() const; - void setAttributes( const DirectiveAttributesPtr& value ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DirectiveAttributesPtr myAttributes; - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DirectiveAttributes) +MX_FORWARD_DECLARE_ELEMENT(Directive) + +inline DirectivePtr makeDirective() +{ + return std::make_shared(); +} + +inline DirectivePtr makeDirective(const XsString &value) +{ + return std::make_shared(value); } + +inline DirectivePtr makeDirective(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Directive : public ElementInterface +{ + public: + Directive(); + Directive(const XsString &value); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DirectiveAttributesPtr getAttributes() const; + void setAttributes(const DirectiveAttributesPtr &value); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DirectiveAttributesPtr myAttributes; + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp b/Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp index 10b53bc2e..0d4e6ba3f 100644 --- a/Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp @@ -8,87 +8,94 @@ namespace mx { - namespace core +namespace core +{ +DirectiveAttributes::DirectiveAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), lang("it"), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false), hasLang(false) +{ +} + +bool DirectiveAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasLang; +} + +std::ostream &DirectiveAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - DirectiveAttributes::DirectiveAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,lang( "it" ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasLang( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, lang, "xml:lang", hasLang); + } + return os; +} + +bool DirectiveAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DirectiveAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DirectiveAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasLang; + continue; } - - - std::ostream& DirectiveAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - } - return os; + continue; } - - - bool DirectiveAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "DirectiveAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "xml:lang")) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DirectiveAttributes.h b/Sourcecode/private/mx/core/elements/DirectiveAttributes.h index b698e8b26..ffa053d07 100644 --- a/Sourcecode/private/mx/core/elements/DirectiveAttributes.h +++ b/Sourcecode/private/mx/core/elements/DirectiveAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XmlLang.h" #include @@ -18,38 +18,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DirectiveAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DirectiveAttributes) - struct DirectiveAttributes : public AttributesInterface - { - public: - DirectiveAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - XmlLang lang; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasLang; +struct DirectiveAttributes : public AttributesInterface +{ + public: + DirectiveAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + XmlLang lang; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasLang; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayOctave.cpp b/Sourcecode/private/mx/core/elements/DisplayOctave.cpp index e8c27e88d..65ae78ba4 100644 --- a/Sourcecode/private/mx/core/elements/DisplayOctave.cpp +++ b/Sourcecode/private/mx/core/elements/DisplayOctave.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - DisplayOctave::DisplayOctave() - :myValue() - {} - - - DisplayOctave::DisplayOctave( const OctaveValue& value ) - :myValue( value ) - {} - - - bool DisplayOctave::hasAttributes() const - { - return false; - } - - - bool DisplayOctave::hasContents() const - { - return true; - } - - - std::ostream& DisplayOctave::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& DisplayOctave::streamName( std::ostream& os ) const - { - os << "display-octave"; - return os; - } +namespace core +{ +DisplayOctave::DisplayOctave() : myValue() +{ +} +DisplayOctave::DisplayOctave(const OctaveValue &value) : myValue(value) +{ +} - std::ostream& DisplayOctave::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool DisplayOctave::hasAttributes() const +{ + return false; +} +bool DisplayOctave::hasContents() const +{ + return true; +} - OctaveValue DisplayOctave::getValue() const - { - return myValue; - } +std::ostream &DisplayOctave::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &DisplayOctave::streamName(std::ostream &os) const +{ + os << "display-octave"; + return os; +} - void DisplayOctave::setValue( const OctaveValue& value ) - { - myValue = value; - } +std::ostream &DisplayOctave::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OctaveValue DisplayOctave::getValue() const +{ + return myValue; +} - bool DisplayOctave::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void DisplayOctave::setValue(const OctaveValue &value) +{ + myValue = value; +} - } +bool DisplayOctave::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayOctave.h b/Sourcecode/private/mx/core/elements/DisplayOctave.h index 4e1e1ab98..5692007ee 100644 --- a/Sourcecode/private/mx/core/elements/DisplayOctave.h +++ b/Sourcecode/private/mx/core/elements/DisplayOctave.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DisplayOctave ) - - inline DisplayOctavePtr makeDisplayOctave() { return std::make_shared(); } - inline DisplayOctavePtr makeDisplayOctave( const OctaveValue& value ) { return std::make_shared( value ); } - inline DisplayOctavePtr makeDisplayOctave( OctaveValue&& value ) { return std::make_shared( std::move( value ) ); } - - class DisplayOctave : public ElementInterface - { - public: - DisplayOctave(); - DisplayOctave( const OctaveValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OctaveValue getValue() const; - void setValue( const OctaveValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OctaveValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(DisplayOctave) + +inline DisplayOctavePtr makeDisplayOctave() +{ + return std::make_shared(); +} + +inline DisplayOctavePtr makeDisplayOctave(const OctaveValue &value) +{ + return std::make_shared(value); } + +inline DisplayOctavePtr makeDisplayOctave(OctaveValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class DisplayOctave : public ElementInterface +{ + public: + DisplayOctave(); + DisplayOctave(const OctaveValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OctaveValue getValue() const; + void setValue(const OctaveValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + OctaveValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayStep.cpp b/Sourcecode/private/mx/core/elements/DisplayStep.cpp index 972fb3373..b13dbc9df 100644 --- a/Sourcecode/private/mx/core/elements/DisplayStep.cpp +++ b/Sourcecode/private/mx/core/elements/DisplayStep.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - DisplayStep::DisplayStep() - :myValue( StepEnum::a ) - {} - - - DisplayStep::DisplayStep( const StepEnum& value ) - :myValue( value ) - {} - - - bool DisplayStep::hasAttributes() const - { - return false; - } - - - bool DisplayStep::hasContents() const - { - return true; - } - - - std::ostream& DisplayStep::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& DisplayStep::streamName( std::ostream& os ) const - { - os << "display-step"; - return os; - } +namespace core +{ +DisplayStep::DisplayStep() : myValue(StepEnum::a) +{ +} +DisplayStep::DisplayStep(const StepEnum &value) : myValue(value) +{ +} - std::ostream& DisplayStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool DisplayStep::hasAttributes() const +{ + return false; +} +bool DisplayStep::hasContents() const +{ + return true; +} - StepEnum DisplayStep::getValue() const - { - return myValue; - } +std::ostream &DisplayStep::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &DisplayStep::streamName(std::ostream &os) const +{ + os << "display-step"; + return os; +} - void DisplayStep::setValue( const StepEnum& value ) - { - myValue = value; - } +std::ostream &DisplayStep::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StepEnum DisplayStep::getValue() const +{ + return myValue; +} - bool DisplayStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStepEnum( xelement.getValue() ); - return true; - } +void DisplayStep::setValue(const StepEnum &value) +{ + myValue = value; +} - } +bool DisplayStep::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseStepEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayStep.h b/Sourcecode/private/mx/core/elements/DisplayStep.h index 2ff77b0eb..ef691260f 100644 --- a/Sourcecode/private/mx/core/elements/DisplayStep.h +++ b/Sourcecode/private/mx/core/elements/DisplayStep.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DisplayStep ) - - inline DisplayStepPtr makeDisplayStep() { return std::make_shared(); } - inline DisplayStepPtr makeDisplayStep( const StepEnum& value ) { return std::make_shared( value ); } - inline DisplayStepPtr makeDisplayStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class DisplayStep : public ElementInterface - { - public: - DisplayStep(); - DisplayStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(DisplayStep) + +inline DisplayStepPtr makeDisplayStep() +{ + return std::make_shared(); +} + +inline DisplayStepPtr makeDisplayStep(const StepEnum &value) +{ + return std::make_shared(value); } + +inline DisplayStepPtr makeDisplayStep(StepEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class DisplayStep : public ElementInterface +{ + public: + DisplayStep(); + DisplayStep(const StepEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StepEnum getValue() const; + void setValue(const StepEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StepEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp b/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp index 9fb74402b..968b6430c 100644 --- a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp +++ b/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp @@ -10,115 +10,106 @@ namespace mx { - namespace core - { - DisplayStepOctaveGroup::DisplayStepOctaveGroup() - :myDisplayStep( makeDisplayStep() ) - ,myDisplayOctave( makeDisplayOctave() ) - {} - - - bool DisplayStepOctaveGroup::hasAttributes() const - { - return false; - } +namespace core +{ +DisplayStepOctaveGroup::DisplayStepOctaveGroup() + : myDisplayStep(makeDisplayStep()), myDisplayOctave(makeDisplayOctave()) +{ +} +bool DisplayStepOctaveGroup::hasAttributes() const +{ + return false; +} - std::ostream& DisplayStepOctaveGroup::streamAttributes( std::ostream& os ) const - { - return os; - } +std::ostream &DisplayStepOctaveGroup::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &DisplayStepOctaveGroup::streamName(std::ostream &os) const +{ + return os; +} - std::ostream& DisplayStepOctaveGroup::streamName( std::ostream& os ) const - { - return os; - } +bool DisplayStepOctaveGroup::hasContents() const +{ + return true; +} +std::ostream &DisplayStepOctaveGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(isOneLineOnly); + myDisplayStep->toStream(os, indentLevel); + os << std::endl; + myDisplayOctave->toStream(os, indentLevel); + return os; +} - bool DisplayStepOctaveGroup::hasContents() const - { - return true; - } +DisplayStepPtr DisplayStepOctaveGroup::getDisplayStep() const +{ + return myDisplayStep; +} +void DisplayStepOctaveGroup::setDisplayStep(const DisplayStepPtr &value) +{ + if (value) + { + myDisplayStep = value; + } +} - std::ostream& DisplayStepOctaveGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - myDisplayStep->toStream( os, indentLevel ); - os << std::endl; - myDisplayOctave->toStream( os, indentLevel ); - return os; - } +DisplayOctavePtr DisplayStepOctaveGroup::getDisplayOctave() const +{ + return myDisplayOctave; +} +void DisplayStepOctaveGroup::setDisplayOctave(const DisplayOctavePtr &value) +{ + if (value) + { + myDisplayOctave = value; + } +} - DisplayStepPtr DisplayStepOctaveGroup::getDisplayStep() const - { - return myDisplayStep; - } +bool DisplayStepOctaveGroup::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isDisplayStepFound = false; + bool isDisplayOctaveFound = false; + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); - void DisplayStepOctaveGroup::setDisplayStep( const DisplayStepPtr& value ) + if (elementName == "display-step") { - if ( value ) - { - myDisplayStep = value; - } + isDisplayStepFound = true; + isSuccess &= myDisplayStep->fromXElement(message, *it); } - - - DisplayOctavePtr DisplayStepOctaveGroup::getDisplayOctave() const + else if (elementName == "display-octave") { - return myDisplayOctave; + isDisplayOctaveFound = true; + isSuccess &= myDisplayOctave->fromXElement(message, *it); } - - - void DisplayStepOctaveGroup::setDisplayOctave( const DisplayOctavePtr& value ) + else { - if ( value ) + if (!isDisplayStepFound) { - myDisplayOctave = value; + isSuccess = false; + message << "DisplayStepOctaveGroup: 'display-step' element is required but was not found" << std::endl; } - } - - - bool DisplayStepOctaveGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isDisplayStepFound = false; - bool isDisplayOctaveFound = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + if (!isDisplayOctaveFound) { - const std::string elementName = it->getName(); - - if( elementName == "display-step" ) - { - isDisplayStepFound = true; - isSuccess &= myDisplayStep->fromXElement( message, *it ); - } - else if( elementName == "display-octave" ) - { - isDisplayOctaveFound = true; - isSuccess &= myDisplayOctave->fromXElement( message, *it ); - } - else - { - if( !isDisplayStepFound ) - { - isSuccess = false; - message << "DisplayStepOctaveGroup: 'display-step' element is required but was not found" << std::endl; - } - if( !isDisplayOctaveFound ) - { - isSuccess = false; - message << "DisplayStepOctaveGroup: 'display-octave' element is required but was not found" << std::endl; - } - break; - } + isSuccess = false; + message << "DisplayStepOctaveGroup: 'display-octave' element is required but was not found" + << std::endl; } - MX_RETURN_IS_SUCCESS; + break; } - } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h b/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h index e81722348..aa0ecf37a 100644 --- a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h +++ b/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,40 +13,43 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DisplayOctave ) - MX_FORWARD_DECLARE_ELEMENT( DisplayStep ) - MX_FORWARD_DECLARE_ELEMENT( DisplayStepOctaveGroup ) - - inline DisplayStepOctaveGroupPtr makeDisplayStepOctaveGroup() { return std::make_shared(); } - - class DisplayStepOctaveGroup : public ElementInterface - { - public: - DisplayStepOctaveGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ DisplayStep minOccurs = 1, maxOccurs = 1 _________ */ - DisplayStepPtr getDisplayStep() const; - void setDisplayStep( const DisplayStepPtr& value ); - - /* _________ DisplayOctave minOccurs = 1, maxOccurs = 1 _________ */ - DisplayOctavePtr getDisplayOctave() const; - void setDisplayOctave( const DisplayOctavePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DisplayStepPtr myDisplayStep; - DisplayOctavePtr myDisplayOctave; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(DisplayOctave) +MX_FORWARD_DECLARE_ELEMENT(DisplayStep) +MX_FORWARD_DECLARE_ELEMENT(DisplayStepOctaveGroup) + +inline DisplayStepOctaveGroupPtr makeDisplayStepOctaveGroup() +{ + return std::make_shared(); } + +class DisplayStepOctaveGroup : public ElementInterface +{ + public: + DisplayStepOctaveGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ DisplayStep minOccurs = 1, maxOccurs = 1 _________ */ + DisplayStepPtr getDisplayStep() const; + void setDisplayStep(const DisplayStepPtr &value); + + /* _________ DisplayOctave minOccurs = 1, maxOccurs = 1 _________ */ + DisplayOctavePtr getDisplayOctave() const; + void setDisplayOctave(const DisplayOctavePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DisplayStepPtr myDisplayStep; + DisplayOctavePtr myDisplayOctave; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayText.cpp b/Sourcecode/private/mx/core/elements/DisplayText.cpp index 2ebfdc10e..56698cdb1 100644 --- a/Sourcecode/private/mx/core/elements/DisplayText.cpp +++ b/Sourcecode/private/mx/core/elements/DisplayText.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - DisplayText::DisplayText() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - DisplayText::DisplayText( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool DisplayText::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DisplayText::hasContents() const - { - return true; - } - - - std::ostream& DisplayText::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DisplayText::streamName( std::ostream& os ) const - { - os << "display-text"; - return os; - } - - - std::ostream& DisplayText::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +DisplayText::DisplayText() : myValue(), myAttributes(std::make_shared()) +{ +} +DisplayText::DisplayText(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - DisplayTextAttributesPtr DisplayText::getAttributes() const - { - return myAttributes; - } +bool DisplayText::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool DisplayText::hasContents() const +{ + return true; +} - void DisplayText::setAttributes( const DisplayTextAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DisplayText::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &DisplayText::streamName(std::ostream &os) const +{ + os << "display-text"; + return os; +} - XsString DisplayText::getValue() const - { - return myValue; - } +std::ostream &DisplayText::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +DisplayTextAttributesPtr DisplayText::getAttributes() const +{ + return myAttributes; +} - void DisplayText::setValue( const XsString& value ) - { - myValue = value; - } +void DisplayText::setAttributes(const DisplayTextAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString DisplayText::getValue() const +{ + return myValue; +} - bool DisplayText::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void DisplayText::setValue(const XsString &value) +{ + myValue = value; +} - } +bool DisplayText::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayText.h b/Sourcecode/private/mx/core/elements/DisplayText.h index b39dc3cc3..2720b78e1 100644 --- a/Sourcecode/private/mx/core/elements/DisplayText.h +++ b/Sourcecode/private/mx/core/elements/DisplayText.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/DisplayTextAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DisplayTextAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayText ) - - inline DisplayTextPtr makeDisplayText() { return std::make_shared(); } - inline DisplayTextPtr makeDisplayText( const XsString& value ) { return std::make_shared( value ); } - inline DisplayTextPtr makeDisplayText( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class DisplayText : public ElementInterface - { - public: - DisplayText(); - DisplayText( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DisplayTextAttributesPtr getAttributes() const; - void setAttributes( const DisplayTextAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - DisplayTextAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DisplayTextAttributes) +MX_FORWARD_DECLARE_ELEMENT(DisplayText) + +inline DisplayTextPtr makeDisplayText() +{ + return std::make_shared(); +} + +inline DisplayTextPtr makeDisplayText(const XsString &value) +{ + return std::make_shared(value); } + +inline DisplayTextPtr makeDisplayText(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class DisplayText : public ElementInterface +{ + public: + DisplayText(); + DisplayText(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DisplayTextAttributesPtr getAttributes() const; + void setAttributes(const DisplayTextAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + DisplayTextAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp b/Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp index 1bf700804..89b67093e 100644 --- a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp @@ -8,138 +8,154 @@ namespace mx { - namespace core - { - DisplayTextAttributes::DisplayTextAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( XmlLang{ "it" } ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - +namespace core +{ +DisplayTextAttributes::DisplayTextAttributes() + : justify(LeftCenterRight::center), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), halign(), + underline(), overline(), lineThrough(), rotation(), letterSpacing(), lineHeight(), lang(XmlLang{"it"}), + space(XmlSpace::default_), enclosure(EnclosureShape::rectangle), hasJustify(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasHalign(false), hasUnderline(false), hasOverline(false), + hasLineThrough(false), hasRotation(false), hasLetterSpacing(false), hasLineHeight(false), hasLang(false), + hasSpace(false), hasEnclosure(false) +{ +} - bool DisplayTextAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } +bool DisplayTextAttributes::hasValues() const +{ + return hasJustify || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight || hasHalign || hasUnderline || hasOverline || hasLineThrough || hasRotation || + hasLetterSpacing || hasLineHeight || hasLang || hasSpace || hasEnclosure; +} +std::ostream &DisplayTextAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, justify, "justify", hasJustify); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, underline, "underline", hasUnderline); + streamAttribute(os, overline, "overline", hasOverline); + streamAttribute(os, lineThrough, "line-through", hasLineThrough); + streamAttribute(os, rotation, "rotation", hasRotation); + streamAttribute(os, letterSpacing, "letter-spacing", hasLetterSpacing); + streamAttribute(os, lineHeight, "line-height", hasLineHeight); + streamAttribute(os, lang, "xml:lang", hasLang); + streamAttribute(os, space, "xml:space", hasSpace); + streamAttribute(os, enclosure, "enclosure", hasEnclosure); + } + return os; +} - std::ostream& DisplayTextAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } +bool DisplayTextAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DisplayTextAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DisplayTextAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DisplayTextAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - return isSuccess; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, underline, hasUnderline, "underline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, overline, hasOverline, "overline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, rotation, hasRotation, "rotation")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "xml:lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", + &parseEnclosureShape)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.h b/Sourcecode/private/mx/core/elements/DisplayTextAttributes.h index 96cf5ffd8..ddf749177 100644 --- a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.h +++ b/Sourcecode/private/mx/core/elements/DisplayTextAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/NumberOrNormal.h" #include "mx/core/XmlLang.h" @@ -20,58 +20,58 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DisplayTextAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DisplayTextAttributes) - struct DisplayTextAttributes : public AttributesInterface - { - public: - DisplayTextAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; +struct DisplayTextAttributes : public AttributesInterface +{ + public: + DisplayTextAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + LeftCenterRight justify; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + NumberOfLines underline; + NumberOfLines overline; + NumberOfLines lineThrough; + RotationDegrees rotation; + NumberOrNormal letterSpacing; + NumberOrNormal lineHeight; + XmlLang lang; + XmlSpace space; + EnclosureShape enclosure; + bool hasJustify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; + bool hasUnderline; + bool hasOverline; + bool hasLineThrough; + bool hasRotation; + bool hasLetterSpacing; + bool hasLineHeight; + bool hasLang; + bool hasSpace; + bool hasEnclosure; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp b/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp index 248f686f4..d0de17f1e 100644 --- a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp +++ b/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp @@ -10,120 +10,106 @@ namespace mx { - namespace core - { - DisplayTextOrAccidentalText::DisplayTextOrAccidentalText() - :myChoice( Choice::displayText ) - ,myDisplayText( makeDisplayText() ) - ,myAccidentalText( makeAccidentalText() ) - {} - - - bool DisplayTextOrAccidentalText::hasAttributes() const - { - return false; - } - - - std::ostream& DisplayTextOrAccidentalText::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& DisplayTextOrAccidentalText::streamName( std::ostream& os ) const - { - return os; - } - - - bool DisplayTextOrAccidentalText::hasContents() const - { - if ( myChoice == Choice::accidentalText ) - { - return myAccidentalText->hasContents(); - } - if ( myChoice == Choice::displayText ) - { - return myDisplayText->hasContents(); - } - return false; - } - +namespace core +{ +DisplayTextOrAccidentalText::DisplayTextOrAccidentalText() + : myChoice(Choice::displayText), myDisplayText(makeDisplayText()), myAccidentalText(makeAccidentalText()) +{ +} - std::ostream& DisplayTextOrAccidentalText::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - if ( hasContents() ) - { - switch ( myChoice ) - { - case Choice::accidentalText: - { - myAccidentalText->toStream( os, indentLevel ); - } - break; - case Choice::displayText: - { - myDisplayText->toStream( os, indentLevel ); - } - break; - default: - break; - } - } - return os; - } +bool DisplayTextOrAccidentalText::hasAttributes() const +{ + return false; +} +std::ostream &DisplayTextOrAccidentalText::streamAttributes(std::ostream &os) const +{ + return os; +} - DisplayTextOrAccidentalText::Choice DisplayTextOrAccidentalText::getChoice() const - { - return myChoice; - } +std::ostream &DisplayTextOrAccidentalText::streamName(std::ostream &os) const +{ + return os; +} +bool DisplayTextOrAccidentalText::hasContents() const +{ + if (myChoice == Choice::accidentalText) + { + return myAccidentalText->hasContents(); + } + if (myChoice == Choice::displayText) + { + return myDisplayText->hasContents(); + } + return false; +} - void DisplayTextOrAccidentalText::setChoice( const DisplayTextOrAccidentalText::Choice value ) +std::ostream &DisplayTextOrAccidentalText::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + MX_UNUSED(isOneLineOnly); + if (hasContents()) + { + switch (myChoice) { - myChoice = value; + case Choice::accidentalText: { + myAccidentalText->toStream(os, indentLevel); } - - - DisplayTextPtr DisplayTextOrAccidentalText::getDisplayText() const - { - return myDisplayText; + break; + case Choice::displayText: { + myDisplayText->toStream(os, indentLevel); } - - - void DisplayTextOrAccidentalText::setDisplayText( const DisplayTextPtr& value ) - { - if ( value ) - { - myDisplayText = value; - } + break; + default: + break; } + } + return os; +} +DisplayTextOrAccidentalText::Choice DisplayTextOrAccidentalText::getChoice() const +{ + return myChoice; +} - AccidentalTextPtr DisplayTextOrAccidentalText::getAccidentalText() const - { - return myAccidentalText; - } - +void DisplayTextOrAccidentalText::setChoice(const DisplayTextOrAccidentalText::Choice value) +{ + myChoice = value; +} - void DisplayTextOrAccidentalText::setAccidentalText( const AccidentalTextPtr& value ) - { - if ( value ) - { - myAccidentalText = value; - } - } +DisplayTextPtr DisplayTextOrAccidentalText::getDisplayText() const +{ + return myDisplayText; +} +void DisplayTextOrAccidentalText::setDisplayText(const DisplayTextPtr &value) +{ + if (value) + { + myDisplayText = value; + } +} - bool DisplayTextOrAccidentalText::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( displayText, "display-text", DisplayText ); - MX_CHOICE_IF( accidentalText, "accidental-text", AccidentalText ); - MX_BAD_ELEMENT_FAILURE( DisplayTextOrAccidentalText ); - } +AccidentalTextPtr DisplayTextOrAccidentalText::getAccidentalText() const +{ + return myAccidentalText; +} +void DisplayTextOrAccidentalText::setAccidentalText(const AccidentalTextPtr &value) +{ + if (value) + { + myAccidentalText = value; } } + +bool DisplayTextOrAccidentalText::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_CHOICE_IF(displayText, "display-text", DisplayText); + MX_CHOICE_IF(accidentalText, "accidental-text", AccidentalText); + MX_BAD_ELEMENT_FAILURE(DisplayTextOrAccidentalText); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h b/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h index dca28ab2f..3e2daa32b 100644 --- a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h +++ b/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,44 +13,47 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(AccidentalText) +MX_FORWARD_DECLARE_ELEMENT(DisplayText) +MX_FORWARD_DECLARE_ELEMENT(DisplayTextOrAccidentalText) - MX_FORWARD_DECLARE_ELEMENT( AccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( DisplayText ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - - inline DisplayTextOrAccidentalTextPtr makeDisplayTextOrAccidentalText() { return std::make_shared(); } - - class DisplayTextOrAccidentalText : public ElementInterface - { - public: - enum class Choice - { - displayText = 1, - accidentalText = 2 - }; - DisplayTextOrAccidentalText(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DisplayTextOrAccidentalText::Choice getChoice() const; - void setChoice( const DisplayTextOrAccidentalText::Choice value ); - DisplayTextPtr getDisplayText() const; - void setDisplayText( const DisplayTextPtr& value ); - AccidentalTextPtr getAccidentalText() const; - void setAccidentalText( const AccidentalTextPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - DisplayTextPtr myDisplayText; - AccidentalTextPtr myAccidentalText; - }; - } +inline DisplayTextOrAccidentalTextPtr makeDisplayTextOrAccidentalText() +{ + return std::make_shared(); } + +class DisplayTextOrAccidentalText : public ElementInterface +{ + public: + enum class Choice + { + displayText = 1, + accidentalText = 2 + }; + DisplayTextOrAccidentalText(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DisplayTextOrAccidentalText::Choice getChoice() const; + void setChoice(const DisplayTextOrAccidentalText::Choice value); + DisplayTextPtr getDisplayText() const; + void setDisplayText(const DisplayTextPtr &value); + AccidentalTextPtr getAccidentalText() const; + void setAccidentalText(const AccidentalTextPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + DisplayTextPtr myDisplayText; + AccidentalTextPtr myAccidentalText; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Distance.cpp b/Sourcecode/private/mx/core/elements/Distance.cpp index 0b613e230..bc667ae27 100644 --- a/Sourcecode/private/mx/core/elements/Distance.cpp +++ b/Sourcecode/private/mx/core/elements/Distance.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Distance::Distance() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Distance::Distance( const TenthsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Distance::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Distance::hasContents() const - { - return true; - } - - - std::ostream& Distance::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Distance::streamName( std::ostream& os ) const - { - os << "distance"; - return os; - } - - - std::ostream& Distance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Distance::Distance() : myValue(), myAttributes(std::make_shared()) +{ +} +Distance::Distance(const TenthsValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - DistanceAttributesPtr Distance::getAttributes() const - { - return myAttributes; - } +bool Distance::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Distance::hasContents() const +{ + return true; +} - void Distance::setAttributes( const DistanceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Distance::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Distance::streamName(std::ostream &os) const +{ + os << "distance"; + return os; +} - TenthsValue Distance::getValue() const - { - return myValue; - } +std::ostream &Distance::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +DistanceAttributesPtr Distance::getAttributes() const +{ + return myAttributes; +} - void Distance::setValue( const TenthsValue& value ) - { - myValue = value; - } +void Distance::setAttributes(const DistanceAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +TenthsValue Distance::getValue() const +{ + return myValue; +} - bool Distance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Distance::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool Distance::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Distance.h b/Sourcecode/private/mx/core/elements/Distance.h index ba745e1e3..a9f92c78d 100644 --- a/Sourcecode/private/mx/core/elements/Distance.h +++ b/Sourcecode/private/mx/core/elements/Distance.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DistanceAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DistanceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Distance ) - - inline DistancePtr makeDistance() { return std::make_shared(); } - inline DistancePtr makeDistance( const TenthsValue& value ) { return std::make_shared( value ); } - inline DistancePtr makeDistance( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Distance : public ElementInterface - { - public: - Distance(); - Distance( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DistanceAttributesPtr getAttributes() const; - void setAttributes( const DistanceAttributesPtr& attributes ); - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - DistanceAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DistanceAttributes) +MX_FORWARD_DECLARE_ELEMENT(Distance) + +inline DistancePtr makeDistance() +{ + return std::make_shared(); } + +inline DistancePtr makeDistance(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline DistancePtr makeDistance(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Distance : public ElementInterface +{ + public: + Distance(); + Distance(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DistanceAttributesPtr getAttributes() const; + void setAttributes(const DistanceAttributesPtr &attributes); + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; + DistanceAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DistanceAttributes.cpp b/Sourcecode/private/mx/core/elements/DistanceAttributes.cpp index 42bdbba9c..0340c1c5d 100644 --- a/Sourcecode/private/mx/core/elements/DistanceAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DistanceAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - DistanceAttributes::DistanceAttributes() - :type() - ,hasType( true ) - {} - +namespace core +{ +DistanceAttributes::DistanceAttributes() : type(), hasType(true) +{ +} - bool DistanceAttributes::hasValues() const - { - return hasType; - } +bool DistanceAttributes::hasValues() const +{ + return hasType; +} +std::ostream &DistanceAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& DistanceAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool DistanceAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DistanceAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DistanceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type")) { - const char* const className = "DistanceAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DistanceAttributes.h b/Sourcecode/private/mx/core/elements/DistanceAttributes.h index d69bf7af3..433820253 100644 --- a/Sourcecode/private/mx/core/elements/DistanceAttributes.h +++ b/Sourcecode/private/mx/core/elements/DistanceAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DistanceAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DistanceAttributes) - struct DistanceAttributes : public AttributesInterface - { - public: - DistanceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - DistanceType type; - const bool hasType; +struct DistanceAttributes : public AttributesInterface +{ + public: + DistanceAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + DistanceType type; + const bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Divisions.cpp b/Sourcecode/private/mx/core/elements/Divisions.cpp index dc865f84f..f3bd169ef 100644 --- a/Sourcecode/private/mx/core/elements/Divisions.cpp +++ b/Sourcecode/private/mx/core/elements/Divisions.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - Divisions::Divisions() - :myValue() - {} - - - Divisions::Divisions( const PositiveDivisionsValue& value ) - :myValue( value ) - {} - - - bool Divisions::hasAttributes() const - { - return false; - } - - - bool Divisions::hasContents() const - { - return true; - } - - - std::ostream& Divisions::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Divisions::streamName( std::ostream& os ) const - { - os << "divisions"; - return os; - } +namespace core +{ +Divisions::Divisions() : myValue() +{ +} +Divisions::Divisions(const PositiveDivisionsValue &value) : myValue(value) +{ +} - std::ostream& Divisions::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Divisions::hasAttributes() const +{ + return false; +} +bool Divisions::hasContents() const +{ + return true; +} - PositiveDivisionsValue Divisions::getValue() const - { - return myValue; - } +std::ostream &Divisions::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Divisions::streamName(std::ostream &os) const +{ + os << "divisions"; + return os; +} - void Divisions::setValue( const PositiveDivisionsValue& value ) - { - myValue = value; - } +std::ostream &Divisions::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PositiveDivisionsValue Divisions::getValue() const +{ + return myValue; +} - bool Divisions::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue.parse( xelement.getValue() ); - return true; - } +void Divisions::setValue(const PositiveDivisionsValue &value) +{ + myValue = value; +} - } +bool Divisions::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Divisions.h b/Sourcecode/private/mx/core/elements/Divisions.h index b5a53a9d3..6b44f37c7 100644 --- a/Sourcecode/private/mx/core/elements/Divisions.h +++ b/Sourcecode/private/mx/core/elements/Divisions.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Divisions ) - - inline DivisionsPtr makeDivisions() { return std::make_shared(); } - inline DivisionsPtr makeDivisions( const PositiveDivisionsValue& value ) { return std::make_shared( value ); } - inline DivisionsPtr makeDivisions( PositiveDivisionsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Divisions : public ElementInterface - { - public: - Divisions(); - Divisions( const PositiveDivisionsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveDivisionsValue getValue() const; - void setValue( const PositiveDivisionsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveDivisionsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Divisions) + +inline DivisionsPtr makeDivisions() +{ + return std::make_shared(); } + +inline DivisionsPtr makeDivisions(const PositiveDivisionsValue &value) +{ + return std::make_shared(value); +} + +inline DivisionsPtr makeDivisions(PositiveDivisionsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Divisions : public ElementInterface +{ + public: + Divisions(); + Divisions(const PositiveDivisionsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PositiveDivisionsValue getValue() const; + void setValue(const PositiveDivisionsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveDivisionsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Doit.cpp b/Sourcecode/private/mx/core/elements/Doit.cpp index 33c4c85b0..7678da48f 100644 --- a/Sourcecode/private/mx/core/elements/Doit.cpp +++ b/Sourcecode/private/mx/core/elements/Doit.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Doit::Doit() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Doit::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Doit::hasContents() const { return false; } - std::ostream& Doit::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Doit::streamName( std::ostream& os ) const { os << "doit"; return os; } - std::ostream& Doit::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Doit::Doit() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Doit::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyLineAttributesPtr Doit::getAttributes() const - { - return myAttributes; - } +bool Doit::hasContents() const +{ + return false; +} +std::ostream &Doit::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Doit::setAttributes( const EmptyLineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Doit::streamName(std::ostream &os) const +{ + os << "doit"; + return os; +} +std::ostream &Doit::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Doit::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyLineAttributesPtr Doit::getAttributes() const +{ + return myAttributes; +} +void Doit::setAttributes(const EmptyLineAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Doit::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Doit.h b/Sourcecode/private/mx/core/elements/Doit.h index 65e21ef5a..4f2d32be8 100644 --- a/Sourcecode/private/mx/core/elements/Doit.h +++ b/Sourcecode/private/mx/core/elements/Doit.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyLineAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Doit ) - - inline DoitPtr makeDoit() { return std::make_shared(); } - - class Doit : public ElementInterface - { - public: - Doit(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyLineAttributesPtr getAttributes() const; - void setAttributes( const EmptyLineAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyLineAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyLineAttributes) +MX_FORWARD_DECLARE_ELEMENT(Doit) + +inline DoitPtr makeDoit() +{ + return std::make_shared(); } + +class Doit : public ElementInterface +{ + public: + Doit(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyLineAttributesPtr getAttributes() const; + void setAttributes(const EmptyLineAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyLineAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Dot.cpp b/Sourcecode/private/mx/core/elements/Dot.cpp index d2270265c..f45402ccc 100644 --- a/Sourcecode/private/mx/core/elements/Dot.cpp +++ b/Sourcecode/private/mx/core/elements/Dot.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Dot::Dot() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Dot::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Dot::hasContents() const { return false; } - std::ostream& Dot::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Dot::streamName( std::ostream& os ) const { os << "dot"; return os; } - std::ostream& Dot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Dot::Dot() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Dot::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Dot::getAttributes() const - { - return myAttributes; - } +bool Dot::hasContents() const +{ + return false; +} +std::ostream &Dot::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Dot::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Dot::streamName(std::ostream &os) const +{ + os << "dot"; + return os; +} +std::ostream &Dot::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Dot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Dot::getAttributes() const +{ + return myAttributes; +} +void Dot::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Dot::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Dot.h b/Sourcecode/private/mx/core/elements/Dot.h index 09b956b90..a5eb15aaf 100644 --- a/Sourcecode/private/mx/core/elements/Dot.h +++ b/Sourcecode/private/mx/core/elements/Dot.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Dot ) - - inline DotPtr makeDot() { return std::make_shared(); } - - class Dot : public ElementInterface - { - public: - Dot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Dot) + +inline DotPtr makeDot() +{ + return std::make_shared(); } + +class Dot : public ElementInterface +{ + public: + Dot(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Double.cpp b/Sourcecode/private/mx/core/elements/Double.cpp index 36f429309..850e13f06 100644 --- a/Sourcecode/private/mx/core/elements/Double.cpp +++ b/Sourcecode/private/mx/core/elements/Double.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Double::Double() : ElementInterface() {} - +namespace core +{ +Double::Double() : ElementInterface() +{ +} - bool Double::hasAttributes() const { return false; } +bool Double::hasAttributes() const +{ + return false; +} +bool Double::hasContents() const +{ + return false; +} - bool Double::hasContents() const { return false; } - std::ostream& Double::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Double::streamName( std::ostream& os ) const { os << "double"; return os; } - std::ostream& Double::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Double::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Double::streamName(std::ostream &os) const +{ + os << "double"; + return os; +} - bool Double::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &Double::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Double::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Double.h b/Sourcecode/private/mx/core/elements/Double.h index 22866f740..5cbff691f 100644 --- a/Sourcecode/private/mx/core/elements/Double.h +++ b/Sourcecode/private/mx/core/elements/Double.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Double ) - - inline DoublePtr makeDouble() { return std::make_shared(); } - - class Double : public ElementInterface - { - public: - Double(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Double) + +inline DoublePtr makeDouble() +{ + return std::make_shared(); } + +class Double : public ElementInterface +{ + public: + Double(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DoubleTongue.cpp b/Sourcecode/private/mx/core/elements/DoubleTongue.cpp index b2a949d65..efe0ac0e6 100644 --- a/Sourcecode/private/mx/core/elements/DoubleTongue.cpp +++ b/Sourcecode/private/mx/core/elements/DoubleTongue.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - DoubleTongue::DoubleTongue() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DoubleTongue::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DoubleTongue::hasContents() const { return false; } - std::ostream& DoubleTongue::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DoubleTongue::streamName( std::ostream& os ) const { os << "double-tongue"; return os; } - std::ostream& DoubleTongue::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +DoubleTongue::DoubleTongue() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool DoubleTongue::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr DoubleTongue::getAttributes() const - { - return myAttributes; - } +bool DoubleTongue::hasContents() const +{ + return false; +} +std::ostream &DoubleTongue::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void DoubleTongue::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DoubleTongue::streamName(std::ostream &os) const +{ + os << "double-tongue"; + return os; +} +std::ostream &DoubleTongue::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool DoubleTongue::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr DoubleTongue::getAttributes() const +{ + return myAttributes; +} +void DoubleTongue::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool DoubleTongue::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DoubleTongue.h b/Sourcecode/private/mx/core/elements/DoubleTongue.h index b643fcdda..18a20184b 100644 --- a/Sourcecode/private/mx/core/elements/DoubleTongue.h +++ b/Sourcecode/private/mx/core/elements/DoubleTongue.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DoubleTongue ) - - inline DoubleTonguePtr makeDoubleTongue() { return std::make_shared(); } - - class DoubleTongue : public ElementInterface - { - public: - DoubleTongue(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(DoubleTongue) + +inline DoubleTonguePtr makeDoubleTongue() +{ + return std::make_shared(); } + +class DoubleTongue : public ElementInterface +{ + public: + DoubleTongue(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DownBow.cpp b/Sourcecode/private/mx/core/elements/DownBow.cpp index 4da6954cf..5cafdf278 100644 --- a/Sourcecode/private/mx/core/elements/DownBow.cpp +++ b/Sourcecode/private/mx/core/elements/DownBow.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - DownBow::DownBow() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DownBow::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DownBow::hasContents() const { return false; } - std::ostream& DownBow::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DownBow::streamName( std::ostream& os ) const { os << "down-bow"; return os; } - std::ostream& DownBow::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +DownBow::DownBow() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool DownBow::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr DownBow::getAttributes() const - { - return myAttributes; - } +bool DownBow::hasContents() const +{ + return false; +} +std::ostream &DownBow::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void DownBow::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &DownBow::streamName(std::ostream &os) const +{ + os << "down-bow"; + return os; +} +std::ostream &DownBow::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool DownBow::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr DownBow::getAttributes() const +{ + return myAttributes; +} +void DownBow::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool DownBow::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DownBow.h b/Sourcecode/private/mx/core/elements/DownBow.h index 76c6188f1..d27dd5aee 100644 --- a/Sourcecode/private/mx/core/elements/DownBow.h +++ b/Sourcecode/private/mx/core/elements/DownBow.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DownBow ) - - inline DownBowPtr makeDownBow() { return std::make_shared(); } - - class DownBow : public ElementInterface - { - public: - DownBow(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(DownBow) + +inline DownBowPtr makeDownBow() +{ + return std::make_shared(); } + +class DownBow : public ElementInterface +{ + public: + DownBow(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Duration.cpp b/Sourcecode/private/mx/core/elements/Duration.cpp index 2c1819691..1ad9d47fc 100644 --- a/Sourcecode/private/mx/core/elements/Duration.cpp +++ b/Sourcecode/private/mx/core/elements/Duration.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Duration::Duration() - :myValue(1.0) - {} - - - Duration::Duration( const PositiveDivisionsValue& value ) - :myValue( value ) - {} - - - bool Duration::hasAttributes() const - { - return false; - } - - - bool Duration::hasContents() const - { - return true; - } - - - std::ostream& Duration::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Duration::streamName( std::ostream& os ) const - { - os << "duration"; - return os; - } +namespace core +{ +Duration::Duration() : myValue(1.0) +{ +} +Duration::Duration(const PositiveDivisionsValue &value) : myValue(value) +{ +} - std::ostream& Duration::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Duration::hasAttributes() const +{ + return false; +} +bool Duration::hasContents() const +{ + return true; +} - PositiveDivisionsValue Duration::getValue() const - { - return myValue; - } +std::ostream &Duration::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Duration::streamName(std::ostream &os) const +{ + os << "duration"; + return os; +} - void Duration::setValue( const PositiveDivisionsValue& value ) - { - myValue = value; - } +std::ostream &Duration::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PositiveDivisionsValue Duration::getValue() const +{ + return myValue; +} - bool Duration::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Duration::setValue(const PositiveDivisionsValue &value) +{ + myValue = value; +} - } +bool Duration::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Duration.h b/Sourcecode/private/mx/core/elements/Duration.h index c75a3f3d9..5bd568a62 100644 --- a/Sourcecode/private/mx/core/elements/Duration.h +++ b/Sourcecode/private/mx/core/elements/Duration.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Duration ) - - inline DurationPtr makeDuration() { return std::make_shared(); } - inline DurationPtr makeDuration( const PositiveDivisionsValue& value ) { return std::make_shared( value ); } - inline DurationPtr makeDuration( PositiveDivisionsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Duration : public ElementInterface - { - public: - Duration(); - Duration( const PositiveDivisionsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveDivisionsValue getValue() const; - void setValue( const PositiveDivisionsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveDivisionsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Duration) + +inline DurationPtr makeDuration() +{ + return std::make_shared(); } + +inline DurationPtr makeDuration(const PositiveDivisionsValue &value) +{ + return std::make_shared(value); +} + +inline DurationPtr makeDuration(PositiveDivisionsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Duration : public ElementInterface +{ + public: + Duration(); + Duration(const PositiveDivisionsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PositiveDivisionsValue getValue() const; + void setValue(const PositiveDivisionsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveDivisionsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Dynamics.cpp b/Sourcecode/private/mx/core/elements/Dynamics.cpp index 56752ac72..b9b1d4bda 100644 --- a/Sourcecode/private/mx/core/elements/Dynamics.cpp +++ b/Sourcecode/private/mx/core/elements/Dynamics.cpp @@ -8,113 +8,102 @@ namespace mx { - namespace core - { - Dynamics::Dynamics( const DynamicsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - Dynamics::Dynamics() - :myValue() - ,myAttributes( std::make_shared() ) - {} - std::ostream& Dynamics::streamName( std::ostream& os ) const - { - return os << "dynamics"; - } - - - std::ostream& Dynamics::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - if ( myValue.getValue() == DynamicsEnum::otherDynamics ) - { - indent( os, indentLevel + 1 ); - os << "<"; - core::toStream( os, myValue.getValue() ); - os << ">"; - os << myValue; - os << ""; - } - else - { - indent( os, indentLevel + 1 ); - os << "<"; - core::toStream( os, myValue.getValue() ); - os << "/>"; - } - os << std::endl; - return os; - } +namespace core +{ +Dynamics::Dynamics(const DynamicsValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} +Dynamics::Dynamics() : myValue(), myAttributes(std::make_shared()) +{ +} - DynamicsAttributesPtr Dynamics::getAttributes() const - { - return myAttributes; - } +std::ostream &Dynamics::streamName(std::ostream &os) const +{ + return os << "dynamics"; +} +std::ostream &Dynamics::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + if (myValue.getValue() == DynamicsEnum::otherDynamics) + { + indent(os, indentLevel + 1); + os << "<"; + core::toStream(os, myValue.getValue()); + os << ">"; + os << myValue; + os << ""; + } + else + { + indent(os, indentLevel + 1); + os << "<"; + core::toStream(os, myValue.getValue()); + os << "/>"; + } + os << std::endl; + return os; +} - bool Dynamics::hasAttributes() const - { - return myAttributes->hasValues(); - } +DynamicsAttributesPtr Dynamics::getAttributes() const +{ + return myAttributes; +} +bool Dynamics::hasAttributes() const +{ + return myAttributes->hasValues(); +} - bool Dynamics::hasContents() const - { - return true; - } +bool Dynamics::hasContents() const +{ + return true; +} +std::ostream &Dynamics::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - std::ostream& Dynamics::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +DynamicsValue Dynamics::getValue() const +{ + return myValue; +} +void Dynamics::setValue(const DynamicsValue &value) +{ + myValue = value; +} - DynamicsValue Dynamics::getValue() const - { - return myValue; - } +bool Dynamics::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + auto b = xelement.begin(); + auto e = xelement.end(); - void Dynamics::setValue( const DynamicsValue& value ) + if (b != e) + { + if (b->getName() == "other-dynamics") { - myValue = value; + myValue.setValue(b->getValue()); + MX_RETURN_IS_SUCCESS; } - - - bool Dynamics::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + else { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - - auto b = xelement.begin(); - auto e = xelement.end(); - - if( b != e ) - { - if( b->getName() == "other-dynamics" ) - { - myValue.setValue( b->getValue() ); - MX_RETURN_IS_SUCCESS; - } - else - { - myValue.setValue( b->getName() ); - MX_RETURN_IS_SUCCESS; - } - } - - message << "Dynamics: parsing failed" << std::endl; - return false; + myValue.setValue(b->getName()); + MX_RETURN_IS_SUCCESS; } - } + + message << "Dynamics: parsing failed" << std::endl; + return false; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Dynamics.h b/Sourcecode/private/mx/core/elements/Dynamics.h index 8efe2df89..729ec75a6 100644 --- a/Sourcecode/private/mx/core/elements/Dynamics.h +++ b/Sourcecode/private/mx/core/elements/Dynamics.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/DynamicsAttributes.h" #include @@ -15,39 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DynamicsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Dynamics ) - - inline DynamicsPtr makeDynamics() { return std::make_shared(); } - inline DynamicsPtr makeDynamics( const DynamicsValue& value ) { return std::make_shared( value ); } - inline DynamicsPtr makeDynamics( DynamicsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Dynamics : public ElementInterface - { - public: - Dynamics( const DynamicsValue& value ); - Dynamics(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DynamicsAttributesPtr getAttributes() const; - void setAttributes( const DynamicsAttributes& attributes ); - DynamicsValue getValue() const; - void setValue( const DynamicsValue& value ); - - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DynamicsValue myValue; - DynamicsAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(DynamicsAttributes) +MX_FORWARD_DECLARE_ELEMENT(Dynamics) + +inline DynamicsPtr makeDynamics() +{ + return std::make_shared(); +} + +inline DynamicsPtr makeDynamics(const DynamicsValue &value) +{ + return std::make_shared(value); } + +inline DynamicsPtr makeDynamics(DynamicsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Dynamics : public ElementInterface +{ + public: + Dynamics(const DynamicsValue &value); + Dynamics(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + DynamicsAttributesPtr getAttributes() const; + void setAttributes(const DynamicsAttributes &attributes); + DynamicsValue getValue() const; + void setValue(const DynamicsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DynamicsValue myValue; + DynamicsAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp b/Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp index 43d8d3975..f02c25b2f 100644 --- a/Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp @@ -8,105 +8,127 @@ namespace mx { - namespace core - { - DynamicsAttributes::DynamicsAttributes() - :hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasPlacement( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasEnclosure( false ) - {} - +namespace core +{ +DynamicsAttributes::DynamicsAttributes() + : hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasHalign(false), + hasValign(false), hasPlacement(false), hasUnderline(false), hasOverline(false), hasLineThrough(false), + hasEnclosure(false) +{ +} - bool DynamicsAttributes::hasValues() const - { - return hasDefaultX - || hasDefaultY - || hasRelativeX - || hasRelativeY - || hasFontFamily - || hasFontStyle - || hasFontSize - || hasFontWeight - || hasColor - || hasHalign - || hasValign - || hasPlacement - || hasUnderline - || hasOverline - || hasLineThrough - || hasEnclosure; - } +bool DynamicsAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasHalign || hasValign || hasPlacement || hasUnderline || hasOverline || + hasLineThrough || hasEnclosure; +} +std::ostream &DynamicsAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, valign, "valign", hasValign); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, underline, "underline", hasUnderline); + streamAttribute(os, overline, "overline", hasOverline); + streamAttribute(os, lineThrough, "line-through", hasLineThrough); + streamAttribute(os, enclosure, "enclosure", hasEnclosure); + } + return os; +} - std::ostream& DynamicsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } +bool DynamicsAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "DynamicsAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool DynamicsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DynamicsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, valign, hasValign, "valign", &parseValign)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, underline, hasUnderline, "underline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, overline, hasOverline, "overline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", + &parseEnclosureShape)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/DynamicsAttributes.h b/Sourcecode/private/mx/core/elements/DynamicsAttributes.h index 660b516ee..efc892784 100644 --- a/Sourcecode/private/mx/core/elements/DynamicsAttributes.h +++ b/Sourcecode/private/mx/core/elements/DynamicsAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -19,52 +19,52 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( DynamicsAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(DynamicsAttributes) - struct DynamicsAttributes : public AttributesInterface - { - public: - DynamicsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - AboveBelow placement; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - EnclosureShape enclosure; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasPlacement; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasEnclosure; +struct DynamicsAttributes : public AttributesInterface +{ + public: + DynamicsAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + LeftCenterRight halign; + Valign valign; + AboveBelow placement; + NumberOfLines underline; + NumberOfLines overline; + NumberOfLines lineThrough; + EnclosureShape enclosure; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasHalign; + bool hasValign; + bool hasPlacement; + bool hasUnderline; + bool hasOverline; + bool hasLineThrough; + bool hasEnclosure; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EditorialGroup.cpp b/Sourcecode/private/mx/core/elements/EditorialGroup.cpp index d4fc13115..b7c94ca4e 100644 --- a/Sourcecode/private/mx/core/elements/EditorialGroup.cpp +++ b/Sourcecode/private/mx/core/elements/EditorialGroup.cpp @@ -10,114 +10,98 @@ namespace mx { - namespace core - { - EditorialGroup::EditorialGroup() - :myFootnote( makeFootnote() ) - ,myHasFootnote( false ) - ,myLevel( makeLevel() ) - ,myHasLevel( false ) - {} - - - bool EditorialGroup::hasAttributes() const - { - return false; - } - - - std::ostream& EditorialGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EditorialGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool EditorialGroup::hasContents() const - { - return myHasFootnote || myHasLevel; - } - - - std::ostream& EditorialGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = true; - if ( myHasFootnote ) - { - myFootnote->toStream( os, indentLevel ); - if ( myHasLevel ) - { - os << std::endl; - isOneLineOnly = false; - } - } - if ( myHasLevel ) - { - myLevel->toStream( os, indentLevel ); - } - return os; - } - - - FootnotePtr EditorialGroup::getFootnote() const - { - return myFootnote; - } - +namespace core +{ +EditorialGroup::EditorialGroup() + : myFootnote(makeFootnote()), myHasFootnote(false), myLevel(makeLevel()), myHasLevel(false) +{ +} - void EditorialGroup::setFootnote( const FootnotePtr& value ) - { - if ( value ) - { - myFootnote = value; - } - } +bool EditorialGroup::hasAttributes() const +{ + return false; +} +std::ostream &EditorialGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - bool EditorialGroup::getHasFootnote() const - { - return myHasFootnote; - } +std::ostream &EditorialGroup::streamName(std::ostream &os) const +{ + return os; +} +bool EditorialGroup::hasContents() const +{ + return myHasFootnote || myHasLevel; +} - void EditorialGroup::setHasFootnote( const bool value ) +std::ostream &EditorialGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = true; + if (myHasFootnote) + { + myFootnote->toStream(os, indentLevel); + if (myHasLevel) { - myHasFootnote = value; + os << std::endl; + isOneLineOnly = false; } + } + if (myHasLevel) + { + myLevel->toStream(os, indentLevel); + } + return os; +} +FootnotePtr EditorialGroup::getFootnote() const +{ + return myFootnote; +} - LevelPtr EditorialGroup::getLevel() const - { - return myLevel; - } - +void EditorialGroup::setFootnote(const FootnotePtr &value) +{ + if (value) + { + myFootnote = value; + } +} - void EditorialGroup::setLevel( const LevelPtr& value ) - { - if ( value ) - { - myLevel = value; - } - } +bool EditorialGroup::getHasFootnote() const +{ + return myHasFootnote; +} +void EditorialGroup::setHasFootnote(const bool value) +{ + myHasFootnote = value; +} - bool EditorialGroup::getHasLevel() const - { - return myHasLevel; - } +LevelPtr EditorialGroup::getLevel() const +{ + return myLevel; +} +void EditorialGroup::setLevel(const LevelPtr &value) +{ + if (value) + { + myLevel = value; + } +} - void EditorialGroup::setHasLevel( const bool value ) - { - myHasLevel = value; - } +bool EditorialGroup::getHasLevel() const +{ + return myHasLevel; +} - - MX_FROM_XELEMENT_UNUSED( EditorialGroup ); - } +void EditorialGroup::setHasLevel(const bool value) +{ + myHasLevel = value; } + +MX_FROM_XELEMENT_UNUSED(EditorialGroup); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EditorialGroup.h b/Sourcecode/private/mx/core/elements/EditorialGroup.h index eaeeb3818..e2cb256c6 100644 --- a/Sourcecode/private/mx/core/elements/EditorialGroup.h +++ b/Sourcecode/private/mx/core/elements/EditorialGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,46 +13,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - MX_FORWARD_DECLARE_ELEMENT( Level ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - - inline EditorialGroupPtr makeEditorialGroup() { return std::make_shared(); } - - class EditorialGroup : public ElementInterface - { - public: - EditorialGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ - FootnotePtr getFootnote() const; - void setFootnote( const FootnotePtr& value ); - bool getHasFootnote() const; - void setHasFootnote( const bool value ); - - /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ - LevelPtr getLevel() const; - void setLevel( const LevelPtr& value ); - bool getHasLevel() const; - void setHasLevel( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FootnotePtr myFootnote; - bool myHasFootnote; - LevelPtr myLevel; - bool myHasLevel; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Footnote) +MX_FORWARD_DECLARE_ELEMENT(Level) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) + +inline EditorialGroupPtr makeEditorialGroup() +{ + return std::make_shared(); } + +class EditorialGroup : public ElementInterface +{ + public: + EditorialGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ + FootnotePtr getFootnote() const; + void setFootnote(const FootnotePtr &value); + bool getHasFootnote() const; + void setHasFootnote(const bool value); + + /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ + LevelPtr getLevel() const; + void setLevel(const LevelPtr &value); + bool getHasLevel() const; + void setHasLevel(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + FootnotePtr myFootnote; + bool myHasFootnote; + LevelPtr myLevel; + bool myHasLevel; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp b/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp index a4edc08e6..73170a609 100644 --- a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp +++ b/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp @@ -11,150 +11,132 @@ namespace mx { - namespace core - { - EditorialVoiceDirectionGroup::EditorialVoiceDirectionGroup() - :myFootnote( makeFootnote() ) - ,myHasFootnote( false ) - ,myLevel( makeLevel() ) - ,myHasLevel( false ) - ,myVoice( makeVoice() ) - ,myHasVoice( false ) - {} - - - bool EditorialVoiceDirectionGroup::hasAttributes() const - { - return false; - } - - - std::ostream& EditorialVoiceDirectionGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EditorialVoiceDirectionGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool EditorialVoiceDirectionGroup::hasContents() const - { - return myHasFootnote || myHasLevel || myHasVoice; - } - - - std::ostream& EditorialVoiceDirectionGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - bool firstItem = true; - isOneLineOnly = true; - if ( myHasFootnote ) - { - myFootnote->toStream( os, indentLevel ); - firstItem = false; - } - if ( myHasLevel ) - { - if( ! firstItem ) os << std::endl; - myLevel->toStream( os, indentLevel ); - firstItem = false; - } - if ( myHasVoice ) - { - if( ! firstItem ) os << std::endl; - myVoice->toStream( os, indentLevel ); - firstItem = false; - } - isOneLineOnly = ! hasContents(); - return os; - } - - - FootnotePtr EditorialVoiceDirectionGroup::getFootnote() const - { - return myFootnote; - } +namespace core +{ +EditorialVoiceDirectionGroup::EditorialVoiceDirectionGroup() + : myFootnote(makeFootnote()), myHasFootnote(false), myLevel(makeLevel()), myHasLevel(false), myVoice(makeVoice()), + myHasVoice(false) +{ +} +bool EditorialVoiceDirectionGroup::hasAttributes() const +{ + return false; +} - void EditorialVoiceDirectionGroup::setFootnote( const FootnotePtr& value ) - { - if ( value ) - { - myFootnote = value; - } - } +std::ostream &EditorialVoiceDirectionGroup::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &EditorialVoiceDirectionGroup::streamName(std::ostream &os) const +{ + return os; +} - bool EditorialVoiceDirectionGroup::getHasFootnote() const - { - return myHasFootnote; - } +bool EditorialVoiceDirectionGroup::hasContents() const +{ + return myHasFootnote || myHasLevel || myHasVoice; +} +std::ostream &EditorialVoiceDirectionGroup::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + bool firstItem = true; + isOneLineOnly = true; + if (myHasFootnote) + { + myFootnote->toStream(os, indentLevel); + firstItem = false; + } + if (myHasLevel) + { + if (!firstItem) + os << std::endl; + myLevel->toStream(os, indentLevel); + firstItem = false; + } + if (myHasVoice) + { + if (!firstItem) + os << std::endl; + myVoice->toStream(os, indentLevel); + firstItem = false; + } + isOneLineOnly = !hasContents(); + return os; +} - void EditorialVoiceDirectionGroup::setHasFootnote( const bool value ) - { - myHasFootnote = value; - } +FootnotePtr EditorialVoiceDirectionGroup::getFootnote() const +{ + return myFootnote; +} +void EditorialVoiceDirectionGroup::setFootnote(const FootnotePtr &value) +{ + if (value) + { + myFootnote = value; + } +} - LevelPtr EditorialVoiceDirectionGroup::getLevel() const - { - return myLevel; - } +bool EditorialVoiceDirectionGroup::getHasFootnote() const +{ + return myHasFootnote; +} +void EditorialVoiceDirectionGroup::setHasFootnote(const bool value) +{ + myHasFootnote = value; +} - void EditorialVoiceDirectionGroup::setLevel( const LevelPtr& value ) - { - if ( value ) - { - myLevel = value; - } - } +LevelPtr EditorialVoiceDirectionGroup::getLevel() const +{ + return myLevel; +} +void EditorialVoiceDirectionGroup::setLevel(const LevelPtr &value) +{ + if (value) + { + myLevel = value; + } +} - bool EditorialVoiceDirectionGroup::getHasLevel() const - { - return myHasLevel; - } +bool EditorialVoiceDirectionGroup::getHasLevel() const +{ + return myHasLevel; +} +void EditorialVoiceDirectionGroup::setHasLevel(const bool value) +{ + myHasLevel = value; +} - void EditorialVoiceDirectionGroup::setHasLevel( const bool value ) - { - myHasLevel = value; - } +VoicePtr EditorialVoiceDirectionGroup::getVoice() const +{ + return myVoice; +} +void EditorialVoiceDirectionGroup::setVoice(const VoicePtr &value) +{ + if (value) + { + myVoice = value; + } +} - VoicePtr EditorialVoiceDirectionGroup::getVoice() const - { - return myVoice; - } +bool EditorialVoiceDirectionGroup::getHasVoice() const +{ + return myHasVoice; +} +void EditorialVoiceDirectionGroup::setHasVoice(const bool value) +{ + myHasVoice = value; +} - void EditorialVoiceDirectionGroup::setVoice( const VoicePtr& value ) - { - if ( value ) - { - myVoice = value; - } - } - - - bool EditorialVoiceDirectionGroup::getHasVoice() const - { - return myHasVoice; - } - - - void EditorialVoiceDirectionGroup::setHasVoice( const bool value ) - { - myHasVoice = value; - } - - - MX_FROM_XELEMENT_UNUSED( EditorialVoiceDirectionGroup ); +MX_FROM_XELEMENT_UNUSED(EditorialVoiceDirectionGroup); - } -} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h b/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h index de43ded5e..bd23561d7 100644 --- a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h +++ b/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,56 +13,58 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - MX_FORWARD_DECLARE_ELEMENT( Level ) - MX_FORWARD_DECLARE_ELEMENT( Voice ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceDirectionGroup ) +MX_FORWARD_DECLARE_ELEMENT(Footnote) +MX_FORWARD_DECLARE_ELEMENT(Level) +MX_FORWARD_DECLARE_ELEMENT(Voice) +MX_FORWARD_DECLARE_ELEMENT(EditorialVoiceDirectionGroup) - inline EditorialVoiceDirectionGroupPtr makeEditorialVoiceDirectionGroup() { return std::make_shared(); } - +inline EditorialVoiceDirectionGroupPtr makeEditorialVoiceDirectionGroup() +{ + return std::make_shared(); +} - class EditorialVoiceDirectionGroup : public ElementInterface - { - public: - EditorialVoiceDirectionGroup(); +class EditorialVoiceDirectionGroup : public ElementInterface +{ + public: + EditorialVoiceDirectionGroup(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ - FootnotePtr getFootnote() const; - void setFootnote( const FootnotePtr& value ); - bool getHasFootnote() const; - void setHasFootnote( const bool value ); + /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ + FootnotePtr getFootnote() const; + void setFootnote(const FootnotePtr &value); + bool getHasFootnote() const; + void setHasFootnote(const bool value); - /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ - LevelPtr getLevel() const; - void setLevel( const LevelPtr& value ); - bool getHasLevel() const; - void setHasLevel( const bool value ); + /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ + LevelPtr getLevel() const; + void setLevel(const LevelPtr &value); + bool getHasLevel() const; + void setHasLevel(const bool value); - /* _________ Voice minOccurs = 0, maxOccurs = 1 _________ */ - VoicePtr getVoice() const; - void setVoice( const VoicePtr& value ); - bool getHasVoice() const; - void setHasVoice( const bool value ); + /* _________ Voice minOccurs = 0, maxOccurs = 1 _________ */ + VoicePtr getVoice() const; + void setVoice(const VoicePtr &value); + bool getHasVoice() const; + void setHasVoice(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - FootnotePtr myFootnote; - bool myHasFootnote; - LevelPtr myLevel; - bool myHasLevel; - VoicePtr myVoice; - bool myHasVoice; - }; - } -} + private: + FootnotePtr myFootnote; + bool myHasFootnote; + LevelPtr myLevel; + bool myHasLevel; + VoicePtr myVoice; + bool myHasVoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp b/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp index d66b0295d..5a431f0fc 100644 --- a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp +++ b/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp @@ -11,150 +11,131 @@ namespace mx { - namespace core - { - EditorialVoiceGroup::EditorialVoiceGroup() - :myFootnote( makeFootnote() ) - ,myHasFootnote( false ) - ,myLevel( makeLevel() ) - ,myHasLevel( false ) - ,myVoice( makeVoice() ) - ,myHasVoice( false ) - {} - - - bool EditorialVoiceGroup::hasAttributes() const - { - return false; - } - - - std::ostream& EditorialVoiceGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EditorialVoiceGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool EditorialVoiceGroup::hasContents() const - { - return myHasFootnote || myHasLevel || myHasVoice; - } - - - std::ostream& EditorialVoiceGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - bool firstItem = true; - isOneLineOnly = true; - if ( myHasFootnote ) - { - myFootnote->toStream( os, indentLevel ); - firstItem = false; - } - if ( myHasLevel ) - { - if( ! firstItem ) os << std::endl; - myLevel->toStream( os, indentLevel ); - firstItem = false; - } - if ( myHasVoice ) - { - if( ! firstItem ) os << std::endl; - myVoice->toStream( os, indentLevel ); - firstItem = false; - } - isOneLineOnly = ! hasContents(); - return os; - } - - - FootnotePtr EditorialVoiceGroup::getFootnote() const - { - return myFootnote; - } +namespace core +{ +EditorialVoiceGroup::EditorialVoiceGroup() + : myFootnote(makeFootnote()), myHasFootnote(false), myLevel(makeLevel()), myHasLevel(false), myVoice(makeVoice()), + myHasVoice(false) +{ +} +bool EditorialVoiceGroup::hasAttributes() const +{ + return false; +} - void EditorialVoiceGroup::setFootnote( const FootnotePtr& value ) - { - if ( value ) - { - myFootnote = value; - } - } +std::ostream &EditorialVoiceGroup::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &EditorialVoiceGroup::streamName(std::ostream &os) const +{ + return os; +} - bool EditorialVoiceGroup::getHasFootnote() const - { - return myHasFootnote; - } +bool EditorialVoiceGroup::hasContents() const +{ + return myHasFootnote || myHasLevel || myHasVoice; +} +std::ostream &EditorialVoiceGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + bool firstItem = true; + isOneLineOnly = true; + if (myHasFootnote) + { + myFootnote->toStream(os, indentLevel); + firstItem = false; + } + if (myHasLevel) + { + if (!firstItem) + os << std::endl; + myLevel->toStream(os, indentLevel); + firstItem = false; + } + if (myHasVoice) + { + if (!firstItem) + os << std::endl; + myVoice->toStream(os, indentLevel); + firstItem = false; + } + isOneLineOnly = !hasContents(); + return os; +} - void EditorialVoiceGroup::setHasFootnote( const bool value ) - { - myHasFootnote = value; - } +FootnotePtr EditorialVoiceGroup::getFootnote() const +{ + return myFootnote; +} +void EditorialVoiceGroup::setFootnote(const FootnotePtr &value) +{ + if (value) + { + myFootnote = value; + } +} - LevelPtr EditorialVoiceGroup::getLevel() const - { - return myLevel; - } +bool EditorialVoiceGroup::getHasFootnote() const +{ + return myHasFootnote; +} +void EditorialVoiceGroup::setHasFootnote(const bool value) +{ + myHasFootnote = value; +} - void EditorialVoiceGroup::setLevel( const LevelPtr& value ) - { - if ( value ) - { - myLevel = value; - } - } +LevelPtr EditorialVoiceGroup::getLevel() const +{ + return myLevel; +} +void EditorialVoiceGroup::setLevel(const LevelPtr &value) +{ + if (value) + { + myLevel = value; + } +} - bool EditorialVoiceGroup::getHasLevel() const - { - return myHasLevel; - } +bool EditorialVoiceGroup::getHasLevel() const +{ + return myHasLevel; +} +void EditorialVoiceGroup::setHasLevel(const bool value) +{ + myHasLevel = value; +} - void EditorialVoiceGroup::setHasLevel( const bool value ) - { - myHasLevel = value; - } +VoicePtr EditorialVoiceGroup::getVoice() const +{ + return myVoice; +} +void EditorialVoiceGroup::setVoice(const VoicePtr &value) +{ + if (value) + { + myVoice = value; + } +} - VoicePtr EditorialVoiceGroup::getVoice() const - { - return myVoice; - } +bool EditorialVoiceGroup::getHasVoice() const +{ + return myHasVoice; +} +void EditorialVoiceGroup::setHasVoice(const bool value) +{ + myHasVoice = value; +} - void EditorialVoiceGroup::setVoice( const VoicePtr& value ) - { - if ( value ) - { - myVoice = value; - } - } - - - bool EditorialVoiceGroup::getHasVoice() const - { - return myHasVoice; - } - - - void EditorialVoiceGroup::setHasVoice( const bool value ) - { - myHasVoice = value; - } - - - MX_FROM_XELEMENT_UNUSED( EditorialVoiceGroup ); +MX_FROM_XELEMENT_UNUSED(EditorialVoiceGroup); - } -} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h b/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h index 5072f9732..f42700749 100644 --- a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h +++ b/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,55 +13,58 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - MX_FORWARD_DECLARE_ELEMENT( Level ) - MX_FORWARD_DECLARE_ELEMENT( Voice ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceGroup ) +MX_FORWARD_DECLARE_ELEMENT(Footnote) +MX_FORWARD_DECLARE_ELEMENT(Level) +MX_FORWARD_DECLARE_ELEMENT(Voice) +MX_FORWARD_DECLARE_ELEMENT(EditorialVoiceGroup) - inline EditorialVoiceGroupPtr makeEditorialVoiceGroup() { return std::make_shared(); } +inline EditorialVoiceGroupPtr makeEditorialVoiceGroup() +{ + return std::make_shared(); +} - class EditorialVoiceGroup : public ElementInterface - { - public: - EditorialVoiceGroup(); +class EditorialVoiceGroup : public ElementInterface +{ + public: + EditorialVoiceGroup(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ - FootnotePtr getFootnote() const; - void setFootnote( const FootnotePtr& value ); - bool getHasFootnote() const; - void setHasFootnote( const bool value ); + /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ + FootnotePtr getFootnote() const; + void setFootnote(const FootnotePtr &value); + bool getHasFootnote() const; + void setHasFootnote(const bool value); - /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ - LevelPtr getLevel() const; - void setLevel( const LevelPtr& value ); - bool getHasLevel() const; - void setHasLevel( const bool value ); + /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ + LevelPtr getLevel() const; + void setLevel(const LevelPtr &value); + bool getHasLevel() const; + void setHasLevel(const bool value); - /* _________ Voice minOccurs = 0, maxOccurs = 1 _________ */ - VoicePtr getVoice() const; - void setVoice( const VoicePtr& value ); - bool getHasVoice() const; - void setHasVoice( const bool value ); + /* _________ Voice minOccurs = 0, maxOccurs = 1 _________ */ + VoicePtr getVoice() const; + void setVoice(const VoicePtr &value); + bool getHasVoice() const; + void setHasVoice(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - FootnotePtr myFootnote; - bool myHasFootnote; - LevelPtr myLevel; - bool myHasLevel; - VoicePtr myVoice; - bool myHasVoice; - }; - } -} + private: + FootnotePtr myFootnote; + bool myHasFootnote; + LevelPtr myLevel; + bool myHasLevel; + VoicePtr myVoice; + bool myHasVoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Effect.cpp b/Sourcecode/private/mx/core/elements/Effect.cpp index af1e7cac4..0ede16a6f 100644 --- a/Sourcecode/private/mx/core/elements/Effect.cpp +++ b/Sourcecode/private/mx/core/elements/Effect.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - Effect::Effect() - :myValue( EffectEnum::anvil ) - {} - - - Effect::Effect( const EffectEnum& value ) - :myValue( value ) - {} - - - bool Effect::hasAttributes() const - { - return false; - } - - - bool Effect::hasContents() const - { - return true; - } - - - std::ostream& Effect::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Effect::streamName( std::ostream& os ) const - { - os << "effect"; - return os; - } +namespace core +{ +Effect::Effect() : myValue(EffectEnum::anvil) +{ +} +Effect::Effect(const EffectEnum &value) : myValue(value) +{ +} - std::ostream& Effect::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Effect::hasAttributes() const +{ + return false; +} +bool Effect::hasContents() const +{ + return true; +} - EffectEnum Effect::getValue() const - { - return myValue; - } +std::ostream &Effect::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Effect::streamName(std::ostream &os) const +{ + os << "effect"; + return os; +} - void Effect::setValue( const EffectEnum& value ) - { - myValue = value; - } +std::ostream &Effect::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +EffectEnum Effect::getValue() const +{ + return myValue; +} - bool Effect::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseEffectEnum( xelement.getValue() ); - return true; - } +void Effect::setValue(const EffectEnum &value) +{ + myValue = value; +} - } +bool Effect::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseEffectEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Effect.h b/Sourcecode/private/mx/core/elements/Effect.h index 4ffaecc32..6356ba4a9 100644 --- a/Sourcecode/private/mx/core/elements/Effect.h +++ b/Sourcecode/private/mx/core/elements/Effect.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Effect ) - - inline EffectPtr makeEffect() { return std::make_shared(); } - inline EffectPtr makeEffect( const EffectEnum& value ) { return std::make_shared( value ); } - inline EffectPtr makeEffect( EffectEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Effect : public ElementInterface - { - public: - Effect(); - Effect( const EffectEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EffectEnum getValue() const; - void setValue( const EffectEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EffectEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Effect) + +inline EffectPtr makeEffect() +{ + return std::make_shared(); +} + +inline EffectPtr makeEffect(const EffectEnum &value) +{ + return std::make_shared(value); } + +inline EffectPtr makeEffect(EffectEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class Effect : public ElementInterface +{ + public: + Effect(); + Effect(const EffectEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EffectEnum getValue() const; + void setValue(const EffectEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EffectEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Elevation.cpp b/Sourcecode/private/mx/core/elements/Elevation.cpp index 985b512ca..08ea17c57 100644 --- a/Sourcecode/private/mx/core/elements/Elevation.cpp +++ b/Sourcecode/private/mx/core/elements/Elevation.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Elevation::Elevation() - :myValue() - {} - - - Elevation::Elevation( const RotationDegrees& value ) - :myValue( value ) - {} - - - bool Elevation::hasAttributes() const - { - return false; - } - - - bool Elevation::hasContents() const - { - return true; - } - - - std::ostream& Elevation::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Elevation::streamName( std::ostream& os ) const - { - os << "elevation"; - return os; - } +namespace core +{ +Elevation::Elevation() : myValue() +{ +} +Elevation::Elevation(const RotationDegrees &value) : myValue(value) +{ +} - std::ostream& Elevation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Elevation::hasAttributes() const +{ + return false; +} +bool Elevation::hasContents() const +{ + return true; +} - RotationDegrees Elevation::getValue() const - { - return myValue; - } +std::ostream &Elevation::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Elevation::streamName(std::ostream &os) const +{ + os << "elevation"; + return os; +} - void Elevation::setValue( const RotationDegrees& value ) - { - myValue = value; - } +std::ostream &Elevation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +RotationDegrees Elevation::getValue() const +{ + return myValue; +} - bool Elevation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Elevation::setValue(const RotationDegrees &value) +{ + myValue = value; +} - } +bool Elevation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Elevation.h b/Sourcecode/private/mx/core/elements/Elevation.h index d1e4f926e..d3af46d21 100644 --- a/Sourcecode/private/mx/core/elements/Elevation.h +++ b/Sourcecode/private/mx/core/elements/Elevation.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Elevation ) - - inline ElevationPtr makeElevation() { return std::make_shared(); } - inline ElevationPtr makeElevation( const RotationDegrees& value ) { return std::make_shared( value ); } - inline ElevationPtr makeElevation( RotationDegrees&& value ) { return std::make_shared( std::move( value ) ); } - - class Elevation : public ElementInterface - { - public: - Elevation(); - Elevation( const RotationDegrees& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RotationDegrees getValue() const; - void setValue( const RotationDegrees& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RotationDegrees myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Elevation) + +inline ElevationPtr makeElevation() +{ + return std::make_shared(); } + +inline ElevationPtr makeElevation(const RotationDegrees &value) +{ + return std::make_shared(value); +} + +inline ElevationPtr makeElevation(RotationDegrees &&value) +{ + return std::make_shared(std::move(value)); +} + +class Elevation : public ElementInterface +{ + public: + Elevation(); + Elevation(const RotationDegrees &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RotationDegrees getValue() const; + void setValue(const RotationDegrees &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + RotationDegrees myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Elision.cpp b/Sourcecode/private/mx/core/elements/Elision.cpp index cb5ed8e80..0185dc943 100644 --- a/Sourcecode/private/mx/core/elements/Elision.cpp +++ b/Sourcecode/private/mx/core/elements/Elision.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Elision::Elision() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Elision::Elision( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Elision::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Elision::hasContents() const - { - return true; - } - - - std::ostream& Elision::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Elision::streamName( std::ostream& os ) const - { - os << "elision"; - return os; - } - - - std::ostream& Elision::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Elision::Elision() : myValue(), myAttributes(std::make_shared()) +{ +} +Elision::Elision(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - ElisionAttributesPtr Elision::getAttributes() const - { - return myAttributes; - } +bool Elision::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Elision::hasContents() const +{ + return true; +} - void Elision::setAttributes( const ElisionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Elision::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Elision::streamName(std::ostream &os) const +{ + os << "elision"; + return os; +} - XsString Elision::getValue() const - { - return myValue; - } +std::ostream &Elision::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +ElisionAttributesPtr Elision::getAttributes() const +{ + return myAttributes; +} - void Elision::setValue( const XsString& value ) - { - myValue = value; - } +void Elision::setAttributes(const ElisionAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Elision::getValue() const +{ + return myValue; +} - bool Elision::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Elision::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Elision::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Elision.h b/Sourcecode/private/mx/core/elements/Elision.h index 69a98d1d0..50d43e035 100644 --- a/Sourcecode/private/mx/core/elements/Elision.h +++ b/Sourcecode/private/mx/core/elements/Elision.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/ElisionAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ElisionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Elision ) - - inline ElisionPtr makeElision() { return std::make_shared(); } - inline ElisionPtr makeElision( const XsString& value ) { return std::make_shared( value ); } - inline ElisionPtr makeElision( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Elision : public ElementInterface - { - public: - Elision(); - Elision( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ElisionAttributesPtr getAttributes() const; - void setAttributes( const ElisionAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - ElisionAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(ElisionAttributes) +MX_FORWARD_DECLARE_ELEMENT(Elision) + +inline ElisionPtr makeElision() +{ + return std::make_shared(); +} + +inline ElisionPtr makeElision(const XsString &value) +{ + return std::make_shared(value); } + +inline ElisionPtr makeElision(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Elision : public ElementInterface +{ + public: + Elision(); + Elision(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ElisionAttributesPtr getAttributes() const; + void setAttributes(const ElisionAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + ElisionAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ElisionAttributes.cpp b/Sourcecode/private/mx/core/elements/ElisionAttributes.cpp index 428546a05..c58cfad7a 100644 --- a/Sourcecode/private/mx/core/elements/ElisionAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ElisionAttributes.cpp @@ -8,92 +8,100 @@ namespace mx { - namespace core +namespace core +{ +ElisionAttributes::ElisionAttributes() + : fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), underline(), overline(), lineThrough(), rotation(), letterSpacing(), + lang(XmlLang{"it"}), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasUnderline(false), hasOverline(false), hasLineThrough(false), hasRotation(false), hasLetterSpacing(false), + hasLang(false) +{ +} + +bool ElisionAttributes::hasValues() const +{ + return hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasUnderline || hasOverline || + hasLineThrough || hasRotation || hasLetterSpacing || hasLang; +} + +std::ostream &ElisionAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - ElisionAttributes::ElisionAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lang( XmlLang{ "it" } ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLang( false ) - {} + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, underline, "underline", hasUnderline); + streamAttribute(os, overline, "overline", hasOverline); + streamAttribute(os, lineThrough, "line-through", hasLineThrough); + streamAttribute(os, rotation, "rotation", hasRotation); + streamAttribute(os, letterSpacing, "letter-spacing", hasLetterSpacing); + streamAttribute(os, lang, "xml:lang", hasLang); + } + return os; +} + +bool ElisionAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ElisionAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool ElisionAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLang; + continue; } - - - std::ostream& ElisionAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lang, "xml:lang", hasLang ); - } - return os; + continue; } - - - bool ElisionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) { - const char* const className = "ElisionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, underline, hasUnderline, "underline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, overline, hasOverline, "overline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, rotation, hasRotation, "rotation")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "xml:lang")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ElisionAttributes.h b/Sourcecode/private/mx/core/elements/ElisionAttributes.h index 4bf65a621..6d629667f 100644 --- a/Sourcecode/private/mx/core/elements/ElisionAttributes.h +++ b/Sourcecode/private/mx/core/elements/ElisionAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/NumberOrNormal.h" #include "mx/core/XmlLang.h" @@ -20,40 +20,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ElisionAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(ElisionAttributes) - struct ElisionAttributes : public AttributesInterface - { - public: - ElisionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - XmlLang lang; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLang; +struct ElisionAttributes : public AttributesInterface +{ + public: + ElisionAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + NumberOfLines underline; + NumberOfLines overline; + NumberOfLines lineThrough; + RotationDegrees rotation; + NumberOrNormal letterSpacing; + XmlLang lang; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasUnderline; + bool hasOverline; + bool hasLineThrough; + bool hasRotation; + bool hasLetterSpacing; + bool hasLang; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp b/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp index c11b05197..f038c121e 100644 --- a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp +++ b/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp @@ -10,96 +10,83 @@ namespace mx { - namespace core - { - ElisionSyllabicGroup::ElisionSyllabicGroup() - :myElision( makeElision() ) - ,mySyllabic( makeSyllabic() ) - ,myHasSyllabic( false ) - {} - - - bool ElisionSyllabicGroup::hasAttributes() const - { - return false; - } - - - std::ostream& ElisionSyllabicGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ElisionSyllabicGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool ElisionSyllabicGroup::hasContents() const - { - return true; - } - +namespace core +{ +ElisionSyllabicGroup::ElisionSyllabicGroup() + : myElision(makeElision()), mySyllabic(makeSyllabic()), myHasSyllabic(false) +{ +} - std::ostream& ElisionSyllabicGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = true; - myElision->toStream( os, indentLevel ); - if ( myHasSyllabic ) - { - isOneLineOnly = false; - os << std::endl; - mySyllabic->toStream( os, indentLevel ); - } - return os; - } +bool ElisionSyllabicGroup::hasAttributes() const +{ + return false; +} +std::ostream &ElisionSyllabicGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - ElisionPtr ElisionSyllabicGroup::getElision() const - { - return myElision; - } +std::ostream &ElisionSyllabicGroup::streamName(std::ostream &os) const +{ + return os; +} +bool ElisionSyllabicGroup::hasContents() const +{ + return true; +} - void ElisionSyllabicGroup::setElision( const ElisionPtr& value ) - { - if ( value ) - { - myElision = value; - } - } +std::ostream &ElisionSyllabicGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = true; + myElision->toStream(os, indentLevel); + if (myHasSyllabic) + { + isOneLineOnly = false; + os << std::endl; + mySyllabic->toStream(os, indentLevel); + } + return os; +} +ElisionPtr ElisionSyllabicGroup::getElision() const +{ + return myElision; +} - SyllabicPtr ElisionSyllabicGroup::getSyllabic() const - { - return mySyllabic; - } +void ElisionSyllabicGroup::setElision(const ElisionPtr &value) +{ + if (value) + { + myElision = value; + } +} +SyllabicPtr ElisionSyllabicGroup::getSyllabic() const +{ + return mySyllabic; +} - void ElisionSyllabicGroup::setSyllabic( const SyllabicPtr& value ) - { - if ( value ) - { - mySyllabic = value; - } - } +void ElisionSyllabicGroup::setSyllabic(const SyllabicPtr &value) +{ + if (value) + { + mySyllabic = value; + } +} +bool ElisionSyllabicGroup::getHasSyllabic() const +{ + return myHasSyllabic; +} - bool ElisionSyllabicGroup::getHasSyllabic() const - { - return myHasSyllabic; - } +void ElisionSyllabicGroup::setHasSyllabic(const bool value) +{ + myHasSyllabic = value; +} +MX_FROM_XELEMENT_UNUSED(ElisionSyllabicGroup); - void ElisionSyllabicGroup::setHasSyllabic( const bool value ) - { - myHasSyllabic = value; - } - - - MX_FROM_XELEMENT_UNUSED( ElisionSyllabicGroup ); - - } -} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h b/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h index 533be2b3a..451496130 100644 --- a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h +++ b/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,43 +13,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Elision ) - MX_FORWARD_DECLARE_ELEMENT( Syllabic ) - MX_FORWARD_DECLARE_ELEMENT( ElisionSyllabicGroup ) - - inline ElisionSyllabicGroupPtr makeElisionSyllabicGroup() { return std::make_shared(); } - - class ElisionSyllabicGroup : public ElementInterface - { - public: - ElisionSyllabicGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Elision minOccurs = 1, maxOccurs = 1 _________ */ - ElisionPtr getElision() const; - void setElision( const ElisionPtr& value ); - - /* _________ Syllabic minOccurs = 0, maxOccurs = 1 _________ */ - SyllabicPtr getSyllabic() const; - void setSyllabic( const SyllabicPtr& value ); - bool getHasSyllabic() const; - void setHasSyllabic( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ElisionPtr myElision; - SyllabicPtr mySyllabic; - bool myHasSyllabic; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Elision) +MX_FORWARD_DECLARE_ELEMENT(Syllabic) +MX_FORWARD_DECLARE_ELEMENT(ElisionSyllabicGroup) + +inline ElisionSyllabicGroupPtr makeElisionSyllabicGroup() +{ + return std::make_shared(); } + +class ElisionSyllabicGroup : public ElementInterface +{ + public: + ElisionSyllabicGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Elision minOccurs = 1, maxOccurs = 1 _________ */ + ElisionPtr getElision() const; + void setElision(const ElisionPtr &value); + + /* _________ Syllabic minOccurs = 0, maxOccurs = 1 _________ */ + SyllabicPtr getSyllabic() const; + void setSyllabic(const SyllabicPtr &value); + bool getHasSyllabic() const; + void setHasSyllabic(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ElisionPtr myElision; + SyllabicPtr mySyllabic; + bool myHasSyllabic; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp b/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp index a44c113d9..2ee8be319 100644 --- a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp +++ b/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp @@ -10,96 +10,84 @@ namespace mx { - namespace core - { - ElisionSyllabicTextGroup::ElisionSyllabicTextGroup() - :myElisionSyllabicGroup( makeElisionSyllabicGroup() ) - ,myHasElisionSyllabicGroup( false ) - ,myText( makeText() ) - {} - - - bool ElisionSyllabicTextGroup::hasAttributes() const - { - return false; - } - - - std::ostream& ElisionSyllabicTextGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ElisionSyllabicTextGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool ElisionSyllabicTextGroup::hasContents() const - { - return true; - } - - - std::ostream& ElisionSyllabicTextGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = true; - if ( myHasElisionSyllabicGroup ) - { - myElisionSyllabicGroup->streamContents( os, indentLevel, isOneLineOnly ); - isOneLineOnly = false; - os << std::endl; - } - myText->toStream( os, indentLevel ); - return os; - } - - - ElisionSyllabicGroupPtr ElisionSyllabicTextGroup::getElisionSyllabicGroup() const - { - return myElisionSyllabicGroup; - } +namespace core +{ +ElisionSyllabicTextGroup::ElisionSyllabicTextGroup() + : myElisionSyllabicGroup(makeElisionSyllabicGroup()), myHasElisionSyllabicGroup(false), myText(makeText()) +{ +} +bool ElisionSyllabicTextGroup::hasAttributes() const +{ + return false; +} - void ElisionSyllabicTextGroup::setElisionSyllabicGroup( const ElisionSyllabicGroupPtr& value ) - { - if ( value ) - { - myElisionSyllabicGroup = value; - } - } +std::ostream &ElisionSyllabicTextGroup::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &ElisionSyllabicTextGroup::streamName(std::ostream &os) const +{ + return os; +} - bool ElisionSyllabicTextGroup::getHasElisionSyllabicGroup() const - { - return myHasElisionSyllabicGroup; - } +bool ElisionSyllabicTextGroup::hasContents() const +{ + return true; +} +std::ostream &ElisionSyllabicTextGroup::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + isOneLineOnly = true; + if (myHasElisionSyllabicGroup) + { + myElisionSyllabicGroup->streamContents(os, indentLevel, isOneLineOnly); + isOneLineOnly = false; + os << std::endl; + } + myText->toStream(os, indentLevel); + return os; +} - void ElisionSyllabicTextGroup::setHasElisionSyllabicGroup( const bool value ) - { - myHasElisionSyllabicGroup = value; - } +ElisionSyllabicGroupPtr ElisionSyllabicTextGroup::getElisionSyllabicGroup() const +{ + return myElisionSyllabicGroup; +} +void ElisionSyllabicTextGroup::setElisionSyllabicGroup(const ElisionSyllabicGroupPtr &value) +{ + if (value) + { + myElisionSyllabicGroup = value; + } +} - TextPtr ElisionSyllabicTextGroup::getText() const - { - return myText; - } +bool ElisionSyllabicTextGroup::getHasElisionSyllabicGroup() const +{ + return myHasElisionSyllabicGroup; +} +void ElisionSyllabicTextGroup::setHasElisionSyllabicGroup(const bool value) +{ + myHasElisionSyllabicGroup = value; +} - void ElisionSyllabicTextGroup::setText( const TextPtr& value ) - { - if ( value ) - { - myText = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( ElisionSyllabicTextGroup ); +TextPtr ElisionSyllabicTextGroup::getText() const +{ + return myText; +} +void ElisionSyllabicTextGroup::setText(const TextPtr &value) +{ + if (value) + { + myText = value; } } + +MX_FROM_XELEMENT_UNUSED(ElisionSyllabicTextGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h b/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h index a9846804a..78088d7f5 100644 --- a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h +++ b/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,43 +13,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ElisionSyllabicGroup ) - MX_FORWARD_DECLARE_ELEMENT( Text ) - MX_FORWARD_DECLARE_ELEMENT( ElisionSyllabicTextGroup ) - - inline ElisionSyllabicTextGroupPtr makeElisionSyllabicTextGroup() { return std::make_shared(); } - - class ElisionSyllabicTextGroup : public ElementInterface - { - public: - ElisionSyllabicTextGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ ElisionSyllabicGroup minOccurs = 0, maxOccurs = 1 _________ */ - ElisionSyllabicGroupPtr getElisionSyllabicGroup() const; - void setElisionSyllabicGroup( const ElisionSyllabicGroupPtr& value ); - bool getHasElisionSyllabicGroup() const; - void setHasElisionSyllabicGroup( const bool value ); - - /* _________ Text minOccurs = 1, maxOccurs = 1 _________ */ - TextPtr getText() const; - void setText( const TextPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ElisionSyllabicGroupPtr myElisionSyllabicGroup; - bool myHasElisionSyllabicGroup; - TextPtr myText; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(ElisionSyllabicGroup) +MX_FORWARD_DECLARE_ELEMENT(Text) +MX_FORWARD_DECLARE_ELEMENT(ElisionSyllabicTextGroup) + +inline ElisionSyllabicTextGroupPtr makeElisionSyllabicTextGroup() +{ + return std::make_shared(); } + +class ElisionSyllabicTextGroup : public ElementInterface +{ + public: + ElisionSyllabicTextGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ ElisionSyllabicGroup minOccurs = 0, maxOccurs = 1 _________ */ + ElisionSyllabicGroupPtr getElisionSyllabicGroup() const; + void setElisionSyllabicGroup(const ElisionSyllabicGroupPtr &value); + bool getHasElisionSyllabicGroup() const; + void setHasElisionSyllabicGroup(const bool value); + + /* _________ Text minOccurs = 1, maxOccurs = 1 _________ */ + TextPtr getText() const; + void setText(const TextPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ElisionSyllabicGroupPtr myElisionSyllabicGroup; + bool myHasElisionSyllabicGroup; + TextPtr myText; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp b/Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp index 03eb127a0..26933f4f4 100644 --- a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp @@ -8,61 +8,62 @@ namespace mx { - namespace core +namespace core +{ +EmptyFontAttributes::EmptyFontAttributes() + : fontFamily(), fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false) +{ +} + +bool EmptyFontAttributes::hasValues() const +{ + return hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight; +} + +std::ostream &EmptyFontAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - EmptyFontAttributes::EmptyFontAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool EmptyFontAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "EmptyFontAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool EmptyFontAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& EmptyFontAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool EmptyFontAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) { - const char* const className = "EmptyFontAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.h b/Sourcecode/private/mx/core/elements/EmptyFontAttributes.h index 6c4e2ecdd..9b6e78405 100644 --- a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.h +++ b/Sourcecode/private/mx/core/elements/EmptyFontAttributes.h @@ -4,11 +4,11 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -16,28 +16,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyFontAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyFontAttributes) - struct EmptyFontAttributes : public AttributesInterface - { - public: - EmptyFontAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct EmptyFontAttributes : public AttributesInterface +{ + public: + EmptyFontAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp b/Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp index 9ebc90918..197d57335 100644 --- a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp @@ -8,109 +8,114 @@ namespace mx { - namespace core +namespace core +{ +EmptyLineAttributes::EmptyLineAttributes() + : lineShape(), lineType(), dashLength(), spaceLength(), defaultX(), defaultY(), relativeX(), relativeY(), + fontFamily(), fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), + placement(AboveBelow::below), hasLineShape(false), hasLineType(false), hasDashLength(false), + hasSpaceLength(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool EmptyLineAttributes::hasValues() const +{ + return hasLineShape || hasLineType || hasDashLength || hasSpaceLength || hasDefaultX || hasDefaultY || + hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || + hasPlacement; +} + +std::ostream &EmptyLineAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - EmptyLineAttributes::EmptyLineAttributes() - :lineShape() - ,lineType() - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,hasLineShape( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, lineShape, "line-shape", hasLineShape); + streamAttribute(os, lineType, "line-type", hasLineType); + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, spaceLength, "space-length", hasSpaceLength); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} +bool EmptyLineAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "EmptyLineAttributes"; + bool isSuccess = true; - bool EmptyLineAttributes::hasValues() const - { - return - hasLineShape || - hasLineType || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + for (; it != endIter; ++it) + { - std::ostream& EmptyLineAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, lineShape, hasLineShape, "line-shape", &parseLineShape)) { - if ( hasValues() ) - { - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, lineShape, "line-shape", hasLineShape ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool EmptyLineAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType)) { - const char* const className = "EmptyLineAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - - if( parseAttribute( message, it, className, isSuccess, lineShape, hasLineShape, "line-shape", &parseLineShape ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, dashLength, hasDashLength, "dash-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.h b/Sourcecode/private/mx/core/elements/EmptyLineAttributes.h index ef4a6ddf2..682ec835f 100644 --- a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.h +++ b/Sourcecode/private/mx/core/elements/EmptyLineAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,46 +17,46 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyLineAttributes) - struct EmptyLineAttributes : public AttributesInterface - { - public: - EmptyLineAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LineShape lineShape; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasLineShape; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct EmptyLineAttributes : public AttributesInterface +{ + public: + EmptyLineAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + LineShape lineShape; + LineType lineType; + TenthsValue dashLength; + TenthsValue spaceLength; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasLineShape; + bool hasLineType; + bool hasDashLength; + bool hasSpaceLength; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp b/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp index 499b5da06..f76ea22a8 100644 --- a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +EmptyPlacementAttributes::EmptyPlacementAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), placement(AboveBelow::below), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool EmptyPlacementAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &EmptyPlacementAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - EmptyPlacementAttributes::EmptyPlacementAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool EmptyPlacementAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "EmptyPlacementAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool EmptyPlacementAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& EmptyPlacementAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool EmptyPlacementAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "EmptyPlacementAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h b/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h index e555b6395..e387d37f2 100644 --- a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h +++ b/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) - struct EmptyPlacementAttributes : public AttributesInterface - { - public: - EmptyPlacementAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct EmptyPlacementAttributes : public AttributesInterface +{ + public: + EmptyPlacementAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp b/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp index e922211ca..898fd469d 100644 --- a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp @@ -8,121 +8,130 @@ namespace mx { - namespace core - { - EmptyTrillSoundAttributes::EmptyTrillSoundAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep() - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - {} - +namespace core +{ +EmptyTrillSoundAttributes::EmptyTrillSoundAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), placement(AboveBelow::below), + startNote(StartNote::main), trillStep(), twoNoteTurn(TwoNoteTurn::none), accelerate(YesNo::no), beats(), + secondBeat(), lastBeat(), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasPlacement(false), + hasStartNote(false), hasTrillStep(false), hasTwoNoteTurn(false), hasAccelerate(false), hasBeats(false), + hasSecondBeat(false), hasLastBeat(false) +{ +} - bool EmptyTrillSoundAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat; - } +bool EmptyTrillSoundAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement || hasStartNote || hasTrillStep || hasTwoNoteTurn || hasAccelerate || + hasBeats || hasSecondBeat || hasLastBeat; +} +std::ostream &EmptyTrillSoundAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, startNote, "start-note", hasStartNote); + streamAttribute(os, trillStep, "trill-step", hasTrillStep); + streamAttribute(os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn); + streamAttribute(os, accelerate, "accelerate", hasAccelerate); + streamAttribute(os, beats, "beats", hasBeats); + streamAttribute(os, secondBeat, "second-beat", hasSecondBeat); + streamAttribute(os, lastBeat, "last-beat", hasLastBeat); + } + return os; +} - std::ostream& EmptyTrillSoundAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - } - return os; - } +bool EmptyTrillSoundAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "EmptyTrillSoundAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool EmptyTrillSoundAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "EmptyTrillSoundAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", + &parseTwoNoteTurn)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, beats, hasBeats, "beats")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h b/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h index 9577596f3..04bc1f1a5 100644 --- a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h +++ b/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,52 +17,52 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyTrillSoundAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyTrillSoundAttributes) - struct EmptyTrillSoundAttributes : public AttributesInterface - { - public: - EmptyTrillSoundAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; +struct EmptyTrillSoundAttributes : public AttributesInterface +{ + public: + EmptyTrillSoundAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + StartNote startNote; + TrillStep trillStep; + TwoNoteTurn twoNoteTurn; + YesNo accelerate; + TrillBeats beats; + Percent secondBeat; + Percent lastBeat; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; + bool hasStartNote; + bool hasTrillStep; + bool hasTwoNoteTurn; + bool hasAccelerate; + bool hasBeats; + bool hasSecondBeat; + bool hasLastBeat; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Encoder.cpp b/Sourcecode/private/mx/core/elements/Encoder.cpp index e5ad36db5..901fafe04 100644 --- a/Sourcecode/private/mx/core/elements/Encoder.cpp +++ b/Sourcecode/private/mx/core/elements/Encoder.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Encoder::Encoder() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Encoder::Encoder( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Encoder::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Encoder::hasContents() const - { - return true; - } - - - std::ostream& Encoder::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Encoder::streamName( std::ostream& os ) const - { - os << "encoder"; - return os; - } - - - std::ostream& Encoder::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Encoder::Encoder() : myValue(), myAttributes(std::make_shared()) +{ +} +Encoder::Encoder(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - EncoderAttributesPtr Encoder::getAttributes() const - { - return myAttributes; - } +bool Encoder::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Encoder::hasContents() const +{ + return true; +} - void Encoder::setAttributes( const EncoderAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Encoder::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Encoder::streamName(std::ostream &os) const +{ + os << "encoder"; + return os; +} - XsString Encoder::getValue() const - { - return myValue; - } +std::ostream &Encoder::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +EncoderAttributesPtr Encoder::getAttributes() const +{ + return myAttributes; +} - void Encoder::setValue( const XsString& value ) - { - myValue = value; - } +void Encoder::setAttributes(const EncoderAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Encoder::getValue() const +{ + return myValue; +} - bool Encoder::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } +void Encoder::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Encoder::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Encoder.h b/Sourcecode/private/mx/core/elements/Encoder.h index a834efbef..a1e9f0a70 100644 --- a/Sourcecode/private/mx/core/elements/Encoder.h +++ b/Sourcecode/private/mx/core/elements/Encoder.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/EncoderAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EncoderAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Encoder ) - - inline EncoderPtr makeEncoder() { return std::make_shared(); } - inline EncoderPtr makeEncoder( const XsString& value ) { return std::make_shared( value ); } - inline EncoderPtr makeEncoder( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Encoder : public ElementInterface - { - public: - Encoder(); - Encoder( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EncoderAttributesPtr getAttributes() const; - void setAttributes( const EncoderAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - EncoderAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EncoderAttributes) +MX_FORWARD_DECLARE_ELEMENT(Encoder) + +inline EncoderPtr makeEncoder() +{ + return std::make_shared(); +} + +inline EncoderPtr makeEncoder(const XsString &value) +{ + return std::make_shared(value); } + +inline EncoderPtr makeEncoder(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Encoder : public ElementInterface +{ + public: + Encoder(); + Encoder(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EncoderAttributesPtr getAttributes() const; + void setAttributes(const EncoderAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + EncoderAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EncoderAttributes.cpp b/Sourcecode/private/mx/core/elements/EncoderAttributes.cpp index a55fe4588..104a9c467 100644 --- a/Sourcecode/private/mx/core/elements/EncoderAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/EncoderAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - EncoderAttributes::EncoderAttributes() - :type() - ,hasType( false ) - {} - +namespace core +{ +EncoderAttributes::EncoderAttributes() : type(), hasType(false) +{ +} - bool EncoderAttributes::hasValues() const - { - return hasType; - } +bool EncoderAttributes::hasValues() const +{ + return hasType; +} +std::ostream &EncoderAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& EncoderAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool EncoderAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "EncoderAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool EncoderAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type")) { - const char* const className = "EncoderAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EncoderAttributes.h b/Sourcecode/private/mx/core/elements/EncoderAttributes.h index 7e8341b5c..21c766fed 100644 --- a/Sourcecode/private/mx/core/elements/EncoderAttributes.h +++ b/Sourcecode/private/mx/core/elements/EncoderAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( EncoderAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(EncoderAttributes) - struct EncoderAttributes : public AttributesInterface - { - public: - EncoderAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; +struct EncoderAttributes : public AttributesInterface +{ + public: + EncoderAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken type; + bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Encoding.cpp b/Sourcecode/private/mx/core/elements/Encoding.cpp index 3da8ccdc7..b81c5370f 100644 --- a/Sourcecode/private/mx/core/elements/Encoding.cpp +++ b/Sourcecode/private/mx/core/elements/Encoding.cpp @@ -9,103 +9,93 @@ namespace mx { - namespace core +namespace core +{ +Encoding::Encoding() : myEncodingChoiceSet() +{ +} + +bool Encoding::hasAttributes() const +{ + return false; +} + +std::ostream &Encoding::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &Encoding::streamName(std::ostream &os) const +{ + os << "encoding"; + return os; +} + +bool Encoding::hasContents() const +{ + return myEncodingChoiceSet.size() > 0; +} + +std::ostream &Encoding::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + bool isFirst = true; + for (auto x : myEncodingChoiceSet) { - Encoding::Encoding() - :myEncodingChoiceSet() - {} - - - bool Encoding::hasAttributes() const - { - return false; - } - - - std::ostream& Encoding::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Encoding::streamName( std::ostream& os ) const - { - os << "encoding"; - return os; - } - - - bool Encoding::hasContents() const - { - return myEncodingChoiceSet.size() > 0; - } - - - std::ostream& Encoding::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - bool isFirst = true; - for ( auto x : myEncodingChoiceSet ) - { - if( !isFirst ) - { - os << std::endl; - isFirst = false; - } - x->streamContents( os, indentLevel, isOneLineOnly ); - } - if ( hasContents() ) - { - os << std::endl; - } - isOneLineOnly = !hasContents(); - return os; - } - - - const EncodingChoiceSet& Encoding::getEncodingChoiceSet() const - { - return myEncodingChoiceSet; - } - - - void Encoding::removeEncodingChoice( const EncodingChoiceSetIterConst& value ) - { - if ( value != myEncodingChoiceSet.cend() ) - { - myEncodingChoiceSet.erase( value ); - } - } - - - void Encoding::addEncodingChoice( const EncodingChoicePtr& value ) - { - if ( value ) - { - myEncodingChoiceSet.push_back( value ); - } - } - - - void Encoding::clearEncodingChoiceSet() + if (!isFirst) { - myEncodingChoiceSet.clear(); + os << std::endl; + isFirst = false; } - - - bool Encoding::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeEncodingChoice(); - isSuccess &= item->fromXElement( message, *it ); - myEncodingChoiceSet.push_back( item ); - } + x->streamContents(os, indentLevel, isOneLineOnly); + } + if (hasContents()) + { + os << std::endl; + } + isOneLineOnly = !hasContents(); + return os; +} - MX_RETURN_IS_SUCCESS; - } - +const EncodingChoiceSet &Encoding::getEncodingChoiceSet() const +{ + return myEncodingChoiceSet; +} + +void Encoding::removeEncodingChoice(const EncodingChoiceSetIterConst &value) +{ + if (value != myEncodingChoiceSet.cend()) + { + myEncodingChoiceSet.erase(value); + } +} + +void Encoding::addEncodingChoice(const EncodingChoicePtr &value) +{ + if (value) + { + myEncodingChoiceSet.push_back(value); } } + +void Encoding::clearEncodingChoiceSet() +{ + myEncodingChoiceSet.clear(); +} + +bool Encoding::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + auto item = makeEncodingChoice(); + isSuccess &= item->fromXElement(message, *it); + myEncodingChoiceSet.push_back(item); + } + + MX_RETURN_IS_SUCCESS; +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Encoding.h b/Sourcecode/private/mx/core/elements/Encoding.h index 64dcf2dab..3402c6a3b 100644 --- a/Sourcecode/private/mx/core/elements/Encoding.h +++ b/Sourcecode/private/mx/core/elements/Encoding.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,36 +13,39 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EncodingChoice ) - MX_FORWARD_DECLARE_ELEMENT( Encoding ) - - inline EncodingPtr makeEncoding() { return std::make_shared(); } - - class Encoding : public ElementInterface - { - public: - Encoding(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ EncodingChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const EncodingChoiceSet& getEncodingChoiceSet() const; - void addEncodingChoice( const EncodingChoicePtr& value ); - void removeEncodingChoice( const EncodingChoiceSetIterConst& value ); - void clearEncodingChoiceSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EncodingChoiceSet myEncodingChoiceSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(EncodingChoice) +MX_FORWARD_DECLARE_ELEMENT(Encoding) + +inline EncodingPtr makeEncoding() +{ + return std::make_shared(); } + +class Encoding : public ElementInterface +{ + public: + Encoding(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ EncodingChoice minOccurs = 0, maxOccurs = unbounded _________ */ + const EncodingChoiceSet &getEncodingChoiceSet() const; + void addEncodingChoice(const EncodingChoicePtr &value); + void removeEncodingChoice(const EncodingChoiceSetIterConst &value); + void clearEncodingChoiceSet(); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EncodingChoiceSet myEncodingChoiceSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EncodingChoice.cpp b/Sourcecode/private/mx/core/elements/EncodingChoice.cpp index 7fcbc5284..5a78b40f4 100644 --- a/Sourcecode/private/mx/core/elements/EncodingChoice.cpp +++ b/Sourcecode/private/mx/core/elements/EncodingChoice.cpp @@ -13,177 +13,151 @@ namespace mx { - namespace core +namespace core +{ +EncodingChoice::EncodingChoice() + : myChoice(Choice::encodingDate), myEncodingDate(makeEncodingDate()), myEncoder(makeEncoder()), + mySoftware(makeSoftware()), myEncodingDescription(makeEncodingDescription()), mySupports(makeSupports()) +{ +} + +bool EncodingChoice::hasAttributes() const +{ + return false; +} + +std::ostream &EncodingChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &EncodingChoice::streamName(std::ostream &os) const +{ + os << "encoding"; + return os; +} + +bool EncodingChoice::hasContents() const +{ + return true; +} + +std::ostream &EncodingChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + switch (myChoice) + { + case Choice::encodingDate: { + myEncodingDate->toStream(os, indentLevel + 1); + } + break; + case Choice::encoder: { + myEncoder->toStream(os, indentLevel + 1); + } + break; + case Choice::software: { + mySoftware->toStream(os, indentLevel + 1); + } + break; + case Choice::encodingDescription: { + myEncodingDescription->toStream(os, indentLevel + 1); + } + break; + case Choice::supports: { + mySupports->toStream(os, indentLevel + 1); + } + break; + default: + break; + } + isOneLineOnly = false; + return os; +} + +EncodingChoice::Choice EncodingChoice::getChoice() const +{ + return myChoice; +} + +void EncodingChoice::setChoice(const EncodingChoice::Choice value) +{ + myChoice = value; +} + +EncodingDatePtr EncodingChoice::getEncodingDate() const +{ + return myEncodingDate; +} + +void EncodingChoice::setEncodingDate(const EncodingDatePtr &value) +{ + if (value) + { + myEncodingDate = value; + } +} + +EncoderPtr EncodingChoice::getEncoder() const +{ + return myEncoder; +} + +void EncodingChoice::setEncoder(const EncoderPtr &value) +{ + if (value) { - EncodingChoice::EncodingChoice() - :myChoice( Choice::encodingDate ) - ,myEncodingDate( makeEncodingDate() ) - ,myEncoder( makeEncoder() ) - ,mySoftware( makeSoftware() ) - ,myEncodingDescription( makeEncodingDescription() ) - ,mySupports( makeSupports() ) - {} - - - bool EncodingChoice::hasAttributes() const - { - return false; - } - - - std::ostream& EncodingChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EncodingChoice::streamName( std::ostream& os ) const - { - os << "encoding"; - return os; - } - - - bool EncodingChoice::hasContents() const - { - return true; - } - - - std::ostream& EncodingChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - switch ( myChoice ) - { - case Choice::encodingDate: - { - myEncodingDate->toStream( os, indentLevel+1 ); - } - break; - case Choice::encoder: - { - myEncoder->toStream( os, indentLevel+1 ); - } - break; - case Choice::software: - { - mySoftware->toStream( os, indentLevel+1 ); - } - break; - case Choice::encodingDescription: - { - myEncodingDescription->toStream( os, indentLevel+1 ); - } - break; - case Choice::supports: - { - mySupports->toStream( os, indentLevel+1 ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - EncodingChoice::Choice EncodingChoice::getChoice() const - { - return myChoice; - } - - - void EncodingChoice::setChoice( const EncodingChoice::Choice value ) - { - myChoice = value; - } - - - EncodingDatePtr EncodingChoice::getEncodingDate() const - { - return myEncodingDate; - } - - - void EncodingChoice::setEncodingDate( const EncodingDatePtr& value ) - { - if( value ) - { - myEncodingDate = value; - } - } - - - EncoderPtr EncodingChoice::getEncoder() const - { - return myEncoder; - } - - - void EncodingChoice::setEncoder( const EncoderPtr& value ) - { - if( value ) - { - myEncoder = value; - } - } - - - SoftwarePtr EncodingChoice::getSoftware() const - { - return mySoftware; - } - - - void EncodingChoice::setSoftware( const SoftwarePtr& value ) - { - if( value ) - { - mySoftware = value; - } - } - - - EncodingDescriptionPtr EncodingChoice::getEncodingDescription() const - { - return myEncodingDescription; - } - - - void EncodingChoice::setEncodingDescription( const EncodingDescriptionPtr& value ) - { - if( value ) - { - myEncodingDescription = value; - } - } - - - SupportsPtr EncodingChoice::getSupports() const - { - return mySupports; - } - - - void EncodingChoice::setSupports( const SupportsPtr& value ) - { - if( value ) - { - mySupports = value; - } - } - + myEncoder = value; + } +} - bool EncodingChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( encodingDate, "encoding-date", EncodingDate ); - MX_CHOICE_IF( encoder, "encoder", Encoder ); - MX_CHOICE_IF( software, "software", Software ); - MX_CHOICE_IF( encodingDescription, "encoding-description", EncodingDescription ); - MX_CHOICE_IF( supports, "supports", Supports ); - MX_BAD_ELEMENT_FAILURE( EncodingChoice ); - } +SoftwarePtr EncodingChoice::getSoftware() const +{ + return mySoftware; +} +void EncodingChoice::setSoftware(const SoftwarePtr &value) +{ + if (value) + { + mySoftware = value; } } + +EncodingDescriptionPtr EncodingChoice::getEncodingDescription() const +{ + return myEncodingDescription; +} + +void EncodingChoice::setEncodingDescription(const EncodingDescriptionPtr &value) +{ + if (value) + { + myEncodingDescription = value; + } +} + +SupportsPtr EncodingChoice::getSupports() const +{ + return mySupports; +} + +void EncodingChoice::setSupports(const SupportsPtr &value) +{ + if (value) + { + mySupports = value; + } +} + +bool EncodingChoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_CHOICE_IF(encodingDate, "encoding-date", EncodingDate); + MX_CHOICE_IF(encoder, "encoder", Encoder); + MX_CHOICE_IF(software, "software", Software); + MX_CHOICE_IF(encodingDescription, "encoding-description", EncodingDescription); + MX_CHOICE_IF(supports, "supports", Supports); + MX_BAD_ELEMENT_FAILURE(EncodingChoice); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EncodingChoice.h b/Sourcecode/private/mx/core/elements/EncodingChoice.h index a66ec9655..89cef8830 100644 --- a/Sourcecode/private/mx/core/elements/EncodingChoice.h +++ b/Sourcecode/private/mx/core/elements/EncodingChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,71 +13,74 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Encoder) +MX_FORWARD_DECLARE_ELEMENT(EncodingDate) +MX_FORWARD_DECLARE_ELEMENT(EncodingDescription) +MX_FORWARD_DECLARE_ELEMENT(Software) +MX_FORWARD_DECLARE_ELEMENT(Supports) +MX_FORWARD_DECLARE_ELEMENT(EncodingChoice) - MX_FORWARD_DECLARE_ELEMENT( Encoder ) - MX_FORWARD_DECLARE_ELEMENT( EncodingDate ) - MX_FORWARD_DECLARE_ELEMENT( EncodingDescription ) - MX_FORWARD_DECLARE_ELEMENT( Software ) - MX_FORWARD_DECLARE_ELEMENT( Supports ) - MX_FORWARD_DECLARE_ELEMENT( EncodingChoice ) - - inline EncodingChoicePtr makeEncodingChoice() { return std::make_shared(); } - - class EncodingChoice : public ElementInterface - { - public: - enum class Choice - { - encodingDate = 1, - encoder = 2, - software = 3, - encodingDescription = 4, - supports = 5 - }; - EncodingChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice _________ */ - EncodingChoice::Choice getChoice() const; - void setChoice( const EncodingChoice::Choice value ); - - /* _________ EncodingDate minOccurs = 1, maxOccurs = 1 _________ */ - EncodingDatePtr getEncodingDate() const; - void setEncodingDate( const EncodingDatePtr& value ); - - /* _________ Encoder minOccurs = 1, maxOccurs = 1 _________ */ - EncoderPtr getEncoder() const; - void setEncoder( const EncoderPtr& value ); - - /* _________ Software minOccurs = 1, maxOccurs = 1 _________ */ - SoftwarePtr getSoftware() const; - void setSoftware( const SoftwarePtr& value ); - - /* _________ EncodingDescription minOccurs = 1, maxOccurs = 1 _________ */ - EncodingDescriptionPtr getEncodingDescription() const; - void setEncodingDescription( const EncodingDescriptionPtr& value ); - - /* _________ Supports minOccurs = 1, maxOccurs = 1 _________ */ - SupportsPtr getSupports() const; - void setSupports( const SupportsPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - EncodingDatePtr myEncodingDate; - EncoderPtr myEncoder; - SoftwarePtr mySoftware; - EncodingDescriptionPtr myEncodingDescription; - SupportsPtr mySupports; - }; - } +inline EncodingChoicePtr makeEncodingChoice() +{ + return std::make_shared(); } + +class EncodingChoice : public ElementInterface +{ + public: + enum class Choice + { + encodingDate = 1, + encoder = 2, + software = 3, + encodingDescription = 4, + supports = 5 + }; + EncodingChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice _________ */ + EncodingChoice::Choice getChoice() const; + void setChoice(const EncodingChoice::Choice value); + + /* _________ EncodingDate minOccurs = 1, maxOccurs = 1 _________ */ + EncodingDatePtr getEncodingDate() const; + void setEncodingDate(const EncodingDatePtr &value); + + /* _________ Encoder minOccurs = 1, maxOccurs = 1 _________ */ + EncoderPtr getEncoder() const; + void setEncoder(const EncoderPtr &value); + + /* _________ Software minOccurs = 1, maxOccurs = 1 _________ */ + SoftwarePtr getSoftware() const; + void setSoftware(const SoftwarePtr &value); + + /* _________ EncodingDescription minOccurs = 1, maxOccurs = 1 _________ */ + EncodingDescriptionPtr getEncodingDescription() const; + void setEncodingDescription(const EncodingDescriptionPtr &value); + + /* _________ Supports minOccurs = 1, maxOccurs = 1 _________ */ + SupportsPtr getSupports() const; + void setSupports(const SupportsPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + EncodingDatePtr myEncodingDate; + EncoderPtr myEncoder; + SoftwarePtr mySoftware; + EncodingDescriptionPtr myEncodingDescription; + SupportsPtr mySupports; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EncodingDate.cpp b/Sourcecode/private/mx/core/elements/EncodingDate.cpp index 55e370a62..8420af985 100644 --- a/Sourcecode/private/mx/core/elements/EncodingDate.cpp +++ b/Sourcecode/private/mx/core/elements/EncodingDate.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - EncodingDate::EncodingDate() - :myValue() - {} - - - EncodingDate::EncodingDate( const Date& value ) - :myValue( value ) - {} - - - bool EncodingDate::hasAttributes() const - { - return false; - } - - - bool EncodingDate::hasContents() const - { - return true; - } - - - std::ostream& EncodingDate::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EncodingDate::streamName( std::ostream& os ) const - { - os << "encoding-date"; - return os; - } +namespace core +{ +EncodingDate::EncodingDate() : myValue() +{ +} +EncodingDate::EncodingDate(const Date &value) : myValue(value) +{ +} - std::ostream& EncodingDate::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool EncodingDate::hasAttributes() const +{ + return false; +} +bool EncodingDate::hasContents() const +{ + return true; +} - Date EncodingDate::getValue() const - { - return myValue; - } +std::ostream &EncodingDate::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &EncodingDate::streamName(std::ostream &os) const +{ + os << "encoding-date"; + return os; +} - void EncodingDate::setValue( const Date& value ) - { - myValue = value; - } +std::ostream &EncodingDate::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Date EncodingDate::getValue() const +{ + return myValue; +} - bool EncodingDate::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void EncodingDate::setValue(const Date &value) +{ + myValue = value; +} - } +bool EncodingDate::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EncodingDate.h b/Sourcecode/private/mx/core/elements/EncodingDate.h index 17be5ed97..b53377bc8 100644 --- a/Sourcecode/private/mx/core/elements/EncodingDate.h +++ b/Sourcecode/private/mx/core/elements/EncodingDate.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Date.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EncodingDate ) - - inline EncodingDatePtr makeEncodingDate() { return std::make_shared(); } - inline EncodingDatePtr makeEncodingDate( const Date& value ) { return std::make_shared( value ); } - inline EncodingDatePtr makeEncodingDate( Date&& value ) { return std::make_shared( std::move( value ) ); } - - class EncodingDate : public ElementInterface - { - public: - EncodingDate(); - EncodingDate( const Date& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Date getValue() const; - void setValue( const Date& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Date myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(EncodingDate) + +inline EncodingDatePtr makeEncodingDate() +{ + return std::make_shared(); } + +inline EncodingDatePtr makeEncodingDate(const Date &value) +{ + return std::make_shared(value); +} + +inline EncodingDatePtr makeEncodingDate(Date &&value) +{ + return std::make_shared(std::move(value)); +} + +class EncodingDate : public ElementInterface +{ + public: + EncodingDate(); + EncodingDate(const Date &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Date getValue() const; + void setValue(const Date &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Date myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EncodingDescription.cpp b/Sourcecode/private/mx/core/elements/EncodingDescription.cpp index 3b7df02c9..ce34a53ff 100644 --- a/Sourcecode/private/mx/core/elements/EncodingDescription.cpp +++ b/Sourcecode/private/mx/core/elements/EncodingDescription.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - EncodingDescription::EncodingDescription() - :myValue() - {} - - - EncodingDescription::EncodingDescription( const XsString& value ) - :myValue( value ) - {} - - - bool EncodingDescription::hasAttributes() const - { - return false; - } - - - bool EncodingDescription::hasContents() const - { - return true; - } - - - std::ostream& EncodingDescription::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EncodingDescription::streamName( std::ostream& os ) const - { - os << "encoding-description"; - return os; - } +namespace core +{ +EncodingDescription::EncodingDescription() : myValue() +{ +} +EncodingDescription::EncodingDescription(const XsString &value) : myValue(value) +{ +} - std::ostream& EncodingDescription::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool EncodingDescription::hasAttributes() const +{ + return false; +} +bool EncodingDescription::hasContents() const +{ + return true; +} - XsString EncodingDescription::getValue() const - { - return myValue; - } +std::ostream &EncodingDescription::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &EncodingDescription::streamName(std::ostream &os) const +{ + os << "encoding-description"; + return os; +} - void EncodingDescription::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &EncodingDescription::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString EncodingDescription::getValue() const +{ + return myValue; +} - bool EncodingDescription::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void EncodingDescription::setValue(const XsString &value) +{ + myValue = value; +} - } +bool EncodingDescription::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EncodingDescription.h b/Sourcecode/private/mx/core/elements/EncodingDescription.h index 780f3c674..59b0bc8a5 100644 --- a/Sourcecode/private/mx/core/elements/EncodingDescription.h +++ b/Sourcecode/private/mx/core/elements/EncodingDescription.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EncodingDescription ) - - inline EncodingDescriptionPtr makeEncodingDescription() { return std::make_shared(); } - inline EncodingDescriptionPtr makeEncodingDescription( const XsString& value ) { return std::make_shared( value ); } - inline EncodingDescriptionPtr makeEncodingDescription( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class EncodingDescription : public ElementInterface - { - public: - EncodingDescription(); - EncodingDescription( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(EncodingDescription) + +inline EncodingDescriptionPtr makeEncodingDescription() +{ + return std::make_shared(); +} + +inline EncodingDescriptionPtr makeEncodingDescription(const XsString &value) +{ + return std::make_shared(value); } + +inline EncodingDescriptionPtr makeEncodingDescription(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class EncodingDescription : public ElementInterface +{ + public: + EncodingDescription(); + EncodingDescription(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EndLine.cpp b/Sourcecode/private/mx/core/elements/EndLine.cpp index b5f9a93c8..df5d717fc 100644 --- a/Sourcecode/private/mx/core/elements/EndLine.cpp +++ b/Sourcecode/private/mx/core/elements/EndLine.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - EndLine::EndLine() : ElementInterface() {} - +namespace core +{ +EndLine::EndLine() : ElementInterface() +{ +} - bool EndLine::hasAttributes() const { return false; } +bool EndLine::hasAttributes() const +{ + return false; +} +bool EndLine::hasContents() const +{ + return false; +} - bool EndLine::hasContents() const { return false; } - std::ostream& EndLine::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& EndLine::streamName( std::ostream& os ) const { os << "end-line"; return os; } - std::ostream& EndLine::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &EndLine::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &EndLine::streamName(std::ostream &os) const +{ + os << "end-line"; + return os; +} - bool EndLine::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &EndLine::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool EndLine::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EndLine.h b/Sourcecode/private/mx/core/elements/EndLine.h index aba68ecc5..9ba9b5625 100644 --- a/Sourcecode/private/mx/core/elements/EndLine.h +++ b/Sourcecode/private/mx/core/elements/EndLine.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EndLine ) - - inline EndLinePtr makeEndLine() { return std::make_shared(); } - - class EndLine : public ElementInterface - { - public: - EndLine(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(EndLine) + +inline EndLinePtr makeEndLine() +{ + return std::make_shared(); } + +class EndLine : public ElementInterface +{ + public: + EndLine(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EndParagraph.cpp b/Sourcecode/private/mx/core/elements/EndParagraph.cpp index d2949f1f0..65b5c7efb 100644 --- a/Sourcecode/private/mx/core/elements/EndParagraph.cpp +++ b/Sourcecode/private/mx/core/elements/EndParagraph.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - EndParagraph::EndParagraph() : ElementInterface() {} - +namespace core +{ +EndParagraph::EndParagraph() : ElementInterface() +{ +} - bool EndParagraph::hasAttributes() const { return false; } +bool EndParagraph::hasAttributes() const +{ + return false; +} +bool EndParagraph::hasContents() const +{ + return false; +} - bool EndParagraph::hasContents() const { return false; } - std::ostream& EndParagraph::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& EndParagraph::streamName( std::ostream& os ) const { os << "end-paragraph"; return os; } - std::ostream& EndParagraph::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &EndParagraph::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &EndParagraph::streamName(std::ostream &os) const +{ + os << "end-paragraph"; + return os; +} - bool EndParagraph::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &EndParagraph::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool EndParagraph::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EndParagraph.h b/Sourcecode/private/mx/core/elements/EndParagraph.h index ad70cbac9..f7586b132 100644 --- a/Sourcecode/private/mx/core/elements/EndParagraph.h +++ b/Sourcecode/private/mx/core/elements/EndParagraph.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EndParagraph ) - - inline EndParagraphPtr makeEndParagraph() { return std::make_shared(); } - - class EndParagraph : public ElementInterface - { - public: - EndParagraph(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(EndParagraph) + +inline EndParagraphPtr makeEndParagraph() +{ + return std::make_shared(); } + +class EndParagraph : public ElementInterface +{ + public: + EndParagraph(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Ending.cpp b/Sourcecode/private/mx/core/elements/Ending.cpp index c3757fae1..26a846d06 100644 --- a/Sourcecode/private/mx/core/elements/Ending.cpp +++ b/Sourcecode/private/mx/core/elements/Ending.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Ending::Ending() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Ending::Ending( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Ending::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Ending::hasContents() const - { - return true; - } - - - std::ostream& Ending::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Ending::streamName( std::ostream& os ) const - { - os << "ending"; - return os; - } - - - std::ostream& Ending::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Ending::Ending() : myValue(), myAttributes(std::make_shared()) +{ +} +Ending::Ending(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - EndingAttributesPtr Ending::getAttributes() const - { - return myAttributes; - } +bool Ending::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Ending::hasContents() const +{ + return true; +} - void Ending::setAttributes( const EndingAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Ending::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Ending::streamName(std::ostream &os) const +{ + os << "ending"; + return os; +} - XsString Ending::getValue() const - { - return myValue; - } +std::ostream &Ending::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +EndingAttributesPtr Ending::getAttributes() const +{ + return myAttributes; +} - void Ending::setValue( const XsString& value ) - { - myValue = value; - } +void Ending::setAttributes(const EndingAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Ending::getValue() const +{ + return myValue; +} - bool Ending::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Ending::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Ending::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Ending.h b/Sourcecode/private/mx/core/elements/Ending.h index 9692c9192..564b1bd93 100644 --- a/Sourcecode/private/mx/core/elements/Ending.h +++ b/Sourcecode/private/mx/core/elements/Ending.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/EndingAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EndingAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Ending ) - - inline EndingPtr makeEnding() { return std::make_shared(); } - inline EndingPtr makeEnding( const XsString& value ) { return std::make_shared( value ); } - inline EndingPtr makeEnding( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Ending : public ElementInterface - { - public: - Ending(); - Ending( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EndingAttributesPtr getAttributes() const; - void setAttributes( const EndingAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - EndingAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EndingAttributes) +MX_FORWARD_DECLARE_ELEMENT(Ending) + +inline EndingPtr makeEnding() +{ + return std::make_shared(); +} + +inline EndingPtr makeEnding(const XsString &value) +{ + return std::make_shared(value); } + +inline EndingPtr makeEnding(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Ending : public ElementInterface +{ + public: + Ending(); + Ending(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EndingAttributesPtr getAttributes() const; + void setAttributes(const EndingAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + EndingAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EndingAttributes.cpp b/Sourcecode/private/mx/core/elements/EndingAttributes.cpp index c4b35430a..17b4466f6 100644 --- a/Sourcecode/private/mx/core/elements/EndingAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/EndingAttributes.cpp @@ -8,127 +8,131 @@ namespace mx { - namespace core +namespace core +{ +EndingAttributes::EndingAttributes() + : number("1"), type(StartStopDiscontinue::start), printObject(), defaultX(), defaultY(), relativeX(), relativeY(), + fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), endLength(), textX(), textY(), hasNumber(true), hasType(true), + hasPrintObject(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasEndLength(false), + hasTextX(false), hasTextY(false) +{ +} + +bool EndingAttributes::hasValues() const +{ + return hasNumber || hasType || hasPrintObject || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || + hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasEndLength || hasTextX || hasTextY; +} + +std::ostream &EndingAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - EndingAttributes::EndingAttributes() - :number( "1" ) - ,type( StartStopDiscontinue::start ) - ,printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,endLength() - ,textX() - ,textY() - ,hasNumber( true ) - ,hasType( true ) - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasEndLength( false ) - ,hasTextX( false ) - ,hasTextY( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, type, "type", hasType); + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, endLength, "end-length", hasEndLength); + streamAttribute(os, textX, "text-x", hasTextX); + streamAttribute(os, textY, "text-y", hasTextY); + } + return os; +} + +bool EndingAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "EndingAttributes"; + bool isSuccess = true; + bool isNumberFound = false; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool EndingAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, isNumberFound, "number")) { - return hasNumber || - hasType || - hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasEndLength || - hasTextX || - hasTextY; + number.setUseSpaceBetweenItems(it->getValue().find(" ") != std::string::npos); + continue; } - - - std::ostream& EndingAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopDiscontinue)) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, endLength, "end-length", hasEndLength ); - streamAttribute( os, textX, "text-x", hasTextX ); - streamAttribute( os, textY, "text-y", hasTextY ); - } - return os; + continue; } - - - bool EndingAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "EndingAttributes"; - bool isSuccess = true; - bool isNumberFound = false; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, isNumberFound, "number" ) ) - { - number.setUseSpaceBetweenItems( it->getValue().find( " " ) != std::string::npos ); - continue; - } - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopDiscontinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, endLength, hasEndLength, "end-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, textX, hasTextX, "text-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, textY, hasTextY, "text-y" ) ) { continue; } - } - - if( !isNumberFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, endLength, hasEndLength, "end-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, textX, hasTextX, "text-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, textY, hasTextY, "text-y")) + { + continue; + } + } + if (!isNumberFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/EndingAttributes.h b/Sourcecode/private/mx/core/elements/EndingAttributes.h index c9d391e8a..44a665d58 100644 --- a/Sourcecode/private/mx/core/elements/EndingAttributes.h +++ b/Sourcecode/private/mx/core/elements/EndingAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/EndingNumber.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,48 +18,48 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( EndingAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(EndingAttributes) - struct EndingAttributes : public AttributesInterface - { - public: - EndingAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - EndingNumber number; - StartStopDiscontinue type; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - TenthsValue endLength; - TenthsValue textX; - TenthsValue textY; - const bool hasNumber; - const bool hasType; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasEndLength; - bool hasTextX; - bool hasTextY; +struct EndingAttributes : public AttributesInterface +{ + public: + EndingAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + EndingNumber number; + StartStopDiscontinue type; + YesNo printObject; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + TenthsValue endLength; + TenthsValue textX; + TenthsValue textY; + const bool hasNumber; + const bool hasType; + bool hasPrintObject; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasEndLength; + bool hasTextX; + bool hasTextY; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Ensemble.cpp b/Sourcecode/private/mx/core/elements/Ensemble.cpp index acf456a31..3a0c32369 100644 --- a/Sourcecode/private/mx/core/elements/Ensemble.cpp +++ b/Sourcecode/private/mx/core/elements/Ensemble.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Ensemble::Ensemble() - :myValue() - {} - - - Ensemble::Ensemble( const PositiveIntegerOrEmpty& value ) - :myValue( value ) - {} - - - bool Ensemble::hasAttributes() const - { - return false; - } - - - bool Ensemble::hasContents() const - { - return true; - } - - - std::ostream& Ensemble::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Ensemble::streamName( std::ostream& os ) const - { - os << "ensemble"; - return os; - } +namespace core +{ +Ensemble::Ensemble() : myValue() +{ +} +Ensemble::Ensemble(const PositiveIntegerOrEmpty &value) : myValue(value) +{ +} - std::ostream& Ensemble::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Ensemble::hasAttributes() const +{ + return false; +} +bool Ensemble::hasContents() const +{ + return true; +} - PositiveIntegerOrEmpty Ensemble::getValue() const - { - return myValue; - } +std::ostream &Ensemble::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Ensemble::streamName(std::ostream &os) const +{ + os << "ensemble"; + return os; +} - void Ensemble::setValue( const PositiveIntegerOrEmpty& value ) - { - myValue = value; - } +std::ostream &Ensemble::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PositiveIntegerOrEmpty Ensemble::getValue() const +{ + return myValue; +} - bool Ensemble::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Ensemble::setValue(const PositiveIntegerOrEmpty &value) +{ + myValue = value; +} - } +bool Ensemble::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Ensemble.h b/Sourcecode/private/mx/core/elements/Ensemble.h index 979d69341..b6880fab8 100644 --- a/Sourcecode/private/mx/core/elements/Ensemble.h +++ b/Sourcecode/private/mx/core/elements/Ensemble.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/PositiveIntegerOrEmpty.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Ensemble ) - - inline EnsemblePtr makeEnsemble() { return std::make_shared(); } - inline EnsemblePtr makeEnsemble( const PositiveIntegerOrEmpty& value ) { return std::make_shared( value ); } - inline EnsemblePtr makeEnsemble( PositiveIntegerOrEmpty&& value ) { return std::make_shared( std::move( value ) ); } - - class Ensemble : public ElementInterface - { - public: - Ensemble(); - Ensemble( const PositiveIntegerOrEmpty& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveIntegerOrEmpty getValue() const; - void setValue( const PositiveIntegerOrEmpty& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveIntegerOrEmpty myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Ensemble) + +inline EnsemblePtr makeEnsemble() +{ + return std::make_shared(); +} + +inline EnsemblePtr makeEnsemble(const PositiveIntegerOrEmpty &value) +{ + return std::make_shared(value); } + +inline EnsemblePtr makeEnsemble(PositiveIntegerOrEmpty &&value) +{ + return std::make_shared(std::move(value)); +} + +class Ensemble : public ElementInterface +{ + public: + Ensemble(); + Ensemble(const PositiveIntegerOrEmpty &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PositiveIntegerOrEmpty getValue() const; + void setValue(const PositiveIntegerOrEmpty &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveIntegerOrEmpty myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Extend.cpp b/Sourcecode/private/mx/core/elements/Extend.cpp index 435283690..04841df18 100644 --- a/Sourcecode/private/mx/core/elements/Extend.cpp +++ b/Sourcecode/private/mx/core/elements/Extend.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Extend::Extend() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Extend::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Extend::hasContents() const { return false; } - std::ostream& Extend::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Extend::streamName( std::ostream& os ) const { os << "extend"; return os; } - std::ostream& Extend::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Extend::Extend() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Extend::hasAttributes() const +{ + return myAttributes->hasValues(); +} - ExtendAttributesPtr Extend::getAttributes() const - { - return myAttributes; - } +bool Extend::hasContents() const +{ + return false; +} +std::ostream &Extend::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Extend::setAttributes( const ExtendAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Extend::streamName(std::ostream &os) const +{ + os << "extend"; + return os; +} +std::ostream &Extend::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Extend::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +ExtendAttributesPtr Extend::getAttributes() const +{ + return myAttributes; +} +void Extend::setAttributes(const ExtendAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Extend::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Extend.h b/Sourcecode/private/mx/core/elements/Extend.h index e405aba7c..0ca43689a 100644 --- a/Sourcecode/private/mx/core/elements/Extend.h +++ b/Sourcecode/private/mx/core/elements/Extend.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ExtendAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ExtendAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Extend ) - - inline ExtendPtr makeExtend() { return std::make_shared(); } - - class Extend : public ElementInterface - { - public: - Extend(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ExtendAttributesPtr getAttributes() const; - void setAttributes( const ExtendAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ExtendAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(ExtendAttributes) +MX_FORWARD_DECLARE_ELEMENT(Extend) + +inline ExtendPtr makeExtend() +{ + return std::make_shared(); } + +class Extend : public ElementInterface +{ + public: + Extend(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ExtendAttributesPtr getAttributes() const; + void setAttributes(const ExtendAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ExtendAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ExtendAttributes.cpp b/Sourcecode/private/mx/core/elements/ExtendAttributes.cpp index cff2aed9e..ae4099b07 100644 --- a/Sourcecode/private/mx/core/elements/ExtendAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ExtendAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +ExtendAttributes::ExtendAttributes() + : type(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), hasType(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false) +{ +} + +bool ExtendAttributes::hasValues() const +{ + return hasType || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight; +} + +std::ostream &ExtendAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - ExtendAttributes::ExtendAttributes() - :type() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,hasType( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool ExtendAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ExtendAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool ExtendAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type", &parseStartStopContinue)) { - return hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& ExtendAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool ExtendAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "ExtendAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ExtendAttributes.h b/Sourcecode/private/mx/core/elements/ExtendAttributes.h index 2080e4f7c..ff6d275dd 100644 --- a/Sourcecode/private/mx/core/elements/ExtendAttributes.h +++ b/Sourcecode/private/mx/core/elements/ExtendAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ExtendAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(ExtendAttributes) - struct ExtendAttributes : public AttributesInterface - { - public: - ExtendAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopContinue type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct ExtendAttributes : public AttributesInterface +{ + public: + ExtendAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStopContinue type; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasType; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Eyeglasses.cpp b/Sourcecode/private/mx/core/elements/Eyeglasses.cpp index 0c7daa63b..7ef7326a4 100644 --- a/Sourcecode/private/mx/core/elements/Eyeglasses.cpp +++ b/Sourcecode/private/mx/core/elements/Eyeglasses.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Eyeglasses::Eyeglasses() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Eyeglasses::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Eyeglasses::hasContents() const { return false; } - std::ostream& Eyeglasses::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Eyeglasses::streamName( std::ostream& os ) const { os << "eyeglasses"; return os; } - std::ostream& Eyeglasses::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Eyeglasses::Eyeglasses() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Eyeglasses::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPrintObjectStyleAlignAttributesPtr Eyeglasses::getAttributes() const - { - return myAttributes; - } +bool Eyeglasses::hasContents() const +{ + return false; +} +std::ostream &Eyeglasses::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Eyeglasses::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Eyeglasses::streamName(std::ostream &os) const +{ + os << "eyeglasses"; + return os; +} +std::ostream &Eyeglasses::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Eyeglasses::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPrintObjectStyleAlignAttributesPtr Eyeglasses::getAttributes() const +{ + return myAttributes; +} +void Eyeglasses::setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Eyeglasses::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Eyeglasses.h b/Sourcecode/private/mx/core/elements/Eyeglasses.h index 11f58a683..70842297a 100644 --- a/Sourcecode/private/mx/core/elements/Eyeglasses.h +++ b/Sourcecode/private/mx/core/elements/Eyeglasses.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,31 +14,34 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Eyeglasses ) - - inline EyeglassesPtr makeEyeglasses() { return std::make_shared(); } - - class Eyeglasses : public ElementInterface - { - public: - Eyeglasses(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); +namespace core +{ - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); +MX_FORWARD_DECLARE_ELEMENT(Eyeglasses) - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } +inline EyeglassesPtr makeEyeglasses() +{ + return std::make_shared(); } + +class Eyeglasses : public ElementInterface +{ + public: + Eyeglasses(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; + void setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPrintObjectStyleAlignAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Falloff.cpp b/Sourcecode/private/mx/core/elements/Falloff.cpp index 28e543fcf..761c84adb 100644 --- a/Sourcecode/private/mx/core/elements/Falloff.cpp +++ b/Sourcecode/private/mx/core/elements/Falloff.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Falloff::Falloff() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Falloff::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Falloff::hasContents() const { return false; } - std::ostream& Falloff::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Falloff::streamName( std::ostream& os ) const { os << "falloff"; return os; } - std::ostream& Falloff::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Falloff::Falloff() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Falloff::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyLineAttributesPtr Falloff::getAttributes() const - { - return myAttributes; - } +bool Falloff::hasContents() const +{ + return false; +} +std::ostream &Falloff::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Falloff::setAttributes( const EmptyLineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Falloff::streamName(std::ostream &os) const +{ + os << "falloff"; + return os; +} +std::ostream &Falloff::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Falloff::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyLineAttributesPtr Falloff::getAttributes() const +{ + return myAttributes; +} +void Falloff::setAttributes(const EmptyLineAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Falloff::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Falloff.h b/Sourcecode/private/mx/core/elements/Falloff.h index 2f19efaa3..8cf25d0e5 100644 --- a/Sourcecode/private/mx/core/elements/Falloff.h +++ b/Sourcecode/private/mx/core/elements/Falloff.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyLineAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Falloff ) - - inline FalloffPtr makeFalloff() { return std::make_shared(); } - - class Falloff : public ElementInterface - { - public: - Falloff(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyLineAttributesPtr getAttributes() const; - void setAttributes( const EmptyLineAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyLineAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyLineAttributes) +MX_FORWARD_DECLARE_ELEMENT(Falloff) + +inline FalloffPtr makeFalloff() +{ + return std::make_shared(); } + +class Falloff : public ElementInterface +{ + public: + Falloff(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyLineAttributesPtr getAttributes() const; + void setAttributes(const EmptyLineAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyLineAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Feature.cpp b/Sourcecode/private/mx/core/elements/Feature.cpp index ce06dabe0..6558a502d 100644 --- a/Sourcecode/private/mx/core/elements/Feature.cpp +++ b/Sourcecode/private/mx/core/elements/Feature.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Feature::Feature() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Feature::Feature( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Feature::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Feature::hasContents() const - { - return true; - } - - - std::ostream& Feature::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Feature::streamName( std::ostream& os ) const - { - os << "feature"; - return os; - } - - - std::ostream& Feature::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Feature::Feature() : myValue(), myAttributes(std::make_shared()) +{ +} +Feature::Feature(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - FeatureAttributesPtr Feature::getAttributes() const - { - return myAttributes; - } +bool Feature::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Feature::hasContents() const +{ + return true; +} - void Feature::setAttributes( const FeatureAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Feature::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Feature::streamName(std::ostream &os) const +{ + os << "feature"; + return os; +} - XsString Feature::getValue() const - { - return myValue; - } +std::ostream &Feature::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FeatureAttributesPtr Feature::getAttributes() const +{ + return myAttributes; +} - void Feature::setValue( const XsString& value ) - { - myValue = value; - } +void Feature::setAttributes(const FeatureAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Feature::getValue() const +{ + return myValue; +} - bool Feature::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Feature::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Feature::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Feature.h b/Sourcecode/private/mx/core/elements/Feature.h index 6b1b4923d..7bb20e91a 100644 --- a/Sourcecode/private/mx/core/elements/Feature.h +++ b/Sourcecode/private/mx/core/elements/Feature.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/FeatureAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FeatureAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Feature ) - - inline FeaturePtr makeFeature() { return std::make_shared(); } - inline FeaturePtr makeFeature( const XsString& value ) { return std::make_shared( value ); } - inline FeaturePtr makeFeature( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Feature : public ElementInterface - { - public: - Feature(); - Feature( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FeatureAttributesPtr getAttributes() const; - void setAttributes( const FeatureAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FeatureAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(FeatureAttributes) +MX_FORWARD_DECLARE_ELEMENT(Feature) + +inline FeaturePtr makeFeature() +{ + return std::make_shared(); +} + +inline FeaturePtr makeFeature(const XsString &value) +{ + return std::make_shared(value); } + +inline FeaturePtr makeFeature(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Feature : public ElementInterface +{ + public: + Feature(); + Feature(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FeatureAttributesPtr getAttributes() const; + void setAttributes(const FeatureAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + FeatureAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FeatureAttributes.cpp b/Sourcecode/private/mx/core/elements/FeatureAttributes.cpp index c4384d079..eb525920b 100644 --- a/Sourcecode/private/mx/core/elements/FeatureAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FeatureAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - FeatureAttributes::FeatureAttributes() - :type() - ,hasType( false ) - {} - +namespace core +{ +FeatureAttributes::FeatureAttributes() : type(), hasType(false) +{ +} - bool FeatureAttributes::hasValues() const - { - return hasType; - } +bool FeatureAttributes::hasValues() const +{ + return hasType; +} +std::ostream &FeatureAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& FeatureAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool FeatureAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FeatureAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool FeatureAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type")) { - const char* const className = "FeatureAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FeatureAttributes.h b/Sourcecode/private/mx/core/elements/FeatureAttributes.h index 170ebd13d..14a51740f 100644 --- a/Sourcecode/private/mx/core/elements/FeatureAttributes.h +++ b/Sourcecode/private/mx/core/elements/FeatureAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FeatureAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FeatureAttributes) - struct FeatureAttributes : public AttributesInterface - { - public: - FeatureAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; +struct FeatureAttributes : public AttributesInterface +{ + public: + FeatureAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken type; + bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fermata.cpp b/Sourcecode/private/mx/core/elements/Fermata.cpp index 001b24fa3..9f44dddc9 100644 --- a/Sourcecode/private/mx/core/elements/Fermata.cpp +++ b/Sourcecode/private/mx/core/elements/Fermata.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Fermata::Fermata() - :myValue( FermataShape::normal ) - ,myAttributes( std::make_shared() ) - {} - - - Fermata::Fermata( const FermataShape& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Fermata::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Fermata::hasContents() const - { - return true; - } - - - std::ostream& Fermata::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Fermata::streamName( std::ostream& os ) const - { - os << "fermata"; - return os; - } - - - std::ostream& Fermata::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Fermata::Fermata() : myValue(FermataShape::normal), myAttributes(std::make_shared()) +{ +} +Fermata::Fermata(const FermataShape &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - FermataAttributesPtr Fermata::getAttributes() const - { - return myAttributes; - } +bool Fermata::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Fermata::hasContents() const +{ + return true; +} - void Fermata::setAttributes( const FermataAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Fermata::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Fermata::streamName(std::ostream &os) const +{ + os << "fermata"; + return os; +} - FermataShape Fermata::getValue() const - { - return myValue; - } +std::ostream &Fermata::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FermataAttributesPtr Fermata::getAttributes() const +{ + return myAttributes; +} - void Fermata::setValue( const FermataShape& value ) - { - myValue = value; - } +void Fermata::setAttributes(const FermataAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +FermataShape Fermata::getValue() const +{ + return myValue; +} - bool Fermata::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseFermataShape( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Fermata::setValue(const FermataShape &value) +{ + myValue = value; +} - } +bool Fermata::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseFermataShape(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fermata.h b/Sourcecode/private/mx/core/elements/Fermata.h index 6b5e0cd7e..e4dafa414 100644 --- a/Sourcecode/private/mx/core/elements/Fermata.h +++ b/Sourcecode/private/mx/core/elements/Fermata.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/FermataAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FermataAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Fermata ) - - inline FermataPtr makeFermata() { return std::make_shared(); } - inline FermataPtr makeFermata( const FermataShape& value ) { return std::make_shared( value ); } - inline FermataPtr makeFermata( FermataShape&& value ) { return std::make_shared( std::move( value ) ); } - - class Fermata : public ElementInterface - { - public: - Fermata(); - Fermata( const FermataShape& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FermataAttributesPtr getAttributes() const; - void setAttributes( const FermataAttributesPtr& attributes ); - FermataShape getValue() const; - void setValue( const FermataShape& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FermataShape myValue; - FermataAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(FermataAttributes) +MX_FORWARD_DECLARE_ELEMENT(Fermata) + +inline FermataPtr makeFermata() +{ + return std::make_shared(); +} + +inline FermataPtr makeFermata(const FermataShape &value) +{ + return std::make_shared(value); } + +inline FermataPtr makeFermata(FermataShape &&value) +{ + return std::make_shared(std::move(value)); +} + +class Fermata : public ElementInterface +{ + public: + Fermata(); + Fermata(const FermataShape &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FermataAttributesPtr getAttributes() const; + void setAttributes(const FermataAttributesPtr &attributes); + FermataShape getValue() const; + void setValue(const FermataShape &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + FermataShape myValue; + FermataAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FermataAttributes.cpp b/Sourcecode/private/mx/core/elements/FermataAttributes.cpp index 719554ce8..313968345 100644 --- a/Sourcecode/private/mx/core/elements/FermataAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FermataAttributes.cpp @@ -8,91 +8,95 @@ namespace mx { - namespace core +namespace core +{ +FermataAttributes::FermataAttributes() + : type(UprightInverted::upright), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), color(), + hasType(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false) +{ +} + +bool FermataAttributes::hasValues() const +{ + return hasType || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight || hasColor; +} + +std::ostream &FermataAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - FermataAttributes::FermataAttributes() - :type( UprightInverted::upright ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,color() - ,hasType( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + } + return os; +} + +bool FermataAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FermataAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool FermataAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type", &parseUprightInverted)) { - return hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor; + continue; } - - - std::ostream& FermataAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - } - return os; + continue; } - - - bool FermataAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "FermataAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseUprightInverted ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FermataAttributes.h b/Sourcecode/private/mx/core/elements/FermataAttributes.h index fe37d055b..c641ffba4 100644 --- a/Sourcecode/private/mx/core/elements/FermataAttributes.h +++ b/Sourcecode/private/mx/core/elements/FermataAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,40 +18,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FermataAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FermataAttributes) - struct FermataAttributes : public AttributesInterface - { - public: - FermataAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - UprightInverted type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; +struct FermataAttributes : public AttributesInterface +{ + public: + FermataAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + UprightInverted type; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + bool hasType; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fifths.cpp b/Sourcecode/private/mx/core/elements/Fifths.cpp index 5d34f9533..102d0cf0d 100644 --- a/Sourcecode/private/mx/core/elements/Fifths.cpp +++ b/Sourcecode/private/mx/core/elements/Fifths.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Fifths::Fifths() - :myValue{ 0 } - {} - - - Fifths::Fifths( const FifthsValue& value ) - :myValue( value ) - {} - - - bool Fifths::hasAttributes() const - { - return false; - } - - - bool Fifths::hasContents() const - { - return true; - } - - - std::ostream& Fifths::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Fifths::streamName( std::ostream& os ) const - { - os << "fifths"; - return os; - } +namespace core +{ +Fifths::Fifths() : myValue{0} +{ +} +Fifths::Fifths(const FifthsValue &value) : myValue(value) +{ +} - std::ostream& Fifths::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Fifths::hasAttributes() const +{ + return false; +} +bool Fifths::hasContents() const +{ + return true; +} - FifthsValue Fifths::getValue() const - { - return myValue; - } +std::ostream &Fifths::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Fifths::streamName(std::ostream &os) const +{ + os << "fifths"; + return os; +} - void Fifths::setValue( const FifthsValue& value ) - { - myValue = value; - } +std::ostream &Fifths::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FifthsValue Fifths::getValue() const +{ + return myValue; +} - bool Fifths::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Fifths::setValue(const FifthsValue &value) +{ + myValue = value; +} - } +bool Fifths::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fifths.h b/Sourcecode/private/mx/core/elements/Fifths.h index 36173ea55..e939c2e1f 100644 --- a/Sourcecode/private/mx/core/elements/Fifths.h +++ b/Sourcecode/private/mx/core/elements/Fifths.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Fifths ) - - inline FifthsPtr makeFifths() { return std::make_shared(); } - inline FifthsPtr makeFifths( const FifthsValue& value ) { return std::make_shared( value ); } - inline FifthsPtr makeFifths( FifthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Fifths : public ElementInterface - { - public: - Fifths(); - Fifths( const FifthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FifthsValue getValue() const; - void setValue( const FifthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FifthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Fifths) + +inline FifthsPtr makeFifths() +{ + return std::make_shared(); +} + +inline FifthsPtr makeFifths(const FifthsValue &value) +{ + return std::make_shared(value); } + +inline FifthsPtr makeFifths(FifthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Fifths : public ElementInterface +{ + public: + Fifths(); + Fifths(const FifthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FifthsValue getValue() const; + void setValue(const FifthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + FifthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Figure.cpp b/Sourcecode/private/mx/core/elements/Figure.cpp index 1f40dc2b0..80f00b373 100644 --- a/Sourcecode/private/mx/core/elements/Figure.cpp +++ b/Sourcecode/private/mx/core/elements/Figure.cpp @@ -12,203 +12,188 @@ namespace mx { - namespace core - { - Figure::Figure() - :myPrefix( makePrefix() ) - ,myHasPrefix( false ) - ,myFigureNumber( makeFigureNumber() ) - ,myHasFigureNumber( false ) - ,mySuffix( makeSuffix() ) - ,myHasSuffix( false ) - ,myExtend( makeExtend() ) - ,myHasExtend( false ) - {} - - - bool Figure::hasAttributes() const - { - return false; - } - - - std::ostream& Figure::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Figure::streamName( std::ostream& os ) const - { - os << "figure"; - return os; - } - - - bool Figure::hasContents() const - { - return myHasPrefix || myHasFigureNumber || myHasSuffix || myHasExtend; - } - - - std::ostream& Figure::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasPrefix ) - { - os << std::endl; - myPrefix->toStream( os, indentLevel+1 ); - } - if ( myHasFigureNumber ) - { - os << std::endl; - myFigureNumber->toStream( os, indentLevel+1 ); - } - if ( myHasSuffix ) - { - os << std::endl; - mySuffix->toStream( os, indentLevel+1 ); - } - if ( myHasExtend ) - { - os << std::endl; - myExtend->toStream( os, indentLevel+1 ); - } - if ( hasContents() ) - { - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - PrefixPtr Figure::getPrefix() const - { - return myPrefix; - } - - - void Figure::setPrefix( const PrefixPtr& value ) - { - if( value ) - { - myPrefix = value; - } - } - +namespace core +{ +Figure::Figure() + : myPrefix(makePrefix()), myHasPrefix(false), myFigureNumber(makeFigureNumber()), myHasFigureNumber(false), + mySuffix(makeSuffix()), myHasSuffix(false), myExtend(makeExtend()), myHasExtend(false) +{ +} - bool Figure::getHasPrefix() const - { - return myHasPrefix; - } +bool Figure::hasAttributes() const +{ + return false; +} +std::ostream &Figure::streamAttributes(std::ostream &os) const +{ + return os; +} - void Figure::setHasPrefix( const bool value ) - { - myHasPrefix = value; - } +std::ostream &Figure::streamName(std::ostream &os) const +{ + os << "figure"; + return os; +} +bool Figure::hasContents() const +{ + return myHasPrefix || myHasFigureNumber || myHasSuffix || myHasExtend; +} - FigureNumberPtr Figure::getFigureNumber() const - { - return myFigureNumber; - } +std::ostream &Figure::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasPrefix) + { + os << std::endl; + myPrefix->toStream(os, indentLevel + 1); + } + if (myHasFigureNumber) + { + os << std::endl; + myFigureNumber->toStream(os, indentLevel + 1); + } + if (myHasSuffix) + { + os << std::endl; + mySuffix->toStream(os, indentLevel + 1); + } + if (myHasExtend) + { + os << std::endl; + myExtend->toStream(os, indentLevel + 1); + } + if (hasContents()) + { + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +PrefixPtr Figure::getPrefix() const +{ + return myPrefix; +} - void Figure::setFigureNumber( const FigureNumberPtr& value ) - { - if( value ) - { - myFigureNumber = value; - } - } +void Figure::setPrefix(const PrefixPtr &value) +{ + if (value) + { + myPrefix = value; + } +} +bool Figure::getHasPrefix() const +{ + return myHasPrefix; +} - bool Figure::getHasFigureNumber() const - { - return myHasFigureNumber; - } +void Figure::setHasPrefix(const bool value) +{ + myHasPrefix = value; +} +FigureNumberPtr Figure::getFigureNumber() const +{ + return myFigureNumber; +} - void Figure::setHasFigureNumber( const bool value ) - { - myHasFigureNumber = value; - } +void Figure::setFigureNumber(const FigureNumberPtr &value) +{ + if (value) + { + myFigureNumber = value; + } +} +bool Figure::getHasFigureNumber() const +{ + return myHasFigureNumber; +} - SuffixPtr Figure::getSuffix() const - { - return mySuffix; - } +void Figure::setHasFigureNumber(const bool value) +{ + myHasFigureNumber = value; +} +SuffixPtr Figure::getSuffix() const +{ + return mySuffix; +} - void Figure::setSuffix( const SuffixPtr& value ) - { - if( value ) - { - mySuffix = value; - } - } +void Figure::setSuffix(const SuffixPtr &value) +{ + if (value) + { + mySuffix = value; + } +} +bool Figure::getHasSuffix() const +{ + return myHasSuffix; +} - bool Figure::getHasSuffix() const - { - return myHasSuffix; - } +void Figure::setHasSuffix(const bool value) +{ + myHasSuffix = value; +} +ExtendPtr Figure::getExtend() const +{ + return myExtend; +} - void Figure::setHasSuffix( const bool value ) - { - myHasSuffix = value; - } +void Figure::setExtend(const ExtendPtr &value) +{ + if (value) + { + myExtend = value; + } +} +bool Figure::getHasExtend() const +{ + return myHasExtend; +} - ExtendPtr Figure::getExtend() const - { - return myExtend; - } +void Figure::setHasExtend(const bool value) +{ + myHasExtend = value; +} +bool Figure::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; - void Figure::setExtend( const ExtendPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myPrefix, myHasPrefix)) { - if( value ) - { - myExtend = value; - } + continue; } - - - bool Figure::getHasExtend() const + if (importElement(message, *it, isSuccess, *myFigureNumber, myHasFigureNumber)) { - return myHasExtend; + continue; } - - - void Figure::setHasExtend( const bool value ) + if (importElement(message, *it, isSuccess, *mySuffix, myHasSuffix)) { - myHasExtend = value; + continue; } - - - bool Figure::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myExtend, myHasExtend)) { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myPrefix, myHasPrefix ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFigureNumber, myHasFigureNumber ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySuffix, myHasSuffix ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myExtend, myHasExtend ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Figure.h b/Sourcecode/private/mx/core/elements/Figure.h index 881056f8b..db3973e4c 100644 --- a/Sourcecode/private/mx/core/elements/Figure.h +++ b/Sourcecode/private/mx/core/elements/Figure.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,64 +13,67 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Extend ) - MX_FORWARD_DECLARE_ELEMENT( FigureNumber ) - MX_FORWARD_DECLARE_ELEMENT( Prefix ) - MX_FORWARD_DECLARE_ELEMENT( Suffix ) - MX_FORWARD_DECLARE_ELEMENT( Figure ) +MX_FORWARD_DECLARE_ELEMENT(Extend) +MX_FORWARD_DECLARE_ELEMENT(FigureNumber) +MX_FORWARD_DECLARE_ELEMENT(Prefix) +MX_FORWARD_DECLARE_ELEMENT(Suffix) +MX_FORWARD_DECLARE_ELEMENT(Figure) - inline FigurePtr makeFigure() { return std::make_shared
(); } +inline FigurePtr makeFigure() +{ + return std::make_shared
(); +} - class Figure : public ElementInterface - { - public: - Figure(); +class Figure : public ElementInterface +{ + public: + Figure(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ Prefix minOccurs = 0, maxOccurs = 1 _________ */ - PrefixPtr getPrefix() const; - void setPrefix( const PrefixPtr& value ); - bool getHasPrefix() const; - void setHasPrefix( const bool value ); + /* _________ Prefix minOccurs = 0, maxOccurs = 1 _________ */ + PrefixPtr getPrefix() const; + void setPrefix(const PrefixPtr &value); + bool getHasPrefix() const; + void setHasPrefix(const bool value); - /* _________ FigureNumber minOccurs = 0, maxOccurs = 1 _________ */ - FigureNumberPtr getFigureNumber() const; - void setFigureNumber( const FigureNumberPtr& value ); - bool getHasFigureNumber() const; - void setHasFigureNumber( const bool value ); + /* _________ FigureNumber minOccurs = 0, maxOccurs = 1 _________ */ + FigureNumberPtr getFigureNumber() const; + void setFigureNumber(const FigureNumberPtr &value); + bool getHasFigureNumber() const; + void setHasFigureNumber(const bool value); - /* _________ Suffix minOccurs = 0, maxOccurs = 1 _________ */ - SuffixPtr getSuffix() const; - void setSuffix( const SuffixPtr& value ); - bool getHasSuffix() const; - void setHasSuffix( const bool value ); + /* _________ Suffix minOccurs = 0, maxOccurs = 1 _________ */ + SuffixPtr getSuffix() const; + void setSuffix(const SuffixPtr &value); + bool getHasSuffix() const; + void setHasSuffix(const bool value); - /* _________ Extend minOccurs = 0, maxOccurs = 1 _________ */ - ExtendPtr getExtend() const; - void setExtend( const ExtendPtr& value ); - bool getHasExtend() const; - void setHasExtend( const bool value ); + /* _________ Extend minOccurs = 0, maxOccurs = 1 _________ */ + ExtendPtr getExtend() const; + void setExtend(const ExtendPtr &value); + bool getHasExtend() const; + void setHasExtend(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - PrefixPtr myPrefix; - bool myHasPrefix; - FigureNumberPtr myFigureNumber; - bool myHasFigureNumber; - SuffixPtr mySuffix; - bool myHasSuffix; - ExtendPtr myExtend; - bool myHasExtend; - }; - } -} + private: + PrefixPtr myPrefix; + bool myHasPrefix; + FigureNumberPtr myFigureNumber; + bool myHasFigureNumber; + SuffixPtr mySuffix; + bool myHasSuffix; + ExtendPtr myExtend; + bool myHasExtend; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FigureNumber.cpp b/Sourcecode/private/mx/core/elements/FigureNumber.cpp index ae210dfb6..59038595f 100644 --- a/Sourcecode/private/mx/core/elements/FigureNumber.cpp +++ b/Sourcecode/private/mx/core/elements/FigureNumber.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - FigureNumber::FigureNumber() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - FigureNumber::FigureNumber( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool FigureNumber::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool FigureNumber::hasContents() const - { - return true; - } - - - std::ostream& FigureNumber::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& FigureNumber::streamName( std::ostream& os ) const - { - os << "figure-number"; - return os; - } - - - std::ostream& FigureNumber::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +FigureNumber::FigureNumber() : myValue(), myAttributes(std::make_shared()) +{ +} +FigureNumber::FigureNumber(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - FigureNumberAttributesPtr FigureNumber::getAttributes() const - { - return myAttributes; - } +bool FigureNumber::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool FigureNumber::hasContents() const +{ + return true; +} - void FigureNumber::setAttributes( const FigureNumberAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &FigureNumber::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &FigureNumber::streamName(std::ostream &os) const +{ + os << "figure-number"; + return os; +} - XsString FigureNumber::getValue() const - { - return myValue; - } +std::ostream &FigureNumber::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FigureNumberAttributesPtr FigureNumber::getAttributes() const +{ + return myAttributes; +} - void FigureNumber::setValue( const XsString& value ) - { - myValue = value; - } +void FigureNumber::setAttributes(const FigureNumberAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString FigureNumber::getValue() const +{ + return myValue; +} - bool FigureNumber::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } +void FigureNumber::setValue(const XsString &value) +{ + myValue = value; +} - } +bool FigureNumber::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FigureNumber.h b/Sourcecode/private/mx/core/elements/FigureNumber.h index 6ceb5c2e7..467fc429e 100644 --- a/Sourcecode/private/mx/core/elements/FigureNumber.h +++ b/Sourcecode/private/mx/core/elements/FigureNumber.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/FigureNumberAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FigureNumberAttributes ) - MX_FORWARD_DECLARE_ELEMENT( FigureNumber ) - - inline FigureNumberPtr makeFigureNumber() { return std::make_shared(); } - inline FigureNumberPtr makeFigureNumber( const XsString& value ) { return std::make_shared( value ); } - inline FigureNumberPtr makeFigureNumber( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class FigureNumber : public ElementInterface - { - public: - FigureNumber(); - FigureNumber( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FigureNumberAttributesPtr getAttributes() const; - void setAttributes( const FigureNumberAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FigureNumberAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(FigureNumberAttributes) +MX_FORWARD_DECLARE_ELEMENT(FigureNumber) + +inline FigureNumberPtr makeFigureNumber() +{ + return std::make_shared(); +} + +inline FigureNumberPtr makeFigureNumber(const XsString &value) +{ + return std::make_shared(value); } + +inline FigureNumberPtr makeFigureNumber(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class FigureNumber : public ElementInterface +{ + public: + FigureNumber(); + FigureNumber(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FigureNumberAttributesPtr getAttributes() const; + void setAttributes(const FigureNumberAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + FigureNumberAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp b/Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp index e75c7ffc3..715ee331d 100644 --- a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp @@ -8,81 +8,85 @@ namespace mx { - namespace core +namespace core +{ +FigureNumberAttributes::FigureNumberAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false) +{ +} + +bool FigureNumberAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight; +} + +std::ostream &FigureNumberAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - FigureNumberAttributes::FigureNumberAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool FigureNumberAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FigureNumberAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool FigureNumberAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& FigureNumberAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool FigureNumberAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "FigureNumberAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.h b/Sourcecode/private/mx/core/elements/FigureNumberAttributes.h index 3289d86d0..95020c3e7 100644 --- a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.h +++ b/Sourcecode/private/mx/core/elements/FigureNumberAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,36 +17,36 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FigureNumberAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FigureNumberAttributes) - struct FigureNumberAttributes : public AttributesInterface - { - public: - FigureNumberAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct FigureNumberAttributes : public AttributesInterface +{ + public: + FigureNumberAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FiguredBass.cpp b/Sourcecode/private/mx/core/elements/FiguredBass.cpp index 95a0cf8e0..1eb4c1323 100644 --- a/Sourcecode/private/mx/core/elements/FiguredBass.cpp +++ b/Sourcecode/private/mx/core/elements/FiguredBass.cpp @@ -11,186 +11,167 @@ namespace mx { - namespace core - { - FiguredBass::FiguredBass() - :myAttributes( std::make_shared() ) - ,myFigureSet() - ,myDuration( makeDuration() ) - ,myHasDuration( false ) - ,myEditorialGroup( makeEditorialGroup() ) - { - myFigureSet.push_back( makeFigure() ); - } - - - bool FiguredBass::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& FiguredBass::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& FiguredBass::streamName( std::ostream& os ) const - { - os << "figured-bass"; - return os; - } - - - bool FiguredBass::hasContents() const - { - return true; - } - - - std::ostream& FiguredBass::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myFigureSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasDuration ) - { - os << std::endl; - myDuration->toStream( os, indentLevel+1 ); - } - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - FiguredBassAttributesPtr FiguredBass::getAttributes() const - { - return myAttributes; - } - - - void FiguredBass::setAttributes( const FiguredBassAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const FigureSet& FiguredBass::getFigureSet() const - { - return myFigureSet; - } - +namespace core +{ +FiguredBass::FiguredBass() + : myAttributes(std::make_shared()), myFigureSet(), myDuration(makeDuration()), + myHasDuration(false), myEditorialGroup(makeEditorialGroup()) +{ + myFigureSet.push_back(makeFigure()); +} - void FiguredBass::removeFigure( const FigureSetIterConst& value ) - { - if ( value != myFigureSet.cend() ) - { - if ( myFigureSet.size() > 1 ) - { - myFigureSet.erase( value ); - } - } - } +bool FiguredBass::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &FiguredBass::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void FiguredBass::addFigure( const FigurePtr& value ) - { - if ( value ) - { - myFigureSet.push_back( value ); - } - } +std::ostream &FiguredBass::streamName(std::ostream &os) const +{ + os << "figured-bass"; + return os; +} +bool FiguredBass::hasContents() const +{ + return true; +} - void FiguredBass::clearFigureSet() - { - myFigureSet.clear(); - while( myFigureSet.size() < 1 ) - { - myFigureSet.push_back( makeFigure() ); - } - } +std::ostream &FiguredBass::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto x : myFigureSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + if (myHasDuration) + { + os << std::endl; + myDuration->toStream(os, indentLevel + 1); + } + if (myEditorialGroup->hasContents()) + { + os << std::endl; + myEditorialGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + } + os << std::endl; + isOneLineOnly = false; + return os; +} +FiguredBassAttributesPtr FiguredBass::getAttributes() const +{ + return myAttributes; +} - FigurePtr FiguredBass::getFigure( const FigureSetIterConst& setIterator ) const - { - if( setIterator != myFigureSet.cend() ) - { - return *setIterator; - } - return FigurePtr(); - } +void FiguredBass::setAttributes(const FiguredBassAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +const FigureSet &FiguredBass::getFigureSet() const +{ + return myFigureSet; +} - DurationPtr FiguredBass::getDuration() const +void FiguredBass::removeFigure(const FigureSetIterConst &value) +{ + if (value != myFigureSet.cend()) + { + if (myFigureSet.size() > 1) { - return myDuration; + myFigureSet.erase(value); } + } +} +void FiguredBass::addFigure(const FigurePtr &value) +{ + if (value) + { + myFigureSet.push_back(value); + } +} - void FiguredBass::setDuration( const DurationPtr& value ) - { - if ( value ) - { - myDuration = value; - } - } - +void FiguredBass::clearFigureSet() +{ + myFigureSet.clear(); + while (myFigureSet.size() < 1) + { + myFigureSet.push_back(makeFigure()); + } +} - bool FiguredBass::getHasDuration() const - { - return myHasDuration; - } +FigurePtr FiguredBass::getFigure(const FigureSetIterConst &setIterator) const +{ + if (setIterator != myFigureSet.cend()) + { + return *setIterator; + } + return FigurePtr(); +} +DurationPtr FiguredBass::getDuration() const +{ + return myDuration; +} - void FiguredBass::setHasDuration( const bool value ) - { - myHasDuration = value; - } +void FiguredBass::setDuration(const DurationPtr &value) +{ + if (value) + { + myDuration = value; + } +} +bool FiguredBass::getHasDuration() const +{ + return myHasDuration; +} - EditorialGroupPtr FiguredBass::getEditorialGroup() const - { - return myEditorialGroup; - } +void FiguredBass::setHasDuration(const bool value) +{ + myHasDuration = value; +} +EditorialGroupPtr FiguredBass::getEditorialGroup() const +{ + return myEditorialGroup; +} - void FiguredBass::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } +void FiguredBass::setEditorialGroup(const EditorialGroupPtr &value) +{ + if (value) + { + myEditorialGroup = value; + } +} +bool FiguredBass::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - bool FiguredBass::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importElementSet(message, it, endIter, isSuccess, "figure", myFigureSet); + if (importElement(message, *it, isSuccess, *myDuration, myHasDuration)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "figure", myFigureSet ); - if ( importElement( message, *it, isSuccess, *myDuration, myHasDuration ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - } - - return isSuccess; + continue; } - + importGroup(message, it, endIter, isSuccess, myEditorialGroup); } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FiguredBass.h b/Sourcecode/private/mx/core/elements/FiguredBass.h index 4af6aa7d6..d7944767b 100644 --- a/Sourcecode/private/mx/core/elements/FiguredBass.h +++ b/Sourcecode/private/mx/core/elements/FiguredBass.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/FiguredBassAttributes.h" #include @@ -14,56 +14,59 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FiguredBassAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Figure ) - MX_FORWARD_DECLARE_ELEMENT( FiguredBass ) +MX_FORWARD_DECLARE_ATTRIBUTES(FiguredBassAttributes) +MX_FORWARD_DECLARE_ELEMENT(Duration) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) +MX_FORWARD_DECLARE_ELEMENT(Figure) +MX_FORWARD_DECLARE_ELEMENT(FiguredBass) - inline FiguredBassPtr makeFiguredBass() { return std::make_shared(); } +inline FiguredBassPtr makeFiguredBass() +{ + return std::make_shared(); +} - class FiguredBass : public ElementInterface - { - public: - FiguredBass(); +class FiguredBass : public ElementInterface +{ + public: + FiguredBass(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FiguredBassAttributesPtr getAttributes() const; - void setAttributes( const FiguredBassAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FiguredBassAttributesPtr getAttributes() const; + void setAttributes(const FiguredBassAttributesPtr &value); - /* _________ Figure minOccurs = 1, maxOccurs = unbounded _________ */ - const FigureSet& getFigureSet() const; - void addFigure( const FigurePtr& value ); - void removeFigure( const FigureSetIterConst& value ); - void clearFigureSet(); - FigurePtr getFigure( const FigureSetIterConst& setIterator ) const; + /* _________ Figure minOccurs = 1, maxOccurs = unbounded _________ */ + const FigureSet &getFigureSet() const; + void addFigure(const FigurePtr &value); + void removeFigure(const FigureSetIterConst &value); + void clearFigureSet(); + FigurePtr getFigure(const FigureSetIterConst &setIterator) const; - /* _________ Duration minOccurs = 0, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - bool getHasDuration() const; - void setHasDuration( const bool value ); + /* _________ Duration minOccurs = 0, maxOccurs = 1 _________ */ + DurationPtr getDuration() const; + void setDuration(const DurationPtr &value); + bool getHasDuration() const; + void setHasDuration(const bool value); - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); + /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialGroupPtr getEditorialGroup() const; + void setEditorialGroup(const EditorialGroupPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - FiguredBassAttributesPtr myAttributes; - FigureSet myFigureSet; - DurationPtr myDuration; - bool myHasDuration; - EditorialGroupPtr myEditorialGroup; - }; - } -} + private: + FiguredBassAttributesPtr myAttributes; + FigureSet myFigureSet; + DurationPtr myDuration; + bool myHasDuration; + EditorialGroupPtr myEditorialGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp b/Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp index 1b9b1e127..0567688d5 100644 --- a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp @@ -8,111 +8,119 @@ namespace mx { - namespace core +namespace core +{ +FiguredBassAttributes::FiguredBassAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), printObject(YesNo::no), + printDot(YesNo::no), printSpacing(YesNo::no), printLyric(YesNo::no), parentheses(YesNo::no), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasColor(false), hasPrintObject(false), hasPrintDot(false), + hasPrintSpacing(false), hasPrintLyric(false), hasParentheses(false) +{ +} + +bool FiguredBassAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPrintObject || hasPrintDot || hasPrintSpacing || hasPrintLyric || + hasParentheses; +} + +std::ostream &FiguredBassAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - FiguredBassAttributes::FiguredBassAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject( YesNo::no ) - ,printDot( YesNo::no ) - ,printSpacing( YesNo::no ) - ,printLyric( YesNo::no ) - ,parentheses( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - ,hasPrintDot( false ) - ,hasPrintSpacing( false ) - ,hasPrintLyric( false ) - ,hasParentheses( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, printDot, "print-dot", hasPrintDot); + streamAttribute(os, printSpacing, "print-spacing", hasPrintSpacing); + streamAttribute(os, printLyric, "print-lyric", hasPrintLyric); + streamAttribute(os, parentheses, "parentheses", hasParentheses); + } + return os; +} +bool FiguredBassAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FiguredBassAttributes"; + bool isSuccess = true; - bool FiguredBassAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject || - hasPrintDot || - hasPrintSpacing || - hasPrintLyric || - hasParentheses; + continue; } - - - std::ostream& FiguredBassAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, printDot, "print-dot", hasPrintDot ); - streamAttribute( os, printSpacing, "print-spacing", hasPrintSpacing ); - streamAttribute( os, printLyric, "print-lyric", hasPrintLyric ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - } - return os; + continue; } - - - bool FiguredBassAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "FiguredBassAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printDot, hasPrintDot, "print-dot", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printLyric, hasPrintLyric, "print-lyric", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printDot, hasPrintDot, "print-dot", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", + &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printLyric, hasPrintLyric, "print-lyric", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.h b/Sourcecode/private/mx/core/elements/FiguredBassAttributes.h index a83bdfa0f..b9f10cf94 100644 --- a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.h +++ b/Sourcecode/private/mx/core/elements/FiguredBassAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,48 +18,48 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FiguredBassAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FiguredBassAttributes) - struct FiguredBassAttributes : public AttributesInterface - { - public: - FiguredBassAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - YesNo printDot; - YesNo printSpacing; - YesNo printLyric; - YesNo parentheses; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; - bool hasPrintDot; - bool hasPrintSpacing; - bool hasPrintLyric; - bool hasParentheses; +struct FiguredBassAttributes : public AttributesInterface +{ + public: + FiguredBassAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + YesNo printObject; + YesNo printDot; + YesNo printSpacing; + YesNo printLyric; + YesNo parentheses; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPrintObject; + bool hasPrintDot; + bool hasPrintSpacing; + bool hasPrintLyric; + bool hasParentheses; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fingering.cpp b/Sourcecode/private/mx/core/elements/Fingering.cpp index 322333c47..c3c54b615 100644 --- a/Sourcecode/private/mx/core/elements/Fingering.cpp +++ b/Sourcecode/private/mx/core/elements/Fingering.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Fingering::Fingering() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Fingering::Fingering( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Fingering::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Fingering::hasContents() const - { - return true; - } - - - std::ostream& Fingering::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Fingering::streamName( std::ostream& os ) const - { - os << "fingering"; - return os; - } - - - std::ostream& Fingering::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Fingering::Fingering() : myValue(), myAttributes(std::make_shared()) +{ +} +Fingering::Fingering(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - FingeringAttributesPtr Fingering::getAttributes() const - { - return myAttributes; - } +bool Fingering::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Fingering::hasContents() const +{ + return true; +} - void Fingering::setAttributes( const FingeringAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Fingering::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Fingering::streamName(std::ostream &os) const +{ + os << "fingering"; + return os; +} - XsString Fingering::getValue() const - { - return myValue; - } +std::ostream &Fingering::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FingeringAttributesPtr Fingering::getAttributes() const +{ + return myAttributes; +} - void Fingering::setValue( const XsString& value ) - { - myValue = value; - } +void Fingering::setAttributes(const FingeringAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Fingering::getValue() const +{ + return myValue; +} - bool Fingering::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } +void Fingering::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Fingering::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fingering.h b/Sourcecode/private/mx/core/elements/Fingering.h index 220fe0f52..c9df34d4d 100644 --- a/Sourcecode/private/mx/core/elements/Fingering.h +++ b/Sourcecode/private/mx/core/elements/Fingering.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/FingeringAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FingeringAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Fingering ) - - inline FingeringPtr makeFingering() { return std::make_shared(); } - inline FingeringPtr makeFingering( const XsString& value ) { return std::make_shared( value ); } - inline FingeringPtr makeFingering( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Fingering : public ElementInterface - { - public: - Fingering(); - Fingering( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FingeringAttributesPtr getAttributes() const; - void setAttributes( const FingeringAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FingeringAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(FingeringAttributes) +MX_FORWARD_DECLARE_ELEMENT(Fingering) + +inline FingeringPtr makeFingering() +{ + return std::make_shared(); +} + +inline FingeringPtr makeFingering(const XsString &value) +{ + return std::make_shared(value); } + +inline FingeringPtr makeFingering(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Fingering : public ElementInterface +{ + public: + Fingering(); + Fingering(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FingeringAttributesPtr getAttributes() const; + void setAttributes(const FingeringAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + FingeringAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FingeringAttributes.cpp b/Sourcecode/private/mx/core/elements/FingeringAttributes.cpp index bffa41338..d9a3f08dd 100644 --- a/Sourcecode/private/mx/core/elements/FingeringAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FingeringAttributes.cpp @@ -8,96 +8,102 @@ namespace mx { - namespace core +namespace core +{ +FingeringAttributes::FingeringAttributes() + : substitution(YesNo::no), alternate(YesNo::no), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), + placement(), hasSubstitution(false), hasAlternate(false), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false), hasPlacement(false) +{ +} + +bool FingeringAttributes::hasValues() const +{ + return hasSubstitution || hasAlternate || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || + hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasPlacement; +} + +std::ostream &FingeringAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - FingeringAttributes::FingeringAttributes() - :substitution( YesNo::no ) - ,alternate( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasSubstitution( false ) - ,hasAlternate( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, substitution, "substitution", hasSubstitution); + streamAttribute(os, alternate, "alternate", hasAlternate); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool FingeringAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FingeringAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool FingeringAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, substitution, hasSubstitution, "substitution", + &parseYesNo)) { - return hasSubstitution || - hasAlternate || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& FingeringAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, alternate, hasAlternate, "alternate", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, substitution, "substitution", hasSubstitution ); - streamAttribute( os, alternate, "alternate", hasAlternate ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool FingeringAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - const char* const className = "FingeringAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, substitution, hasSubstitution, "substitution", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, alternate, hasAlternate, "alternate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FingeringAttributes.h b/Sourcecode/private/mx/core/elements/FingeringAttributes.h index 3312ab040..419261c4b 100644 --- a/Sourcecode/private/mx/core/elements/FingeringAttributes.h +++ b/Sourcecode/private/mx/core/elements/FingeringAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,42 +17,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FingeringAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FingeringAttributes) - struct FingeringAttributes : public AttributesInterface - { - public: - FingeringAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo substitution; - YesNo alternate; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasSubstitution; - bool hasAlternate; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct FingeringAttributes : public AttributesInterface +{ + public: + FingeringAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo substitution; + YesNo alternate; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasSubstitution; + bool hasAlternate; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fingernails.cpp b/Sourcecode/private/mx/core/elements/Fingernails.cpp index c119170ba..065382587 100644 --- a/Sourcecode/private/mx/core/elements/Fingernails.cpp +++ b/Sourcecode/private/mx/core/elements/Fingernails.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Fingernails::Fingernails() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Fingernails::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Fingernails::hasContents() const { return false; } - std::ostream& Fingernails::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Fingernails::streamName( std::ostream& os ) const { os << "fingernails"; return os; } - std::ostream& Fingernails::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Fingernails::Fingernails() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Fingernails::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Fingernails::getAttributes() const - { - return myAttributes; - } +bool Fingernails::hasContents() const +{ + return false; +} +std::ostream &Fingernails::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Fingernails::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Fingernails::streamName(std::ostream &os) const +{ + os << "fingernails"; + return os; +} +std::ostream &Fingernails::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Fingernails::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Fingernails::getAttributes() const +{ + return myAttributes; +} +void Fingernails::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Fingernails::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fingernails.h b/Sourcecode/private/mx/core/elements/Fingernails.h index b6161dd04..870f85bb3 100644 --- a/Sourcecode/private/mx/core/elements/Fingernails.h +++ b/Sourcecode/private/mx/core/elements/Fingernails.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Fingernails ) - - inline FingernailsPtr makeFingernails() { return std::make_shared(); } - - class Fingernails : public ElementInterface - { - public: - Fingernails(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Fingernails) + +inline FingernailsPtr makeFingernails() +{ + return std::make_shared(); } + +class Fingernails : public ElementInterface +{ + public: + Fingernails(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FirstFret.cpp b/Sourcecode/private/mx/core/elements/FirstFret.cpp index 866f12f66..d953189f3 100644 --- a/Sourcecode/private/mx/core/elements/FirstFret.cpp +++ b/Sourcecode/private/mx/core/elements/FirstFret.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - FirstFret::FirstFret() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - FirstFret::FirstFret( const PositiveInteger& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool FirstFret::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool FirstFret::hasContents() const - { - return true; - } - - - std::ostream& FirstFret::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& FirstFret::streamName( std::ostream& os ) const - { - os << "first-fret"; - return os; - } - - - std::ostream& FirstFret::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +FirstFret::FirstFret() : myValue(), myAttributes(std::make_shared()) +{ +} +FirstFret::FirstFret(const PositiveInteger &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - FirstFretAttributesPtr FirstFret::getAttributes() const - { - return myAttributes; - } +bool FirstFret::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool FirstFret::hasContents() const +{ + return true; +} - void FirstFret::setAttributes( const FirstFretAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &FirstFret::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &FirstFret::streamName(std::ostream &os) const +{ + os << "first-fret"; + return os; +} - PositiveInteger FirstFret::getValue() const - { - return myValue; - } +std::ostream &FirstFret::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FirstFretAttributesPtr FirstFret::getAttributes() const +{ + return myAttributes; +} - void FirstFret::setValue( const PositiveInteger& value ) - { - myValue = value; - } +void FirstFret::setAttributes(const FirstFretAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +PositiveInteger FirstFret::getValue() const +{ + return myValue; +} - bool FirstFret::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void FirstFret::setValue(const PositiveInteger &value) +{ + myValue = value; +} - } +bool FirstFret::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FirstFret.h b/Sourcecode/private/mx/core/elements/FirstFret.h index 456e33b71..b557c76bc 100644 --- a/Sourcecode/private/mx/core/elements/FirstFret.h +++ b/Sourcecode/private/mx/core/elements/FirstFret.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/elements/FirstFretAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FirstFretAttributes ) - MX_FORWARD_DECLARE_ELEMENT( FirstFret ) - - inline FirstFretPtr makeFirstFret() { return std::make_shared(); } - inline FirstFretPtr makeFirstFret( const PositiveInteger& value ) { return std::make_shared( value ); } - inline FirstFretPtr makeFirstFret( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class FirstFret : public ElementInterface - { - public: - FirstFret(); - FirstFret( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FirstFretAttributesPtr getAttributes() const; - void setAttributes( const FirstFretAttributesPtr& attributes ); - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - FirstFretAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(FirstFretAttributes) +MX_FORWARD_DECLARE_ELEMENT(FirstFret) + +inline FirstFretPtr makeFirstFret() +{ + return std::make_shared(); +} + +inline FirstFretPtr makeFirstFret(const PositiveInteger &value) +{ + return std::make_shared(value); } + +inline FirstFretPtr makeFirstFret(PositiveInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class FirstFret : public ElementInterface +{ + public: + FirstFret(); + FirstFret(const PositiveInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FirstFretAttributesPtr getAttributes() const; + void setAttributes(const FirstFretAttributesPtr &attributes); + PositiveInteger getValue() const; + void setValue(const PositiveInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveInteger myValue; + FirstFretAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp b/Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp index 2894b8f24..d75d0a3c8 100644 --- a/Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp @@ -8,51 +8,49 @@ namespace mx { - namespace core - { - FirstFretAttributes::FirstFretAttributes() - :text() - ,location() - ,hasText( false ) - ,hasLocation( false ) - {} +namespace core +{ +FirstFretAttributes::FirstFretAttributes() : text(), location(), hasText(false), hasLocation(false) +{ +} +bool FirstFretAttributes::hasValues() const +{ + return hasText || hasLocation; +} - bool FirstFretAttributes::hasValues() const - { - return hasText || - hasLocation; - } +std::ostream &FirstFretAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, text, "text", hasText); + streamAttribute(os, location, "location", hasLocation); + } + return os; +} +bool FirstFretAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FirstFretAttributes"; + bool isSuccess = true; - std::ostream& FirstFretAttributes::toStream( std::ostream& os ) const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, text, hasText, "text")) { - if ( hasValues() ) - { - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, location, "location", hasLocation ); - } - return os; + continue; } - - - bool FirstFretAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight)) { - const char* const className = "FirstFretAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FirstFretAttributes.h b/Sourcecode/private/mx/core/elements/FirstFretAttributes.h index 75587f07a..b9ee93005 100644 --- a/Sourcecode/private/mx/core/elements/FirstFretAttributes.h +++ b/Sourcecode/private/mx/core/elements/FirstFretAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XmlLang.h" #include "mx/core/XsString.h" #include "mx/core/XsToken.h" @@ -17,24 +17,24 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FirstFretAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FirstFretAttributes) - struct FirstFretAttributes : public AttributesInterface - { - public: - FirstFretAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken text; - LeftRight location; - bool hasText; - bool hasLocation; +struct FirstFretAttributes : public AttributesInterface +{ + public: + FirstFretAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken text; + LeftRight location; + bool hasText; + bool hasLocation; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Footnote.cpp b/Sourcecode/private/mx/core/elements/Footnote.cpp index c1295641c..564ef03ed 100644 --- a/Sourcecode/private/mx/core/elements/Footnote.cpp +++ b/Sourcecode/private/mx/core/elements/Footnote.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Footnote::Footnote() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Footnote::Footnote( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Footnote::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Footnote::hasContents() const - { - return true; - } - - - std::ostream& Footnote::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Footnote::streamName( std::ostream& os ) const - { - os << "footnote"; - return os; - } - - - std::ostream& Footnote::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Footnote::Footnote() : myValue(), myAttributes(std::make_shared()) +{ +} +Footnote::Footnote(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - FootnoteAttributesPtr Footnote::getAttributes() const - { - return myAttributes; - } +bool Footnote::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Footnote::hasContents() const +{ + return true; +} - void Footnote::setAttributes( const FootnoteAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Footnote::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Footnote::streamName(std::ostream &os) const +{ + os << "footnote"; + return os; +} - XsString Footnote::getValue() const - { - return myValue; - } +std::ostream &Footnote::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FootnoteAttributesPtr Footnote::getAttributes() const +{ + return myAttributes; +} - void Footnote::setValue( const XsString& value ) - { - myValue = value; - } +void Footnote::setAttributes(const FootnoteAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Footnote::getValue() const +{ + return myValue; +} - bool Footnote::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Footnote::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Footnote::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Footnote.h b/Sourcecode/private/mx/core/elements/Footnote.h index 63a168b22..6c64c74ab 100644 --- a/Sourcecode/private/mx/core/elements/Footnote.h +++ b/Sourcecode/private/mx/core/elements/Footnote.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/FootnoteAttributes.h" #include @@ -14,38 +14,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FootnoteAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - - inline FootnotePtr makeFootnote() { return std::make_shared(); } - inline FootnotePtr makeFootnote( const XsString& value ) { return std::make_shared( value ); } - inline FootnotePtr makeFootnote( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Footnote : public ElementInterface - { - public: - Footnote(); - Footnote( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FootnoteAttributesPtr getAttributes() const; - void setAttributes( const FootnoteAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FootnoteAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(FootnoteAttributes) +MX_FORWARD_DECLARE_ELEMENT(Footnote) + +inline FootnotePtr makeFootnote() +{ + return std::make_shared(); +} + +inline FootnotePtr makeFootnote(const XsString &value) +{ + return std::make_shared(value); } + +inline FootnotePtr makeFootnote(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Footnote : public ElementInterface +{ + public: + Footnote(); + Footnote(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FootnoteAttributesPtr getAttributes() const; + void setAttributes(const FootnoteAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + FootnoteAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp b/Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp index d4582b3f1..1605ed181 100644 --- a/Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp @@ -8,138 +8,154 @@ namespace mx { - namespace core - { - FootnoteAttributes::FootnoteAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( XmlLang{ "it" } ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - +namespace core +{ +FootnoteAttributes::FootnoteAttributes() + : justify(LeftCenterRight::center), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), halign(), + underline(), overline(), lineThrough(), rotation(), letterSpacing(), lineHeight(), lang(XmlLang{"it"}), + space(XmlSpace::default_), enclosure(EnclosureShape::rectangle), hasJustify(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasHalign(false), hasUnderline(false), hasOverline(false), + hasLineThrough(false), hasRotation(false), hasLetterSpacing(false), hasLineHeight(false), hasLang(false), + hasSpace(false), hasEnclosure(false) +{ +} - bool FootnoteAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } +bool FootnoteAttributes::hasValues() const +{ + return hasJustify || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight || hasHalign || hasUnderline || hasOverline || hasLineThrough || hasRotation || + hasLetterSpacing || hasLineHeight || hasLang || hasSpace || hasEnclosure; +} +std::ostream &FootnoteAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, justify, "justify", hasJustify); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, underline, "underline", hasUnderline); + streamAttribute(os, overline, "overline", hasOverline); + streamAttribute(os, lineThrough, "line-through", hasLineThrough); + streamAttribute(os, rotation, "rotation", hasRotation); + streamAttribute(os, letterSpacing, "letter-spacing", hasLetterSpacing); + streamAttribute(os, lineHeight, "line-height", hasLineHeight); + streamAttribute(os, lang, "xml:lang", hasLang); + streamAttribute(os, space, "xml:space", hasSpace); + streamAttribute(os, enclosure, "enclosure", hasEnclosure); + } + return os; +} - std::ostream& FootnoteAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } +bool FootnoteAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FootnoteAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool FootnoteAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FootnoteAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - return isSuccess; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, underline, hasUnderline, "underline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, overline, hasOverline, "overline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, rotation, hasRotation, "rotation")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "xml:lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", + &parseEnclosureShape)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FootnoteAttributes.h b/Sourcecode/private/mx/core/elements/FootnoteAttributes.h index f73f3e156..3dc211c13 100644 --- a/Sourcecode/private/mx/core/elements/FootnoteAttributes.h +++ b/Sourcecode/private/mx/core/elements/FootnoteAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/NumberOrNormal.h" #include "mx/core/XmlLang.h" @@ -20,58 +20,58 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FootnoteAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FootnoteAttributes) - struct FootnoteAttributes : public AttributesInterface - { - public: - FootnoteAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; +struct FootnoteAttributes : public AttributesInterface +{ + public: + FootnoteAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + LeftCenterRight justify; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + NumberOfLines underline; + NumberOfLines overline; + NumberOfLines lineThrough; + RotationDegrees rotation; + NumberOrNormal letterSpacing; + NumberOrNormal lineHeight; + XmlLang lang; + XmlSpace space; + EnclosureShape enclosure; + bool hasJustify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; + bool hasUnderline; + bool hasOverline; + bool hasLineThrough; + bool hasRotation; + bool hasLetterSpacing; + bool hasLineHeight; + bool hasLang; + bool hasSpace; + bool hasEnclosure; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Forward.cpp b/Sourcecode/private/mx/core/elements/Forward.cpp index e039d5f44..054a14da8 100644 --- a/Sourcecode/private/mx/core/elements/Forward.cpp +++ b/Sourcecode/private/mx/core/elements/Forward.cpp @@ -11,133 +11,124 @@ namespace mx { - namespace core - { - Forward::Forward() - :myDuration( makeDuration() ) - ,myEditorialVoiceGroup( makeEditorialVoiceGroup() ) - ,myStaff( makeStaff() ) - ,myHasStaff( false ) - {} - - - bool Forward::hasAttributes() const - { - return false; - } - - - std::ostream& Forward::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Forward::streamName( std::ostream& os ) const - { - os << "forward"; - return os; - } - - - bool Forward::hasContents() const - { - return true; - } - - - std::ostream& Forward::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myDuration->toStream( os, indentLevel+1 ); - if ( myEditorialVoiceGroup->hasContents() ) - { - os << std::endl; - myEditorialVoiceGroup->streamContents(os, indentLevel+1, isOneLineOnly ); - } - if ( myHasStaff ) - { - os << std::endl; - myStaff->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - return os; - } - +namespace core +{ +Forward::Forward() + : myDuration(makeDuration()), myEditorialVoiceGroup(makeEditorialVoiceGroup()), myStaff(makeStaff()), + myHasStaff(false) +{ +} - DurationPtr Forward::getDuration() const - { - return myDuration; - } +bool Forward::hasAttributes() const +{ + return false; +} +std::ostream &Forward::streamAttributes(std::ostream &os) const +{ + return os; +} - void Forward::setDuration( const DurationPtr& value ) - { - if( value ) - { - myDuration = value; - } - } +std::ostream &Forward::streamName(std::ostream &os) const +{ + os << "forward"; + return os; +} +bool Forward::hasContents() const +{ + return true; +} - EditorialVoiceGroupPtr Forward::getEditorialVoiceGroup() const - { - return myEditorialVoiceGroup; - } +std::ostream &Forward::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myDuration->toStream(os, indentLevel + 1); + if (myEditorialVoiceGroup->hasContents()) + { + os << std::endl; + myEditorialVoiceGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + } + if (myHasStaff) + { + os << std::endl; + myStaff->toStream(os, indentLevel + 1); + } + isOneLineOnly = false; + os << std::endl; + return os; +} +DurationPtr Forward::getDuration() const +{ + return myDuration; +} - void Forward::setEditorialVoiceGroup( const EditorialVoiceGroupPtr& value ) - { - if ( value ) - { - myEditorialVoiceGroup = value; - } - } +void Forward::setDuration(const DurationPtr &value) +{ + if (value) + { + myDuration = value; + } +} +EditorialVoiceGroupPtr Forward::getEditorialVoiceGroup() const +{ + return myEditorialVoiceGroup; +} - StaffPtr Forward::getStaff() const - { - return myStaff; - } +void Forward::setEditorialVoiceGroup(const EditorialVoiceGroupPtr &value) +{ + if (value) + { + myEditorialVoiceGroup = value; + } +} +StaffPtr Forward::getStaff() const +{ + return myStaff; +} - void Forward::setStaff( const StaffPtr& value ) - { - if( value ) - { - myStaff = value; - } - } +void Forward::setStaff(const StaffPtr &value) +{ + if (value) + { + myStaff = value; + } +} +bool Forward::getHasStaff() const +{ + return myHasStaff; +} - bool Forward::getHasStaff() const - { - return myHasStaff; - } +void Forward::setHasStaff(const bool value) +{ + myHasStaff = value; +} +bool Forward::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isDurationFound = false; - void Forward::setHasStaff( const bool value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myDuration, isDurationFound)) { - myHasStaff = value; + continue; } - - - bool Forward::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + importGroup(message, it, endIter, isSuccess, myEditorialVoiceGroup); + if (importElement(message, *it, isSuccess, *myStaff, myHasStaff)) { - bool isSuccess = true; - bool isDurationFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myDuration, isDurationFound ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialVoiceGroup ); - if ( importElement( message, *it, isSuccess, *myStaff, myHasStaff ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Forward.h b/Sourcecode/private/mx/core/elements/Forward.h index 2597af8f5..d72490b48 100644 --- a/Sourcecode/private/mx/core/elements/Forward.h +++ b/Sourcecode/private/mx/core/elements/Forward.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,50 +13,53 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceGroup ) - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - MX_FORWARD_DECLARE_ELEMENT( Staff ) - MX_FORWARD_DECLARE_ELEMENT( Forward ) - - inline ForwardPtr makeForward() { return std::make_shared(); } - - class Forward : public ElementInterface - { - public: - Forward(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - - /* _________ Footnote minOccurs = 1, maxOccurs = 1 _________ */ - EditorialVoiceGroupPtr getEditorialVoiceGroup() const; - void setEditorialVoiceGroup( const EditorialVoiceGroupPtr& value ); - - /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ - StaffPtr getStaff() const; - void setStaff( const StaffPtr& value ); - bool getHasStaff() const; - void setHasStaff( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DurationPtr myDuration; - EditorialVoiceGroupPtr myEditorialVoiceGroup; - StaffPtr myStaff; - bool myHasStaff; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Duration) +MX_FORWARD_DECLARE_ELEMENT(EditorialVoiceGroup) +MX_FORWARD_DECLARE_ELEMENT(Footnote) +MX_FORWARD_DECLARE_ELEMENT(Staff) +MX_FORWARD_DECLARE_ELEMENT(Forward) + +inline ForwardPtr makeForward() +{ + return std::make_shared(); } + +class Forward : public ElementInterface +{ + public: + Forward(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ + DurationPtr getDuration() const; + void setDuration(const DurationPtr &value); + + /* _________ Footnote minOccurs = 1, maxOccurs = 1 _________ */ + EditorialVoiceGroupPtr getEditorialVoiceGroup() const; + void setEditorialVoiceGroup(const EditorialVoiceGroupPtr &value); + + /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ + StaffPtr getStaff() const; + void setStaff(const StaffPtr &value); + bool getHasStaff() const; + void setHasStaff(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DurationPtr myDuration; + EditorialVoiceGroupPtr myEditorialVoiceGroup; + StaffPtr myStaff; + bool myHasStaff; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Frame.cpp b/Sourcecode/private/mx/core/elements/Frame.cpp index f51a92fa4..26e115dbb 100644 --- a/Sourcecode/private/mx/core/elements/Frame.cpp +++ b/Sourcecode/private/mx/core/elements/Frame.cpp @@ -12,209 +12,193 @@ namespace mx { - namespace core - { - Frame::Frame() - :myAttributes( std::make_shared() ) - ,myFrameStrings( makeFrameStrings() ) - ,myFrameFrets( makeFrameFrets() ) - ,myFirstFret( makeFirstFret() ) - ,myHasFirstFret( false ) - ,myFrameNoteSet() - { - myFrameNoteSet.push_back( makeFrameNote() ); - } - - - bool Frame::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Frame::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Frame::streamName( std::ostream& os ) const - { - os << "frame"; - return os; - } - - - bool Frame::hasContents() const - { - return true; - } - - - std::ostream& Frame::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myFrameStrings->toStream( os, indentLevel+1 ); - os << std::endl; - myFrameFrets->toStream( os, indentLevel+1 ); - if ( myHasFirstFret ) - { - os << std::endl; - myFirstFret->toStream( os, indentLevel+1 ); - } - for ( auto x : myFrameNoteSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - FrameAttributesPtr Frame::getAttributes() const - { - return myAttributes; - } - - - void Frame::setAttributes( const FrameAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - +namespace core +{ +Frame::Frame() + : myAttributes(std::make_shared()), myFrameStrings(makeFrameStrings()), + myFrameFrets(makeFrameFrets()), myFirstFret(makeFirstFret()), myHasFirstFret(false), myFrameNoteSet() +{ + myFrameNoteSet.push_back(makeFrameNote()); +} - FrameStringsPtr Frame::getFrameStrings() const - { - return myFrameStrings; - } +bool Frame::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Frame::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void Frame::setFrameStrings( const FrameStringsPtr& value ) - { - if( value ) - { - myFrameStrings = value; - } - } +std::ostream &Frame::streamName(std::ostream &os) const +{ + os << "frame"; + return os; +} +bool Frame::hasContents() const +{ + return true; +} - FrameFretsPtr Frame::getFrameFrets() const - { - return myFrameFrets; - } +std::ostream &Frame::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myFrameStrings->toStream(os, indentLevel + 1); + os << std::endl; + myFrameFrets->toStream(os, indentLevel + 1); + if (myHasFirstFret) + { + os << std::endl; + myFirstFret->toStream(os, indentLevel + 1); + } + for (auto x : myFrameNoteSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + os << std::endl; + return os; +} +FrameAttributesPtr Frame::getAttributes() const +{ + return myAttributes; +} - void Frame::setFrameFrets( const FrameFretsPtr& value ) - { - if( value ) - { - myFrameFrets = value; - } - } +void Frame::setAttributes(const FrameAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +FrameStringsPtr Frame::getFrameStrings() const +{ + return myFrameStrings; +} - FirstFretPtr Frame::getFirstFret() const - { - return myFirstFret; - } +void Frame::setFrameStrings(const FrameStringsPtr &value) +{ + if (value) + { + myFrameStrings = value; + } +} +FrameFretsPtr Frame::getFrameFrets() const +{ + return myFrameFrets; +} - void Frame::setFirstFret( const FirstFretPtr& value ) - { - if( value ) - { - myFirstFret = value; - } - } +void Frame::setFrameFrets(const FrameFretsPtr &value) +{ + if (value) + { + myFrameFrets = value; + } +} +FirstFretPtr Frame::getFirstFret() const +{ + return myFirstFret; +} - bool Frame::getHasFirstFret() const - { - return myHasFirstFret; - } +void Frame::setFirstFret(const FirstFretPtr &value) +{ + if (value) + { + myFirstFret = value; + } +} +bool Frame::getHasFirstFret() const +{ + return myHasFirstFret; +} - void Frame::setHasFirstFret( const bool value ) - { - myHasFirstFret = value; - } +void Frame::setHasFirstFret(const bool value) +{ + myHasFirstFret = value; +} +const FrameNoteSet &Frame::getFrameNoteSet() const +{ + return myFrameNoteSet; +} - const FrameNoteSet& Frame::getFrameNoteSet() const +void Frame::removeFrameNote(const FrameNoteSetIterConst &value) +{ + if (value != myFrameNoteSet.cend()) + { + if (myFrameNoteSet.size() > 1) { - return myFrameNoteSet; + myFrameNoteSet.erase(value); } + } +} +void Frame::addFrameNote(const FrameNotePtr &value) +{ + if (value) + { + myFrameNoteSet.push_back(value); + } +} - void Frame::removeFrameNote( const FrameNoteSetIterConst& value ) - { - if ( value != myFrameNoteSet.cend() ) - { - if ( myFrameNoteSet.size() > 1 ) - { - myFrameNoteSet.erase( value ); - } - } - } - +void Frame::clearFrameNoteSet() +{ + myFrameNoteSet.clear(); + myFrameNoteSet.push_back(makeFrameNote()); +} - void Frame::addFrameNote( const FrameNotePtr& value ) - { - if ( value ) - { - myFrameNoteSet.push_back( value ); - } - } +FrameNotePtr Frame::getFrameNote(const FrameNoteSetIterConst &setIterator) const +{ + if (setIterator != myFrameNoteSet.cend()) + { + return *setIterator; + } + return FrameNotePtr(); +} +bool Frame::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isFrameStringsFound = false; + bool isFrameFretsFound = false; - void Frame::clearFrameNoteSet() + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myFrameStrings, isFrameStringsFound)) { - myFrameNoteSet.clear(); - myFrameNoteSet.push_back( makeFrameNote() ); + continue; } - - - FrameNotePtr Frame::getFrameNote( const FrameNoteSetIterConst& setIterator ) const + if (importElement(message, *it, isSuccess, *myFrameFrets, isFrameFretsFound)) { - if( setIterator != myFrameNoteSet.cend() ) - { - return *setIterator; - } - return FrameNotePtr(); + continue; } - - - bool Frame::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myFirstFret, myHasFirstFret)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isFrameStringsFound = false; - bool isFrameFretsFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myFrameStrings, isFrameStringsFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFrameFrets, isFrameFretsFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFirstFret, myHasFirstFret ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "frame-note", myFrameNoteSet ); - } - - if( !isFrameStringsFound ) - { - message << "Frame: '" << myFrameStrings->getElementName() << "' is required but was not found" << std::endl; - } - if( !isFrameFretsFound ) - { - message << "Frame: '" << myFrameFrets->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + importElementSet(message, it, endIter, isSuccess, "frame-note", myFrameNoteSet); + } + if (!isFrameStringsFound) + { + message << "Frame: '" << myFrameStrings->getElementName() << "' is required but was not found" << std::endl; } + if (!isFrameFretsFound) + { + message << "Frame: '" << myFrameFrets->getElementName() << "' is required but was not found" << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Frame.h b/Sourcecode/private/mx/core/elements/Frame.h index 4feb6e214..b23b9f1f0 100644 --- a/Sourcecode/private/mx/core/elements/Frame.h +++ b/Sourcecode/private/mx/core/elements/Frame.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/FrameAttributes.h" #include @@ -14,62 +14,65 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FrameAttributes ) - MX_FORWARD_DECLARE_ELEMENT( FirstFret ) - MX_FORWARD_DECLARE_ELEMENT( FrameFrets ) - MX_FORWARD_DECLARE_ELEMENT( FrameNote ) - MX_FORWARD_DECLARE_ELEMENT( FrameStrings ) - MX_FORWARD_DECLARE_ELEMENT( Frame ) +MX_FORWARD_DECLARE_ATTRIBUTES(FrameAttributes) +MX_FORWARD_DECLARE_ELEMENT(FirstFret) +MX_FORWARD_DECLARE_ELEMENT(FrameFrets) +MX_FORWARD_DECLARE_ELEMENT(FrameNote) +MX_FORWARD_DECLARE_ELEMENT(FrameStrings) +MX_FORWARD_DECLARE_ELEMENT(Frame) - inline FramePtr makeFrame() { return std::make_shared(); } +inline FramePtr makeFrame() +{ + return std::make_shared(); +} - class Frame : public ElementInterface - { - public: - Frame(); +class Frame : public ElementInterface +{ + public: + Frame(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FrameAttributesPtr getAttributes() const; - void setAttributes( const FrameAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FrameAttributesPtr getAttributes() const; + void setAttributes(const FrameAttributesPtr &value); - /* _________ FrameStrings minOccurs = 1, maxOccurs = 1 _________ */ - FrameStringsPtr getFrameStrings() const; - void setFrameStrings( const FrameStringsPtr& value ); + /* _________ FrameStrings minOccurs = 1, maxOccurs = 1 _________ */ + FrameStringsPtr getFrameStrings() const; + void setFrameStrings(const FrameStringsPtr &value); - /* _________ FrameFrets minOccurs = 1, maxOccurs = 1 _________ */ - FrameFretsPtr getFrameFrets() const; - void setFrameFrets( const FrameFretsPtr& value ); + /* _________ FrameFrets minOccurs = 1, maxOccurs = 1 _________ */ + FrameFretsPtr getFrameFrets() const; + void setFrameFrets(const FrameFretsPtr &value); - /* _________ FirstFret minOccurs = 0, maxOccurs = 1 _________ */ - FirstFretPtr getFirstFret() const; - void setFirstFret( const FirstFretPtr& value ); - bool getHasFirstFret() const; - void setHasFirstFret( const bool value ); + /* _________ FirstFret minOccurs = 0, maxOccurs = 1 _________ */ + FirstFretPtr getFirstFret() const; + void setFirstFret(const FirstFretPtr &value); + bool getHasFirstFret() const; + void setHasFirstFret(const bool value); - /* _________ FrameNote minOccurs = 1, maxOccurs = unbounded _________ */ - const FrameNoteSet& getFrameNoteSet() const; - void addFrameNote( const FrameNotePtr& value ); - void removeFrameNote( const FrameNoteSetIterConst& value ); - void clearFrameNoteSet(); - FrameNotePtr getFrameNote( const FrameNoteSetIterConst& setIterator ) const; + /* _________ FrameNote minOccurs = 1, maxOccurs = unbounded _________ */ + const FrameNoteSet &getFrameNoteSet() const; + void addFrameNote(const FrameNotePtr &value); + void removeFrameNote(const FrameNoteSetIterConst &value); + void clearFrameNoteSet(); + FrameNotePtr getFrameNote(const FrameNoteSetIterConst &setIterator) const; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - FrameAttributesPtr myAttributes; - FrameStringsPtr myFrameStrings; - FrameFretsPtr myFrameFrets; - FirstFretPtr myFirstFret; - bool myHasFirstFret; - FrameNoteSet myFrameNoteSet; - }; - } -} + private: + FrameAttributesPtr myAttributes; + FrameStringsPtr myFrameStrings; + FrameFretsPtr myFrameFrets; + FirstFretPtr myFirstFret; + bool myHasFirstFret; + FrameNoteSet myFrameNoteSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FrameAttributes.cpp b/Sourcecode/private/mx/core/elements/FrameAttributes.cpp index 82e1dcea8..3d9e0bd8f 100644 --- a/Sourcecode/private/mx/core/elements/FrameAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FrameAttributes.cpp @@ -8,91 +8,93 @@ namespace mx { - namespace core +namespace core +{ +FrameAttributes::FrameAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), color(), halign(LeftCenterRight::center), valign(), height(), + width(), unplayed(), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasColor(false), hasHalign(false), hasValign(false), hasHeight(false), hasWidth(false), hasUnplayed(false) +{ +} + +bool FrameAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasColor || hasHalign || hasValign || + hasHeight || hasWidth || hasUnplayed; +} + +std::ostream &FrameAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - FrameAttributes::FrameAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,color() - ,halign( LeftCenterRight::center ) - ,valign() - ,height() - ,width() - ,unplayed() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasHeight( false ) - ,hasWidth( false ) - ,hasUnplayed( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, valign, "valign", hasValign); + streamAttribute(os, height, "height", hasHeight); + streamAttribute(os, width, "width", hasWidth); + streamAttribute(os, unplayed, "unplayed", hasUnplayed); + } + return os; +} + +bool FrameAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FrameAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool FrameAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasColor || - hasHalign || - hasValign || - hasHeight || - hasWidth || - hasUnplayed; + continue; } - - - std::ostream& FrameAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, height, "height", hasHeight ); - streamAttribute( os, width, "width", hasWidth ); - streamAttribute( os, unplayed, "unplayed", hasUnplayed ); - } - return os; + continue; } - - - bool FrameAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "FrameAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValignImage ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, height, hasHeight, "height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, width, hasWidth, "width" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, unplayed, hasUnplayed, "unplayed" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, valign, hasValign, "valign", &parseValignImage)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, height, hasHeight, "height")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, width, hasWidth, "width")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, unplayed, hasUnplayed, "unplayed")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FrameAttributes.h b/Sourcecode/private/mx/core/elements/FrameAttributes.h index 5549525ca..546a6c279 100644 --- a/Sourcecode/private/mx/core/elements/FrameAttributes.h +++ b/Sourcecode/private/mx/core/elements/FrameAttributes.h @@ -4,11 +4,11 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -17,40 +17,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FrameAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FrameAttributes) - struct FrameAttributes : public AttributesInterface - { - public: - FrameAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - Color color; - LeftCenterRight halign; - ValignImage valign; - TenthsValue height; - TenthsValue width; - XsToken unplayed; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasHeight; - bool hasWidth; - bool hasUnplayed; +struct FrameAttributes : public AttributesInterface +{ + public: + FrameAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + Color color; + LeftCenterRight halign; + ValignImage valign; + TenthsValue height; + TenthsValue width; + XsToken unplayed; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasColor; + bool hasHalign; + bool hasValign; + bool hasHeight; + bool hasWidth; + bool hasUnplayed; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FrameFrets.cpp b/Sourcecode/private/mx/core/elements/FrameFrets.cpp index 3f8b72589..f1cc0f530 100644 --- a/Sourcecode/private/mx/core/elements/FrameFrets.cpp +++ b/Sourcecode/private/mx/core/elements/FrameFrets.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - FrameFrets::FrameFrets() - :myValue() - {} - - - FrameFrets::FrameFrets( const PositiveInteger& value ) - :myValue( value ) - {} - - - bool FrameFrets::hasAttributes() const - { - return false; - } - - - bool FrameFrets::hasContents() const - { - return true; - } - - - std::ostream& FrameFrets::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FrameFrets::streamName( std::ostream& os ) const - { - os << "frame-frets"; - return os; - } +namespace core +{ +FrameFrets::FrameFrets() : myValue() +{ +} +FrameFrets::FrameFrets(const PositiveInteger &value) : myValue(value) +{ +} - std::ostream& FrameFrets::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool FrameFrets::hasAttributes() const +{ + return false; +} +bool FrameFrets::hasContents() const +{ + return true; +} - PositiveInteger FrameFrets::getValue() const - { - return myValue; - } +std::ostream &FrameFrets::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &FrameFrets::streamName(std::ostream &os) const +{ + os << "frame-frets"; + return os; +} - void FrameFrets::setValue( const PositiveInteger& value ) - { - myValue = value; - } +std::ostream &FrameFrets::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PositiveInteger FrameFrets::getValue() const +{ + return myValue; +} - bool FrameFrets::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void FrameFrets::setValue(const PositiveInteger &value) +{ + myValue = value; +} - } +bool FrameFrets::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FrameFrets.h b/Sourcecode/private/mx/core/elements/FrameFrets.h index 1e6440b1f..e11f2fc36 100644 --- a/Sourcecode/private/mx/core/elements/FrameFrets.h +++ b/Sourcecode/private/mx/core/elements/FrameFrets.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( FrameFrets ) - - inline FrameFretsPtr makeFrameFrets() { return std::make_shared(); } - inline FrameFretsPtr makeFrameFrets( const PositiveInteger& value ) { return std::make_shared( value ); } - inline FrameFretsPtr makeFrameFrets( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class FrameFrets : public ElementInterface - { - public: - FrameFrets(); - FrameFrets( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(FrameFrets) + +inline FrameFretsPtr makeFrameFrets() +{ + return std::make_shared(); +} + +inline FrameFretsPtr makeFrameFrets(const PositiveInteger &value) +{ + return std::make_shared(value); } + +inline FrameFretsPtr makeFrameFrets(PositiveInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class FrameFrets : public ElementInterface +{ + public: + FrameFrets(); + FrameFrets(const PositiveInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PositiveInteger getValue() const; + void setValue(const PositiveInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FrameNote.cpp b/Sourcecode/private/mx/core/elements/FrameNote.cpp index 19d386da4..2c5ec0021 100644 --- a/Sourcecode/private/mx/core/elements/FrameNote.cpp +++ b/Sourcecode/private/mx/core/elements/FrameNote.cpp @@ -12,174 +12,165 @@ namespace mx { - namespace core - { - FrameNote::FrameNote() - :myString( makeString() ) - ,myFret( makeFret() ) - ,myFingering( makeFingering() ) - ,myHasFingering( false ) - ,myBarre( makeBarre() ) - ,myHasBarre( false ) - {} - - - bool FrameNote::hasAttributes() const - { - return false; - } - - - std::ostream& FrameNote::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FrameNote::streamName( std::ostream& os ) const - { - os << "frame-note"; - return os; - } - - - bool FrameNote::hasContents() const - { - return true; - } - - - std::ostream& FrameNote::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myString->toStream( os, indentLevel+1 ); - os << std::endl; - myFret->toStream( os, indentLevel+1 ); - if ( myHasFingering ) - { - os << std::endl; - myFingering->toStream( os, indentLevel+1 ); - } - if ( myHasBarre ) - { - os << std::endl; - myBarre->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - +namespace core +{ +FrameNote::FrameNote() + : myString(makeString()), myFret(makeFret()), myFingering(makeFingering()), myHasFingering(false), + myBarre(makeBarre()), myHasBarre(false) +{ +} - StringPtr FrameNote::getString() const - { - return myString; - } +bool FrameNote::hasAttributes() const +{ + return false; +} +std::ostream &FrameNote::streamAttributes(std::ostream &os) const +{ + return os; +} - void FrameNote::setString( const StringPtr& value ) - { - if( value ) - { - myString = value; - } - } +std::ostream &FrameNote::streamName(std::ostream &os) const +{ + os << "frame-note"; + return os; +} +bool FrameNote::hasContents() const +{ + return true; +} - FretPtr FrameNote::getFret() const - { - return myFret; - } +std::ostream &FrameNote::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myString->toStream(os, indentLevel + 1); + os << std::endl; + myFret->toStream(os, indentLevel + 1); + if (myHasFingering) + { + os << std::endl; + myFingering->toStream(os, indentLevel + 1); + } + if (myHasBarre) + { + os << std::endl; + myBarre->toStream(os, indentLevel + 1); + } + os << std::endl; + return os; +} +StringPtr FrameNote::getString() const +{ + return myString; +} - void FrameNote::setFret( const FretPtr& value ) - { - if( value ) - { - myFret = value; - } - } +void FrameNote::setString(const StringPtr &value) +{ + if (value) + { + myString = value; + } +} +FretPtr FrameNote::getFret() const +{ + return myFret; +} - FingeringPtr FrameNote::getFingering() const - { - return myFingering; - } +void FrameNote::setFret(const FretPtr &value) +{ + if (value) + { + myFret = value; + } +} +FingeringPtr FrameNote::getFingering() const +{ + return myFingering; +} - void FrameNote::setFingering( const FingeringPtr& value ) - { - if( value ) - { - myFingering = value; - } - } +void FrameNote::setFingering(const FingeringPtr &value) +{ + if (value) + { + myFingering = value; + } +} +bool FrameNote::getHasFingering() const +{ + return myHasFingering; +} - bool FrameNote::getHasFingering() const - { - return myHasFingering; - } +void FrameNote::setHasFingering(const bool value) +{ + myHasFingering = value; +} +BarrePtr FrameNote::getBarre() const +{ + return myBarre; +} - void FrameNote::setHasFingering( const bool value ) - { - myHasFingering = value; - } +void FrameNote::setBarre(const BarrePtr &value) +{ + if (value) + { + myBarre = value; + } +} +bool FrameNote::getHasBarre() const +{ + return myHasBarre; +} - BarrePtr FrameNote::getBarre() const - { - return myBarre; - } +void FrameNote::setHasBarre(const bool value) +{ + myHasBarre = value; +} +bool FrameNote::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isStringFound = false; + bool isFretFound = false; - void FrameNote::setBarre( const BarrePtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myString, isStringFound)) { - if( value ) - { - myBarre = value; - } + continue; } - - - bool FrameNote::getHasBarre() const + if (importElement(message, *it, isSuccess, *myFret, isFretFound)) { - return myHasBarre; + continue; } - - - void FrameNote::setHasBarre( const bool value ) + if (importElement(message, *it, isSuccess, *myFingering, myHasFingering)) { - myHasBarre = value; + continue; } - - - bool FrameNote::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myBarre, myHasBarre)) { - bool isSuccess = true; - bool isStringFound = false; - bool isFretFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myString, isStringFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFret, isFretFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFingering, myHasFingering ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBarre, myHasBarre ) ) { continue; } - } - - if( !isStringFound ) - { - message << "FrameNote: '" << myString->getElementName() << "' is required but was not found" << std::endl; - } - if( !isFretFound ) - { - message << "FrameNote: '" << myFret->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isStringFound) + { + message << "FrameNote: '" << myString->getElementName() << "' is required but was not found" << std::endl; } + if (!isFretFound) + { + message << "FrameNote: '" << myFret->getElementName() << "' is required but was not found" << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FrameNote.h b/Sourcecode/private/mx/core/elements/FrameNote.h index 1efd1e692..049fc3123 100644 --- a/Sourcecode/private/mx/core/elements/FrameNote.h +++ b/Sourcecode/private/mx/core/elements/FrameNote.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,58 +13,61 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Barre ) - MX_FORWARD_DECLARE_ELEMENT( Fingering ) - MX_FORWARD_DECLARE_ELEMENT( Fret ) - MX_FORWARD_DECLARE_ELEMENT( String ) - MX_FORWARD_DECLARE_ELEMENT( FrameNote ) +MX_FORWARD_DECLARE_ELEMENT(Barre) +MX_FORWARD_DECLARE_ELEMENT(Fingering) +MX_FORWARD_DECLARE_ELEMENT(Fret) +MX_FORWARD_DECLARE_ELEMENT(String) +MX_FORWARD_DECLARE_ELEMENT(FrameNote) - inline FrameNotePtr makeFrameNote() { return std::make_shared(); } +inline FrameNotePtr makeFrameNote() +{ + return std::make_shared(); +} - class FrameNote : public ElementInterface - { - public: - FrameNote(); +class FrameNote : public ElementInterface +{ + public: + FrameNote(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ String minOccurs = 1, maxOccurs = 1 _________ */ - StringPtr getString() const; - void setString( const StringPtr& value ); + /* _________ String minOccurs = 1, maxOccurs = 1 _________ */ + StringPtr getString() const; + void setString(const StringPtr &value); - /* _________ Fret minOccurs = 1, maxOccurs = 1 _________ */ - FretPtr getFret() const; - void setFret( const FretPtr& value ); + /* _________ Fret minOccurs = 1, maxOccurs = 1 _________ */ + FretPtr getFret() const; + void setFret(const FretPtr &value); - /* _________ Fingering minOccurs = 0, maxOccurs = 1 _________ */ - FingeringPtr getFingering() const; - void setFingering( const FingeringPtr& value ); - bool getHasFingering() const; - void setHasFingering( const bool value ); + /* _________ Fingering minOccurs = 0, maxOccurs = 1 _________ */ + FingeringPtr getFingering() const; + void setFingering(const FingeringPtr &value); + bool getHasFingering() const; + void setHasFingering(const bool value); - /* _________ Barre minOccurs = 0, maxOccurs = 1 _________ */ - BarrePtr getBarre() const; - void setBarre( const BarrePtr& value ); - bool getHasBarre() const; - void setHasBarre( const bool value ); + /* _________ Barre minOccurs = 0, maxOccurs = 1 _________ */ + BarrePtr getBarre() const; + void setBarre(const BarrePtr &value); + bool getHasBarre() const; + void setHasBarre(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - StringPtr myString; - FretPtr myFret; - FingeringPtr myFingering; - bool myHasFingering; - BarrePtr myBarre; - bool myHasBarre; - }; - } -} + private: + StringPtr myString; + FretPtr myFret; + FingeringPtr myFingering; + bool myHasFingering; + BarrePtr myBarre; + bool myHasBarre; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FrameStrings.cpp b/Sourcecode/private/mx/core/elements/FrameStrings.cpp index 927bf2d08..042f801d1 100644 --- a/Sourcecode/private/mx/core/elements/FrameStrings.cpp +++ b/Sourcecode/private/mx/core/elements/FrameStrings.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - FrameStrings::FrameStrings() - :myValue() - {} - - - FrameStrings::FrameStrings( const PositiveInteger& value ) - :myValue( value ) - {} - - - bool FrameStrings::hasAttributes() const - { - return false; - } - - - bool FrameStrings::hasContents() const - { - return true; - } - - - std::ostream& FrameStrings::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FrameStrings::streamName( std::ostream& os ) const - { - os << "frame-strings"; - return os; - } +namespace core +{ +FrameStrings::FrameStrings() : myValue() +{ +} +FrameStrings::FrameStrings(const PositiveInteger &value) : myValue(value) +{ +} - std::ostream& FrameStrings::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool FrameStrings::hasAttributes() const +{ + return false; +} +bool FrameStrings::hasContents() const +{ + return true; +} - PositiveInteger FrameStrings::getValue() const - { - return myValue; - } +std::ostream &FrameStrings::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &FrameStrings::streamName(std::ostream &os) const +{ + os << "frame-strings"; + return os; +} - void FrameStrings::setValue( const PositiveInteger& value ) - { - myValue = value; - } +std::ostream &FrameStrings::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PositiveInteger FrameStrings::getValue() const +{ + return myValue; +} - bool FrameStrings::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void FrameStrings::setValue(const PositiveInteger &value) +{ + myValue = value; +} - } +bool FrameStrings::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FrameStrings.h b/Sourcecode/private/mx/core/elements/FrameStrings.h index 7988f1c2c..06614feda 100644 --- a/Sourcecode/private/mx/core/elements/FrameStrings.h +++ b/Sourcecode/private/mx/core/elements/FrameStrings.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( FrameStrings ) - - inline FrameStringsPtr makeFrameStrings() { return std::make_shared(); } - inline FrameStringsPtr makeFrameStrings( const PositiveInteger& value ) { return std::make_shared( value ); } - inline FrameStringsPtr makeFrameStrings( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class FrameStrings : public ElementInterface - { - public: - FrameStrings(); - FrameStrings( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(FrameStrings) + +inline FrameStringsPtr makeFrameStrings() +{ + return std::make_shared(); +} + +inline FrameStringsPtr makeFrameStrings(const PositiveInteger &value) +{ + return std::make_shared(value); } + +inline FrameStringsPtr makeFrameStrings(PositiveInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class FrameStrings : public ElementInterface +{ + public: + FrameStrings(); + FrameStrings(const PositiveInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PositiveInteger getValue() const; + void setValue(const PositiveInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fret.cpp b/Sourcecode/private/mx/core/elements/Fret.cpp index e48db2307..0123c7637 100644 --- a/Sourcecode/private/mx/core/elements/Fret.cpp +++ b/Sourcecode/private/mx/core/elements/Fret.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Fret::Fret() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Fret::Fret( const NonNegativeInteger& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Fret::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Fret::hasContents() const - { - return true; - } - - - std::ostream& Fret::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Fret::streamName( std::ostream& os ) const - { - os << "fret"; - return os; - } - - - std::ostream& Fret::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Fret::Fret() : myValue(), myAttributes(std::make_shared()) +{ +} +Fret::Fret(const NonNegativeInteger &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - FretAttributesPtr Fret::getAttributes() const - { - return myAttributes; - } +bool Fret::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Fret::hasContents() const +{ + return true; +} - void Fret::setAttributes( const FretAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Fret::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Fret::streamName(std::ostream &os) const +{ + os << "fret"; + return os; +} - NonNegativeInteger Fret::getValue() const - { - return myValue; - } +std::ostream &Fret::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FretAttributesPtr Fret::getAttributes() const +{ + return myAttributes; +} - void Fret::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } +void Fret::setAttributes(const FretAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +NonNegativeInteger Fret::getValue() const +{ + return myValue; +} - bool Fret::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Fret::setValue(const NonNegativeInteger &value) +{ + myValue = value; +} - } +bool Fret::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Fret.h b/Sourcecode/private/mx/core/elements/Fret.h index 85fa65081..db43b1e24 100644 --- a/Sourcecode/private/mx/core/elements/Fret.h +++ b/Sourcecode/private/mx/core/elements/Fret.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/elements/FretAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FretAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Fret ) - - inline FretPtr makeFret() { return std::make_shared(); } - inline FretPtr makeFret( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline FretPtr makeFret( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Fret : public ElementInterface - { - public: - Fret(); - Fret( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FretAttributesPtr getAttributes() const; - void setAttributes( const FretAttributesPtr& attributes ); - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - FretAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(FretAttributes) +MX_FORWARD_DECLARE_ELEMENT(Fret) + +inline FretPtr makeFret() +{ + return std::make_shared(); +} + +inline FretPtr makeFret(const NonNegativeInteger &value) +{ + return std::make_shared(value); } + +inline FretPtr makeFret(NonNegativeInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class Fret : public ElementInterface +{ + public: + Fret(); + Fret(const NonNegativeInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FretAttributesPtr getAttributes() const; + void setAttributes(const FretAttributesPtr &attributes); + NonNegativeInteger getValue() const; + void setValue(const NonNegativeInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeInteger myValue; + FretAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FretAttributes.cpp b/Sourcecode/private/mx/core/elements/FretAttributes.cpp index b74c4da09..69e000902 100644 --- a/Sourcecode/private/mx/core/elements/FretAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FretAttributes.cpp @@ -8,61 +8,63 @@ namespace mx { - namespace core +namespace core +{ +FretAttributes::FretAttributes() + : fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false) +{ +} + +bool FretAttributes::hasValues() const +{ + return hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight; +} + +std::ostream &FretAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - FretAttributes::FretAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool FretAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FretAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool FretAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& FretAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool FretAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) { - const char* const className = "FretAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FretAttributes.h b/Sourcecode/private/mx/core/elements/FretAttributes.h index 2f63939fc..e4c256ccd 100644 --- a/Sourcecode/private/mx/core/elements/FretAttributes.h +++ b/Sourcecode/private/mx/core/elements/FretAttributes.h @@ -4,11 +4,11 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -16,28 +16,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FretAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FretAttributes) - struct FretAttributes : public AttributesInterface - { - public: - FretAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct FretAttributes : public AttributesInterface +{ + public: + FretAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FullNoteGroup.cpp b/Sourcecode/private/mx/core/elements/FullNoteGroup.cpp index 5f9c08f78..7b44692ed 100644 --- a/Sourcecode/private/mx/core/elements/FullNoteGroup.cpp +++ b/Sourcecode/private/mx/core/elements/FullNoteGroup.cpp @@ -10,97 +10,83 @@ namespace mx { - namespace core - { - FullNoteGroup::FullNoteGroup() - :myChord( makeChord() ) - ,myHasChord( false ) - ,myFullNoteTypeChoice( nullptr ) - {} - - - bool FullNoteGroup::hasAttributes() const - { - return false; - } - - - std::ostream& FullNoteGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FullNoteGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool FullNoteGroup::hasContents() const - { - return true; - } - - - std::ostream& FullNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasChord ) - { - myChord->toStream( os, indentLevel ); - os << std::endl; - } - getFullNoteTypeChoice()->streamContents( os, indentLevel, isOneLineOnly ); - isOneLineOnly = false; - return os; - } - - - ChordPtr FullNoteGroup::getChord() const - { - return myChord; - } +namespace core +{ +FullNoteGroup::FullNoteGroup() : myChord(makeChord()), myHasChord(false), myFullNoteTypeChoice(nullptr) +{ +} +bool FullNoteGroup::hasAttributes() const +{ + return false; +} - void FullNoteGroup::setChord( const ChordPtr& value ) - { - if ( value ) - { - myChord = value; - } - } +std::ostream &FullNoteGroup::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &FullNoteGroup::streamName(std::ostream &os) const +{ + return os; +} - bool FullNoteGroup::getHasChord() const - { - return myHasChord; - } +bool FullNoteGroup::hasContents() const +{ + return true; +} +std::ostream &FullNoteGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasChord) + { + myChord->toStream(os, indentLevel); + os << std::endl; + } + getFullNoteTypeChoice()->streamContents(os, indentLevel, isOneLineOnly); + isOneLineOnly = false; + return os; +} - void FullNoteGroup::setHasChord( const bool value ) - { - myHasChord = value; - } +ChordPtr FullNoteGroup::getChord() const +{ + return myChord; +} +void FullNoteGroup::setChord(const ChordPtr &value) +{ + if (value) + { + myChord = value; + } +} - FullNoteTypeChoicePtr FullNoteGroup::getFullNoteTypeChoice() const - { - MX_LOCK - MX_JIT_ALLOCATE( FullNoteTypeChoice ); - return myFullNoteTypeChoice; - } +bool FullNoteGroup::getHasChord() const +{ + return myHasChord; +} +void FullNoteGroup::setHasChord(const bool value) +{ + myHasChord = value; +} - void FullNoteGroup::setFullNoteTypeChoice( const FullNoteTypeChoicePtr& value ) - { - if ( value ) - { - myFullNoteTypeChoice = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( FullNoteGroup ); +FullNoteTypeChoicePtr FullNoteGroup::getFullNoteTypeChoice() const +{ + MX_LOCK + MX_JIT_ALLOCATE(FullNoteTypeChoice); + return myFullNoteTypeChoice; +} +void FullNoteGroup::setFullNoteTypeChoice(const FullNoteTypeChoicePtr &value) +{ + if (value) + { + myFullNoteTypeChoice = value; } } + +MX_FROM_XELEMENT_UNUSED(FullNoteGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FullNoteGroup.h b/Sourcecode/private/mx/core/elements/FullNoteGroup.h index 8a2ac1ab0..2f5ab028c 100644 --- a/Sourcecode/private/mx/core/elements/FullNoteGroup.h +++ b/Sourcecode/private/mx/core/elements/FullNoteGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,44 +13,47 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Chord ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteTypeChoice ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - - inline FullNoteGroupPtr makeFullNoteGroup() { return std::make_shared(); } - - class FullNoteGroup : public ElementInterface - { - public: - FullNoteGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Chord minOccurs = 0, maxOccurs = 1 _________ */ - ChordPtr getChord() const; - void setChord( const ChordPtr& value ); - bool getHasChord() const; - void setHasChord( const bool value ); - - /* _________ FullNoteTypeChoice minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteTypeChoicePtr getFullNoteTypeChoice() const; - void setFullNoteTypeChoice( const FullNoteTypeChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - ChordPtr myChord; - bool myHasChord; - mutable FullNoteTypeChoicePtr myFullNoteTypeChoice; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Chord) +MX_FORWARD_DECLARE_ELEMENT(FullNoteTypeChoice) +MX_FORWARD_DECLARE_ELEMENT(FullNoteGroup) + +inline FullNoteGroupPtr makeFullNoteGroup() +{ + return std::make_shared(); } + +class FullNoteGroup : public ElementInterface +{ + public: + FullNoteGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Chord minOccurs = 0, maxOccurs = 1 _________ */ + ChordPtr getChord() const; + void setChord(const ChordPtr &value); + bool getHasChord() const; + void setHasChord(const bool value); + + /* _________ FullNoteTypeChoice minOccurs = 1, maxOccurs = 1 _________ */ + FullNoteTypeChoicePtr getFullNoteTypeChoice() const; + void setFullNoteTypeChoice(const FullNoteTypeChoicePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MX_MUTEX + ChordPtr myChord; + bool myHasChord; + mutable FullNoteTypeChoicePtr myFullNoteTypeChoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp b/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp index 4dbafbde8..24b6c0e11 100644 --- a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp +++ b/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp @@ -11,126 +11,111 @@ namespace mx { - namespace core +namespace core +{ +FullNoteTypeChoice::FullNoteTypeChoice() + : myChoice(Choice::pitch), myPitch(makePitch()), myUnpitched(makeUnpitched()), myRest(makeRest()) +{ +} + +bool FullNoteTypeChoice::hasAttributes() const +{ + return false; +} + +std::ostream &FullNoteTypeChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &FullNoteTypeChoice::streamName(std::ostream &os) const +{ + return os; +} + +bool FullNoteTypeChoice::hasContents() const +{ + return true; +} + +std::ostream &FullNoteTypeChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + + MX_UNUSED(indentLevel); + MX_UNUSED(isOneLineOnly); + + switch (myChoice) + { + case Choice::pitch: + getPitch()->toStream(os, indentLevel); + break; + case Choice::unpitched: + getUnpitched()->toStream(os, indentLevel); + break; + case Choice::rest: + getRest()->toStream(os, indentLevel); + break; + default: + break; + } + return os; +} + +FullNoteTypeChoice::Choice FullNoteTypeChoice::getChoice() const +{ + return myChoice; +} + +void FullNoteTypeChoice::setChoice(const FullNoteTypeChoice::Choice value) +{ + myChoice = value; +} + +PitchPtr FullNoteTypeChoice::getPitch() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Pitch); + return myPitch; +} + +void FullNoteTypeChoice::setPitch(const PitchPtr &value) +{ + if (value) { - FullNoteTypeChoice::FullNoteTypeChoice() - :myChoice( Choice::pitch ) - ,myPitch( makePitch() ) - ,myUnpitched( makeUnpitched() ) - ,myRest( makeRest() ) - {} - - - bool FullNoteTypeChoice::hasAttributes() const - { - return false; - } - - - std::ostream& FullNoteTypeChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FullNoteTypeChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool FullNoteTypeChoice::hasContents() const - { - return true; - } - - - std::ostream& FullNoteTypeChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - - MX_UNUSED( indentLevel ); - MX_UNUSED( isOneLineOnly ); - - switch ( myChoice ) - { - case Choice::pitch: - getPitch()->toStream( os, indentLevel ); - break; - case Choice::unpitched: - getUnpitched()->toStream( os, indentLevel ); - break; - case Choice::rest: - getRest()->toStream( os, indentLevel ); - break; - default: - break; - } - return os; - } - - - FullNoteTypeChoice::Choice FullNoteTypeChoice::getChoice() const - { - return myChoice; - } - - - void FullNoteTypeChoice::setChoice( const FullNoteTypeChoice::Choice value ) - { - myChoice = value; - } - - - PitchPtr FullNoteTypeChoice::getPitch() const - { - MX_LOCK - MX_JIT_ALLOCATE( Pitch ); - return myPitch; - } - - - void FullNoteTypeChoice::setPitch( const PitchPtr& value ) - { - if ( value ) - { - myPitch = value; - } - } - - - UnpitchedPtr FullNoteTypeChoice::getUnpitched() const - { - MX_LOCK - MX_JIT_ALLOCATE( Unpitched ); - return myUnpitched; - } - - - void FullNoteTypeChoice::setUnpitched( const UnpitchedPtr& value ) - { - if ( value ) - { - myUnpitched = value; - } - } - - - RestPtr FullNoteTypeChoice::getRest() const - { - MX_LOCK - MX_JIT_ALLOCATE( Rest ); - return myRest; - } - - - void FullNoteTypeChoice::setRest( const RestPtr& value ) - { - if ( value ) - { - myRest = value; - } - } - - MX_FROM_XELEMENT_UNUSED( FullNoteTypeChoice ); + myPitch = value; } } + +UnpitchedPtr FullNoteTypeChoice::getUnpitched() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Unpitched); + return myUnpitched; +} + +void FullNoteTypeChoice::setUnpitched(const UnpitchedPtr &value) +{ + if (value) + { + myUnpitched = value; + } +} + +RestPtr FullNoteTypeChoice::getRest() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Rest); + return myRest; +} + +void FullNoteTypeChoice::setRest(const RestPtr &value) +{ + if (value) + { + myRest = value; + } +} + +MX_FROM_XELEMENT_UNUSED(FullNoteTypeChoice); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h b/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h index 986032a28..efbfb234a 100644 --- a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h +++ b/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,58 +13,61 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Pitch ) - MX_FORWARD_DECLARE_ELEMENT( Rest ) - MX_FORWARD_DECLARE_ELEMENT( Unpitched ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteTypeChoice ) +MX_FORWARD_DECLARE_ELEMENT(Pitch) +MX_FORWARD_DECLARE_ELEMENT(Rest) +MX_FORWARD_DECLARE_ELEMENT(Unpitched) +MX_FORWARD_DECLARE_ELEMENT(FullNoteTypeChoice) - inline FullNoteTypeChoicePtr makeFullNoteTypeChoice() { return std::make_shared(); } +inline FullNoteTypeChoicePtr makeFullNoteTypeChoice() +{ + return std::make_shared(); +} - class FullNoteTypeChoice : public ElementInterface - { - public: - enum class Choice - { - pitch = 1, - unpitched = 2, - rest = 3 - }; - FullNoteTypeChoice(); +class FullNoteTypeChoice : public ElementInterface +{ + public: + enum class Choice + { + pitch = 1, + unpitched = 2, + rest = 3 + }; + FullNoteTypeChoice(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteTypeChoice::Choice getChoice() const; - void setChoice( const FullNoteTypeChoice::Choice value ); + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + FullNoteTypeChoice::Choice getChoice() const; + void setChoice(const FullNoteTypeChoice::Choice value); - /* _________ Pitch minOccurs = 1, maxOccurs = 1 _________ */ - PitchPtr getPitch() const; - void setPitch( const PitchPtr& value ); + /* _________ Pitch minOccurs = 1, maxOccurs = 1 _________ */ + PitchPtr getPitch() const; + void setPitch(const PitchPtr &value); - /* _________ Unpitched minOccurs = 1, maxOccurs = 1 _________ */ - UnpitchedPtr getUnpitched() const; - void setUnpitched( const UnpitchedPtr& value ); + /* _________ Unpitched minOccurs = 1, maxOccurs = 1 _________ */ + UnpitchedPtr getUnpitched() const; + void setUnpitched(const UnpitchedPtr &value); - /* _________ Rest minOccurs = 1, maxOccurs = 1 _________ */ - RestPtr getRest() const; - void setRest( const RestPtr& value ); + /* _________ Rest minOccurs = 1, maxOccurs = 1 _________ */ + RestPtr getRest() const; + void setRest(const RestPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - MX_MUTEX - Choice myChoice; - mutable PitchPtr myPitch; - mutable UnpitchedPtr myUnpitched; - mutable RestPtr myRest; - }; - } -} + private: + MX_MUTEX + Choice myChoice; + mutable PitchPtr myPitch; + mutable UnpitchedPtr myUnpitched; + mutable RestPtr myRest; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Function.cpp b/Sourcecode/private/mx/core/elements/Function.cpp index 99b3ebab6..87176e4ba 100644 --- a/Sourcecode/private/mx/core/elements/Function.cpp +++ b/Sourcecode/private/mx/core/elements/Function.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Function::Function() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Function::Function( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Function::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Function::hasContents() const - { - return true; - } - - - std::ostream& Function::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Function::streamName( std::ostream& os ) const - { - os << "function"; - return os; - } - - - std::ostream& Function::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Function::Function() : myValue(), myAttributes(std::make_shared()) +{ +} +Function::Function(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - FunctionAttributesPtr Function::getAttributes() const - { - return myAttributes; - } +bool Function::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Function::hasContents() const +{ + return true; +} - void Function::setAttributes( const FunctionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Function::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Function::streamName(std::ostream &os) const +{ + os << "function"; + return os; +} - XsString Function::getValue() const - { - return myValue; - } +std::ostream &Function::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +FunctionAttributesPtr Function::getAttributes() const +{ + return myAttributes; +} - void Function::setValue( const XsString& value ) - { - myValue = value; - } +void Function::setAttributes(const FunctionAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Function::getValue() const +{ + return myValue; +} - bool Function::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Function::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Function::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Function.h b/Sourcecode/private/mx/core/elements/Function.h index 1e35c3af7..9a4662029 100644 --- a/Sourcecode/private/mx/core/elements/Function.h +++ b/Sourcecode/private/mx/core/elements/Function.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/FunctionAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FunctionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Function ) - - inline FunctionPtr makeFunction() { return std::make_shared(); } - inline FunctionPtr makeFunction( const XsString& value ) { return std::make_shared( value ); } - inline FunctionPtr makeFunction( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Function : public ElementInterface - { - public: - Function(); - Function( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FunctionAttributesPtr getAttributes() const; - void setAttributes( const FunctionAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FunctionAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(FunctionAttributes) +MX_FORWARD_DECLARE_ELEMENT(Function) + +inline FunctionPtr makeFunction() +{ + return std::make_shared(); +} + +inline FunctionPtr makeFunction(const XsString &value) +{ + return std::make_shared(value); } + +inline FunctionPtr makeFunction(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Function : public ElementInterface +{ + public: + Function(); + Function(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + FunctionAttributesPtr getAttributes() const; + void setAttributes(const FunctionAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + FunctionAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FunctionAttributes.cpp b/Sourcecode/private/mx/core/elements/FunctionAttributes.cpp index 30b93770b..25eb26623 100644 --- a/Sourcecode/private/mx/core/elements/FunctionAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/FunctionAttributes.cpp @@ -8,81 +8,85 @@ namespace mx { - namespace core +namespace core +{ +FunctionAttributes::FunctionAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false) +{ +} + +bool FunctionAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight; +} + +std::ostream &FunctionAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - FunctionAttributes::FunctionAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool FunctionAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "FunctionAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool FunctionAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& FunctionAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool FunctionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "FunctionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/FunctionAttributes.h b/Sourcecode/private/mx/core/elements/FunctionAttributes.h index 2cc6a4a7f..3ca96a5f9 100644 --- a/Sourcecode/private/mx/core/elements/FunctionAttributes.h +++ b/Sourcecode/private/mx/core/elements/FunctionAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,36 +17,36 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( FunctionAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(FunctionAttributes) - struct FunctionAttributes : public AttributesInterface - { - public: - FunctionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct FunctionAttributes : public AttributesInterface +{ + public: + FunctionAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Glass.cpp b/Sourcecode/private/mx/core/elements/Glass.cpp index f66cbc711..5641ec42e 100644 --- a/Sourcecode/private/mx/core/elements/Glass.cpp +++ b/Sourcecode/private/mx/core/elements/Glass.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - Glass::Glass() - :myValue( GlassEnum::windChimes ) - {} - - - Glass::Glass( const GlassEnum& value ) - :myValue( value ) - {} - - - bool Glass::hasAttributes() const - { - return false; - } - - - bool Glass::hasContents() const - { - return true; - } - - - std::ostream& Glass::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Glass::streamName( std::ostream& os ) const - { - os << "glass"; - return os; - } +namespace core +{ +Glass::Glass() : myValue(GlassEnum::windChimes) +{ +} +Glass::Glass(const GlassEnum &value) : myValue(value) +{ +} - std::ostream& Glass::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Glass::hasAttributes() const +{ + return false; +} +bool Glass::hasContents() const +{ + return true; +} - GlassEnum Glass::getValue() const - { - return myValue; - } +std::ostream &Glass::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Glass::streamName(std::ostream &os) const +{ + os << "glass"; + return os; +} - void Glass::setValue( const GlassEnum& value ) - { - myValue = value; - } +std::ostream &Glass::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +GlassEnum Glass::getValue() const +{ + return myValue; +} - bool Glass::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseGlassEnum( xelement.getValue() ); - return true; - } +void Glass::setValue(const GlassEnum &value) +{ + myValue = value; +} - } +bool Glass::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseGlassEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Glass.h b/Sourcecode/private/mx/core/elements/Glass.h index 4a829cab4..b362795dd 100644 --- a/Sourcecode/private/mx/core/elements/Glass.h +++ b/Sourcecode/private/mx/core/elements/Glass.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Glass ) - - inline GlassPtr makeGlass() { return std::make_shared(); } - inline GlassPtr makeGlass( const GlassEnum& value ) { return std::make_shared( value ); } - inline GlassPtr makeGlass( GlassEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Glass : public ElementInterface - { - public: - Glass(); - Glass( const GlassEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GlassEnum getValue() const; - void setValue( const GlassEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GlassEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Glass) + +inline GlassPtr makeGlass() +{ + return std::make_shared(); +} + +inline GlassPtr makeGlass(const GlassEnum &value) +{ + return std::make_shared(value); } + +inline GlassPtr makeGlass(GlassEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class Glass : public ElementInterface +{ + public: + Glass(); + Glass(const GlassEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GlassEnum getValue() const; + void setValue(const GlassEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GlassEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Glissando.cpp b/Sourcecode/private/mx/core/elements/Glissando.cpp index 22fe16ceb..7526191c7 100644 --- a/Sourcecode/private/mx/core/elements/Glissando.cpp +++ b/Sourcecode/private/mx/core/elements/Glissando.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Glissando::Glissando() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Glissando::Glissando( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Glissando::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Glissando::hasContents() const - { - return true; - } - - - std::ostream& Glissando::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Glissando::streamName( std::ostream& os ) const - { - os << "glissando"; - return os; - } - - - std::ostream& Glissando::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Glissando::Glissando() : myValue(), myAttributes(std::make_shared()) +{ +} +Glissando::Glissando(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - GlissandoAttributesPtr Glissando::getAttributes() const - { - return myAttributes; - } +bool Glissando::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Glissando::hasContents() const +{ + return true; +} - void Glissando::setAttributes( const GlissandoAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Glissando::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Glissando::streamName(std::ostream &os) const +{ + os << "glissando"; + return os; +} - XsString Glissando::getValue() const - { - return myValue; - } +std::ostream &Glissando::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +GlissandoAttributesPtr Glissando::getAttributes() const +{ + return myAttributes; +} - void Glissando::setValue( const XsString& value ) - { - myValue = value; - } +void Glissando::setAttributes(const GlissandoAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Glissando::getValue() const +{ + return myValue; +} - bool Glissando::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Glissando::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Glissando::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Glissando.h b/Sourcecode/private/mx/core/elements/Glissando.h index 223d470a3..0b4a690a1 100644 --- a/Sourcecode/private/mx/core/elements/Glissando.h +++ b/Sourcecode/private/mx/core/elements/Glissando.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/GlissandoAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GlissandoAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Glissando ) - - inline GlissandoPtr makeGlissando() { return std::make_shared(); } - inline GlissandoPtr makeGlissando( const XsString& value ) { return std::make_shared( value ); } - inline GlissandoPtr makeGlissando( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Glissando : public ElementInterface - { - public: - Glissando(); - Glissando( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GlissandoAttributesPtr getAttributes() const; - void setAttributes( const GlissandoAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - GlissandoAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(GlissandoAttributes) +MX_FORWARD_DECLARE_ELEMENT(Glissando) + +inline GlissandoPtr makeGlissando() +{ + return std::make_shared(); +} + +inline GlissandoPtr makeGlissando(const XsString &value) +{ + return std::make_shared(value); } + +inline GlissandoPtr makeGlissando(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Glissando : public ElementInterface +{ + public: + Glissando(); + Glissando(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GlissandoAttributesPtr getAttributes() const; + void setAttributes(const GlissandoAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + GlissandoAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp b/Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp index fbeb6e9cd..74831303b 100644 --- a/Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp @@ -8,112 +8,118 @@ namespace mx { - namespace core +namespace core +{ +GlissandoAttributes::GlissandoAttributes() + : type(StartStop::start), number(1), lineType(LineType::solid), dashLength(), spaceLength(), defaultX(), defaultY(), + relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), hasType(true), hasNumber(false), hasLineType(false), hasDashLength(false), + hasSpaceLength(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false) +{ +} + +bool GlissandoAttributes::hasValues() const +{ + return hasType || hasNumber || hasLineType || hasDashLength || hasSpaceLength || hasDefaultX || hasDefaultY || + hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight; +} + +std::ostream &GlissandoAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - GlissandoAttributes::GlissandoAttributes() - :type( StartStop::start ) - ,number( 1 ) - ,lineType( LineType::solid ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasType( true ) - ,hasNumber( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, lineType, "line-type", hasLineType); + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, spaceLength, "space-length", hasSpaceLength); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} +bool GlissandoAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GlissandoAttributes"; + bool isSuccess = true; + bool isTypeFound = false; - bool GlissandoAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - return hasType || - hasNumber || - hasLineType || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& GlissandoAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool GlissandoAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dashLength, hasDashLength, "dash-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length")) { - const char* const className = "GlissandoAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GlissandoAttributes.h b/Sourcecode/private/mx/core/elements/GlissandoAttributes.h index 81e67de0f..903e041d2 100644 --- a/Sourcecode/private/mx/core/elements/GlissandoAttributes.h +++ b/Sourcecode/private/mx/core/elements/GlissandoAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -18,46 +18,46 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GlissandoAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GlissandoAttributes) - struct GlissandoAttributes : public AttributesInterface - { - public: - GlissandoAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - NumberLevel number; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - const bool hasType; - bool hasNumber; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct GlissandoAttributes : public AttributesInterface +{ + public: + GlissandoAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + NumberLevel number; + LineType lineType; + TenthsValue dashLength; + TenthsValue spaceLength; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + const bool hasType; + bool hasNumber; + bool hasLineType; + bool hasDashLength; + bool hasSpaceLength; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Grace.cpp b/Sourcecode/private/mx/core/elements/Grace.cpp index 4fcbf3ace..c79a75189 100644 --- a/Sourcecode/private/mx/core/elements/Grace.cpp +++ b/Sourcecode/private/mx/core/elements/Grace.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Grace::Grace() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Grace::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Grace::hasContents() const { return false; } - std::ostream& Grace::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Grace::streamName( std::ostream& os ) const { os << "grace"; return os; } - std::ostream& Grace::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Grace::Grace() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Grace::hasAttributes() const +{ + return myAttributes->hasValues(); +} - GraceAttributesPtr Grace::getAttributes() const - { - return myAttributes; - } +bool Grace::hasContents() const +{ + return false; +} +std::ostream &Grace::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Grace::setAttributes( const GraceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Grace::streamName(std::ostream &os) const +{ + os << "grace"; + return os; +} +std::ostream &Grace::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Grace::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +GraceAttributesPtr Grace::getAttributes() const +{ + return myAttributes; +} +void Grace::setAttributes(const GraceAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Grace::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Grace.h b/Sourcecode/private/mx/core/elements/Grace.h index 21ebf7b1e..5272f98a2 100644 --- a/Sourcecode/private/mx/core/elements/Grace.h +++ b/Sourcecode/private/mx/core/elements/Grace.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/GraceAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GraceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Grace ) - - inline GracePtr makeGrace() { return std::make_shared(); } - - class Grace : public ElementInterface - { - public: - Grace(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GraceAttributesPtr getAttributes() const; - void setAttributes( const GraceAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GraceAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(GraceAttributes) +MX_FORWARD_DECLARE_ELEMENT(Grace) + +inline GracePtr makeGrace() +{ + return std::make_shared(); } + +class Grace : public ElementInterface +{ + public: + Grace(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GraceAttributesPtr getAttributes() const; + void setAttributes(const GraceAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GraceAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GraceAttributes.cpp b/Sourcecode/private/mx/core/elements/GraceAttributes.cpp index e448e6928..6e5c1ad7d 100644 --- a/Sourcecode/private/mx/core/elements/GraceAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GraceAttributes.cpp @@ -8,61 +8,63 @@ namespace mx { - namespace core +namespace core +{ +GraceAttributes::GraceAttributes() + : stealTimePrevious(), stealTimeFollowing(), makeTime(), slash(YesNo::no), hasStealTimePrevious(false), + hasStealTimeFollowing(false), hasMakeTime(false), hasSlash(false) +{ +} + +bool GraceAttributes::hasValues() const +{ + return hasStealTimePrevious || hasStealTimeFollowing || hasMakeTime || hasSlash; +} + +std::ostream &GraceAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - GraceAttributes::GraceAttributes() - :stealTimePrevious() - ,stealTimeFollowing() - ,makeTime() - ,slash( YesNo::no ) - ,hasStealTimePrevious( false ) - ,hasStealTimeFollowing( false ) - ,hasMakeTime( false ) - ,hasSlash( false ) - {} + streamAttribute(os, stealTimePrevious, "steal-time-previous", hasStealTimePrevious); + streamAttribute(os, stealTimeFollowing, "steal-time-following", hasStealTimeFollowing); + streamAttribute(os, makeTime, "make-time", hasMakeTime); + streamAttribute(os, slash, "slash", hasSlash); + } + return os; +} + +bool GraceAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GraceAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool GraceAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, stealTimePrevious, hasStealTimePrevious, + "steal-time-previous")) { - return hasStealTimePrevious || - hasStealTimeFollowing || - hasMakeTime || - hasSlash; + continue; } - - - std::ostream& GraceAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, stealTimeFollowing, hasStealTimeFollowing, + "steal-time-following")) { - if ( hasValues() ) - { - streamAttribute( os, stealTimePrevious, "steal-time-previous", hasStealTimePrevious ); - streamAttribute( os, stealTimeFollowing, "steal-time-following", hasStealTimeFollowing ); - streamAttribute( os, makeTime, "make-time", hasMakeTime ); - streamAttribute( os, slash, "slash", hasSlash ); - } - return os; + continue; } - - - bool GraceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, makeTime, hasMakeTime, "make-time")) { - const char* const className = "GraceAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, stealTimePrevious, hasStealTimePrevious, "steal-time-previous" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, stealTimeFollowing, hasStealTimeFollowing, "steal-time-following" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, makeTime, hasMakeTime, "make-time" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GraceAttributes.h b/Sourcecode/private/mx/core/elements/GraceAttributes.h index 76ac2fd0a..ad78b9b17 100644 --- a/Sourcecode/private/mx/core/elements/GraceAttributes.h +++ b/Sourcecode/private/mx/core/elements/GraceAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -15,28 +15,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GraceAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GraceAttributes) - struct GraceAttributes : public AttributesInterface - { - public: - GraceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - Percent stealTimePrevious; - Percent stealTimeFollowing; - DivisionsValue makeTime; - YesNo slash; - bool hasStealTimePrevious; - bool hasStealTimeFollowing; - bool hasMakeTime; - bool hasSlash; +struct GraceAttributes : public AttributesInterface +{ + public: + GraceAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + Percent stealTimePrevious; + Percent stealTimeFollowing; + DivisionsValue makeTime; + YesNo slash; + bool hasStealTimePrevious; + bool hasStealTimeFollowing; + bool hasMakeTime; + bool hasSlash; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp b/Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp index a2f4fda6d..0eb462238 100644 --- a/Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp +++ b/Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp @@ -11,128 +11,111 @@ namespace mx { - namespace core - { - GraceNoteGroup::GraceNoteGroup() - :myGrace( makeGrace() ) - ,myFullNoteGroup( makeFullNoteGroup() ) - ,myTieSet() - {} - - - bool GraceNoteGroup::hasAttributes() const - { - return false; - } - - - std::ostream& GraceNoteGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& GraceNoteGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool GraceNoteGroup::hasContents() const - { - return true; - } - - - std::ostream& GraceNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myGrace->toStream( os, indentLevel ); - os << std::endl; - myFullNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - for ( auto x : myTieSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - isOneLineOnly = false; - return os; - } - - - GracePtr GraceNoteGroup::getGrace() const - { - return myGrace; - } - - - void GraceNoteGroup::setGrace( const GracePtr& value ) - { - if ( value ) - { - myGrace = value; - } - } - +namespace core +{ +GraceNoteGroup::GraceNoteGroup() : myGrace(makeGrace()), myFullNoteGroup(makeFullNoteGroup()), myTieSet() +{ +} - FullNoteGroupPtr GraceNoteGroup::getFullNoteGroup() const - { - return myFullNoteGroup; - } +bool GraceNoteGroup::hasAttributes() const +{ + return false; +} +std::ostream &GraceNoteGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - void GraceNoteGroup::setFullNoteGroup( const FullNoteGroupPtr& value ) - { - if ( value ) - { - myFullNoteGroup = value; - } - } +std::ostream &GraceNoteGroup::streamName(std::ostream &os) const +{ + return os; +} +bool GraceNoteGroup::hasContents() const +{ + return true; +} - const TieSet& GraceNoteGroup::getTieSet() const - { - return myTieSet; - } +std::ostream &GraceNoteGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + myGrace->toStream(os, indentLevel); + os << std::endl; + myFullNoteGroup->streamContents(os, indentLevel, isOneLineOnly); + for (auto x : myTieSet) + { + os << std::endl; + x->toStream(os, indentLevel); + } + isOneLineOnly = false; + return os; +} +GracePtr GraceNoteGroup::getGrace() const +{ + return myGrace; +} - void GraceNoteGroup::addTie( const TiePtr& value ) - { - if ( value ) - { - if ( myTieSet.size() < 2 ) - { - myTieSet.push_back( value ); - } - } - } +void GraceNoteGroup::setGrace(const GracePtr &value) +{ + if (value) + { + myGrace = value; + } +} +FullNoteGroupPtr GraceNoteGroup::getFullNoteGroup() const +{ + return myFullNoteGroup; +} - void GraceNoteGroup::removeTie( const TieSetIterConst& value ) - { - if ( value != myTieSet.cend() ) - { - myTieSet.erase( value ); - } - } +void GraceNoteGroup::setFullNoteGroup(const FullNoteGroupPtr &value) +{ + if (value) + { + myFullNoteGroup = value; + } +} +const TieSet &GraceNoteGroup::getTieSet() const +{ + return myTieSet; +} - void GraceNoteGroup::clearTieSet() +void GraceNoteGroup::addTie(const TiePtr &value) +{ + if (value) + { + if (myTieSet.size() < 2) { - myTieSet.clear(); + myTieSet.push_back(value); } + } +} +void GraceNoteGroup::removeTie(const TieSetIterConst &value) +{ + if (value != myTieSet.cend()) + { + myTieSet.erase(value); + } +} - TiePtr GraceNoteGroup::getTie( const TieSetIterConst& setIterator ) const - { - if( setIterator != myTieSet.cend() ) - { - return *setIterator; - } - return TiePtr(); - } - - - MX_FROM_XELEMENT_UNUSED( GraceNoteGroup ); +void GraceNoteGroup::clearTieSet() +{ + myTieSet.clear(); +} +TiePtr GraceNoteGroup::getTie(const TieSetIterConst &setIterator) const +{ + if (setIterator != myTieSet.cend()) + { + return *setIterator; } + return TiePtr(); } + +MX_FROM_XELEMENT_UNUSED(GraceNoteGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GraceNoteGroup.h b/Sourcecode/private/mx/core/elements/GraceNoteGroup.h index 0b262a412..a9fed97fa 100644 --- a/Sourcecode/private/mx/core/elements/GraceNoteGroup.h +++ b/Sourcecode/private/mx/core/elements/GraceNoteGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,49 +13,52 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( Grace ) - MX_FORWARD_DECLARE_ELEMENT( Tie ) - MX_FORWARD_DECLARE_ELEMENT( GraceNoteGroup ) - - inline GraceNoteGroupPtr makeGraceNoteGroup() { return std::make_shared(); } - - class GraceNoteGroup : public ElementInterface - { - public: - GraceNoteGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Grace minOccurs = 1, maxOccurs = 1 _________ */ - GracePtr getGrace() const; - void setGrace( const GracePtr& value ); - - /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteGroupPtr getFullNoteGroup() const; - void setFullNoteGroup( const FullNoteGroupPtr& value ); - - /* _________ Tie minOccurs = 0, maxOccurs = 2 _________ */ - const TieSet& getTieSet() const; - void addTie( const TiePtr& value ); - void removeTie( const TieSetIterConst& value ); - void clearTieSet(); - TiePtr getTie( const TieSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GracePtr myGrace; - FullNoteGroupPtr myFullNoteGroup; - TieSet myTieSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(FullNoteGroup) +MX_FORWARD_DECLARE_ELEMENT(Grace) +MX_FORWARD_DECLARE_ELEMENT(Tie) +MX_FORWARD_DECLARE_ELEMENT(GraceNoteGroup) + +inline GraceNoteGroupPtr makeGraceNoteGroup() +{ + return std::make_shared(); } + +class GraceNoteGroup : public ElementInterface +{ + public: + GraceNoteGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Grace minOccurs = 1, maxOccurs = 1 _________ */ + GracePtr getGrace() const; + void setGrace(const GracePtr &value); + + /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ + FullNoteGroupPtr getFullNoteGroup() const; + void setFullNoteGroup(const FullNoteGroupPtr &value); + + /* _________ Tie minOccurs = 0, maxOccurs = 2 _________ */ + const TieSet &getTieSet() const; + void addTie(const TiePtr &value); + void removeTie(const TieSetIterConst &value); + void clearTieSet(); + TiePtr getTie(const TieSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GracePtr myGrace; + FullNoteGroupPtr myFullNoteGroup; + TieSet myTieSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Group.cpp b/Sourcecode/private/mx/core/elements/Group.cpp index b418e5c66..802e269cf 100644 --- a/Sourcecode/private/mx/core/elements/Group.cpp +++ b/Sourcecode/private/mx/core/elements/Group.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Group::Group() - :myValue() - {} - - - Group::Group( const XsString& value ) - :myValue( value ) - {} - - - bool Group::hasAttributes() const - { - return false; - } - - - bool Group::hasContents() const - { - return true; - } - - - std::ostream& Group::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Group::streamName( std::ostream& os ) const - { - os << "group"; - return os; - } +namespace core +{ +Group::Group() : myValue() +{ +} +Group::Group(const XsString &value) : myValue(value) +{ +} - std::ostream& Group::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Group::hasAttributes() const +{ + return false; +} +bool Group::hasContents() const +{ + return true; +} - XsString Group::getValue() const - { - return myValue; - } +std::ostream &Group::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Group::streamName(std::ostream &os) const +{ + os << "group"; + return os; +} - void Group::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &Group::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString Group::getValue() const +{ + return myValue; +} - bool Group::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void Group::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Group::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Group.h b/Sourcecode/private/mx/core/elements/Group.h index dcc88d28c..9e33f8200 100644 --- a/Sourcecode/private/mx/core/elements/Group.h +++ b/Sourcecode/private/mx/core/elements/Group.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Group ) - - inline GroupPtr makeGroup() { return std::make_shared(); } - inline GroupPtr makeGroup( const XsString& value ) { return std::make_shared( value ); } - inline GroupPtr makeGroup( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Group : public ElementInterface - { - public: - Group(); - Group( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Group) + +inline GroupPtr makeGroup() +{ + return std::make_shared(); +} + +inline GroupPtr makeGroup(const XsString &value) +{ + return std::make_shared(value); } + +inline GroupPtr makeGroup(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Group : public ElementInterface +{ + public: + Group(); + Group(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp b/Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp index 0554f0a97..dbfddee67 100644 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp +++ b/Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - GroupAbbreviation::GroupAbbreviation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - GroupAbbreviation::GroupAbbreviation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool GroupAbbreviation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool GroupAbbreviation::hasContents() const - { - return true; - } - - - std::ostream& GroupAbbreviation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& GroupAbbreviation::streamName( std::ostream& os ) const - { - os << "group-abbreviation"; - return os; - } - - - std::ostream& GroupAbbreviation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +GroupAbbreviation::GroupAbbreviation() : myValue(), myAttributes(std::make_shared()) +{ +} +GroupAbbreviation::GroupAbbreviation(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - GroupAbbreviationAttributesPtr GroupAbbreviation::getAttributes() const - { - return myAttributes; - } +bool GroupAbbreviation::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool GroupAbbreviation::hasContents() const +{ + return true; +} - void GroupAbbreviation::setAttributes( const GroupAbbreviationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &GroupAbbreviation::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &GroupAbbreviation::streamName(std::ostream &os) const +{ + os << "group-abbreviation"; + return os; +} - XsString GroupAbbreviation::getValue() const - { - return myValue; - } +std::ostream &GroupAbbreviation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +GroupAbbreviationAttributesPtr GroupAbbreviation::getAttributes() const +{ + return myAttributes; +} - void GroupAbbreviation::setValue( const XsString& value ) - { - myValue = value; - } +void GroupAbbreviation::setAttributes(const GroupAbbreviationAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString GroupAbbreviation::getValue() const +{ + return myValue; +} - bool GroupAbbreviation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void GroupAbbreviation::setValue(const XsString &value) +{ + myValue = value; +} - } +bool GroupAbbreviation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviation.h b/Sourcecode/private/mx/core/elements/GroupAbbreviation.h index 9026e7169..66ad0eb73 100644 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviation.h +++ b/Sourcecode/private/mx/core/elements/GroupAbbreviation.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/GroupAbbreviationAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupAbbreviationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( GroupAbbreviation ) - - inline GroupAbbreviationPtr makeGroupAbbreviation() { return std::make_shared(); } - inline GroupAbbreviationPtr makeGroupAbbreviation( const XsString& value ) { return std::make_shared( value ); } - inline GroupAbbreviationPtr makeGroupAbbreviation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class GroupAbbreviation : public ElementInterface - { - public: - GroupAbbreviation(); - GroupAbbreviation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupAbbreviationAttributesPtr getAttributes() const; - void setAttributes( const GroupAbbreviationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - GroupAbbreviationAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(GroupAbbreviationAttributes) +MX_FORWARD_DECLARE_ELEMENT(GroupAbbreviation) + +inline GroupAbbreviationPtr makeGroupAbbreviation() +{ + return std::make_shared(); +} + +inline GroupAbbreviationPtr makeGroupAbbreviation(const XsString &value) +{ + return std::make_shared(value); } + +inline GroupAbbreviationPtr makeGroupAbbreviation(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class GroupAbbreviation : public ElementInterface +{ + public: + GroupAbbreviation(); + GroupAbbreviation(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GroupAbbreviationAttributesPtr getAttributes() const; + void setAttributes(const GroupAbbreviationAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + GroupAbbreviationAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp index 5b01c1a74..24ecb7b24 100644 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +GroupAbbreviationAttributes::GroupAbbreviationAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), justify(LeftCenterRight::center), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasJustify(false) +{ +} + +bool GroupAbbreviationAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasJustify; +} + +std::ostream &GroupAbbreviationAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - GroupAbbreviationAttributes::GroupAbbreviationAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,justify( LeftCenterRight::center ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasJustify( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, justify, "justify", hasJustify); + } + return os; +} + +bool GroupAbbreviationAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GroupAbbreviationAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool GroupAbbreviationAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasJustify; + continue; } - - - std::ostream& GroupAbbreviationAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, justify, "justify", hasJustify ); - } - return os; + continue; } - - - bool GroupAbbreviationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "GroupAbbreviationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h b/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h index 2e81b509e..578852689 100644 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h +++ b/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GroupAbbreviationAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GroupAbbreviationAttributes) - struct GroupAbbreviationAttributes : public AttributesInterface - { - public: - GroupAbbreviationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight justify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasJustify; +struct GroupAbbreviationAttributes : public AttributesInterface +{ + public: + GroupAbbreviationAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight justify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasJustify; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp index e1567031e..fc1a32792 100644 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp +++ b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp @@ -9,132 +9,121 @@ namespace mx { - namespace core - { - GroupAbbreviationDisplay::GroupAbbreviationDisplay() - :myAttributes( std::make_shared() ) - ,myDisplayTextOrAccidentalTextSet() - {} - - - bool GroupAbbreviationDisplay::hasAttributes() const - { - return myAttributes->hasValues(); - } - +namespace core +{ +GroupAbbreviationDisplay::GroupAbbreviationDisplay() + : myAttributes(std::make_shared()), myDisplayTextOrAccidentalTextSet() +{ +} - std::ostream& GroupAbbreviationDisplay::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +bool GroupAbbreviationDisplay::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &GroupAbbreviationDisplay::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - std::ostream& GroupAbbreviationDisplay::streamName( std::ostream& os ) const - { - os << "group-abbreviation-display"; - return os; - } +std::ostream &GroupAbbreviationDisplay::streamName(std::ostream &os) const +{ + os << "group-abbreviation-display"; + return os; +} +bool GroupAbbreviationDisplay::hasContents() const +{ + return myDisplayTextOrAccidentalTextSet.size() > 0; +} - bool GroupAbbreviationDisplay::hasContents() const +std::ostream &GroupAbbreviationDisplay::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + if (hasContents()) + { + for (auto x : myDisplayTextOrAccidentalTextSet) { - return myDisplayTextOrAccidentalTextSet.size() > 0; + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); } + isOneLineOnly = false; + os << std::endl; + } + isOneLineOnly = !hasContents(); + return os; +} +GroupAbbreviationDisplayAttributesPtr GroupAbbreviationDisplay::getAttributes() const +{ + return myAttributes; +} - std::ostream& GroupAbbreviationDisplay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myDisplayTextOrAccidentalTextSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = false; - os << std::endl; - } - isOneLineOnly = !hasContents(); - return os; - } - +void GroupAbbreviationDisplay::setAttributes(const GroupAbbreviationDisplayAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - GroupAbbreviationDisplayAttributesPtr GroupAbbreviationDisplay::getAttributes() const - { - return myAttributes; - } +const DisplayTextOrAccidentalTextSet &GroupAbbreviationDisplay::getDisplayTextOrAccidentalText() const +{ + return myDisplayTextOrAccidentalTextSet; +} +void GroupAbbreviationDisplay::addDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextPtr &value) +{ + if (value) + { + myDisplayTextOrAccidentalTextSet.push_back(value); + } +} - void GroupAbbreviationDisplay::setAttributes( const GroupAbbreviationDisplayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +void GroupAbbreviationDisplay::removeDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) +{ + if (setIterator != myDisplayTextOrAccidentalTextSet.cend()) + { + myDisplayTextOrAccidentalTextSet.erase(setIterator); + } +} +void GroupAbbreviationDisplay::clearDisplayTextOrAccidentalTextSet() +{ + myDisplayTextOrAccidentalTextSet.clear(); +} - const DisplayTextOrAccidentalTextSet& GroupAbbreviationDisplay::getDisplayTextOrAccidentalText() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - void GroupAbbreviationDisplay::addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ) - { - if ( value ) - { - myDisplayTextOrAccidentalTextSet.push_back( value ); - } - } - - - void GroupAbbreviationDisplay::removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - myDisplayTextOrAccidentalTextSet.erase( setIterator ); - } - } - - - void GroupAbbreviationDisplay::clearDisplayTextOrAccidentalTextSet() - { - myDisplayTextOrAccidentalTextSet.clear(); - } - - - DisplayTextOrAccidentalTextPtr GroupAbbreviationDisplay::getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - return *setIterator; - } - return makeDisplayTextOrAccidentalText(); - } +DisplayTextOrAccidentalTextPtr GroupAbbreviationDisplay::getDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) const +{ + if (setIterator != myDisplayTextOrAccidentalTextSet.cend()) + { + return *setIterator; + } + return makeDisplayTextOrAccidentalText(); +} - - const DisplayTextOrAccidentalTextSet& GroupAbbreviationDisplay::getDisplayTextOrAccidentalTextSet() const - { - return myDisplayTextOrAccidentalTextSet; - } - +const DisplayTextOrAccidentalTextSet &GroupAbbreviationDisplay::getDisplayTextOrAccidentalTextSet() const +{ + return myDisplayTextOrAccidentalTextSet; +} - bool GroupAbbreviationDisplay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeDisplayTextOrAccidentalText(); - isSuccess &= item->fromXElement( message, *it ); - myDisplayTextOrAccidentalTextSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } +bool GroupAbbreviationDisplay::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + auto item = makeDisplayTextOrAccidentalText(); + isSuccess &= item->fromXElement(message, *it); + myDisplayTextOrAccidentalTextSet.push_back(item); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h index 296a3058f..bda914dcc 100644 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h +++ b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/GroupAbbreviationDisplayAttributes.h" #include @@ -14,47 +14,51 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GroupAbbreviationDisplayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( GroupAbbreviationDisplay ) - - inline GroupAbbreviationDisplayPtr makeGroupAbbreviationDisplay() { return std::make_shared(); } - - class GroupAbbreviationDisplay : public ElementInterface - { - public: - enum class Choice - { - displayText = 1, - accidentalText = 2 - }; - GroupAbbreviationDisplay(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupAbbreviationDisplayAttributesPtr getAttributes() const; - void setAttributes( const GroupAbbreviationDisplayAttributesPtr& value ); - - /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalText() const; - void addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ); - void removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ); - void clearDisplayTextOrAccidentalTextSet(); - DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const; - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalTextSet() const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupAbbreviationDisplayAttributesPtr myAttributes; - DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; - }; - } +MX_FORWARD_DECLARE_ATTRIBUTES(GroupAbbreviationDisplayAttributes) +MX_FORWARD_DECLARE_ELEMENT(DisplayTextOrAccidentalText) +MX_FORWARD_DECLARE_ELEMENT(GroupAbbreviationDisplay) + +inline GroupAbbreviationDisplayPtr makeGroupAbbreviationDisplay() +{ + return std::make_shared(); } + +class GroupAbbreviationDisplay : public ElementInterface +{ + public: + enum class Choice + { + displayText = 1, + accidentalText = 2 + }; + GroupAbbreviationDisplay(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GroupAbbreviationDisplayAttributesPtr getAttributes() const; + void setAttributes(const GroupAbbreviationDisplayAttributesPtr &value); + + /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ + const DisplayTextOrAccidentalTextSet &getDisplayTextOrAccidentalText() const; + void addDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextPtr &value); + void removeDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextSetIterConst &setIterator); + void clearDisplayTextOrAccidentalTextSet(); + DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) const; + const DisplayTextOrAccidentalTextSet &getDisplayTextOrAccidentalTextSet() const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GroupAbbreviationDisplayAttributesPtr myAttributes; + DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp index 144224e05..4514377af 100644 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - GroupAbbreviationDisplayAttributes::GroupAbbreviationDisplayAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - +namespace core +{ +GroupAbbreviationDisplayAttributes::GroupAbbreviationDisplayAttributes() : printObject(YesNo::no), hasPrintObject(false) +{ +} - bool GroupAbbreviationDisplayAttributes::hasValues() const - { - return hasPrintObject; - } +bool GroupAbbreviationDisplayAttributes::hasValues() const +{ + return hasPrintObject; +} +std::ostream &GroupAbbreviationDisplayAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} - std::ostream& GroupAbbreviationDisplayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } +bool GroupAbbreviationDisplayAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GroupAbbreviationDisplayAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool GroupAbbreviationDisplayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - const char* const className = "GroupAbbreviationDisplayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h index aea5f5643..635fffadf 100644 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h +++ b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GroupAbbreviationDisplayAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GroupAbbreviationDisplayAttributes) - struct GroupAbbreviationDisplayAttributes : public AttributesInterface - { - public: - GroupAbbreviationDisplayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; +struct GroupAbbreviationDisplayAttributes : public AttributesInterface +{ + public: + GroupAbbreviationDisplayAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupBarline.cpp b/Sourcecode/private/mx/core/elements/GroupBarline.cpp index f28940f80..6ef73c464 100644 --- a/Sourcecode/private/mx/core/elements/GroupBarline.cpp +++ b/Sourcecode/private/mx/core/elements/GroupBarline.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - GroupBarline::GroupBarline() - :myValue( GroupBarlineValue::yes ) - ,myAttributes( std::make_shared() ) - {} - - - GroupBarline::GroupBarline( const GroupBarlineValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool GroupBarline::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool GroupBarline::hasContents() const - { - return true; - } - - - std::ostream& GroupBarline::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& GroupBarline::streamName( std::ostream& os ) const - { - os << "group-barline"; - return os; - } - - - std::ostream& GroupBarline::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +GroupBarline::GroupBarline() : myValue(GroupBarlineValue::yes), myAttributes(std::make_shared()) +{ +} +GroupBarline::GroupBarline(const GroupBarlineValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - GroupBarlineAttributesPtr GroupBarline::getAttributes() const - { - return myAttributes; - } +bool GroupBarline::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool GroupBarline::hasContents() const +{ + return true; +} - void GroupBarline::setAttributes( const GroupBarlineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &GroupBarline::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &GroupBarline::streamName(std::ostream &os) const +{ + os << "group-barline"; + return os; +} - GroupBarlineValue GroupBarline::getValue() const - { - return myValue; - } +std::ostream &GroupBarline::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +GroupBarlineAttributesPtr GroupBarline::getAttributes() const +{ + return myAttributes; +} - void GroupBarline::setValue( const GroupBarlineValue& value ) - { - myValue = value; - } +void GroupBarline::setAttributes(const GroupBarlineAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +GroupBarlineValue GroupBarline::getValue() const +{ + return myValue; +} - bool GroupBarline::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseGroupBarlineValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void GroupBarline::setValue(const GroupBarlineValue &value) +{ + myValue = value; +} - } +bool GroupBarline::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseGroupBarlineValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupBarline.h b/Sourcecode/private/mx/core/elements/GroupBarline.h index 62e7d39ee..701804787 100644 --- a/Sourcecode/private/mx/core/elements/GroupBarline.h +++ b/Sourcecode/private/mx/core/elements/GroupBarline.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/GroupBarlineAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupBarlineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( GroupBarline ) - - inline GroupBarlinePtr makeGroupBarline() { return std::make_shared(); } - inline GroupBarlinePtr makeGroupBarline( const GroupBarlineValue& value ) { return std::make_shared( value ); } - inline GroupBarlinePtr makeGroupBarline( GroupBarlineValue&& value ) { return std::make_shared( std::move( value ) ); } - - class GroupBarline : public ElementInterface - { - public: - GroupBarline(); - GroupBarline( const GroupBarlineValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupBarlineAttributesPtr getAttributes() const; - void setAttributes( const GroupBarlineAttributesPtr& attributes ); - GroupBarlineValue getValue() const; - void setValue( const GroupBarlineValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupBarlineValue myValue; - GroupBarlineAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(GroupBarlineAttributes) +MX_FORWARD_DECLARE_ELEMENT(GroupBarline) + +inline GroupBarlinePtr makeGroupBarline() +{ + return std::make_shared(); +} + +inline GroupBarlinePtr makeGroupBarline(const GroupBarlineValue &value) +{ + return std::make_shared(value); } + +inline GroupBarlinePtr makeGroupBarline(GroupBarlineValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class GroupBarline : public ElementInterface +{ + public: + GroupBarline(); + GroupBarline(const GroupBarlineValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GroupBarlineAttributesPtr getAttributes() const; + void setAttributes(const GroupBarlineAttributesPtr &attributes); + GroupBarlineValue getValue() const; + void setValue(const GroupBarlineValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GroupBarlineValue myValue; + GroupBarlineAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp index 3e128491d..33559441f 100644 --- a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - GroupBarlineAttributes::GroupBarlineAttributes() - :color( "#FFFFFF" ) - ,hasColor( false ) - {} - +namespace core +{ +GroupBarlineAttributes::GroupBarlineAttributes() : color("#FFFFFF"), hasColor(false) +{ +} - bool GroupBarlineAttributes::hasValues() const - { - return hasColor; - } +bool GroupBarlineAttributes::hasValues() const +{ + return hasColor; +} +std::ostream &GroupBarlineAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, color, "color", hasColor); + } + return os; +} - std::ostream& GroupBarlineAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, color, "color", hasColor ); - } - return os; - } +bool GroupBarlineAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GroupBarlineAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool GroupBarlineAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) { - const char* const className = "GroupBarlineAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h b/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h index d6603b298..e01dbbae9 100644 --- a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h +++ b/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GroupBarlineAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GroupBarlineAttributes) - struct GroupBarlineAttributes : public AttributesInterface - { - public: - GroupBarlineAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - Color color; - bool hasColor; +struct GroupBarlineAttributes : public AttributesInterface +{ + public: + GroupBarlineAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + Color color; + bool hasColor; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupName.cpp b/Sourcecode/private/mx/core/elements/GroupName.cpp index 6006ef00b..c2adc087d 100644 --- a/Sourcecode/private/mx/core/elements/GroupName.cpp +++ b/Sourcecode/private/mx/core/elements/GroupName.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - GroupName::GroupName() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - GroupName::GroupName( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool GroupName::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool GroupName::hasContents() const - { - return true; - } - - - std::ostream& GroupName::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& GroupName::streamName( std::ostream& os ) const - { - os << "group-name"; - return os; - } - - - std::ostream& GroupName::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +GroupName::GroupName() : myValue(), myAttributes(std::make_shared()) +{ +} +GroupName::GroupName(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - GroupNameAttributesPtr GroupName::getAttributes() const - { - return myAttributes; - } +bool GroupName::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool GroupName::hasContents() const +{ + return true; +} - void GroupName::setAttributes( const GroupNameAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &GroupName::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &GroupName::streamName(std::ostream &os) const +{ + os << "group-name"; + return os; +} - XsString GroupName::getValue() const - { - return myValue; - } +std::ostream &GroupName::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +GroupNameAttributesPtr GroupName::getAttributes() const +{ + return myAttributes; +} - void GroupName::setValue( const XsString& value ) - { - myValue = value; - } +void GroupName::setAttributes(const GroupNameAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString GroupName::getValue() const +{ + return myValue; +} - bool GroupName::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void GroupName::setValue(const XsString &value) +{ + myValue = value; +} - } +bool GroupName::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupName.h b/Sourcecode/private/mx/core/elements/GroupName.h index 5c45a812a..3b7ff94ab 100644 --- a/Sourcecode/private/mx/core/elements/GroupName.h +++ b/Sourcecode/private/mx/core/elements/GroupName.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/GroupNameAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupNameAttributes ) - MX_FORWARD_DECLARE_ELEMENT( GroupName ) - - inline GroupNamePtr makeGroupName() { return std::make_shared(); } - inline GroupNamePtr makeGroupName( const XsString& value ) { return std::make_shared( value ); } - inline GroupNamePtr makeGroupName( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class GroupName : public ElementInterface - { - public: - GroupName(); - GroupName( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupNameAttributesPtr getAttributes() const; - void setAttributes( const GroupNameAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - GroupNameAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(GroupNameAttributes) +MX_FORWARD_DECLARE_ELEMENT(GroupName) + +inline GroupNamePtr makeGroupName() +{ + return std::make_shared(); +} + +inline GroupNamePtr makeGroupName(const XsString &value) +{ + return std::make_shared(value); } + +inline GroupNamePtr makeGroupName(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class GroupName : public ElementInterface +{ + public: + GroupName(); + GroupName(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GroupNameAttributesPtr getAttributes() const; + void setAttributes(const GroupNameAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + GroupNameAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp index 38fb3e1fc..c2bf57c3b 100644 --- a/Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +GroupNameAttributes::GroupNameAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), justify(LeftCenterRight::center), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasJustify(false) +{ +} + +bool GroupNameAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasJustify; +} + +std::ostream &GroupNameAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - GroupNameAttributes::GroupNameAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,justify( LeftCenterRight::center ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasJustify( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, justify, "justify", hasJustify); + } + return os; +} + +bool GroupNameAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GroupNameAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool GroupNameAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasJustify; + continue; } - - - std::ostream& GroupNameAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, justify, "justify", hasJustify ); - } - return os; + continue; } - - - bool GroupNameAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "GroupNameAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupNameAttributes.h b/Sourcecode/private/mx/core/elements/GroupNameAttributes.h index a756f4909..80bf2d4d8 100644 --- a/Sourcecode/private/mx/core/elements/GroupNameAttributes.h +++ b/Sourcecode/private/mx/core/elements/GroupNameAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GroupNameAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GroupNameAttributes) - struct GroupNameAttributes : public AttributesInterface - { - public: - GroupNameAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight justify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasJustify; +struct GroupNameAttributes : public AttributesInterface +{ + public: + GroupNameAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight justify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasJustify; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp b/Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp index f3003ffbe..333110d25 100644 --- a/Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp +++ b/Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp @@ -9,132 +9,119 @@ namespace mx { - namespace core - { - GroupNameDisplay::GroupNameDisplay() - :myAttributes( std::make_shared() ) - ,myDisplayTextOrAccidentalTextSet() - {} - +namespace core +{ +GroupNameDisplay::GroupNameDisplay() + : myAttributes(std::make_shared()), myDisplayTextOrAccidentalTextSet() +{ +} - bool GroupNameDisplay::hasAttributes() const - { - return myAttributes->hasValues(); - } +bool GroupNameDisplay::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &GroupNameDisplay::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - std::ostream& GroupNameDisplay::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +std::ostream &GroupNameDisplay::streamName(std::ostream &os) const +{ + os << "group-name-display"; + return os; +} +bool GroupNameDisplay::hasContents() const +{ + return myDisplayTextOrAccidentalTextSet.size() > 0; +} - std::ostream& GroupNameDisplay::streamName( std::ostream& os ) const +std::ostream &GroupNameDisplay::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + for (auto x : myDisplayTextOrAccidentalTextSet) { - os << "group-name-display"; - return os; + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); } + isOneLineOnly = false; + os << std::endl; + } + isOneLineOnly = !hasContents(); + return os; +} +GroupNameDisplayAttributesPtr GroupNameDisplay::getAttributes() const +{ + return myAttributes; +} - bool GroupNameDisplay::hasContents() const - { - return myDisplayTextOrAccidentalTextSet.size() > 0; - } - +void GroupNameDisplay::setAttributes(const GroupNameDisplayAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - std::ostream& GroupNameDisplay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myDisplayTextOrAccidentalTextSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = false; - os << std::endl; - } - isOneLineOnly = !hasContents(); - return os; - } +const DisplayTextOrAccidentalTextSet &GroupNameDisplay::getDisplayTextOrAccidentalText() const +{ + return myDisplayTextOrAccidentalTextSet; +} +void GroupNameDisplay::addDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextPtr &value) +{ + if (value) + { + myDisplayTextOrAccidentalTextSet.push_back(value); + } +} - GroupNameDisplayAttributesPtr GroupNameDisplay::getAttributes() const - { - return myAttributes; - } +void GroupNameDisplay::removeDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextSetIterConst &setIterator) +{ + if (setIterator != myDisplayTextOrAccidentalTextSet.cend()) + { + myDisplayTextOrAccidentalTextSet.erase(setIterator); + } +} +void GroupNameDisplay::clearDisplayTextOrAccidentalTextSet() +{ + myDisplayTextOrAccidentalTextSet.clear(); +} - void GroupNameDisplay::setAttributes( const GroupNameDisplayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const DisplayTextOrAccidentalTextSet& GroupNameDisplay::getDisplayTextOrAccidentalText() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - void GroupNameDisplay::addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ) - { - if ( value ) - { - myDisplayTextOrAccidentalTextSet.push_back( value ); - } - } - - - void GroupNameDisplay::removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - myDisplayTextOrAccidentalTextSet.erase( setIterator ); - } - } - - - void GroupNameDisplay::clearDisplayTextOrAccidentalTextSet() - { - myDisplayTextOrAccidentalTextSet.clear(); - } - - - DisplayTextOrAccidentalTextPtr GroupNameDisplay::getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - return *setIterator; - } - return makeDisplayTextOrAccidentalText(); - } - - - const DisplayTextOrAccidentalTextSet& GroupNameDisplay::getDisplayTextOrAccidentalTextSet() const - { - return myDisplayTextOrAccidentalTextSet; - } +DisplayTextOrAccidentalTextPtr GroupNameDisplay::getDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) const +{ + if (setIterator != myDisplayTextOrAccidentalTextSet.cend()) + { + return *setIterator; + } + return makeDisplayTextOrAccidentalText(); +} +const DisplayTextOrAccidentalTextSet &GroupNameDisplay::getDisplayTextOrAccidentalTextSet() const +{ + return myDisplayTextOrAccidentalTextSet; +} - bool GroupNameDisplay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeDisplayTextOrAccidentalText(); - isSuccess &= item->fromXElement( message, *it ); - myDisplayTextOrAccidentalTextSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } +bool GroupNameDisplay::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + auto item = makeDisplayTextOrAccidentalText(); + isSuccess &= item->fromXElement(message, *it); + myDisplayTextOrAccidentalTextSet.push_back(item); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplay.h b/Sourcecode/private/mx/core/elements/GroupNameDisplay.h index 6361d786d..6b3a5fca7 100644 --- a/Sourcecode/private/mx/core/elements/GroupNameDisplay.h +++ b/Sourcecode/private/mx/core/elements/GroupNameDisplay.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/GroupNameDisplayAttributes.h" #include @@ -14,44 +14,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupNameDisplayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( GroupNameDisplay ) - - inline GroupNameDisplayPtr makeGroupNameDisplay() { return std::make_shared(); } - - class GroupNameDisplay : public ElementInterface - { - public: - - GroupNameDisplay(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupNameDisplayAttributesPtr getAttributes() const; - void setAttributes( const GroupNameDisplayAttributesPtr& value ); - - /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalText() const; - void addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ); - void removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ); - void clearDisplayTextOrAccidentalTextSet(); - DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const; - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalTextSet() const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupNameDisplayAttributesPtr myAttributes; - DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; - - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(GroupNameDisplayAttributes) +MX_FORWARD_DECLARE_ELEMENT(DisplayTextOrAccidentalText) +MX_FORWARD_DECLARE_ELEMENT(GroupNameDisplay) + +inline GroupNameDisplayPtr makeGroupNameDisplay() +{ + return std::make_shared(); } + +class GroupNameDisplay : public ElementInterface +{ + public: + GroupNameDisplay(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GroupNameDisplayAttributesPtr getAttributes() const; + void setAttributes(const GroupNameDisplayAttributesPtr &value); + + /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ + const DisplayTextOrAccidentalTextSet &getDisplayTextOrAccidentalText() const; + void addDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextPtr &value); + void removeDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextSetIterConst &setIterator); + void clearDisplayTextOrAccidentalTextSet(); + DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) const; + const DisplayTextOrAccidentalTextSet &getDisplayTextOrAccidentalTextSet() const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GroupNameDisplayAttributesPtr myAttributes; + DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp index 5f0eef857..5f72a6fdf 100644 --- a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - GroupNameDisplayAttributes::GroupNameDisplayAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - +namespace core +{ +GroupNameDisplayAttributes::GroupNameDisplayAttributes() : printObject(YesNo::no), hasPrintObject(false) +{ +} - bool GroupNameDisplayAttributes::hasValues() const - { - return hasPrintObject; - } +bool GroupNameDisplayAttributes::hasValues() const +{ + return hasPrintObject; +} +std::ostream &GroupNameDisplayAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} - std::ostream& GroupNameDisplayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } +bool GroupNameDisplayAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GroupNameDisplayAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool GroupNameDisplayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - const char* const className = "GroupNameDisplayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h b/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h index 5f86cf2ff..0546cf037 100644 --- a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h +++ b/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GroupNameDisplayAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GroupNameDisplayAttributes) - struct GroupNameDisplayAttributes : public AttributesInterface - { - public: - GroupNameDisplayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; +struct GroupNameDisplayAttributes : public AttributesInterface +{ + public: + GroupNameDisplayAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupSymbol.cpp b/Sourcecode/private/mx/core/elements/GroupSymbol.cpp index 693bbcb00..ed8d2f183 100644 --- a/Sourcecode/private/mx/core/elements/GroupSymbol.cpp +++ b/Sourcecode/private/mx/core/elements/GroupSymbol.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - GroupSymbol::GroupSymbol() - :myValue( GroupSymbolValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - GroupSymbol::GroupSymbol( const GroupSymbolValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool GroupSymbol::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool GroupSymbol::hasContents() const - { - return true; - } - - - std::ostream& GroupSymbol::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& GroupSymbol::streamName( std::ostream& os ) const - { - os << "group-symbol"; - return os; - } - - - std::ostream& GroupSymbol::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +GroupSymbol::GroupSymbol() : myValue(GroupSymbolValue::none), myAttributes(std::make_shared()) +{ +} +GroupSymbol::GroupSymbol(const GroupSymbolValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - GroupSymbolAttributesPtr GroupSymbol::getAttributes() const - { - return myAttributes; - } +bool GroupSymbol::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool GroupSymbol::hasContents() const +{ + return true; +} - void GroupSymbol::setAttributes( const GroupSymbolAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &GroupSymbol::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &GroupSymbol::streamName(std::ostream &os) const +{ + os << "group-symbol"; + return os; +} - GroupSymbolValue GroupSymbol::getValue() const - { - return myValue; - } +std::ostream &GroupSymbol::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +GroupSymbolAttributesPtr GroupSymbol::getAttributes() const +{ + return myAttributes; +} - void GroupSymbol::setValue( const GroupSymbolValue& value ) - { - myValue = value; - } +void GroupSymbol::setAttributes(const GroupSymbolAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +GroupSymbolValue GroupSymbol::getValue() const +{ + return myValue; +} - bool GroupSymbol::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseGroupSymbolValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void GroupSymbol::setValue(const GroupSymbolValue &value) +{ + myValue = value; +} - } +bool GroupSymbol::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseGroupSymbolValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupSymbol.h b/Sourcecode/private/mx/core/elements/GroupSymbol.h index 3117cdde3..5f1a48478 100644 --- a/Sourcecode/private/mx/core/elements/GroupSymbol.h +++ b/Sourcecode/private/mx/core/elements/GroupSymbol.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/GroupSymbolAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupSymbolAttributes ) - MX_FORWARD_DECLARE_ELEMENT( GroupSymbol ) - - inline GroupSymbolPtr makeGroupSymbol() { return std::make_shared(); } - inline GroupSymbolPtr makeGroupSymbol( const GroupSymbolValue& value ) { return std::make_shared( value ); } - inline GroupSymbolPtr makeGroupSymbol( GroupSymbolValue&& value ) { return std::make_shared( std::move( value ) ); } - - class GroupSymbol : public ElementInterface - { - public: - GroupSymbol(); - GroupSymbol( const GroupSymbolValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupSymbolAttributesPtr getAttributes() const; - void setAttributes( const GroupSymbolAttributesPtr& attributes ); - GroupSymbolValue getValue() const; - void setValue( const GroupSymbolValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupSymbolValue myValue; - GroupSymbolAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(GroupSymbolAttributes) +MX_FORWARD_DECLARE_ELEMENT(GroupSymbol) + +inline GroupSymbolPtr makeGroupSymbol() +{ + return std::make_shared(); +} + +inline GroupSymbolPtr makeGroupSymbol(const GroupSymbolValue &value) +{ + return std::make_shared(value); } + +inline GroupSymbolPtr makeGroupSymbol(GroupSymbolValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class GroupSymbol : public ElementInterface +{ + public: + GroupSymbol(); + GroupSymbol(const GroupSymbolValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GroupSymbolAttributesPtr getAttributes() const; + void setAttributes(const GroupSymbolAttributesPtr &attributes); + GroupSymbolValue getValue() const; + void setValue(const GroupSymbolValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GroupSymbolValue myValue; + GroupSymbolAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp index f312933c9..48ba2d381 100644 --- a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp @@ -8,61 +8,61 @@ namespace mx { - namespace core +namespace core +{ +GroupSymbolAttributes::GroupSymbolAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false) +{ +} + +bool GroupSymbolAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY; +} + +std::ostream &GroupSymbolAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - GroupSymbolAttributes::GroupSymbolAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + } + return os; +} + +bool GroupSymbolAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GroupSymbolAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool GroupSymbolAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; + continue; } - - - std::ostream& GroupSymbolAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; + continue; } - - - bool GroupSymbolAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "GroupSymbolAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h b/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h index 568524366..281b73104 100644 --- a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h +++ b/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,28 +14,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GroupSymbolAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GroupSymbolAttributes) - struct GroupSymbolAttributes : public AttributesInterface - { - public: - GroupSymbolAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; +struct GroupSymbolAttributes : public AttributesInterface +{ + public: + GroupSymbolAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupTime.cpp b/Sourcecode/private/mx/core/elements/GroupTime.cpp index 4460ff32f..3d99c8878 100644 --- a/Sourcecode/private/mx/core/elements/GroupTime.cpp +++ b/Sourcecode/private/mx/core/elements/GroupTime.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - GroupTime::GroupTime() : ElementInterface() {} - +namespace core +{ +GroupTime::GroupTime() : ElementInterface() +{ +} - bool GroupTime::hasAttributes() const { return false; } +bool GroupTime::hasAttributes() const +{ + return false; +} +bool GroupTime::hasContents() const +{ + return false; +} - bool GroupTime::hasContents() const { return false; } - std::ostream& GroupTime::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& GroupTime::streamName( std::ostream& os ) const { os << "group-time"; return os; } - std::ostream& GroupTime::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &GroupTime::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &GroupTime::streamName(std::ostream &os) const +{ + os << "group-time"; + return os; +} - bool GroupTime::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &GroupTime::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool GroupTime::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupTime.h b/Sourcecode/private/mx/core/elements/GroupTime.h index 6f26e245c..7302911f1 100644 --- a/Sourcecode/private/mx/core/elements/GroupTime.h +++ b/Sourcecode/private/mx/core/elements/GroupTime.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( GroupTime ) - - inline GroupTimePtr makeGroupTime() { return std::make_shared(); } - - class GroupTime : public ElementInterface - { - public: - GroupTime(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(GroupTime) + +inline GroupTimePtr makeGroupTime() +{ + return std::make_shared(); } + +class GroupTime : public ElementInterface +{ + public: + GroupTime(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Grouping.cpp b/Sourcecode/private/mx/core/elements/Grouping.cpp index a20e495ce..e175d15c2 100644 --- a/Sourcecode/private/mx/core/elements/Grouping.cpp +++ b/Sourcecode/private/mx/core/elements/Grouping.cpp @@ -9,127 +9,113 @@ namespace mx { - namespace core - { - Grouping::Grouping() - :myAttributes( std::make_shared() ) - ,myFeatureSet() - {} - - - bool Grouping::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Grouping::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Grouping::streamName( std::ostream& os ) const - { - os << "grouping"; - return os; - } - - - bool Grouping::hasContents() const - { - return myFeatureSet.size() > 0; - } - - - std::ostream& Grouping::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myFeatureSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - GroupingAttributesPtr Grouping::getAttributes() const - { - return myAttributes; - } - - - void Grouping::setAttributes( const GroupingAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - +namespace core +{ +Grouping::Grouping() : myAttributes(std::make_shared()), myFeatureSet() +{ +} - const FeatureSet& Grouping::getFeatureSet() const - { - return myFeatureSet; - } +bool Grouping::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Grouping::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void Grouping::removeFeature( const FeatureSetIterConst& value ) - { - if ( value != myFeatureSet.cend() ) - { - myFeatureSet.erase( value ); - } - } +std::ostream &Grouping::streamName(std::ostream &os) const +{ + os << "grouping"; + return os; +} +bool Grouping::hasContents() const +{ + return myFeatureSet.size() > 0; +} - void Grouping::addFeature( const FeaturePtr& value ) +std::ostream &Grouping::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + for (auto x : myFeatureSet) { - if ( value ) - { - myFeatureSet.push_back( value ); - } + os << std::endl; + x->toStream(os, indentLevel + 1); } + isOneLineOnly = false; + os << std::endl; + } + else + { + isOneLineOnly = true; + } + return os; +} +GroupingAttributesPtr Grouping::getAttributes() const +{ + return myAttributes; +} - void Grouping::clearFeatureSet() - { - myFeatureSet.clear(); - } +void Grouping::setAttributes(const GroupingAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +const FeatureSet &Grouping::getFeatureSet() const +{ + return myFeatureSet; +} - FeaturePtr Grouping::getFeature( const FeatureSetIterConst& setIterator ) const - { - if( setIterator != myFeatureSet.cend() ) - { - return *setIterator; - } - return FeaturePtr(); - } +void Grouping::removeFeature(const FeatureSetIterConst &value) +{ + if (value != myFeatureSet.cend()) + { + myFeatureSet.erase(value); + } +} +void Grouping::addFeature(const FeaturePtr &value) +{ + if (value) + { + myFeatureSet.push_back(value); + } +} - bool Grouping::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); +void Grouping::clearFeatureSet() +{ + myFeatureSet.clear(); +} - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "feature", myFeatureSet ); - } +FeaturePtr Grouping::getFeature(const FeatureSetIterConst &setIterator) const +{ + if (setIterator != myFeatureSet.cend()) + { + return *setIterator; + } + return FeaturePtr(); +} - MX_RETURN_IS_SUCCESS; - } +bool Grouping::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importElementSet(message, it, endIter, isSuccess, "feature", myFeatureSet); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Grouping.h b/Sourcecode/private/mx/core/elements/Grouping.h index ae25da1a3..bd1093f1a 100644 --- a/Sourcecode/private/mx/core/elements/Grouping.h +++ b/Sourcecode/private/mx/core/elements/Grouping.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/GroupingAttributes.h" #include @@ -14,41 +14,44 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupingAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Feature ) - MX_FORWARD_DECLARE_ELEMENT( Grouping ) - - inline GroupingPtr makeGrouping() { return std::make_shared(); } - - class Grouping : public ElementInterface - { - public: - Grouping(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupingAttributesPtr getAttributes() const; - void setAttributes( const GroupingAttributesPtr& value ); - - /* _________ Feature minOccurs = 0, maxOccurs = unbounded _________ */ - const FeatureSet& getFeatureSet() const; - void addFeature( const FeaturePtr& value ); - void removeFeature( const FeatureSetIterConst& value ); - void clearFeatureSet(); - FeaturePtr getFeature( const FeatureSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupingAttributesPtr myAttributes; - FeatureSet myFeatureSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(GroupingAttributes) +MX_FORWARD_DECLARE_ELEMENT(Feature) +MX_FORWARD_DECLARE_ELEMENT(Grouping) + +inline GroupingPtr makeGrouping() +{ + return std::make_shared(); } + +class Grouping : public ElementInterface +{ + public: + Grouping(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + GroupingAttributesPtr getAttributes() const; + void setAttributes(const GroupingAttributesPtr &value); + + /* _________ Feature minOccurs = 0, maxOccurs = unbounded _________ */ + const FeatureSet &getFeatureSet() const; + void addFeature(const FeaturePtr &value); + void removeFeature(const FeatureSetIterConst &value); + void clearFeatureSet(); + FeaturePtr getFeature(const FeatureSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GroupingAttributesPtr myAttributes; + FeatureSet myFeatureSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupingAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupingAttributes.cpp index 0216c547a..4e5dfde57 100644 --- a/Sourcecode/private/mx/core/elements/GroupingAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/GroupingAttributes.cpp @@ -8,62 +8,63 @@ namespace mx { - namespace core +namespace core +{ +GroupingAttributes::GroupingAttributes() + : type(StartStopSingle::single), number(XsToken("1")), memberOf(), hasType(true), hasNumber(false), + hasMemberOf(false) +{ +} + +bool GroupingAttributes::hasValues() const +{ + return hasType || hasNumber || hasMemberOf; +} + +std::ostream &GroupingAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - GroupingAttributes::GroupingAttributes() - :type( StartStopSingle::single ) - ,number( XsToken( "1" ) ) - ,memberOf() - ,hasType( true ) - ,hasNumber( false ) - ,hasMemberOf( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, memberOf, "member-of", hasMemberOf); + } + return os; +} +bool GroupingAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "GroupingAttributes"; + bool isSuccess = true; + bool isTypeFound = false; - bool GroupingAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopSingle)) { - return hasType || - hasNumber || - hasMemberOf; + continue; } - - - std::ostream& GroupingAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, memberOf, "member-of", hasMemberOf ); - } - return os; + continue; } - - - bool GroupingAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, memberOf, hasMemberOf, "member-of")) { - const char* const className = "GroupingAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopSingle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, memberOf, hasMemberOf, "member-of" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/GroupingAttributes.h b/Sourcecode/private/mx/core/elements/GroupingAttributes.h index 686d83289..f69eb79e5 100644 --- a/Sourcecode/private/mx/core/elements/GroupingAttributes.h +++ b/Sourcecode/private/mx/core/elements/GroupingAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -15,26 +15,26 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( GroupingAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(GroupingAttributes) - struct GroupingAttributes : public AttributesInterface - { - public: - GroupingAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopSingle type; - XsToken number; - XsToken memberOf; - const bool hasType; - bool hasNumber; - bool hasMemberOf; +struct GroupingAttributes : public AttributesInterface +{ + public: + GroupingAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStopSingle type; + XsToken number; + XsToken memberOf; + const bool hasType; + bool hasNumber; + bool hasMemberOf; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HammerOn.cpp b/Sourcecode/private/mx/core/elements/HammerOn.cpp index 5b678a9c4..692994d02 100644 --- a/Sourcecode/private/mx/core/elements/HammerOn.cpp +++ b/Sourcecode/private/mx/core/elements/HammerOn.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - HammerOn::HammerOn() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - HammerOn::HammerOn( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool HammerOn::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool HammerOn::hasContents() const - { - return true; - } - - - std::ostream& HammerOn::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& HammerOn::streamName( std::ostream& os ) const - { - os << "hammer-on"; - return os; - } - - - std::ostream& HammerOn::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +HammerOn::HammerOn() : myValue(), myAttributes(std::make_shared()) +{ +} +HammerOn::HammerOn(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - HammerOnAttributesPtr HammerOn::getAttributes() const - { - return myAttributes; - } +bool HammerOn::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool HammerOn::hasContents() const +{ + return true; +} - void HammerOn::setAttributes( const HammerOnAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &HammerOn::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &HammerOn::streamName(std::ostream &os) const +{ + os << "hammer-on"; + return os; +} - XsString HammerOn::getValue() const - { - return myValue; - } +std::ostream &HammerOn::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +HammerOnAttributesPtr HammerOn::getAttributes() const +{ + return myAttributes; +} - void HammerOn::setValue( const XsString& value ) - { - myValue = value; - } +void HammerOn::setAttributes(const HammerOnAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString HammerOn::getValue() const +{ + return myValue; +} - bool HammerOn::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void HammerOn::setValue(const XsString &value) +{ + myValue = value; +} - } +bool HammerOn::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HammerOn.h b/Sourcecode/private/mx/core/elements/HammerOn.h index b603a875b..bccd03eb3 100644 --- a/Sourcecode/private/mx/core/elements/HammerOn.h +++ b/Sourcecode/private/mx/core/elements/HammerOn.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/HammerOnAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HammerOnAttributes ) - MX_FORWARD_DECLARE_ELEMENT( HammerOn ) - - inline HammerOnPtr makeHammerOn() { return std::make_shared(); } - inline HammerOnPtr makeHammerOn( const XsString& value ) { return std::make_shared( value ); } - inline HammerOnPtr makeHammerOn( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class HammerOn : public ElementInterface - { - public: - HammerOn(); - HammerOn( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HammerOnAttributesPtr getAttributes() const; - void setAttributes( const HammerOnAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - HammerOnAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(HammerOnAttributes) +MX_FORWARD_DECLARE_ELEMENT(HammerOn) + +inline HammerOnPtr makeHammerOn() +{ + return std::make_shared(); +} + +inline HammerOnPtr makeHammerOn(const XsString &value) +{ + return std::make_shared(value); } + +inline HammerOnPtr makeHammerOn(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class HammerOn : public ElementInterface +{ + public: + HammerOn(); + HammerOn(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HammerOnAttributesPtr getAttributes() const; + void setAttributes(const HammerOnAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + HammerOnAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp b/Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp index 2eb604e13..6541834c5 100644 --- a/Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp @@ -8,102 +8,108 @@ namespace mx { - namespace core +namespace core +{ +HammerOnAttributes::HammerOnAttributes() + : type(StartStop::start), number(1), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), + placement(), hasType(true), hasNumber(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasPlacement(false) +{ +} + +bool HammerOnAttributes::hasValues() const +{ + return hasType || hasNumber || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight || hasPlacement; +} + +std::ostream &HammerOnAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - HammerOnAttributes::HammerOnAttributes() - :type( StartStop::start ) - ,number( 1 ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasType( true ) - ,hasNumber( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} +bool HammerOnAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "HammerOnAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool HammerOnAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - return hasType || - hasNumber || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& HammerOnAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool HammerOnAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "HammerOnAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HammerOnAttributes.h b/Sourcecode/private/mx/core/elements/HammerOnAttributes.h index 791f95bea..ce3a500b9 100644 --- a/Sourcecode/private/mx/core/elements/HammerOnAttributes.h +++ b/Sourcecode/private/mx/core/elements/HammerOnAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -18,42 +18,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HammerOnAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(HammerOnAttributes) - struct HammerOnAttributes : public AttributesInterface - { - public: - HammerOnAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - NumberLevel number; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - const bool hasType; - bool hasNumber; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct HammerOnAttributes : public AttributesInterface +{ + public: + HammerOnAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + NumberLevel number; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + const bool hasType; + bool hasNumber; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Handbell.cpp b/Sourcecode/private/mx/core/elements/Handbell.cpp index 1ff68f1c9..b7fe09b66 100644 --- a/Sourcecode/private/mx/core/elements/Handbell.cpp +++ b/Sourcecode/private/mx/core/elements/Handbell.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Handbell::Handbell() - :myValue( HandbellValue::damp ) - ,myAttributes( std::make_shared() ) - {} - - - Handbell::Handbell( const HandbellValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Handbell::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Handbell::hasContents() const - { - return true; - } - - - std::ostream& Handbell::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Handbell::streamName( std::ostream& os ) const - { - os << "handbell"; - return os; - } - - - std::ostream& Handbell::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Handbell::Handbell() : myValue(HandbellValue::damp), myAttributes(std::make_shared()) +{ +} +Handbell::Handbell(const HandbellValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - HandbellAttributesPtr Handbell::getAttributes() const - { - return myAttributes; - } +bool Handbell::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Handbell::hasContents() const +{ + return true; +} - void Handbell::setAttributes( const HandbellAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Handbell::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Handbell::streamName(std::ostream &os) const +{ + os << "handbell"; + return os; +} - HandbellValue Handbell::getValue() const - { - return myValue; - } +std::ostream &Handbell::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +HandbellAttributesPtr Handbell::getAttributes() const +{ + return myAttributes; +} - void Handbell::setValue( const HandbellValue& value ) - { - myValue = value; - } +void Handbell::setAttributes(const HandbellAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +HandbellValue Handbell::getValue() const +{ + return myValue; +} - bool Handbell::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseHandbellValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Handbell::setValue(const HandbellValue &value) +{ + myValue = value; +} - } +bool Handbell::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseHandbellValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Handbell.h b/Sourcecode/private/mx/core/elements/Handbell.h index 7aa2d5269..c55b23695 100644 --- a/Sourcecode/private/mx/core/elements/Handbell.h +++ b/Sourcecode/private/mx/core/elements/Handbell.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/HandbellAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HandbellAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Handbell ) - - inline HandbellPtr makeHandbell() { return std::make_shared(); } - inline HandbellPtr makeHandbell( const HandbellValue& value ) { return std::make_shared( value ); } - inline HandbellPtr makeHandbell( HandbellValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Handbell : public ElementInterface - { - public: - Handbell(); - Handbell( const HandbellValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HandbellAttributesPtr getAttributes() const; - void setAttributes( const HandbellAttributesPtr& attributes ); - HandbellValue getValue() const; - void setValue( const HandbellValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HandbellValue myValue; - HandbellAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(HandbellAttributes) +MX_FORWARD_DECLARE_ELEMENT(Handbell) + +inline HandbellPtr makeHandbell() +{ + return std::make_shared(); +} + +inline HandbellPtr makeHandbell(const HandbellValue &value) +{ + return std::make_shared(value); } + +inline HandbellPtr makeHandbell(HandbellValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Handbell : public ElementInterface +{ + public: + Handbell(); + Handbell(const HandbellValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HandbellAttributesPtr getAttributes() const; + void setAttributes(const HandbellAttributesPtr &attributes); + HandbellValue getValue() const; + void setValue(const HandbellValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + HandbellValue myValue; + HandbellAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HandbellAttributes.cpp b/Sourcecode/private/mx/core/elements/HandbellAttributes.cpp index 4be078607..525d3b9dd 100644 --- a/Sourcecode/private/mx/core/elements/HandbellAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/HandbellAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +HandbellAttributes::HandbellAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), placement(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool HandbellAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &HandbellAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - HandbellAttributes::HandbellAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool HandbellAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "HandbellAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool HandbellAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& HandbellAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool HandbellAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "HandbellAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HandbellAttributes.h b/Sourcecode/private/mx/core/elements/HandbellAttributes.h index 5e267ba0c..bef22555e 100644 --- a/Sourcecode/private/mx/core/elements/HandbellAttributes.h +++ b/Sourcecode/private/mx/core/elements/HandbellAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HandbellAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(HandbellAttributes) - struct HandbellAttributes : public AttributesInterface - { - public: - HandbellAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct HandbellAttributes : public AttributesInterface +{ + public: + HandbellAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Harmonic.cpp b/Sourcecode/private/mx/core/elements/Harmonic.cpp index b90d67244..d66bb3cde 100644 --- a/Sourcecode/private/mx/core/elements/Harmonic.cpp +++ b/Sourcecode/private/mx/core/elements/Harmonic.cpp @@ -15,178 +15,169 @@ namespace mx { - namespace core - { - Harmonic::Harmonic() - :myAttributes( std::make_shared() ) - ,myHarmonicTypeChoice( makeHarmonicTypeChoice() ) - ,myHasHarmonicTypeChoice( false ) - ,myHarmonicInfoChoice( makeHarmonicInfoChoice() ) - ,myHasHarmonicInfoChoice( false ) - {} - - - bool Harmonic::hasAttributes() const - { - return myAttributes->hasValues(); - } - +namespace core +{ +Harmonic::Harmonic() + : myAttributes(std::make_shared()), myHarmonicTypeChoice(makeHarmonicTypeChoice()), + myHasHarmonicTypeChoice(false), myHarmonicInfoChoice(makeHarmonicInfoChoice()), myHasHarmonicInfoChoice(false) +{ +} - std::ostream& Harmonic::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +bool Harmonic::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Harmonic::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - std::ostream& Harmonic::streamName( std::ostream& os ) const - { - os << "harmonic"; - return os; - } +std::ostream &Harmonic::streamName(std::ostream &os) const +{ + os << "harmonic"; + return os; +} +bool Harmonic::hasContents() const +{ + return myHasHarmonicTypeChoice || myHasHarmonicInfoChoice; +} - bool Harmonic::hasContents() const +std::ostream &Harmonic::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + if (myHasHarmonicTypeChoice) { - return myHasHarmonicTypeChoice || myHasHarmonicInfoChoice; + os << std::endl; + myHarmonicTypeChoice->streamContents(os, indentLevel + 1, isOneLineOnly); } - - - std::ostream& Harmonic::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const + if (myHasHarmonicInfoChoice) { - if ( hasContents() ) - { - if ( myHasHarmonicTypeChoice ) - { - os << std::endl; - myHarmonicTypeChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasHarmonicInfoChoice ) - { - os << std::endl; - myHarmonicInfoChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; + os << std::endl; + myHarmonicInfoChoice->streamContents(os, indentLevel + 1, isOneLineOnly); } + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +HarmonicTypeChoicePtr Harmonic::getHarmonicTypeChoice() const +{ + return myHarmonicTypeChoice; +} - HarmonicTypeChoicePtr Harmonic::getHarmonicTypeChoice() const - { - return myHarmonicTypeChoice; - } +void Harmonic::setHarmonicTypeChoice(const HarmonicTypeChoicePtr &value) +{ + if (value) + { + myHarmonicTypeChoice = value; + } +} +bool Harmonic::getHasHarmonicTypeChoice() const +{ + return myHasHarmonicTypeChoice; +} - void Harmonic::setHarmonicTypeChoice( const HarmonicTypeChoicePtr& value ) - { - if ( value ) - { - myHarmonicTypeChoice = value; - } - } +void Harmonic::setHasHarmonicTypeChoice(const bool value) +{ + myHasHarmonicTypeChoice = value; +} +HarmonicAttributesPtr Harmonic::getAttributes() const +{ + return myAttributes; +} - bool Harmonic::getHasHarmonicTypeChoice() const - { - return myHasHarmonicTypeChoice; - } +void Harmonic::setAttributes(const HarmonicAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +HarmonicInfoChoicePtr Harmonic::getHarmonicInfoChoice() const +{ + return myHarmonicInfoChoice; +} - void Harmonic::setHasHarmonicTypeChoice( const bool value ) - { - myHasHarmonicTypeChoice = value; - } +void Harmonic::setHarmonicInfoChoice(const HarmonicInfoChoicePtr &value) +{ + if (value) + { + myHarmonicInfoChoice = value; + } +} +bool Harmonic::getHasHarmonicInfoChoice() const +{ + return myHasHarmonicInfoChoice; +} - HarmonicAttributesPtr Harmonic::getAttributes() const - { - return myAttributes; - } +void Harmonic::setHasHarmonicInfoChoice(const bool value) +{ + myHasHarmonicInfoChoice = value; +} +bool Harmonic::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - void Harmonic::setAttributes( const HarmonicAttributesPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (checkSetChoiceMember(message, *it, isSuccess, myHarmonicTypeChoice, "natural", + &HarmonicTypeChoice::getNatural, + static_cast(HarmonicTypeChoice::Choice::natural))) { - if ( value ) - { - myAttributes = value; - } + myHasHarmonicTypeChoice = true; + continue; } - - HarmonicInfoChoicePtr Harmonic::getHarmonicInfoChoice() const + if (checkSetChoiceMember(message, *it, isSuccess, myHarmonicTypeChoice, "artificial", + &HarmonicTypeChoice::getArtificial, + static_cast(HarmonicTypeChoice::Choice::artificial))) { - return myHarmonicInfoChoice; + myHasHarmonicTypeChoice = true; + continue; } - - void Harmonic::setHarmonicInfoChoice( const HarmonicInfoChoicePtr& value ) + if (checkSetChoiceMember(message, *it, isSuccess, myHarmonicInfoChoice, "base-pitch", + &HarmonicInfoChoice::getBasePitch, + static_cast(HarmonicInfoChoice::Choice::basePitch))) { - if ( value ) - { - myHarmonicInfoChoice = value; - } + myHasHarmonicInfoChoice = true; + continue; } - - bool Harmonic::getHasHarmonicInfoChoice() const + if (checkSetChoiceMember(message, *it, isSuccess, myHarmonicInfoChoice, "touching-pitch", + &HarmonicInfoChoice::getTouchingPitch, + static_cast(HarmonicInfoChoice::Choice::touchingPitch))) { - return myHasHarmonicInfoChoice; + myHasHarmonicInfoChoice = true; + continue; } - - void Harmonic::setHasHarmonicInfoChoice( const bool value ) + if (checkSetChoiceMember(message, *it, isSuccess, myHarmonicInfoChoice, "sounding-pitch", + &HarmonicInfoChoice::getSoundingPitch, + static_cast(HarmonicInfoChoice::Choice::soundingPitch))) { - myHasHarmonicInfoChoice = value; + myHasHarmonicInfoChoice = true; + continue; } - - - bool Harmonic::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicTypeChoice, - "natural", &HarmonicTypeChoice::getNatural, - static_cast( HarmonicTypeChoice::Choice::natural ) ) ) - { myHasHarmonicTypeChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicTypeChoice, - "artificial", &HarmonicTypeChoice::getArtificial, - static_cast( HarmonicTypeChoice::Choice::artificial ) ) ) - { myHasHarmonicTypeChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicInfoChoice, - "base-pitch", &HarmonicInfoChoice::getBasePitch, - static_cast( HarmonicInfoChoice::Choice::basePitch ) ) ) - { myHasHarmonicInfoChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicInfoChoice, - "touching-pitch", &HarmonicInfoChoice::getTouchingPitch, - static_cast( HarmonicInfoChoice::Choice::touchingPitch ) ) ) - { myHasHarmonicInfoChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicInfoChoice, - "sounding-pitch", &HarmonicInfoChoice::getSoundingPitch, - static_cast( HarmonicInfoChoice::Choice::soundingPitch ) ) ) - { myHasHarmonicInfoChoice = true; continue; } - - } - - return isSuccess; - } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Harmonic.h b/Sourcecode/private/mx/core/elements/Harmonic.h index 24a35f511..6d8b3a8a7 100644 --- a/Sourcecode/private/mx/core/elements/Harmonic.h +++ b/Sourcecode/private/mx/core/elements/Harmonic.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/HarmonicAttributes.h" #include @@ -14,50 +14,53 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarmonicAttributes ) - MX_FORWARD_DECLARE_ELEMENT( HarmonicInfoChoice ) - MX_FORWARD_DECLARE_ELEMENT( HarmonicTypeChoice ) - MX_FORWARD_DECLARE_ELEMENT( Harmonic ) - - inline HarmonicPtr makeHarmonic() { return std::make_shared(); } - - class Harmonic : public ElementInterface - { - public: - Harmonic(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HarmonicAttributesPtr getAttributes() const; - void setAttributes( const HarmonicAttributesPtr& value ); - - /* _________ HarmonicTypeChoice minOccurs = 0, maxOccurs = 1 _________ */ - HarmonicTypeChoicePtr getHarmonicTypeChoice() const; - void setHarmonicTypeChoice( const HarmonicTypeChoicePtr& value ); - bool getHasHarmonicTypeChoice() const; - void setHasHarmonicTypeChoice( const bool value ); - - /* _________ HarmonicInfoChoice minOccurs = 0, maxOccurs = 1 _________ */ - HarmonicInfoChoicePtr getHarmonicInfoChoice() const; - void setHarmonicInfoChoice( const HarmonicInfoChoicePtr& value ); - bool getHasHarmonicInfoChoice() const; - void setHasHarmonicInfoChoice( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HarmonicAttributesPtr myAttributes; - HarmonicTypeChoicePtr myHarmonicTypeChoice; - bool myHasHarmonicTypeChoice; - HarmonicInfoChoicePtr myHarmonicInfoChoice; - bool myHasHarmonicInfoChoice; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(HarmonicAttributes) +MX_FORWARD_DECLARE_ELEMENT(HarmonicInfoChoice) +MX_FORWARD_DECLARE_ELEMENT(HarmonicTypeChoice) +MX_FORWARD_DECLARE_ELEMENT(Harmonic) + +inline HarmonicPtr makeHarmonic() +{ + return std::make_shared(); } + +class Harmonic : public ElementInterface +{ + public: + Harmonic(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HarmonicAttributesPtr getAttributes() const; + void setAttributes(const HarmonicAttributesPtr &value); + + /* _________ HarmonicTypeChoice minOccurs = 0, maxOccurs = 1 _________ */ + HarmonicTypeChoicePtr getHarmonicTypeChoice() const; + void setHarmonicTypeChoice(const HarmonicTypeChoicePtr &value); + bool getHasHarmonicTypeChoice() const; + void setHasHarmonicTypeChoice(const bool value); + + /* _________ HarmonicInfoChoice minOccurs = 0, maxOccurs = 1 _________ */ + HarmonicInfoChoicePtr getHarmonicInfoChoice() const; + void setHarmonicInfoChoice(const HarmonicInfoChoicePtr &value); + bool getHasHarmonicInfoChoice() const; + void setHasHarmonicInfoChoice(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + HarmonicAttributesPtr myAttributes; + HarmonicTypeChoicePtr myHarmonicTypeChoice; + bool myHasHarmonicTypeChoice; + HarmonicInfoChoicePtr myHarmonicInfoChoice; + bool myHasHarmonicInfoChoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp b/Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp index e792deb27..65e630ece 100644 --- a/Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp @@ -8,96 +8,101 @@ namespace mx { - namespace core +namespace core +{ +HarmonicAttributes::HarmonicAttributes() + : printObject(YesNo::no), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), + placement(AboveBelow::below), hasPrintObject(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasColor(false), hasPlacement(false) +{ +} + +bool HarmonicAttributes::hasValues() const +{ + return hasPrintObject || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight || hasColor || hasPlacement; +} + +std::ostream &HarmonicAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - HarmonicAttributes::HarmonicAttributes() - :printObject( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool HarmonicAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "HarmonicAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool HarmonicAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - return hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; + continue; } - - - std::ostream& HarmonicAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool HarmonicAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "HarmonicAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonicAttributes.h b/Sourcecode/private/mx/core/elements/HarmonicAttributes.h index 7b1c517bb..85468fc01 100644 --- a/Sourcecode/private/mx/core/elements/HarmonicAttributes.h +++ b/Sourcecode/private/mx/core/elements/HarmonicAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,42 +18,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HarmonicAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(HarmonicAttributes) - struct HarmonicAttributes : public AttributesInterface - { - public: - HarmonicAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; +struct HarmonicAttributes : public AttributesInterface +{ + public: + HarmonicAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + bool hasPrintObject; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp b/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp index 12d7d02f3..bf0eb8639 100644 --- a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp +++ b/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp @@ -11,119 +11,104 @@ namespace mx { - namespace core +namespace core +{ +HarmonicInfoChoice::HarmonicInfoChoice() + : myChoice(Choice::basePitch), myBasePitch(makeBasePitch()), myTouchingPitch(makeTouchingPitch()), + mySoundingPitch(makeSoundingPitch()) +{ +} + +bool HarmonicInfoChoice::hasAttributes() const +{ + return false; +} + +std::ostream &HarmonicInfoChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &HarmonicInfoChoice::streamName(std::ostream &os) const +{ + return os; +} + +bool HarmonicInfoChoice::hasContents() const +{ + return true; +} + +std::ostream &HarmonicInfoChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::basePitch: + myBasePitch->toStream(os, indentLevel); + break; + case Choice::touchingPitch: + myTouchingPitch->toStream(os, indentLevel); + break; + case Choice::soundingPitch: + mySoundingPitch->toStream(os, indentLevel); + break; + default: + break; + } + isOneLineOnly = false; + return os; +} + +HarmonicInfoChoice::Choice HarmonicInfoChoice::getChoice() const +{ + return myChoice; +} + +void HarmonicInfoChoice::setChoice(const HarmonicInfoChoice::Choice value) +{ + myChoice = value; +} + +BasePitchPtr HarmonicInfoChoice::getBasePitch() const +{ + return myBasePitch; +} + +void HarmonicInfoChoice::setBasePitch(const BasePitchPtr &value) +{ + if (value) + { + myBasePitch = value; + } +} + +TouchingPitchPtr HarmonicInfoChoice::getTouchingPitch() const +{ + return myTouchingPitch; +} + +void HarmonicInfoChoice::setTouchingPitch(const TouchingPitchPtr &value) +{ + if (value) { - HarmonicInfoChoice::HarmonicInfoChoice() - :myChoice( Choice::basePitch ) - ,myBasePitch( makeBasePitch() ) - ,myTouchingPitch( makeTouchingPitch() ) - ,mySoundingPitch( makeSoundingPitch() ) - {} + myTouchingPitch = value; + } +} + +SoundingPitchPtr HarmonicInfoChoice::getSoundingPitch() const +{ + return mySoundingPitch; +} - - bool HarmonicInfoChoice::hasAttributes() const - { - return false; - } - - - std::ostream& HarmonicInfoChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HarmonicInfoChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool HarmonicInfoChoice::hasContents() const - { - return true; - } - - - std::ostream& HarmonicInfoChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::basePitch: - myBasePitch->toStream( os, indentLevel ); - break; - case Choice::touchingPitch: - myTouchingPitch->toStream( os, indentLevel ); - break; - case Choice::soundingPitch: - mySoundingPitch->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - HarmonicInfoChoice::Choice HarmonicInfoChoice::getChoice() const - { - return myChoice; - } - - - void HarmonicInfoChoice::setChoice( const HarmonicInfoChoice::Choice value ) - { - myChoice = value; - } - - - BasePitchPtr HarmonicInfoChoice::getBasePitch() const - { - return myBasePitch; - } - - - void HarmonicInfoChoice::setBasePitch( const BasePitchPtr& value ) - { - if ( value ) - { - myBasePitch = value; - } - } - - - TouchingPitchPtr HarmonicInfoChoice::getTouchingPitch() const - { - return myTouchingPitch; - } - - - void HarmonicInfoChoice::setTouchingPitch( const TouchingPitchPtr& value ) - { - if ( value ) - { - myTouchingPitch = value; - } - } - - - SoundingPitchPtr HarmonicInfoChoice::getSoundingPitch() const - { - return mySoundingPitch; - } - - - void HarmonicInfoChoice::setSoundingPitch( const SoundingPitchPtr& value ) - { - if ( value ) - { - mySoundingPitch = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( HarmonicInfoChoice ); - +void HarmonicInfoChoice::setSoundingPitch(const SoundingPitchPtr &value) +{ + if (value) + { + mySoundingPitch = value; } } + +MX_FROM_XELEMENT_UNUSED(HarmonicInfoChoice); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h b/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h index 8ef94c3fe..b18e40790 100644 --- a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h +++ b/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,57 +13,60 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BasePitch) +MX_FORWARD_DECLARE_ELEMENT(SoundingPitch) +MX_FORWARD_DECLARE_ELEMENT(TouchingPitch) +MX_FORWARD_DECLARE_ELEMENT(HarmonicInfoChoice) - MX_FORWARD_DECLARE_ELEMENT( BasePitch ) - MX_FORWARD_DECLARE_ELEMENT( SoundingPitch ) - MX_FORWARD_DECLARE_ELEMENT( TouchingPitch ) - MX_FORWARD_DECLARE_ELEMENT( HarmonicInfoChoice ) +inline HarmonicInfoChoicePtr makeHarmonicInfoChoice() +{ + return std::make_shared(); +} - inline HarmonicInfoChoicePtr makeHarmonicInfoChoice() { return std::make_shared(); } +class HarmonicInfoChoice : public ElementInterface +{ + public: + enum class Choice + { + basePitch = 1, + touchingPitch = 2, + soundingPitch = 3 + }; + HarmonicInfoChoice(); - class HarmonicInfoChoice : public ElementInterface - { - public: - enum class Choice - { - basePitch = 1, - touchingPitch = 2, - soundingPitch = 3 - }; - HarmonicInfoChoice(); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + HarmonicInfoChoice::Choice getChoice() const; + void setChoice(const HarmonicInfoChoice::Choice value); - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - HarmonicInfoChoice::Choice getChoice() const; - void setChoice( const HarmonicInfoChoice::Choice value ); + /* _________ BasePitch minOccurs = 1, maxOccurs = 1 _________ */ + BasePitchPtr getBasePitch() const; + void setBasePitch(const BasePitchPtr &value); - /* _________ BasePitch minOccurs = 1, maxOccurs = 1 _________ */ - BasePitchPtr getBasePitch() const; - void setBasePitch( const BasePitchPtr& value ); + /* _________ TouchingPitch minOccurs = 1, maxOccurs = 1 _________ */ + TouchingPitchPtr getTouchingPitch() const; + void setTouchingPitch(const TouchingPitchPtr &value); - /* _________ TouchingPitch minOccurs = 1, maxOccurs = 1 _________ */ - TouchingPitchPtr getTouchingPitch() const; - void setTouchingPitch( const TouchingPitchPtr& value ); + /* _________ SoundingPitch minOccurs = 1, maxOccurs = 1 _________ */ + SoundingPitchPtr getSoundingPitch() const; + void setSoundingPitch(const SoundingPitchPtr &value); - /* _________ SoundingPitch minOccurs = 1, maxOccurs = 1 _________ */ - SoundingPitchPtr getSoundingPitch() const; - void setSoundingPitch( const SoundingPitchPtr& value ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - BasePitchPtr myBasePitch; - TouchingPitchPtr myTouchingPitch; - SoundingPitchPtr mySoundingPitch; - }; - } -} + private: + Choice myChoice; + BasePitchPtr myBasePitch; + TouchingPitchPtr myTouchingPitch; + SoundingPitchPtr mySoundingPitch; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp b/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp index 7784285e8..2c38a4aea 100644 --- a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp +++ b/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp @@ -10,100 +10,87 @@ namespace mx { - namespace core - { - HarmonicTypeChoice::HarmonicTypeChoice() - :myChoice( Choice::natural ) - ,myNatural( makeNatural() ) - ,myArtificial( makeArtificial() ) - {} - - - bool HarmonicTypeChoice::hasAttributes() const - { - return false; - } - - - std::ostream& HarmonicTypeChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HarmonicTypeChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool HarmonicTypeChoice::hasContents() const - { - return true; - } - - - std::ostream& HarmonicTypeChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::natural: - myNatural->toStream( os, indentLevel ); - break; - case Choice::artificial: - myArtificial->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - HarmonicTypeChoice::Choice HarmonicTypeChoice::getChoice() const - { - return myChoice; - } +namespace core +{ +HarmonicTypeChoice::HarmonicTypeChoice() + : myChoice(Choice::natural), myNatural(makeNatural()), myArtificial(makeArtificial()) +{ +} +bool HarmonicTypeChoice::hasAttributes() const +{ + return false; +} - void HarmonicTypeChoice::setChoice( const HarmonicTypeChoice::Choice value ) - { - myChoice = value; - } +std::ostream &HarmonicTypeChoice::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &HarmonicTypeChoice::streamName(std::ostream &os) const +{ + return os; +} - NaturalPtr HarmonicTypeChoice::getNatural() const - { - return myNatural; - } +bool HarmonicTypeChoice::hasContents() const +{ + return true; +} +std::ostream &HarmonicTypeChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::natural: + myNatural->toStream(os, indentLevel); + break; + case Choice::artificial: + myArtificial->toStream(os, indentLevel); + break; + default: + break; + } + isOneLineOnly = false; + return os; +} - void HarmonicTypeChoice::setNatural( const NaturalPtr& value ) - { - if ( value ) - { - myNatural = value; - } - } +HarmonicTypeChoice::Choice HarmonicTypeChoice::getChoice() const +{ + return myChoice; +} +void HarmonicTypeChoice::setChoice(const HarmonicTypeChoice::Choice value) +{ + myChoice = value; +} - ArtificialPtr HarmonicTypeChoice::getArtificial() const - { - return myArtificial; - } +NaturalPtr HarmonicTypeChoice::getNatural() const +{ + return myNatural; +} +void HarmonicTypeChoice::setNatural(const NaturalPtr &value) +{ + if (value) + { + myNatural = value; + } +} - void HarmonicTypeChoice::setArtificial( const ArtificialPtr& value ) - { - if ( value ) - { - myArtificial = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( HarmonicTypeChoice ); +ArtificialPtr HarmonicTypeChoice::getArtificial() const +{ + return myArtificial; +} +void HarmonicTypeChoice::setArtificial(const ArtificialPtr &value) +{ + if (value) + { + myArtificial = value; } } + +MX_FROM_XELEMENT_UNUSED(HarmonicTypeChoice); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h b/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h index 9d7f75f3b..e38db384b 100644 --- a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h +++ b/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,50 +13,53 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Artificial ) - MX_FORWARD_DECLARE_ELEMENT( Natural ) - MX_FORWARD_DECLARE_ELEMENT( HarmonicTypeChoice ) - - inline HarmonicTypeChoicePtr makeHarmonicTypeChoice() { return std::make_shared(); } - - class HarmonicTypeChoice : public ElementInterface - { - public: - enum class Choice - { - natural = 1, - artificial = 2 - }; - HarmonicTypeChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - HarmonicTypeChoice::Choice getChoice() const; - void setChoice( const HarmonicTypeChoice::Choice value ); - - /* _________ Natural minOccurs = 1, maxOccurs = 1 _________ */ - NaturalPtr getNatural() const; - void setNatural( const NaturalPtr& value ); - - /* _________ Artificial minOccurs = 1, maxOccurs = 1 _________ */ - ArtificialPtr getArtificial() const; - void setArtificial( const ArtificialPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - NaturalPtr myNatural; - ArtificialPtr myArtificial; - }; - } +MX_FORWARD_DECLARE_ELEMENT(Artificial) +MX_FORWARD_DECLARE_ELEMENT(Natural) +MX_FORWARD_DECLARE_ELEMENT(HarmonicTypeChoice) + +inline HarmonicTypeChoicePtr makeHarmonicTypeChoice() +{ + return std::make_shared(); } + +class HarmonicTypeChoice : public ElementInterface +{ + public: + enum class Choice + { + natural = 1, + artificial = 2 + }; + HarmonicTypeChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + HarmonicTypeChoice::Choice getChoice() const; + void setChoice(const HarmonicTypeChoice::Choice value); + + /* _________ Natural minOccurs = 1, maxOccurs = 1 _________ */ + NaturalPtr getNatural() const; + void setNatural(const NaturalPtr &value); + + /* _________ Artificial minOccurs = 1, maxOccurs = 1 _________ */ + ArtificialPtr getArtificial() const; + void setArtificial(const ArtificialPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + NaturalPtr myNatural; + ArtificialPtr myArtificial; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Harmony.cpp b/Sourcecode/private/mx/core/elements/Harmony.cpp index f199cf1bd..eb323e2e7 100644 --- a/Sourcecode/private/mx/core/elements/Harmony.cpp +++ b/Sourcecode/private/mx/core/elements/Harmony.cpp @@ -9,344 +9,333 @@ #include "mx/core/elements/EditorialGroup.h" #include "mx/core/elements/Frame.h" #include "mx/core/elements/Function.h" -#include "mx/core/elements/Inversion.h" #include "mx/core/elements/HarmonyChordGroup.h" +#include "mx/core/elements/Inversion.h" #include "mx/core/elements/Kind.h" -#include "mx/core/elements/Root.h" #include "mx/core/elements/Offset.h" +#include "mx/core/elements/Root.h" #include "mx/core/elements/Staff.h" #include namespace mx { - namespace core - { - Harmony::Harmony() - :myAttributes( std::make_shared() ) - ,myHarmonyChordGroupSet() - ,myFrame( makeFrame() ) - ,myHasFrame( false ) - ,myOffset( makeOffset() ) - ,myHasOffset( false ) - ,myEditorialGroup( makeEditorialGroup() ) - ,myStaff( makeStaff() ) - ,myHasStaff( false ) - { - myHarmonyChordGroupSet.push_back( makeHarmonyChordGroup() ); - } +namespace core +{ +Harmony::Harmony() + : myAttributes(std::make_shared()), myHarmonyChordGroupSet(), myFrame(makeFrame()), + myHasFrame(false), myOffset(makeOffset()), myHasOffset(false), myEditorialGroup(makeEditorialGroup()), + myStaff(makeStaff()), myHasStaff(false) +{ + myHarmonyChordGroupSet.push_back(makeHarmonyChordGroup()); +} +bool Harmony::hasAttributes() const +{ + return myAttributes->hasValues(); +} - bool Harmony::hasAttributes() const - { - return myAttributes->hasValues(); - } +std::ostream &Harmony::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Harmony::streamName(std::ostream &os) const +{ + os << "harmony"; + return os; +} - std::ostream& Harmony::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +bool Harmony::hasContents() const +{ + return true; +} +std::ostream &Harmony::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto x : myHarmonyChordGroupSet) + { + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); + } + if (myHasFrame) + { + os << std::endl; + myFrame->toStream(os, indentLevel + 1); + } + if (myHasOffset) + { + os << std::endl; + myOffset->toStream(os, indentLevel + 1); + } + if (myEditorialGroup->hasContents()) + { + os << std::endl; + myEditorialGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + } + if (myHasStaff) + { + os << std::endl; + myStaff->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} - std::ostream& Harmony::streamName( std::ostream& os ) const - { - os << "harmony"; - return os; - } +HarmonyAttributesPtr Harmony::getAttributes() const +{ + return myAttributes; +} +void Harmony::setAttributes(const HarmonyAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - bool Harmony::hasContents() const - { - return true; - } +const HarmonyChordGroupSet &Harmony::getHarmonyChordGroupSet() const +{ + return myHarmonyChordGroupSet; +} +void Harmony::addHarmonyChordGroup(const HarmonyChordGroupPtr &value) +{ + if (value) + { + myHarmonyChordGroupSet.push_back(value); + } +} - std::ostream& Harmony::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const +void Harmony::removeHarmonyChordGroup(const HarmonyChordGroupSetIterConst &value) +{ + if (value != myHarmonyChordGroupSet.cend()) + { + if (myHarmonyChordGroupSet.size() > 1) { - for ( auto x : myHarmonyChordGroupSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasFrame ) - { - os << std::endl; - myFrame->toStream( os, indentLevel+1 ); - } - if ( myHasOffset ) - { - os << std::endl; - myOffset->toStream( os, indentLevel+1 ); - } - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasStaff ) - { - os << std::endl; - myStaff->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; + myHarmonyChordGroupSet.erase(value); } + } +} +void Harmony::clearHarmonyChordGroupSet() +{ + myHarmonyChordGroupSet.clear(); + myHarmonyChordGroupSet.push_back(makeHarmonyChordGroup()); +} - HarmonyAttributesPtr Harmony::getAttributes() const - { - return myAttributes; - } +HarmonyChordGroupPtr Harmony::getHarmonyChordGroup(const HarmonyChordGroupSetIterConst &setIterator) const +{ + if (setIterator != myHarmonyChordGroupSet.cend()) + { + return *setIterator; + } + return HarmonyChordGroupPtr(); +} +FramePtr Harmony::getFrame() const +{ + return myFrame; +} - void Harmony::setAttributes( const HarmonyAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +void Harmony::setFrame(const FramePtr &value) +{ + if (value) + { + myFrame = value; + } +} +bool Harmony::getHasFrame() const +{ + return myHasFrame; +} - const HarmonyChordGroupSet& Harmony::getHarmonyChordGroupSet() const - { - return myHarmonyChordGroupSet; - } +void Harmony::setHasFrame(const bool value) +{ + myHasFrame = value; +} +OffsetPtr Harmony::getOffset() const +{ + return myOffset; +} - void Harmony::addHarmonyChordGroup( const HarmonyChordGroupPtr& value ) - { - if ( value ) - { - myHarmonyChordGroupSet.push_back( value ); - } - } +void Harmony::setOffset(const OffsetPtr &value) +{ + if (value) + { + myOffset = value; + } +} +bool Harmony::getHasOffset() const +{ + return myHasOffset; +} - void Harmony::removeHarmonyChordGroup( const HarmonyChordGroupSetIterConst& value ) - { - if ( value != myHarmonyChordGroupSet.cend() ) - { - if( myHarmonyChordGroupSet.size() > 1 ) - { - myHarmonyChordGroupSet.erase( value ); - } - } - } +void Harmony::setHasOffset(const bool value) +{ + myHasOffset = value; +} +EditorialGroupPtr Harmony::getEditorialGroup() const +{ + return myEditorialGroup; +} - void Harmony::clearHarmonyChordGroupSet() - { - myHarmonyChordGroupSet.clear(); - myHarmonyChordGroupSet.push_back( makeHarmonyChordGroup() ); - } +void Harmony::setEditorialGroup(const EditorialGroupPtr &value) +{ + if (value) + { + myEditorialGroup = value; + } +} +StaffPtr Harmony::getStaff() const +{ + return myStaff; +} - HarmonyChordGroupPtr Harmony::getHarmonyChordGroup( const HarmonyChordGroupSetIterConst& setIterator ) const - { - if( setIterator != myHarmonyChordGroupSet.cend() ) - { - return *setIterator; - } - return HarmonyChordGroupPtr(); - } +void Harmony::setStaff(const StaffPtr &value) +{ + if (value) + { + myStaff = value; + } +} +bool Harmony::getHasStaff() const +{ + return myHasStaff; +} - FramePtr Harmony::getFrame() const - { - return myFrame; - } +void Harmony::setHasStaff(const bool value) +{ + myHasStaff = value; +} +bool Harmony::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isChoiceFound = false; + bool isFirstHarmonyChordGroupAdded = false; - void Harmony::setFrame( const FramePtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + const std::string elementName = it->getName(); + if (elementName == "root" || elementName == "function") { - if ( value ) + bool decrementIter = false; + isChoiceFound = true; + auto item = makeHarmonyChordGroup(); + if (elementName == "root") { - myFrame = value; + item->setChoice(HarmonyChordGroup::Choice::root); + isSuccess &= item->getRoot()->fromXElement(message, *it); } - } - - - bool Harmony::getHasFrame() const - { - return myHasFrame; - } - - - void Harmony::setHasFrame( const bool value ) - { - myHasFrame = value; - } - - - OffsetPtr Harmony::getOffset() const - { - return myOffset; - } - - - void Harmony::setOffset( const OffsetPtr& value ) - { - if ( value ) + else { - myOffset = value; + item->setChoice(HarmonyChordGroup::Choice::function); + isSuccess &= item->getFunction()->fromXElement(message, *it); } - } - - - bool Harmony::getHasOffset() const - { - return myHasOffset; - } - - - void Harmony::setHasOffset( const bool value ) - { - myHasOffset = value; - } - - - EditorialGroupPtr Harmony::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void Harmony::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) + decrementIter = true; + ++it; + if (it == endIter || it->getName() != "kind") { - myEditorialGroup = value; + message << "Harmony: 'kind' is a required element and is missing aborting" << std::endl; + return false; + } + isSuccess &= item->getKind()->fromXElement(message, *it); + decrementIter = true; + ++it; + if (it == endIter) + { + addGroup(item, isFirstHarmonyChordGroupAdded); + MX_RETURN_IS_SUCCESS; + } + if (it->getName() == "inversion") + { + isSuccess &= item->getInversion()->fromXElement(message, *it); + item->setHasInversion(true); + decrementIter = true; + ++it; + } + if (it == endIter) + { + addGroup(item, isFirstHarmonyChordGroupAdded); + MX_RETURN_IS_SUCCESS; + } + if (it->getName() == "bass") + { + isSuccess &= item->getBass()->fromXElement(message, *it); + item->setHasBass(true); + decrementIter = true; + ++it; + } + if (it == endIter) + { + addGroup(item, isFirstHarmonyChordGroupAdded); + MX_RETURN_IS_SUCCESS; } - } - - StaffPtr Harmony::getStaff() const - { - return myStaff; - } + while (it != endIter && it->getName() == "degree") + { + auto degree = makeDegree(); + isSuccess &= degree->fromXElement(message, *it); + item->addDegree(degree); + decrementIter = true; + ++it; + } + addGroup(item, isFirstHarmonyChordGroupAdded); - void Harmony::setStaff( const StaffPtr& value ) - { - if ( value ) + if (decrementIter) { - myStaff = value; + --it; } + continue; } - - bool Harmony::getHasStaff() const + if (importElement(message, *it, isSuccess, *myFrame, myHasFrame)) { - return myHasStaff; + continue; } - - - void Harmony::setHasStaff( const bool value ) + if (importElement(message, *it, isSuccess, *myOffset, myHasOffset)) { - myHasStaff = value; + continue; } - - - bool Harmony::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + importGroup(message, it, endIter, isSuccess, myEditorialGroup); + if (importElement(message, *it, isSuccess, *myStaff, myHasStaff)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isChoiceFound = false; - bool isFirstHarmonyChordGroupAdded = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - const std::string elementName = it->getName(); - if( elementName == "root" || elementName == "function" ) - { - bool decrementIter = false; - isChoiceFound = true; - auto item = makeHarmonyChordGroup(); - if( elementName == "root" ) - { - item->setChoice( HarmonyChordGroup::Choice::root ); - isSuccess &= item->getRoot()->fromXElement( message, *it ); - } - else - { - item->setChoice( HarmonyChordGroup::Choice::function ); - isSuccess &= item->getFunction()->fromXElement( message, *it ); - } - decrementIter = true; - ++it; - if( it == endIter || it->getName() != "kind" ) - { - message << "Harmony: 'kind' is a required element and is missing aborting" << std::endl; return false; - } - isSuccess &= item->getKind()->fromXElement( message, *it ); - decrementIter = true; - ++it; - if( it == endIter ) { addGroup( item, isFirstHarmonyChordGroupAdded ); MX_RETURN_IS_SUCCESS; } - if( it->getName() == "inversion" ) - { - isSuccess &= item->getInversion()->fromXElement( message, *it ); - item->setHasInversion( true ); - decrementIter = true; - ++it; - } - if( it == endIter ) { addGroup( item, isFirstHarmonyChordGroupAdded ); MX_RETURN_IS_SUCCESS; } - if( it->getName() == "bass" ) - { - isSuccess &= item->getBass()->fromXElement( message, *it ); - item->setHasBass( true ); - decrementIter = true; - ++it; - } - if( it == endIter ) { addGroup( item, isFirstHarmonyChordGroupAdded ); MX_RETURN_IS_SUCCESS; } - - while( it != endIter && it->getName() == "degree" ) - { - auto degree = makeDegree(); - isSuccess &= degree->fromXElement( message, *it ); - item->addDegree( degree ); - decrementIter = true; - ++it; - } - - addGroup( item, isFirstHarmonyChordGroupAdded ); - - if( decrementIter ) - { - --it; - } - continue; - } - - if ( importElement( message, *it, isSuccess, *myFrame, myHasFrame ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myOffset, myHasOffset ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - if ( importElement( message, *it, isSuccess, *myStaff, myHasStaff ) ) { continue; } - } - - if( !isChoiceFound ) - { - message << "Harmony: either 'root' or 'function' is required but neither was present" << std::endl; - isSuccess = false; - } - - return isSuccess; + continue; } + } - void Harmony::addGroup( HarmonyChordGroupPtr& grp, bool& isFirst ) - { - if( !isFirst && myHarmonyChordGroupSet.size() == 1 ) - { - *myHarmonyChordGroupSet.begin() = grp; - isFirst = true; - } - else - { - myHarmonyChordGroupSet.push_back( grp ); - isFirst = true; - } - } + if (!isChoiceFound) + { + message << "Harmony: either 'root' or 'function' is required but neither was present" << std::endl; + isSuccess = false; + } + + return isSuccess; +} + +void Harmony::addGroup(HarmonyChordGroupPtr &grp, bool &isFirst) +{ + if (!isFirst && myHarmonyChordGroupSet.size() == 1) + { + *myHarmonyChordGroupSet.begin() = grp; + isFirst = true; + } + else + { + myHarmonyChordGroupSet.push_back(grp); + isFirst = true; } } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Harmony.h b/Sourcecode/private/mx/core/elements/Harmony.h index 9230b6c33..01dd3c85b 100644 --- a/Sourcecode/private/mx/core/elements/Harmony.h +++ b/Sourcecode/private/mx/core/elements/Harmony.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/HarmonyAttributes.h" #include @@ -14,76 +14,79 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarmonyAttributes ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Frame ) - MX_FORWARD_DECLARE_ELEMENT( HarmonyChordGroup ) - MX_FORWARD_DECLARE_ELEMENT( Offset ) - MX_FORWARD_DECLARE_ELEMENT( Staff ) - MX_FORWARD_DECLARE_ELEMENT( Harmony ) - - inline HarmonyPtr makeHarmony() { return std::make_shared(); } - - class Harmony : public ElementInterface - { - public: - Harmony(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HarmonyAttributesPtr getAttributes() const; - void setAttributes( const HarmonyAttributesPtr& value ); - - /* _________ HarmonyChordGroup minOccurs = 1, maxOccurs = unbounded _________ */ - const HarmonyChordGroupSet& getHarmonyChordGroupSet() const; - void addHarmonyChordGroup( const HarmonyChordGroupPtr& value ); - void removeHarmonyChordGroup( const HarmonyChordGroupSetIterConst& value ); - void clearHarmonyChordGroupSet(); - HarmonyChordGroupPtr getHarmonyChordGroup( const HarmonyChordGroupSetIterConst& setIterator ) const; - - /* _________ Frame minOccurs = 0, maxOccurs = 1 _________ */ - FramePtr getFrame() const; - void setFrame( const FramePtr& value ); - bool getHasFrame() const; - void setHasFrame( const bool value ); - - /* _________ Offset minOccurs = 0, maxOccurs = 1 _________ */ - OffsetPtr getOffset() const; - void setOffset( const OffsetPtr& value ); - bool getHasOffset() const; - void setHasOffset( const bool value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ - StaffPtr getStaff() const; - void setStaff( const StaffPtr& value ); - bool getHasStaff() const; - void setHasStaff( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HarmonyAttributesPtr myAttributes; - HarmonyChordGroupSet myHarmonyChordGroupSet; - FramePtr myFrame; - bool myHasFrame; - OffsetPtr myOffset; - bool myHasOffset; - EditorialGroupPtr myEditorialGroup; - StaffPtr myStaff; - bool myHasStaff; - - void addGroup( HarmonyChordGroupPtr& grp, bool& isFirst ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(HarmonyAttributes) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) +MX_FORWARD_DECLARE_ELEMENT(Frame) +MX_FORWARD_DECLARE_ELEMENT(HarmonyChordGroup) +MX_FORWARD_DECLARE_ELEMENT(Offset) +MX_FORWARD_DECLARE_ELEMENT(Staff) +MX_FORWARD_DECLARE_ELEMENT(Harmony) + +inline HarmonyPtr makeHarmony() +{ + return std::make_shared(); } + +class Harmony : public ElementInterface +{ + public: + Harmony(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HarmonyAttributesPtr getAttributes() const; + void setAttributes(const HarmonyAttributesPtr &value); + + /* _________ HarmonyChordGroup minOccurs = 1, maxOccurs = unbounded _________ */ + const HarmonyChordGroupSet &getHarmonyChordGroupSet() const; + void addHarmonyChordGroup(const HarmonyChordGroupPtr &value); + void removeHarmonyChordGroup(const HarmonyChordGroupSetIterConst &value); + void clearHarmonyChordGroupSet(); + HarmonyChordGroupPtr getHarmonyChordGroup(const HarmonyChordGroupSetIterConst &setIterator) const; + + /* _________ Frame minOccurs = 0, maxOccurs = 1 _________ */ + FramePtr getFrame() const; + void setFrame(const FramePtr &value); + bool getHasFrame() const; + void setHasFrame(const bool value); + + /* _________ Offset minOccurs = 0, maxOccurs = 1 _________ */ + OffsetPtr getOffset() const; + void setOffset(const OffsetPtr &value); + bool getHasOffset() const; + void setHasOffset(const bool value); + + /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialGroupPtr getEditorialGroup() const; + void setEditorialGroup(const EditorialGroupPtr &value); + + /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ + StaffPtr getStaff() const; + void setStaff(const StaffPtr &value); + bool getHasStaff() const; + void setHasStaff(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + HarmonyAttributesPtr myAttributes; + HarmonyChordGroupSet myHarmonyChordGroupSet; + FramePtr myFrame; + bool myHasFrame; + OffsetPtr myOffset; + bool myHasOffset; + EditorialGroupPtr myEditorialGroup; + StaffPtr myStaff; + bool myHasStaff; + + void addGroup(HarmonyChordGroupPtr &grp, bool &isFirst); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp b/Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp index 37d98b41a..47a070b2a 100644 --- a/Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp @@ -8,106 +8,111 @@ namespace mx { - namespace core +namespace core +{ +HarmonyAttributes::HarmonyAttributes() + : type(), printObject(YesNo::no), printFrame(YesNo::no), defaultX(), defaultY(), relativeX(), relativeY(), + fontFamily(), fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), + color(), placement(AboveBelow::below), hasType(false), hasPrintObject(false), hasPrintFrame(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasPlacement(false) +{ +} + +bool HarmonyAttributes::hasValues() const +{ + return hasType || hasPrintObject || hasPrintFrame || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || + hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasColor || hasPlacement; +} + +std::ostream &HarmonyAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - HarmonyAttributes::HarmonyAttributes() - :type() - ,printObject( YesNo::no ) - ,printFrame( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasType( false ) - ,hasPrintObject( false ) - ,hasPrintFrame( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, printFrame, "print-frame", hasPrintFrame); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} +bool HarmonyAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "HarmonyAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool HarmonyAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type", &parseHarmonyType)) { - return hasType || - hasPrintObject || - hasPrintFrame || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; + continue; } - - - std::ostream& HarmonyAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, printFrame, "print-frame", hasPrintFrame ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool HarmonyAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, printFrame, hasPrintFrame, "print-frame", &parseYesNo)) { - const char* const className = "HarmonyAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseHarmonyType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printFrame, hasPrintFrame, "print-frame", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonyAttributes.h b/Sourcecode/private/mx/core/elements/HarmonyAttributes.h index e92a115f5..73afefe6d 100644 --- a/Sourcecode/private/mx/core/elements/HarmonyAttributes.h +++ b/Sourcecode/private/mx/core/elements/HarmonyAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,46 +18,46 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HarmonyAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(HarmonyAttributes) - struct HarmonyAttributes : public AttributesInterface - { - public: - HarmonyAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - HarmonyType type; - YesNo printObject; - YesNo printFrame; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasType; - bool hasPrintObject; - bool hasPrintFrame; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; +struct HarmonyAttributes : public AttributesInterface +{ + public: + HarmonyAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + HarmonyType type; + YesNo printObject; + YesNo printFrame; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + bool hasType; + bool hasPrintObject; + bool hasPrintFrame; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp b/Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp index 8b28a2d23..6c074bc6c 100644 --- a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp +++ b/Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp @@ -14,232 +14,199 @@ namespace mx { - namespace core - { - HarmonyChordGroup::HarmonyChordGroup() - :myChoice( Choice::root ) - ,myRoot( makeRoot() ) - ,myFunction( makeFunction() ) - ,myKind( makeKind() ) - ,myInversion( makeInversion() ) - ,myHasInversion( false ) - ,myBass( makeBass() ) - ,myHasBass( false ) - ,myDegreeSet() - {} - - - bool HarmonyChordGroup::hasAttributes() const - { - return false; - } - - - std::ostream& HarmonyChordGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HarmonyChordGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool HarmonyChordGroup::hasContents() const - { - return true; - } - - - std::ostream& HarmonyChordGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::root: - myRoot->toStream( os, indentLevel ); - break; - case Choice::function: - myFunction->toStream( os, indentLevel ); - break; - default: - break; - } - os << std::endl; - myKind->toStream( os, indentLevel ); - if ( myHasInversion ) - { - os << std::endl; - myInversion->toStream( os, indentLevel ); - } - if ( myHasBass ) - { - os << std::endl; - myBass->toStream( os, indentLevel ); - } - for ( auto x : myDegreeSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - isOneLineOnly = false; - return os; - } - - - HarmonyChordGroup::Choice HarmonyChordGroup::getChoice() const - { - return myChoice; - } - - - void HarmonyChordGroup::setChoice( const HarmonyChordGroup::Choice value ) - { - myChoice = value; - } - - - RootPtr HarmonyChordGroup::getRoot() const - { - return myRoot; - } - - - void HarmonyChordGroup::setRoot( const RootPtr& value ) - { - if ( value ) - { - myRoot = value; - } - } - - - FunctionPtr HarmonyChordGroup::getFunction() const - { - return myFunction; - } - - - void HarmonyChordGroup::setFunction( const FunctionPtr& value ) - { - if ( value ) - { - myFunction = value; - } - } - - - KindPtr HarmonyChordGroup::getKind() const - { - return myKind; - } - - - void HarmonyChordGroup::setKind( const KindPtr& value ) - { - if ( value ) - { - myKind = value; - } - } - - - InversionPtr HarmonyChordGroup::getInversion() const - { - return myInversion; - } - +namespace core +{ +HarmonyChordGroup::HarmonyChordGroup() + : myChoice(Choice::root), myRoot(makeRoot()), myFunction(makeFunction()), myKind(makeKind()), + myInversion(makeInversion()), myHasInversion(false), myBass(makeBass()), myHasBass(false), myDegreeSet() +{ +} - void HarmonyChordGroup::setInversion( const InversionPtr& value ) - { - if ( value ) - { - myInversion = value; - } - } +bool HarmonyChordGroup::hasAttributes() const +{ + return false; +} +std::ostream &HarmonyChordGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - bool HarmonyChordGroup::getHasInversion() const - { - return myHasInversion; - } +std::ostream &HarmonyChordGroup::streamName(std::ostream &os) const +{ + return os; +} +bool HarmonyChordGroup::hasContents() const +{ + return true; +} - void HarmonyChordGroup::setHasInversion( const bool value ) - { - myHasInversion = value; - } +std::ostream &HarmonyChordGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::root: + myRoot->toStream(os, indentLevel); + break; + case Choice::function: + myFunction->toStream(os, indentLevel); + break; + default: + break; + } + os << std::endl; + myKind->toStream(os, indentLevel); + if (myHasInversion) + { + os << std::endl; + myInversion->toStream(os, indentLevel); + } + if (myHasBass) + { + os << std::endl; + myBass->toStream(os, indentLevel); + } + for (auto x : myDegreeSet) + { + os << std::endl; + x->toStream(os, indentLevel); + } + isOneLineOnly = false; + return os; +} +HarmonyChordGroup::Choice HarmonyChordGroup::getChoice() const +{ + return myChoice; +} - BassPtr HarmonyChordGroup::getBass() const - { - return myBass; - } +void HarmonyChordGroup::setChoice(const HarmonyChordGroup::Choice value) +{ + myChoice = value; +} +RootPtr HarmonyChordGroup::getRoot() const +{ + return myRoot; +} - void HarmonyChordGroup::setBass( const BassPtr& value ) - { - if ( value ) - { - myBass = value; - } - } +void HarmonyChordGroup::setRoot(const RootPtr &value) +{ + if (value) + { + myRoot = value; + } +} +FunctionPtr HarmonyChordGroup::getFunction() const +{ + return myFunction; +} - bool HarmonyChordGroup::getHasBass() const - { - return myHasBass; - } +void HarmonyChordGroup::setFunction(const FunctionPtr &value) +{ + if (value) + { + myFunction = value; + } +} +KindPtr HarmonyChordGroup::getKind() const +{ + return myKind; +} - void HarmonyChordGroup::setHasBass( const bool value ) - { - myHasBass = value; - } +void HarmonyChordGroup::setKind(const KindPtr &value) +{ + if (value) + { + myKind = value; + } +} +InversionPtr HarmonyChordGroup::getInversion() const +{ + return myInversion; +} - const DegreeSet& HarmonyChordGroup::getDegreeSet() const - { - return myDegreeSet; - } +void HarmonyChordGroup::setInversion(const InversionPtr &value) +{ + if (value) + { + myInversion = value; + } +} +bool HarmonyChordGroup::getHasInversion() const +{ + return myHasInversion; +} - void HarmonyChordGroup::addDegree( const DegreePtr& value ) - { - if ( value ) - { - myDegreeSet.push_back( value ); - } - } +void HarmonyChordGroup::setHasInversion(const bool value) +{ + myHasInversion = value; +} +BassPtr HarmonyChordGroup::getBass() const +{ + return myBass; +} - void HarmonyChordGroup::removeDegree( const DegreeSetIterConst& value ) - { - if ( value != myDegreeSet.cend() ) - { - myDegreeSet.erase( value ); - } - } +void HarmonyChordGroup::setBass(const BassPtr &value) +{ + if (value) + { + myBass = value; + } +} +bool HarmonyChordGroup::getHasBass() const +{ + return myHasBass; +} - void HarmonyChordGroup::clearDegreeSet() - { - myDegreeSet.clear(); - } +void HarmonyChordGroup::setHasBass(const bool value) +{ + myHasBass = value; +} +const DegreeSet &HarmonyChordGroup::getDegreeSet() const +{ + return myDegreeSet; +} - DegreePtr HarmonyChordGroup::getDegree( const DegreeSetIterConst& setIterator ) const - { - if( setIterator != myDegreeSet.cend() ) - { - return *setIterator; - } - return DegreePtr(); - } +void HarmonyChordGroup::addDegree(const DegreePtr &value) +{ + if (value) + { + myDegreeSet.push_back(value); + } +} +void HarmonyChordGroup::removeDegree(const DegreeSetIterConst &value) +{ + if (value != myDegreeSet.cend()) + { + myDegreeSet.erase(value); + } +} - MX_FROM_XELEMENT_UNUSED( HarmonyChordGroup ); +void HarmonyChordGroup::clearDegreeSet() +{ + myDegreeSet.clear(); +} +DegreePtr HarmonyChordGroup::getDegree(const DegreeSetIterConst &setIterator) const +{ + if (setIterator != myDegreeSet.cend()) + { + return *setIterator; } + return DegreePtr(); } + +MX_FROM_XELEMENT_UNUSED(HarmonyChordGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.h b/Sourcecode/private/mx/core/elements/HarmonyChordGroup.h index 1aa8fd735..2cd726436 100644 --- a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.h +++ b/Sourcecode/private/mx/core/elements/HarmonyChordGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,81 +13,84 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Bass) +MX_FORWARD_DECLARE_ELEMENT(Degree) +MX_FORWARD_DECLARE_ELEMENT(Function) +MX_FORWARD_DECLARE_ELEMENT(Inversion) +MX_FORWARD_DECLARE_ELEMENT(Kind) +MX_FORWARD_DECLARE_ELEMENT(Root) +MX_FORWARD_DECLARE_ELEMENT(HarmonyChordGroup) - MX_FORWARD_DECLARE_ELEMENT( Bass ) - MX_FORWARD_DECLARE_ELEMENT( Degree ) - MX_FORWARD_DECLARE_ELEMENT( Function ) - MX_FORWARD_DECLARE_ELEMENT( Inversion ) - MX_FORWARD_DECLARE_ELEMENT( Kind ) - MX_FORWARD_DECLARE_ELEMENT( Root ) - MX_FORWARD_DECLARE_ELEMENT( HarmonyChordGroup ) - - inline HarmonyChordGroupPtr makeHarmonyChordGroup() { return std::make_shared(); } - - class HarmonyChordGroup : public ElementInterface - { - public: - enum class Choice - { - root = 1, - function = 2 - }; - HarmonyChordGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HarmonyChordGroup::Choice getChoice() const; - void setChoice( const HarmonyChordGroup::Choice value ); - - /* _________ Root minOccurs = 1, maxOccurs = 1 _________ */ - RootPtr getRoot() const; - void setRoot( const RootPtr& value ); - - /* _________ Function minOccurs = 1, maxOccurs = 1 _________ */ - FunctionPtr getFunction() const; - void setFunction( const FunctionPtr& value ); - - /* _________ Kind minOccurs = 1, maxOccurs = 1 _________ */ - KindPtr getKind() const; - void setKind( const KindPtr& value ); - - /* _________ Inversion minOccurs = 0, maxOccurs = 1 _________ */ - InversionPtr getInversion() const; - void setInversion( const InversionPtr& value ); - bool getHasInversion() const; - void setHasInversion( const bool value ); - - /* _________ Bass minOccurs = 0, maxOccurs = 1 _________ */ - BassPtr getBass() const; - void setBass( const BassPtr& value ); - bool getHasBass() const; - void setHasBass( const bool value ); - - /* _________ Degree minOccurs = 0, maxOccurs = unbounded _________ */ - const DegreeSet& getDegreeSet() const; - void addDegree( const DegreePtr& value ); - void removeDegree( const DegreeSetIterConst& value ); - void clearDegreeSet(); - DegreePtr getDegree( const DegreeSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - RootPtr myRoot; - FunctionPtr myFunction; - KindPtr myKind; - InversionPtr myInversion; - bool myHasInversion; - BassPtr myBass; - bool myHasBass; - DegreeSet myDegreeSet; - }; - } +inline HarmonyChordGroupPtr makeHarmonyChordGroup() +{ + return std::make_shared(); } + +class HarmonyChordGroup : public ElementInterface +{ + public: + enum class Choice + { + root = 1, + function = 2 + }; + HarmonyChordGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HarmonyChordGroup::Choice getChoice() const; + void setChoice(const HarmonyChordGroup::Choice value); + + /* _________ Root minOccurs = 1, maxOccurs = 1 _________ */ + RootPtr getRoot() const; + void setRoot(const RootPtr &value); + + /* _________ Function minOccurs = 1, maxOccurs = 1 _________ */ + FunctionPtr getFunction() const; + void setFunction(const FunctionPtr &value); + + /* _________ Kind minOccurs = 1, maxOccurs = 1 _________ */ + KindPtr getKind() const; + void setKind(const KindPtr &value); + + /* _________ Inversion minOccurs = 0, maxOccurs = 1 _________ */ + InversionPtr getInversion() const; + void setInversion(const InversionPtr &value); + bool getHasInversion() const; + void setHasInversion(const bool value); + + /* _________ Bass minOccurs = 0, maxOccurs = 1 _________ */ + BassPtr getBass() const; + void setBass(const BassPtr &value); + bool getHasBass() const; + void setHasBass(const bool value); + + /* _________ Degree minOccurs = 0, maxOccurs = unbounded _________ */ + const DegreeSet &getDegreeSet() const; + void addDegree(const DegreePtr &value); + void removeDegree(const DegreeSetIterConst &value); + void clearDegreeSet(); + DegreePtr getDegree(const DegreeSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + RootPtr myRoot; + FunctionPtr myFunction; + KindPtr myKind; + InversionPtr myInversion; + bool myHasInversion; + BassPtr myBass; + bool myHasBass; + DegreeSet myDegreeSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarpPedals.cpp b/Sourcecode/private/mx/core/elements/HarpPedals.cpp index d42863810..b3957b91f 100644 --- a/Sourcecode/private/mx/core/elements/HarpPedals.cpp +++ b/Sourcecode/private/mx/core/elements/HarpPedals.cpp @@ -9,126 +9,111 @@ namespace mx { - namespace core - { - HarpPedals::HarpPedals() - :myAttributes( std::make_shared() ) - ,myPedalTuningSet() - { - myPedalTuningSet.push_back( makePedalTuning() ); - } - - - bool HarpPedals::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& HarpPedals::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& HarpPedals::streamName( std::ostream& os ) const - { - os << "harp-pedals"; - return os; - } - - - bool HarpPedals::hasContents() const - { - return true; - } - - - std::ostream& HarpPedals::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - for ( auto x : myPedalTuningSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - HarpPedalsAttributesPtr HarpPedals::getAttributes() const - { - return myAttributes; - } - - - void HarpPedals::setAttributes( const HarpPedalsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - +namespace core +{ +HarpPedals::HarpPedals() : myAttributes(std::make_shared()), myPedalTuningSet() +{ + myPedalTuningSet.push_back(makePedalTuning()); +} - const PedalTuningSet& HarpPedals::getPedalTuningSet() const - { - return myPedalTuningSet; - } +bool HarpPedals::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &HarpPedals::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void HarpPedals::removePedalTuning( const PedalTuningSetIterConst& value ) - { - if ( value != myPedalTuningSet.cend() ) - { - if ( myPedalTuningSet.size() > 1 ) - { - myPedalTuningSet.erase( value ); - } - } - } +std::ostream &HarpPedals::streamName(std::ostream &os) const +{ + os << "harp-pedals"; + return os; +} +bool HarpPedals::hasContents() const +{ + return true; +} - void HarpPedals::addPedalTuning( const PedalTuningPtr& value ) - { - if ( value ) - { - myPedalTuningSet.push_back( value ); - } - } +std::ostream &HarpPedals::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + for (auto x : myPedalTuningSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + os << std::endl; + return os; +} +HarpPedalsAttributesPtr HarpPedals::getAttributes() const +{ + return myAttributes; +} - void HarpPedals::clearPedalTuningSet() - { - myPedalTuningSet.clear(); - myPedalTuningSet.push_back( makePedalTuning() ); - } +void HarpPedals::setAttributes(const HarpPedalsAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +const PedalTuningSet &HarpPedals::getPedalTuningSet() const +{ + return myPedalTuningSet; +} - PedalTuningPtr HarpPedals::getPedalTuning( const PedalTuningSetIterConst& setIterator ) const +void HarpPedals::removePedalTuning(const PedalTuningSetIterConst &value) +{ + if (value != myPedalTuningSet.cend()) + { + if (myPedalTuningSet.size() > 1) { - if( setIterator != myPedalTuningSet.cend() ) - { - return *setIterator; - } - return PedalTuningPtr(); + myPedalTuningSet.erase(value); } + } +} +void HarpPedals::addPedalTuning(const PedalTuningPtr &value) +{ + if (value) + { + myPedalTuningSet.push_back(value); + } +} - bool HarpPedals::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); +void HarpPedals::clearPedalTuningSet() +{ + myPedalTuningSet.clear(); + myPedalTuningSet.push_back(makePedalTuning()); +} - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "pedal-tuning", myPedalTuningSet ); - } +PedalTuningPtr HarpPedals::getPedalTuning(const PedalTuningSetIterConst &setIterator) const +{ + if (setIterator != myPedalTuningSet.cend()) + { + return *setIterator; + } + return PedalTuningPtr(); +} - MX_RETURN_IS_SUCCESS; - } +bool HarpPedals::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importElementSet(message, it, endIter, isSuccess, "pedal-tuning", myPedalTuningSet); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarpPedals.h b/Sourcecode/private/mx/core/elements/HarpPedals.h index 9ea3499bb..c4ed57d17 100644 --- a/Sourcecode/private/mx/core/elements/HarpPedals.h +++ b/Sourcecode/private/mx/core/elements/HarpPedals.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/HarpPedalsAttributes.h" #include @@ -14,41 +14,44 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarpPedalsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PedalTuning ) - MX_FORWARD_DECLARE_ELEMENT( HarpPedals ) - - inline HarpPedalsPtr makeHarpPedals() { return std::make_shared(); } - - class HarpPedals : public ElementInterface - { - public: - HarpPedals(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HarpPedalsAttributesPtr getAttributes() const; - void setAttributes( const HarpPedalsAttributesPtr& value ); - - /* _________ PedalTuning minOccurs = 1, maxOccurs = unbounded _________ */ - const PedalTuningSet& getPedalTuningSet() const; - void addPedalTuning( const PedalTuningPtr& value ); - void removePedalTuning( const PedalTuningSetIterConst& value ); - void clearPedalTuningSet(); - PedalTuningPtr getPedalTuning( const PedalTuningSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HarpPedalsAttributesPtr myAttributes; - PedalTuningSet myPedalTuningSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(HarpPedalsAttributes) +MX_FORWARD_DECLARE_ELEMENT(PedalTuning) +MX_FORWARD_DECLARE_ELEMENT(HarpPedals) + +inline HarpPedalsPtr makeHarpPedals() +{ + return std::make_shared(); } + +class HarpPedals : public ElementInterface +{ + public: + HarpPedals(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HarpPedalsAttributesPtr getAttributes() const; + void setAttributes(const HarpPedalsAttributesPtr &value); + + /* _________ PedalTuning minOccurs = 1, maxOccurs = unbounded _________ */ + const PedalTuningSet &getPedalTuningSet() const; + void addPedalTuning(const PedalTuningPtr &value); + void removePedalTuning(const PedalTuningSetIterConst &value); + void clearPedalTuningSet(); + PedalTuningPtr getPedalTuning(const PedalTuningSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + HarpPedalsAttributesPtr myAttributes; + PedalTuningSet myPedalTuningSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp b/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp index 47b13ea9e..34316d695 100644 --- a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp @@ -8,96 +8,100 @@ namespace mx { - namespace core +namespace core +{ +HarpPedalsAttributes::HarpPedalsAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), halign(LeftCenterRight::center), valign(), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasHalign(false), hasValign(false) +{ +} + +bool HarpPedalsAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasHalign || hasValign; +} + +std::ostream &HarpPedalsAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - HarpPedalsAttributes::HarpPedalsAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign( LeftCenterRight::center ) - ,valign() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, valign, "valign", hasValign); + } + return os; +} + +bool HarpPedalsAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "HarpPedalsAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool HarpPedalsAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign; + continue; } - - - std::ostream& HarpPedalsAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - } - return os; + continue; } - - - bool HarpPedalsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "HarpPedalsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, valign, hasValign, "valign", &parseValign)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h b/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h index 39a1ab557..3b44ccb15 100644 --- a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h +++ b/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,42 +18,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HarpPedalsAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(HarpPedalsAttributes) - struct HarpPedalsAttributes : public AttributesInterface - { - public: - HarpPedalsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; +struct HarpPedalsAttributes : public AttributesInterface +{ + public: + HarpPedalsAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + LeftCenterRight halign; + Valign valign; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasHalign; + bool hasValign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Heel.cpp b/Sourcecode/private/mx/core/elements/Heel.cpp index da7125b83..7149d470e 100644 --- a/Sourcecode/private/mx/core/elements/Heel.cpp +++ b/Sourcecode/private/mx/core/elements/Heel.cpp @@ -8,65 +8,57 @@ namespace mx { - namespace core - { - Heel::Heel() - :myAttributes( std::make_shared() ) - {} - - - bool Heel::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Heel::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Heel::streamName( std::ostream& os ) const - { - os << "heel"; - return os; - } - - - bool Heel::hasContents() const - { - return false; - } - - - std::ostream& Heel::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Heel::Heel() : myAttributes(std::make_shared()) +{ +} +bool Heel::hasAttributes() const +{ + return myAttributes->hasValues(); +} - HeelAttributesPtr Heel::getAttributes() const - { - return myAttributes; - } +std::ostream &Heel::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Heel::streamName(std::ostream &os) const +{ + os << "heel"; + return os; +} - void Heel::setAttributes( const HeelAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool Heel::hasContents() const +{ + return false; +} +std::ostream &Heel::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Heel::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +HeelAttributesPtr Heel::getAttributes() const +{ + return myAttributes; +} +void Heel::setAttributes(const HeelAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Heel::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Heel.h b/Sourcecode/private/mx/core/elements/Heel.h index 067d770a3..684f3170b 100644 --- a/Sourcecode/private/mx/core/elements/Heel.h +++ b/Sourcecode/private/mx/core/elements/Heel.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/HeelAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HeelAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Heel ) - - inline HeelPtr makeHeel() { return std::make_shared(); } - - class Heel : public ElementInterface - { - public: - Heel(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HeelAttributesPtr getAttributes() const; - void setAttributes( const HeelAttributesPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HeelAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(HeelAttributes) +MX_FORWARD_DECLARE_ELEMENT(Heel) + +inline HeelPtr makeHeel() +{ + return std::make_shared(); } + +class Heel : public ElementInterface +{ + public: + Heel(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HeelAttributesPtr getAttributes() const; + void setAttributes(const HeelAttributesPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + HeelAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HeelAttributes.cpp b/Sourcecode/private/mx/core/elements/HeelAttributes.cpp index f6f1bfbc3..4c8542979 100644 --- a/Sourcecode/private/mx/core/elements/HeelAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/HeelAttributes.cpp @@ -8,96 +8,102 @@ namespace mx { - namespace core +namespace core +{ +HeelAttributes::HeelAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), placement(AboveBelow::below), + substitution(YesNo::no), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), + hasPlacement(false), hasSubstitution(false) +{ +} + +bool HeelAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPlacement || hasSubstitution; +} + +std::ostream &HeelAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - HeelAttributes::HeelAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,substitution( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - ,hasSubstitution( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, substitution, "substitution", hasSubstitution); + } + return os; +} + +bool HeelAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "HeelAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool HeelAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement || - hasSubstitution; + continue; } - - - std::ostream& HeelAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, substitution, "substitution", hasSubstitution ); - } - return os; + continue; } - - - bool HeelAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "HeelAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, substitution, hasSubstitution, "substitution", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, substitution, hasSubstitution, "substitution", + &parseYesNo)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HeelAttributes.h b/Sourcecode/private/mx/core/elements/HeelAttributes.h index 691d5e0fc..7c46d4c7c 100644 --- a/Sourcecode/private/mx/core/elements/HeelAttributes.h +++ b/Sourcecode/private/mx/core/elements/HeelAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,42 +18,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HeelAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(HeelAttributes) - struct HeelAttributes : public AttributesInterface - { - public: - HeelAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - YesNo substitution; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - bool hasSubstitution; +struct HeelAttributes : public AttributesInterface +{ + public: + HeelAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + YesNo substitution; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; + bool hasSubstitution; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Hole.cpp b/Sourcecode/private/mx/core/elements/Hole.cpp index f8c7344b1..a37723650 100644 --- a/Sourcecode/private/mx/core/elements/Hole.cpp +++ b/Sourcecode/private/mx/core/elements/Hole.cpp @@ -11,167 +11,155 @@ namespace mx { - namespace core - { - Hole::Hole() - :myAttributes( std::make_shared() ) - ,myHoleType( makeHoleType() ) - ,myHasHoleType( false ) - ,myHoleClosed( makeHoleClosed() ) - ,myHoleShape( makeHoleShape() ) - ,myHasHoleShape( false ) - {} - - - bool Hole::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Hole::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Hole::streamName( std::ostream& os ) const - { - os << "hole"; - return os; - } - - - bool Hole::hasContents() const - { - return true; - } - - - std::ostream& Hole::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasHoleType ) - { - os << std::endl; - myHoleType->toStream( os, indentLevel+1 ); - } - os << std::endl; - myHoleClosed->toStream( os, indentLevel+1 ); - if ( myHasHoleShape ) - { - os << std::endl; - myHoleShape->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - HoleAttributesPtr Hole::getAttributes() const - { - return myAttributes; - } - +namespace core +{ +Hole::Hole() + : myAttributes(std::make_shared()), myHoleType(makeHoleType()), myHasHoleType(false), + myHoleClosed(makeHoleClosed()), myHoleShape(makeHoleShape()), myHasHoleShape(false) +{ +} - void Hole::setAttributes( const HoleAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool Hole::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Hole::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - HoleTypePtr Hole::getHoleType() const - { - return myHoleType; - } +std::ostream &Hole::streamName(std::ostream &os) const +{ + os << "hole"; + return os; +} +bool Hole::hasContents() const +{ + return true; +} - void Hole::setHoleType( const HoleTypePtr& value ) - { - if( value ) - { - myHoleType = value; - } - } +std::ostream &Hole::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasHoleType) + { + os << std::endl; + myHoleType->toStream(os, indentLevel + 1); + } + os << std::endl; + myHoleClosed->toStream(os, indentLevel + 1); + if (myHasHoleShape) + { + os << std::endl; + myHoleShape->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} +HoleAttributesPtr Hole::getAttributes() const +{ + return myAttributes; +} - bool Hole::getHasHoleType() const - { - return myHasHoleType; - } +void Hole::setAttributes(const HoleAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +HoleTypePtr Hole::getHoleType() const +{ + return myHoleType; +} - void Hole::setHasHoleType( const bool value ) - { - myHasHoleType = value; - } +void Hole::setHoleType(const HoleTypePtr &value) +{ + if (value) + { + myHoleType = value; + } +} +bool Hole::getHasHoleType() const +{ + return myHasHoleType; +} - HoleClosedPtr Hole::getHoleClosed() const - { - return myHoleClosed; - } +void Hole::setHasHoleType(const bool value) +{ + myHasHoleType = value; +} +HoleClosedPtr Hole::getHoleClosed() const +{ + return myHoleClosed; +} - void Hole::setHoleClosed( const HoleClosedPtr& value ) - { - if( value ) - { - myHoleClosed = value; - } - } +void Hole::setHoleClosed(const HoleClosedPtr &value) +{ + if (value) + { + myHoleClosed = value; + } +} +HoleShapePtr Hole::getHoleShape() const +{ + return myHoleShape; +} - HoleShapePtr Hole::getHoleShape() const - { - return myHoleShape; - } +void Hole::setHoleShape(const HoleShapePtr &value) +{ + if (value) + { + myHoleShape = value; + } +} +bool Hole::getHasHoleShape() const +{ + return myHasHoleShape; +} - void Hole::setHoleShape( const HoleShapePtr& value ) - { - if( value ) - { - myHoleShape = value; - } - } +void Hole::setHasHoleShape(const bool value) +{ + myHasHoleShape = value; +} +bool Hole::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isHoleClosedFound = false; - bool Hole::getHasHoleShape() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myHoleType, myHasHoleType)) { - return myHasHoleShape; + continue; } - - - void Hole::setHasHoleShape( const bool value ) + if (importElement(message, *it, isSuccess, *myHoleClosed, isHoleClosedFound)) { - myHasHoleShape = value; + continue; } - - - bool Hole::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myHoleShape, myHasHoleShape)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isHoleClosedFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myHoleType, myHasHoleType ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myHoleClosed, isHoleClosedFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myHoleShape, myHasHoleShape ) ) { continue; } - } - - if( !isHoleClosedFound ) - { - message << "Hole: '" << myHoleClosed->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isHoleClosedFound) + { + message << "Hole: '" << myHoleClosed->getElementName() << "' is required but was not found" << std::endl; } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Hole.h b/Sourcecode/private/mx/core/elements/Hole.h index 89ae7901a..a8ee024b2 100644 --- a/Sourcecode/private/mx/core/elements/Hole.h +++ b/Sourcecode/private/mx/core/elements/Hole.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/HoleAttributes.h" #include @@ -14,56 +14,59 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HoleAttributes ) - MX_FORWARD_DECLARE_ELEMENT( HoleClosed ) - MX_FORWARD_DECLARE_ELEMENT( HoleShape ) - MX_FORWARD_DECLARE_ELEMENT( HoleType ) - MX_FORWARD_DECLARE_ELEMENT( Hole ) +MX_FORWARD_DECLARE_ATTRIBUTES(HoleAttributes) +MX_FORWARD_DECLARE_ELEMENT(HoleClosed) +MX_FORWARD_DECLARE_ELEMENT(HoleShape) +MX_FORWARD_DECLARE_ELEMENT(HoleType) +MX_FORWARD_DECLARE_ELEMENT(Hole) - inline HolePtr makeHole() { return std::make_shared(); } +inline HolePtr makeHole() +{ + return std::make_shared(); +} - class Hole : public ElementInterface - { - public: - Hole(); +class Hole : public ElementInterface +{ + public: + Hole(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HoleAttributesPtr getAttributes() const; - void setAttributes( const HoleAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HoleAttributesPtr getAttributes() const; + void setAttributes(const HoleAttributesPtr &value); - /* _________ HoleType minOccurs = 0, maxOccurs = 1 _________ */ - HoleTypePtr getHoleType() const; - void setHoleType( const HoleTypePtr& value ); - bool getHasHoleType() const; - void setHasHoleType( const bool value ); + /* _________ HoleType minOccurs = 0, maxOccurs = 1 _________ */ + HoleTypePtr getHoleType() const; + void setHoleType(const HoleTypePtr &value); + bool getHasHoleType() const; + void setHasHoleType(const bool value); - /* _________ HoleClosed minOccurs = 1, maxOccurs = 1 _________ */ - HoleClosedPtr getHoleClosed() const; - void setHoleClosed( const HoleClosedPtr& value ); + /* _________ HoleClosed minOccurs = 1, maxOccurs = 1 _________ */ + HoleClosedPtr getHoleClosed() const; + void setHoleClosed(const HoleClosedPtr &value); - /* _________ HoleShape minOccurs = 0, maxOccurs = 1 _________ */ - HoleShapePtr getHoleShape() const; - void setHoleShape( const HoleShapePtr& value ); - bool getHasHoleShape() const; - void setHasHoleShape( const bool value ); + /* _________ HoleShape minOccurs = 0, maxOccurs = 1 _________ */ + HoleShapePtr getHoleShape() const; + void setHoleShape(const HoleShapePtr &value); + bool getHasHoleShape() const; + void setHasHoleShape(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - HoleAttributesPtr myAttributes; - HoleTypePtr myHoleType; - bool myHasHoleType; - HoleClosedPtr myHoleClosed; - HoleShapePtr myHoleShape; - bool myHasHoleShape; - }; - } -} + private: + HoleAttributesPtr myAttributes; + HoleTypePtr myHoleType; + bool myHasHoleType; + HoleClosedPtr myHoleClosed; + HoleShapePtr myHoleShape; + bool myHasHoleShape; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleAttributes.cpp b/Sourcecode/private/mx/core/elements/HoleAttributes.cpp index d24cbc772..7887e308b 100644 --- a/Sourcecode/private/mx/core/elements/HoleAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/HoleAttributes.cpp @@ -8,91 +8,95 @@ namespace mx { - namespace core +namespace core +{ +HoleAttributes::HoleAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), placement(AboveBelow::below), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasPlacement(false) +{ +} + +bool HoleAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPlacement; +} + +std::ostream &HoleAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - HoleAttributes::HoleAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool HoleAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "HoleAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool HoleAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; + continue; } - - - std::ostream& HoleAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool HoleAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "HoleAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleAttributes.h b/Sourcecode/private/mx/core/elements/HoleAttributes.h index b6aa5579b..33fbfc50b 100644 --- a/Sourcecode/private/mx/core/elements/HoleAttributes.h +++ b/Sourcecode/private/mx/core/elements/HoleAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,40 +18,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HoleAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(HoleAttributes) - struct HoleAttributes : public AttributesInterface - { - public: - HoleAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; +struct HoleAttributes : public AttributesInterface +{ + public: + HoleAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleClosed.cpp b/Sourcecode/private/mx/core/elements/HoleClosed.cpp index 2f6e7fbb2..6be91c912 100644 --- a/Sourcecode/private/mx/core/elements/HoleClosed.cpp +++ b/Sourcecode/private/mx/core/elements/HoleClosed.cpp @@ -8,91 +8,79 @@ namespace mx { - namespace core - { - HoleClosed::HoleClosed() - :myValue( HoleClosedValue::no ) - ,myAttributes( std::make_shared() ) - {} - - - HoleClosed::HoleClosed( const HoleClosedValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool HoleClosed::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool HoleClosed::hasContents() const - { - return true; - } - - - std::ostream& HoleClosed::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - +namespace core +{ +HoleClosed::HoleClosed() : myValue(HoleClosedValue::no), myAttributes(std::make_shared()) +{ +} - std::ostream& HoleClosed::streamName( std::ostream& os ) const - { - os << "hole-closed"; - return os; - } +HoleClosed::HoleClosed(const HoleClosedValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} +bool HoleClosed::hasAttributes() const +{ + return myAttributes->hasValues(); +} - std::ostream& HoleClosed::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool HoleClosed::hasContents() const +{ + return true; +} +std::ostream &HoleClosed::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - HoleClosedAttributesPtr HoleClosed::getAttributes() const - { - return myAttributes; - } +std::ostream &HoleClosed::streamName(std::ostream &os) const +{ + os << "hole-closed"; + return os; +} +std::ostream &HoleClosed::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} - void HoleClosed::setAttributes( const HoleClosedAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +HoleClosedAttributesPtr HoleClosed::getAttributes() const +{ + return myAttributes; +} +void HoleClosed::setAttributes(const HoleClosedAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - HoleClosedValue HoleClosed::getValue() const - { - return myValue; - } +HoleClosedValue HoleClosed::getValue() const +{ + return myValue; +} +void HoleClosed::setValue(const HoleClosedValue &value) +{ + myValue = value; +} - void HoleClosed::setValue( const HoleClosedValue& value ) - { - myValue = value; - } - - - bool HoleClosed::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseHoleClosedValue( xelement.getValue() ); - return true; - } - } +bool HoleClosed::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue = parseHoleClosedValue(xelement.getValue()); + return true; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleClosed.h b/Sourcecode/private/mx/core/elements/HoleClosed.h index 79c722670..fbe498e32 100644 --- a/Sourcecode/private/mx/core/elements/HoleClosed.h +++ b/Sourcecode/private/mx/core/elements/HoleClosed.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/HoleClosedAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HoleClosedAttributes ) - MX_FORWARD_DECLARE_ELEMENT( HoleClosed ) - - inline HoleClosedPtr makeHoleClosed() { return std::make_shared(); } - inline HoleClosedPtr makeHoleClosed( const HoleClosedValue& value ) { return std::make_shared( value ); } - inline HoleClosedPtr makeHoleClosed( HoleClosedValue&& value ) { return std::make_shared( std::move( value ) ); } - - class HoleClosed : public ElementInterface - { - public: - HoleClosed(); - HoleClosed( const HoleClosedValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HoleClosedAttributesPtr getAttributes() const; - void setAttributes( const HoleClosedAttributesPtr& attributes ); - HoleClosedValue getValue() const; - void setValue( const HoleClosedValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HoleClosedValue myValue; - HoleClosedAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(HoleClosedAttributes) +MX_FORWARD_DECLARE_ELEMENT(HoleClosed) + +inline HoleClosedPtr makeHoleClosed() +{ + return std::make_shared(); +} + +inline HoleClosedPtr makeHoleClosed(const HoleClosedValue &value) +{ + return std::make_shared(value); } + +inline HoleClosedPtr makeHoleClosed(HoleClosedValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class HoleClosed : public ElementInterface +{ + public: + HoleClosed(); + HoleClosed(const HoleClosedValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + HoleClosedAttributesPtr getAttributes() const; + void setAttributes(const HoleClosedAttributesPtr &attributes); + HoleClosedValue getValue() const; + void setValue(const HoleClosedValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + HoleClosedValue myValue; + HoleClosedAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp b/Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp index 6aca13517..843a8756c 100644 --- a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp @@ -8,46 +8,45 @@ namespace mx { - namespace core - { - HoleClosedAttributes::HoleClosedAttributes() - :location( HoleClosedLocation::top ) - ,hasLocation( false ) - {} - +namespace core +{ +HoleClosedAttributes::HoleClosedAttributes() : location(HoleClosedLocation::top), hasLocation(false) +{ +} - bool HoleClosedAttributes::hasValues() const - { - return hasLocation; - } +bool HoleClosedAttributes::hasValues() const +{ + return hasLocation; +} +std::ostream &HoleClosedAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, location, "location", hasLocation); + } + return os; +} - std::ostream& HoleClosedAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, location, "location", hasLocation ); - } - return os; - } +bool HoleClosedAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "HoleClosedAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool HoleClosedAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, location, hasLocation, "location", + &parseHoleClosedLocation)) { - const char* const className = "HoleClosedAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseHoleClosedLocation ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.h b/Sourcecode/private/mx/core/elements/HoleClosedAttributes.h index 5fe875c0f..752ca121c 100644 --- a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.h +++ b/Sourcecode/private/mx/core/elements/HoleClosedAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( HoleClosedAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(HoleClosedAttributes) - struct HoleClosedAttributes : public AttributesInterface - { - public: - HoleClosedAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - HoleClosedLocation location; - bool hasLocation; +struct HoleClosedAttributes : public AttributesInterface +{ + public: + HoleClosedAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + HoleClosedLocation location; + bool hasLocation; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleShape.cpp b/Sourcecode/private/mx/core/elements/HoleShape.cpp index 3a86981a0..e7a764041 100644 --- a/Sourcecode/private/mx/core/elements/HoleShape.cpp +++ b/Sourcecode/private/mx/core/elements/HoleShape.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - HoleShape::HoleShape() - :myValue() - {} - - - HoleShape::HoleShape( const XsString& value ) - :myValue( value ) - {} - - - bool HoleShape::hasAttributes() const - { - return false; - } - - - bool HoleShape::hasContents() const - { - return true; - } - - - std::ostream& HoleShape::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HoleShape::streamName( std::ostream& os ) const - { - os << "hole-shape"; - return os; - } +namespace core +{ +HoleShape::HoleShape() : myValue() +{ +} +HoleShape::HoleShape(const XsString &value) : myValue(value) +{ +} - std::ostream& HoleShape::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool HoleShape::hasAttributes() const +{ + return false; +} +bool HoleShape::hasContents() const +{ + return true; +} - XsString HoleShape::getValue() const - { - return myValue; - } +std::ostream &HoleShape::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &HoleShape::streamName(std::ostream &os) const +{ + os << "hole-shape"; + return os; +} - void HoleShape::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &HoleShape::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString HoleShape::getValue() const +{ + return myValue; +} - bool HoleShape::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void HoleShape::setValue(const XsString &value) +{ + myValue = value; +} - } +bool HoleShape::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleShape.h b/Sourcecode/private/mx/core/elements/HoleShape.h index 4494aa836..8909c5750 100644 --- a/Sourcecode/private/mx/core/elements/HoleShape.h +++ b/Sourcecode/private/mx/core/elements/HoleShape.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( HoleShape ) - - inline HoleShapePtr makeHoleShape() { return std::make_shared(); } - inline HoleShapePtr makeHoleShape( const XsString& value ) { return std::make_shared( value ); } - inline HoleShapePtr makeHoleShape( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class HoleShape : public ElementInterface - { - public: - HoleShape(); - HoleShape( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(HoleShape) + +inline HoleShapePtr makeHoleShape() +{ + return std::make_shared(); +} + +inline HoleShapePtr makeHoleShape(const XsString &value) +{ + return std::make_shared(value); } + +inline HoleShapePtr makeHoleShape(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class HoleShape : public ElementInterface +{ + public: + HoleShape(); + HoleShape(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleType.cpp b/Sourcecode/private/mx/core/elements/HoleType.cpp index 638265e53..a9b4de9f7 100644 --- a/Sourcecode/private/mx/core/elements/HoleType.cpp +++ b/Sourcecode/private/mx/core/elements/HoleType.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - HoleType::HoleType() - :myValue() - {} - - - HoleType::HoleType( const XsString& value ) - :myValue( value ) - {} - - - bool HoleType::hasAttributes() const - { - return false; - } - - - bool HoleType::hasContents() const - { - return true; - } - - - std::ostream& HoleType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HoleType::streamName( std::ostream& os ) const - { - os << "hole-type"; - return os; - } +namespace core +{ +HoleType::HoleType() : myValue() +{ +} +HoleType::HoleType(const XsString &value) : myValue(value) +{ +} - std::ostream& HoleType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool HoleType::hasAttributes() const +{ + return false; +} +bool HoleType::hasContents() const +{ + return true; +} - XsString HoleType::getValue() const - { - return myValue; - } +std::ostream &HoleType::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &HoleType::streamName(std::ostream &os) const +{ + os << "hole-type"; + return os; +} - void HoleType::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &HoleType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString HoleType::getValue() const +{ + return myValue; +} - bool HoleType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void HoleType::setValue(const XsString &value) +{ + myValue = value; +} - } +bool HoleType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/HoleType.h b/Sourcecode/private/mx/core/elements/HoleType.h index 8a580263d..aec211f0c 100644 --- a/Sourcecode/private/mx/core/elements/HoleType.h +++ b/Sourcecode/private/mx/core/elements/HoleType.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( HoleType ) - - inline HoleTypePtr makeHoleType() { return std::make_shared(); } - inline HoleTypePtr makeHoleType( const XsString& value ) { return std::make_shared( value ); } - inline HoleTypePtr makeHoleType( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class HoleType : public ElementInterface - { - public: - HoleType(); - HoleType( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(HoleType) + +inline HoleTypePtr makeHoleType() +{ + return std::make_shared(); +} + +inline HoleTypePtr makeHoleType(const XsString &value) +{ + return std::make_shared(value); } + +inline HoleTypePtr makeHoleType(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class HoleType : public ElementInterface +{ + public: + HoleType(); + HoleType(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Humming.cpp b/Sourcecode/private/mx/core/elements/Humming.cpp index a4f2ddf2b..60bd82434 100644 --- a/Sourcecode/private/mx/core/elements/Humming.cpp +++ b/Sourcecode/private/mx/core/elements/Humming.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Humming::Humming() : ElementInterface() {} - +namespace core +{ +Humming::Humming() : ElementInterface() +{ +} - bool Humming::hasAttributes() const { return false; } +bool Humming::hasAttributes() const +{ + return false; +} +bool Humming::hasContents() const +{ + return false; +} - bool Humming::hasContents() const { return false; } - std::ostream& Humming::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Humming::streamName( std::ostream& os ) const { os << "humming"; return os; } - std::ostream& Humming::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Humming::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Humming::streamName(std::ostream &os) const +{ + os << "humming"; + return os; +} - bool Humming::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &Humming::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Humming::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Humming.h b/Sourcecode/private/mx/core/elements/Humming.h index 07e5a94cf..927ce1b3d 100644 --- a/Sourcecode/private/mx/core/elements/Humming.h +++ b/Sourcecode/private/mx/core/elements/Humming.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Humming ) - - inline HummingPtr makeHumming() { return std::make_shared(); } - - class Humming : public ElementInterface - { - public: - Humming(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Humming) + +inline HummingPtr makeHumming() +{ + return std::make_shared(); } + +class Humming : public ElementInterface +{ + public: + Humming(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Identification.cpp b/Sourcecode/private/mx/core/elements/Identification.cpp index 6a9a9b175..454eaa0a0 100644 --- a/Sourcecode/private/mx/core/elements/Identification.cpp +++ b/Sourcecode/private/mx/core/elements/Identification.cpp @@ -14,314 +14,280 @@ namespace mx { - namespace core - { - Identification::Identification() - :myCreatorSet() - ,myRightsSet() - ,myEncoding( makeEncoding() ) - ,myHasEncoding( false ) - ,mySource( makeSource() ) - ,myHasSource( false ) - ,myRelationSet() - ,myMiscellaneous( makeMiscellaneous() ) - ,myHasMiscellaneous( false ) - {} - - - bool Identification::hasAttributes() const - { - return false; - } - - - std::ostream& Identification::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Identification::streamName( std::ostream& os ) const - { - os << "identification"; - return os; - } - - - bool Identification::hasContents() const - { - return myCreatorSet.size() > 0 - || myRightsSet.size() > 0 - || myHasEncoding - || myHasSource - || myRelationSet.size() > 0 - || myHasMiscellaneous; - } - - - std::ostream& Identification::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myCreatorSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myRightsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasEncoding ) - { - os << std::endl; - myEncoding->toStream( os, indentLevel+1 ); - } - if ( myHasSource ) - { - os << std::endl; - mySource->toStream( os, indentLevel+1 ); - } - for ( auto x : myRelationSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasMiscellaneous ) - { - os << std::endl; - myMiscellaneous->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - const CreatorSet& Identification::getCreatorSet() const - { - return myCreatorSet; - } - - - void Identification::removeCreator( const CreatorSetIterConst& value ) - { - if ( value != myCreatorSet.cend() ) - { - myCreatorSet.erase( value ); - } - } - - - void Identification::addCreator( const CreatorPtr& value ) - { - if ( value ) - { - myCreatorSet.push_back( value ); - } - } - +namespace core +{ +Identification::Identification() + : myCreatorSet(), myRightsSet(), myEncoding(makeEncoding()), myHasEncoding(false), mySource(makeSource()), + myHasSource(false), myRelationSet(), myMiscellaneous(makeMiscellaneous()), myHasMiscellaneous(false) +{ +} - void Identification::clearCreatorSet() - { - myCreatorSet.clear(); - } +bool Identification::hasAttributes() const +{ + return false; +} +std::ostream &Identification::streamAttributes(std::ostream &os) const +{ + return os; +} - CreatorPtr Identification::getCreator( const CreatorSetIterConst& setIterator ) const - { - if( setIterator != myCreatorSet.cend() ) - { - return *setIterator; - } - return CreatorPtr(); - } +std::ostream &Identification::streamName(std::ostream &os) const +{ + os << "identification"; + return os; +} +bool Identification::hasContents() const +{ + return myCreatorSet.size() > 0 || myRightsSet.size() > 0 || myHasEncoding || myHasSource || + myRelationSet.size() > 0 || myHasMiscellaneous; +} - const RightsSet& Identification::getRightsSet() const +std::ostream &Identification::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + for (auto x : myCreatorSet) { - return myRightsSet; + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - void Identification::removeRights( const RightsSetIterConst& value ) + for (auto x : myRightsSet) { - if ( value != myRightsSet.cend() ) - { - myRightsSet.erase( value ); - } + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - void Identification::addRights( const RightsPtr& value ) + if (myHasEncoding) { - if ( value ) - { - myRightsSet.push_back( value ); - } + os << std::endl; + myEncoding->toStream(os, indentLevel + 1); } - - - void Identification::clearRightsSet() + if (myHasSource) { - myRightsSet.clear(); + os << std::endl; + mySource->toStream(os, indentLevel + 1); } - - - RightsPtr Identification::getRights( const RightsSetIterConst& setIterator ) const + for (auto x : myRelationSet) { - if( setIterator != myRightsSet.cend() ) - { - return *setIterator; - } - return RightsPtr(); + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - EncodingPtr Identification::getEncoding() const + if (myHasMiscellaneous) { - return myEncoding; + os << std::endl; + myMiscellaneous->toStream(os, indentLevel + 1); } + isOneLineOnly = false; + os << std::endl; + } + else + { + isOneLineOnly = true; + } + return os; +} +const CreatorSet &Identification::getCreatorSet() const +{ + return myCreatorSet; +} - void Identification::setEncoding( const EncodingPtr& value ) - { - if( value ) - { - myEncoding = value; - } - } - +void Identification::removeCreator(const CreatorSetIterConst &value) +{ + if (value != myCreatorSet.cend()) + { + myCreatorSet.erase(value); + } +} - bool Identification::getHasEncoding() const - { - return myHasEncoding; - } +void Identification::addCreator(const CreatorPtr &value) +{ + if (value) + { + myCreatorSet.push_back(value); + } +} +void Identification::clearCreatorSet() +{ + myCreatorSet.clear(); +} - void Identification::setHasEncoding( const bool value ) - { - myHasEncoding = value; - } +CreatorPtr Identification::getCreator(const CreatorSetIterConst &setIterator) const +{ + if (setIterator != myCreatorSet.cend()) + { + return *setIterator; + } + return CreatorPtr(); +} +const RightsSet &Identification::getRightsSet() const +{ + return myRightsSet; +} - SourcePtr Identification::getSource() const - { - return mySource; - } +void Identification::removeRights(const RightsSetIterConst &value) +{ + if (value != myRightsSet.cend()) + { + myRightsSet.erase(value); + } +} +void Identification::addRights(const RightsPtr &value) +{ + if (value) + { + myRightsSet.push_back(value); + } +} - void Identification::setSource( const SourcePtr& value ) - { - if( value ) - { - mySource = value; - } - } +void Identification::clearRightsSet() +{ + myRightsSet.clear(); +} +RightsPtr Identification::getRights(const RightsSetIterConst &setIterator) const +{ + if (setIterator != myRightsSet.cend()) + { + return *setIterator; + } + return RightsPtr(); +} - bool Identification::getHasSource() const - { - return myHasSource; - } +EncodingPtr Identification::getEncoding() const +{ + return myEncoding; +} +void Identification::setEncoding(const EncodingPtr &value) +{ + if (value) + { + myEncoding = value; + } +} - void Identification::setHasSource( const bool value ) - { - myHasSource = value; - } +bool Identification::getHasEncoding() const +{ + return myHasEncoding; +} +void Identification::setHasEncoding(const bool value) +{ + myHasEncoding = value; +} - const RelationSet& Identification::getRelationSet() const - { - return myRelationSet; - } +SourcePtr Identification::getSource() const +{ + return mySource; +} +void Identification::setSource(const SourcePtr &value) +{ + if (value) + { + mySource = value; + } +} - void Identification::removeRelation( const RelationSetIterConst& value ) - { - if ( value != myRelationSet.cend() ) - { - myRelationSet.erase( value ); - } - } +bool Identification::getHasSource() const +{ + return myHasSource; +} +void Identification::setHasSource(const bool value) +{ + myHasSource = value; +} - void Identification::addRelation( const RelationPtr& value ) - { - if ( value ) - { - myRelationSet.push_back( value ); - } - } +const RelationSet &Identification::getRelationSet() const +{ + return myRelationSet; +} +void Identification::removeRelation(const RelationSetIterConst &value) +{ + if (value != myRelationSet.cend()) + { + myRelationSet.erase(value); + } +} - void Identification::clearRelationSet() - { - myRelationSet.clear(); - } +void Identification::addRelation(const RelationPtr &value) +{ + if (value) + { + myRelationSet.push_back(value); + } +} +void Identification::clearRelationSet() +{ + myRelationSet.clear(); +} - RelationPtr Identification::getRelation( const RelationSetIterConst& setIterator ) const - { - if( setIterator != myRelationSet.cend() ) - { - return *setIterator; - } - return RelationPtr(); - } +RelationPtr Identification::getRelation(const RelationSetIterConst &setIterator) const +{ + if (setIterator != myRelationSet.cend()) + { + return *setIterator; + } + return RelationPtr(); +} +MiscellaneousPtr Identification::getMiscellaneous() const +{ + return myMiscellaneous; +} - MiscellaneousPtr Identification::getMiscellaneous() const - { - return myMiscellaneous; - } +void Identification::setMiscellaneous(const MiscellaneousPtr &value) +{ + if (value) + { + myMiscellaneous = value; + } +} +bool Identification::getHasMiscellaneous() const +{ + return myHasMiscellaneous; +} - void Identification::setMiscellaneous( const MiscellaneousPtr& value ) - { - if( value ) - { - myMiscellaneous = value; - } - } +void Identification::setHasMiscellaneous(const bool value) +{ + myHasMiscellaneous = value; +} +bool Identification::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; - bool Identification::getHasMiscellaneous() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importElementSet(message, it, endIter, isSuccess, "creator", myCreatorSet); + importElementSet(message, it, endIter, isSuccess, "rights", myRightsSet); + if (importElement(message, *it, isSuccess, *myEncoding, myHasEncoding)) { - return myHasMiscellaneous; + continue; } - - - void Identification::setHasMiscellaneous( const bool value ) + if (importElement(message, *it, isSuccess, *mySource, myHasSource)) { - myHasMiscellaneous = value; + continue; } - - - bool Identification::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + importElementSet(message, it, endIter, isSuccess, "relation", myRelationSet); + if (importElement(message, *it, isSuccess, *myMiscellaneous, myHasMiscellaneous)) { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "creator", myCreatorSet ); - importElementSet( message, it, endIter, isSuccess, "rights", myRightsSet ); - if ( importElement( message, *it, isSuccess, *myEncoding, myHasEncoding ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySource, myHasSource ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "relation", myRelationSet ); - if ( importElement( message, *it, isSuccess, *myMiscellaneous, myHasMiscellaneous ) ) { continue; } - } - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Identification.h b/Sourcecode/private/mx/core/elements/Identification.h index 6eb32a800..9c1f8d947 100644 --- a/Sourcecode/private/mx/core/elements/Identification.h +++ b/Sourcecode/private/mx/core/elements/Identification.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,82 +13,85 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Creator ) - MX_FORWARD_DECLARE_ELEMENT( Encoding ) - MX_FORWARD_DECLARE_ELEMENT( Miscellaneous ) - MX_FORWARD_DECLARE_ELEMENT( Relation ) - MX_FORWARD_DECLARE_ELEMENT( Rights ) - MX_FORWARD_DECLARE_ELEMENT( Source ) - MX_FORWARD_DECLARE_ELEMENT( Identification ) - - inline IdentificationPtr makeIdentification() { return std::make_shared(); } - - class Identification : public ElementInterface - { - public: - Identification(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Creator minOccurs = 0, maxOccurs = unbounded _________ */ - const CreatorSet& getCreatorSet() const; - void addCreator( const CreatorPtr& value ); - void removeCreator( const CreatorSetIterConst& value ); - void clearCreatorSet(); - CreatorPtr getCreator( const CreatorSetIterConst& setIterator ) const; - - /* _________ Rights minOccurs = 0, maxOccurs = unbounded _________ */ - const RightsSet& getRightsSet() const; - void addRights( const RightsPtr& value ); - void removeRights( const RightsSetIterConst& value ); - void clearRightsSet(); - RightsPtr getRights( const RightsSetIterConst& setIterator ) const; - - /* _________ Encoding minOccurs = 0, maxOccurs = 1 _________ */ - EncodingPtr getEncoding() const; - void setEncoding( const EncodingPtr& value ); - bool getHasEncoding() const; - void setHasEncoding( const bool value ); - - /* _________ Source minOccurs = 0, maxOccurs = 1 _________ */ - SourcePtr getSource() const; - void setSource( const SourcePtr& value ); - bool getHasSource() const; - void setHasSource( const bool value ); - - /* _________ Relation minOccurs = 0, maxOccurs = unbounded _________ */ - const RelationSet& getRelationSet() const; - void addRelation( const RelationPtr& value ); - void removeRelation( const RelationSetIterConst& value ); - void clearRelationSet(); - RelationPtr getRelation( const RelationSetIterConst& setIterator ) const; - - /* _________ Miscellaneous minOccurs = 0, maxOccurs = 1 _________ */ - MiscellaneousPtr getMiscellaneous() const; - void setMiscellaneous( const MiscellaneousPtr& value ); - bool getHasMiscellaneous() const; - void setHasMiscellaneous( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CreatorSet myCreatorSet; - RightsSet myRightsSet; - EncodingPtr myEncoding; - bool myHasEncoding; - SourcePtr mySource; - bool myHasSource; - RelationSet myRelationSet; - MiscellaneousPtr myMiscellaneous; - bool myHasMiscellaneous; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Creator) +MX_FORWARD_DECLARE_ELEMENT(Encoding) +MX_FORWARD_DECLARE_ELEMENT(Miscellaneous) +MX_FORWARD_DECLARE_ELEMENT(Relation) +MX_FORWARD_DECLARE_ELEMENT(Rights) +MX_FORWARD_DECLARE_ELEMENT(Source) +MX_FORWARD_DECLARE_ELEMENT(Identification) + +inline IdentificationPtr makeIdentification() +{ + return std::make_shared(); } + +class Identification : public ElementInterface +{ + public: + Identification(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Creator minOccurs = 0, maxOccurs = unbounded _________ */ + const CreatorSet &getCreatorSet() const; + void addCreator(const CreatorPtr &value); + void removeCreator(const CreatorSetIterConst &value); + void clearCreatorSet(); + CreatorPtr getCreator(const CreatorSetIterConst &setIterator) const; + + /* _________ Rights minOccurs = 0, maxOccurs = unbounded _________ */ + const RightsSet &getRightsSet() const; + void addRights(const RightsPtr &value); + void removeRights(const RightsSetIterConst &value); + void clearRightsSet(); + RightsPtr getRights(const RightsSetIterConst &setIterator) const; + + /* _________ Encoding minOccurs = 0, maxOccurs = 1 _________ */ + EncodingPtr getEncoding() const; + void setEncoding(const EncodingPtr &value); + bool getHasEncoding() const; + void setHasEncoding(const bool value); + + /* _________ Source minOccurs = 0, maxOccurs = 1 _________ */ + SourcePtr getSource() const; + void setSource(const SourcePtr &value); + bool getHasSource() const; + void setHasSource(const bool value); + + /* _________ Relation minOccurs = 0, maxOccurs = unbounded _________ */ + const RelationSet &getRelationSet() const; + void addRelation(const RelationPtr &value); + void removeRelation(const RelationSetIterConst &value); + void clearRelationSet(); + RelationPtr getRelation(const RelationSetIterConst &setIterator) const; + + /* _________ Miscellaneous minOccurs = 0, maxOccurs = 1 _________ */ + MiscellaneousPtr getMiscellaneous() const; + void setMiscellaneous(const MiscellaneousPtr &value); + bool getHasMiscellaneous() const; + void setHasMiscellaneous(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + CreatorSet myCreatorSet; + RightsSet myRightsSet; + EncodingPtr myEncoding; + bool myHasEncoding; + SourcePtr mySource; + bool myHasSource; + RelationSet myRelationSet; + MiscellaneousPtr myMiscellaneous; + bool myHasMiscellaneous; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Image.cpp b/Sourcecode/private/mx/core/elements/Image.cpp index 6e5509c43..a6111f353 100644 --- a/Sourcecode/private/mx/core/elements/Image.cpp +++ b/Sourcecode/private/mx/core/elements/Image.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Image::Image() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Image::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Image::hasContents() const { return false; } - std::ostream& Image::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Image::streamName( std::ostream& os ) const { os << "image"; return os; } - std::ostream& Image::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Image::Image() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Image::hasAttributes() const +{ + return myAttributes->hasValues(); +} - ImageAttributesPtr Image::getAttributes() const - { - return myAttributes; - } +bool Image::hasContents() const +{ + return false; +} +std::ostream &Image::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Image::setAttributes( const ImageAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Image::streamName(std::ostream &os) const +{ + os << "image"; + return os; +} +std::ostream &Image::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Image::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +ImageAttributesPtr Image::getAttributes() const +{ + return myAttributes; +} +void Image::setAttributes(const ImageAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Image::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Image.h b/Sourcecode/private/mx/core/elements/Image.h index 10bbaaed7..d03246199 100644 --- a/Sourcecode/private/mx/core/elements/Image.h +++ b/Sourcecode/private/mx/core/elements/Image.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ImageAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ImageAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Image ) - - inline ImagePtr makeImage() { return std::make_shared(); } - - class Image : public ElementInterface - { - public: - Image(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ImageAttributesPtr getAttributes() const; - void setAttributes( const ImageAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ImageAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(ImageAttributes) +MX_FORWARD_DECLARE_ELEMENT(Image) + +inline ImagePtr makeImage() +{ + return std::make_shared(); } + +class Image : public ElementInterface +{ + public: + Image(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ImageAttributesPtr getAttributes() const; + void setAttributes(const ImageAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ImageAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ImageAttributes.cpp b/Sourcecode/private/mx/core/elements/ImageAttributes.cpp index 2172a66b2..b5bd55356 100644 --- a/Sourcecode/private/mx/core/elements/ImageAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ImageAttributes.cpp @@ -8,88 +8,90 @@ namespace mx { - namespace core +namespace core +{ +ImageAttributes::ImageAttributes() + : source(), type(), defaultX(), defaultY(), relativeX(), relativeY(), halign(LeftCenterRight::center), + hasSource(true), hasType(true), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasHalign(false) +{ +} + +bool ImageAttributes::hasValues() const +{ + return hasSource || hasType || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasHalign; +} + +std::ostream &ImageAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - ImageAttributes::ImageAttributes() - :source() - ,type() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,halign( LeftCenterRight::center ) - ,hasSource( true ) - ,hasType( true ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasHalign( false ) - {} + streamAttribute(os, source, "source", hasSource); + streamAttribute(os, type, "type", hasType); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, halign, "halign", hasHalign); + } + return os; +} + +bool ImageAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ImageAttributes"; + bool isSuccess = true; + bool isSourceFound = false; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool ImageAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, source, isSourceFound, "source")) { - return hasSource || - hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasHalign; + continue; } - - - std::ostream& ImageAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type")) { - if ( hasValues() ) - { - streamAttribute( os, source, "source", hasSource ); - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; + continue; } - - - bool ImageAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) { - const char* const className = "ImageAttributes"; - bool isSuccess = true; - bool isSourceFound = false; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, source, isSourceFound, "source" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isSourceFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + } + if (!isSourceFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; + } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ImageAttributes.h b/Sourcecode/private/mx/core/elements/ImageAttributes.h index 1bd445c3d..24057c86b 100644 --- a/Sourcecode/private/mx/core/elements/ImageAttributes.h +++ b/Sourcecode/private/mx/core/elements/ImageAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsAnyUri.h" #include "mx/core/XsToken.h" @@ -17,34 +17,34 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ImageAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(ImageAttributes) - struct ImageAttributes : public AttributesInterface - { - public: - ImageAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsAnyUri source; - XsToken type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - LeftCenterRight halign; - const bool hasSource; - const bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasHalign; +struct ImageAttributes : public AttributesInterface +{ + public: + ImageAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsAnyUri source; + XsToken type; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + LeftCenterRight halign; + const bool hasSource; + const bool hasType; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasHalign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Instrument.cpp b/Sourcecode/private/mx/core/elements/Instrument.cpp index 63fc61005..fe76fc793 100644 --- a/Sourcecode/private/mx/core/elements/Instrument.cpp +++ b/Sourcecode/private/mx/core/elements/Instrument.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Instrument::Instrument() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Instrument::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Instrument::hasContents() const { return false; } - std::ostream& Instrument::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Instrument::streamName( std::ostream& os ) const { os << "instrument"; return os; } - std::ostream& Instrument::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Instrument::Instrument() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Instrument::hasAttributes() const +{ + return myAttributes->hasValues(); +} - InstrumentAttributesPtr Instrument::getAttributes() const - { - return myAttributes; - } +bool Instrument::hasContents() const +{ + return false; +} +std::ostream &Instrument::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Instrument::setAttributes( const InstrumentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Instrument::streamName(std::ostream &os) const +{ + os << "instrument"; + return os; +} +std::ostream &Instrument::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Instrument::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +InstrumentAttributesPtr Instrument::getAttributes() const +{ + return myAttributes; +} +void Instrument::setAttributes(const InstrumentAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Instrument::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Instrument.h b/Sourcecode/private/mx/core/elements/Instrument.h index 069c9580b..9c969bb77 100644 --- a/Sourcecode/private/mx/core/elements/Instrument.h +++ b/Sourcecode/private/mx/core/elements/Instrument.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/InstrumentAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InstrumentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Instrument ) - - inline InstrumentPtr makeInstrument() { return std::make_shared(); } - - class Instrument : public ElementInterface - { - public: - Instrument(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InstrumentAttributesPtr getAttributes() const; - void setAttributes( const InstrumentAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - InstrumentAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(InstrumentAttributes) +MX_FORWARD_DECLARE_ELEMENT(Instrument) + +inline InstrumentPtr makeInstrument() +{ + return std::make_shared(); } + +class Instrument : public ElementInterface +{ + public: + Instrument(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + InstrumentAttributesPtr getAttributes() const; + void setAttributes(const InstrumentAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + InstrumentAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp b/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp index 1aebb7bf1..d76677911 100644 --- a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp +++ b/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - InstrumentAbbreviation::InstrumentAbbreviation() - :myValue() - {} - - - InstrumentAbbreviation::InstrumentAbbreviation( const XsString& value ) - :myValue( value ) - {} - - - bool InstrumentAbbreviation::hasAttributes() const - { - return false; - } - - - bool InstrumentAbbreviation::hasContents() const - { - return true; - } - - - std::ostream& InstrumentAbbreviation::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& InstrumentAbbreviation::streamName( std::ostream& os ) const - { - os << "instrument-abbreviation"; - return os; - } +namespace core +{ +InstrumentAbbreviation::InstrumentAbbreviation() : myValue() +{ +} +InstrumentAbbreviation::InstrumentAbbreviation(const XsString &value) : myValue(value) +{ +} - std::ostream& InstrumentAbbreviation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool InstrumentAbbreviation::hasAttributes() const +{ + return false; +} +bool InstrumentAbbreviation::hasContents() const +{ + return true; +} - XsString InstrumentAbbreviation::getValue() const - { - return myValue; - } +std::ostream &InstrumentAbbreviation::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &InstrumentAbbreviation::streamName(std::ostream &os) const +{ + os << "instrument-abbreviation"; + return os; +} - void InstrumentAbbreviation::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &InstrumentAbbreviation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString InstrumentAbbreviation::getValue() const +{ + return myValue; +} - bool InstrumentAbbreviation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void InstrumentAbbreviation::setValue(const XsString &value) +{ + myValue = value; +} - } +bool InstrumentAbbreviation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h b/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h index e4165717b..84c641728 100644 --- a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h +++ b/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( InstrumentAbbreviation ) - - inline InstrumentAbbreviationPtr makeInstrumentAbbreviation() { return std::make_shared(); } - inline InstrumentAbbreviationPtr makeInstrumentAbbreviation( const XsString& value ) { return std::make_shared( value ); } - inline InstrumentAbbreviationPtr makeInstrumentAbbreviation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class InstrumentAbbreviation : public ElementInterface - { - public: - InstrumentAbbreviation(); - InstrumentAbbreviation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(InstrumentAbbreviation) + +inline InstrumentAbbreviationPtr makeInstrumentAbbreviation() +{ + return std::make_shared(); +} + +inline InstrumentAbbreviationPtr makeInstrumentAbbreviation(const XsString &value) +{ + return std::make_shared(value); } + +inline InstrumentAbbreviationPtr makeInstrumentAbbreviation(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class InstrumentAbbreviation : public ElementInterface +{ + public: + InstrumentAbbreviation(); + InstrumentAbbreviation(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp b/Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp index 8d1d7d73f..4cd77c0c2 100644 --- a/Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - InstrumentAttributes::InstrumentAttributes() - :id() - ,hasId( true ) - {} - +namespace core +{ +InstrumentAttributes::InstrumentAttributes() : id(), hasId(true) +{ +} - bool InstrumentAttributes::hasValues() const - { - return hasId; - } +bool InstrumentAttributes::hasValues() const +{ + return hasId; +} +std::ostream &InstrumentAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, id, "id", hasId); + } + return os; +} - std::ostream& InstrumentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } +bool InstrumentAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "InstrumentAttributes"; + bool isSuccess = true; + bool isIdFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool InstrumentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, id, isIdFound, "id")) { - const char* const className = "InstrumentAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isIdFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InstrumentAttributes.h b/Sourcecode/private/mx/core/elements/InstrumentAttributes.h index 5375b2b71..e9ae8a566 100644 --- a/Sourcecode/private/mx/core/elements/InstrumentAttributes.h +++ b/Sourcecode/private/mx/core/elements/InstrumentAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsIDREF.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( InstrumentAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(InstrumentAttributes) - struct InstrumentAttributes : public AttributesInterface - { - public: - InstrumentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsIDREF id; - const bool hasId; +struct InstrumentAttributes : public AttributesInterface +{ + public: + InstrumentAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsIDREF id; + const bool hasId; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InstrumentName.cpp b/Sourcecode/private/mx/core/elements/InstrumentName.cpp index 5c1e0d7a3..37402b6f5 100644 --- a/Sourcecode/private/mx/core/elements/InstrumentName.cpp +++ b/Sourcecode/private/mx/core/elements/InstrumentName.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - InstrumentName::InstrumentName() - :myValue() - {} - - - InstrumentName::InstrumentName( const XsString& value ) - :myValue( value ) - {} - - - bool InstrumentName::hasAttributes() const - { - return false; - } - - - bool InstrumentName::hasContents() const - { - return true; - } - - - std::ostream& InstrumentName::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& InstrumentName::streamName( std::ostream& os ) const - { - os << "instrument-name"; - return os; - } +namespace core +{ +InstrumentName::InstrumentName() : myValue() +{ +} +InstrumentName::InstrumentName(const XsString &value) : myValue(value) +{ +} - std::ostream& InstrumentName::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool InstrumentName::hasAttributes() const +{ + return false; +} +bool InstrumentName::hasContents() const +{ + return true; +} - XsString InstrumentName::getValue() const - { - return myValue; - } +std::ostream &InstrumentName::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &InstrumentName::streamName(std::ostream &os) const +{ + os << "instrument-name"; + return os; +} - void InstrumentName::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &InstrumentName::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString InstrumentName::getValue() const +{ + return myValue; +} - bool InstrumentName::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void InstrumentName::setValue(const XsString &value) +{ + myValue = value; +} - } +bool InstrumentName::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InstrumentName.h b/Sourcecode/private/mx/core/elements/InstrumentName.h index 4a0ec56b4..09688e7c2 100644 --- a/Sourcecode/private/mx/core/elements/InstrumentName.h +++ b/Sourcecode/private/mx/core/elements/InstrumentName.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( InstrumentName ) - - inline InstrumentNamePtr makeInstrumentName() { return std::make_shared(); } - inline InstrumentNamePtr makeInstrumentName( const XsString& value ) { return std::make_shared( value ); } - inline InstrumentNamePtr makeInstrumentName( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class InstrumentName : public ElementInterface - { - public: - InstrumentName(); - InstrumentName( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(InstrumentName) + +inline InstrumentNamePtr makeInstrumentName() +{ + return std::make_shared(); +} + +inline InstrumentNamePtr makeInstrumentName(const XsString &value) +{ + return std::make_shared(value); } + +inline InstrumentNamePtr makeInstrumentName(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class InstrumentName : public ElementInterface +{ + public: + InstrumentName(); + InstrumentName(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InstrumentSound.cpp b/Sourcecode/private/mx/core/elements/InstrumentSound.cpp index 09c2d4c79..63c032df1 100644 --- a/Sourcecode/private/mx/core/elements/InstrumentSound.cpp +++ b/Sourcecode/private/mx/core/elements/InstrumentSound.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - InstrumentSound::InstrumentSound() - :myValue( PlaybackSound::keyboardPiano ) - {} - - - InstrumentSound::InstrumentSound( const PlaybackSound& value ) - :myValue( value ) - {} - - - bool InstrumentSound::hasAttributes() const - { - return false; - } - - - bool InstrumentSound::hasContents() const - { - return true; - } - - - std::ostream& InstrumentSound::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& InstrumentSound::streamName( std::ostream& os ) const - { - os << "instrument-sound"; - return os; - } +namespace core +{ +InstrumentSound::InstrumentSound() : myValue(PlaybackSound::keyboardPiano) +{ +} +InstrumentSound::InstrumentSound(const PlaybackSound &value) : myValue(value) +{ +} - std::ostream& InstrumentSound::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << PlaybackSoundToString( myValue ); - return os; - } +bool InstrumentSound::hasAttributes() const +{ + return false; +} +bool InstrumentSound::hasContents() const +{ + return true; +} - PlaybackSound InstrumentSound::getValue() const - { - return myValue; - } +std::ostream &InstrumentSound::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &InstrumentSound::streamName(std::ostream &os) const +{ + os << "instrument-sound"; + return os; +} - void InstrumentSound::setValue( const PlaybackSound& value ) - { - myValue = value; - } +std::ostream &InstrumentSound::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << PlaybackSoundToString(myValue); + return os; +} +PlaybackSound InstrumentSound::getValue() const +{ + return myValue; +} - bool InstrumentSound::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = ( PlaybackSoundFromString( xelement.getValue() ) ); - return true; - } +void InstrumentSound::setValue(const PlaybackSound &value) +{ + myValue = value; +} - } +bool InstrumentSound::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue = (PlaybackSoundFromString(xelement.getValue())); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InstrumentSound.h b/Sourcecode/private/mx/core/elements/InstrumentSound.h index e0077b8d4..942dd148a 100644 --- a/Sourcecode/private/mx/core/elements/InstrumentSound.h +++ b/Sourcecode/private/mx/core/elements/InstrumentSound.h @@ -15,33 +15,40 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( InstrumentSound ) - - inline InstrumentSoundPtr makeInstrumentSound() { return std::make_shared(); } - inline InstrumentSoundPtr makeInstrumentSound( PlaybackSound value ) { return std::make_shared( value ); } - - class InstrumentSound : public ElementInterface - { - public: - InstrumentSound(); - InstrumentSound( const PlaybackSound& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PlaybackSound getValue() const; - void setValue( const PlaybackSound& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PlaybackSound myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(InstrumentSound) + +inline InstrumentSoundPtr makeInstrumentSound() +{ + return std::make_shared(); } + +inline InstrumentSoundPtr makeInstrumentSound(PlaybackSound value) +{ + return std::make_shared(value); +} + +class InstrumentSound : public ElementInterface +{ + public: + InstrumentSound(); + InstrumentSound(const PlaybackSound &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PlaybackSound getValue() const; + void setValue(const PlaybackSound &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PlaybackSound myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Instruments.cpp b/Sourcecode/private/mx/core/elements/Instruments.cpp index 0c4bcee4b..755b717cd 100644 --- a/Sourcecode/private/mx/core/elements/Instruments.cpp +++ b/Sourcecode/private/mx/core/elements/Instruments.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Instruments::Instruments() - :myValue() - {} - - - Instruments::Instruments( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool Instruments::hasAttributes() const - { - return false; - } - - - bool Instruments::hasContents() const - { - return true; - } - - - std::ostream& Instruments::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Instruments::streamName( std::ostream& os ) const - { - os << "instruments"; - return os; - } +namespace core +{ +Instruments::Instruments() : myValue() +{ +} +Instruments::Instruments(const NonNegativeInteger &value) : myValue(value) +{ +} - std::ostream& Instruments::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Instruments::hasAttributes() const +{ + return false; +} +bool Instruments::hasContents() const +{ + return true; +} - NonNegativeInteger Instruments::getValue() const - { - return myValue; - } +std::ostream &Instruments::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Instruments::streamName(std::ostream &os) const +{ + os << "instruments"; + return os; +} - void Instruments::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } +std::ostream &Instruments::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NonNegativeInteger Instruments::getValue() const +{ + return myValue; +} - bool Instruments::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Instruments::setValue(const NonNegativeInteger &value) +{ + myValue = value; +} - } +bool Instruments::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Instruments.h b/Sourcecode/private/mx/core/elements/Instruments.h index b10754c19..bf469ff12 100644 --- a/Sourcecode/private/mx/core/elements/Instruments.h +++ b/Sourcecode/private/mx/core/elements/Instruments.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Instruments ) - - inline InstrumentsPtr makeInstruments() { return std::make_shared(); } - inline InstrumentsPtr makeInstruments( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline InstrumentsPtr makeInstruments( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Instruments : public ElementInterface - { - public: - Instruments(); - Instruments( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Instruments) + +inline InstrumentsPtr makeInstruments() +{ + return std::make_shared(); +} + +inline InstrumentsPtr makeInstruments(const NonNegativeInteger &value) +{ + return std::make_shared(value); } + +inline InstrumentsPtr makeInstruments(NonNegativeInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class Instruments : public ElementInterface +{ + public: + Instruments(); + Instruments(const NonNegativeInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NonNegativeInteger getValue() const; + void setValue(const NonNegativeInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Interchangeable.cpp b/Sourcecode/private/mx/core/elements/Interchangeable.cpp index 14fd40be9..a9614c4cb 100644 --- a/Sourcecode/private/mx/core/elements/Interchangeable.cpp +++ b/Sourcecode/private/mx/core/elements/Interchangeable.cpp @@ -11,158 +11,150 @@ namespace mx { - namespace core - { - Interchangeable::Interchangeable() - :myAttributes( std::make_shared() ) - ,myTimeRelation( makeTimeRelation() ) - ,myHasTimeRelation( false ) - ,myBeats( makeBeats() ) - ,myBeatType( makeBeatType() ) - {} - - - bool Interchangeable::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Interchangeable::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Interchangeable::streamName( std::ostream& os ) const - { - os << "interchangeable"; - return os; - } - - - bool Interchangeable::hasContents() const - { - return true; - } - +namespace core +{ +Interchangeable::Interchangeable() + : myAttributes(std::make_shared()), myTimeRelation(makeTimeRelation()), + myHasTimeRelation(false), myBeats(makeBeats()), myBeatType(makeBeatType()) +{ +} - std::ostream& Interchangeable::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - if( myHasTimeRelation ) - { - os << std::endl; - myTimeRelation->toStream( os, indentLevel+1 ); - } - os << std::endl; - myBeats->toStream( os, indentLevel+1 ); - os << std::endl; - myBeatType->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } +bool Interchangeable::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Interchangeable::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - InterchangeableAttributesPtr Interchangeable::getAttributes() const - { - return myAttributes; - } +std::ostream &Interchangeable::streamName(std::ostream &os) const +{ + os << "interchangeable"; + return os; +} +bool Interchangeable::hasContents() const +{ + return true; +} - void Interchangeable::setAttributes( const InterchangeableAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Interchangeable::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + if (myHasTimeRelation) + { + os << std::endl; + myTimeRelation->toStream(os, indentLevel + 1); + } + os << std::endl; + myBeats->toStream(os, indentLevel + 1); + os << std::endl; + myBeatType->toStream(os, indentLevel + 1); + os << std::endl; + return os; +} +InterchangeableAttributesPtr Interchangeable::getAttributes() const +{ + return myAttributes; +} - TimeRelationPtr Interchangeable::getTimeRelation() const - { - return myTimeRelation; - } +void Interchangeable::setAttributes(const InterchangeableAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +TimeRelationPtr Interchangeable::getTimeRelation() const +{ + return myTimeRelation; +} - void Interchangeable::setTimeRelation( const TimeRelationPtr& value ) - { - if( value ) - { - myTimeRelation = value; - } - } +void Interchangeable::setTimeRelation(const TimeRelationPtr &value) +{ + if (value) + { + myTimeRelation = value; + } +} +bool Interchangeable::getHasTimeRelation() const +{ + return myHasTimeRelation; +} - bool Interchangeable::getHasTimeRelation() const - { - return myHasTimeRelation; - } +void Interchangeable::setHasTimeRelation(const bool value) +{ + myHasTimeRelation = value; +} +BeatsPtr Interchangeable::getBeats() const +{ + return myBeats; +} - void Interchangeable::setHasTimeRelation( const bool value ) - { - myHasTimeRelation = value; - } +void Interchangeable::setBeats(const BeatsPtr &value) +{ + if (value) + { + myBeats = value; + } +} +BeatTypePtr Interchangeable::getBeatType() const +{ + return myBeatType; +} - BeatsPtr Interchangeable::getBeats() const - { - return myBeats; - } +void Interchangeable::setBeatType(const BeatTypePtr &value) +{ + if (value) + { + myBeatType = value; + } +} +bool Interchangeable::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isBeatsFound = false; + bool isBeatTypeFound = false; - void Interchangeable::setBeats( const BeatsPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myTimeRelation, myHasTimeRelation)) { - if( value ) - { - myBeats = value; - } + continue; } - - - BeatTypePtr Interchangeable::getBeatType() const + if (importElement(message, *it, isSuccess, *myBeats, isBeatsFound)) { - return myBeatType; + continue; } - - - void Interchangeable::setBeatType( const BeatTypePtr& value ) + if (importElement(message, *it, isSuccess, *myBeatType, isBeatTypeFound)) { - if( value ) - { - myBeatType = value; - } + continue; } + } + if (!isBeatsFound) + { + message << "Interchangeable: '" << myBeats->getElementName() << "' is required but was not found" << std::endl; + } - bool Interchangeable::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isBeatsFound = false; - bool isBeatTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myTimeRelation, myHasTimeRelation ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBeats, isBeatsFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBeatType, isBeatTypeFound ) ) { continue; } - } - - if( !isBeatsFound ) - { - message << "Interchangeable: '" << myBeats->getElementName() << "' is required but was not found" << std::endl; - } - - if( !isBeatTypeFound ) - { - message << "Interchangeable: '" << myBeatType->getElementName() << "' is required but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - + if (!isBeatTypeFound) + { + message << "Interchangeable: '" << myBeatType->getElementName() << "' is required but was not found" + << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Interchangeable.h b/Sourcecode/private/mx/core/elements/Interchangeable.h index bb4ebd850..eb3bd4479 100644 --- a/Sourcecode/private/mx/core/elements/Interchangeable.h +++ b/Sourcecode/private/mx/core/elements/Interchangeable.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/InterchangeableAttributes.h" #include @@ -14,53 +14,56 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( InterchangeableAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BeatType ) - MX_FORWARD_DECLARE_ELEMENT( Beats ) - MX_FORWARD_DECLARE_ELEMENT( TimeRelation ) - MX_FORWARD_DECLARE_ELEMENT( Interchangeable ) +MX_FORWARD_DECLARE_ATTRIBUTES(InterchangeableAttributes) +MX_FORWARD_DECLARE_ELEMENT(BeatType) +MX_FORWARD_DECLARE_ELEMENT(Beats) +MX_FORWARD_DECLARE_ELEMENT(TimeRelation) +MX_FORWARD_DECLARE_ELEMENT(Interchangeable) - inline InterchangeablePtr makeInterchangeable() { return std::make_shared(); } +inline InterchangeablePtr makeInterchangeable() +{ + return std::make_shared(); +} - class Interchangeable : public ElementInterface - { - public: - Interchangeable(); +class Interchangeable : public ElementInterface +{ + public: + Interchangeable(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InterchangeableAttributesPtr getAttributes() const; - void setAttributes( const InterchangeableAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + InterchangeableAttributesPtr getAttributes() const; + void setAttributes(const InterchangeableAttributesPtr &value); - /* _________ TimeRelation minOccurs = 0, maxOccurs = 1 _________ */ - TimeRelationPtr getTimeRelation() const; - void setTimeRelation( const TimeRelationPtr& value ); - bool getHasTimeRelation() const; - void setHasTimeRelation( const bool value ); + /* _________ TimeRelation minOccurs = 0, maxOccurs = 1 _________ */ + TimeRelationPtr getTimeRelation() const; + void setTimeRelation(const TimeRelationPtr &value); + bool getHasTimeRelation() const; + void setHasTimeRelation(const bool value); - /* _________ Beats minOccurs = 1, maxOccurs = 1 _________ */ - BeatsPtr getBeats() const; - void setBeats( const BeatsPtr& value ); + /* _________ Beats minOccurs = 1, maxOccurs = 1 _________ */ + BeatsPtr getBeats() const; + void setBeats(const BeatsPtr &value); - /* _________ BeatType minOccurs = 1, maxOccurs = 1 _________ */ - BeatTypePtr getBeatType() const; - void setBeatType( const BeatTypePtr& value ); + /* _________ BeatType minOccurs = 1, maxOccurs = 1 _________ */ + BeatTypePtr getBeatType() const; + void setBeatType(const BeatTypePtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - InterchangeableAttributesPtr myAttributes; - TimeRelationPtr myTimeRelation; - bool myHasTimeRelation; - BeatsPtr myBeats; - BeatTypePtr myBeatType; - }; - } -} + private: + InterchangeableAttributesPtr myAttributes; + TimeRelationPtr myTimeRelation; + bool myHasTimeRelation; + BeatsPtr myBeats; + BeatTypePtr myBeatType; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp b/Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp index f1751f632..8664d5564 100644 --- a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp @@ -8,50 +8,50 @@ namespace mx { - namespace core - { - InterchangeableAttributes::InterchangeableAttributes() - :symbol() - ,separator() - ,hasSymbol( false ) - ,hasSeparator( false ) - {} +namespace core +{ +InterchangeableAttributes::InterchangeableAttributes() : symbol(), separator(), hasSymbol(false), hasSeparator(false) +{ +} +bool InterchangeableAttributes::hasValues() const +{ + return hasSymbol || hasSeparator; +} - bool InterchangeableAttributes::hasValues() const - { - return hasSymbol || - hasSeparator; - } +std::ostream &InterchangeableAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, symbol, "symbol", hasSymbol); + streamAttribute(os, separator, "separator", hasSeparator); + } + return os; +} +bool InterchangeableAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "InterchangeableAttributes"; + bool isSuccess = true; - std::ostream& InterchangeableAttributes::toStream( std::ostream& os ) const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, symbol, hasSymbol, "symbol", &parseTimeSymbol)) { - if ( hasValues() ) - { - streamAttribute( os, symbol, "symbol", hasSymbol ); - streamAttribute( os, separator, "separator", hasSeparator ); - } - return os; + continue; } - - - bool InterchangeableAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, separator, hasSeparator, "separator", + &parseTimeSeparator)) { - const char* const className = "InterchangeableAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, symbol, hasSymbol, "symbol", &parseTimeSymbol ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, separator, hasSeparator, "separator", &parseTimeSeparator ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.h b/Sourcecode/private/mx/core/elements/InterchangeableAttributes.h index da1d19fb8..3a8295f95 100644 --- a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.h +++ b/Sourcecode/private/mx/core/elements/InterchangeableAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,24 +14,24 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( InterchangeableAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(InterchangeableAttributes) - struct InterchangeableAttributes : public AttributesInterface - { - public: - InterchangeableAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TimeSymbol symbol; - TimeSeparator separator; - bool hasSymbol; - bool hasSeparator; +struct InterchangeableAttributes : public AttributesInterface +{ + public: + InterchangeableAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TimeSymbol symbol; + TimeSeparator separator; + bool hasSymbol; + bool hasSeparator; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Inversion.cpp b/Sourcecode/private/mx/core/elements/Inversion.cpp index ade20e040..3215e4876 100644 --- a/Sourcecode/private/mx/core/elements/Inversion.cpp +++ b/Sourcecode/private/mx/core/elements/Inversion.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - Inversion::Inversion() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Inversion::Inversion( const NonNegativeInteger& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Inversion::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Inversion::hasContents() const - { - return true; - } - - - std::ostream& Inversion::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Inversion::streamName( std::ostream& os ) const - { - os << "inversion"; - return os; - } - - - std::ostream& Inversion::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Inversion::Inversion() : myValue(), myAttributes(std::make_shared()) +{ +} +Inversion::Inversion(const NonNegativeInteger &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - InversionAttributesPtr Inversion::getAttributes() const - { - return myAttributes; - } +bool Inversion::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Inversion::hasContents() const +{ + return true; +} - void Inversion::setAttributes( const InversionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Inversion::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Inversion::streamName(std::ostream &os) const +{ + os << "inversion"; + return os; +} - NonNegativeInteger Inversion::getValue() const - { - return myValue; - } +std::ostream &Inversion::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +InversionAttributesPtr Inversion::getAttributes() const +{ + return myAttributes; +} - void Inversion::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } +void Inversion::setAttributes(const InversionAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +NonNegativeInteger Inversion::getValue() const +{ + return myValue; +} - bool Inversion::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - return isSuccess; - } +void Inversion::setValue(const NonNegativeInteger &value) +{ + myValue = value; +} - } +bool Inversion::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Inversion.h b/Sourcecode/private/mx/core/elements/Inversion.h index 6c9529f68..a0fe63fcc 100644 --- a/Sourcecode/private/mx/core/elements/Inversion.h +++ b/Sourcecode/private/mx/core/elements/Inversion.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/elements/InversionAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InversionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Inversion ) - - inline InversionPtr makeInversion() { return std::make_shared(); } - inline InversionPtr makeInversion( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline InversionPtr makeInversion( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Inversion : public ElementInterface - { - public: - Inversion(); - Inversion( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InversionAttributesPtr getAttributes() const; - void setAttributes( const InversionAttributesPtr& attributes ); - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - InversionAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(InversionAttributes) +MX_FORWARD_DECLARE_ELEMENT(Inversion) + +inline InversionPtr makeInversion() +{ + return std::make_shared(); +} + +inline InversionPtr makeInversion(const NonNegativeInteger &value) +{ + return std::make_shared(value); } + +inline InversionPtr makeInversion(NonNegativeInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class Inversion : public ElementInterface +{ + public: + Inversion(); + Inversion(const NonNegativeInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + InversionAttributesPtr getAttributes() const; + void setAttributes(const InversionAttributesPtr &attributes); + NonNegativeInteger getValue() const; + void setValue(const NonNegativeInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeInteger myValue; + InversionAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InversionAttributes.cpp b/Sourcecode/private/mx/core/elements/InversionAttributes.cpp index e7fc0b429..25f27fee3 100644 --- a/Sourcecode/private/mx/core/elements/InversionAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/InversionAttributes.cpp @@ -8,81 +8,85 @@ namespace mx { - namespace core +namespace core +{ +InversionAttributes::InversionAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false) +{ +} + +bool InversionAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight; +} + +std::ostream &InversionAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - InversionAttributes::InversionAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool InversionAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "InversionAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool InversionAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& InversionAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool InversionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "InversionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InversionAttributes.h b/Sourcecode/private/mx/core/elements/InversionAttributes.h index 07fa315cc..181b7d3c0 100644 --- a/Sourcecode/private/mx/core/elements/InversionAttributes.h +++ b/Sourcecode/private/mx/core/elements/InversionAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,36 +17,36 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( InversionAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(InversionAttributes) - struct InversionAttributes : public AttributesInterface - { - public: - InversionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct InversionAttributes : public AttributesInterface +{ + public: + InversionAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InvertedMordent.cpp b/Sourcecode/private/mx/core/elements/InvertedMordent.cpp index 23c373841..95d296e85 100644 --- a/Sourcecode/private/mx/core/elements/InvertedMordent.cpp +++ b/Sourcecode/private/mx/core/elements/InvertedMordent.cpp @@ -7,65 +7,57 @@ namespace mx { - namespace core - { - InvertedMordent::InvertedMordent() - :myAttributes( std::make_shared() ) - {} - - - bool InvertedMordent::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& InvertedMordent::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& InvertedMordent::streamName( std::ostream& os ) const - { - os << "inverted-mordent"; - return os; - } - - - bool InvertedMordent::hasContents() const - { - return false; - } +namespace core +{ +InvertedMordent::InvertedMordent() : myAttributes(std::make_shared()) +{ +} +bool InvertedMordent::hasAttributes() const +{ + return myAttributes->hasValues(); +} - std::ostream& InvertedMordent::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &InvertedMordent::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &InvertedMordent::streamName(std::ostream &os) const +{ + os << "inverted-mordent"; + return os; +} - InvertedMordentAttributesPtr InvertedMordent::getAttributes() const - { - return myAttributes; - } +bool InvertedMordent::hasContents() const +{ + return false; +} +std::ostream &InvertedMordent::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - void InvertedMordent::setAttributes( const InvertedMordentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool InvertedMordent::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +InvertedMordentAttributesPtr InvertedMordent::getAttributes() const +{ + return myAttributes; +} +void InvertedMordent::setAttributes(const InvertedMordentAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool InvertedMordent::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InvertedMordent.h b/Sourcecode/private/mx/core/elements/InvertedMordent.h index 7c2d040fb..c97b5958e 100644 --- a/Sourcecode/private/mx/core/elements/InvertedMordent.h +++ b/Sourcecode/private/mx/core/elements/InvertedMordent.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/InvertedMordentAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InvertedMordentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( InvertedMordent ) - - inline InvertedMordentPtr makeInvertedMordent() { return std::make_shared(); } - - class InvertedMordent : public ElementInterface - { - public: - InvertedMordent(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InvertedMordentAttributesPtr getAttributes() const; - void setAttributes( const InvertedMordentAttributesPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - InvertedMordentAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(InvertedMordentAttributes) +MX_FORWARD_DECLARE_ELEMENT(InvertedMordent) + +inline InvertedMordentPtr makeInvertedMordent() +{ + return std::make_shared(); } + +class InvertedMordent : public ElementInterface +{ + public: + InvertedMordent(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + InvertedMordentAttributesPtr getAttributes() const; + void setAttributes(const InvertedMordentAttributesPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + InvertedMordentAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp b/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp index 4b0c42a8d..c704174a7 100644 --- a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp @@ -4,146 +4,155 @@ #include "mx/core/elements/InvertedMordentAttributes.h" #include "mx/core/FromXElement.h" -#include "mx/core/FromXElement.h" #include namespace mx { - namespace core - { - InvertedMordentAttributes::InvertedMordentAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep( TrillStep::half ) - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,long_( YesNo::no ) - ,approach( AboveBelow::below ) - ,departure( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasLong( false ) - ,hasApproach( false ) - ,hasDeparture( false ) - {} - +namespace core +{ +InvertedMordentAttributes::InvertedMordentAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), placement(AboveBelow::below), + startNote(StartNote::main), trillStep(TrillStep::half), twoNoteTurn(TwoNoteTurn::none), accelerate(YesNo::no), + beats(), secondBeat(), lastBeat(), long_(YesNo::no), approach(AboveBelow::below), departure(AboveBelow::below), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasPlacement(false), + hasStartNote(false), hasTrillStep(false), hasTwoNoteTurn(false), hasAccelerate(false), hasBeats(false), + hasSecondBeat(false), hasLastBeat(false), hasLong(false), hasApproach(false), hasDeparture(false) +{ +} - bool InvertedMordentAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasLong || - hasApproach || - hasDeparture; - } +bool InvertedMordentAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPlacement || hasStartNote || hasTrillStep || hasTwoNoteTurn || + hasAccelerate || hasBeats || hasSecondBeat || hasLastBeat || hasLong || hasApproach || hasDeparture; +} +std::ostream &InvertedMordentAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, startNote, "start-note", hasStartNote); + streamAttribute(os, trillStep, "trill-step", hasTrillStep); + streamAttribute(os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn); + streamAttribute(os, accelerate, "accelerate", hasAccelerate); + streamAttribute(os, beats, "beats", hasBeats); + streamAttribute(os, secondBeat, "second-beat", hasSecondBeat); + streamAttribute(os, lastBeat, "last-beat", hasLastBeat); + streamAttribute(os, long_, "long", hasLong); + streamAttribute(os, approach, "approach", hasApproach); + streamAttribute(os, departure, "departure", hasDeparture); + } + return os; +} - std::ostream& InvertedMordentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, long_, "long", hasLong ); - streamAttribute( os, approach, "approach", hasApproach ); - streamAttribute( os, departure, "departure", hasDeparture ); - } - return os; - } +bool InvertedMordentAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "InvertedMordentAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool InvertedMordentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "InvertedMordentAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, long_, hasLong , "long", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, approach, hasApproach, "approach", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, departure, hasDeparture, "departure", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", + &parseTwoNoteTurn)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, beats, hasBeats, "beats")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, long_, hasLong, "long", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, approach, hasApproach, "approach", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, departure, hasDeparture, "departure", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h b/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h index fb22a775b..9d65570c4 100644 --- a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h +++ b/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,60 +18,60 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( InvertedMordentAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(InvertedMordentAttributes) - struct InvertedMordentAttributes : public AttributesInterface - { - public: - InvertedMordentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo long_; - AboveBelow approach; - AboveBelow departure; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasLong; - bool hasApproach; - bool hasDeparture; +struct InvertedMordentAttributes : public AttributesInterface +{ + public: + InvertedMordentAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + StartNote startNote; + TrillStep trillStep; + TwoNoteTurn twoNoteTurn; + YesNo accelerate; + TrillBeats beats; + Percent secondBeat; + Percent lastBeat; + YesNo long_; + AboveBelow approach; + AboveBelow departure; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; + bool hasStartNote; + bool hasTrillStep; + bool hasTwoNoteTurn; + bool hasAccelerate; + bool hasBeats; + bool hasSecondBeat; + bool hasLastBeat; + bool hasLong; + bool hasApproach; + bool hasDeparture; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InvertedTurn.cpp b/Sourcecode/private/mx/core/elements/InvertedTurn.cpp index b99ed7031..a02c50819 100644 --- a/Sourcecode/private/mx/core/elements/InvertedTurn.cpp +++ b/Sourcecode/private/mx/core/elements/InvertedTurn.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - InvertedTurn::InvertedTurn() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool InvertedTurn::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool InvertedTurn::hasContents() const { return false; } - std::ostream& InvertedTurn::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& InvertedTurn::streamName( std::ostream& os ) const { os << "inverted-turn"; return os; } - std::ostream& InvertedTurn::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +InvertedTurn::InvertedTurn() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool InvertedTurn::hasAttributes() const +{ + return myAttributes->hasValues(); +} - InvertedTurnAttributesPtr InvertedTurn::getAttributes() const - { - return myAttributes; - } +bool InvertedTurn::hasContents() const +{ + return false; +} +std::ostream &InvertedTurn::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void InvertedTurn::setAttributes( const InvertedTurnAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &InvertedTurn::streamName(std::ostream &os) const +{ + os << "inverted-turn"; + return os; +} +std::ostream &InvertedTurn::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool InvertedTurn::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +InvertedTurnAttributesPtr InvertedTurn::getAttributes() const +{ + return myAttributes; +} +void InvertedTurn::setAttributes(const InvertedTurnAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool InvertedTurn::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InvertedTurn.h b/Sourcecode/private/mx/core/elements/InvertedTurn.h index 50ce5733c..4c007b608 100644 --- a/Sourcecode/private/mx/core/elements/InvertedTurn.h +++ b/Sourcecode/private/mx/core/elements/InvertedTurn.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/InvertedTurnAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InvertedTurnAttributes ) - MX_FORWARD_DECLARE_ELEMENT( InvertedTurn ) - - inline InvertedTurnPtr makeInvertedTurn() { return std::make_shared(); } - - class InvertedTurn : public ElementInterface - { - public: - InvertedTurn(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InvertedTurnAttributesPtr getAttributes() const; - void setAttributes( const InvertedTurnAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - InvertedTurnAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(InvertedTurnAttributes) +MX_FORWARD_DECLARE_ELEMENT(InvertedTurn) + +inline InvertedTurnPtr makeInvertedTurn() +{ + return std::make_shared(); } + +class InvertedTurn : public ElementInterface +{ + public: + InvertedTurn(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + InvertedTurnAttributesPtr getAttributes() const; + void setAttributes(const InvertedTurnAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + InvertedTurnAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp b/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp index fd3a96718..24d50a224 100644 --- a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp @@ -8,126 +8,135 @@ namespace mx { - namespace core - { - InvertedTurnAttributes::InvertedTurnAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep() - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,slash( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasSlash( false ) - {} - +namespace core +{ +InvertedTurnAttributes::InvertedTurnAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), placement(AboveBelow::below), + startNote(StartNote::main), trillStep(), twoNoteTurn(TwoNoteTurn::none), accelerate(YesNo::no), beats(), + secondBeat(), lastBeat(), slash(YesNo::no), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasPlacement(false), hasStartNote(false), hasTrillStep(false), hasTwoNoteTurn(false), hasAccelerate(false), + hasBeats(false), hasSecondBeat(false), hasLastBeat(false), hasSlash(false) +{ +} - bool InvertedTurnAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasSlash; - } +bool InvertedTurnAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement || hasStartNote || hasTrillStep || hasTwoNoteTurn || hasAccelerate || + hasBeats || hasSecondBeat || hasLastBeat || hasSlash; +} +std::ostream &InvertedTurnAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, startNote, "start-note", hasStartNote); + streamAttribute(os, trillStep, "trill-step", hasTrillStep); + streamAttribute(os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn); + streamAttribute(os, accelerate, "accelerate", hasAccelerate); + streamAttribute(os, beats, "beats", hasBeats); + streamAttribute(os, secondBeat, "second-beat", hasSecondBeat); + streamAttribute(os, lastBeat, "last-beat", hasLastBeat); + streamAttribute(os, slash, "slash", hasSlash); + } + return os; +} - std::ostream& InvertedTurnAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, slash, "slash", hasSlash ); - } - return os; - } +bool InvertedTurnAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "InvertedTurnAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool InvertedTurnAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "InvertedTurnAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo ) ) { continue; } - } - - - return isSuccess; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", + &parseTwoNoteTurn)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, beats, hasBeats, "beats")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h b/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h index 1a7c39bea..95e5af3d9 100644 --- a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h +++ b/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,54 +17,54 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( InvertedTurnAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(InvertedTurnAttributes) - struct InvertedTurnAttributes : public AttributesInterface - { - public: - InvertedTurnAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo slash; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasSlash; +struct InvertedTurnAttributes : public AttributesInterface +{ + public: + InvertedTurnAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + StartNote startNote; + TrillStep trillStep; + TwoNoteTurn twoNoteTurn; + YesNo accelerate; + TrillBeats beats; + Percent secondBeat; + Percent lastBeat; + YesNo slash; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; + bool hasStartNote; + bool hasTrillStep; + bool hasTwoNoteTurn; + bool hasAccelerate; + bool hasBeats; + bool hasSecondBeat; + bool hasLastBeat; + bool hasSlash; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Ipa.cpp b/Sourcecode/private/mx/core/elements/Ipa.cpp index e2cf083dc..8994b396b 100644 --- a/Sourcecode/private/mx/core/elements/Ipa.cpp +++ b/Sourcecode/private/mx/core/elements/Ipa.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Ipa::Ipa() - :myValue() - {} - - - Ipa::Ipa( const XsString& value ) - :myValue( value ) - {} - - - bool Ipa::hasAttributes() const - { - return false; - } - - - bool Ipa::hasContents() const - { - return true; - } - - - std::ostream& Ipa::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Ipa::streamName( std::ostream& os ) const - { - os << "ipa"; - return os; - } +namespace core +{ +Ipa::Ipa() : myValue() +{ +} +Ipa::Ipa(const XsString &value) : myValue(value) +{ +} - std::ostream& Ipa::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Ipa::hasAttributes() const +{ + return false; +} +bool Ipa::hasContents() const +{ + return true; +} - XsString Ipa::getValue() const - { - return myValue; - } +std::ostream &Ipa::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Ipa::streamName(std::ostream &os) const +{ + os << "ipa"; + return os; +} - void Ipa::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &Ipa::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString Ipa::getValue() const +{ + return myValue; +} - bool Ipa::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void Ipa::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Ipa::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Ipa.h b/Sourcecode/private/mx/core/elements/Ipa.h index 4c2c8917a..124af7d8e 100644 --- a/Sourcecode/private/mx/core/elements/Ipa.h +++ b/Sourcecode/private/mx/core/elements/Ipa.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Ipa ) - - inline IpaPtr makeIpa() { return std::make_shared(); } - inline IpaPtr makeIpa( const XsString& value ) { return std::make_shared( value ); } - inline IpaPtr makeIpa( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Ipa : public ElementInterface - { - public: - Ipa(); - Ipa( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Ipa) + +inline IpaPtr makeIpa() +{ + return std::make_shared(); +} + +inline IpaPtr makeIpa(const XsString &value) +{ + return std::make_shared(value); } + +inline IpaPtr makeIpa(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Ipa : public ElementInterface +{ + public: + Ipa(); + Ipa(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Key.cpp b/Sourcecode/private/mx/core/elements/Key.cpp index 32477351a..43bb29f04 100644 --- a/Sourcecode/private/mx/core/elements/Key.cpp +++ b/Sourcecode/private/mx/core/elements/Key.cpp @@ -4,278 +4,270 @@ #include "mx/core/elements/Key.h" #include "mx/core/FromXElement.h" -#include "mx/core/elements/KeyChoice.h" -#include "mx/core/elements/KeyOctave.h" -#include "mx/core/elements/TraditionalKey.h" -#include "mx/core/elements/NonTraditionalKey.h" #include "mx/core/elements/Cancel.h" -#include "mx/core/elements/Mode.h" #include "mx/core/elements/Fifths.h" #include "mx/core/elements/KeyAccidental.h" #include "mx/core/elements/KeyAlter.h" +#include "mx/core/elements/KeyChoice.h" +#include "mx/core/elements/KeyOctave.h" #include "mx/core/elements/KeyStep.h" +#include "mx/core/elements/Mode.h" +#include "mx/core/elements/NonTraditionalKey.h" +#include "mx/core/elements/TraditionalKey.h" #include namespace mx { - namespace core - { - Key::Key() - :myAttributes( std::make_shared() ) - ,myKeyChoice( std::make_shared() ) - ,myKeyOctaveSet() - {} +namespace core +{ +Key::Key() + : myAttributes(std::make_shared()), myKeyChoice(std::make_shared()), myKeyOctaveSet() +{ +} + +bool Key::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Key::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - bool Key::hasAttributes() const - { - return myAttributes->hasValues(); - } +std::ostream &Key::streamName(std::ostream &os) const +{ + os << "key"; + return os; +} +bool Key::hasContents() const +{ + return myKeyChoice->hasContents() || myKeyOctaveSet.size() > 0; +} - std::ostream& Key::streamAttributes( std::ostream& os ) const +std::ostream &Key::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myKeyChoice->hasContents()) + { + os << std::endl; + if (myKeyChoice) { - return myAttributes->toStream( os ); + myKeyChoice->streamContents(os, indentLevel + 1, isOneLineOnly); } - - - std::ostream& Key::streamName( std::ostream& os ) const + os << std::endl; + } + for (auto it = myKeyOctaveSet.cbegin(); it != myKeyOctaveSet.cend(); ++it) + { + if (it == myKeyOctaveSet.cbegin()) { - os << "key"; - return os; + os << std::endl; } + (*it)->toStream(os, indentLevel + 1); + os << std::endl; + } + if (myKeyChoice->hasContents()) + { + isOneLineOnly = false; + } + if (myKeyOctaveSet.size() > 0) + { + isOneLineOnly = false; + } + return os; +} +KeyAttributesPtr Key::getAttributes() const +{ + return myAttributes; +} - bool Key::hasContents() const - { - return myKeyChoice->hasContents() || myKeyOctaveSet.size() > 0; - } +void Key::setAttributes(const KeyAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +KeyChoicePtr Key::getKeyChoice() const +{ + return myKeyChoice; +} - std::ostream& Key::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myKeyChoice->hasContents() ) - { - os << std::endl; - if ( myKeyChoice ) - { - myKeyChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - } - for ( auto it = myKeyOctaveSet.cbegin(); - it != myKeyOctaveSet.cend(); - ++it ) - { - if ( it == myKeyOctaveSet.cbegin() ) - { - os << std::endl; - } - (*it)->toStream( os, indentLevel+1 ); - os << std::endl; - } - if ( myKeyChoice->hasContents() ) - { - isOneLineOnly = false; - } - if ( myKeyOctaveSet.size() > 0 ) - { - isOneLineOnly = false; - } - return os; - } +void Key::setKeyChoice(const KeyChoicePtr &value) +{ + if (value) + { + myKeyChoice = value; + } +} +const KeyOctaveSet &Key::getKeyOctaveSet() const +{ + return myKeyOctaveSet; +} - KeyAttributesPtr Key::getAttributes() const - { - return myAttributes; - } +void Key::removeKeyOctave(const KeyOctaveSetIterConst &value) +{ + if (value != myKeyOctaveSet.cend()) + { + myKeyOctaveSet.erase(value); + } +} +void Key::addKeyOctave(const KeyOctavePtr &value) +{ + if (value) + { + myKeyOctaveSet.push_back(value); + } +} - void Key::setAttributes( const KeyAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +void Key::clearKeyOctaveSet() +{ + myKeyOctaveSet.clear(); +} +bool Key::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - KeyChoicePtr Key::getKeyChoice() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importTraditionalKey(message, it, endIter, isSuccess)) { - return myKeyChoice; + continue; } - - - void Key::setKeyChoice( const KeyChoicePtr& value ) + if (importNonTraditionalKey(message, it, endIter, isSuccess)) { - if ( value ) - { - myKeyChoice = value; - } + continue; } - - - const KeyOctaveSet& Key::getKeyOctaveSet() const + if (importElementSet(message, it, endIter, isSuccess, "key-octave", myKeyOctaveSet)) { - return myKeyOctaveSet; + continue; } + } + MX_RETURN_IS_SUCCESS; +} - void Key::removeKeyOctave( const KeyOctaveSetIterConst& value ) - { - if ( value != myKeyOctaveSet.cend() ) - { - myKeyOctaveSet.erase( value ); - } - } +bool Key::importTraditionalKey(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess) +{ + if (iter == endIter) + { + return false; + } + if (iter->getName() != "cancel" && iter->getName() != "fifths" && iter->getName() != "mode") + { + return false; + } - void Key::addKeyOctave( const KeyOctavePtr& value ) - { - if ( value ) - { - myKeyOctaveSet.push_back( value ); - } - } + bool isIterIncremented = false; + + if (iter != endIter && iter->getName() == "cancel") + { + myKeyChoice->setChoice(KeyChoice::Choice::traditionalKey); + myKeyChoice->getTraditionalKey()->setHasCancel(true); + isSuccess &= myKeyChoice->getTraditionalKey()->getCancel()->fromXElement(message, *iter); + isIterIncremented = true; + ++iter; + } + + if (iter != endIter && iter->getName() == "fifths") + { + myKeyChoice->setChoice(KeyChoice::Choice::traditionalKey); + isSuccess &= myKeyChoice->getTraditionalKey()->getFifths()->fromXElement(message, *iter); + isIterIncremented = true; + ++iter; + } + if (iter != endIter && iter->getName() == "mode") + { + myKeyChoice->setChoice(KeyChoice::Choice::traditionalKey); + myKeyChoice->getTraditionalKey()->setHasMode(true); + isSuccess &= myKeyChoice->getTraditionalKey()->getMode()->fromXElement(message, *iter); + isIterIncremented = true; + ++iter; + } + + if (isIterIncremented) + { + --iter; + } + + return true; +} + +bool Key::importNonTraditionalKey(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess) +{ + if (iter == endIter) + { + return false; + } - void Key::clearKeyOctaveSet() + if (iter->getName() != "key-step" && iter->getName() != "key-alter" && iter->getName() != "key-accidental") + { + return false; + } + + bool isIterIncremented = false; + bool isFirstItemAdded = false; + + while (iter != endIter && + (iter->getName() == "key-step" || iter->getName() == "key-alter" || iter->getName() == "key-accidental")) + { + auto item = makeNonTraditionalKey(); + const auto &items = myKeyChoice->getNonTraditionalKeySet(); + myKeyChoice->setChoice(KeyChoice::Choice::nonTraditionalKey); + + if (iter != endIter && iter->getName() == "key-step") { - myKeyOctaveSet.clear(); + isSuccess &= item->getKeyStep()->fromXElement(message, *iter); + isIterIncremented = true; + ++iter; } - - bool Key::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (iter != endIter && iter->getName() == "key-alter") { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importTraditionalKey( message, it, endIter, isSuccess ) ) { continue; } - if ( importNonTraditionalKey( message, it, endIter, isSuccess ) ) { continue; } - if ( importElementSet( message, it, endIter, isSuccess, "key-octave", myKeyOctaveSet ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + isSuccess &= item->getKeyAlter()->fromXElement(message, *iter); + isIterIncremented = true; + ++iter; } - - bool Key::importTraditionalKey( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ) + if (iter != endIter && iter->getName() == "key-accidental") { - if( iter == endIter ) - { - return false; - } - - if( iter->getName() != "cancel" && iter->getName() != "fifths" && iter->getName() != "mode" ) - { - return false; - } - - bool isIterIncremented = false; - - if( iter != endIter && iter->getName() == "cancel" ) - { - myKeyChoice->setChoice( KeyChoice::Choice::traditionalKey ); - myKeyChoice->getTraditionalKey()->setHasCancel( true ); - isSuccess &= myKeyChoice->getTraditionalKey()->getCancel()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "fifths" ) - { - myKeyChoice->setChoice( KeyChoice::Choice::traditionalKey ); - isSuccess &= myKeyChoice->getTraditionalKey()->getFifths()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "mode" ) - { - myKeyChoice->setChoice( KeyChoice::Choice::traditionalKey ); - myKeyChoice->getTraditionalKey()->setHasMode( true ); - isSuccess &= myKeyChoice->getTraditionalKey()->getMode()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( isIterIncremented ) - { - --iter; - } - - return true; + item->setHasKeyAccidental(true); + isSuccess &= item->getKeyAccidental()->fromXElement(message, *iter); + isIterIncremented = true; + ++iter; } - - bool Key::importNonTraditionalKey( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ) + if (!isFirstItemAdded && items.size() == 1) { - if( iter == endIter ) - { - return false; - } - - if( iter->getName() != "key-step" && iter->getName() != "key-alter" && iter->getName() != "key-accidental" ) - { - return false; - } - - bool isIterIncremented = false; - bool isFirstItemAdded = false; - - while ( iter != endIter && ( iter->getName() == "key-step" || iter->getName() == "key-alter" || iter->getName() == "key-accidental" ) ) - { - auto item = makeNonTraditionalKey(); - const auto& items = myKeyChoice->getNonTraditionalKeySet(); - myKeyChoice->setChoice( KeyChoice::Choice::nonTraditionalKey ); - - if( iter != endIter && iter->getName() == "key-step" ) - { - isSuccess &= item->getKeyStep()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "key-alter" ) - { - isSuccess &= item->getKeyAlter()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "key-accidental" ) - { - item->setHasKeyAccidental( true ); - isSuccess &= item->getKeyAccidental()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( !isFirstItemAdded && items.size() == 1 ) - { - myKeyChoice->addNonTraditionalKey( item ); - myKeyChoice->removeNonTraditionalKey( items.cbegin() ); - isFirstItemAdded = true; - } - else - { - myKeyChoice->addNonTraditionalKey( item ); - isFirstItemAdded = true; - } - } - - if( isIterIncremented ) - { - --iter; - } - - return true; + myKeyChoice->addNonTraditionalKey(item); + myKeyChoice->removeNonTraditionalKey(items.cbegin()); + isFirstItemAdded = true; + } + else + { + myKeyChoice->addNonTraditionalKey(item); + isFirstItemAdded = true; } - - } + + if (isIterIncremented) + { + --iter; + } + + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Key.h b/Sourcecode/private/mx/core/elements/Key.h index 47214a002..de6182e45 100644 --- a/Sourcecode/private/mx/core/elements/Key.h +++ b/Sourcecode/private/mx/core/elements/Key.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/KeyAttributes.h" #include @@ -14,50 +14,55 @@ namespace ezxml { - class XElementIterator; +class XElementIterator; } namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KeyAttributes ) - MX_FORWARD_DECLARE_ELEMENT( KeyChoice ) - MX_FORWARD_DECLARE_ELEMENT( KeyOctave ) - MX_FORWARD_DECLARE_ELEMENT( Key ) - - inline KeyPtr makeKey() { return std::make_shared(); } - - class Key : public ElementInterface - { - public: - Key(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - KeyAttributesPtr getAttributes() const; - void setAttributes( const KeyAttributesPtr& value ); - KeyChoicePtr getKeyChoice() const; - void setKeyChoice( const KeyChoicePtr& value ); - const KeyOctaveSet& getKeyOctaveSet() const; - void removeKeyOctave( const KeyOctaveSetIterConst& value ); - void addKeyOctave( const KeyOctavePtr& value ); - void clearKeyOctaveSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - KeyAttributesPtr myAttributes; - KeyChoicePtr myKeyChoice; - KeyOctaveSet myKeyOctaveSet; - - bool importTraditionalKey( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ); - bool importNonTraditionalKey( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(KeyAttributes) +MX_FORWARD_DECLARE_ELEMENT(KeyChoice) +MX_FORWARD_DECLARE_ELEMENT(KeyOctave) +MX_FORWARD_DECLARE_ELEMENT(Key) + +inline KeyPtr makeKey() +{ + return std::make_shared(); } + +class Key : public ElementInterface +{ + public: + Key(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + KeyAttributesPtr getAttributes() const; + void setAttributes(const KeyAttributesPtr &value); + KeyChoicePtr getKeyChoice() const; + void setKeyChoice(const KeyChoicePtr &value); + const KeyOctaveSet &getKeyOctaveSet() const; + void removeKeyOctave(const KeyOctaveSetIterConst &value); + void addKeyOctave(const KeyOctavePtr &value); + void clearKeyOctaveSet(); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + KeyAttributesPtr myAttributes; + KeyChoicePtr myKeyChoice; + KeyOctaveSet myKeyOctaveSet; + + bool importTraditionalKey(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess); + bool importNonTraditionalKey(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyAccidental.cpp b/Sourcecode/private/mx/core/elements/KeyAccidental.cpp index a5d545c0a..80b5d1373 100644 --- a/Sourcecode/private/mx/core/elements/KeyAccidental.cpp +++ b/Sourcecode/private/mx/core/elements/KeyAccidental.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - KeyAccidental::KeyAccidental() - :myValue( AccidentalValue::natural ) - {} - - - KeyAccidental::KeyAccidental( const AccidentalValue& value ) - :myValue( value ) - {} - - - bool KeyAccidental::hasAttributes() const - { - return false; - } - - - bool KeyAccidental::hasContents() const - { - return true; - } - - - std::ostream& KeyAccidental::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& KeyAccidental::streamName( std::ostream& os ) const - { - os << "key-accidental"; - return os; - } +namespace core +{ +KeyAccidental::KeyAccidental() : myValue(AccidentalValue::natural) +{ +} +KeyAccidental::KeyAccidental(const AccidentalValue &value) : myValue(value) +{ +} - std::ostream& KeyAccidental::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool KeyAccidental::hasAttributes() const +{ + return false; +} +bool KeyAccidental::hasContents() const +{ + return true; +} - AccidentalValue KeyAccidental::getValue() const - { - return myValue; - } +std::ostream &KeyAccidental::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &KeyAccidental::streamName(std::ostream &os) const +{ + os << "key-accidental"; + return os; +} - void KeyAccidental::setValue( const AccidentalValue& value ) - { - myValue = value; - } +std::ostream &KeyAccidental::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +AccidentalValue KeyAccidental::getValue() const +{ + return myValue; +} - bool KeyAccidental::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseAccidentalValue( xelement.getValue() ); - return true; - } +void KeyAccidental::setValue(const AccidentalValue &value) +{ + myValue = value; +} - } +bool KeyAccidental::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseAccidentalValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyAccidental.h b/Sourcecode/private/mx/core/elements/KeyAccidental.h index 0aa01193d..bc6c59961 100644 --- a/Sourcecode/private/mx/core/elements/KeyAccidental.h +++ b/Sourcecode/private/mx/core/elements/KeyAccidental.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( KeyAccidental ) - - inline KeyAccidentalPtr makeKeyAccidental() { return std::make_shared(); } - inline KeyAccidentalPtr makeKeyAccidental( const AccidentalValue& value ) { return std::make_shared( value ); } - inline KeyAccidentalPtr makeKeyAccidental( AccidentalValue&& value ) { return std::make_shared( std::move( value ) ); } - - class KeyAccidental : public ElementInterface - { - public: - KeyAccidental(); - KeyAccidental( const AccidentalValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccidentalValue getValue() const; - void setValue( const AccidentalValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccidentalValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(KeyAccidental) + +inline KeyAccidentalPtr makeKeyAccidental() +{ + return std::make_shared(); +} + +inline KeyAccidentalPtr makeKeyAccidental(const AccidentalValue &value) +{ + return std::make_shared(value); } + +inline KeyAccidentalPtr makeKeyAccidental(AccidentalValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class KeyAccidental : public ElementInterface +{ + public: + KeyAccidental(); + KeyAccidental(const AccidentalValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + AccidentalValue getValue() const; + void setValue(const AccidentalValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + AccidentalValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyAlter.cpp b/Sourcecode/private/mx/core/elements/KeyAlter.cpp index a412f0e0f..ac293ad40 100644 --- a/Sourcecode/private/mx/core/elements/KeyAlter.cpp +++ b/Sourcecode/private/mx/core/elements/KeyAlter.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - KeyAlter::KeyAlter() - :myValue() - {} - - - KeyAlter::KeyAlter( const Semitones& value ) - :myValue( value ) - {} - - - bool KeyAlter::hasAttributes() const - { - return false; - } - - - bool KeyAlter::hasContents() const - { - return true; - } - - - std::ostream& KeyAlter::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& KeyAlter::streamName( std::ostream& os ) const - { - os << "key-alter"; - return os; - } +namespace core +{ +KeyAlter::KeyAlter() : myValue() +{ +} +KeyAlter::KeyAlter(const Semitones &value) : myValue(value) +{ +} - std::ostream& KeyAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool KeyAlter::hasAttributes() const +{ + return false; +} +bool KeyAlter::hasContents() const +{ + return true; +} - Semitones KeyAlter::getValue() const - { - return myValue; - } +std::ostream &KeyAlter::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &KeyAlter::streamName(std::ostream &os) const +{ + os << "key-alter"; + return os; +} - void KeyAlter::setValue( const Semitones& value ) - { - myValue = value; - } +std::ostream &KeyAlter::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Semitones KeyAlter::getValue() const +{ + return myValue; +} - bool KeyAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void KeyAlter::setValue(const Semitones &value) +{ + myValue = value; +} - } +bool KeyAlter::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyAlter.h b/Sourcecode/private/mx/core/elements/KeyAlter.h index bd0ca5861..aff8b63ab 100644 --- a/Sourcecode/private/mx/core/elements/KeyAlter.h +++ b/Sourcecode/private/mx/core/elements/KeyAlter.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( KeyAlter ) - - inline KeyAlterPtr makeKeyAlter() { return std::make_shared(); } - inline KeyAlterPtr makeKeyAlter( const Semitones& value ) { return std::make_shared( value ); } - inline KeyAlterPtr makeKeyAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class KeyAlter : public ElementInterface - { - public: - KeyAlter(); - KeyAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(KeyAlter) + +inline KeyAlterPtr makeKeyAlter() +{ + return std::make_shared(); } + +inline KeyAlterPtr makeKeyAlter(const Semitones &value) +{ + return std::make_shared(value); +} + +inline KeyAlterPtr makeKeyAlter(Semitones &&value) +{ + return std::make_shared(std::move(value)); +} + +class KeyAlter : public ElementInterface +{ + public: + KeyAlter(); + KeyAlter(const Semitones &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Semitones getValue() const; + void setValue(const Semitones &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Semitones myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyAttributes.cpp b/Sourcecode/private/mx/core/elements/KeyAttributes.cpp index e67364904..e5a0cd388 100644 --- a/Sourcecode/private/mx/core/elements/KeyAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/KeyAttributes.cpp @@ -8,98 +8,100 @@ namespace mx { - namespace core +namespace core +{ +KeyAttributes::KeyAttributes() + : number(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), printObject(YesNo::no), hasNumber(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasPrintObject(false) +{ +} + +bool KeyAttributes::hasValues() const +{ + return hasNumber || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight || hasColor || hasPrintObject; +} + +std::ostream &KeyAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - KeyAttributes::KeyAttributes() - :number() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject( YesNo::no ) - ,hasNumber( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - { + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} - } +bool KeyAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "KeyAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool KeyAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject; + continue; } - - - std::ostream& KeyAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; + continue; } - - - bool KeyAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "KeyAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyAttributes.h b/Sourcecode/private/mx/core/elements/KeyAttributes.h index 36090dfd8..64e40c19e 100644 --- a/Sourcecode/private/mx/core/elements/KeyAttributes.h +++ b/Sourcecode/private/mx/core/elements/KeyAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -19,42 +19,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( KeyAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(KeyAttributes) - struct KeyAttributes : public AttributesInterface - { - public: - KeyAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - bool hasNumber; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; +struct KeyAttributes : public AttributesInterface +{ + public: + KeyAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StaffNumber number; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + YesNo printObject; + bool hasNumber; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyChoice.cpp b/Sourcecode/private/mx/core/elements/KeyChoice.cpp index 9140c3b5a..75076ba78 100644 --- a/Sourcecode/private/mx/core/elements/KeyChoice.cpp +++ b/Sourcecode/private/mx/core/elements/KeyChoice.cpp @@ -10,127 +10,110 @@ namespace mx { - namespace core - { - KeyChoice::KeyChoice() - :myChoice( Choice::traditionalKey ) - ,myTraditionalKey( std::make_shared() ) - ,myNonTraditionalKeySet() - {} - - - bool KeyChoice::hasAttributes() const - { - return false; - } - +namespace core +{ +KeyChoice::KeyChoice() + : myChoice(Choice::traditionalKey), myTraditionalKey(std::make_shared()), myNonTraditionalKeySet() +{ +} - std::ostream& KeyChoice::streamAttributes( std::ostream& os ) const - { - return os; - } +bool KeyChoice::hasAttributes() const +{ + return false; +} +std::ostream &KeyChoice::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& KeyChoice::streamName( std::ostream& os ) const - { - return os; - } +std::ostream &KeyChoice::streamName(std::ostream &os) const +{ + return os; +} +bool KeyChoice::hasContents() const +{ + return true; +} - bool KeyChoice::hasContents() const +std::ostream &KeyChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myChoice == Choice::traditionalKey) + { + if (myTraditionalKey) { - return true; + myTraditionalKey->streamContents(os, indentLevel, isOneLineOnly); } - - - std::ostream& KeyChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const + } + else if (myChoice == Choice::nonTraditionalKey) + { + for (auto it = myNonTraditionalKeySet.cbegin(); it != myNonTraditionalKeySet.cend(); ++it) { - if ( myChoice == Choice::traditionalKey ) + if (it != myNonTraditionalKeySet.cbegin()) { - if ( myTraditionalKey ) - { - myTraditionalKey->streamContents( os, indentLevel, isOneLineOnly ); - } + os << std::endl; } - else if ( myChoice == Choice::nonTraditionalKey ) - { - for ( auto it = myNonTraditionalKeySet.cbegin(); - it != myNonTraditionalKeySet.cend(); - ++it ) - { - if ( it != myNonTraditionalKeySet.cbegin() ) - { - os << std::endl; - } - (*it)->streamContents( os, indentLevel, isOneLineOnly ); - } - if ( myNonTraditionalKeySet.size() > 1 ) - { - isOneLineOnly = false; - } - } - return os; + (*it)->streamContents(os, indentLevel, isOneLineOnly); } - - - KeyChoice::Choice KeyChoice::getChoice() const - { - return myChoice; - } - - - void KeyChoice::setChoice( const Choice value ) - { - myChoice = value; - } - - - TraditionalKeyPtr KeyChoice::getTraditionalKey() const - { - return myTraditionalKey; - } - - - void KeyChoice::setTraditionalKey( const TraditionalKeyPtr& value ) + if (myNonTraditionalKeySet.size() > 1) { - if ( value ) - { - myTraditionalKey = value; - } + isOneLineOnly = false; } + } + return os; +} +KeyChoice::Choice KeyChoice::getChoice() const +{ + return myChoice; +} - const NonTraditionalKeySet& KeyChoice::getNonTraditionalKeySet() const - { - return myNonTraditionalKeySet; - } - +void KeyChoice::setChoice(const Choice value) +{ + myChoice = value; +} - void KeyChoice::removeNonTraditionalKey( const NonTraditionalKeySetIterConst& value ) - { - if ( value != myNonTraditionalKeySet.cend() ) - { - myNonTraditionalKeySet.erase( value ); - } - } +TraditionalKeyPtr KeyChoice::getTraditionalKey() const +{ + return myTraditionalKey; +} +void KeyChoice::setTraditionalKey(const TraditionalKeyPtr &value) +{ + if (value) + { + myTraditionalKey = value; + } +} - void KeyChoice::addNonTraditionalKey( const NonTraditionalKeyPtr& value ) - { - if ( value ) - { - myNonTraditionalKeySet.push_back( value ); - } - } +const NonTraditionalKeySet &KeyChoice::getNonTraditionalKeySet() const +{ + return myNonTraditionalKeySet; +} +void KeyChoice::removeNonTraditionalKey(const NonTraditionalKeySetIterConst &value) +{ + if (value != myNonTraditionalKeySet.cend()) + { + myNonTraditionalKeySet.erase(value); + } +} - void KeyChoice::clearNonTraditionalKeySet() - { - myNonTraditionalKeySet.clear(); - } +void KeyChoice::addNonTraditionalKey(const NonTraditionalKeyPtr &value) +{ + if (value) + { + myNonTraditionalKeySet.push_back(value); + } +} +void KeyChoice::clearNonTraditionalKeySet() +{ + myNonTraditionalKeySet.clear(); +} - MX_FROM_XELEMENT_UNUSED( KeyChoice ); +MX_FROM_XELEMENT_UNUSED(KeyChoice); - } -} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyChoice.h b/Sourcecode/private/mx/core/elements/KeyChoice.h index 0ce010091..1107897d2 100644 --- a/Sourcecode/private/mx/core/elements/KeyChoice.h +++ b/Sourcecode/private/mx/core/elements/KeyChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,48 +13,50 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(NonTraditionalKey) +MX_FORWARD_DECLARE_ELEMENT(TraditionalKey) +MX_FORWARD_DECLARE_ELEMENT(KeyChoice) - MX_FORWARD_DECLARE_ELEMENT( NonTraditionalKey ) - MX_FORWARD_DECLARE_ELEMENT( TraditionalKey ) - MX_FORWARD_DECLARE_ELEMENT( KeyChoice ) - - inline KeyChoicePtr makeKeyChoice() { return std::make_shared(); } - - class KeyChoice : public ElementInterface - { - public: - enum class Choice - { - traditionalKey = 0, - nonTraditionalKey = 1 - }; - KeyChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Choice getChoice() const; - void setChoice( const Choice value ); - TraditionalKeyPtr getTraditionalKey() const; - void setTraditionalKey( const TraditionalKeyPtr& value ); - - const NonTraditionalKeySet& getNonTraditionalKeySet() const; - void removeNonTraditionalKey( const NonTraditionalKeySetIterConst& value ); - void addNonTraditionalKey( const NonTraditionalKeyPtr& value ); - void clearNonTraditionalKeySet(); - - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - TraditionalKeyPtr myTraditionalKey; - NonTraditionalKeySet myNonTraditionalKeySet; - }; - } +inline KeyChoicePtr makeKeyChoice() +{ + return std::make_shared(); } + +class KeyChoice : public ElementInterface +{ + public: + enum class Choice + { + traditionalKey = 0, + nonTraditionalKey = 1 + }; + KeyChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Choice getChoice() const; + void setChoice(const Choice value); + TraditionalKeyPtr getTraditionalKey() const; + void setTraditionalKey(const TraditionalKeyPtr &value); + + const NonTraditionalKeySet &getNonTraditionalKeySet() const; + void removeNonTraditionalKey(const NonTraditionalKeySetIterConst &value); + void addNonTraditionalKey(const NonTraditionalKeyPtr &value); + void clearNonTraditionalKeySet(); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + TraditionalKeyPtr myTraditionalKey; + NonTraditionalKeySet myNonTraditionalKeySet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyOctave.cpp b/Sourcecode/private/mx/core/elements/KeyOctave.cpp index afe7f2219..498029858 100644 --- a/Sourcecode/private/mx/core/elements/KeyOctave.cpp +++ b/Sourcecode/private/mx/core/elements/KeyOctave.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - KeyOctave::KeyOctave() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - KeyOctave::KeyOctave( const OctaveValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool KeyOctave::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool KeyOctave::hasContents() const - { - return true; - } - - - std::ostream& KeyOctave::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& KeyOctave::streamName( std::ostream& os ) const - { - os << "key-octave"; - return os; - } - - - std::ostream& KeyOctave::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +KeyOctave::KeyOctave() : myValue(), myAttributes(std::make_shared()) +{ +} +KeyOctave::KeyOctave(const OctaveValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - KeyOctaveAttributesPtr KeyOctave::getAttributes() const - { - return myAttributes; - } +bool KeyOctave::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool KeyOctave::hasContents() const +{ + return true; +} - void KeyOctave::setAttributes( const KeyOctaveAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &KeyOctave::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &KeyOctave::streamName(std::ostream &os) const +{ + os << "key-octave"; + return os; +} - OctaveValue KeyOctave::getValue() const - { - return myValue; - } +std::ostream &KeyOctave::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +KeyOctaveAttributesPtr KeyOctave::getAttributes() const +{ + return myAttributes; +} - void KeyOctave::setValue( const OctaveValue& value ) - { - myValue = value; - } +void KeyOctave::setAttributes(const KeyOctaveAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +OctaveValue KeyOctave::getValue() const +{ + return myValue; +} - bool KeyOctave::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - return isSuccess; - } +void KeyOctave::setValue(const OctaveValue &value) +{ + myValue = value; +} - } +bool KeyOctave::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyOctave.h b/Sourcecode/private/mx/core/elements/KeyOctave.h index 02a09b63a..63a5ede4b 100644 --- a/Sourcecode/private/mx/core/elements/KeyOctave.h +++ b/Sourcecode/private/mx/core/elements/KeyOctave.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/elements/KeyOctaveAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KeyOctaveAttributes ) - MX_FORWARD_DECLARE_ELEMENT( KeyOctave ) - - inline KeyOctavePtr makeKeyOctave() { return std::make_shared(); } - inline KeyOctavePtr makeKeyOctave( const OctaveValue& value ) { return std::make_shared( value ); } - inline KeyOctavePtr makeKeyOctave( OctaveValue&& value ) { return std::make_shared( std::move( value ) ); } - - class KeyOctave : public ElementInterface - { - public: - KeyOctave(); - KeyOctave( const OctaveValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - KeyOctaveAttributesPtr getAttributes() const; - void setAttributes( const KeyOctaveAttributesPtr& attributes ); - OctaveValue getValue() const; - void setValue( const OctaveValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OctaveValue myValue; - KeyOctaveAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(KeyOctaveAttributes) +MX_FORWARD_DECLARE_ELEMENT(KeyOctave) + +inline KeyOctavePtr makeKeyOctave() +{ + return std::make_shared(); +} + +inline KeyOctavePtr makeKeyOctave(const OctaveValue &value) +{ + return std::make_shared(value); } + +inline KeyOctavePtr makeKeyOctave(OctaveValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class KeyOctave : public ElementInterface +{ + public: + KeyOctave(); + KeyOctave(const OctaveValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + KeyOctaveAttributesPtr getAttributes() const; + void setAttributes(const KeyOctaveAttributesPtr &attributes); + OctaveValue getValue() const; + void setValue(const OctaveValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + OctaveValue myValue; + KeyOctaveAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp b/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp index 292a1acf2..a68a92a73 100644 --- a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp @@ -8,57 +8,57 @@ namespace mx { - namespace core - { - KeyOctaveAttributes::KeyOctaveAttributes() - :number( PositiveInteger{ 1 } ) - ,cancel( YesNo::no ) - ,hasNumber( true ) - ,hasCancel( false ) - {} +namespace core +{ +KeyOctaveAttributes::KeyOctaveAttributes() + : number(PositiveInteger{1}), cancel(YesNo::no), hasNumber(true), hasCancel(false) +{ +} +bool KeyOctaveAttributes::hasValues() const +{ + return hasNumber || hasCancel; +} - bool KeyOctaveAttributes::hasValues() const - { - return hasNumber || - hasCancel; - } +std::ostream &KeyOctaveAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, cancel, "cancel", hasCancel); + } + return os; +} + +bool KeyOctaveAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "KeyOctaveAttributes"; + bool isSuccess = true; + bool isNumberFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - std::ostream& KeyOctaveAttributes::toStream( std::ostream& os ) const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, isNumberFound, "number")) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, cancel, "cancel", hasCancel ); - } - return os; + continue; } - - - bool KeyOctaveAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, cancel, hasCancel, "cancel", &parseYesNo)) { - const char* const className = "KeyOctaveAttributes"; - bool isSuccess = true; - bool isNumberFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, isNumberFound, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, cancel, hasCancel, "cancel", &parseYesNo ) ) { continue; } - } - - if( !isNumberFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isNumberFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h b/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h index f4030021c..982e6f849 100644 --- a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h +++ b/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -15,24 +15,24 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( KeyOctaveAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(KeyOctaveAttributes) - struct KeyOctaveAttributes : public AttributesInterface - { - public: - KeyOctaveAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - PositiveInteger number; - YesNo cancel; - const bool hasNumber; - bool hasCancel; +struct KeyOctaveAttributes : public AttributesInterface +{ + public: + KeyOctaveAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + PositiveInteger number; + YesNo cancel; + const bool hasNumber; + bool hasCancel; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyStep.cpp b/Sourcecode/private/mx/core/elements/KeyStep.cpp index f705fbd9f..dd9394ceb 100644 --- a/Sourcecode/private/mx/core/elements/KeyStep.cpp +++ b/Sourcecode/private/mx/core/elements/KeyStep.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - KeyStep::KeyStep() - :myValue( StepEnum::a ) - {} - - - KeyStep::KeyStep( const StepEnum& value ) - :myValue( value ) - {} - - - bool KeyStep::hasAttributes() const - { - return false; - } - - - bool KeyStep::hasContents() const - { - return true; - } - - - std::ostream& KeyStep::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& KeyStep::streamName( std::ostream& os ) const - { - os << "key-step"; - return os; - } +namespace core +{ +KeyStep::KeyStep() : myValue(StepEnum::a) +{ +} +KeyStep::KeyStep(const StepEnum &value) : myValue(value) +{ +} - std::ostream& KeyStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool KeyStep::hasAttributes() const +{ + return false; +} +bool KeyStep::hasContents() const +{ + return true; +} - StepEnum KeyStep::getValue() const - { - return myValue; - } +std::ostream &KeyStep::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &KeyStep::streamName(std::ostream &os) const +{ + os << "key-step"; + return os; +} - void KeyStep::setValue( const StepEnum& value ) - { - myValue = value; - } +std::ostream &KeyStep::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StepEnum KeyStep::getValue() const +{ + return myValue; +} - bool KeyStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseStepEnum( xelement.getValue() ); - return true; - } +void KeyStep::setValue(const StepEnum &value) +{ + myValue = value; +} - } +bool KeyStep::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue = parseStepEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KeyStep.h b/Sourcecode/private/mx/core/elements/KeyStep.h index b8c29a337..3a95fcd3e 100644 --- a/Sourcecode/private/mx/core/elements/KeyStep.h +++ b/Sourcecode/private/mx/core/elements/KeyStep.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( KeyStep ) - - inline KeyStepPtr makeKeyStep() { return std::make_shared(); } - inline KeyStepPtr makeKeyStep( const StepEnum& value ) { return std::make_shared( value ); } - inline KeyStepPtr makeKeyStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class KeyStep : public ElementInterface - { - public: - KeyStep(); - KeyStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(KeyStep) + +inline KeyStepPtr makeKeyStep() +{ + return std::make_shared(); +} + +inline KeyStepPtr makeKeyStep(const StepEnum &value) +{ + return std::make_shared(value); } + +inline KeyStepPtr makeKeyStep(StepEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class KeyStep : public ElementInterface +{ + public: + KeyStep(); + KeyStep(const StepEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StepEnum getValue() const; + void setValue(const StepEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StepEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Kind.cpp b/Sourcecode/private/mx/core/elements/Kind.cpp index f1e49d368..1ea8b8d8a 100644 --- a/Sourcecode/private/mx/core/elements/Kind.cpp +++ b/Sourcecode/private/mx/core/elements/Kind.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Kind::Kind() - :myValue( KindValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - Kind::Kind( const KindValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Kind::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Kind::hasContents() const - { - return true; - } - - - std::ostream& Kind::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Kind::streamName( std::ostream& os ) const - { - os << "kind"; - return os; - } - - - std::ostream& Kind::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Kind::Kind() : myValue(KindValue::none), myAttributes(std::make_shared()) +{ +} +Kind::Kind(const KindValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - KindAttributesPtr Kind::getAttributes() const - { - return myAttributes; - } +bool Kind::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Kind::hasContents() const +{ + return true; +} - void Kind::setAttributes( const KindAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Kind::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Kind::streamName(std::ostream &os) const +{ + os << "kind"; + return os; +} - KindValue Kind::getValue() const - { - return myValue; - } +std::ostream &Kind::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +KindAttributesPtr Kind::getAttributes() const +{ + return myAttributes; +} - void Kind::setValue( const KindValue& value ) - { - myValue = value; - } +void Kind::setAttributes(const KindAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +KindValue Kind::getValue() const +{ + return myValue; +} - bool Kind::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseKindValue( xelement.getValue() ); - return isSuccess; - } +void Kind::setValue(const KindValue &value) +{ + myValue = value; +} - } +bool Kind::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseKindValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Kind.h b/Sourcecode/private/mx/core/elements/Kind.h index c905f90bf..d759c82f6 100644 --- a/Sourcecode/private/mx/core/elements/Kind.h +++ b/Sourcecode/private/mx/core/elements/Kind.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/KindAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KindAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Kind ) - - inline KindPtr makeKind() { return std::make_shared(); } - inline KindPtr makeKind( const KindValue& value ) { return std::make_shared( value ); } - inline KindPtr makeKind( KindValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Kind : public ElementInterface - { - public: - Kind(); - Kind( const KindValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - KindAttributesPtr getAttributes() const; - void setAttributes( const KindAttributesPtr& attributes ); - KindValue getValue() const; - void setValue( const KindValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - KindValue myValue; - KindAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(KindAttributes) +MX_FORWARD_DECLARE_ELEMENT(Kind) + +inline KindPtr makeKind() +{ + return std::make_shared(); +} + +inline KindPtr makeKind(const KindValue &value) +{ + return std::make_shared(value); } + +inline KindPtr makeKind(KindValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Kind : public ElementInterface +{ + public: + Kind(); + Kind(const KindValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + KindAttributesPtr getAttributes() const; + void setAttributes(const KindAttributesPtr &attributes); + KindValue getValue() const; + void setValue(const KindValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + KindValue myValue; + KindAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KindAttributes.cpp b/Sourcecode/private/mx/core/elements/KindAttributes.cpp index abe7f40e7..c395ad88e 100644 --- a/Sourcecode/private/mx/core/elements/KindAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/KindAttributes.cpp @@ -8,111 +8,121 @@ namespace mx { - namespace core +namespace core +{ +KindAttributes::KindAttributes() + : useSymbols(), text(), stackDegrees(), parenthesesDegrees(), bracketDegrees(), defaultX(), defaultY(), relativeX(), + relativeY(), fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), halign(), hasUseSymbols(false), hasText(false), hasStackDegrees(false), + hasParenthesesDegrees(false), hasBracketDegrees(false), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false), hasHalign(false) +{ +} + +bool KindAttributes::hasValues() const +{ + return hasUseSymbols || hasText || hasStackDegrees || hasParenthesesDegrees || hasBracketDegrees || hasDefaultX || + hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasHalign; +} + +std::ostream &KindAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - KindAttributes::KindAttributes() - :useSymbols() - ,text() - ,stackDegrees() - ,parenthesesDegrees() - ,bracketDegrees() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,hasUseSymbols( false ) - ,hasText( false ) - ,hasStackDegrees( false ) - ,hasParenthesesDegrees( false ) - ,hasBracketDegrees( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} + streamAttribute(os, useSymbols, "use-symbols", hasUseSymbols); + streamAttribute(os, text, "text", hasText); + streamAttribute(os, stackDegrees, "stack-degrees", hasStackDegrees); + streamAttribute(os, parenthesesDegrees, "parentheses-degrees", hasParenthesesDegrees); + streamAttribute(os, bracketDegrees, "bracket-degrees", hasBracketDegrees); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + } + return os; +} +bool KindAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "KindAttributes"; + bool isSuccess = true; - bool KindAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, useSymbols, hasUseSymbols, "use-symbols", &parseYesNo)) { - return hasUseSymbols || - hasText || - hasStackDegrees || - hasParenthesesDegrees || - hasBracketDegrees || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; + continue; } - - - std::ostream& KindAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, text, hasText, "text")) { - if ( hasValues() ) - { - streamAttribute( os, useSymbols, "use-symbols", hasUseSymbols ); - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, stackDegrees, "stack-degrees", hasStackDegrees ); - streamAttribute( os, parenthesesDegrees, "parentheses-degrees", hasParenthesesDegrees ); - streamAttribute( os, bracketDegrees, "bracket-degrees", hasBracketDegrees ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; + continue; } - - - bool KindAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, stackDegrees, hasStackDegrees, "stack-degrees", + &parseYesNo)) { - const char* const className = "KindAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, useSymbols, hasUseSymbols, "use-symbols", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, stackDegrees, hasStackDegrees, "stack-degrees", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parenthesesDegrees, hasParenthesesDegrees, "parentheses-degrees", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bracketDegrees, hasBracketDegrees, "bracket-degrees", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, parenthesesDegrees, hasParenthesesDegrees, + "parentheses-degrees", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bracketDegrees, hasBracketDegrees, "bracket-degrees", + &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/KindAttributes.h b/Sourcecode/private/mx/core/elements/KindAttributes.h index c99ac3a72..7c3c47927 100644 --- a/Sourcecode/private/mx/core/elements/KindAttributes.h +++ b/Sourcecode/private/mx/core/elements/KindAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,48 +17,48 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( KindAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(KindAttributes) - struct KindAttributes : public AttributesInterface - { - public: - KindAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo useSymbols; - XsToken text; - YesNo stackDegrees; - YesNo parenthesesDegrees; - YesNo bracketDegrees; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - bool hasUseSymbols; - bool hasText; - bool hasStackDegrees; - bool hasParenthesesDegrees; - bool hasBracketDegrees; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; +struct KindAttributes : public AttributesInterface +{ + public: + KindAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo useSymbols; + XsToken text; + YesNo stackDegrees; + YesNo parenthesesDegrees; + YesNo bracketDegrees; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + bool hasUseSymbols; + bool hasText; + bool hasStackDegrees; + bool hasParenthesesDegrees; + bool hasBracketDegrees; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Laughing.cpp b/Sourcecode/private/mx/core/elements/Laughing.cpp index c973b2ae3..37fbfea51 100644 --- a/Sourcecode/private/mx/core/elements/Laughing.cpp +++ b/Sourcecode/private/mx/core/elements/Laughing.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Laughing::Laughing() : ElementInterface() {} - +namespace core +{ +Laughing::Laughing() : ElementInterface() +{ +} - bool Laughing::hasAttributes() const { return false; } +bool Laughing::hasAttributes() const +{ + return false; +} +bool Laughing::hasContents() const +{ + return false; +} - bool Laughing::hasContents() const { return false; } - std::ostream& Laughing::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Laughing::streamName( std::ostream& os ) const { os << "laughing"; return os; } - std::ostream& Laughing::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Laughing::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Laughing::streamName(std::ostream &os) const +{ + os << "laughing"; + return os; +} - bool Laughing::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &Laughing::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Laughing::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Laughing.h b/Sourcecode/private/mx/core/elements/Laughing.h index d499b893e..d96f1daaa 100644 --- a/Sourcecode/private/mx/core/elements/Laughing.h +++ b/Sourcecode/private/mx/core/elements/Laughing.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Laughing ) - - inline LaughingPtr makeLaughing() { return std::make_shared(); } - - class Laughing : public ElementInterface - { - public: - Laughing(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Laughing) + +inline LaughingPtr makeLaughing() +{ + return std::make_shared(); } + +class Laughing : public ElementInterface +{ + public: + Laughing(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LayoutGroup.cpp b/Sourcecode/private/mx/core/elements/LayoutGroup.cpp index 678c86764..bc75cf192 100644 --- a/Sourcecode/private/mx/core/elements/LayoutGroup.cpp +++ b/Sourcecode/private/mx/core/elements/LayoutGroup.cpp @@ -11,186 +11,164 @@ namespace mx { - namespace core - { - LayoutGroup::LayoutGroup() - :myPageLayout( makePageLayout() ) - ,myHasPageLayout( false ) - ,mySystemLayout( makeSystemLayout() ) - ,myHasSystemLayout( false ) - ,myStaffLayoutSet() - {} - +namespace core +{ +LayoutGroup::LayoutGroup() + : myPageLayout(makePageLayout()), myHasPageLayout(false), mySystemLayout(makeSystemLayout()), + myHasSystemLayout(false), myStaffLayoutSet() +{ +} - bool LayoutGroup::hasAttributes() const - { - return false; - } +bool LayoutGroup::hasAttributes() const +{ + return false; +} +std::ostream &LayoutGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& LayoutGroup::streamAttributes( std::ostream& os ) const - { - return os; - } +std::ostream &LayoutGroup::streamName(std::ostream &os) const +{ + os << "work"; + return os; +} +bool LayoutGroup::hasContents() const +{ + return myHasPageLayout || myHasSystemLayout || myStaffLayoutSet.size() > 0; +} - std::ostream& LayoutGroup::streamName( std::ostream& os ) const +std::ostream &LayoutGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + bool isFirst = true; + if (myHasPageLayout) { - os << "work"; - return os; + myPageLayout->toStream(os, indentLevel); + isFirst = false; } - - - bool LayoutGroup::hasContents() const + if (myHasSystemLayout) { - return myHasPageLayout || myHasSystemLayout || myStaffLayoutSet.size() > 0; + if (!isFirst) + { + os << std::endl; + isFirst = false; + } + mySystemLayout->toStream(os, indentLevel); } - - - std::ostream& LayoutGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const + if (myStaffLayoutSet.size() > 0) { - if ( hasContents() ) + for (auto it = myStaffLayoutSet.cbegin(); it != myStaffLayoutSet.cend(); ++it) { - bool isFirst = true; - if ( myHasPageLayout ) - { - myPageLayout->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasSystemLayout ) + if (it == myStaffLayoutSet.cbegin()) { - if ( !isFirst ) + if (!isFirst) { os << std::endl; isFirst = false; } - mySystemLayout->toStream( os, indentLevel ); } - if ( myStaffLayoutSet.size() > 0 ) + else { - for ( auto it = myStaffLayoutSet.cbegin(); - it != myStaffLayoutSet.cend(); ++it ) - { - if ( it == myStaffLayoutSet.cbegin() ) - { - if ( !isFirst ) - { - os << std::endl; - isFirst = false; - } - } - else - { - os << std::endl; - } - (*it)->toStream( os, indentLevel ); - } + os << std::endl; } - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; + (*it)->toStream(os, indentLevel); } - return os; - } - - - PageLayoutPtr LayoutGroup::getPageLayout() const - { - return myPageLayout; - } - - - void LayoutGroup::setPageLayout( const PageLayoutPtr& value ) - { - if ( value ) - { - myPageLayout = value; - } - } - - - bool LayoutGroup::getHasPageLayout() const - { - return myHasPageLayout; - } - - - void LayoutGroup::setHasPageLayout( const bool value ) - { - myHasPageLayout = value; - } - - - SystemLayoutPtr LayoutGroup::getSystemLayout() const - { - return mySystemLayout; - } - - - void LayoutGroup::setSystemLayout( const SystemLayoutPtr& value ) - { - if ( value ) - { - mySystemLayout = value; - } - } - - - bool LayoutGroup::getHasSystemLayout() const - { - return myHasSystemLayout; } + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +PageLayoutPtr LayoutGroup::getPageLayout() const +{ + return myPageLayout; +} - void LayoutGroup::setHasSystemLayout( const bool value ) - { - myHasSystemLayout = value; - } +void LayoutGroup::setPageLayout(const PageLayoutPtr &value) +{ + if (value) + { + myPageLayout = value; + } +} +bool LayoutGroup::getHasPageLayout() const +{ + return myHasPageLayout; +} - const StaffLayoutSet& LayoutGroup::getStaffLayoutSet() const - { - return myStaffLayoutSet; - } +void LayoutGroup::setHasPageLayout(const bool value) +{ + myHasPageLayout = value; +} +SystemLayoutPtr LayoutGroup::getSystemLayout() const +{ + return mySystemLayout; +} - void LayoutGroup::addStaffLayout( const StaffLayoutPtr& value ) - { - if ( value ) - { - myStaffLayoutSet.push_back( value ); - } - } +void LayoutGroup::setSystemLayout(const SystemLayoutPtr &value) +{ + if (value) + { + mySystemLayout = value; + } +} +bool LayoutGroup::getHasSystemLayout() const +{ + return myHasSystemLayout; +} - void LayoutGroup::removeStaffLayout( const StaffLayoutSetIterConst& value ) - { - if ( value != myStaffLayoutSet.cend() ) - { - myStaffLayoutSet.erase( value ); - } - } +void LayoutGroup::setHasSystemLayout(const bool value) +{ + myHasSystemLayout = value; +} +const StaffLayoutSet &LayoutGroup::getStaffLayoutSet() const +{ + return myStaffLayoutSet; +} - void LayoutGroup::clearStaffLayoutSet() - { - myStaffLayoutSet.clear(); - } +void LayoutGroup::addStaffLayout(const StaffLayoutPtr &value) +{ + if (value) + { + myStaffLayoutSet.push_back(value); + } +} +void LayoutGroup::removeStaffLayout(const StaffLayoutSetIterConst &value) +{ + if (value != myStaffLayoutSet.cend()) + { + myStaffLayoutSet.erase(value); + } +} - StaffLayoutPtr LayoutGroup::getStaffLayout( const StaffLayoutSetIterConst& setIterator ) const - { - if( setIterator != myStaffLayoutSet.cend() ) - { - return *setIterator; - } - return StaffLayoutPtr(); - } - - - MX_FROM_XELEMENT_UNUSED( LayoutGroup ); +void LayoutGroup::clearStaffLayoutSet() +{ + myStaffLayoutSet.clear(); +} +StaffLayoutPtr LayoutGroup::getStaffLayout(const StaffLayoutSetIterConst &setIterator) const +{ + if (setIterator != myStaffLayoutSet.cend()) + { + return *setIterator; } + return StaffLayoutPtr(); } + +MX_FROM_XELEMENT_UNUSED(LayoutGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LayoutGroup.h b/Sourcecode/private/mx/core/elements/LayoutGroup.h index 38603809c..eb1785cf0 100644 --- a/Sourcecode/private/mx/core/elements/LayoutGroup.h +++ b/Sourcecode/private/mx/core/elements/LayoutGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,55 +13,58 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PageLayout) +MX_FORWARD_DECLARE_ELEMENT(StaffLayout) +MX_FORWARD_DECLARE_ELEMENT(SystemLayout) +MX_FORWARD_DECLARE_ELEMENT(LayoutGroup) - MX_FORWARD_DECLARE_ELEMENT( PageLayout ) - MX_FORWARD_DECLARE_ELEMENT( StaffLayout ) - MX_FORWARD_DECLARE_ELEMENT( SystemLayout ) - MX_FORWARD_DECLARE_ELEMENT( LayoutGroup ) +inline LayoutGroupPtr makeLayoutGroup() +{ + return std::make_shared(); +} - inline LayoutGroupPtr makeLayoutGroup() { return std::make_shared(); } +class LayoutGroup : public ElementInterface +{ + public: + LayoutGroup(); - class LayoutGroup : public ElementInterface - { - public: - LayoutGroup(); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + /* _________ PageLayout minOccurs = 0, maxOccurs = 1 _________ */ + PageLayoutPtr getPageLayout() const; + void setPageLayout(const PageLayoutPtr &value); + bool getHasPageLayout() const; + void setHasPageLayout(const bool value); - /* _________ PageLayout minOccurs = 0, maxOccurs = 1 _________ */ - PageLayoutPtr getPageLayout() const; - void setPageLayout( const PageLayoutPtr& value ); - bool getHasPageLayout() const; - void setHasPageLayout( const bool value ); + /* _________ SystemLayout minOccurs = 0, maxOccurs = 1 _________ */ + SystemLayoutPtr getSystemLayout() const; + void setSystemLayout(const SystemLayoutPtr &value); + bool getHasSystemLayout() const; + void setHasSystemLayout(const bool value); - /* _________ SystemLayout minOccurs = 0, maxOccurs = 1 _________ */ - SystemLayoutPtr getSystemLayout() const; - void setSystemLayout( const SystemLayoutPtr& value ); - bool getHasSystemLayout() const; - void setHasSystemLayout( const bool value ); + /* _________ StaffLayout minOccurs = 0, maxOccurs = unbounded _________ */ + const StaffLayoutSet &getStaffLayoutSet() const; + void addStaffLayout(const StaffLayoutPtr &value); + void removeStaffLayout(const StaffLayoutSetIterConst &value); + void clearStaffLayoutSet(); + StaffLayoutPtr getStaffLayout(const StaffLayoutSetIterConst &setIterator) const; - /* _________ StaffLayout minOccurs = 0, maxOccurs = unbounded _________ */ - const StaffLayoutSet& getStaffLayoutSet() const; - void addStaffLayout( const StaffLayoutPtr& value ); - void removeStaffLayout( const StaffLayoutSetIterConst& value ); - void clearStaffLayoutSet(); - StaffLayoutPtr getStaffLayout( const StaffLayoutSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - PageLayoutPtr myPageLayout; - bool myHasPageLayout; - SystemLayoutPtr mySystemLayout; - bool myHasSystemLayout; - StaffLayoutSet myStaffLayoutSet; - }; - } -} + private: + PageLayoutPtr myPageLayout; + bool myHasPageLayout; + SystemLayoutPtr mySystemLayout; + bool myHasSystemLayout; + StaffLayoutSet myStaffLayoutSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LeftDivider.cpp b/Sourcecode/private/mx/core/elements/LeftDivider.cpp index 28a9ceea5..9cf1d3cca 100644 --- a/Sourcecode/private/mx/core/elements/LeftDivider.cpp +++ b/Sourcecode/private/mx/core/elements/LeftDivider.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - LeftDivider::LeftDivider() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool LeftDivider::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool LeftDivider::hasContents() const { return false; } - std::ostream& LeftDivider::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& LeftDivider::streamName( std::ostream& os ) const { os << "left-divider"; return os; } - std::ostream& LeftDivider::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +LeftDivider::LeftDivider() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool LeftDivider::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPrintObjectStyleAlignAttributesPtr LeftDivider::getAttributes() const - { - return myAttributes; - } +bool LeftDivider::hasContents() const +{ + return false; +} +std::ostream &LeftDivider::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void LeftDivider::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &LeftDivider::streamName(std::ostream &os) const +{ + os << "left-divider"; + return os; +} +std::ostream &LeftDivider::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool LeftDivider::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPrintObjectStyleAlignAttributesPtr LeftDivider::getAttributes() const +{ + return myAttributes; +} +void LeftDivider::setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool LeftDivider::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LeftDivider.h b/Sourcecode/private/mx/core/elements/LeftDivider.h index a0c0ae144..6173f3cdc 100644 --- a/Sourcecode/private/mx/core/elements/LeftDivider.h +++ b/Sourcecode/private/mx/core/elements/LeftDivider.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,31 +14,34 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( LeftDivider ) - - inline LeftDividerPtr makeLeftDivider() { return std::make_shared(); } - - class LeftDivider : public ElementInterface - { - public: - LeftDivider(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); +namespace core +{ - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); +MX_FORWARD_DECLARE_ELEMENT(LeftDivider) - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } +inline LeftDividerPtr makeLeftDivider() +{ + return std::make_shared(); } + +class LeftDivider : public ElementInterface +{ + public: + LeftDivider(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; + void setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPrintObjectStyleAlignAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LeftMargin.cpp b/Sourcecode/private/mx/core/elements/LeftMargin.cpp index 6163cbb64..afa7da164 100644 --- a/Sourcecode/private/mx/core/elements/LeftMargin.cpp +++ b/Sourcecode/private/mx/core/elements/LeftMargin.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - LeftMargin::LeftMargin() - :myValue() - {} - - - LeftMargin::LeftMargin( const TenthsValue& value ) - :myValue( value ) - {} - - - bool LeftMargin::hasAttributes() const - { - return false; - } - - - bool LeftMargin::hasContents() const - { - return true; - } - - - std::ostream& LeftMargin::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& LeftMargin::streamName( std::ostream& os ) const - { - os << "left-margin"; - return os; - } +namespace core +{ +LeftMargin::LeftMargin() : myValue() +{ +} +LeftMargin::LeftMargin(const TenthsValue &value) : myValue(value) +{ +} - std::ostream& LeftMargin::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool LeftMargin::hasAttributes() const +{ + return false; +} +bool LeftMargin::hasContents() const +{ + return true; +} - TenthsValue LeftMargin::getValue() const - { - return myValue; - } +std::ostream &LeftMargin::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &LeftMargin::streamName(std::ostream &os) const +{ + os << "left-margin"; + return os; +} - void LeftMargin::setValue( const TenthsValue& value ) - { - myValue = value; - } +std::ostream &LeftMargin::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TenthsValue LeftMargin::getValue() const +{ + return myValue; +} - bool LeftMargin::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void LeftMargin::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool LeftMargin::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LeftMargin.h b/Sourcecode/private/mx/core/elements/LeftMargin.h index 53f825a93..869cc6b6f 100644 --- a/Sourcecode/private/mx/core/elements/LeftMargin.h +++ b/Sourcecode/private/mx/core/elements/LeftMargin.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( LeftMargin ) - - inline LeftMarginPtr makeLeftMargin() { return std::make_shared(); } - inline LeftMarginPtr makeLeftMargin( const TenthsValue& value ) { return std::make_shared( value ); } - inline LeftMarginPtr makeLeftMargin( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class LeftMargin : public ElementInterface - { - public: - LeftMargin(); - LeftMargin( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(LeftMargin) + +inline LeftMarginPtr makeLeftMargin() +{ + return std::make_shared(); } + +inline LeftMarginPtr makeLeftMargin(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline LeftMarginPtr makeLeftMargin(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class LeftMargin : public ElementInterface +{ + public: + LeftMargin(); + LeftMargin(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Level.cpp b/Sourcecode/private/mx/core/elements/Level.cpp index 987766c45..5c7845d78 100644 --- a/Sourcecode/private/mx/core/elements/Level.cpp +++ b/Sourcecode/private/mx/core/elements/Level.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Level::Level() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Level::Level( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Level::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Level::hasContents() const - { - return true; - } - - - std::ostream& Level::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Level::streamName( std::ostream& os ) const - { - os << "level"; - return os; - } - - - std::ostream& Level::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Level::Level() : myValue(), myAttributes(std::make_shared()) +{ +} +Level::Level(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - LevelAttributesPtr Level::getAttributes() const - { - return myAttributes; - } +bool Level::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Level::hasContents() const +{ + return true; +} - void Level::setAttributes( const LevelAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Level::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Level::streamName(std::ostream &os) const +{ + os << "level"; + return os; +} - XsString Level::getValue() const - { - return myValue; - } +std::ostream &Level::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +LevelAttributesPtr Level::getAttributes() const +{ + return myAttributes; +} - void Level::setValue( const XsString& value ) - { - myValue = value; - } +void Level::setAttributes(const LevelAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Level::getValue() const +{ + return myValue; +} - bool Level::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Level::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Level::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Level.h b/Sourcecode/private/mx/core/elements/Level.h index 94255f92f..745237fb6 100644 --- a/Sourcecode/private/mx/core/elements/Level.h +++ b/Sourcecode/private/mx/core/elements/Level.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/LevelAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LevelAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Level ) - - inline LevelPtr makeLevel() { return std::make_shared(); } - inline LevelPtr makeLevel( const XsString& value ) { return std::make_shared( value ); } - inline LevelPtr makeLevel( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Level : public ElementInterface - { - public: - Level(); - Level( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LevelAttributesPtr getAttributes() const; - void setAttributes( const LevelAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - LevelAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(LevelAttributes) +MX_FORWARD_DECLARE_ELEMENT(Level) + +inline LevelPtr makeLevel() +{ + return std::make_shared(); +} + +inline LevelPtr makeLevel(const XsString &value) +{ + return std::make_shared(value); } + +inline LevelPtr makeLevel(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Level : public ElementInterface +{ + public: + Level(); + Level(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + LevelAttributesPtr getAttributes() const; + void setAttributes(const LevelAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + LevelAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LevelAttributes.cpp b/Sourcecode/private/mx/core/elements/LevelAttributes.cpp index 988796d44..5e3ad62ff 100644 --- a/Sourcecode/private/mx/core/elements/LevelAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/LevelAttributes.cpp @@ -8,61 +8,61 @@ namespace mx { - namespace core +namespace core +{ +LevelAttributes::LevelAttributes() + : reference(), parentheses(), bracket(), size(), hasReference(false), hasParentheses(false), hasBracket(false), + hasSize(false) +{ +} + +bool LevelAttributes::hasValues() const +{ + return hasReference || hasParentheses || hasBracket || hasSize; +} + +std::ostream &LevelAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - LevelAttributes::LevelAttributes() - :reference() - ,parentheses() - ,bracket() - ,size() - ,hasReference( false ) - ,hasParentheses( false ) - ,hasBracket( false ) - ,hasSize( false ) - {} + streamAttribute(os, reference, "reference", hasReference); + streamAttribute(os, parentheses, "parentheses", hasParentheses); + streamAttribute(os, bracket, "bracket", hasBracket); + streamAttribute(os, size, "size", hasSize); + } + return os; +} + +bool LevelAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "LevelAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool LevelAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, reference, hasReference, "reference", &parseYesNo)) { - return hasReference || - hasParentheses || - hasBracket || - hasSize; + continue; } - - - std::ostream& LevelAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, reference, "reference", hasReference ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - streamAttribute( os, bracket, "bracket", hasBracket ); - streamAttribute( os, size, "size", hasSize ); - } - return os; + continue; } - - - bool LevelAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo)) { - const char* const className = "LevelAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, reference, hasReference, "reference", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LevelAttributes.h b/Sourcecode/private/mx/core/elements/LevelAttributes.h index 594d2133f..4635ced6d 100644 --- a/Sourcecode/private/mx/core/elements/LevelAttributes.h +++ b/Sourcecode/private/mx/core/elements/LevelAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,28 +14,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( LevelAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(LevelAttributes) - struct LevelAttributes : public AttributesInterface - { - public: - LevelAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo reference; - YesNo parentheses; - YesNo bracket; - SymbolSize size; - bool hasReference; - bool hasParentheses; - bool hasBracket; - bool hasSize; +struct LevelAttributes : public AttributesInterface +{ + public: + LevelAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo reference; + YesNo parentheses; + YesNo bracket; + SymbolSize size; + bool hasReference; + bool hasParentheses; + bool hasBracket; + bool hasSize; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Line.cpp b/Sourcecode/private/mx/core/elements/Line.cpp index d19d129ff..83a8791e1 100644 --- a/Sourcecode/private/mx/core/elements/Line.cpp +++ b/Sourcecode/private/mx/core/elements/Line.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Line::Line() - :myValue() - {} - - - Line::Line( const StaffLine& value ) - :myValue( value ) - {} - - - bool Line::hasAttributes() const - { - return false; - } - - - bool Line::hasContents() const - { - return true; - } - - - std::ostream& Line::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Line::streamName( std::ostream& os ) const - { - os << "line"; - return os; - } +namespace core +{ +Line::Line() : myValue() +{ +} +Line::Line(const StaffLine &value) : myValue(value) +{ +} - std::ostream& Line::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Line::hasAttributes() const +{ + return false; +} +bool Line::hasContents() const +{ + return true; +} - StaffLine Line::getValue() const - { - return myValue; - } +std::ostream &Line::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Line::streamName(std::ostream &os) const +{ + os << "line"; + return os; +} - void Line::setValue( const StaffLine& value ) - { - myValue = value; - } +std::ostream &Line::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StaffLine Line::getValue() const +{ + return myValue; +} - bool Line::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Line::setValue(const StaffLine &value) +{ + myValue = value; +} - } +bool Line::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Line.h b/Sourcecode/private/mx/core/elements/Line.h index 67ebf7f60..c43b3bbb9 100644 --- a/Sourcecode/private/mx/core/elements/Line.h +++ b/Sourcecode/private/mx/core/elements/Line.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Line ) - - inline LinePtr makeLine() { return std::make_shared(); } - inline LinePtr makeLine( const StaffLine& value ) { return std::make_shared( value ); } - inline LinePtr makeLine( StaffLine&& value ) { return std::make_shared( std::move( value ) ); } - - class Line : public ElementInterface - { - public: - Line(); - Line( const StaffLine& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffLine getValue() const; - void setValue( const StaffLine& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StaffLine myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Line) + +inline LinePtr makeLine() +{ + return std::make_shared(); +} + +inline LinePtr makeLine(const StaffLine &value) +{ + return std::make_shared(value); } + +inline LinePtr makeLine(StaffLine &&value) +{ + return std::make_shared(std::move(value)); +} + +class Line : public ElementInterface +{ + public: + Line(); + Line(const StaffLine &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StaffLine getValue() const; + void setValue(const StaffLine &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StaffLine myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LineWidth.cpp b/Sourcecode/private/mx/core/elements/LineWidth.cpp index b786106e3..7c2d51910 100644 --- a/Sourcecode/private/mx/core/elements/LineWidth.cpp +++ b/Sourcecode/private/mx/core/elements/LineWidth.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - LineWidth::LineWidth() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - LineWidth::LineWidth( const TenthsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool LineWidth::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool LineWidth::hasContents() const - { - return true; - } - - - std::ostream& LineWidth::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& LineWidth::streamName( std::ostream& os ) const - { - os << "line-width"; - return os; - } - - - std::ostream& LineWidth::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +LineWidth::LineWidth() : myValue(), myAttributes(std::make_shared()) +{ +} +LineWidth::LineWidth(const TenthsValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - LineWidthAttributesPtr LineWidth::getAttributes() const - { - return myAttributes; - } +bool LineWidth::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool LineWidth::hasContents() const +{ + return true; +} - void LineWidth::setAttributes( const LineWidthAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &LineWidth::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &LineWidth::streamName(std::ostream &os) const +{ + os << "line-width"; + return os; +} - TenthsValue LineWidth::getValue() const - { - return myValue; - } +std::ostream &LineWidth::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +LineWidthAttributesPtr LineWidth::getAttributes() const +{ + return myAttributes; +} - void LineWidth::setValue( const TenthsValue& value ) - { - myValue = value; - } +void LineWidth::setAttributes(const LineWidthAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +TenthsValue LineWidth::getValue() const +{ + return myValue; +} - bool LineWidth::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - return isSuccess; - } +void LineWidth::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool LineWidth::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LineWidth.h b/Sourcecode/private/mx/core/elements/LineWidth.h index 1c3c3f4a0..8c48a70cd 100644 --- a/Sourcecode/private/mx/core/elements/LineWidth.h +++ b/Sourcecode/private/mx/core/elements/LineWidth.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/LineWidthAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LineWidthAttributes ) - MX_FORWARD_DECLARE_ELEMENT( LineWidth ) - - inline LineWidthPtr makeLineWidth() { return std::make_shared(); } - inline LineWidthPtr makeLineWidth( const TenthsValue& value ) { return std::make_shared( value ); } - inline LineWidthPtr makeLineWidth( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class LineWidth : public ElementInterface - { - public: - LineWidth(); - LineWidth( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LineWidthAttributesPtr getAttributes() const; - void setAttributes( const LineWidthAttributesPtr& attributes ); - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - LineWidthAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(LineWidthAttributes) +MX_FORWARD_DECLARE_ELEMENT(LineWidth) + +inline LineWidthPtr makeLineWidth() +{ + return std::make_shared(); } + +inline LineWidthPtr makeLineWidth(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline LineWidthPtr makeLineWidth(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class LineWidth : public ElementInterface +{ + public: + LineWidth(); + LineWidth(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + LineWidthAttributesPtr getAttributes() const; + void setAttributes(const LineWidthAttributesPtr &attributes); + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; + LineWidthAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp b/Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp index e1d01d617..f88a80cc1 100644 --- a/Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - LineWidthAttributes::LineWidthAttributes() - :type( LineWidthTypeEnum::beam ) - ,hasType( true ) - {} - +namespace core +{ +LineWidthAttributes::LineWidthAttributes() : type(LineWidthTypeEnum::beam), hasType(true) +{ +} - bool LineWidthAttributes::hasValues() const - { - return hasType; - } +bool LineWidthAttributes::hasValues() const +{ + return hasType; +} +std::ostream &LineWidthAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& LineWidthAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool LineWidthAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "LineWidthAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool LineWidthAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type")) { - const char* const className = "LineWidthAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LineWidthAttributes.h b/Sourcecode/private/mx/core/elements/LineWidthAttributes.h index a7823c94d..69a9e2da3 100644 --- a/Sourcecode/private/mx/core/elements/LineWidthAttributes.h +++ b/Sourcecode/private/mx/core/elements/LineWidthAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( LineWidthAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(LineWidthAttributes) - struct LineWidthAttributes : public AttributesInterface - { - public: - LineWidthAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LineWidthType type; - const bool hasType; +struct LineWidthAttributes : public AttributesInterface +{ + public: + LineWidthAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + LineWidthType type; + const bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Link.cpp b/Sourcecode/private/mx/core/elements/Link.cpp index 0437855a8..279fcbf6a 100644 --- a/Sourcecode/private/mx/core/elements/Link.cpp +++ b/Sourcecode/private/mx/core/elements/Link.cpp @@ -7,60 +7,62 @@ namespace mx { - namespace core - { - Link::Link() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Link::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Link::hasContents() const { return false; } - std::ostream& Link::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Link::streamName( std::ostream& os ) const { os << "link"; return os; } - std::ostream& Link::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Link::Link() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Link::hasAttributes() const +{ + return myAttributes->hasValues(); +} - LinkAttributesPtr Link::getAttributes() const - { - return myAttributes; - } +bool Link::hasContents() const +{ + return false; +} +std::ostream &Link::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Link::setAttributes( const LinkAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Link::streamName(std::ostream &os) const +{ + os << "link"; + return os; +} +std::ostream &Link::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Link::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - return myAttributes->fromXElement( message, xelement ); - } +LinkAttributesPtr Link::getAttributes() const +{ + return myAttributes; +} +void Link::setAttributes(const LinkAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Link::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Link.h b/Sourcecode/private/mx/core/elements/Link.h index 992c7c73b..afeeec35f 100644 --- a/Sourcecode/private/mx/core/elements/Link.h +++ b/Sourcecode/private/mx/core/elements/Link.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/LinkAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LinkAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Link ) - - inline LinkPtr makeLink() { return std::make_shared(); } - - class Link : public ElementInterface - { - public: - Link(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LinkAttributesPtr getAttributes() const; - void setAttributes( const LinkAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LinkAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(LinkAttributes) +MX_FORWARD_DECLARE_ELEMENT(Link) + +inline LinkPtr makeLink() +{ + return std::make_shared(); } + +class Link : public ElementInterface +{ + public: + Link(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + LinkAttributesPtr getAttributes() const; + void setAttributes(const LinkAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + LinkAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LinkAttributes.cpp b/Sourcecode/private/mx/core/elements/LinkAttributes.cpp index 21f84759b..39a7e1707 100644 --- a/Sourcecode/private/mx/core/elements/LinkAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/LinkAttributes.cpp @@ -8,118 +8,119 @@ namespace mx { - namespace core +namespace core +{ +LinkAttributes::LinkAttributes() + : href(), type(XlinkType::simple), role(), title(), show(XlinkShow::replace), actuate(XlinkActuate::onRequest), + name(), element(), position(), defaultX(), defaultY(), relativeX(), relativeY(), hasHref(true), hasType(false), + hasRole(false), hasTitle(false), hasShow(false), hasActuate(false), hasName(false), hasElement(false), + hasPosition(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false) +{ +} + +bool LinkAttributes::hasValues() const +{ + return hasHref || hasType || hasRole || hasTitle || hasShow || hasActuate || hasName || hasElement || hasPosition || + hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY; +} + +std::ostream &LinkAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - LinkAttributes::LinkAttributes() - :href() - ,type( XlinkType::simple ) - ,role() - ,title() - ,show( XlinkShow::replace ) - ,actuate( XlinkActuate::onRequest ) - ,name() - ,element() - ,position() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasHref( true ) - ,hasType( false ) - ,hasRole( false ) - ,hasTitle( false ) - ,hasShow( false ) - ,hasActuate( false ) - ,hasName( false ) - ,hasElement( false ) - ,hasPosition( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} + streamAttribute(os, href, "xlink:href", hasHref); + streamAttribute(os, type, "xlink:type", hasType); + streamAttribute(os, role, "xlink:role", hasRole); + streamAttribute(os, title, "xlink:title", hasTitle); + streamAttribute(os, show, "xlink:show", hasShow); + streamAttribute(os, actuate, "xlink:actuate", hasActuate); + streamAttribute(os, name, "name", hasName); + streamAttribute(os, element, "element", hasElement); + streamAttribute(os, position, "position", hasPosition); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + } + return os; +} +bool LinkAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "LinkAttributes"; + bool isSuccess = true; + bool isHrefFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool LinkAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, href, isHrefFound, "href")) { - return hasHref || - hasType || - hasRole || - hasTitle || - hasShow || - hasActuate || - hasName || - hasElement || - hasPosition || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; + continue; } - - std::ostream& LinkAttributes::toStream( std::ostream& os ) const + if (it->getName() == "xlink:type") { - if ( hasValues() ) - { - streamAttribute( os, href, "xlink:href", hasHref ); - streamAttribute( os, type, "xlink:type", hasType ); - streamAttribute( os, role, "xlink:role", hasRole ); - streamAttribute( os, title, "xlink:title", hasTitle ); - streamAttribute( os, show, "xlink:show", hasShow ); - streamAttribute( os, actuate, "xlink:actuate", hasActuate ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, element, "element", hasElement ); - streamAttribute( os, position, "position", hasPosition ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; + hasType = true; + continue; } - - bool LinkAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, role, hasRole, "role")) { - const char* const className = "LinkAttributes"; - bool isSuccess = true; - bool isHrefFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, href, isHrefFound, "href" ) ) { continue; } - - if( it->getName() == "xlink:type" ) - { - hasType = true; - continue; - } - - if( parseAttribute( message, it, className, isSuccess, role, hasRole, "role" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, title, hasTitle, "title" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, show, hasShow, "show", &parseXlinkShow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, actuate, hasActuate, "actuate", &parseXlinkActuate ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, element, hasElement, "element" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, position, hasPosition, "position" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - if( !isHrefFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + if (parseAttribute(message, it, className, isSuccess, title, hasTitle, "title")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, show, hasShow, "show", &parseXlinkShow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, actuate, hasActuate, "actuate", &parseXlinkActuate)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, name, hasName, "name")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, element, hasElement, "element")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, position, hasPosition, "position")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + } + if (!isHrefFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LinkAttributes.h b/Sourcecode/private/mx/core/elements/LinkAttributes.h index e38eb12d7..a9f9f011a 100644 --- a/Sourcecode/private/mx/core/elements/LinkAttributes.h +++ b/Sourcecode/private/mx/core/elements/LinkAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/XlinkHref.h" #include "mx/core/XlinkRole.h" @@ -21,46 +21,46 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( LinkAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(LinkAttributes) - struct LinkAttributes : public AttributesInterface - { - public: - LinkAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XlinkHref href; - const XlinkType type; - XlinkRole role; - XlinkTitle title; - XlinkShow show; - XlinkActuate actuate; - XsToken name; - XsNMToken element; - PositiveInteger position; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - const bool hasHref; - bool hasType; - bool hasRole; - bool hasTitle; - bool hasShow; - bool hasActuate; - bool hasName; - bool hasElement; - bool hasPosition; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; +struct LinkAttributes : public AttributesInterface +{ + public: + LinkAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XlinkHref href; + const XlinkType type; + XlinkRole role; + XlinkTitle title; + XlinkShow show; + XlinkActuate actuate; + XsToken name; + XsNMToken element; + PositiveInteger position; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + const bool hasHref; + bool hasType; + bool hasRole; + bool hasTitle; + bool hasShow; + bool hasActuate; + bool hasName; + bool hasElement; + bool hasPosition; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Lyric.cpp b/Sourcecode/private/mx/core/elements/Lyric.cpp index 40944008c..e35052e3e 100644 --- a/Sourcecode/private/mx/core/elements/Lyric.cpp +++ b/Sourcecode/private/mx/core/elements/Lyric.cpp @@ -16,213 +16,199 @@ namespace mx { - namespace core - { - Lyric::Lyric() - :myAttributes( std::make_shared() ) - ,myLyricTextChoice( makeLyricTextChoice() ) - ,myEndLine( makeEndLine() ) - ,myHasEndLine( false ) - ,myEndParagraph( makeEndParagraph() ) - ,myHasEndParagraph( false ) - ,myEditorialGroup( makeEditorialGroup() ) - {} - - - bool Lyric::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Lyric::streamAttributes( std::ostream& os ) const - { - if ( myAttributes->hasValues() ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Lyric::streamName( std::ostream& os ) const - { - return os << "lyric"; - } - - - bool Lyric::hasContents() const - { - return true; - } +namespace core +{ +Lyric::Lyric() + : myAttributes(std::make_shared()), myLyricTextChoice(makeLyricTextChoice()), + myEndLine(makeEndLine()), myHasEndLine(false), myEndParagraph(makeEndParagraph()), myHasEndParagraph(false), + myEditorialGroup(makeEditorialGroup()) +{ +} +bool Lyric::hasAttributes() const +{ + return myAttributes->hasValues(); +} - LyricAttributesPtr Lyric::getAttributes() const - { - return myAttributes; - } +std::ostream &Lyric::streamAttributes(std::ostream &os) const +{ + if (myAttributes->hasValues()) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Lyric::streamName(std::ostream &os) const +{ + return os << "lyric"; +} - void Lyric::setAttributes( const LyricAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool Lyric::hasContents() const +{ + return true; +} +LyricAttributesPtr Lyric::getAttributes() const +{ + return myAttributes; +} - std::ostream& Lyric::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myLyricTextChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - if ( myHasEndLine ) - { - os << std::endl; - myEndLine->toStream( os, indentLevel+1 ); - } - if ( myHasEndParagraph ) - { - os << std::endl; - myEndParagraph->toStream( os, indentLevel+1 ); - } - if( myEditorialGroup->hasContents() ) - { - os << std::endl; - } - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - return os; - } +void Lyric::setAttributes(const LyricAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +std::ostream &Lyric::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myLyricTextChoice->streamContents(os, indentLevel + 1, isOneLineOnly); + if (myHasEndLine) + { + os << std::endl; + myEndLine->toStream(os, indentLevel + 1); + } + if (myHasEndParagraph) + { + os << std::endl; + myEndParagraph->toStream(os, indentLevel + 1); + } + if (myEditorialGroup->hasContents()) + { + os << std::endl; + } + myEditorialGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + os << std::endl; + isOneLineOnly = false; + return os; +} - LyricTextChoicePtr Lyric::getLyricTextChoice() const - { - return myLyricTextChoice; - } +LyricTextChoicePtr Lyric::getLyricTextChoice() const +{ + return myLyricTextChoice; +} +void Lyric::setLyricTextChoice(const LyricTextChoicePtr &value) +{ + if (value) + { + myLyricTextChoice = value; + } +} - void Lyric::setLyricTextChoice( const LyricTextChoicePtr& value ) - { - if ( value ) - { - myLyricTextChoice = value; - } - } +EndLinePtr Lyric::getEndLine() const +{ + return myEndLine; +} +void Lyric::setEndLine(const EndLinePtr &value) +{ + if (value) + { + myEndLine = value; + } +} - EndLinePtr Lyric::getEndLine() const - { - return myEndLine; - } +bool Lyric::getHasEndLine() const +{ + return myHasEndLine; +} +void Lyric::setHasEndLine(const bool value) +{ + myHasEndLine = value; +} - void Lyric::setEndLine( const EndLinePtr& value ) - { - if ( value ) - { - myEndLine = value; - } - } +EndParagraphPtr Lyric::getEndParagraph() const +{ + return myEndParagraph; +} +void Lyric::setEndParagraph(const EndParagraphPtr &value) +{ + if (value) + { + myEndParagraph = value; + } +} - bool Lyric::getHasEndLine() const - { - return myHasEndLine; - } +bool Lyric::getHasEndParagraph() const +{ + return myHasEndParagraph; +} +void Lyric::setHasEndParagraph(const bool value) +{ + myHasEndParagraph = value; +} - void Lyric::setHasEndLine( const bool value ) - { - myHasEndLine = value; - } +EditorialGroupPtr Lyric::getEditorialGroup() const +{ + return myEditorialGroup; +} +void Lyric::setEditorialGroup(const EditorialGroupPtr &value) +{ + if (value) + { + myEditorialGroup = value; + } +} - EndParagraphPtr Lyric::getEndParagraph() const - { - return myEndParagraph; - } +bool Lyric::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isLyricTextChoiceFound = false; + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { - void Lyric::setEndParagraph( const EndParagraphPtr& value ) + if (checkSetChoiceMember(message, *it, isSuccess, myLyricTextChoice, "extend", &LyricTextChoice::getExtend, + static_cast(LyricTextChoice::Choice::extend))) { - if ( value ) - { - myEndParagraph = value; - } + isLyricTextChoiceFound = true; + continue; } - - bool Lyric::getHasEndParagraph() const + else if (checkSetChoiceMember(message, *it, isSuccess, myLyricTextChoice, "laughing", + &LyricTextChoice::getLaughing, + static_cast(LyricTextChoice::Choice::laughing))) { - return myHasEndParagraph; + isLyricTextChoiceFound = true; + continue; } - - void Lyric::setHasEndParagraph( const bool value ) + else if (checkSetChoiceMember(message, *it, isSuccess, myLyricTextChoice, "humming", + &LyricTextChoice::getHumming, static_cast(LyricTextChoice::Choice::humming))) { - myHasEndParagraph = value; + isLyricTextChoiceFound = true; + continue; } - - EditorialGroupPtr Lyric::getEditorialGroup() const + else { - return myEditorialGroup; + myLyricTextChoice->setChoice(LyricTextChoice::Choice::syllabicTextGroup); + SyllabicTextGroupPtr ptr = myLyricTextChoice->getSyllabicTextGroup(); + importGroup(message, it, endIter, isSuccess, ptr); } - - - void Lyric::setEditorialGroup( const EditorialGroupPtr& value ) + if (importElement(message, *it, isSuccess, *myEndLine, myHasEndLine)) { - if ( value ) - { - myEditorialGroup = value; - } + continue; } - - - bool Lyric::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myEndParagraph, myHasEndParagraph)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isLyricTextChoiceFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - - if( checkSetChoiceMember( - message, *it, isSuccess, myLyricTextChoice, - "extend", &LyricTextChoice::getExtend, - static_cast( LyricTextChoice::Choice::extend ) ) ) - { isLyricTextChoiceFound = true; continue; } - - else if( checkSetChoiceMember( - message, *it, isSuccess, myLyricTextChoice, - "laughing", &LyricTextChoice::getLaughing, - static_cast( LyricTextChoice::Choice::laughing ) ) ) - { isLyricTextChoiceFound = true; continue; } - - else if( checkSetChoiceMember( - message, *it, isSuccess, myLyricTextChoice, - "humming", &LyricTextChoice::getHumming, - static_cast( LyricTextChoice::Choice::humming ) ) ) - { isLyricTextChoiceFound = true; continue; } - - else - { - myLyricTextChoice->setChoice( LyricTextChoice::Choice::syllabicTextGroup ); - SyllabicTextGroupPtr ptr = myLyricTextChoice->getSyllabicTextGroup(); - importGroup( message, it, endIter, isSuccess, ptr ); - } - if ( importElement( message, *it, isSuccess, *myEndLine, myHasEndLine ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myEndParagraph, myHasEndParagraph ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - - } - - MX_RETURN_IS_SUCCESS; + continue; } - + importGroup(message, it, endIter, isSuccess, myEditorialGroup); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Lyric.h b/Sourcecode/private/mx/core/elements/Lyric.h index 53895009b..169f005b3 100644 --- a/Sourcecode/private/mx/core/elements/Lyric.h +++ b/Sourcecode/private/mx/core/elements/Lyric.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/LyricAttributes.h" #include @@ -14,62 +14,65 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( LyricAttributes ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( EndLine ) - MX_FORWARD_DECLARE_ELEMENT( EndParagraph ) - MX_FORWARD_DECLARE_ELEMENT( LyricTextChoice ) - MX_FORWARD_DECLARE_ELEMENT( Lyric ) +MX_FORWARD_DECLARE_ATTRIBUTES(LyricAttributes) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) +MX_FORWARD_DECLARE_ELEMENT(EndLine) +MX_FORWARD_DECLARE_ELEMENT(EndParagraph) +MX_FORWARD_DECLARE_ELEMENT(LyricTextChoice) +MX_FORWARD_DECLARE_ELEMENT(Lyric) - inline LyricPtr makeLyric() { return std::make_shared(); } +inline LyricPtr makeLyric() +{ + return std::make_shared(); +} - class Lyric : public ElementInterface - { - public: - Lyric(); +class Lyric : public ElementInterface +{ + public: + Lyric(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LyricAttributesPtr getAttributes() const; - void setAttributes( const LyricAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + LyricAttributesPtr getAttributes() const; + void setAttributes(const LyricAttributesPtr &value); - /* _________ LyricTextChoice minOccurs = 1, maxOccurs = 1 _________ */ - LyricTextChoicePtr getLyricTextChoice() const; - void setLyricTextChoice( const LyricTextChoicePtr& value ); + /* _________ LyricTextChoice minOccurs = 1, maxOccurs = 1 _________ */ + LyricTextChoicePtr getLyricTextChoice() const; + void setLyricTextChoice(const LyricTextChoicePtr &value); - /* _________ EndLine minOccurs = 0, maxOccurs = 1 _________ */ - EndLinePtr getEndLine() const; - void setEndLine( const EndLinePtr& value ); - bool getHasEndLine() const; - void setHasEndLine( const bool value ); + /* _________ EndLine minOccurs = 0, maxOccurs = 1 _________ */ + EndLinePtr getEndLine() const; + void setEndLine(const EndLinePtr &value); + bool getHasEndLine() const; + void setHasEndLine(const bool value); - /* _________ EndParagraph minOccurs = 0, maxOccurs = 1 _________ */ - EndParagraphPtr getEndParagraph() const; - void setEndParagraph( const EndParagraphPtr& value ); - bool getHasEndParagraph() const; - void setHasEndParagraph( const bool value ); + /* _________ EndParagraph minOccurs = 0, maxOccurs = 1 _________ */ + EndParagraphPtr getEndParagraph() const; + void setEndParagraph(const EndParagraphPtr &value); + bool getHasEndParagraph() const; + void setHasEndParagraph(const bool value); - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); + /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialGroupPtr getEditorialGroup() const; + void setEditorialGroup(const EditorialGroupPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - LyricAttributesPtr myAttributes; - LyricTextChoicePtr myLyricTextChoice; - EndLinePtr myEndLine; - bool myHasEndLine; - EndParagraphPtr myEndParagraph; - bool myHasEndParagraph; - EditorialGroupPtr myEditorialGroup; - }; - } -} + private: + LyricAttributesPtr myAttributes; + LyricTextChoicePtr myLyricTextChoice; + EndLinePtr myEndLine; + bool myHasEndLine; + EndParagraphPtr myEndParagraph; + bool myHasEndParagraph; + EditorialGroupPtr myEditorialGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricAttributes.cpp b/Sourcecode/private/mx/core/elements/LyricAttributes.cpp index 18f6afaed..95d872bcb 100644 --- a/Sourcecode/private/mx/core/elements/LyricAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/LyricAttributes.cpp @@ -8,91 +8,94 @@ namespace mx { - namespace core +namespace core +{ +LyricAttributes::LyricAttributes() + : number(), name(), justify(LeftCenterRight::center), defaultX(), defaultY(), relativeX(), relativeY(), + placement(AboveBelow::below), color(), printObject(YesNo::no), hasNumber(false), hasName(false), + hasJustify(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasPlacement(false), hasColor(false), hasPrintObject(false) +{ +} + +bool LyricAttributes::hasValues() const +{ + return hasNumber || hasName || hasJustify || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || + hasPlacement || hasColor || hasPrintObject; +} + +std::ostream &LyricAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - LyricAttributes::LyricAttributes() - :number() - ,name() - ,justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,color() - ,printObject( YesNo::no ) - ,hasNumber( false ) - ,hasName( false ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, name, "name", hasName); + streamAttribute(os, justify, "justify", hasJustify); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} + +bool LyricAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "LyricAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool LyricAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasName || - hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement || - hasColor || - hasPrintObject; + continue; } - - - std::ostream& LyricAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, name, hasName, "name")) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; + continue; } - - - bool LyricAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) { - const char* const className = "LyricAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricAttributes.h b/Sourcecode/private/mx/core/elements/LyricAttributes.h index e587a1a16..84b77b428 100644 --- a/Sourcecode/private/mx/core/elements/LyricAttributes.h +++ b/Sourcecode/private/mx/core/elements/LyricAttributes.h @@ -4,11 +4,11 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsNMToken.h" #include "mx/core/XsToken.h" @@ -18,40 +18,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( LyricAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(LyricAttributes) - struct LyricAttributes : public AttributesInterface - { - public: - LyricAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsNMToken number; - XsToken name; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - Color color; - YesNo printObject; - bool hasNumber; - bool hasName; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; - bool hasColor; - bool hasPrintObject; +struct LyricAttributes : public AttributesInterface +{ + public: + LyricAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsNMToken number; + XsToken name; + LeftCenterRight justify; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + AboveBelow placement; + Color color; + YesNo printObject; + bool hasNumber; + bool hasName; + bool hasJustify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasPlacement; + bool hasColor; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricFont.cpp b/Sourcecode/private/mx/core/elements/LyricFont.cpp index ece30f7f0..a4ac985c8 100644 --- a/Sourcecode/private/mx/core/elements/LyricFont.cpp +++ b/Sourcecode/private/mx/core/elements/LyricFont.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - LyricFont::LyricFont() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool LyricFont::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool LyricFont::hasContents() const { return false; } - std::ostream& LyricFont::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& LyricFont::streamName( std::ostream& os ) const { os << "lyric-font"; return os; } - std::ostream& LyricFont::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +LyricFont::LyricFont() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool LyricFont::hasAttributes() const +{ + return myAttributes->hasValues(); +} - LyricFontAttributesPtr LyricFont::getAttributes() const - { - return myAttributes; - } +bool LyricFont::hasContents() const +{ + return false; +} +std::ostream &LyricFont::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void LyricFont::setAttributes( const LyricFontAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &LyricFont::streamName(std::ostream &os) const +{ + os << "lyric-font"; + return os; +} +std::ostream &LyricFont::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool LyricFont::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +LyricFontAttributesPtr LyricFont::getAttributes() const +{ + return myAttributes; +} +void LyricFont::setAttributes(const LyricFontAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool LyricFont::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricFont.h b/Sourcecode/private/mx/core/elements/LyricFont.h index 031558fb7..dbf0c6313 100644 --- a/Sourcecode/private/mx/core/elements/LyricFont.h +++ b/Sourcecode/private/mx/core/elements/LyricFont.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/LyricFontAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LyricFontAttributes ) - MX_FORWARD_DECLARE_ELEMENT( LyricFont ) - - inline LyricFontPtr makeLyricFont() { return std::make_shared(); } - - class LyricFont : public ElementInterface - { - public: - LyricFont(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LyricFontAttributesPtr getAttributes() const; - void setAttributes( const LyricFontAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LyricFontAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(LyricFontAttributes) +MX_FORWARD_DECLARE_ELEMENT(LyricFont) + +inline LyricFontPtr makeLyricFont() +{ + return std::make_shared(); } + +class LyricFont : public ElementInterface +{ + public: + LyricFont(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + LyricFontAttributesPtr getAttributes() const; + void setAttributes(const LyricFontAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + LyricFontAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp b/Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp index dbb5b7e2d..f92211038 100644 --- a/Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp @@ -8,71 +8,73 @@ namespace mx { - namespace core +namespace core +{ +LyricFontAttributes::LyricFontAttributes() + : number(), name(), fontFamily(), fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), + fontWeight(FontWeight::normal), hasNumber(false), hasName(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false) +{ +} + +bool LyricFontAttributes::hasValues() const +{ + return hasNumber || hasName || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight; +} + +std::ostream &LyricFontAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - LyricFontAttributes::LyricFontAttributes() - :number() - ,name() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,hasNumber( false ) - ,hasName( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, name, "name", hasName); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} +bool LyricFontAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "LyricFontAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool LyricFontAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasName || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& LyricFontAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, name, hasName, "name")) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool LyricFontAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) { - const char* const className = "LyricFontAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricFontAttributes.h b/Sourcecode/private/mx/core/elements/LyricFontAttributes.h index 3dfcf2e36..bfe560925 100644 --- a/Sourcecode/private/mx/core/elements/LyricFontAttributes.h +++ b/Sourcecode/private/mx/core/elements/LyricFontAttributes.h @@ -4,11 +4,11 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsNMToken.h" #include "mx/core/XsToken.h" @@ -18,32 +18,32 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( LyricFontAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(LyricFontAttributes) - struct LyricFontAttributes : public AttributesInterface - { - public: - LyricFontAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsNMToken number; - XsToken name; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasNumber; - bool hasName; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct LyricFontAttributes : public AttributesInterface +{ + public: + LyricFontAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsNMToken number; + XsToken name; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasNumber; + bool hasName; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricLanguage.cpp b/Sourcecode/private/mx/core/elements/LyricLanguage.cpp index 944f2fbd8..97b753fe1 100644 --- a/Sourcecode/private/mx/core/elements/LyricLanguage.cpp +++ b/Sourcecode/private/mx/core/elements/LyricLanguage.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - LyricLanguage::LyricLanguage() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool LyricLanguage::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool LyricLanguage::hasContents() const { return false; } - std::ostream& LyricLanguage::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& LyricLanguage::streamName( std::ostream& os ) const { os << "lyric-language"; return os; } - std::ostream& LyricLanguage::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +LyricLanguage::LyricLanguage() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool LyricLanguage::hasAttributes() const +{ + return myAttributes->hasValues(); +} - LyricLanguageAttributesPtr LyricLanguage::getAttributes() const - { - return myAttributes; - } +bool LyricLanguage::hasContents() const +{ + return false; +} +std::ostream &LyricLanguage::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void LyricLanguage::setAttributes( const LyricLanguageAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &LyricLanguage::streamName(std::ostream &os) const +{ + os << "lyric-language"; + return os; +} +std::ostream &LyricLanguage::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool LyricLanguage::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +LyricLanguageAttributesPtr LyricLanguage::getAttributes() const +{ + return myAttributes; +} +void LyricLanguage::setAttributes(const LyricLanguageAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool LyricLanguage::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricLanguage.h b/Sourcecode/private/mx/core/elements/LyricLanguage.h index fb16c5d61..73fde0f42 100644 --- a/Sourcecode/private/mx/core/elements/LyricLanguage.h +++ b/Sourcecode/private/mx/core/elements/LyricLanguage.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/LyricLanguageAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LyricLanguageAttributes ) - MX_FORWARD_DECLARE_ELEMENT( LyricLanguage ) - - inline LyricLanguagePtr makeLyricLanguage() { return std::make_shared(); } - - class LyricLanguage : public ElementInterface - { - public: - LyricLanguage(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LyricLanguageAttributesPtr getAttributes() const; - void setAttributes( const LyricLanguageAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LyricLanguageAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(LyricLanguageAttributes) +MX_FORWARD_DECLARE_ELEMENT(LyricLanguage) + +inline LyricLanguagePtr makeLyricLanguage() +{ + return std::make_shared(); } + +class LyricLanguage : public ElementInterface +{ + public: + LyricLanguage(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + LyricLanguageAttributesPtr getAttributes() const; + void setAttributes(const LyricLanguageAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + LyricLanguageAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp b/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp index 33f3b7dd2..2b3be52d8 100644 --- a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp @@ -8,63 +8,66 @@ namespace mx { - namespace core +namespace core +{ +LyricLanguageAttributes::LyricLanguageAttributes() + : number(), name(), lang("it"), hasNumber(false), hasName(false), hasLang(true) +{ +} + +bool LyricLanguageAttributes::hasValues() const +{ + return hasNumber || hasName || hasLang; +} + +std::ostream &LyricLanguageAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - LyricLanguageAttributes::LyricLanguageAttributes() - :number() - ,name() - ,lang( "it" ) - ,hasNumber( false ) - ,hasName( false ) - ,hasLang( true ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, name, "name", hasName); + streamAttribute(os, lang, "xml:lang", hasLang); + } + return os; +} + +bool LyricLanguageAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "LyricLanguageAttributes"; + bool isSuccess = true; + bool isLangFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool LyricLanguageAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasName || - hasLang; + continue; } - - - std::ostream& LyricLanguageAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, name, hasName, "name")) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, lang, "xml:lang", hasLang ); - } - return os; + continue; } - - - bool LyricLanguageAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, lang, isLangFound, "xml:lang")) { - const char* const className = "LyricLanguageAttributes"; - bool isSuccess = true; - bool isLangFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, isLangFound, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, isLangFound, "lang" ) ) { continue; } - } - - if( !isLangFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, lang, isLangFound, "lang")) + { + continue; + } + } + if (!isLangFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h b/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h index e65b0bdd1..35b2b0358 100644 --- a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h +++ b/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XmlLang.h" #include "mx/core/XsNMToken.h" #include "mx/core/XsToken.h" @@ -16,26 +16,26 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( LyricLanguageAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(LyricLanguageAttributes) - struct LyricLanguageAttributes : public AttributesInterface - { - public: - LyricLanguageAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsNMToken number; - XsToken name; - XmlLang lang; - bool hasNumber; - bool hasName; - const bool hasLang; +struct LyricLanguageAttributes : public AttributesInterface +{ + public: + LyricLanguageAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsNMToken number; + XsToken name; + XmlLang lang; + bool hasNumber; + bool hasName; + const bool hasLang; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricTextChoice.cpp b/Sourcecode/private/mx/core/elements/LyricTextChoice.cpp index ee1de9863..47c178763 100644 --- a/Sourcecode/private/mx/core/elements/LyricTextChoice.cpp +++ b/Sourcecode/private/mx/core/elements/LyricTextChoice.cpp @@ -12,145 +12,123 @@ namespace mx { - namespace core +namespace core +{ +LyricTextChoice::LyricTextChoice() + : myChoice(Choice::syllabicTextGroup), mySyllabicTextGroup(makeSyllabicTextGroup()), myExtend(makeExtend()), + myLaughing(makeLaughing()), myHumming(makeHumming()) +{ +} + +bool LyricTextChoice::hasAttributes() const +{ + return false; +} + +std::ostream &LyricTextChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &LyricTextChoice::streamName(std::ostream &os) const +{ + return os; +} + +bool LyricTextChoice::hasContents() const +{ + return myChoice == Choice::syllabicTextGroup; +} + +std::ostream &LyricTextChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::syllabicTextGroup: { + mySyllabicTextGroup->streamContents(os, indentLevel, isOneLineOnly); + } + break; + case Choice::extend: { + myExtend->toStream(os, indentLevel); + } + break; + case Choice::laughing: { + myLaughing->toStream(os, indentLevel); + } + break; + case Choice::humming: { + myHumming->toStream(os, indentLevel); + } + break; + default: + break; + } + return os; +} + +LyricTextChoice::Choice LyricTextChoice::getChoice() const +{ + return myChoice; +} + +void LyricTextChoice::setChoice(const LyricTextChoice::Choice value) +{ + myChoice = value; +} + +SyllabicTextGroupPtr LyricTextChoice::getSyllabicTextGroup() const +{ + return mySyllabicTextGroup; +} + +void LyricTextChoice::setSyllabicTextGroup(const SyllabicTextGroupPtr &value) +{ + if (value) { - LyricTextChoice::LyricTextChoice() - :myChoice( Choice::syllabicTextGroup ) - ,mySyllabicTextGroup( makeSyllabicTextGroup() ) - ,myExtend( makeExtend() ) - ,myLaughing( makeLaughing() ) - ,myHumming( makeHumming() ) - {} - - - bool LyricTextChoice::hasAttributes() const - { - return false; - } - - - std::ostream& LyricTextChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& LyricTextChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool LyricTextChoice::hasContents() const - { - return myChoice == Choice::syllabicTextGroup; - } - - - std::ostream& LyricTextChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::syllabicTextGroup: - { - mySyllabicTextGroup->streamContents( os, indentLevel, isOneLineOnly ); - } - break; - case Choice::extend: - { - myExtend->toStream( os, indentLevel ); - } - break; - case Choice::laughing: - { - myLaughing->toStream( os, indentLevel ); - } - break; - case Choice::humming: - { - myHumming->toStream( os, indentLevel ); - } - break; - default: - break; - } - return os; - } - - - LyricTextChoice::Choice LyricTextChoice::getChoice() const - { - return myChoice; - } - - - void LyricTextChoice::setChoice( const LyricTextChoice::Choice value ) - { - myChoice = value; - } - - - SyllabicTextGroupPtr LyricTextChoice::getSyllabicTextGroup() const - { - return mySyllabicTextGroup; - } - - - void LyricTextChoice::setSyllabicTextGroup( const SyllabicTextGroupPtr& value ) - { - if ( value ) - { - mySyllabicTextGroup = value; - } - } - - - ExtendPtr LyricTextChoice::getExtend() const - { - return myExtend; - } - - - void LyricTextChoice::setExtend( const ExtendPtr& value ) - { - if ( value ) - { - myExtend = value; - } - } + mySyllabicTextGroup = value; + } +} +ExtendPtr LyricTextChoice::getExtend() const +{ + return myExtend; +} + +void LyricTextChoice::setExtend(const ExtendPtr &value) +{ + if (value) + { + myExtend = value; + } +} - LaughingPtr LyricTextChoice::getLaughing() const - { - return myLaughing; - } - +LaughingPtr LyricTextChoice::getLaughing() const +{ + return myLaughing; +} - void LyricTextChoice::setLaughing( const LaughingPtr& value ) - { - if ( value ) - { - myLaughing = value; - } - } +void LyricTextChoice::setLaughing(const LaughingPtr &value) +{ + if (value) + { + myLaughing = value; + } +} +HummingPtr LyricTextChoice::getHumming() const +{ + return myHumming; +} - HummingPtr LyricTextChoice::getHumming() const - { - return myHumming; - } - - - void LyricTextChoice::setHumming( const HummingPtr& value ) - { - if ( value ) - { - myHumming = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( LyricTextChoice ); - +void LyricTextChoice::setHumming(const HummingPtr &value) +{ + if (value) + { + myHumming = value; } } + +MX_FROM_XELEMENT_UNUSED(LyricTextChoice); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/LyricTextChoice.h b/Sourcecode/private/mx/core/elements/LyricTextChoice.h index f2180bb59..ffc99fa53 100644 --- a/Sourcecode/private/mx/core/elements/LyricTextChoice.h +++ b/Sourcecode/private/mx/core/elements/LyricTextChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,62 +13,65 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Extend ) - MX_FORWARD_DECLARE_ELEMENT( Humming ) - MX_FORWARD_DECLARE_ELEMENT( Laughing ) - MX_FORWARD_DECLARE_ELEMENT( SyllabicTextGroup ) - MX_FORWARD_DECLARE_ELEMENT( LyricTextChoice ) +MX_FORWARD_DECLARE_ELEMENT(Extend) +MX_FORWARD_DECLARE_ELEMENT(Humming) +MX_FORWARD_DECLARE_ELEMENT(Laughing) +MX_FORWARD_DECLARE_ELEMENT(SyllabicTextGroup) +MX_FORWARD_DECLARE_ELEMENT(LyricTextChoice) - inline LyricTextChoicePtr makeLyricTextChoice() { return std::make_shared(); } +inline LyricTextChoicePtr makeLyricTextChoice() +{ + return std::make_shared(); +} - class LyricTextChoice : public ElementInterface - { - public: - enum class Choice - { - syllabicTextGroup = 1, - extend = 2, - laughing = 3, - humming = 4 - }; - LyricTextChoice(); +class LyricTextChoice : public ElementInterface +{ + public: + enum class Choice + { + syllabicTextGroup = 1, + extend = 2, + laughing = 3, + humming = 4 + }; + LyricTextChoice(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LyricTextChoice::Choice getChoice() const; - void setChoice( const LyricTextChoice::Choice value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + LyricTextChoice::Choice getChoice() const; + void setChoice(const LyricTextChoice::Choice value); - /* _________ SyllabicTextGroup minOccurs = 1, maxOccurs = 1 _________ */ - SyllabicTextGroupPtr getSyllabicTextGroup() const; - void setSyllabicTextGroup( const SyllabicTextGroupPtr& value ); + /* _________ SyllabicTextGroup minOccurs = 1, maxOccurs = 1 _________ */ + SyllabicTextGroupPtr getSyllabicTextGroup() const; + void setSyllabicTextGroup(const SyllabicTextGroupPtr &value); - /* _________ Extend minOccurs = 1, maxOccurs = 1 _________ */ - ExtendPtr getExtend() const; - void setExtend( const ExtendPtr& value ); + /* _________ Extend minOccurs = 1, maxOccurs = 1 _________ */ + ExtendPtr getExtend() const; + void setExtend(const ExtendPtr &value); - /* _________ Laughing minOccurs = 1, maxOccurs = 1 _________ */ - LaughingPtr getLaughing() const; - void setLaughing( const LaughingPtr& value ); + /* _________ Laughing minOccurs = 1, maxOccurs = 1 _________ */ + LaughingPtr getLaughing() const; + void setLaughing(const LaughingPtr &value); - /* _________ Humming minOccurs = 1, maxOccurs = 1 _________ */ - HummingPtr getHumming() const; - void setHumming( const HummingPtr& value ); + /* _________ Humming minOccurs = 1, maxOccurs = 1 _________ */ + HummingPtr getHumming() const; + void setHumming(const HummingPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - Choice myChoice; - SyllabicTextGroupPtr mySyllabicTextGroup; - ExtendPtr myExtend; - LaughingPtr myLaughing; - HummingPtr myHumming; - }; - } -} + private: + Choice myChoice; + SyllabicTextGroupPtr mySyllabicTextGroup; + ExtendPtr myExtend; + LaughingPtr myLaughing; + HummingPtr myHumming; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureAttributes.cpp b/Sourcecode/private/mx/core/elements/MeasureAttributes.cpp index a3ab1f1fe..926840468 100644 --- a/Sourcecode/private/mx/core/elements/MeasureAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureAttributes.cpp @@ -3,73 +3,75 @@ // Distributed under the MIT License #include "mx/core/elements/MeasureAttributes.h" -#include "mx/core/FromXElement.h" #include "mx/core/FromString.h" +#include "mx/core/FromXElement.h" #include namespace mx { - namespace core +namespace core +{ +MeasureAttributes::MeasureAttributes() + : number(), implicit(YesNo::no), nonControlling(YesNo::no), width(), hasNumber(true), hasImplicit(false), + hasNonControlling(false), hasWidth(false) +{ +} + +bool MeasureAttributes::hasValues() const +{ + return hasNumber || hasImplicit || hasNonControlling || hasWidth; +} + +std::ostream &MeasureAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - MeasureAttributes::MeasureAttributes() - :number() - ,implicit( YesNo::no ) - ,nonControlling( YesNo::no ) - ,width() - ,hasNumber( true ) - ,hasImplicit( false ) - ,hasNonControlling( false ) - ,hasWidth( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, implicit, "implicit", hasImplicit); + streamAttribute(os, nonControlling, "non-controlling", hasNonControlling); + streamAttribute(os, width, "width", hasWidth); + } + return os; +} +bool MeasureAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MeasureAttributes"; + bool isSuccess = true; + bool isNumberFound = false; - bool MeasureAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, isNumberFound, "number")) { - return hasNumber || - hasImplicit || - hasNonControlling || - hasWidth; + continue; } - - - std::ostream& MeasureAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, implicit, hasImplicit, "implicit", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, implicit, "implicit", hasImplicit ); - streamAttribute( os, nonControlling, "non-controlling", hasNonControlling ); - streamAttribute( os, width, "width", hasWidth ); - } - return os; + continue; } - - - bool MeasureAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, nonControlling, hasNonControlling, "non-controlling", + &parseYesNo)) { - const char* const className = "MeasureAttributes"; - bool isSuccess = true; - bool isNumberFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, isNumberFound, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, implicit, hasImplicit, "implicit", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, nonControlling, hasNonControlling, "non-controlling", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, width, hasWidth, "width" ) ) { continue; } - } - - if( !isNumberFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + if (parseAttribute(message, it, className, isSuccess, width, hasWidth, "width")) + { + continue; + } + } + if (!isNumberFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureAttributes.h b/Sourcecode/private/mx/core/elements/MeasureAttributes.h index c5f789357..a8e41518e 100644 --- a/Sourcecode/private/mx/core/elements/MeasureAttributes.h +++ b/Sourcecode/private/mx/core/elements/MeasureAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -16,27 +16,27 @@ namespace mx { - namespace core - { - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureAttributes ) +namespace core +{ +MX_FORWARD_DECLARE_ATTRIBUTES(MeasureAttributes) - struct MeasureAttributes : public AttributesInterface - { - public: - MeasureAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken number; - YesNo implicit; - YesNo nonControlling; - TenthsValue width; - const bool hasNumber; - bool hasImplicit; - bool hasNonControlling; - bool hasWidth; +struct MeasureAttributes : public AttributesInterface +{ + public: + MeasureAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken number; + YesNo implicit; + YesNo nonControlling; + TenthsValue width; + const bool hasNumber; + bool hasImplicit; + bool hasNonControlling; + bool hasWidth; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureDistance.cpp b/Sourcecode/private/mx/core/elements/MeasureDistance.cpp index f61e1f8e2..c865aa38a 100644 --- a/Sourcecode/private/mx/core/elements/MeasureDistance.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureDistance.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - MeasureDistance::MeasureDistance() - :myValue() - {} - - - MeasureDistance::MeasureDistance( const TenthsValue& value ) - :myValue( value ) - {} - - - bool MeasureDistance::hasAttributes() const - { - return false; - } - - - bool MeasureDistance::hasContents() const - { - return true; - } - - - std::ostream& MeasureDistance::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MeasureDistance::streamName( std::ostream& os ) const - { - os << "measure-distance"; - return os; - } +namespace core +{ +MeasureDistance::MeasureDistance() : myValue() +{ +} +MeasureDistance::MeasureDistance(const TenthsValue &value) : myValue(value) +{ +} - std::ostream& MeasureDistance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MeasureDistance::hasAttributes() const +{ + return false; +} +bool MeasureDistance::hasContents() const +{ + return true; +} - TenthsValue MeasureDistance::getValue() const - { - return myValue; - } +std::ostream &MeasureDistance::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MeasureDistance::streamName(std::ostream &os) const +{ + os << "measure-distance"; + return os; +} - void MeasureDistance::setValue( const TenthsValue& value ) - { - myValue = value; - } +std::ostream &MeasureDistance::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TenthsValue MeasureDistance::getValue() const +{ + return myValue; +} - bool MeasureDistance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void MeasureDistance::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool MeasureDistance::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureDistance.h b/Sourcecode/private/mx/core/elements/MeasureDistance.h index 4057e42e4..e0697110f 100644 --- a/Sourcecode/private/mx/core/elements/MeasureDistance.h +++ b/Sourcecode/private/mx/core/elements/MeasureDistance.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MeasureDistance ) - - inline MeasureDistancePtr makeMeasureDistance() { return std::make_shared(); } - inline MeasureDistancePtr makeMeasureDistance( const TenthsValue& value ) { return std::make_shared( value ); } - inline MeasureDistancePtr makeMeasureDistance( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class MeasureDistance : public ElementInterface - { - public: - MeasureDistance(); - MeasureDistance( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MeasureDistance) + +inline MeasureDistancePtr makeMeasureDistance() +{ + return std::make_shared(); } + +inline MeasureDistancePtr makeMeasureDistance(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline MeasureDistancePtr makeMeasureDistance(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class MeasureDistance : public ElementInterface +{ + public: + MeasureDistance(); + MeasureDistance(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureLayout.cpp b/Sourcecode/private/mx/core/elements/MeasureLayout.cpp index 749b98413..3a730efd3 100644 --- a/Sourcecode/private/mx/core/elements/MeasureLayout.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureLayout.cpp @@ -9,95 +9,87 @@ namespace mx { - namespace core - { - MeasureLayout::MeasureLayout() - :myMeasureDistance( makeMeasureDistance() ) - ,myHasMeasureDistance( false ) - {} - - - bool MeasureLayout::hasAttributes() const - { - return false; - } - - - std::ostream& MeasureLayout::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MeasureLayout::streamName( std::ostream& os ) const - { - os << "measure-layout"; - return os; - } - - - bool MeasureLayout::hasContents() const - { - return true; - } - +namespace core +{ +MeasureLayout::MeasureLayout() : myMeasureDistance(makeMeasureDistance()), myHasMeasureDistance(false) +{ +} - std::ostream& MeasureLayout::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasMeasureDistance ) - { - os << std::endl; - myMeasureDistance->toStream( os, indentLevel+1 ); - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } +bool MeasureLayout::hasAttributes() const +{ + return false; +} +std::ostream &MeasureLayout::streamAttributes(std::ostream &os) const +{ + return os; +} - MeasureDistancePtr MeasureLayout::getMeasureDistance() const - { - return myMeasureDistance; - } +std::ostream &MeasureLayout::streamName(std::ostream &os) const +{ + os << "measure-layout"; + return os; +} +bool MeasureLayout::hasContents() const +{ + return true; +} - void MeasureLayout::setMeasureDistance( const MeasureDistancePtr& value ) - { - if( value ) - { - myMeasureDistance = value; - } - } +std::ostream &MeasureLayout::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasMeasureDistance) + { + os << std::endl; + myMeasureDistance->toStream(os, indentLevel + 1); + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +MeasureDistancePtr MeasureLayout::getMeasureDistance() const +{ + return myMeasureDistance; +} - bool MeasureLayout::getHasMeasureDistance() const - { - return myHasMeasureDistance; - } +void MeasureLayout::setMeasureDistance(const MeasureDistancePtr &value) +{ + if (value) + { + myMeasureDistance = value; + } +} +bool MeasureLayout::getHasMeasureDistance() const +{ + return myHasMeasureDistance; +} - void MeasureLayout::setHasMeasureDistance( const bool value ) - { - myHasMeasureDistance = value; - } +void MeasureLayout::setHasMeasureDistance(const bool value) +{ + myHasMeasureDistance = value; +} +bool MeasureLayout::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; - bool MeasureLayout::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myMeasureDistance, myHasMeasureDistance)) { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMeasureDistance, myHasMeasureDistance ) ) { continue; } - } - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureLayout.h b/Sourcecode/private/mx/core/elements/MeasureLayout.h index a29bfaaba..4035aafb1 100644 --- a/Sourcecode/private/mx/core/elements/MeasureLayout.h +++ b/Sourcecode/private/mx/core/elements/MeasureLayout.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,37 +13,40 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MeasureDistance ) - MX_FORWARD_DECLARE_ELEMENT( MeasureLayout ) - - inline MeasureLayoutPtr makeMeasureLayout() { return std::make_shared(); } - - class MeasureLayout : public ElementInterface - { - public: - MeasureLayout(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MeasureDistance minOccurs = 0, maxOccurs = 1 _________ */ - MeasureDistancePtr getMeasureDistance() const; - void setMeasureDistance( const MeasureDistancePtr& value ); - bool getHasMeasureDistance() const; - void setHasMeasureDistance( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MeasureDistancePtr myMeasureDistance; - bool myHasMeasureDistance; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MeasureDistance) +MX_FORWARD_DECLARE_ELEMENT(MeasureLayout) + +inline MeasureLayoutPtr makeMeasureLayout() +{ + return std::make_shared(); } + +class MeasureLayout : public ElementInterface +{ + public: + MeasureLayout(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ MeasureDistance minOccurs = 0, maxOccurs = 1 _________ */ + MeasureDistancePtr getMeasureDistance() const; + void setMeasureDistance(const MeasureDistancePtr &value); + bool getHasMeasureDistance() const; + void setHasMeasureDistance(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MeasureDistancePtr myMeasureDistance; + bool myHasMeasureDistance; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureNumbering.cpp b/Sourcecode/private/mx/core/elements/MeasureNumbering.cpp index 7e1d6b5a7..1fccdc1d8 100644 --- a/Sourcecode/private/mx/core/elements/MeasureNumbering.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureNumbering.cpp @@ -8,92 +8,81 @@ namespace mx { - namespace core - { - MeasureNumbering::MeasureNumbering() - :myValue( MeasureNumberingValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - MeasureNumbering::MeasureNumbering( const MeasureNumberingValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MeasureNumbering::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MeasureNumbering::hasContents() const - { - return true; - } - - - std::ostream& MeasureNumbering::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MeasureNumbering::streamName( std::ostream& os ) const - { - os << "measure-numbering"; - return os; - } - - - std::ostream& MeasureNumbering::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +MeasureNumbering::MeasureNumbering() + : myValue(MeasureNumberingValue::none), myAttributes(std::make_shared()) +{ +} +MeasureNumbering::MeasureNumbering(const MeasureNumberingValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - MeasureNumberingAttributesPtr MeasureNumbering::getAttributes() const - { - return myAttributes; - } +bool MeasureNumbering::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool MeasureNumbering::hasContents() const +{ + return true; +} - void MeasureNumbering::setAttributes( const MeasureNumberingAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MeasureNumbering::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &MeasureNumbering::streamName(std::ostream &os) const +{ + os << "measure-numbering"; + return os; +} - MeasureNumberingValue MeasureNumbering::getValue() const - { - return myValue; - } +std::ostream &MeasureNumbering::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MeasureNumberingAttributesPtr MeasureNumbering::getAttributes() const +{ + return myAttributes; +} - void MeasureNumbering::setValue( const MeasureNumberingValue& value ) - { - myValue = value; - } +void MeasureNumbering::setAttributes(const MeasureNumberingAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +MeasureNumberingValue MeasureNumbering::getValue() const +{ + return myValue; +} - bool MeasureNumbering::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseMeasureNumberingValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void MeasureNumbering::setValue(const MeasureNumberingValue &value) +{ + myValue = value; +} - } +bool MeasureNumbering::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseMeasureNumberingValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureNumbering.h b/Sourcecode/private/mx/core/elements/MeasureNumbering.h index 3fb0ecc1d..f76d40404 100644 --- a/Sourcecode/private/mx/core/elements/MeasureNumbering.h +++ b/Sourcecode/private/mx/core/elements/MeasureNumbering.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/MeasureNumberingAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureNumberingAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MeasureNumbering ) - - inline MeasureNumberingPtr makeMeasureNumbering() { return std::make_shared(); } - inline MeasureNumberingPtr makeMeasureNumbering( const MeasureNumberingValue& value ) { return std::make_shared( value ); } - inline MeasureNumberingPtr makeMeasureNumbering( MeasureNumberingValue&& value ) { return std::make_shared( std::move( value ) ); } - - class MeasureNumbering : public ElementInterface - { - public: - MeasureNumbering(); - MeasureNumbering( const MeasureNumberingValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MeasureNumberingAttributesPtr getAttributes() const; - void setAttributes( const MeasureNumberingAttributesPtr& attributes ); - MeasureNumberingValue getValue() const; - void setValue( const MeasureNumberingValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MeasureNumberingValue myValue; - MeasureNumberingAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MeasureNumberingAttributes) +MX_FORWARD_DECLARE_ELEMENT(MeasureNumbering) + +inline MeasureNumberingPtr makeMeasureNumbering() +{ + return std::make_shared(); +} + +inline MeasureNumberingPtr makeMeasureNumbering(const MeasureNumberingValue &value) +{ + return std::make_shared(value); } + +inline MeasureNumberingPtr makeMeasureNumbering(MeasureNumberingValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class MeasureNumbering : public ElementInterface +{ + public: + MeasureNumbering(); + MeasureNumbering(const MeasureNumberingValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MeasureNumberingAttributesPtr getAttributes() const; + void setAttributes(const MeasureNumberingAttributesPtr &attributes); + MeasureNumberingValue getValue() const; + void setValue(const MeasureNumberingValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MeasureNumberingValue myValue; + MeasureNumberingAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp b/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp index f903b30ce..f3f72290b 100644 --- a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +MeasureNumberingAttributes::MeasureNumberingAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), halign(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasHalign(false) +{ +} + +bool MeasureNumberingAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasHalign; +} + +std::ostream &MeasureNumberingAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - MeasureNumberingAttributes::MeasureNumberingAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + } + return os; +} + +bool MeasureNumberingAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MeasureNumberingAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool MeasureNumberingAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; + continue; } - - - std::ostream& MeasureNumberingAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; + continue; } - - - bool MeasureNumberingAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "MeasureNumberingAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h b/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h index 79f0f12a6..d193ac034 100644 --- a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h +++ b/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureNumberingAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MeasureNumberingAttributes) - struct MeasureNumberingAttributes : public AttributesInterface - { - public: - MeasureNumberingAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; +struct MeasureNumberingAttributes : public AttributesInterface +{ + public: + MeasureNumberingAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeat.cpp b/Sourcecode/private/mx/core/elements/MeasureRepeat.cpp index a3a862640..b9abb391f 100644 --- a/Sourcecode/private/mx/core/elements/MeasureRepeat.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureRepeat.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - MeasureRepeat::MeasureRepeat() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - MeasureRepeat::MeasureRepeat( const PositiveIntegerOrEmpty& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MeasureRepeat::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MeasureRepeat::hasContents() const - { - return true; - } - - - std::ostream& MeasureRepeat::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MeasureRepeat::streamName( std::ostream& os ) const - { - os << "measure-repeat"; - return os; - } - - - std::ostream& MeasureRepeat::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +MeasureRepeat::MeasureRepeat() : myValue(), myAttributes(std::make_shared()) +{ +} +MeasureRepeat::MeasureRepeat(const PositiveIntegerOrEmpty &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - MeasureRepeatAttributesPtr MeasureRepeat::getAttributes() const - { - return myAttributes; - } +bool MeasureRepeat::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool MeasureRepeat::hasContents() const +{ + return true; +} - void MeasureRepeat::setAttributes( const MeasureRepeatAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MeasureRepeat::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &MeasureRepeat::streamName(std::ostream &os) const +{ + os << "measure-repeat"; + return os; +} - PositiveIntegerOrEmpty MeasureRepeat::getValue() const - { - return myValue; - } +std::ostream &MeasureRepeat::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MeasureRepeatAttributesPtr MeasureRepeat::getAttributes() const +{ + return myAttributes; +} - void MeasureRepeat::setValue( const PositiveIntegerOrEmpty& value ) - { - myValue = value; - } +void MeasureRepeat::setAttributes(const MeasureRepeatAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +PositiveIntegerOrEmpty MeasureRepeat::getValue() const +{ + return myValue; +} - bool MeasureRepeat::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - return isSuccess; - } +void MeasureRepeat::setValue(const PositiveIntegerOrEmpty &value) +{ + myValue = value; +} - } +bool MeasureRepeat::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeat.h b/Sourcecode/private/mx/core/elements/MeasureRepeat.h index ef09f276d..b2d0ab010 100644 --- a/Sourcecode/private/mx/core/elements/MeasureRepeat.h +++ b/Sourcecode/private/mx/core/elements/MeasureRepeat.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/PositiveIntegerOrEmpty.h" #include "mx/core/elements/MeasureRepeatAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureRepeatAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MeasureRepeat ) - - inline MeasureRepeatPtr makeMeasureRepeat() { return std::make_shared(); } - inline MeasureRepeatPtr makeMeasureRepeat( const PositiveIntegerOrEmpty& value ) { return std::make_shared( value ); } - inline MeasureRepeatPtr makeMeasureRepeat( PositiveIntegerOrEmpty&& value ) { return std::make_shared( std::move( value ) ); } - - class MeasureRepeat : public ElementInterface - { - public: - MeasureRepeat(); - MeasureRepeat( const PositiveIntegerOrEmpty& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MeasureRepeatAttributesPtr getAttributes() const; - void setAttributes( const MeasureRepeatAttributesPtr& attributes ); - PositiveIntegerOrEmpty getValue() const; - void setValue( const PositiveIntegerOrEmpty& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveIntegerOrEmpty myValue; - MeasureRepeatAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MeasureRepeatAttributes) +MX_FORWARD_DECLARE_ELEMENT(MeasureRepeat) + +inline MeasureRepeatPtr makeMeasureRepeat() +{ + return std::make_shared(); +} + +inline MeasureRepeatPtr makeMeasureRepeat(const PositiveIntegerOrEmpty &value) +{ + return std::make_shared(value); } + +inline MeasureRepeatPtr makeMeasureRepeat(PositiveIntegerOrEmpty &&value) +{ + return std::make_shared(std::move(value)); +} + +class MeasureRepeat : public ElementInterface +{ + public: + MeasureRepeat(); + MeasureRepeat(const PositiveIntegerOrEmpty &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MeasureRepeatAttributesPtr getAttributes() const; + void setAttributes(const MeasureRepeatAttributesPtr &attributes); + PositiveIntegerOrEmpty getValue() const; + void setValue(const PositiveIntegerOrEmpty &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveIntegerOrEmpty myValue; + MeasureRepeatAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp b/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp index 0c3982750..cff92373b 100644 --- a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp @@ -8,57 +8,56 @@ namespace mx { - namespace core - { - MeasureRepeatAttributes::MeasureRepeatAttributes() - :type( StartStop::start ) - ,slashes() - ,hasType( true ) - ,hasSlashes( false ) - {} +namespace core +{ +MeasureRepeatAttributes::MeasureRepeatAttributes() : type(StartStop::start), slashes(), hasType(true), hasSlashes(false) +{ +} +bool MeasureRepeatAttributes::hasValues() const +{ + return hasType || hasSlashes; +} - bool MeasureRepeatAttributes::hasValues() const - { - return hasType || - hasSlashes; - } +std::ostream &MeasureRepeatAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + streamAttribute(os, slashes, "slashes", hasSlashes); + } + return os; +} + +bool MeasureRepeatAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MeasureRepeatAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - std::ostream& MeasureRepeatAttributes::toStream( std::ostream& os ) const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, slashes, "slashes", hasSlashes ); - } - return os; + continue; } - - - bool MeasureRepeatAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, slashes, hasSlashes, "slashes")) { - const char* const className = "MeasureRepeatAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slashes, hasSlashes, "slashes" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h b/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h index 44fe3346a..4d897fd26 100644 --- a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h +++ b/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -15,24 +15,24 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureRepeatAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MeasureRepeatAttributes) - struct MeasureRepeatAttributes : public AttributesInterface - { - public: - MeasureRepeatAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - PositiveInteger slashes; - const bool hasType; - bool hasSlashes; +struct MeasureRepeatAttributes : public AttributesInterface +{ + public: + MeasureRepeatAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + PositiveInteger slashes; + const bool hasType; + bool hasSlashes; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureStyle.cpp b/Sourcecode/private/mx/core/elements/MeasureStyle.cpp index 16398914e..2d1b31cae 100644 --- a/Sourcecode/private/mx/core/elements/MeasureStyle.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureStyle.cpp @@ -9,90 +9,80 @@ namespace mx { - namespace core - { - MeasureStyle::MeasureStyle() - :myAttributes( std::make_shared() ) - ,myChoice( makeMeasureStyleChoice() ) - {} - - - bool MeasureStyle::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& MeasureStyle::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& MeasureStyle::streamName( std::ostream& os ) const - { - os << "measure-style"; - return os; - } - - - bool MeasureStyle::hasContents() const - { - return true; - } - - - std::ostream& MeasureStyle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myChoice->streamContents( os, indentLevel, isOneLineOnly ); - os << std::endl; - return os; - } - +namespace core +{ +MeasureStyle::MeasureStyle() + : myAttributes(std::make_shared()), myChoice(makeMeasureStyleChoice()) +{ +} - MeasureStyleAttributesPtr MeasureStyle::getAttributes() const - { - return myAttributes; - } +bool MeasureStyle::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &MeasureStyle::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void MeasureStyle::setAttributes( const MeasureStyleAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MeasureStyle::streamName(std::ostream &os) const +{ + os << "measure-style"; + return os; +} +bool MeasureStyle::hasContents() const +{ + return true; +} - MeasureStyleChoicePtr MeasureStyle::getMeasureStyleChoice() const - { - return myChoice; - } +std::ostream &MeasureStyle::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myChoice->streamContents(os, indentLevel, isOneLineOnly); + os << std::endl; + return os; +} +MeasureStyleAttributesPtr MeasureStyle::getAttributes() const +{ + return myAttributes; +} - void MeasureStyle::setMeasureStyleChoice( const MeasureStyleChoicePtr& value ) - { - if ( value ) - { - myChoice = value; - } - } +void MeasureStyle::setAttributes(const MeasureStyleAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +MeasureStyleChoicePtr MeasureStyle::getMeasureStyleChoice() const +{ + return myChoice; +} - bool MeasureStyle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - isSuccess &= myChoice->fromXElement( message, *it ); - } - - MX_RETURN_IS_SUCCESS; - } +void MeasureStyle::setMeasureStyleChoice(const MeasureStyleChoicePtr &value) +{ + if (value) + { + myChoice = value; + } +} +bool MeasureStyle::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + isSuccess &= myChoice->fromXElement(message, *it); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureStyle.h b/Sourcecode/private/mx/core/elements/MeasureStyle.h index e790a6781..a0b905d0e 100644 --- a/Sourcecode/private/mx/core/elements/MeasureStyle.h +++ b/Sourcecode/private/mx/core/elements/MeasureStyle.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/MeasureStyleAttributes.h" #include @@ -14,36 +14,39 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureStyleAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MeasureStyleChoice ) - MX_FORWARD_DECLARE_ELEMENT( MeasureStyle ) - - inline MeasureStylePtr makeMeasureStyle() { return std::make_shared(); } - - class MeasureStyle : public ElementInterface - { - public: - MeasureStyle(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MeasureStyleAttributesPtr getAttributes() const; - void setAttributes( const MeasureStyleAttributesPtr& value ); - MeasureStyleChoicePtr getMeasureStyleChoice() const; - void setMeasureStyleChoice( const MeasureStyleChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MeasureStyleAttributesPtr myAttributes; - MeasureStyleChoicePtr myChoice; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MeasureStyleAttributes) +MX_FORWARD_DECLARE_ELEMENT(MeasureStyleChoice) +MX_FORWARD_DECLARE_ELEMENT(MeasureStyle) + +inline MeasureStylePtr makeMeasureStyle() +{ + return std::make_shared(); } + +class MeasureStyle : public ElementInterface +{ + public: + MeasureStyle(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MeasureStyleAttributesPtr getAttributes() const; + void setAttributes(const MeasureStyleAttributesPtr &value); + MeasureStyleChoicePtr getMeasureStyleChoice() const; + void setMeasureStyleChoice(const MeasureStyleChoicePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MeasureStyleAttributesPtr myAttributes; + MeasureStyleChoicePtr myChoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp b/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp index a37c8f7fb..51c563652 100644 --- a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp @@ -8,71 +8,73 @@ namespace mx { - namespace core +namespace core +{ +MeasureStyleAttributes::MeasureStyleAttributes() + : number(), fontFamily(), fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), + fontWeight(FontWeight::normal), color(), hasNumber(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasColor(false) +{ +} + +bool MeasureStyleAttributes::hasValues() const +{ + return hasNumber || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasColor; +} + +std::ostream &MeasureStyleAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - MeasureStyleAttributes::MeasureStyleAttributes() - :number() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,hasNumber( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + } + return os; +} +bool MeasureStyleAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MeasureStyleAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool MeasureStyleAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor; + continue; } - - - std::ostream& MeasureStyleAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - } - return os; + continue; } - - - bool MeasureStyleAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) { - const char* const className = "MeasureStyleAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h b/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h index dfdcae092..a3cdffabf 100644 --- a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h +++ b/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -18,32 +18,32 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureStyleAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MeasureStyleAttributes) - struct MeasureStyleAttributes : public AttributesInterface - { - public: - MeasureStyleAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - bool hasNumber; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; +struct MeasureStyleAttributes : public AttributesInterface +{ + public: + MeasureStyleAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StaffNumber number; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + bool hasNumber; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp b/Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp index c9c71c347..4f61be94c 100644 --- a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp +++ b/Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp @@ -12,147 +12,128 @@ namespace mx { - namespace core - { - MeasureStyleChoice::MeasureStyleChoice() - - - :myChoice( MeasureStyleChoice::Choice::multipleRest ) - ,myMultipleRest( makeMultipleRest() ) - ,myMeasureRepeat( makeMeasureRepeat() ) - ,myBeatRepeat( makeBeatRepeat() ) - ,mySlash( makeSlash() ) - {} - - - bool MeasureStyleChoice::hasAttributes() const - { - return false; - } - - - std::ostream& MeasureStyleChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MeasureStyleChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool MeasureStyleChoice::hasContents() const - { - return true; - } - - - std::ostream& MeasureStyleChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - switch ( myChoice ) - { - case Choice::multipleRest: - myMultipleRest->toStream( os, indentLevel+1 ); - break; - case Choice::measureRepeat: - myMeasureRepeat->toStream( os, indentLevel+1 ); - break; - case Choice::beatRepeat: - myBeatRepeat->toStream( os, indentLevel+1 ); - break; - case Choice::slash: - mySlash->toStream( os, indentLevel+1 ); - break; - default: - break; - } - return os; - } - - - MeasureStyleChoice::Choice MeasureStyleChoice::getChoice() const - { - return myChoice; - } - - - void MeasureStyleChoice::setChoice( const Choice value ) - { - myChoice = value; - } +namespace core +{ +MeasureStyleChoice::MeasureStyleChoice() + : myChoice(MeasureStyleChoice::Choice::multipleRest), myMultipleRest(makeMultipleRest()), + myMeasureRepeat(makeMeasureRepeat()), myBeatRepeat(makeBeatRepeat()), mySlash(makeSlash()) +{ +} - MultipleRestPtr MeasureStyleChoice::getMultipleRest() const - { - return myMultipleRest; - } +bool MeasureStyleChoice::hasAttributes() const +{ + return false; +} +std::ostream &MeasureStyleChoice::streamAttributes(std::ostream &os) const +{ + return os; +} - void MeasureStyleChoice::setMultipleRest( const MultipleRestPtr& value ) - { - if ( value ) - { - myMultipleRest = value; - } - } +std::ostream &MeasureStyleChoice::streamName(std::ostream &os) const +{ + return os; +} +bool MeasureStyleChoice::hasContents() const +{ + return true; +} - MeasureRepeatPtr MeasureStyleChoice::getMeasureRepeat() const - { - return myMeasureRepeat; - } +std::ostream &MeasureStyleChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + switch (myChoice) + { + case Choice::multipleRest: + myMultipleRest->toStream(os, indentLevel + 1); + break; + case Choice::measureRepeat: + myMeasureRepeat->toStream(os, indentLevel + 1); + break; + case Choice::beatRepeat: + myBeatRepeat->toStream(os, indentLevel + 1); + break; + case Choice::slash: + mySlash->toStream(os, indentLevel + 1); + break; + default: + break; + } + return os; +} +MeasureStyleChoice::Choice MeasureStyleChoice::getChoice() const +{ + return myChoice; +} - void MeasureStyleChoice::setMeasureRepeat( const MeasureRepeatPtr& value ) - { - if ( value ) - { - myMeasureRepeat = value; - } - } +void MeasureStyleChoice::setChoice(const Choice value) +{ + myChoice = value; +} +MultipleRestPtr MeasureStyleChoice::getMultipleRest() const +{ + return myMultipleRest; +} - BeatRepeatPtr MeasureStyleChoice::getBeatRepeat() const - { - return myBeatRepeat; - } +void MeasureStyleChoice::setMultipleRest(const MultipleRestPtr &value) +{ + if (value) + { + myMultipleRest = value; + } +} +MeasureRepeatPtr MeasureStyleChoice::getMeasureRepeat() const +{ + return myMeasureRepeat; +} - void MeasureStyleChoice::setBeatRepeat( const BeatRepeatPtr& value ) - { - if ( value ) - { - myBeatRepeat = value; - } - } +void MeasureStyleChoice::setMeasureRepeat(const MeasureRepeatPtr &value) +{ + if (value) + { + myMeasureRepeat = value; + } +} +BeatRepeatPtr MeasureStyleChoice::getBeatRepeat() const +{ + return myBeatRepeat; +} - SlashPtr MeasureStyleChoice::getSlash() const - { - return mySlash; - } - +void MeasureStyleChoice::setBeatRepeat(const BeatRepeatPtr &value) +{ + if (value) + { + myBeatRepeat = value; + } +} - void MeasureStyleChoice::setSlash( const SlashPtr& value ) - { - if ( value ) - { - mySlash = value; - } - } - - - bool MeasureStyleChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( multipleRest, "multiple-rest", MultipleRest ); - MX_CHOICE_IF( measureRepeat, "measure-repeat", MeasureRepeat ); - MX_CHOICE_IF( beatRepeat, "beat-repeat", BeatRepeat ); - MX_CHOICE_IF( slash, "slash", Slash ); - MX_BAD_ELEMENT_FAILURE( MeasureStyleChoice ); - } +SlashPtr MeasureStyleChoice::getSlash() const +{ + return mySlash; +} +void MeasureStyleChoice::setSlash(const SlashPtr &value) +{ + if (value) + { + mySlash = value; } } + +bool MeasureStyleChoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_CHOICE_IF(multipleRest, "multiple-rest", MultipleRest); + MX_CHOICE_IF(measureRepeat, "measure-repeat", MeasureRepeat); + MX_CHOICE_IF(beatRepeat, "beat-repeat", BeatRepeat); + MX_CHOICE_IF(slash, "slash", Slash); + MX_BAD_ELEMENT_FAILURE(MeasureStyleChoice); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.h b/Sourcecode/private/mx/core/elements/MeasureStyleChoice.h index 470f73c9c..11f44caf9 100644 --- a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.h +++ b/Sourcecode/private/mx/core/elements/MeasureStyleChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,54 +13,57 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( BeatRepeat ) - MX_FORWARD_DECLARE_ELEMENT( MeasureRepeat ) - MX_FORWARD_DECLARE_ELEMENT( MultipleRest ) - MX_FORWARD_DECLARE_ELEMENT( Slash ) - MX_FORWARD_DECLARE_ELEMENT( MeasureStyleChoice ) +MX_FORWARD_DECLARE_ELEMENT(BeatRepeat) +MX_FORWARD_DECLARE_ELEMENT(MeasureRepeat) +MX_FORWARD_DECLARE_ELEMENT(MultipleRest) +MX_FORWARD_DECLARE_ELEMENT(Slash) +MX_FORWARD_DECLARE_ELEMENT(MeasureStyleChoice) - inline MeasureStyleChoicePtr makeMeasureStyleChoice() { return std::make_shared(); } +inline MeasureStyleChoicePtr makeMeasureStyleChoice() +{ + return std::make_shared(); +} - class MeasureStyleChoice : public ElementInterface - { - public: - enum class Choice - { - multipleRest = 0, - measureRepeat = 1, - beatRepeat = 2, - slash = 3 - }; - MeasureStyleChoice(); +class MeasureStyleChoice : public ElementInterface +{ + public: + enum class Choice + { + multipleRest = 0, + measureRepeat = 1, + beatRepeat = 2, + slash = 3 + }; + MeasureStyleChoice(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Choice getChoice() const; - void setChoice( const Choice value ); - MultipleRestPtr getMultipleRest() const; - void setMultipleRest( const MultipleRestPtr& value ); - MeasureRepeatPtr getMeasureRepeat() const; - void setMeasureRepeat( const MeasureRepeatPtr& value ); - BeatRepeatPtr getBeatRepeat() const; - void setBeatRepeat( const BeatRepeatPtr& value ); - SlashPtr getSlash() const; - void setSlash( const SlashPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Choice getChoice() const; + void setChoice(const Choice value); + MultipleRestPtr getMultipleRest() const; + void setMultipleRest(const MultipleRestPtr &value); + MeasureRepeatPtr getMeasureRepeat() const; + void setMeasureRepeat(const MeasureRepeatPtr &value); + BeatRepeatPtr getBeatRepeat() const; + void setBeatRepeat(const BeatRepeatPtr &value); + SlashPtr getSlash() const; + void setSlash(const SlashPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - Choice myChoice; - MultipleRestPtr myMultipleRest; - MeasureRepeatPtr myMeasureRepeat; - BeatRepeatPtr myBeatRepeat; - SlashPtr mySlash; - }; - } -} + private: + Choice myChoice; + MultipleRestPtr myMultipleRest; + MeasureRepeatPtr myMeasureRepeat; + BeatRepeatPtr myBeatRepeat; + SlashPtr mySlash; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Membrane.cpp b/Sourcecode/private/mx/core/elements/Membrane.cpp index 1a4c6ec71..119d57c53 100644 --- a/Sourcecode/private/mx/core/elements/Membrane.cpp +++ b/Sourcecode/private/mx/core/elements/Membrane.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Membrane::Membrane() - :myValue( MembraneEnum::snareDrum ) - {} - - - Membrane::Membrane( const MembraneEnum& value ) - :myValue( value ) - {} - - - bool Membrane::hasAttributes() const - { - return false; - } - - - bool Membrane::hasContents() const - { - return true; - } - - - std::ostream& Membrane::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Membrane::streamName( std::ostream& os ) const - { - os << "membrane"; - return os; - } +namespace core +{ +Membrane::Membrane() : myValue(MembraneEnum::snareDrum) +{ +} +Membrane::Membrane(const MembraneEnum &value) : myValue(value) +{ +} - std::ostream& Membrane::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Membrane::hasAttributes() const +{ + return false; +} +bool Membrane::hasContents() const +{ + return true; +} - MembraneEnum Membrane::getValue() const - { - return myValue; - } +std::ostream &Membrane::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Membrane::streamName(std::ostream &os) const +{ + os << "membrane"; + return os; +} - void Membrane::setValue( const MembraneEnum& value ) - { - myValue = value; - } +std::ostream &Membrane::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MembraneEnum Membrane::getValue() const +{ + return myValue; +} - bool Membrane::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseMembraneEnum( xelement.getValue() ); - return true; - } +void Membrane::setValue(const MembraneEnum &value) +{ + myValue = value; +} - } +bool Membrane::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue = parseMembraneEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Membrane.h b/Sourcecode/private/mx/core/elements/Membrane.h index 74191d4ba..229d0118a 100644 --- a/Sourcecode/private/mx/core/elements/Membrane.h +++ b/Sourcecode/private/mx/core/elements/Membrane.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Membrane ) - - inline MembranePtr makeMembrane() { return std::make_shared(); } - inline MembranePtr makeMembrane( const MembraneEnum& value ) { return std::make_shared( value ); } - inline MembranePtr makeMembrane( MembraneEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Membrane : public ElementInterface - { - public: - Membrane(); - Membrane( const MembraneEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MembraneEnum getValue() const; - void setValue( const MembraneEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MembraneEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Membrane) + +inline MembranePtr makeMembrane() +{ + return std::make_shared(); +} + +inline MembranePtr makeMembrane(const MembraneEnum &value) +{ + return std::make_shared(value); } + +inline MembranePtr makeMembrane(MembraneEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class Membrane : public ElementInterface +{ + public: + Membrane(); + Membrane(const MembraneEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MembraneEnum getValue() const; + void setValue(const MembraneEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MembraneEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Metal.cpp b/Sourcecode/private/mx/core/elements/Metal.cpp index 8cb490df2..7a813e209 100644 --- a/Sourcecode/private/mx/core/elements/Metal.cpp +++ b/Sourcecode/private/mx/core/elements/Metal.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - Metal::Metal() - :myValue( MetalEnum::bell ) - {} - - - Metal::Metal( const MetalEnum& value ) - :myValue( value ) - {} - - - bool Metal::hasAttributes() const - { - return false; - } - - - bool Metal::hasContents() const - { - return true; - } - - - std::ostream& Metal::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Metal::streamName( std::ostream& os ) const - { - os << "metal"; - return os; - } +namespace core +{ +Metal::Metal() : myValue(MetalEnum::bell) +{ +} +Metal::Metal(const MetalEnum &value) : myValue(value) +{ +} - std::ostream& Metal::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Metal::hasAttributes() const +{ + return false; +} +bool Metal::hasContents() const +{ + return true; +} - MetalEnum Metal::getValue() const - { - return myValue; - } +std::ostream &Metal::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Metal::streamName(std::ostream &os) const +{ + os << "metal"; + return os; +} - void Metal::setValue( const MetalEnum& value ) - { - myValue = value; - } +std::ostream &Metal::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MetalEnum Metal::getValue() const +{ + return myValue; +} - bool Metal::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseMetalEnum( xelement.getValue() ); - return true; - } +void Metal::setValue(const MetalEnum &value) +{ + myValue = value; +} - } +bool Metal::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseMetalEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Metal.h b/Sourcecode/private/mx/core/elements/Metal.h index 345ae0c64..54428b41b 100644 --- a/Sourcecode/private/mx/core/elements/Metal.h +++ b/Sourcecode/private/mx/core/elements/Metal.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Metal ) - - inline MetalPtr makeMetal() { return std::make_shared(); } - inline MetalPtr makeMetal( const MetalEnum& value ) { return std::make_shared( value ); } - inline MetalPtr makeMetal( MetalEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Metal : public ElementInterface - { - public: - Metal(); - Metal( const MetalEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MetalEnum getValue() const; - void setValue( const MetalEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetalEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Metal) + +inline MetalPtr makeMetal() +{ + return std::make_shared(); +} + +inline MetalPtr makeMetal(const MetalEnum &value) +{ + return std::make_shared(value); } + +inline MetalPtr makeMetal(MetalEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class Metal : public ElementInterface +{ + public: + Metal(); + Metal(const MetalEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MetalEnum getValue() const; + void setValue(const MetalEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MetalEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Metronome.cpp b/Sourcecode/private/mx/core/elements/Metronome.cpp index 0b67c9a2f..04f4c5508 100644 --- a/Sourcecode/private/mx/core/elements/Metronome.cpp +++ b/Sourcecode/private/mx/core/elements/Metronome.cpp @@ -4,212 +4,211 @@ #include "mx/core/elements/Metronome.h" #include "mx/core/FromXElement.h" -#include "mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h" -#include "mx/core/elements/BeatUnitGroup.h" -#include "mx/core/elements/PerMinuteOrBeatUnitChoice.h" #include "mx/core/elements/BeatUnitGroup.h" #include "mx/core/elements/BeatUnitPer.h" -#include "mx/core/elements/PerMinute.h" -#include "mx/core/elements/NoteRelationNote.h" +#include "mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h" #include "mx/core/elements/MetronomeNote.h" -#include "mx/core/elements/MetronomeRelationGroup.h" #include "mx/core/elements/MetronomeRelation.h" +#include "mx/core/elements/MetronomeRelationGroup.h" +#include "mx/core/elements/NoteRelationNote.h" +#include "mx/core/elements/PerMinute.h" +#include "mx/core/elements/PerMinuteOrBeatUnitChoice.h" #include namespace mx { - namespace core - { - Metronome::Metronome() - :myAttributes( std::make_shared() ) - ,myBeatUnitPerOrNoteRelationNoteChoice( makeBeatUnitPerOrNoteRelationNoteChoice() ) - {} +namespace core +{ +Metronome::Metronome() + : myAttributes(std::make_shared()), + myBeatUnitPerOrNoteRelationNoteChoice(makeBeatUnitPerOrNoteRelationNoteChoice()) +{ +} +bool Metronome::hasAttributes() const +{ + return myAttributes->hasValues(); +} - bool Metronome::hasAttributes() const - { - return myAttributes->hasValues(); - } +std::ostream &Metronome::streamAttributes(std::ostream &os) const +{ + myAttributes->toStream(os); + return os; +} +std::ostream &Metronome::streamName(std::ostream &os) const +{ + return os << "metronome"; +} - std::ostream& Metronome::streamAttributes( std::ostream& os ) const - { - myAttributes->toStream( os ); - return os; - } +bool Metronome::hasContents() const +{ + return true; +} +std::ostream &Metronome::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myBeatUnitPerOrNoteRelationNoteChoice->streamContents(os, indentLevel + 1, isOneLineOnly); + os << std::endl; + isOneLineOnly = false; + return os; +} - std::ostream& Metronome::streamName( std::ostream& os ) const - { - return os << "metronome"; - } +MetronomeAttributesPtr Metronome::getAttributes() const +{ + return myAttributes; +} + +void Metronome::setAttributes(const MetronomeAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +BeatUnitPerOrNoteRelationNoteChoicePtr Metronome::getBeatUnitPerOrNoteRelationNoteChoice() const +{ + return myBeatUnitPerOrNoteRelationNoteChoice; +} - bool Metronome::hasContents() const - { - return true; - } +void Metronome::setBeatUnitPerOrNoteRelationNoteChoice(const BeatUnitPerOrNoteRelationNoteChoicePtr &value) +{ + if (value) + { + myBeatUnitPerOrNoteRelationNoteChoice = value; + } +} +/* + + + + + + + + + + */ + +bool Metronome::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - std::ostream& Metronome::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myBeatUnitPerOrNoteRelationNoteChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - return os; - } + auto iter = xelement.begin(); + auto endIter = xelement.end(); + for (; iter != endIter; ++iter) + { + bool isIterIncremented = false; - MetronomeAttributesPtr Metronome::getAttributes() const + if ((iter->getName() == "beat-unit") || (iter->getName() == "beat-unit-dot")) { - return myAttributes; - } + myBeatUnitPerOrNoteRelationNoteChoice->setChoice(BeatUnitPerOrNoteRelationNoteChoice::Choice::beatUnitPer); + auto beatUnitGroup = myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getBeatUnitGroup(); + importGroup(message, iter, endIter, isSuccess, beatUnitGroup); + isIterIncremented = true; + ++iter; + if (iter == endIter) + { + return false; + } - void Metronome::setAttributes( const MetronomeAttributesPtr& value ) - { - if ( value ) + if ((iter->getName() == "beat-unit") || (iter->getName() == "beat-unit-dot")) { - myAttributes = value; + auto beatUnitGroup2 = myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer() + ->getPerMinuteOrBeatUnitChoice() + ->getBeatUnitGroup(); + myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->setChoice( + PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup); + importGroup(message, iter, endIter, isSuccess, beatUnitGroup2); + isIterIncremented = true; + ++iter; + } + else if (iter->getName() == "per-minute") + { + myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->setChoice( + PerMinuteOrBeatUnitChoice::Choice::perMinute); + myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer() + ->getPerMinuteOrBeatUnitChoice() + ->getPerMinute() + ->fromXElement(message, *iter); + isIterIncremented = true; + ++iter; } } - - - BeatUnitPerOrNoteRelationNoteChoicePtr Metronome::getBeatUnitPerOrNoteRelationNoteChoice() const + else if ((iter->getName() == "metronome-note")) { - return myBeatUnitPerOrNoteRelationNoteChoice; - } + myBeatUnitPerOrNoteRelationNoteChoice->setChoice( + BeatUnitPerOrNoteRelationNoteChoice::Choice::noteRelationNote); + auto noteRelationNote = myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote(); + bool isFirstMetronomeNoteAdded = false; + while (iter != endIter && iter->getName() == "metronome-note") + { + auto metronomeNote = makeMetronomeNote(); + isSuccess &= metronomeNote->fromXElement(message, *iter); - void Metronome::setBeatUnitPerOrNoteRelationNoteChoice( const BeatUnitPerOrNoteRelationNoteChoicePtr& value ) - { - if ( value ) + if (!isFirstMetronomeNoteAdded && noteRelationNote->getMetronomeNoteSet().size() == 1) + { + noteRelationNote->addMetronomeNote(metronomeNote); + noteRelationNote->removeMetronomeNote(noteRelationNote->getMetronomeNoteSet().cbegin()); + isFirstMetronomeNoteAdded = true; + } + else + { + noteRelationNote->addMetronomeNote(metronomeNote); + isFirstMetronomeNoteAdded = true; + } + isIterIncremented = true; + ++iter; + } + + if (iter == endIter) { - myBeatUnitPerOrNoteRelationNoteChoice = value; + MX_RETURN_IS_SUCCESS; } - } - /* - - - - - - - - - - */ - - bool Metronome::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto iter = xelement.begin(); - auto endIter = xelement.end(); - - for( ; iter != endIter; ++iter ) + if (iter->getName() == "metronome-relation") { - bool isIterIncremented = false; - - if( ( iter->getName() == "beat-unit" ) || ( iter->getName() == "beat-unit-dot" ) ) + myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->setHasMetronomeRelationGroup(true); + auto metronomeRelationGroup = + myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->getMetronomeRelationGroup(); + isSuccess &= metronomeRelationGroup->getMetronomeRelation()->fromXElement(message, *iter); + ++iter; + isIterIncremented = true; + + if (iter == endIter) { - myBeatUnitPerOrNoteRelationNoteChoice->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::beatUnitPer ); - auto beatUnitGroup = myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getBeatUnitGroup(); - importGroup( message, iter, endIter, isSuccess, beatUnitGroup ); - isIterIncremented = true; - ++iter; - - if( iter == endIter ) - { - return false; - } - - if( ( iter->getName() == "beat-unit" ) || ( iter->getName() == "beat-unit-dot" ) ) - { - auto beatUnitGroup2 = myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->getBeatUnitGroup(); - myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->setChoice( PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup ); - importGroup( message, iter, endIter, isSuccess, beatUnitGroup2 ); - isIterIncremented = true; - ++iter; - } - else if ( iter->getName() == "per-minute" ) - { - myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->setChoice( PerMinuteOrBeatUnitChoice::Choice::perMinute ); - myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->getPerMinute()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } + MX_RETURN_IS_SUCCESS; } - else if( ( iter->getName() == "metronome-note" ) ) + + if (iter->getName() == "metronome-note") { - myBeatUnitPerOrNoteRelationNoteChoice->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::noteRelationNote ); - auto noteRelationNote = myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote(); - bool isFirstMetronomeNoteAdded = false; - - while( iter != endIter && iter->getName() == "metronome-note" ) - { - auto metronomeNote = makeMetronomeNote(); - isSuccess &= metronomeNote->fromXElement( message, *iter ); - - if( !isFirstMetronomeNoteAdded && noteRelationNote->getMetronomeNoteSet().size() == 1 ) - { - noteRelationNote->addMetronomeNote( metronomeNote ); - noteRelationNote->removeMetronomeNote( noteRelationNote->getMetronomeNoteSet().cbegin() ); - isFirstMetronomeNoteAdded = true; - } - else - { - noteRelationNote->addMetronomeNote( metronomeNote ); - isFirstMetronomeNoteAdded = true; - } - isIterIncremented = true; - ++iter; - } - - if( iter == endIter ) + myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->setHasMetronomeRelationGroup(true); + isSuccess &= metronomeRelationGroup->getMetronomeNote()->fromXElement(message, *iter); + ++iter; + isIterIncremented = true; + if (iter == endIter) { MX_RETURN_IS_SUCCESS; } - - if( iter->getName() == "metronome-relation" ) - { - myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->setHasMetronomeRelationGroup( true ); - auto metronomeRelationGroup = myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->getMetronomeRelationGroup(); - isSuccess &= metronomeRelationGroup->getMetronomeRelation()->fromXElement( message, *iter ); - ++iter; - isIterIncremented = true; - - if( iter == endIter ) - { - MX_RETURN_IS_SUCCESS; - } - - if( iter->getName() == "metronome-note" ) - { - myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->setHasMetronomeRelationGroup( true ); - isSuccess &= metronomeRelationGroup->getMetronomeNote()->fromXElement( message, *iter ); - ++iter; - isIterIncremented = true; - if( iter == endIter ) - { - MX_RETURN_IS_SUCCESS; - } - } - } - - } - - if( isIterIncremented ) - { - --iter; } } - - MX_RETURN_IS_SUCCESS; } + if (isIterIncremented) + { + --iter; + } } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Metronome.h b/Sourcecode/private/mx/core/elements/Metronome.h index a657b9ed2..76c7813bb 100644 --- a/Sourcecode/private/mx/core/elements/Metronome.h +++ b/Sourcecode/private/mx/core/elements/Metronome.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/MetronomeAttributes.h" #include @@ -14,36 +14,39 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitPerOrNoteRelationNoteChoice ) - MX_FORWARD_DECLARE_ELEMENT( Metronome ) - - inline MetronomePtr makeMetronome() { return std::make_shared(); } - - class Metronome : public ElementInterface - { - public: - Metronome(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MetronomeAttributesPtr getAttributes() const; - void setAttributes( const MetronomeAttributesPtr& value ); - BeatUnitPerOrNoteRelationNoteChoicePtr getBeatUnitPerOrNoteRelationNoteChoice() const; - void setBeatUnitPerOrNoteRelationNoteChoice( const BeatUnitPerOrNoteRelationNoteChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetronomeAttributesPtr myAttributes; - BeatUnitPerOrNoteRelationNoteChoicePtr myBeatUnitPerOrNoteRelationNoteChoice; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MetronomeAttributes) +MX_FORWARD_DECLARE_ELEMENT(BeatUnitPerOrNoteRelationNoteChoice) +MX_FORWARD_DECLARE_ELEMENT(Metronome) + +inline MetronomePtr makeMetronome() +{ + return std::make_shared(); } + +class Metronome : public ElementInterface +{ + public: + Metronome(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MetronomeAttributesPtr getAttributes() const; + void setAttributes(const MetronomeAttributesPtr &value); + BeatUnitPerOrNoteRelationNoteChoicePtr getBeatUnitPerOrNoteRelationNoteChoice() const; + void setBeatUnitPerOrNoteRelationNoteChoice(const BeatUnitPerOrNoteRelationNoteChoicePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MetronomeAttributesPtr myAttributes; + BeatUnitPerOrNoteRelationNoteChoicePtr myBeatUnitPerOrNoteRelationNoteChoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp b/Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp index a3dcc5bb7..480c9792e 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp @@ -8,106 +8,112 @@ namespace mx { - namespace core +namespace core +{ +MetronomeAttributes::MetronomeAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), halign(LeftCenterRight::center), + valign(Valign::baseline), justify(LeftCenterRight::center), parentheses(YesNo::no), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasColor(false), hasHalign(false), hasValign(false), hasJustify(false), + hasParentheses(false) +{ +} + +bool MetronomeAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasHalign || hasValign || hasJustify || hasParentheses; +} + +std::ostream &MetronomeAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - MetronomeAttributes::MetronomeAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign( LeftCenterRight::center ) - ,valign( Valign::baseline ) - ,justify( LeftCenterRight::center ) - ,parentheses( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasJustify( false ) - ,hasParentheses( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, valign, "valign", hasValign); + streamAttribute(os, justify, "justify", hasJustify); + streamAttribute(os, parentheses, "parentheses", hasParentheses); + } + return os; +} +bool MetronomeAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MetronomeAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool MetronomeAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign || - hasJustify || - hasParentheses; + continue; } - - - std::ostream& MetronomeAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - } - return os; + continue; } - - - bool MetronomeAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "MetronomeAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, valign, hasValign, "valign", &parseValign)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeAttributes.h b/Sourcecode/private/mx/core/elements/MetronomeAttributes.h index c4bacff5f..b151e67e1 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeAttributes.h +++ b/Sourcecode/private/mx/core/elements/MetronomeAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,46 +18,46 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MetronomeAttributes) - struct MetronomeAttributes : public AttributesInterface - { - public: - MetronomeAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - LeftCenterRight justify; - YesNo parentheses; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasJustify; - bool hasParentheses; +struct MetronomeAttributes : public AttributesInterface +{ + public: + MetronomeAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + LeftCenterRight halign; + Valign valign; + LeftCenterRight justify; + YesNo parentheses; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasHalign; + bool hasValign; + bool hasJustify; + bool hasParentheses; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeam.cpp b/Sourcecode/private/mx/core/elements/MetronomeBeam.cpp index 1e4f1da00..897948910 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeBeam.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeBeam.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - MetronomeBeam::MetronomeBeam() - :myValue( BeamValue::begin ) - ,myAttributes( std::make_shared() ) - {} - - - MetronomeBeam::MetronomeBeam( const BeamValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MetronomeBeam::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MetronomeBeam::hasContents() const - { - return true; - } - - - std::ostream& MetronomeBeam::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MetronomeBeam::streamName( std::ostream& os ) const - { - os << "metronome-beam"; - return os; - } - - - std::ostream& MetronomeBeam::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +MetronomeBeam::MetronomeBeam() : myValue(BeamValue::begin), myAttributes(std::make_shared()) +{ +} +MetronomeBeam::MetronomeBeam(const BeamValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - MetronomeBeamAttributesPtr MetronomeBeam::getAttributes() const - { - return myAttributes; - } +bool MetronomeBeam::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool MetronomeBeam::hasContents() const +{ + return true; +} - void MetronomeBeam::setAttributes( const MetronomeBeamAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MetronomeBeam::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &MetronomeBeam::streamName(std::ostream &os) const +{ + os << "metronome-beam"; + return os; +} - BeamValue MetronomeBeam::getValue() const - { - return myValue; - } +std::ostream &MetronomeBeam::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MetronomeBeamAttributesPtr MetronomeBeam::getAttributes() const +{ + return myAttributes; +} - void MetronomeBeam::setValue( const BeamValue& value ) - { - myValue = value; - } +void MetronomeBeam::setAttributes(const MetronomeBeamAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +BeamValue MetronomeBeam::getValue() const +{ + return myValue; +} - bool MetronomeBeam::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBeamValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void MetronomeBeam::setValue(const BeamValue &value) +{ + myValue = value; +} - } +bool MetronomeBeam::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseBeamValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeam.h b/Sourcecode/private/mx/core/elements/MetronomeBeam.h index 0263a4720..53864876f 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeBeam.h +++ b/Sourcecode/private/mx/core/elements/MetronomeBeam.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/MetronomeBeamAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeBeamAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeBeam ) - - inline MetronomeBeamPtr makeMetronomeBeam() { return std::make_shared(); } - inline MetronomeBeamPtr makeMetronomeBeam( const BeamValue& value ) { return std::make_shared( value ); } - inline MetronomeBeamPtr makeMetronomeBeam( BeamValue&& value ) { return std::make_shared( std::move( value ) ); } - - class MetronomeBeam : public ElementInterface - { - public: - MetronomeBeam(); - MetronomeBeam( const BeamValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MetronomeBeamAttributesPtr getAttributes() const; - void setAttributes( const MetronomeBeamAttributesPtr& attributes ); - BeamValue getValue() const; - void setValue( const BeamValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeamValue myValue; - MetronomeBeamAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MetronomeBeamAttributes) +MX_FORWARD_DECLARE_ELEMENT(MetronomeBeam) + +inline MetronomeBeamPtr makeMetronomeBeam() +{ + return std::make_shared(); +} + +inline MetronomeBeamPtr makeMetronomeBeam(const BeamValue &value) +{ + return std::make_shared(value); } + +inline MetronomeBeamPtr makeMetronomeBeam(BeamValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class MetronomeBeam : public ElementInterface +{ + public: + MetronomeBeam(); + MetronomeBeam(const BeamValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MetronomeBeamAttributesPtr getAttributes() const; + void setAttributes(const MetronomeBeamAttributesPtr &attributes); + BeamValue getValue() const; + void setValue(const BeamValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + BeamValue myValue; + MetronomeBeamAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp b/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp index c0a02b1da..f14aeef5e 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - MetronomeBeamAttributes::MetronomeBeamAttributes() - :number( 1 ) - ,hasNumber( false ) - {} - +namespace core +{ +MetronomeBeamAttributes::MetronomeBeamAttributes() : number(1), hasNumber(false) +{ +} - bool MetronomeBeamAttributes::hasValues() const - { - return hasNumber; - } +bool MetronomeBeamAttributes::hasValues() const +{ + return hasNumber; +} +std::ostream &MetronomeBeamAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, number, "number", hasNumber); + } + return os; +} - std::ostream& MetronomeBeamAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - } - return os; - } +bool MetronomeBeamAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MetronomeBeamAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool MetronomeBeamAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - const char* const className = "MetronomeBeamAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h b/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h index 0d2751f96..a9680c5de 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h +++ b/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeBeamAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MetronomeBeamAttributes) - struct MetronomeBeamAttributes : public AttributesInterface - { - public: - MetronomeBeamAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - BeamLevel number; - bool hasNumber; +struct MetronomeBeamAttributes : public AttributesInterface +{ + public: + MetronomeBeamAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + BeamLevel number; + bool hasNumber; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeDot.cpp b/Sourcecode/private/mx/core/elements/MetronomeDot.cpp index 329a3202a..599cc9cbf 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeDot.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeDot.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - MetronomeDot::MetronomeDot() : ElementInterface() {} - +namespace core +{ +MetronomeDot::MetronomeDot() : ElementInterface() +{ +} - bool MetronomeDot::hasAttributes() const { return false; } +bool MetronomeDot::hasAttributes() const +{ + return false; +} +bool MetronomeDot::hasContents() const +{ + return false; +} - bool MetronomeDot::hasContents() const { return false; } - std::ostream& MetronomeDot::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& MetronomeDot::streamName( std::ostream& os ) const { os << "metronome-dot"; return os; } - std::ostream& MetronomeDot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &MetronomeDot::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MetronomeDot::streamName(std::ostream &os) const +{ + os << "metronome-dot"; + return os; +} - bool MetronomeDot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &MetronomeDot::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool MetronomeDot::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeDot.h b/Sourcecode/private/mx/core/elements/MetronomeDot.h index 61cd1357a..1301aa0a6 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeDot.h +++ b/Sourcecode/private/mx/core/elements/MetronomeDot.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeDot ) - - inline MetronomeDotPtr makeMetronomeDot() { return std::make_shared(); } - - class MetronomeDot : public ElementInterface - { - public: - MetronomeDot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MetronomeDot) + +inline MetronomeDotPtr makeMetronomeDot() +{ + return std::make_shared(); } + +class MetronomeDot : public ElementInterface +{ + public: + MetronomeDot(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeNote.cpp b/Sourcecode/private/mx/core/elements/MetronomeNote.cpp index 71e780a86..9aa27a779 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeNote.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeNote.cpp @@ -12,209 +12,192 @@ namespace mx { - namespace core - { - MetronomeNote::MetronomeNote() - :myMetronomeType( makeMetronomeType() ) - ,myMetronomeDotSet() - ,myMetronomeBeamSet() - ,myMetronomeTuplet( makeMetronomeTuplet() ) - ,myHasMetronomeTuplet( false ) - {} - - - bool MetronomeNote::hasAttributes() const - { - return false; - } - - - std::ostream& MetronomeNote::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MetronomeNote::streamName( std::ostream& os ) const - { - os << "metronome-note"; - return os; - } - - - bool MetronomeNote::hasContents() const - { - return true; - } - - - std::ostream& MetronomeNote::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myMetronomeType->toStream( os, indentLevel+1 ); - for ( auto x : myMetronomeDotSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myMetronomeBeamSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasMetronomeTuplet ) - { - os << std::endl; - myMetronomeTuplet->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - MetronomeTypePtr MetronomeNote::getMetronomeType() const - { - return myMetronomeType; - } - - - void MetronomeNote::setMetronomeType( const MetronomeTypePtr& value ) - { - if( value ) - { - myMetronomeType = value; - } - } - - - const MetronomeDotSet& MetronomeNote::getMetronomeDotSet() const - { - return myMetronomeDotSet; - } - - - void MetronomeNote::removeMetronomeDot( const MetronomeDotSetIterConst& value ) - { - if ( value != myMetronomeDotSet.cend() ) - { - myMetronomeDotSet.erase( value ); - } - } - +namespace core +{ +MetronomeNote::MetronomeNote() + : myMetronomeType(makeMetronomeType()), myMetronomeDotSet(), myMetronomeBeamSet(), + myMetronomeTuplet(makeMetronomeTuplet()), myHasMetronomeTuplet(false) +{ +} - void MetronomeNote::addMetronomeDot( const MetronomeDotPtr& value ) - { - if ( value ) - { - myMetronomeDotSet.push_back( value ); - } - } +bool MetronomeNote::hasAttributes() const +{ + return false; +} +std::ostream &MetronomeNote::streamAttributes(std::ostream &os) const +{ + return os; +} - void MetronomeNote::clearMetronomeDotSet() - { - myMetronomeDotSet.clear(); - } +std::ostream &MetronomeNote::streamName(std::ostream &os) const +{ + os << "metronome-note"; + return os; +} +bool MetronomeNote::hasContents() const +{ + return true; +} - MetronomeDotPtr MetronomeNote::getMetronomeDot( const MetronomeDotSetIterConst& setIterator ) const - { - if( setIterator != myMetronomeDotSet.cend() ) - { - return *setIterator; - } - return MetronomeDotPtr(); - } +std::ostream &MetronomeNote::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myMetronomeType->toStream(os, indentLevel + 1); + for (auto x : myMetronomeDotSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myMetronomeBeamSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + if (myHasMetronomeTuplet) + { + os << std::endl; + myMetronomeTuplet->toStream(os, indentLevel + 1); + } + os << std::endl; + return os; +} +MetronomeTypePtr MetronomeNote::getMetronomeType() const +{ + return myMetronomeType; +} - const MetronomeBeamSet& MetronomeNote::getMetronomeBeamSet() const - { - return myMetronomeBeamSet; - } +void MetronomeNote::setMetronomeType(const MetronomeTypePtr &value) +{ + if (value) + { + myMetronomeType = value; + } +} +const MetronomeDotSet &MetronomeNote::getMetronomeDotSet() const +{ + return myMetronomeDotSet; +} - void MetronomeNote::removeMetronomeBeam( const MetronomeBeamSetIterConst& value ) - { - if ( value != myMetronomeBeamSet.cend() ) - { - myMetronomeBeamSet.erase( value ); - } - } +void MetronomeNote::removeMetronomeDot(const MetronomeDotSetIterConst &value) +{ + if (value != myMetronomeDotSet.cend()) + { + myMetronomeDotSet.erase(value); + } +} +void MetronomeNote::addMetronomeDot(const MetronomeDotPtr &value) +{ + if (value) + { + myMetronomeDotSet.push_back(value); + } +} - void MetronomeNote::addMetronomeBeam( const MetronomeBeamPtr& value ) - { - if ( value ) - { - myMetronomeBeamSet.push_back( value ); - } - } +void MetronomeNote::clearMetronomeDotSet() +{ + myMetronomeDotSet.clear(); +} +MetronomeDotPtr MetronomeNote::getMetronomeDot(const MetronomeDotSetIterConst &setIterator) const +{ + if (setIterator != myMetronomeDotSet.cend()) + { + return *setIterator; + } + return MetronomeDotPtr(); +} - void MetronomeNote::clearMetronomeBeamSet() - { - myMetronomeBeamSet.clear(); - } +const MetronomeBeamSet &MetronomeNote::getMetronomeBeamSet() const +{ + return myMetronomeBeamSet; +} +void MetronomeNote::removeMetronomeBeam(const MetronomeBeamSetIterConst &value) +{ + if (value != myMetronomeBeamSet.cend()) + { + myMetronomeBeamSet.erase(value); + } +} - MetronomeBeamPtr MetronomeNote::getMetronomeBeam( const MetronomeBeamSetIterConst& setIterator ) const - { - if( setIterator != myMetronomeBeamSet.cend() ) - { - return *setIterator; - } - return MetronomeBeamPtr(); - } +void MetronomeNote::addMetronomeBeam(const MetronomeBeamPtr &value) +{ + if (value) + { + myMetronomeBeamSet.push_back(value); + } +} +void MetronomeNote::clearMetronomeBeamSet() +{ + myMetronomeBeamSet.clear(); +} - MetronomeTupletPtr MetronomeNote::getMetronomeTuplet() const - { - return myMetronomeTuplet; - } +MetronomeBeamPtr MetronomeNote::getMetronomeBeam(const MetronomeBeamSetIterConst &setIterator) const +{ + if (setIterator != myMetronomeBeamSet.cend()) + { + return *setIterator; + } + return MetronomeBeamPtr(); +} +MetronomeTupletPtr MetronomeNote::getMetronomeTuplet() const +{ + return myMetronomeTuplet; +} - void MetronomeNote::setMetronomeTuplet( const MetronomeTupletPtr& value ) - { - if( value ) - { - myMetronomeTuplet = value; - } - } +void MetronomeNote::setMetronomeTuplet(const MetronomeTupletPtr &value) +{ + if (value) + { + myMetronomeTuplet = value; + } +} +bool MetronomeNote::getHasMetronomeTuplet() const +{ + return myHasMetronomeTuplet; +} - bool MetronomeNote::getHasMetronomeTuplet() const - { - return myHasMetronomeTuplet; - } +void MetronomeNote::setHasMetronomeTuplet(const bool value) +{ + myHasMetronomeTuplet = value; +} +bool MetronomeNote::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isMetronomeTypeFound = false; - void MetronomeNote::setHasMetronomeTuplet( const bool value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myMetronomeType, isMetronomeTypeFound)) { - myHasMetronomeTuplet = value; + continue; } - - - bool MetronomeNote::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + importElementSet(message, it, endIter, isSuccess, "metronome-dot", myMetronomeDotSet); + importElementSet(message, it, endIter, isSuccess, "metronome-beam", myMetronomeBeamSet); + if (importElement(message, *it, isSuccess, *myMetronomeTuplet, myHasMetronomeTuplet)) { - bool isSuccess = true; - bool isMetronomeTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMetronomeType, isMetronomeTypeFound ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "metronome-dot", myMetronomeDotSet ); - importElementSet( message, it, endIter, isSuccess, "metronome-beam", myMetronomeBeamSet ); - if ( importElement( message, *it, isSuccess, *myMetronomeTuplet, myHasMetronomeTuplet ) ) { continue; } - } - - if( !isMetronomeTypeFound ) - { - message << "MetronomeNote: '" << myMetronomeType->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isMetronomeTypeFound) + { + message << "MetronomeNote: '" << myMetronomeType->getElementName() << "' is required but was not found" + << std::endl; } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeNote.h b/Sourcecode/private/mx/core/elements/MetronomeNote.h index dc6508ad6..fc144f22f 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeNote.h +++ b/Sourcecode/private/mx/core/elements/MetronomeNote.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,61 +13,64 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( MetronomeBeam ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeDot ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeTuplet ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeType ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeNote ) +MX_FORWARD_DECLARE_ELEMENT(MetronomeBeam) +MX_FORWARD_DECLARE_ELEMENT(MetronomeDot) +MX_FORWARD_DECLARE_ELEMENT(MetronomeTuplet) +MX_FORWARD_DECLARE_ELEMENT(MetronomeType) +MX_FORWARD_DECLARE_ELEMENT(MetronomeNote) - inline MetronomeNotePtr makeMetronomeNote() { return std::make_shared(); } +inline MetronomeNotePtr makeMetronomeNote() +{ + return std::make_shared(); +} - class MetronomeNote : public ElementInterface - { - public: - MetronomeNote(); +class MetronomeNote : public ElementInterface +{ + public: + MetronomeNote(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ MetronomeType minOccurs = 1, maxOccurs = 1 _________ */ - MetronomeTypePtr getMetronomeType() const; - void setMetronomeType( const MetronomeTypePtr& value ); + /* _________ MetronomeType minOccurs = 1, maxOccurs = 1 _________ */ + MetronomeTypePtr getMetronomeType() const; + void setMetronomeType(const MetronomeTypePtr &value); - /* _________ MetronomeDot minOccurs = 0, maxOccurs = unbounded _________ */ - const MetronomeDotSet& getMetronomeDotSet() const; - void addMetronomeDot( const MetronomeDotPtr& value ); - void removeMetronomeDot( const MetronomeDotSetIterConst& value ); - void clearMetronomeDotSet(); - MetronomeDotPtr getMetronomeDot( const MetronomeDotSetIterConst& setIterator ) const; + /* _________ MetronomeDot minOccurs = 0, maxOccurs = unbounded _________ */ + const MetronomeDotSet &getMetronomeDotSet() const; + void addMetronomeDot(const MetronomeDotPtr &value); + void removeMetronomeDot(const MetronomeDotSetIterConst &value); + void clearMetronomeDotSet(); + MetronomeDotPtr getMetronomeDot(const MetronomeDotSetIterConst &setIterator) const; - /* _________ MetronomeBeam minOccurs = 0, maxOccurs = unbounded _________ */ - const MetronomeBeamSet& getMetronomeBeamSet() const; - void addMetronomeBeam( const MetronomeBeamPtr& value ); - void removeMetronomeBeam( const MetronomeBeamSetIterConst& value ); - void clearMetronomeBeamSet(); - MetronomeBeamPtr getMetronomeBeam( const MetronomeBeamSetIterConst& setIterator ) const; + /* _________ MetronomeBeam minOccurs = 0, maxOccurs = unbounded _________ */ + const MetronomeBeamSet &getMetronomeBeamSet() const; + void addMetronomeBeam(const MetronomeBeamPtr &value); + void removeMetronomeBeam(const MetronomeBeamSetIterConst &value); + void clearMetronomeBeamSet(); + MetronomeBeamPtr getMetronomeBeam(const MetronomeBeamSetIterConst &setIterator) const; - /* _________ MetronomeTuplet minOccurs = 0, maxOccurs = 1 _________ */ - MetronomeTupletPtr getMetronomeTuplet() const; - void setMetronomeTuplet( const MetronomeTupletPtr& value ); - bool getHasMetronomeTuplet() const; - void setHasMetronomeTuplet( const bool value ); + /* _________ MetronomeTuplet minOccurs = 0, maxOccurs = 1 _________ */ + MetronomeTupletPtr getMetronomeTuplet() const; + void setMetronomeTuplet(const MetronomeTupletPtr &value); + bool getHasMetronomeTuplet() const; + void setHasMetronomeTuplet(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - MetronomeTypePtr myMetronomeType; - MetronomeDotSet myMetronomeDotSet; - MetronomeBeamSet myMetronomeBeamSet; - MetronomeTupletPtr myMetronomeTuplet; - bool myHasMetronomeTuplet; - }; - } -} + private: + MetronomeTypePtr myMetronomeType; + MetronomeDotSet myMetronomeDotSet; + MetronomeBeamSet myMetronomeBeamSet; + MetronomeTupletPtr myMetronomeTuplet; + bool myHasMetronomeTuplet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelation.cpp b/Sourcecode/private/mx/core/elements/MetronomeRelation.cpp index b49ae6b1c..eb915aa46 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeRelation.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeRelation.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - MetronomeRelation::MetronomeRelation() - :myValue( "equals" ) - {} - - - MetronomeRelation::MetronomeRelation( const XsString& value ) - :myValue( value ) - {} - - - bool MetronomeRelation::hasAttributes() const - { - return false; - } - - - bool MetronomeRelation::hasContents() const - { - return true; - } - - - std::ostream& MetronomeRelation::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MetronomeRelation::streamName( std::ostream& os ) const - { - os << "metronome-relation"; - return os; - } +namespace core +{ +MetronomeRelation::MetronomeRelation() : myValue("equals") +{ +} +MetronomeRelation::MetronomeRelation(const XsString &value) : myValue(value) +{ +} - std::ostream& MetronomeRelation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MetronomeRelation::hasAttributes() const +{ + return false; +} +bool MetronomeRelation::hasContents() const +{ + return true; +} - XsString MetronomeRelation::getValue() const - { - return myValue; - } +std::ostream &MetronomeRelation::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MetronomeRelation::streamName(std::ostream &os) const +{ + os << "metronome-relation"; + return os; +} - void MetronomeRelation::setValue( const XsString& value ) - { - myValue.setValue( value.getValue() ); - } +std::ostream &MetronomeRelation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString MetronomeRelation::getValue() const +{ + return myValue; +} - bool MetronomeRelation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue.setValue( xelement.getValue() ); - return true; - } +void MetronomeRelation::setValue(const XsString &value) +{ + myValue.setValue(value.getValue()); +} - } +bool MetronomeRelation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelation.h b/Sourcecode/private/mx/core/elements/MetronomeRelation.h index 0bcec723a..92011d6cb 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeRelation.h +++ b/Sourcecode/private/mx/core/elements/MetronomeRelation.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelation ) - - inline MetronomeRelationPtr makeMetronomeRelation() { return std::make_shared(); } - - class MetronomeRelation : public ElementInterface - { - public: - MetronomeRelation(); - MetronomeRelation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MetronomeRelation) + +inline MetronomeRelationPtr makeMetronomeRelation() +{ + return std::make_shared(); } + +class MetronomeRelation : public ElementInterface +{ + public: + MetronomeRelation(); + MetronomeRelation(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp b/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp index 04a89767d..b5a7b6519 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp @@ -10,78 +10,69 @@ namespace mx { - namespace core - { - MetronomeRelationGroup::MetronomeRelationGroup() - :myMetronomeRelation( makeMetronomeRelation() ) - ,myMetronomeNote( makeMetronomeNote() ) - {} - - - bool MetronomeRelationGroup::hasAttributes() const - { - return false; - } - - - std::ostream& MetronomeRelationGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MetronomeRelationGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool MetronomeRelationGroup::hasContents() const - { - return true; - } - - - std::ostream& MetronomeRelationGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - myMetronomeRelation->toStream( os, indentLevel ); - os << std::endl; - myMetronomeNote->toStream( os, indentLevel ); - return os; - } +namespace core +{ +MetronomeRelationGroup::MetronomeRelationGroup() + : myMetronomeRelation(makeMetronomeRelation()), myMetronomeNote(makeMetronomeNote()) +{ +} +bool MetronomeRelationGroup::hasAttributes() const +{ + return false; +} - MetronomeRelationPtr MetronomeRelationGroup::getMetronomeRelation() const - { - return myMetronomeRelation; - } +std::ostream &MetronomeRelationGroup::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MetronomeRelationGroup::streamName(std::ostream &os) const +{ + return os; +} - void MetronomeRelationGroup::setMetronomeRelation( const MetronomeRelationPtr& value ) - { - if ( value ) - { - myMetronomeRelation = value; - } - } +bool MetronomeRelationGroup::hasContents() const +{ + return true; +} +std::ostream &MetronomeRelationGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + myMetronomeRelation->toStream(os, indentLevel); + os << std::endl; + myMetronomeNote->toStream(os, indentLevel); + return os; +} - MetronomeNotePtr MetronomeRelationGroup::getMetronomeNote() const - { - return myMetronomeNote; - } +MetronomeRelationPtr MetronomeRelationGroup::getMetronomeRelation() const +{ + return myMetronomeRelation; +} +void MetronomeRelationGroup::setMetronomeRelation(const MetronomeRelationPtr &value) +{ + if (value) + { + myMetronomeRelation = value; + } +} - void MetronomeRelationGroup::setMetronomeNote( const MetronomeNotePtr& value ) - { - if ( value ) - { - myMetronomeNote = value; - } - } - - MX_FROM_XELEMENT_UNUSED( MetronomeRelationGroup ); +MetronomeNotePtr MetronomeRelationGroup::getMetronomeNote() const +{ + return myMetronomeNote; +} +void MetronomeRelationGroup::setMetronomeNote(const MetronomeNotePtr &value) +{ + if (value) + { + myMetronomeNote = value; } } + +MX_FROM_XELEMENT_UNUSED(MetronomeRelationGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h b/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h index 35a60a4d1..aad2d27e3 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h +++ b/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,40 +13,43 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeNote ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelation ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelationGroup ) - - inline MetronomeRelationGroupPtr makeMetronomeRelationGroup() { return std::make_shared(); } - - class MetronomeRelationGroup : public ElementInterface - { - public: - MetronomeRelationGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MetronomeRelation minOccurs = 1, maxOccurs = 1 _________ */ - MetronomeRelationPtr getMetronomeRelation() const; - void setMetronomeRelation( const MetronomeRelationPtr& value ); - - /* _________ MetronomeNote minOccurs = 1, maxOccurs = 1 _________ */ - MetronomeNotePtr getMetronomeNote() const; - void setMetronomeNote( const MetronomeNotePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetronomeRelationPtr myMetronomeRelation; - MetronomeNotePtr myMetronomeNote; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MetronomeNote) +MX_FORWARD_DECLARE_ELEMENT(MetronomeRelation) +MX_FORWARD_DECLARE_ELEMENT(MetronomeRelationGroup) + +inline MetronomeRelationGroupPtr makeMetronomeRelationGroup() +{ + return std::make_shared(); } + +class MetronomeRelationGroup : public ElementInterface +{ + public: + MetronomeRelationGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ MetronomeRelation minOccurs = 1, maxOccurs = 1 _________ */ + MetronomeRelationPtr getMetronomeRelation() const; + void setMetronomeRelation(const MetronomeRelationPtr &value); + + /* _________ MetronomeNote minOccurs = 1, maxOccurs = 1 _________ */ + MetronomeNotePtr getMetronomeNote() const; + void setMetronomeNote(const MetronomeNotePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MetronomeRelationPtr myMetronomeRelation; + MetronomeNotePtr myMetronomeNote; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp b/Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp index 0d20fcb4d..1b14afebb 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp @@ -11,156 +11,152 @@ namespace mx { - namespace core - { - MetronomeTuplet::MetronomeTuplet() - :myAttributes( std::make_shared() ) - ,myActualNotes( makeActualNotes() ) - ,myNormalNotes( makeNormalNotes() ) - ,myTimeModificationNormalTypeNormalDot( makeTimeModificationNormalTypeNormalDot() ) - ,myHasTimeModificationNormalTypeNormalDot( false ) - {} - - - bool MetronomeTuplet::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& MetronomeTuplet::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& MetronomeTuplet::streamName( std::ostream& os ) const - { - os << "metronome-tuplet"; - return os; - } - - - bool MetronomeTuplet::hasContents() const - { - return true; - } - - - std::ostream& MetronomeTuplet::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myActualNotes->toStream( os, indentLevel+1 ); - os << std::endl; - myNormalNotes->toStream( os, indentLevel+1 ); - if ( myHasTimeModificationNormalTypeNormalDot ) - { - os << std::endl; - myTimeModificationNormalTypeNormalDot->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - +namespace core +{ +MetronomeTuplet::MetronomeTuplet() + : myAttributes(std::make_shared()), myActualNotes(makeActualNotes()), + myNormalNotes(makeNormalNotes()), + myTimeModificationNormalTypeNormalDot(makeTimeModificationNormalTypeNormalDot()), + myHasTimeModificationNormalTypeNormalDot(false) +{ +} - MetronomeTupletAttributesPtr MetronomeTuplet::getAttributes() const - { - return myAttributes; - } +bool MetronomeTuplet::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &MetronomeTuplet::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void MetronomeTuplet::setAttributes( const MetronomeTupletAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MetronomeTuplet::streamName(std::ostream &os) const +{ + os << "metronome-tuplet"; + return os; +} +bool MetronomeTuplet::hasContents() const +{ + return true; +} - ActualNotesPtr MetronomeTuplet::getActualNotes() const - { - return myActualNotes; - } +std::ostream &MetronomeTuplet::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myActualNotes->toStream(os, indentLevel + 1); + os << std::endl; + myNormalNotes->toStream(os, indentLevel + 1); + if (myHasTimeModificationNormalTypeNormalDot) + { + os << std::endl; + myTimeModificationNormalTypeNormalDot->streamContents(os, indentLevel + 1, isOneLineOnly); + } + os << std::endl; + isOneLineOnly = false; + return os; +} +MetronomeTupletAttributesPtr MetronomeTuplet::getAttributes() const +{ + return myAttributes; +} - void MetronomeTuplet::setActualNotes( const ActualNotesPtr& value ) - { - if( value ) - { - myActualNotes = value; - } - } +void MetronomeTuplet::setAttributes(const MetronomeTupletAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +ActualNotesPtr MetronomeTuplet::getActualNotes() const +{ + return myActualNotes; +} - NormalNotesPtr MetronomeTuplet::getNormalNotes() const - { - return myNormalNotes; - } +void MetronomeTuplet::setActualNotes(const ActualNotesPtr &value) +{ + if (value) + { + myActualNotes = value; + } +} +NormalNotesPtr MetronomeTuplet::getNormalNotes() const +{ + return myNormalNotes; +} - void MetronomeTuplet::setNormalNotes( const NormalNotesPtr& value ) - { - if( value ) - { - myNormalNotes = value; - } - } +void MetronomeTuplet::setNormalNotes(const NormalNotesPtr &value) +{ + if (value) + { + myNormalNotes = value; + } +} +TimeModificationNormalTypeNormalDotPtr MetronomeTuplet::getTimeModificationNormalTypeNormalDot() const +{ + return myTimeModificationNormalTypeNormalDot; +} - TimeModificationNormalTypeNormalDotPtr MetronomeTuplet::getTimeModificationNormalTypeNormalDot() const - { - return myTimeModificationNormalTypeNormalDot; - } +void MetronomeTuplet::setTimeModificationNormalTypeNormalDot(const TimeModificationNormalTypeNormalDotPtr &value) +{ + if (value) + { + myTimeModificationNormalTypeNormalDot = value; + } +} +bool MetronomeTuplet::getHasTimeModificationNormalTypeNormalDot() const +{ + return myHasTimeModificationNormalTypeNormalDot; +} - void MetronomeTuplet::setTimeModificationNormalTypeNormalDot( const TimeModificationNormalTypeNormalDotPtr& value ) - { - if ( value ) - { - myTimeModificationNormalTypeNormalDot = value; - } - } +void MetronomeTuplet::setHasTimeModificationNormalTypeNormalDot(const bool value) +{ + myHasTimeModificationNormalTypeNormalDot = value; +} +bool MetronomeTuplet::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isActualNotesFound = false; + bool isNormalNotesFound = false; - bool MetronomeTuplet::getHasTimeModificationNormalTypeNormalDot() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myActualNotes, isActualNotesFound)) { - return myHasTimeModificationNormalTypeNormalDot; + continue; } - - - void MetronomeTuplet::setHasTimeModificationNormalTypeNormalDot( const bool value ) + if (importElement(message, *it, isSuccess, *myNormalNotes, isNormalNotesFound)) { - myHasTimeModificationNormalTypeNormalDot = value; + continue; } - - - bool MetronomeTuplet::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myTimeModificationNormalTypeNormalDot, + myHasTimeModificationNormalTypeNormalDot)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isActualNotesFound = false; - bool isNormalNotesFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myActualNotes, isActualNotesFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myNormalNotes, isNormalNotesFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTimeModificationNormalTypeNormalDot, myHasTimeModificationNormalTypeNormalDot ) ) { continue; } - } - - if( !isActualNotesFound ) - { - message << "MetronomeTuplet: '" << myActualNotes->getElementName() << "' is required but was not found" << std::endl; - } - if( !isNormalNotesFound ) - { - message << "MetronomeTuplet: '" << myNormalNotes->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isActualNotesFound) + { + message << "MetronomeTuplet: '" << myActualNotes->getElementName() << "' is required but was not found" + << std::endl; } + if (!isNormalNotesFound) + { + message << "MetronomeTuplet: '" << myNormalNotes->getElementName() << "' is required but was not found" + << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeTuplet.h b/Sourcecode/private/mx/core/elements/MetronomeTuplet.h index f674f6a69..4752b8d44 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeTuplet.h +++ b/Sourcecode/private/mx/core/elements/MetronomeTuplet.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/MetronomeTupletAttributes.h" #include @@ -14,54 +14,56 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeTupletAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ActualNotes ) - MX_FORWARD_DECLARE_ELEMENT( NormalNotes ) - MX_FORWARD_DECLARE_ELEMENT( TimeModificationNormalTypeNormalDot ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeTuplet ) +MX_FORWARD_DECLARE_ATTRIBUTES(MetronomeTupletAttributes) +MX_FORWARD_DECLARE_ELEMENT(ActualNotes) +MX_FORWARD_DECLARE_ELEMENT(NormalNotes) +MX_FORWARD_DECLARE_ELEMENT(TimeModificationNormalTypeNormalDot) +MX_FORWARD_DECLARE_ELEMENT(MetronomeTuplet) - inline MetronomeTupletPtr makeMetronomeTuplet() { return std::make_shared(); } - +inline MetronomeTupletPtr makeMetronomeTuplet() +{ + return std::make_shared(); +} - class MetronomeTuplet : public ElementInterface - { - public: - MetronomeTuplet(); +class MetronomeTuplet : public ElementInterface +{ + public: + MetronomeTuplet(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MetronomeTupletAttributesPtr getAttributes() const; - void setAttributes( const MetronomeTupletAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MetronomeTupletAttributesPtr getAttributes() const; + void setAttributes(const MetronomeTupletAttributesPtr &value); - /* _________ ActualNotes minOccurs = 1, maxOccurs = 1 _________ */ - ActualNotesPtr getActualNotes() const; - void setActualNotes( const ActualNotesPtr& value ); + /* _________ ActualNotes minOccurs = 1, maxOccurs = 1 _________ */ + ActualNotesPtr getActualNotes() const; + void setActualNotes(const ActualNotesPtr &value); - /* _________ NormalNotes minOccurs = 1, maxOccurs = 1 _________ */ - NormalNotesPtr getNormalNotes() const; - void setNormalNotes( const NormalNotesPtr& value ); + /* _________ NormalNotes minOccurs = 1, maxOccurs = 1 _________ */ + NormalNotesPtr getNormalNotes() const; + void setNormalNotes(const NormalNotesPtr &value); - /* _________ TimeModificationNormalTypeNormalDot minOccurs = 0, maxOccurs = 1 _________ */ - TimeModificationNormalTypeNormalDotPtr getTimeModificationNormalTypeNormalDot() const; - void setTimeModificationNormalTypeNormalDot( const TimeModificationNormalTypeNormalDotPtr& value ); - bool getHasTimeModificationNormalTypeNormalDot() const; - void setHasTimeModificationNormalTypeNormalDot( const bool value ); + /* _________ TimeModificationNormalTypeNormalDot minOccurs = 0, maxOccurs = 1 _________ */ + TimeModificationNormalTypeNormalDotPtr getTimeModificationNormalTypeNormalDot() const; + void setTimeModificationNormalTypeNormalDot(const TimeModificationNormalTypeNormalDotPtr &value); + bool getHasTimeModificationNormalTypeNormalDot() const; + void setHasTimeModificationNormalTypeNormalDot(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - MetronomeTupletAttributesPtr myAttributes; - ActualNotesPtr myActualNotes; - NormalNotesPtr myNormalNotes; - TimeModificationNormalTypeNormalDotPtr myTimeModificationNormalTypeNormalDot; - bool myHasTimeModificationNormalTypeNormalDot; - }; - } -} + private: + MetronomeTupletAttributesPtr myAttributes; + ActualNotesPtr myActualNotes; + NormalNotesPtr myNormalNotes; + TimeModificationNormalTypeNormalDotPtr myTimeModificationNormalTypeNormalDot; + bool myHasTimeModificationNormalTypeNormalDot; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp b/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp index 3f6aa7d04..8d7d43792 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp @@ -8,62 +8,64 @@ namespace mx { - namespace core +namespace core +{ +MetronomeTupletAttributes::MetronomeTupletAttributes() + : type(StartStop::start), bracket(YesNo::no), showNumber(ShowTuplet::actual), hasType(true), hasBracket(false), + hasShowNumber(false) +{ +} + +bool MetronomeTupletAttributes::hasValues() const +{ + return hasType || hasBracket || hasShowNumber; +} + +std::ostream &MetronomeTupletAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - MetronomeTupletAttributes::MetronomeTupletAttributes() - :type( StartStop::start ) - ,bracket( YesNo::no ) - ,showNumber( ShowTuplet::actual ) - ,hasType( true ) - ,hasBracket( false ) - ,hasShowNumber( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, bracket, "bracket", hasBracket); + streamAttribute(os, showNumber, "show-number", hasShowNumber); + } + return os; +} +bool MetronomeTupletAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MetronomeTupletAttributes"; + bool isSuccess = true; + bool isTypeFound = false; - bool MetronomeTupletAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - return hasType || - hasBracket || - hasShowNumber; + continue; } - - - std::ostream& MetronomeTupletAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, bracket, "bracket", hasBracket ); - streamAttribute( os, showNumber, "show-number", hasShowNumber ); - } - return os; + continue; } - - - bool MetronomeTupletAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, showNumber, hasShowNumber, "show-number", + &parseShowTuplet)) { - const char* const className = "MetronomeTupletAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, showNumber, hasShowNumber, "show-number", &parseShowTuplet ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h b/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h index 36cb8edcd..77ce24aaf 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h +++ b/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,26 +14,26 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeTupletAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MetronomeTupletAttributes) - struct MetronomeTupletAttributes : public AttributesInterface - { - public: - MetronomeTupletAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - YesNo bracket; - ShowTuplet showNumber; - const bool hasType; - bool hasBracket; - bool hasShowNumber; +struct MetronomeTupletAttributes : public AttributesInterface +{ + public: + MetronomeTupletAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + YesNo bracket; + ShowTuplet showNumber; + const bool hasType; + bool hasBracket; + bool hasShowNumber; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeType.cpp b/Sourcecode/private/mx/core/elements/MetronomeType.cpp index a53a626a5..b2186367d 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeType.cpp +++ b/Sourcecode/private/mx/core/elements/MetronomeType.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - MetronomeType::MetronomeType() - :myValue( NoteTypeValue::eighth ) - {} - - - MetronomeType::MetronomeType( const NoteTypeValue& value ) - :myValue( value ) - {} - - - bool MetronomeType::hasAttributes() const - { - return false; - } - - - bool MetronomeType::hasContents() const - { - return true; - } - - - std::ostream& MetronomeType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MetronomeType::streamName( std::ostream& os ) const - { - os << "metronome-type"; - return os; - } +namespace core +{ +MetronomeType::MetronomeType() : myValue(NoteTypeValue::eighth) +{ +} +MetronomeType::MetronomeType(const NoteTypeValue &value) : myValue(value) +{ +} - std::ostream& MetronomeType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MetronomeType::hasAttributes() const +{ + return false; +} +bool MetronomeType::hasContents() const +{ + return true; +} - NoteTypeValue MetronomeType::getValue() const - { - return myValue; - } +std::ostream &MetronomeType::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MetronomeType::streamName(std::ostream &os) const +{ + os << "metronome-type"; + return os; +} - void MetronomeType::setValue( const NoteTypeValue& value ) - { - myValue = value; - } +std::ostream &MetronomeType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NoteTypeValue MetronomeType::getValue() const +{ + return myValue; +} - bool MetronomeType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseNoteTypeValue( xelement.getValue() ); - return true; - } +void MetronomeType::setValue(const NoteTypeValue &value) +{ + myValue = value; +} - } +bool MetronomeType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseNoteTypeValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MetronomeType.h b/Sourcecode/private/mx/core/elements/MetronomeType.h index 7293f9b81..d3b4d451b 100644 --- a/Sourcecode/private/mx/core/elements/MetronomeType.h +++ b/Sourcecode/private/mx/core/elements/MetronomeType.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeType ) - - inline MetronomeTypePtr makeMetronomeType() { return std::make_shared(); } - inline MetronomeTypePtr makeMetronomeType( const NoteTypeValue& value ) { return std::make_shared( value ); } - inline MetronomeTypePtr makeMetronomeType( NoteTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class MetronomeType : public ElementInterface - { - public: - MetronomeType(); - MetronomeType( const NoteTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteTypeValue getValue() const; - void setValue( const NoteTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteTypeValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MetronomeType) + +inline MetronomeTypePtr makeMetronomeType() +{ + return std::make_shared(); +} + +inline MetronomeTypePtr makeMetronomeType(const NoteTypeValue &value) +{ + return std::make_shared(value); } + +inline MetronomeTypePtr makeMetronomeType(NoteTypeValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class MetronomeType : public ElementInterface +{ + public: + MetronomeType(); + MetronomeType(const NoteTypeValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NoteTypeValue getValue() const; + void setValue(const NoteTypeValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NoteTypeValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiBank.cpp b/Sourcecode/private/mx/core/elements/MidiBank.cpp index c0adcbca8..8ddf5c93b 100644 --- a/Sourcecode/private/mx/core/elements/MidiBank.cpp +++ b/Sourcecode/private/mx/core/elements/MidiBank.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - MidiBank::MidiBank() - :myValue() - {} - - - MidiBank::MidiBank( const Midi16384& value ) - :myValue( value ) - {} - - - bool MidiBank::hasAttributes() const - { - return false; - } - - - bool MidiBank::hasContents() const - { - return true; - } - - - std::ostream& MidiBank::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiBank::streamName( std::ostream& os ) const - { - os << "midi-bank"; - return os; - } +namespace core +{ +MidiBank::MidiBank() : myValue() +{ +} +MidiBank::MidiBank(const Midi16384 &value) : myValue(value) +{ +} - std::ostream& MidiBank::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MidiBank::hasAttributes() const +{ + return false; +} +bool MidiBank::hasContents() const +{ + return true; +} - Midi16384 MidiBank::getValue() const - { - return myValue; - } +std::ostream &MidiBank::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MidiBank::streamName(std::ostream &os) const +{ + os << "midi-bank"; + return os; +} - void MidiBank::setValue( const Midi16384& value ) - { - myValue = value; - } +std::ostream &MidiBank::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Midi16384 MidiBank::getValue() const +{ + return myValue; +} - bool MidiBank::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void MidiBank::setValue(const Midi16384 &value) +{ + myValue = value; +} - } +bool MidiBank::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiBank.h b/Sourcecode/private/mx/core/elements/MidiBank.h index 41c8a76c8..7c32a4833 100644 --- a/Sourcecode/private/mx/core/elements/MidiBank.h +++ b/Sourcecode/private/mx/core/elements/MidiBank.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiBank ) - - inline MidiBankPtr makeMidiBank() { return std::make_shared(); } - inline MidiBankPtr makeMidiBank( const Midi16384& value ) { return std::make_shared( value ); } - inline MidiBankPtr makeMidiBank( Midi16384&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiBank : public ElementInterface - { - public: - MidiBank(); - MidiBank( const Midi16384& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Midi16384 getValue() const; - void setValue( const Midi16384& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Midi16384 myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MidiBank) + +inline MidiBankPtr makeMidiBank() +{ + return std::make_shared(); +} + +inline MidiBankPtr makeMidiBank(const Midi16384 &value) +{ + return std::make_shared(value); } + +inline MidiBankPtr makeMidiBank(Midi16384 &&value) +{ + return std::make_shared(std::move(value)); +} + +class MidiBank : public ElementInterface +{ + public: + MidiBank(); + MidiBank(const Midi16384 &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Midi16384 getValue() const; + void setValue(const Midi16384 &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Midi16384 myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiChannel.cpp b/Sourcecode/private/mx/core/elements/MidiChannel.cpp index 483f44d68..55d875b4e 100644 --- a/Sourcecode/private/mx/core/elements/MidiChannel.cpp +++ b/Sourcecode/private/mx/core/elements/MidiChannel.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - MidiChannel::MidiChannel() - :myValue() - {} - - - MidiChannel::MidiChannel( const Midi16& value ) - :myValue( value ) - {} - - - bool MidiChannel::hasAttributes() const - { - return false; - } - - - bool MidiChannel::hasContents() const - { - return true; - } - - - std::ostream& MidiChannel::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiChannel::streamName( std::ostream& os ) const - { - os << "midi-channel"; - return os; - } +namespace core +{ +MidiChannel::MidiChannel() : myValue() +{ +} +MidiChannel::MidiChannel(const Midi16 &value) : myValue(value) +{ +} - std::ostream& MidiChannel::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MidiChannel::hasAttributes() const +{ + return false; +} +bool MidiChannel::hasContents() const +{ + return true; +} - Midi16 MidiChannel::getValue() const - { - return myValue; - } +std::ostream &MidiChannel::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MidiChannel::streamName(std::ostream &os) const +{ + os << "midi-channel"; + return os; +} - void MidiChannel::setValue( const Midi16& value ) - { - myValue = value; - } +std::ostream &MidiChannel::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Midi16 MidiChannel::getValue() const +{ + return myValue; +} - bool MidiChannel::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void MidiChannel::setValue(const Midi16 &value) +{ + myValue = value; +} - } +bool MidiChannel::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiChannel.h b/Sourcecode/private/mx/core/elements/MidiChannel.h index ad229268b..d1a5dcc68 100644 --- a/Sourcecode/private/mx/core/elements/MidiChannel.h +++ b/Sourcecode/private/mx/core/elements/MidiChannel.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiChannel ) - - inline MidiChannelPtr makeMidiChannel() { return std::make_shared(); } - inline MidiChannelPtr makeMidiChannel( const Midi16& value ) { return std::make_shared( value ); } - inline MidiChannelPtr makeMidiChannel( Midi16&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiChannel : public ElementInterface - { - public: - MidiChannel(); - MidiChannel( const Midi16& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Midi16 getValue() const; - void setValue( const Midi16& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Midi16 myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MidiChannel) + +inline MidiChannelPtr makeMidiChannel() +{ + return std::make_shared(); +} + +inline MidiChannelPtr makeMidiChannel(const Midi16 &value) +{ + return std::make_shared(value); } + +inline MidiChannelPtr makeMidiChannel(Midi16 &&value) +{ + return std::make_shared(std::move(value)); +} + +class MidiChannel : public ElementInterface +{ + public: + MidiChannel(); + MidiChannel(const Midi16 &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Midi16 getValue() const; + void setValue(const Midi16 &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Midi16 myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiDevice.cpp b/Sourcecode/private/mx/core/elements/MidiDevice.cpp index b719c4e73..ce0496d44 100644 --- a/Sourcecode/private/mx/core/elements/MidiDevice.cpp +++ b/Sourcecode/private/mx/core/elements/MidiDevice.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - MidiDevice::MidiDevice() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - MidiDevice::MidiDevice( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MidiDevice::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MidiDevice::hasContents() const - { - return true; - } - - - std::ostream& MidiDevice::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MidiDevice::streamName( std::ostream& os ) const - { - os << "midi-device"; - return os; - } - - - std::ostream& MidiDevice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +MidiDevice::MidiDevice() : myValue(), myAttributes(std::make_shared()) +{ +} +MidiDevice::MidiDevice(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - MidiDeviceAttributesPtr MidiDevice::getAttributes() const - { - return myAttributes; - } +bool MidiDevice::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool MidiDevice::hasContents() const +{ + return true; +} - void MidiDevice::setAttributes( const MidiDeviceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MidiDevice::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &MidiDevice::streamName(std::ostream &os) const +{ + os << "midi-device"; + return os; +} - XsString MidiDevice::getValue() const - { - return myValue; - } +std::ostream &MidiDevice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MidiDeviceAttributesPtr MidiDevice::getAttributes() const +{ + return myAttributes; +} - void MidiDevice::setValue( const XsString& value ) - { - myValue = value; - } +void MidiDevice::setAttributes(const MidiDeviceAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString MidiDevice::getValue() const +{ + return myValue; +} - bool MidiDevice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void MidiDevice::setValue(const XsString &value) +{ + myValue = value; +} - } +bool MidiDevice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiDevice.h b/Sourcecode/private/mx/core/elements/MidiDevice.h index 71459a321..a68250d10 100644 --- a/Sourcecode/private/mx/core/elements/MidiDevice.h +++ b/Sourcecode/private/mx/core/elements/MidiDevice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/MidiDeviceAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MidiDeviceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MidiDevice ) - - inline MidiDevicePtr makeMidiDevice() { return std::make_shared(); } - inline MidiDevicePtr makeMidiDevice( const XsString& value ) { return std::make_shared( value ); } - inline MidiDevicePtr makeMidiDevice( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiDevice : public ElementInterface - { - public: - MidiDevice(); - MidiDevice( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MidiDeviceAttributesPtr getAttributes() const; - void setAttributes( const MidiDeviceAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - MidiDeviceAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MidiDeviceAttributes) +MX_FORWARD_DECLARE_ELEMENT(MidiDevice) + +inline MidiDevicePtr makeMidiDevice() +{ + return std::make_shared(); +} + +inline MidiDevicePtr makeMidiDevice(const XsString &value) +{ + return std::make_shared(value); } + +inline MidiDevicePtr makeMidiDevice(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class MidiDevice : public ElementInterface +{ + public: + MidiDevice(); + MidiDevice(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MidiDeviceAttributesPtr getAttributes() const; + void setAttributes(const MidiDeviceAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + MidiDeviceAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp b/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp index 557a916df..dcfef5cad 100644 --- a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp @@ -8,51 +8,49 @@ namespace mx { - namespace core - { - MidiDeviceAttributes::MidiDeviceAttributes() - :port() - ,id() - ,hasPort( false ) - ,hasId( false ) - {} +namespace core +{ +MidiDeviceAttributes::MidiDeviceAttributes() : port(), id(), hasPort(false), hasId(false) +{ +} +bool MidiDeviceAttributes::hasValues() const +{ + return hasPort || hasId; +} - bool MidiDeviceAttributes::hasValues() const - { - return hasPort || - hasId; - } +std::ostream &MidiDeviceAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, port, "port", hasPort); + streamAttribute(os, id, "id", hasId); + } + return os; +} +bool MidiDeviceAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MidiDeviceAttributes"; + bool isSuccess = true; - std::ostream& MidiDeviceAttributes::toStream( std::ostream& os ) const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, port, hasPort, "port")) { - if ( hasValues() ) - { - streamAttribute( os, port, "port", hasPort ); - streamAttribute( os, id, "id", hasId ); - } - return os; + continue; } - - - bool MidiDeviceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, id, hasId, "id")) { - const char* const className = "MidiDeviceAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, port, hasPort, "port" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, id, hasId, "id" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h b/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h index 39ccbe9ca..95de1367d 100644 --- a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h +++ b/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/XsIDREF.h" @@ -15,24 +15,24 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MidiDeviceAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MidiDeviceAttributes) - struct MidiDeviceAttributes : public AttributesInterface - { - public: - MidiDeviceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - Midi16 port; - XsIDREF id; - bool hasPort; - bool hasId; +struct MidiDeviceAttributes : public AttributesInterface +{ + public: + MidiDeviceAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + Midi16 port; + XsIDREF id; + bool hasPort; + bool hasId; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp b/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp index 84afc0c19..6b39bb5b1 100644 --- a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp +++ b/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp @@ -10,121 +10,107 @@ namespace mx { - namespace core - { - MidiDeviceInstrumentGroup::MidiDeviceInstrumentGroup() - :myMidiDevice( makeMidiDevice() ) - ,myHasMidiDevice( false ) - ,myMidiInstrument( makeMidiInstrument() ) - ,myHasMidiInstrument( false ) - {} - - - bool MidiDeviceInstrumentGroup::hasAttributes() const - { - return false; - } - - - std::ostream& MidiDeviceInstrumentGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiDeviceInstrumentGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool MidiDeviceInstrumentGroup::hasContents() const - { - return myHasMidiDevice || myHasMidiInstrument; - } - +namespace core +{ +MidiDeviceInstrumentGroup::MidiDeviceInstrumentGroup() + : myMidiDevice(makeMidiDevice()), myHasMidiDevice(false), myMidiInstrument(makeMidiInstrument()), + myHasMidiInstrument(false) +{ +} - std::ostream& MidiDeviceInstrumentGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( this->hasContents() ) - { - if ( myHasMidiDevice ) - { - myMidiDevice->toStream( os, indentLevel ); - if ( myHasMidiInstrument ) - { - os << std::endl; - } - } - if ( myHasMidiInstrument ) - { - myMidiInstrument->toStream( os, indentLevel ); - } - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } +bool MidiDeviceInstrumentGroup::hasAttributes() const +{ + return false; +} +std::ostream &MidiDeviceInstrumentGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - MidiDevicePtr MidiDeviceInstrumentGroup::getMidiDevice() const - { - return myMidiDevice; - } +std::ostream &MidiDeviceInstrumentGroup::streamName(std::ostream &os) const +{ + return os; +} +bool MidiDeviceInstrumentGroup::hasContents() const +{ + return myHasMidiDevice || myHasMidiInstrument; +} - void MidiDeviceInstrumentGroup::setMidiDevice( const MidiDevicePtr& value ) +std::ostream &MidiDeviceInstrumentGroup::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + if (this->hasContents()) + { + if (myHasMidiDevice) { - if ( value ) + myMidiDevice->toStream(os, indentLevel); + if (myHasMidiInstrument) { - myMidiDevice = value; + os << std::endl; } } - - - bool MidiDeviceInstrumentGroup::getHasMidiDevice() const + if (myHasMidiInstrument) { - return myHasMidiDevice; + myMidiInstrument->toStream(os, indentLevel); } + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +MidiDevicePtr MidiDeviceInstrumentGroup::getMidiDevice() const +{ + return myMidiDevice; +} - void MidiDeviceInstrumentGroup::setHasMidiDevice( const bool value ) - { - myHasMidiDevice = value; - } - +void MidiDeviceInstrumentGroup::setMidiDevice(const MidiDevicePtr &value) +{ + if (value) + { + myMidiDevice = value; + } +} - MidiInstrumentPtr MidiDeviceInstrumentGroup::getMidiInstrument() const - { - return myMidiInstrument; - } +bool MidiDeviceInstrumentGroup::getHasMidiDevice() const +{ + return myHasMidiDevice; +} +void MidiDeviceInstrumentGroup::setHasMidiDevice(const bool value) +{ + myHasMidiDevice = value; +} - void MidiDeviceInstrumentGroup::setMidiInstrument( const MidiInstrumentPtr& value ) - { - if ( value ) - { - myMidiInstrument = value; - } - } +MidiInstrumentPtr MidiDeviceInstrumentGroup::getMidiInstrument() const +{ + return myMidiInstrument; +} +void MidiDeviceInstrumentGroup::setMidiInstrument(const MidiInstrumentPtr &value) +{ + if (value) + { + myMidiInstrument = value; + } +} - bool MidiDeviceInstrumentGroup::getHasMidiInstrument() const - { - return myHasMidiInstrument; - } +bool MidiDeviceInstrumentGroup::getHasMidiInstrument() const +{ + return myHasMidiInstrument; +} +void MidiDeviceInstrumentGroup::setHasMidiInstrument(const bool value) +{ + myHasMidiInstrument = value; +} - void MidiDeviceInstrumentGroup::setHasMidiInstrument( const bool value ) - { - myHasMidiInstrument = value; - } - - - MX_FROM_XELEMENT_UNUSED( MidiDeviceInstrumentGroup ); +MX_FROM_XELEMENT_UNUSED(MidiDeviceInstrumentGroup); - } -} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h b/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h index 536abfb73..aae69f87b 100644 --- a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h +++ b/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,46 +13,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiDevice ) - MX_FORWARD_DECLARE_ELEMENT( MidiInstrument ) - MX_FORWARD_DECLARE_ELEMENT( MidiDeviceInstrumentGroup ) - - inline MidiDeviceInstrumentGroupPtr makeMidiDeviceInstrumentGroup() { return std::make_shared(); } - - class MidiDeviceInstrumentGroup : public ElementInterface - { - public: - MidiDeviceInstrumentGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MidiDevice minOccurs = 0, maxOccurs = 1 _________ */ - MidiDevicePtr getMidiDevice() const; - void setMidiDevice( const MidiDevicePtr& value ); - bool getHasMidiDevice() const; - void setHasMidiDevice( const bool value ); - - /* _________ MidiInstrument minOccurs = 0, maxOccurs = 1 _________ */ - MidiInstrumentPtr getMidiInstrument() const; - void setMidiInstrument( const MidiInstrumentPtr& value ); - bool getHasMidiInstrument() const; - void setHasMidiInstrument( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MidiDevicePtr myMidiDevice; - bool myHasMidiDevice; - MidiInstrumentPtr myMidiInstrument; - bool myHasMidiInstrument; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MidiDevice) +MX_FORWARD_DECLARE_ELEMENT(MidiInstrument) +MX_FORWARD_DECLARE_ELEMENT(MidiDeviceInstrumentGroup) + +inline MidiDeviceInstrumentGroupPtr makeMidiDeviceInstrumentGroup() +{ + return std::make_shared(); } + +class MidiDeviceInstrumentGroup : public ElementInterface +{ + public: + MidiDeviceInstrumentGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ MidiDevice minOccurs = 0, maxOccurs = 1 _________ */ + MidiDevicePtr getMidiDevice() const; + void setMidiDevice(const MidiDevicePtr &value); + bool getHasMidiDevice() const; + void setHasMidiDevice(const bool value); + + /* _________ MidiInstrument minOccurs = 0, maxOccurs = 1 _________ */ + MidiInstrumentPtr getMidiInstrument() const; + void setMidiInstrument(const MidiInstrumentPtr &value); + bool getHasMidiInstrument() const; + void setHasMidiInstrument(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MidiDevicePtr myMidiDevice; + bool myHasMidiDevice; + MidiInstrumentPtr myMidiInstrument; + bool myHasMidiInstrument; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiInstrument.cpp b/Sourcecode/private/mx/core/elements/MidiInstrument.cpp index 8518d2bbb..443665b16 100644 --- a/Sourcecode/private/mx/core/elements/MidiInstrument.cpp +++ b/Sourcecode/private/mx/core/elements/MidiInstrument.cpp @@ -16,367 +16,334 @@ namespace mx { - namespace core - { - MidiInstrument::MidiInstrument() - :myAttributes( std::make_shared() ) - ,myMidiChannel( makeMidiChannel() ) - ,myHasMidiChannel( false ) - ,myMidiName( makeMidiName() ) - ,myHasMidiName( false ) - ,myMidiBank( makeMidiBank() ) - ,myHasMidiBank( false ) - ,myMidiProgram( makeMidiProgram() ) - ,myHasMidiProgram( false ) - ,myMidiUnpitched( makeMidiUnpitched() ) - ,myHasMidiUnpitched( false ) - ,myVolume( makeVolume() ) - ,myHasVolume( false ) - ,myPan( makePan() ) - ,myHasPan( false ) - ,myElevation( makeElevation() ) - ,myHasElevation( false ) - {} - - - bool MidiInstrument::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& MidiInstrument::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& MidiInstrument::streamName( std::ostream& os ) const - { - os << "midi-instrument"; - return os; - } - - - bool MidiInstrument::hasContents() const - { - return myHasMidiChannel - || myHasMidiName - || myHasMidiBank - || myHasMidiProgram - || myHasMidiUnpitched - || myHasVolume - || myHasPan - || myHasElevation; - } - - - std::ostream& MidiInstrument::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasMidiChannel ) - { - os << std::endl; - myMidiChannel->toStream( os, indentLevel+1 ); - } - if ( myHasMidiName ) - { - os << std::endl; - myMidiName->toStream( os, indentLevel+1 ); - } - if ( myHasMidiBank ) - { - os << std::endl; - myMidiBank->toStream( os, indentLevel+1 ); - } - if ( myHasMidiProgram ) - { - os << std::endl; - myMidiProgram->toStream( os, indentLevel+1 ); - } - if ( myHasMidiUnpitched ) - { - os << std::endl; - myMidiUnpitched->toStream( os, indentLevel+1 ); - } - if ( myHasVolume ) - { - os << std::endl; - myVolume->toStream( os, indentLevel+1 ); - } - if ( myHasPan ) - { - os << std::endl; - myPan->toStream( os, indentLevel+1 ); - } - if ( myHasElevation ) - { - os << std::endl; - myElevation->toStream( os, indentLevel+1 ); - } - if( hasContents() ) - { - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - MidiInstrumentAttributesPtr MidiInstrument::getAttributes() const - { - return myAttributes; - } - - - void MidiInstrument::setAttributes( const MidiInstrumentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - MidiChannelPtr MidiInstrument::getMidiChannel() const - { - return myMidiChannel; - } - - - void MidiInstrument::setMidiChannel( const MidiChannelPtr& value ) - { - if( value ) - { - myMidiChannel = value; - } - } - - - bool MidiInstrument::getHasMidiChannel() const - { - return myHasMidiChannel; - } - - - void MidiInstrument::setHasMidiChannel( const bool value ) - { - myHasMidiChannel = value; - } - - - MidiNamePtr MidiInstrument::getMidiName() const - { - return myMidiName; - } - +namespace core +{ +MidiInstrument::MidiInstrument() + : myAttributes(std::make_shared()), myMidiChannel(makeMidiChannel()), + myHasMidiChannel(false), myMidiName(makeMidiName()), myHasMidiName(false), myMidiBank(makeMidiBank()), + myHasMidiBank(false), myMidiProgram(makeMidiProgram()), myHasMidiProgram(false), + myMidiUnpitched(makeMidiUnpitched()), myHasMidiUnpitched(false), myVolume(makeVolume()), myHasVolume(false), + myPan(makePan()), myHasPan(false), myElevation(makeElevation()), myHasElevation(false) +{ +} - void MidiInstrument::setMidiName( const MidiNamePtr& value ) - { - if( value ) - { - myMidiName = value; - } - } +bool MidiInstrument::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &MidiInstrument::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - bool MidiInstrument::getHasMidiName() const - { - return myHasMidiName; - } +std::ostream &MidiInstrument::streamName(std::ostream &os) const +{ + os << "midi-instrument"; + return os; +} +bool MidiInstrument::hasContents() const +{ + return myHasMidiChannel || myHasMidiName || myHasMidiBank || myHasMidiProgram || myHasMidiUnpitched || + myHasVolume || myHasPan || myHasElevation; +} - void MidiInstrument::setHasMidiName( const bool value ) - { - myHasMidiName = value; - } +std::ostream &MidiInstrument::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasMidiChannel) + { + os << std::endl; + myMidiChannel->toStream(os, indentLevel + 1); + } + if (myHasMidiName) + { + os << std::endl; + myMidiName->toStream(os, indentLevel + 1); + } + if (myHasMidiBank) + { + os << std::endl; + myMidiBank->toStream(os, indentLevel + 1); + } + if (myHasMidiProgram) + { + os << std::endl; + myMidiProgram->toStream(os, indentLevel + 1); + } + if (myHasMidiUnpitched) + { + os << std::endl; + myMidiUnpitched->toStream(os, indentLevel + 1); + } + if (myHasVolume) + { + os << std::endl; + myVolume->toStream(os, indentLevel + 1); + } + if (myHasPan) + { + os << std::endl; + myPan->toStream(os, indentLevel + 1); + } + if (myHasElevation) + { + os << std::endl; + myElevation->toStream(os, indentLevel + 1); + } + if (hasContents()) + { + isOneLineOnly = false; + os << std::endl; + } + else + { + isOneLineOnly = true; + } + return os; +} +MidiInstrumentAttributesPtr MidiInstrument::getAttributes() const +{ + return myAttributes; +} - MidiBankPtr MidiInstrument::getMidiBank() const - { - return myMidiBank; - } +void MidiInstrument::setAttributes(const MidiInstrumentAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +MidiChannelPtr MidiInstrument::getMidiChannel() const +{ + return myMidiChannel; +} - void MidiInstrument::setMidiBank( const MidiBankPtr& value ) - { - if( value ) - { - myMidiBank = value; - } - } +void MidiInstrument::setMidiChannel(const MidiChannelPtr &value) +{ + if (value) + { + myMidiChannel = value; + } +} +bool MidiInstrument::getHasMidiChannel() const +{ + return myHasMidiChannel; +} - bool MidiInstrument::getHasMidiBank() const - { - return myHasMidiBank; - } +void MidiInstrument::setHasMidiChannel(const bool value) +{ + myHasMidiChannel = value; +} +MidiNamePtr MidiInstrument::getMidiName() const +{ + return myMidiName; +} - void MidiInstrument::setHasMidiBank( const bool value ) - { - myHasMidiBank = value; - } +void MidiInstrument::setMidiName(const MidiNamePtr &value) +{ + if (value) + { + myMidiName = value; + } +} +bool MidiInstrument::getHasMidiName() const +{ + return myHasMidiName; +} - MidiProgramPtr MidiInstrument::getMidiProgram() const - { - return myMidiProgram; - } +void MidiInstrument::setHasMidiName(const bool value) +{ + myHasMidiName = value; +} +MidiBankPtr MidiInstrument::getMidiBank() const +{ + return myMidiBank; +} - void MidiInstrument::setMidiProgram( const MidiProgramPtr& value ) - { - if( value ) - { - myMidiProgram = value; - } - } +void MidiInstrument::setMidiBank(const MidiBankPtr &value) +{ + if (value) + { + myMidiBank = value; + } +} +bool MidiInstrument::getHasMidiBank() const +{ + return myHasMidiBank; +} - bool MidiInstrument::getHasMidiProgram() const - { - return myHasMidiProgram; - } +void MidiInstrument::setHasMidiBank(const bool value) +{ + myHasMidiBank = value; +} +MidiProgramPtr MidiInstrument::getMidiProgram() const +{ + return myMidiProgram; +} - void MidiInstrument::setHasMidiProgram( const bool value ) - { - myHasMidiProgram = value; - } +void MidiInstrument::setMidiProgram(const MidiProgramPtr &value) +{ + if (value) + { + myMidiProgram = value; + } +} +bool MidiInstrument::getHasMidiProgram() const +{ + return myHasMidiProgram; +} - MidiUnpitchedPtr MidiInstrument::getMidiUnpitched() const - { - return myMidiUnpitched; - } +void MidiInstrument::setHasMidiProgram(const bool value) +{ + myHasMidiProgram = value; +} +MidiUnpitchedPtr MidiInstrument::getMidiUnpitched() const +{ + return myMidiUnpitched; +} - void MidiInstrument::setMidiUnpitched( const MidiUnpitchedPtr& value ) - { - if( value ) - { - myMidiUnpitched = value; - } - } +void MidiInstrument::setMidiUnpitched(const MidiUnpitchedPtr &value) +{ + if (value) + { + myMidiUnpitched = value; + } +} +bool MidiInstrument::getHasMidiUnpitched() const +{ + return myHasMidiUnpitched; +} - bool MidiInstrument::getHasMidiUnpitched() const - { - return myHasMidiUnpitched; - } +void MidiInstrument::setHasMidiUnpitched(const bool value) +{ + myHasMidiUnpitched = value; +} +VolumePtr MidiInstrument::getVolume() const +{ + return myVolume; +} - void MidiInstrument::setHasMidiUnpitched( const bool value ) - { - myHasMidiUnpitched = value; - } +void MidiInstrument::setVolume(const VolumePtr &value) +{ + if (value) + { + myVolume = value; + } +} +bool MidiInstrument::getHasVolume() const +{ + return myHasVolume; +} - VolumePtr MidiInstrument::getVolume() const - { - return myVolume; - } +void MidiInstrument::setHasVolume(const bool value) +{ + myHasVolume = value; +} +PanPtr MidiInstrument::getPan() const +{ + return myPan; +} - void MidiInstrument::setVolume( const VolumePtr& value ) - { - if( value ) - { - myVolume = value; - } - } +void MidiInstrument::setPan(const PanPtr &value) +{ + if (value) + { + myPan = value; + } +} +bool MidiInstrument::getHasPan() const +{ + return myHasPan; +} - bool MidiInstrument::getHasVolume() const - { - return myHasVolume; - } +void MidiInstrument::setHasPan(const bool value) +{ + myHasPan = value; +} +ElevationPtr MidiInstrument::getElevation() const +{ + return myElevation; +} - void MidiInstrument::setHasVolume( const bool value ) - { - myHasVolume = value; - } +void MidiInstrument::setElevation(const ElevationPtr &value) +{ + if (value) + { + myElevation = value; + } +} +bool MidiInstrument::getHasElevation() const +{ + return myHasElevation; +} - PanPtr MidiInstrument::getPan() const - { - return myPan; - } +void MidiInstrument::setHasElevation(const bool value) +{ + myHasElevation = value; +} +bool MidiInstrument::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - void MidiInstrument::setPan( const PanPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myMidiChannel, myHasMidiChannel)) { - if( value ) - { - myPan = value; - } + continue; } - - - bool MidiInstrument::getHasPan() const + if (importElement(message, *it, isSuccess, *myMidiName, myHasMidiName)) { - return myHasPan; + continue; } - - - void MidiInstrument::setHasPan( const bool value ) + if (importElement(message, *it, isSuccess, *myMidiBank, myHasMidiBank)) { - myHasPan = value; + continue; } - - - ElevationPtr MidiInstrument::getElevation() const + if (importElement(message, *it, isSuccess, *myMidiProgram, myHasMidiProgram)) { - return myElevation; + continue; } - - - void MidiInstrument::setElevation( const ElevationPtr& value ) + if (importElement(message, *it, isSuccess, *myMidiUnpitched, myHasMidiUnpitched)) { - if( value ) - { - myElevation = value; - } + continue; } - - - bool MidiInstrument::getHasElevation() const + if (importElement(message, *it, isSuccess, *myVolume, myHasVolume)) { - return myHasElevation; + continue; } - - - void MidiInstrument::setHasElevation( const bool value ) + if (importElement(message, *it, isSuccess, *myPan, myHasPan)) { - myHasElevation = value; + continue; } - - - bool MidiInstrument::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myElevation, myHasElevation)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMidiChannel, myHasMidiChannel ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiName, myHasMidiName ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiBank, myHasMidiBank ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiProgram, myHasMidiProgram ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiUnpitched, myHasMidiUnpitched ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myVolume, myHasVolume ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPan, myHasPan ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myElevation, myHasElevation ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiInstrument.h b/Sourcecode/private/mx/core/elements/MidiInstrument.h index 254cdc547..838a852e4 100644 --- a/Sourcecode/private/mx/core/elements/MidiInstrument.h +++ b/Sourcecode/private/mx/core/elements/MidiInstrument.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/MidiInstrumentAttributes.h" #include @@ -14,104 +14,107 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MidiInstrumentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Elevation ) - MX_FORWARD_DECLARE_ELEMENT( MidiBank ) - MX_FORWARD_DECLARE_ELEMENT( MidiChannel ) - MX_FORWARD_DECLARE_ELEMENT( MidiName ) - MX_FORWARD_DECLARE_ELEMENT( MidiProgram ) - MX_FORWARD_DECLARE_ELEMENT( MidiUnpitched ) - MX_FORWARD_DECLARE_ELEMENT( Pan ) - MX_FORWARD_DECLARE_ELEMENT( Volume ) - MX_FORWARD_DECLARE_ELEMENT( MidiInstrument ) - - inline MidiInstrumentPtr makeMidiInstrument() { return std::make_shared(); } - - class MidiInstrument : public ElementInterface - { - public: - MidiInstrument(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MidiInstrumentAttributesPtr getAttributes() const; - void setAttributes( const MidiInstrumentAttributesPtr& value ); - - /* _________ MidiChannel minOccurs = 0, maxOccurs = 1 _________ */ - MidiChannelPtr getMidiChannel() const; - void setMidiChannel( const MidiChannelPtr& value ); - bool getHasMidiChannel() const; - void setHasMidiChannel( const bool value ); - - /* _________ MidiName minOccurs = 0, maxOccurs = 1 _________ */ - MidiNamePtr getMidiName() const; - void setMidiName( const MidiNamePtr& value ); - bool getHasMidiName() const; - void setHasMidiName( const bool value ); - - /* _________ MidiBank minOccurs = 0, maxOccurs = 1 _________ */ - MidiBankPtr getMidiBank() const; - void setMidiBank( const MidiBankPtr& value ); - bool getHasMidiBank() const; - void setHasMidiBank( const bool value ); - - /* _________ MidiProgram minOccurs = 0, maxOccurs = 1 _________ */ - MidiProgramPtr getMidiProgram() const; - void setMidiProgram( const MidiProgramPtr& value ); - bool getHasMidiProgram() const; - void setHasMidiProgram( const bool value ); - - /* _________ MidiUnpitched minOccurs = 0, maxOccurs = 1 _________ */ - MidiUnpitchedPtr getMidiUnpitched() const; - void setMidiUnpitched( const MidiUnpitchedPtr& value ); - bool getHasMidiUnpitched() const; - void setHasMidiUnpitched( const bool value ); - - /* _________ Volume minOccurs = 0, maxOccurs = 1 _________ */ - VolumePtr getVolume() const; - void setVolume( const VolumePtr& value ); - bool getHasVolume() const; - void setHasVolume( const bool value ); - - /* _________ Pan minOccurs = 0, maxOccurs = 1 _________ */ - PanPtr getPan() const; - void setPan( const PanPtr& value ); - bool getHasPan() const; - void setHasPan( const bool value ); - - /* _________ Elevation minOccurs = 0, maxOccurs = 1 _________ */ - ElevationPtr getElevation() const; - void setElevation( const ElevationPtr& value ); - bool getHasElevation() const; - void setHasElevation( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MidiInstrumentAttributesPtr myAttributes; - MidiChannelPtr myMidiChannel; - bool myHasMidiChannel; - MidiNamePtr myMidiName; - bool myHasMidiName; - MidiBankPtr myMidiBank; - bool myHasMidiBank; - MidiProgramPtr myMidiProgram; - bool myHasMidiProgram; - MidiUnpitchedPtr myMidiUnpitched; - bool myHasMidiUnpitched; - VolumePtr myVolume; - bool myHasVolume; - PanPtr myPan; - bool myHasPan; - ElevationPtr myElevation; - bool myHasElevation; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MidiInstrumentAttributes) +MX_FORWARD_DECLARE_ELEMENT(Elevation) +MX_FORWARD_DECLARE_ELEMENT(MidiBank) +MX_FORWARD_DECLARE_ELEMENT(MidiChannel) +MX_FORWARD_DECLARE_ELEMENT(MidiName) +MX_FORWARD_DECLARE_ELEMENT(MidiProgram) +MX_FORWARD_DECLARE_ELEMENT(MidiUnpitched) +MX_FORWARD_DECLARE_ELEMENT(Pan) +MX_FORWARD_DECLARE_ELEMENT(Volume) +MX_FORWARD_DECLARE_ELEMENT(MidiInstrument) + +inline MidiInstrumentPtr makeMidiInstrument() +{ + return std::make_shared(); } + +class MidiInstrument : public ElementInterface +{ + public: + MidiInstrument(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MidiInstrumentAttributesPtr getAttributes() const; + void setAttributes(const MidiInstrumentAttributesPtr &value); + + /* _________ MidiChannel minOccurs = 0, maxOccurs = 1 _________ */ + MidiChannelPtr getMidiChannel() const; + void setMidiChannel(const MidiChannelPtr &value); + bool getHasMidiChannel() const; + void setHasMidiChannel(const bool value); + + /* _________ MidiName minOccurs = 0, maxOccurs = 1 _________ */ + MidiNamePtr getMidiName() const; + void setMidiName(const MidiNamePtr &value); + bool getHasMidiName() const; + void setHasMidiName(const bool value); + + /* _________ MidiBank minOccurs = 0, maxOccurs = 1 _________ */ + MidiBankPtr getMidiBank() const; + void setMidiBank(const MidiBankPtr &value); + bool getHasMidiBank() const; + void setHasMidiBank(const bool value); + + /* _________ MidiProgram minOccurs = 0, maxOccurs = 1 _________ */ + MidiProgramPtr getMidiProgram() const; + void setMidiProgram(const MidiProgramPtr &value); + bool getHasMidiProgram() const; + void setHasMidiProgram(const bool value); + + /* _________ MidiUnpitched minOccurs = 0, maxOccurs = 1 _________ */ + MidiUnpitchedPtr getMidiUnpitched() const; + void setMidiUnpitched(const MidiUnpitchedPtr &value); + bool getHasMidiUnpitched() const; + void setHasMidiUnpitched(const bool value); + + /* _________ Volume minOccurs = 0, maxOccurs = 1 _________ */ + VolumePtr getVolume() const; + void setVolume(const VolumePtr &value); + bool getHasVolume() const; + void setHasVolume(const bool value); + + /* _________ Pan minOccurs = 0, maxOccurs = 1 _________ */ + PanPtr getPan() const; + void setPan(const PanPtr &value); + bool getHasPan() const; + void setHasPan(const bool value); + + /* _________ Elevation minOccurs = 0, maxOccurs = 1 _________ */ + ElevationPtr getElevation() const; + void setElevation(const ElevationPtr &value); + bool getHasElevation() const; + void setHasElevation(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MidiInstrumentAttributesPtr myAttributes; + MidiChannelPtr myMidiChannel; + bool myHasMidiChannel; + MidiNamePtr myMidiName; + bool myHasMidiName; + MidiBankPtr myMidiBank; + bool myHasMidiBank; + MidiProgramPtr myMidiProgram; + bool myHasMidiProgram; + MidiUnpitchedPtr myMidiUnpitched; + bool myHasMidiUnpitched; + VolumePtr myVolume; + bool myHasVolume; + PanPtr myPan; + bool myHasPan; + ElevationPtr myElevation; + bool myHasElevation; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp b/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp index 25d88e611..356cbf9c9 100644 --- a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - MidiInstrumentAttributes::MidiInstrumentAttributes() - :id() - ,hasId( true ) - {} - +namespace core +{ +MidiInstrumentAttributes::MidiInstrumentAttributes() : id(), hasId(true) +{ +} - bool MidiInstrumentAttributes::hasValues() const - { - return hasId; - } +bool MidiInstrumentAttributes::hasValues() const +{ + return hasId; +} +std::ostream &MidiInstrumentAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, id, "id", hasId); + } + return os; +} - std::ostream& MidiInstrumentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } +bool MidiInstrumentAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MidiInstrumentAttributes"; + bool isSuccess = true; + bool isIdFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool MidiInstrumentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, id, isIdFound, "id")) { - const char* const className = "MidiInstrumentAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isIdFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h b/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h index a4f733d0f..dce2afca3 100644 --- a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h +++ b/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsIDREF.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MidiInstrumentAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MidiInstrumentAttributes) - struct MidiInstrumentAttributes : public AttributesInterface - { - public: - MidiInstrumentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsIDREF id; - const bool hasId; +struct MidiInstrumentAttributes : public AttributesInterface +{ + public: + MidiInstrumentAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsIDREF id; + const bool hasId; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiName.cpp b/Sourcecode/private/mx/core/elements/MidiName.cpp index 958c5ca36..2a09e32bc 100644 --- a/Sourcecode/private/mx/core/elements/MidiName.cpp +++ b/Sourcecode/private/mx/core/elements/MidiName.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - MidiName::MidiName() - :myValue() - {} - - - MidiName::MidiName( const XsString& value ) - :myValue( value ) - {} - - - bool MidiName::hasAttributes() const - { - return false; - } - - - bool MidiName::hasContents() const - { - return true; - } - - - std::ostream& MidiName::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiName::streamName( std::ostream& os ) const - { - os << "midi-name"; - return os; - } +namespace core +{ +MidiName::MidiName() : myValue() +{ +} +MidiName::MidiName(const XsString &value) : myValue(value) +{ +} - std::ostream& MidiName::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MidiName::hasAttributes() const +{ + return false; +} +bool MidiName::hasContents() const +{ + return true; +} - XsString MidiName::getValue() const - { - return myValue; - } +std::ostream &MidiName::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MidiName::streamName(std::ostream &os) const +{ + os << "midi-name"; + return os; +} - void MidiName::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &MidiName::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString MidiName::getValue() const +{ + return myValue; +} - bool MidiName::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void MidiName::setValue(const XsString &value) +{ + myValue = value; +} - } +bool MidiName::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiName.h b/Sourcecode/private/mx/core/elements/MidiName.h index 6d0a585c8..671d3343f 100644 --- a/Sourcecode/private/mx/core/elements/MidiName.h +++ b/Sourcecode/private/mx/core/elements/MidiName.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,33 +14,44 @@ namespace mx { - namespace core - { - MX_FORWARD_DECLARE_ELEMENT( MidiName ) - - inline MidiNamePtr makeMidiName() { return std::make_shared(); } - inline MidiNamePtr makeMidiName( const XsString& value ) { return std::make_shared( value ); } - inline MidiNamePtr makeMidiName( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiName : public ElementInterface - { - public: - MidiName(); - MidiName( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ +MX_FORWARD_DECLARE_ELEMENT(MidiName) + +inline MidiNamePtr makeMidiName() +{ + return std::make_shared(); } + +inline MidiNamePtr makeMidiName(const XsString &value) +{ + return std::make_shared(value); +} + +inline MidiNamePtr makeMidiName(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class MidiName : public ElementInterface +{ + public: + MidiName(); + MidiName(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiProgram.cpp b/Sourcecode/private/mx/core/elements/MidiProgram.cpp index 15868e2da..4282888d4 100644 --- a/Sourcecode/private/mx/core/elements/MidiProgram.cpp +++ b/Sourcecode/private/mx/core/elements/MidiProgram.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - MidiProgram::MidiProgram() - :myValue() - {} - - - MidiProgram::MidiProgram( const Midi128& value ) - :myValue( value ) - {} - - - bool MidiProgram::hasAttributes() const - { - return false; - } - - - bool MidiProgram::hasContents() const - { - return true; - } - - - std::ostream& MidiProgram::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiProgram::streamName( std::ostream& os ) const - { - os << "midi-program"; - return os; - } +namespace core +{ +MidiProgram::MidiProgram() : myValue() +{ +} +MidiProgram::MidiProgram(const Midi128 &value) : myValue(value) +{ +} - std::ostream& MidiProgram::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MidiProgram::hasAttributes() const +{ + return false; +} +bool MidiProgram::hasContents() const +{ + return true; +} - Midi128 MidiProgram::getValue() const - { - return myValue; - } +std::ostream &MidiProgram::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MidiProgram::streamName(std::ostream &os) const +{ + os << "midi-program"; + return os; +} - void MidiProgram::setValue( const Midi128& value ) - { - myValue = value; - } +std::ostream &MidiProgram::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Midi128 MidiProgram::getValue() const +{ + return myValue; +} - bool MidiProgram::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void MidiProgram::setValue(const Midi128 &value) +{ + myValue = value; +} - } +bool MidiProgram::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiProgram.h b/Sourcecode/private/mx/core/elements/MidiProgram.h index 0eb4dcf77..4fcbc489b 100644 --- a/Sourcecode/private/mx/core/elements/MidiProgram.h +++ b/Sourcecode/private/mx/core/elements/MidiProgram.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiProgram ) - - inline MidiProgramPtr makeMidiProgram() { return std::make_shared(); } - inline MidiProgramPtr makeMidiProgram( const Midi128& value ) { return std::make_shared( value ); } - inline MidiProgramPtr makeMidiProgram( Midi128&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiProgram : public ElementInterface - { - public: - MidiProgram(); - MidiProgram( const Midi128& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Midi128 getValue() const; - void setValue( const Midi128& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Midi128 myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MidiProgram) + +inline MidiProgramPtr makeMidiProgram() +{ + return std::make_shared(); +} + +inline MidiProgramPtr makeMidiProgram(const Midi128 &value) +{ + return std::make_shared(value); } + +inline MidiProgramPtr makeMidiProgram(Midi128 &&value) +{ + return std::make_shared(std::move(value)); +} + +class MidiProgram : public ElementInterface +{ + public: + MidiProgram(); + MidiProgram(const Midi128 &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Midi128 getValue() const; + void setValue(const Midi128 &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Midi128 myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiUnpitched.cpp b/Sourcecode/private/mx/core/elements/MidiUnpitched.cpp index 6cb3e589e..9b9a78992 100644 --- a/Sourcecode/private/mx/core/elements/MidiUnpitched.cpp +++ b/Sourcecode/private/mx/core/elements/MidiUnpitched.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - MidiUnpitched::MidiUnpitched() - :myValue() - {} - - - MidiUnpitched::MidiUnpitched( const Midi128& value ) - :myValue( value ) - {} - - - bool MidiUnpitched::hasAttributes() const - { - return false; - } - - - bool MidiUnpitched::hasContents() const - { - return true; - } - - - std::ostream& MidiUnpitched::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiUnpitched::streamName( std::ostream& os ) const - { - os << "midi-unpitched"; - return os; - } +namespace core +{ +MidiUnpitched::MidiUnpitched() : myValue() +{ +} +MidiUnpitched::MidiUnpitched(const Midi128 &value) : myValue(value) +{ +} - std::ostream& MidiUnpitched::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MidiUnpitched::hasAttributes() const +{ + return false; +} +bool MidiUnpitched::hasContents() const +{ + return true; +} - Midi128 MidiUnpitched::getValue() const - { - return myValue; - } +std::ostream &MidiUnpitched::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MidiUnpitched::streamName(std::ostream &os) const +{ + os << "midi-unpitched"; + return os; +} - void MidiUnpitched::setValue( const Midi128& value ) - { - myValue = value; - } +std::ostream &MidiUnpitched::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Midi128 MidiUnpitched::getValue() const +{ + return myValue; +} - bool MidiUnpitched::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void MidiUnpitched::setValue(const Midi128 &value) +{ + myValue = value; +} - } +bool MidiUnpitched::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MidiUnpitched.h b/Sourcecode/private/mx/core/elements/MidiUnpitched.h index 43481e38f..431946cca 100644 --- a/Sourcecode/private/mx/core/elements/MidiUnpitched.h +++ b/Sourcecode/private/mx/core/elements/MidiUnpitched.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiUnpitched ) - - inline MidiUnpitchedPtr makeMidiUnpitched() { return std::make_shared(); } - inline MidiUnpitchedPtr makeMidiUnpitched( const Midi128& value ) { return std::make_shared( value ); } - inline MidiUnpitchedPtr makeMidiUnpitched( Midi128&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiUnpitched : public ElementInterface - { - public: - MidiUnpitched(); - MidiUnpitched( const Midi128& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Midi128 getValue() const; - void setValue( const Midi128& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Midi128 myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MidiUnpitched) + +inline MidiUnpitchedPtr makeMidiUnpitched() +{ + return std::make_shared(); +} + +inline MidiUnpitchedPtr makeMidiUnpitched(const Midi128 &value) +{ + return std::make_shared(value); } + +inline MidiUnpitchedPtr makeMidiUnpitched(Midi128 &&value) +{ + return std::make_shared(std::move(value)); +} + +class MidiUnpitched : public ElementInterface +{ + public: + MidiUnpitched(); + MidiUnpitched(const Midi128 &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Midi128 getValue() const; + void setValue(const Midi128 &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Midi128 myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Millimeters.cpp b/Sourcecode/private/mx/core/elements/Millimeters.cpp index ac2b0d40f..1eab88872 100644 --- a/Sourcecode/private/mx/core/elements/Millimeters.cpp +++ b/Sourcecode/private/mx/core/elements/Millimeters.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Millimeters::Millimeters() - :myValue() - {} - - - Millimeters::Millimeters( const MillimetersValue& value ) - :myValue( value ) - {} - - - bool Millimeters::hasAttributes() const - { - return false; - } - - - bool Millimeters::hasContents() const - { - return true; - } - - - std::ostream& Millimeters::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Millimeters::streamName( std::ostream& os ) const - { - os << "millimeters"; - return os; - } +namespace core +{ +Millimeters::Millimeters() : myValue() +{ +} +Millimeters::Millimeters(const MillimetersValue &value) : myValue(value) +{ +} - std::ostream& Millimeters::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Millimeters::hasAttributes() const +{ + return false; +} +bool Millimeters::hasContents() const +{ + return true; +} - MillimetersValue Millimeters::getValue() const - { - return myValue; - } +std::ostream &Millimeters::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Millimeters::streamName(std::ostream &os) const +{ + os << "millimeters"; + return os; +} - void Millimeters::setValue( const MillimetersValue& value ) - { - myValue = value; - } +std::ostream &Millimeters::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MillimetersValue Millimeters::getValue() const +{ + return myValue; +} - bool Millimeters::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Millimeters::setValue(const MillimetersValue &value) +{ + myValue = value; +} - } +bool Millimeters::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Millimeters.h b/Sourcecode/private/mx/core/elements/Millimeters.h index ffd3b9770..4676a17ea 100644 --- a/Sourcecode/private/mx/core/elements/Millimeters.h +++ b/Sourcecode/private/mx/core/elements/Millimeters.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Millimeters ) - - inline MillimetersPtr makeMillimeters() { return std::make_shared(); } - inline MillimetersPtr makeMillimeters( const MillimetersValue& value ) { return std::make_shared( value ); } - inline MillimetersPtr makeMillimeters( MillimetersValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Millimeters : public ElementInterface - { - public: - Millimeters(); - Millimeters( const MillimetersValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MillimetersValue getValue() const; - void setValue( const MillimetersValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MillimetersValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Millimeters) + +inline MillimetersPtr makeMillimeters() +{ + return std::make_shared(); } + +inline MillimetersPtr makeMillimeters(const MillimetersValue &value) +{ + return std::make_shared(value); +} + +inline MillimetersPtr makeMillimeters(MillimetersValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Millimeters : public ElementInterface +{ + public: + Millimeters(); + Millimeters(const MillimetersValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MillimetersValue getValue() const; + void setValue(const MillimetersValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MillimetersValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Miscellaneous.cpp b/Sourcecode/private/mx/core/elements/Miscellaneous.cpp index 1803e604d..1de4aed45 100644 --- a/Sourcecode/private/mx/core/elements/Miscellaneous.cpp +++ b/Sourcecode/private/mx/core/elements/Miscellaneous.cpp @@ -9,110 +9,99 @@ namespace mx { - namespace core - { - Miscellaneous::Miscellaneous() - :myMiscellaneousFieldSet() - {} - - - bool Miscellaneous::hasAttributes() const - { - return false; - } - - - std::ostream& Miscellaneous::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Miscellaneous::streamName( std::ostream& os ) const - { - os << "miscellaneous"; - return os; - } - - - bool Miscellaneous::hasContents() const - { - return myMiscellaneousFieldSet.size() > 0; - } - - - std::ostream& Miscellaneous::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for( auto x : myMiscellaneousFieldSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( hasContents() ) - { - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - const MiscellaneousFieldSet& Miscellaneous::getMiscellaneousFieldSet() const - { - return myMiscellaneousFieldSet; - } - +namespace core +{ +Miscellaneous::Miscellaneous() : myMiscellaneousFieldSet() +{ +} - void Miscellaneous::removeMiscellaneousField( const MiscellaneousFieldSetIterConst& value ) - { - if ( value != myMiscellaneousFieldSet.cend() ) - { - myMiscellaneousFieldSet.erase( value ); - } - } +bool Miscellaneous::hasAttributes() const +{ + return false; +} +std::ostream &Miscellaneous::streamAttributes(std::ostream &os) const +{ + return os; +} - void Miscellaneous::addMiscellaneousField( const MiscellaneousFieldPtr& value ) - { - if ( value ) - { - myMiscellaneousFieldSet.push_back( value ); - } - } +std::ostream &Miscellaneous::streamName(std::ostream &os) const +{ + os << "miscellaneous"; + return os; +} +bool Miscellaneous::hasContents() const +{ + return myMiscellaneousFieldSet.size() > 0; +} - void Miscellaneous::clearMiscellaneousFieldSet() - { - myMiscellaneousFieldSet.clear(); - } +std::ostream &Miscellaneous::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto x : myMiscellaneousFieldSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + if (hasContents()) + { + isOneLineOnly = false; + os << std::endl; + } + else + { + isOneLineOnly = true; + } + return os; +} +const MiscellaneousFieldSet &Miscellaneous::getMiscellaneousFieldSet() const +{ + return myMiscellaneousFieldSet; +} - MiscellaneousFieldPtr Miscellaneous::getMiscellaneousField( const MiscellaneousFieldSetIterConst& setIterator ) const - { - if( setIterator != myMiscellaneousFieldSet.cend() ) - { - return *setIterator; - } - return MiscellaneousFieldPtr(); - } +void Miscellaneous::removeMiscellaneousField(const MiscellaneousFieldSetIterConst &value) +{ + if (value != myMiscellaneousFieldSet.cend()) + { + myMiscellaneousFieldSet.erase(value); + } +} +void Miscellaneous::addMiscellaneousField(const MiscellaneousFieldPtr &value) +{ + if (value) + { + myMiscellaneousFieldSet.push_back(value); + } +} - bool Miscellaneous::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; +void Miscellaneous::clearMiscellaneousFieldSet() +{ + myMiscellaneousFieldSet.clear(); +} - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "miscellaneous-field", myMiscellaneousFieldSet ); - } +MiscellaneousFieldPtr Miscellaneous::getMiscellaneousField(const MiscellaneousFieldSetIterConst &setIterator) const +{ + if (setIterator != myMiscellaneousFieldSet.cend()) + { + return *setIterator; + } + return MiscellaneousFieldPtr(); +} - MX_RETURN_IS_SUCCESS; - } +bool Miscellaneous::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importElementSet(message, it, endIter, isSuccess, "miscellaneous-field", myMiscellaneousFieldSet); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Miscellaneous.h b/Sourcecode/private/mx/core/elements/Miscellaneous.h index 9972c3444..4d1e64993 100644 --- a/Sourcecode/private/mx/core/elements/Miscellaneous.h +++ b/Sourcecode/private/mx/core/elements/Miscellaneous.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,37 +13,40 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MiscellaneousField ) - MX_FORWARD_DECLARE_ELEMENT( Miscellaneous ) - - inline MiscellaneousPtr makeMiscellaneous() { return std::make_shared(); } - - class Miscellaneous : public ElementInterface - { - public: - Miscellaneous(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MiscellaneousField minOccurs = 0, maxOccurs = unbounded _________ */ - const MiscellaneousFieldSet& getMiscellaneousFieldSet() const; - void addMiscellaneousField( const MiscellaneousFieldPtr& value ); - void removeMiscellaneousField( const MiscellaneousFieldSetIterConst& value ); - void clearMiscellaneousFieldSet(); - MiscellaneousFieldPtr getMiscellaneousField( const MiscellaneousFieldSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MiscellaneousFieldSet myMiscellaneousFieldSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MiscellaneousField) +MX_FORWARD_DECLARE_ELEMENT(Miscellaneous) + +inline MiscellaneousPtr makeMiscellaneous() +{ + return std::make_shared(); } + +class Miscellaneous : public ElementInterface +{ + public: + Miscellaneous(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ MiscellaneousField minOccurs = 0, maxOccurs = unbounded _________ */ + const MiscellaneousFieldSet &getMiscellaneousFieldSet() const; + void addMiscellaneousField(const MiscellaneousFieldPtr &value); + void removeMiscellaneousField(const MiscellaneousFieldSetIterConst &value); + void clearMiscellaneousFieldSet(); + MiscellaneousFieldPtr getMiscellaneousField(const MiscellaneousFieldSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MiscellaneousFieldSet myMiscellaneousFieldSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousField.cpp b/Sourcecode/private/mx/core/elements/MiscellaneousField.cpp index 87d698bea..dcfebd1d4 100644 --- a/Sourcecode/private/mx/core/elements/MiscellaneousField.cpp +++ b/Sourcecode/private/mx/core/elements/MiscellaneousField.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - MiscellaneousField::MiscellaneousField() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - MiscellaneousField::MiscellaneousField( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MiscellaneousField::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MiscellaneousField::hasContents() const - { - return true; - } - - - std::ostream& MiscellaneousField::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MiscellaneousField::streamName( std::ostream& os ) const - { - os << "miscellaneous-field"; - return os; - } - - - std::ostream& MiscellaneousField::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +MiscellaneousField::MiscellaneousField() : myValue(), myAttributes(std::make_shared()) +{ +} +MiscellaneousField::MiscellaneousField(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - MiscellaneousFieldAttributesPtr MiscellaneousField::getAttributes() const - { - return myAttributes; - } +bool MiscellaneousField::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool MiscellaneousField::hasContents() const +{ + return true; +} - void MiscellaneousField::setAttributes( const MiscellaneousFieldAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MiscellaneousField::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &MiscellaneousField::streamName(std::ostream &os) const +{ + os << "miscellaneous-field"; + return os; +} - XsString MiscellaneousField::getValue() const - { - return myValue; - } +std::ostream &MiscellaneousField::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MiscellaneousFieldAttributesPtr MiscellaneousField::getAttributes() const +{ + return myAttributes; +} - void MiscellaneousField::setValue( const XsString& value ) - { - myValue = value; - } +void MiscellaneousField::setAttributes(const MiscellaneousFieldAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString MiscellaneousField::getValue() const +{ + return myValue; +} - bool MiscellaneousField::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void MiscellaneousField::setValue(const XsString &value) +{ + myValue = value; +} - } +bool MiscellaneousField::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousField.h b/Sourcecode/private/mx/core/elements/MiscellaneousField.h index a4050cd2e..9efba00a4 100644 --- a/Sourcecode/private/mx/core/elements/MiscellaneousField.h +++ b/Sourcecode/private/mx/core/elements/MiscellaneousField.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/MiscellaneousFieldAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MiscellaneousFieldAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MiscellaneousField ) - - inline MiscellaneousFieldPtr makeMiscellaneousField() { return std::make_shared(); } - inline MiscellaneousFieldPtr makeMiscellaneousField( const XsString& value ) { return std::make_shared( value ); } - inline MiscellaneousFieldPtr makeMiscellaneousField( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MiscellaneousField : public ElementInterface - { - public: - MiscellaneousField(); - MiscellaneousField( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MiscellaneousFieldAttributesPtr getAttributes() const; - void setAttributes( const MiscellaneousFieldAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - MiscellaneousFieldAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MiscellaneousFieldAttributes) +MX_FORWARD_DECLARE_ELEMENT(MiscellaneousField) + +inline MiscellaneousFieldPtr makeMiscellaneousField() +{ + return std::make_shared(); +} + +inline MiscellaneousFieldPtr makeMiscellaneousField(const XsString &value) +{ + return std::make_shared(value); } + +inline MiscellaneousFieldPtr makeMiscellaneousField(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class MiscellaneousField : public ElementInterface +{ + public: + MiscellaneousField(); + MiscellaneousField(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MiscellaneousFieldAttributesPtr getAttributes() const; + void setAttributes(const MiscellaneousFieldAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + MiscellaneousFieldAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp b/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp index 7d547f4ad..adeeb8664 100644 --- a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - MiscellaneousFieldAttributes::MiscellaneousFieldAttributes() - :name() - ,hasName( true ) - {} - +namespace core +{ +MiscellaneousFieldAttributes::MiscellaneousFieldAttributes() : name(), hasName(true) +{ +} - bool MiscellaneousFieldAttributes::hasValues() const - { - return hasName; - } +bool MiscellaneousFieldAttributes::hasValues() const +{ + return hasName; +} +std::ostream &MiscellaneousFieldAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, name, "name", hasName); + } + return os; +} - std::ostream& MiscellaneousFieldAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, name, "name", hasName ); - } - return os; - } +bool MiscellaneousFieldAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MiscellaneousFieldAttributes"; + bool isSuccess = true; + bool isNameFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool MiscellaneousFieldAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, name, isNameFound, "name")) { - const char* const className = "MiscellaneousFieldAttributes"; - bool isSuccess = true; - bool isNameFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, name, isNameFound, "name" ) ) { continue; } - } - - if( !isNameFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isNameFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h b/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h index b565c35d7..a9846a906 100644 --- a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h +++ b/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MiscellaneousFieldAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MiscellaneousFieldAttributes) - struct MiscellaneousFieldAttributes : public AttributesInterface - { - public: - MiscellaneousFieldAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken name; - const bool hasName; +struct MiscellaneousFieldAttributes : public AttributesInterface +{ + public: + MiscellaneousFieldAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken name; + const bool hasName; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Mode.cpp b/Sourcecode/private/mx/core/elements/Mode.cpp index f25e27105..112d7a02a 100644 --- a/Sourcecode/private/mx/core/elements/Mode.cpp +++ b/Sourcecode/private/mx/core/elements/Mode.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Mode::Mode() - :myValue() - {} - - - Mode::Mode( const ModeValue& value ) - :myValue( value ) - {} - - - bool Mode::hasAttributes() const - { - return false; - } - - - bool Mode::hasContents() const - { - return true; - } - - - std::ostream& Mode::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Mode::streamName( std::ostream& os ) const - { - os << "mode"; - return os; - } +namespace core +{ +Mode::Mode() : myValue() +{ +} +Mode::Mode(const ModeValue &value) : myValue(value) +{ +} - std::ostream& Mode::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Mode::hasAttributes() const +{ + return false; +} +bool Mode::hasContents() const +{ + return true; +} - ModeValue Mode::getValue() const - { - return myValue; - } +std::ostream &Mode::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Mode::streamName(std::ostream &os) const +{ + os << "mode"; + return os; +} - void Mode::setValue( const ModeValue& value ) - { - myValue = value; - } +std::ostream &Mode::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +ModeValue Mode::getValue() const +{ + return myValue; +} - bool Mode::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void Mode::setValue(const ModeValue &value) +{ + myValue = value; +} - } +bool Mode::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Mode.h b/Sourcecode/private/mx/core/elements/Mode.h index 812a474a0..23e6f83f4 100644 --- a/Sourcecode/private/mx/core/elements/Mode.h +++ b/Sourcecode/private/mx/core/elements/Mode.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Mode ) - - inline ModePtr makeMode() { return std::make_shared(); } - inline ModePtr makeMode( const ModeValue& value ) { return std::make_shared( value ); } - inline ModePtr makeMode( ModeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Mode : public ElementInterface - { - public: - Mode(); - Mode( const ModeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ModeValue getValue() const; - void setValue( const ModeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ModeValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Mode) + +inline ModePtr makeMode() +{ + return std::make_shared(); +} + +inline ModePtr makeMode(const ModeValue &value) +{ + return std::make_shared(value); } + +inline ModePtr makeMode(ModeValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Mode : public ElementInterface +{ + public: + Mode(); + Mode(const ModeValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ModeValue getValue() const; + void setValue(const ModeValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ModeValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Mordent.cpp b/Sourcecode/private/mx/core/elements/Mordent.cpp index 41bee3a75..1c0ef0396 100644 --- a/Sourcecode/private/mx/core/elements/Mordent.cpp +++ b/Sourcecode/private/mx/core/elements/Mordent.cpp @@ -8,65 +8,57 @@ namespace mx { - namespace core - { - Mordent::Mordent() - :myAttributes( std::make_shared() ) - {} - - - bool Mordent::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Mordent::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Mordent::streamName( std::ostream& os ) const - { - os << "mordent"; - return os; - } - - - bool Mordent::hasContents() const - { - return false; - } - - - std::ostream& Mordent::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Mordent::Mordent() : myAttributes(std::make_shared()) +{ +} +bool Mordent::hasAttributes() const +{ + return myAttributes->hasValues(); +} - MordentAttributesPtr Mordent::getAttributes() const - { - return myAttributes; - } +std::ostream &Mordent::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Mordent::streamName(std::ostream &os) const +{ + os << "mordent"; + return os; +} - void Mordent::setAttributes( const MordentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool Mordent::hasContents() const +{ + return false; +} +std::ostream &Mordent::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Mordent::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +MordentAttributesPtr Mordent::getAttributes() const +{ + return myAttributes; +} +void Mordent::setAttributes(const MordentAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Mordent::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Mordent.h b/Sourcecode/private/mx/core/elements/Mordent.h index a1bfcda55..73fc5c4ac 100644 --- a/Sourcecode/private/mx/core/elements/Mordent.h +++ b/Sourcecode/private/mx/core/elements/Mordent.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/MordentAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MordentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Mordent ) - - inline MordentPtr makeMordent() { return std::make_shared(); } - - class Mordent : public ElementInterface - { - public: - Mordent(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MordentAttributesPtr getAttributes() const; - void setAttributes( const MordentAttributesPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MordentAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MordentAttributes) +MX_FORWARD_DECLARE_ELEMENT(Mordent) + +inline MordentPtr makeMordent() +{ + return std::make_shared(); } + +class Mordent : public ElementInterface +{ + public: + Mordent(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MordentAttributesPtr getAttributes() const; + void setAttributes(const MordentAttributesPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MordentAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MordentAttributes.cpp b/Sourcecode/private/mx/core/elements/MordentAttributes.cpp index 7871c547a..c92e836d2 100644 --- a/Sourcecode/private/mx/core/elements/MordentAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MordentAttributes.cpp @@ -8,141 +8,151 @@ namespace mx { - namespace core - { - MordentAttributes::MordentAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep( TrillStep::half ) - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,long_( YesNo::no ) - ,approach( AboveBelow::below ) - ,departure( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasLong( false ) - ,hasApproach( false ) - ,hasDeparture( false ) - {} - +namespace core +{ +MordentAttributes::MordentAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), placement(AboveBelow::below), + startNote(StartNote::main), trillStep(TrillStep::half), twoNoteTurn(TwoNoteTurn::none), accelerate(YesNo::no), + beats(), secondBeat(), lastBeat(), long_(YesNo::no), approach(AboveBelow::below), departure(AboveBelow::below), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasPlacement(false), + hasStartNote(false), hasTrillStep(false), hasTwoNoteTurn(false), hasAccelerate(false), hasBeats(false), + hasSecondBeat(false), hasLastBeat(false), hasLong(false), hasApproach(false), hasDeparture(false) +{ +} - bool MordentAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasLong || - hasApproach || - hasDeparture; - } +bool MordentAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPlacement || hasStartNote || hasTrillStep || hasTwoNoteTurn || + hasAccelerate || hasBeats || hasSecondBeat || hasLastBeat || hasLong || hasApproach || hasDeparture; +} +std::ostream &MordentAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, startNote, "start-note", hasStartNote); + streamAttribute(os, trillStep, "trill-step", hasTrillStep); + streamAttribute(os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn); + streamAttribute(os, accelerate, "accelerate", hasAccelerate); + streamAttribute(os, beats, "beats", hasBeats); + streamAttribute(os, secondBeat, "second-beat", hasSecondBeat); + streamAttribute(os, lastBeat, "last-beat", hasLastBeat); + streamAttribute(os, long_, "long", hasLong); + streamAttribute(os, approach, "approach", hasApproach); + streamAttribute(os, departure, "departure", hasDeparture); + } + return os; +} - std::ostream& MordentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, long_, "long", hasLong ); - streamAttribute( os, approach, "approach", hasApproach ); - streamAttribute( os, departure, "departure", hasDeparture ); - } - return os; - } +bool MordentAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MordentAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool MordentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MordentAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, long_, hasLong , "long", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, approach, hasApproach, "approach", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, departure, hasDeparture, "departure", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", + &parseTwoNoteTurn)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, beats, hasBeats, "beats")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, long_, hasLong, "long", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, approach, hasApproach, "approach", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, departure, hasDeparture, "departure", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MordentAttributes.h b/Sourcecode/private/mx/core/elements/MordentAttributes.h index 7b0d8b82c..68ff58d09 100644 --- a/Sourcecode/private/mx/core/elements/MordentAttributes.h +++ b/Sourcecode/private/mx/core/elements/MordentAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,60 +18,60 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MordentAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MordentAttributes) - struct MordentAttributes : public AttributesInterface - { - public: - MordentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo long_; - AboveBelow approach; - AboveBelow departure; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasLong; - bool hasApproach; - bool hasDeparture; +struct MordentAttributes : public AttributesInterface +{ + public: + MordentAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + StartNote startNote; + TrillStep trillStep; + TwoNoteTurn twoNoteTurn; + YesNo accelerate; + TrillBeats beats; + Percent secondBeat; + Percent lastBeat; + YesNo long_; + AboveBelow approach; + AboveBelow departure; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; + bool hasStartNote; + bool hasTrillStep; + bool hasTwoNoteTurn; + bool hasAccelerate; + bool hasBeats; + bool hasSecondBeat; + bool hasLastBeat; + bool hasLong; + bool hasApproach; + bool hasDeparture; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MovementNumber.cpp b/Sourcecode/private/mx/core/elements/MovementNumber.cpp index 08d8ada7e..802ab6ab2 100644 --- a/Sourcecode/private/mx/core/elements/MovementNumber.cpp +++ b/Sourcecode/private/mx/core/elements/MovementNumber.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - MovementNumber::MovementNumber() - :myValue() - {} - - - MovementNumber::MovementNumber( const XsString& value ) - :myValue( value ) - {} - - - bool MovementNumber::hasAttributes() const - { - return false; - } - - - bool MovementNumber::hasContents() const - { - return true; - } - - - std::ostream& MovementNumber::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MovementNumber::streamName( std::ostream& os ) const - { - os << "movement-number"; - return os; - } +namespace core +{ +MovementNumber::MovementNumber() : myValue() +{ +} +MovementNumber::MovementNumber(const XsString &value) : myValue(value) +{ +} - std::ostream& MovementNumber::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MovementNumber::hasAttributes() const +{ + return false; +} +bool MovementNumber::hasContents() const +{ + return true; +} - XsString MovementNumber::getValue() const - { - return myValue; - } +std::ostream &MovementNumber::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MovementNumber::streamName(std::ostream &os) const +{ + os << "movement-number"; + return os; +} - void MovementNumber::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &MovementNumber::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString MovementNumber::getValue() const +{ + return myValue; +} - bool MovementNumber::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void MovementNumber::setValue(const XsString &value) +{ + myValue = value; +} - } +bool MovementNumber::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MovementNumber.h b/Sourcecode/private/mx/core/elements/MovementNumber.h index 776713e26..105448776 100644 --- a/Sourcecode/private/mx/core/elements/MovementNumber.h +++ b/Sourcecode/private/mx/core/elements/MovementNumber.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MovementNumber ) - - inline MovementNumberPtr makeMovementNumber() { return std::make_shared(); } - inline MovementNumberPtr makeMovementNumber( const XsString& value ) { return std::make_shared( value ); } - inline MovementNumberPtr makeMovementNumber( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MovementNumber : public ElementInterface - { - public: - MovementNumber(); - MovementNumber( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MovementNumber) + +inline MovementNumberPtr makeMovementNumber() +{ + return std::make_shared(); +} + +inline MovementNumberPtr makeMovementNumber(const XsString &value) +{ + return std::make_shared(value); } + +inline MovementNumberPtr makeMovementNumber(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class MovementNumber : public ElementInterface +{ + public: + MovementNumber(); + MovementNumber(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MovementTitle.cpp b/Sourcecode/private/mx/core/elements/MovementTitle.cpp index aa9a87763..0cb3e59c3 100644 --- a/Sourcecode/private/mx/core/elements/MovementTitle.cpp +++ b/Sourcecode/private/mx/core/elements/MovementTitle.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - MovementTitle::MovementTitle() - :myValue() - {} - - - MovementTitle::MovementTitle( const XsString& value ) - :myValue( value ) - {} - - - bool MovementTitle::hasAttributes() const - { - return false; - } - - - bool MovementTitle::hasContents() const - { - return true; - } - - - std::ostream& MovementTitle::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MovementTitle::streamName( std::ostream& os ) const - { - os << "movement-title"; - return os; - } +namespace core +{ +MovementTitle::MovementTitle() : myValue() +{ +} +MovementTitle::MovementTitle(const XsString &value) : myValue(value) +{ +} - std::ostream& MovementTitle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool MovementTitle::hasAttributes() const +{ + return false; +} +bool MovementTitle::hasContents() const +{ + return true; +} - XsString MovementTitle::getValue() const - { - return myValue; - } +std::ostream &MovementTitle::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &MovementTitle::streamName(std::ostream &os) const +{ + os << "movement-title"; + return os; +} - void MovementTitle::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &MovementTitle::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString MovementTitle::getValue() const +{ + return myValue; +} - bool MovementTitle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void MovementTitle::setValue(const XsString &value) +{ + myValue = value; +} - } +bool MovementTitle::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MovementTitle.h b/Sourcecode/private/mx/core/elements/MovementTitle.h index 0a8e62bf1..8041fbe58 100644 --- a/Sourcecode/private/mx/core/elements/MovementTitle.h +++ b/Sourcecode/private/mx/core/elements/MovementTitle.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MovementTitle ) - - inline MovementTitlePtr makeMovementTitle() { return std::make_shared(); } - inline MovementTitlePtr makeMovementTitle( const XsString& value ) { return std::make_shared( value ); } - inline MovementTitlePtr makeMovementTitle( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MovementTitle : public ElementInterface - { - public: - MovementTitle(); - MovementTitle( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MovementTitle) + +inline MovementTitlePtr makeMovementTitle() +{ + return std::make_shared(); +} + +inline MovementTitlePtr makeMovementTitle(const XsString &value) +{ + return std::make_shared(value); } + +inline MovementTitlePtr makeMovementTitle(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class MovementTitle : public ElementInterface +{ + public: + MovementTitle(); + MovementTitle(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MultipleRest.cpp b/Sourcecode/private/mx/core/elements/MultipleRest.cpp index a428d3e9e..0be7c5606 100644 --- a/Sourcecode/private/mx/core/elements/MultipleRest.cpp +++ b/Sourcecode/private/mx/core/elements/MultipleRest.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - MultipleRest::MultipleRest() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - MultipleRest::MultipleRest( const PositiveIntegerOrEmpty& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MultipleRest::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MultipleRest::hasContents() const - { - return true; - } - - - std::ostream& MultipleRest::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MultipleRest::streamName( std::ostream& os ) const - { - os << "multiple-rest"; - return os; - } - - - std::ostream& MultipleRest::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +MultipleRest::MultipleRest() : myValue(), myAttributes(std::make_shared()) +{ +} +MultipleRest::MultipleRest(const PositiveIntegerOrEmpty &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - MultipleRestAttributesPtr MultipleRest::getAttributes() const - { - return myAttributes; - } +bool MultipleRest::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool MultipleRest::hasContents() const +{ + return true; +} - void MultipleRest::setAttributes( const MultipleRestAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MultipleRest::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &MultipleRest::streamName(std::ostream &os) const +{ + os << "multiple-rest"; + return os; +} - PositiveIntegerOrEmpty MultipleRest::getValue() const - { - return myValue; - } +std::ostream &MultipleRest::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MultipleRestAttributesPtr MultipleRest::getAttributes() const +{ + return myAttributes; +} - void MultipleRest::setValue( const PositiveIntegerOrEmpty& value ) - { - myValue = value; - } +void MultipleRest::setAttributes(const MultipleRestAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +PositiveIntegerOrEmpty MultipleRest::getValue() const +{ + return myValue; +} - bool MultipleRest::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void MultipleRest::setValue(const PositiveIntegerOrEmpty &value) +{ + myValue = value; +} - } +bool MultipleRest::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MultipleRest.h b/Sourcecode/private/mx/core/elements/MultipleRest.h index 66ee8bd94..7aec88273 100644 --- a/Sourcecode/private/mx/core/elements/MultipleRest.h +++ b/Sourcecode/private/mx/core/elements/MultipleRest.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/PositiveIntegerOrEmpty.h" #include "mx/core/elements/MultipleRestAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MultipleRestAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MultipleRest ) - - inline MultipleRestPtr makeMultipleRest() { return std::make_shared(); } - inline MultipleRestPtr makeMultipleRest( const PositiveIntegerOrEmpty& value ) { return std::make_shared( value ); } - inline MultipleRestPtr makeMultipleRest( PositiveIntegerOrEmpty&& value ) { return std::make_shared( std::move( value ) ); } - - class MultipleRest : public ElementInterface - { - public: - MultipleRest(); - MultipleRest( const PositiveIntegerOrEmpty& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MultipleRestAttributesPtr getAttributes() const; - void setAttributes( const MultipleRestAttributesPtr& attributes ); - PositiveIntegerOrEmpty getValue() const; - void setValue( const PositiveIntegerOrEmpty& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveIntegerOrEmpty myValue; - MultipleRestAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MultipleRestAttributes) +MX_FORWARD_DECLARE_ELEMENT(MultipleRest) + +inline MultipleRestPtr makeMultipleRest() +{ + return std::make_shared(); +} + +inline MultipleRestPtr makeMultipleRest(const PositiveIntegerOrEmpty &value) +{ + return std::make_shared(value); } + +inline MultipleRestPtr makeMultipleRest(PositiveIntegerOrEmpty &&value) +{ + return std::make_shared(std::move(value)); +} + +class MultipleRest : public ElementInterface +{ + public: + MultipleRest(); + MultipleRest(const PositiveIntegerOrEmpty &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MultipleRestAttributesPtr getAttributes() const; + void setAttributes(const MultipleRestAttributesPtr &attributes); + PositiveIntegerOrEmpty getValue() const; + void setValue(const PositiveIntegerOrEmpty &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveIntegerOrEmpty myValue; + MultipleRestAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp b/Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp index 1ca8f2d3c..7b5f917ab 100644 --- a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - MultipleRestAttributes::MultipleRestAttributes() - :useSymbols() - ,hasUseSymbols( false ) - {} - +namespace core +{ +MultipleRestAttributes::MultipleRestAttributes() : useSymbols(), hasUseSymbols(false) +{ +} - bool MultipleRestAttributes::hasValues() const - { - return hasUseSymbols; - } +bool MultipleRestAttributes::hasValues() const +{ + return hasUseSymbols; +} +std::ostream &MultipleRestAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, useSymbols, "use-symbols", hasUseSymbols); + } + return os; +} - std::ostream& MultipleRestAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, useSymbols, "use-symbols", hasUseSymbols ); - } - return os; - } +bool MultipleRestAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "MultipleRestAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool MultipleRestAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, useSymbols, hasUseSymbols, "use-symbols", &parseYesNo)) { - const char* const className = "MultipleRestAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, useSymbols, hasUseSymbols, "use-symbols", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.h b/Sourcecode/private/mx/core/elements/MultipleRestAttributes.h index 1f6ac528e..6a2fd4afc 100644 --- a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.h +++ b/Sourcecode/private/mx/core/elements/MultipleRestAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( MultipleRestAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(MultipleRestAttributes) - struct MultipleRestAttributes : public AttributesInterface - { - public: - MultipleRestAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo useSymbols; - bool hasUseSymbols; +struct MultipleRestAttributes : public AttributesInterface +{ + public: + MultipleRestAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo useSymbols; + bool hasUseSymbols; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MusicDataChoice.cpp b/Sourcecode/private/mx/core/elements/MusicDataChoice.cpp index 3eaf5c7b0..2e2990d81 100644 --- a/Sourcecode/private/mx/core/elements/MusicDataChoice.cpp +++ b/Sourcecode/private/mx/core/elements/MusicDataChoice.cpp @@ -19,338 +19,293 @@ #include "mx/core/elements/Sound.h" #include - namespace mx { - namespace core +namespace core +{ +MusicDataChoice::MusicDataChoice() + : myChoice(Choice::note), myNote(nullptr), myBackup(nullptr), myForward(nullptr), myDirection(nullptr), + myProperties(nullptr), myHarmony(nullptr), myFiguredBass(nullptr), myPrint(nullptr), mySound(nullptr), + myBarline(nullptr), myGrouping(nullptr), myLink(nullptr), myBookmark(nullptr) +{ +} + +bool MusicDataChoice::hasAttributes() const +{ + return false; +} + +std::ostream &MusicDataChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &MusicDataChoice::streamName(std::ostream &os) const +{ + return os; +} + +bool MusicDataChoice::hasContents() const +{ + return true; +} + +std::ostream &MusicDataChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) { - MusicDataChoice::MusicDataChoice() - :myChoice( Choice::note ) - ,myNote( nullptr ) - ,myBackup( nullptr ) - ,myForward( nullptr ) - ,myDirection( nullptr ) - ,myProperties( nullptr ) - ,myHarmony( nullptr ) - ,myFiguredBass( nullptr ) - ,myPrint( nullptr ) - ,mySound( nullptr ) - ,myBarline( nullptr ) - ,myGrouping( nullptr ) - ,myLink( nullptr ) - ,myBookmark( nullptr ) - {} - - - bool MusicDataChoice::hasAttributes() const - { - return false; - } - - - std::ostream& MusicDataChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MusicDataChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool MusicDataChoice::hasContents() const - { - return true; - } - - - std::ostream& MusicDataChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::note: - getNote()->toStream( os, indentLevel ); - break; - case Choice::backup: - getBackup()->toStream( os, indentLevel ); - break; - case Choice::forward: - getForward()->toStream( os, indentLevel ); - break; - case Choice::direction: - getDirection()->toStream( os, indentLevel ); - break; - case Choice::properties: - getProperties()->toStream( os, indentLevel ); - break; - case Choice::harmony: - getHarmony()->toStream( os, indentLevel ); - break; - case Choice::figuredBass: - getFiguredBass()->toStream( os, indentLevel ); - break; - case Choice::print: - getPrint()->toStream( os, indentLevel ); - break; - case Choice::sound: - getSound()->toStream( os, indentLevel ); - break; - case Choice::barline: - getBarline()->toStream( os, indentLevel ); - break; - case Choice::grouping: - getGrouping()->toStream( os, indentLevel ); - break; - case Choice::link: - getLink()->toStream( os, indentLevel ); - break; - case Choice::bookmark: - getBookmark()->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - MusicDataChoice::Choice MusicDataChoice::getChoice() const - { - return myChoice; - } - - - void MusicDataChoice::setChoice( const MusicDataChoice::Choice value ) - { - myChoice = value; - } - - - NotePtr MusicDataChoice::getNote() const - { - MX_LOCK - MX_JIT_ALLOCATE( Note ); - return myNote; - } - - - void MusicDataChoice::setNote( const NotePtr& value ) - { - if ( value ) - { - myNote = value; - } - } - - - BackupPtr MusicDataChoice::getBackup() const - { - MX_LOCK - MX_JIT_ALLOCATE( Backup ); - return myBackup; - } - - - void MusicDataChoice::setBackup( const BackupPtr& value ) - { - if ( value ) - { - myBackup = value; - } - } - - - ForwardPtr MusicDataChoice::getForward() const - { - MX_LOCK - MX_JIT_ALLOCATE( Forward ); - return myForward; - } - - - void MusicDataChoice::setForward( const ForwardPtr& value ) - { - if ( value ) - { - myForward = value; - } - } - - - DirectionPtr MusicDataChoice::getDirection() const - { - MX_LOCK - MX_JIT_ALLOCATE( Direction ); - return myDirection; - } - - - void MusicDataChoice::setDirection( const DirectionPtr& value ) - { - if ( value ) - { - myDirection = value; - } - } - - - PropertiesPtr MusicDataChoice::getProperties() const - { - MX_LOCK - MX_JIT_ALLOCATE( Properties ); - return myProperties; - } - - - void MusicDataChoice::setProperties( const PropertiesPtr& value ) - { - if ( value ) - { - myProperties = value; - } - } - - - HarmonyPtr MusicDataChoice::getHarmony() const - { - MX_LOCK - MX_JIT_ALLOCATE( Harmony ); - return myHarmony; - } - - - void MusicDataChoice::setHarmony( const HarmonyPtr& value ) - { - if ( value ) - { - myHarmony = value; - } - } - - - FiguredBassPtr MusicDataChoice::getFiguredBass() const - { - MX_LOCK - MX_JIT_ALLOCATE( FiguredBass ); - return myFiguredBass; - } - - - void MusicDataChoice::setFiguredBass( const FiguredBassPtr& value ) - { - if ( value ) - { - myFiguredBass = value; - } - } - - - PrintPtr MusicDataChoice::getPrint() const - { - MX_LOCK - MX_JIT_ALLOCATE( Print ); - return myPrint; - } - - - void MusicDataChoice::setPrint( const PrintPtr& value ) - { - if ( value ) - { - myPrint = value; - } - } - - - SoundPtr MusicDataChoice::getSound() const - { - MX_LOCK - MX_JIT_ALLOCATE( Sound ); - return mySound; - } - - - void MusicDataChoice::setSound( const SoundPtr& value ) - { - if ( value ) - { - mySound = value; - } - } - - - BarlinePtr MusicDataChoice::getBarline() const - { - MX_LOCK - MX_JIT_ALLOCATE( Barline ); - return myBarline; - } - - - void MusicDataChoice::setBarline( const BarlinePtr& value ) - { - if ( value ) - { - myBarline = value; - } - } - - - GroupingPtr MusicDataChoice::getGrouping() const - { - MX_LOCK - MX_JIT_ALLOCATE( Grouping ); - return myGrouping; - } - - - void MusicDataChoice::setGrouping( const GroupingPtr& value ) - { - if ( value ) - { - myGrouping = value; - } - } - - - LinkPtr MusicDataChoice::getLink() const - { - MX_LOCK - MX_JIT_ALLOCATE( Link ); - return myLink; - } - - - void MusicDataChoice::setLink( const LinkPtr& value ) - { - if ( value ) - { - myLink = value; - } - } - - - BookmarkPtr MusicDataChoice::getBookmark() const - { - MX_LOCK - MX_JIT_ALLOCATE( Bookmark ); - return myBookmark; - } - - - void MusicDataChoice::setBookmark( const BookmarkPtr& value ) - { - if ( value ) - { - myBookmark = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( MusicDataChoice ); + case Choice::note: + getNote()->toStream(os, indentLevel); + break; + case Choice::backup: + getBackup()->toStream(os, indentLevel); + break; + case Choice::forward: + getForward()->toStream(os, indentLevel); + break; + case Choice::direction: + getDirection()->toStream(os, indentLevel); + break; + case Choice::properties: + getProperties()->toStream(os, indentLevel); + break; + case Choice::harmony: + getHarmony()->toStream(os, indentLevel); + break; + case Choice::figuredBass: + getFiguredBass()->toStream(os, indentLevel); + break; + case Choice::print: + getPrint()->toStream(os, indentLevel); + break; + case Choice::sound: + getSound()->toStream(os, indentLevel); + break; + case Choice::barline: + getBarline()->toStream(os, indentLevel); + break; + case Choice::grouping: + getGrouping()->toStream(os, indentLevel); + break; + case Choice::link: + getLink()->toStream(os, indentLevel); + break; + case Choice::bookmark: + getBookmark()->toStream(os, indentLevel); + break; + default: + break; + } + isOneLineOnly = false; + return os; +} + +MusicDataChoice::Choice MusicDataChoice::getChoice() const +{ + return myChoice; +} + +void MusicDataChoice::setChoice(const MusicDataChoice::Choice value) +{ + myChoice = value; +} + +NotePtr MusicDataChoice::getNote() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Note); + return myNote; +} +void MusicDataChoice::setNote(const NotePtr &value) +{ + if (value) + { + myNote = value; } } + +BackupPtr MusicDataChoice::getBackup() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Backup); + return myBackup; +} + +void MusicDataChoice::setBackup(const BackupPtr &value) +{ + if (value) + { + myBackup = value; + } +} + +ForwardPtr MusicDataChoice::getForward() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Forward); + return myForward; +} + +void MusicDataChoice::setForward(const ForwardPtr &value) +{ + if (value) + { + myForward = value; + } +} + +DirectionPtr MusicDataChoice::getDirection() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Direction); + return myDirection; +} + +void MusicDataChoice::setDirection(const DirectionPtr &value) +{ + if (value) + { + myDirection = value; + } +} + +PropertiesPtr MusicDataChoice::getProperties() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Properties); + return myProperties; +} + +void MusicDataChoice::setProperties(const PropertiesPtr &value) +{ + if (value) + { + myProperties = value; + } +} + +HarmonyPtr MusicDataChoice::getHarmony() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Harmony); + return myHarmony; +} + +void MusicDataChoice::setHarmony(const HarmonyPtr &value) +{ + if (value) + { + myHarmony = value; + } +} + +FiguredBassPtr MusicDataChoice::getFiguredBass() const +{ + MX_LOCK + MX_JIT_ALLOCATE(FiguredBass); + return myFiguredBass; +} + +void MusicDataChoice::setFiguredBass(const FiguredBassPtr &value) +{ + if (value) + { + myFiguredBass = value; + } +} + +PrintPtr MusicDataChoice::getPrint() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Print); + return myPrint; +} + +void MusicDataChoice::setPrint(const PrintPtr &value) +{ + if (value) + { + myPrint = value; + } +} + +SoundPtr MusicDataChoice::getSound() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Sound); + return mySound; +} + +void MusicDataChoice::setSound(const SoundPtr &value) +{ + if (value) + { + mySound = value; + } +} + +BarlinePtr MusicDataChoice::getBarline() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Barline); + return myBarline; +} + +void MusicDataChoice::setBarline(const BarlinePtr &value) +{ + if (value) + { + myBarline = value; + } +} + +GroupingPtr MusicDataChoice::getGrouping() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Grouping); + return myGrouping; +} + +void MusicDataChoice::setGrouping(const GroupingPtr &value) +{ + if (value) + { + myGrouping = value; + } +} + +LinkPtr MusicDataChoice::getLink() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Link); + return myLink; +} + +void MusicDataChoice::setLink(const LinkPtr &value) +{ + if (value) + { + myLink = value; + } +} + +BookmarkPtr MusicDataChoice::getBookmark() const +{ + MX_LOCK + MX_JIT_ALLOCATE(Bookmark); + return myBookmark; +} + +void MusicDataChoice::setBookmark(const BookmarkPtr &value) +{ + if (value) + { + myBookmark = value; + } +} + +MX_FROM_XELEMENT_UNUSED(MusicDataChoice); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MusicDataChoice.h b/Sourcecode/private/mx/core/elements/MusicDataChoice.h index 81e3f1798..c7dbd500a 100644 --- a/Sourcecode/private/mx/core/elements/MusicDataChoice.h +++ b/Sourcecode/private/mx/core/elements/MusicDataChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,128 +13,131 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Backup ) - MX_FORWARD_DECLARE_ELEMENT( Barline ) - MX_FORWARD_DECLARE_ELEMENT( Bookmark ) - MX_FORWARD_DECLARE_ELEMENT( Direction ) - MX_FORWARD_DECLARE_ELEMENT( FiguredBass ) - MX_FORWARD_DECLARE_ELEMENT( Forward ) - MX_FORWARD_DECLARE_ELEMENT( Grouping ) - MX_FORWARD_DECLARE_ELEMENT( Harmony ) - MX_FORWARD_DECLARE_ELEMENT( Link ) - MX_FORWARD_DECLARE_ELEMENT( Note ) - MX_FORWARD_DECLARE_ELEMENT( Print ) - MX_FORWARD_DECLARE_ELEMENT( Properties ) - MX_FORWARD_DECLARE_ELEMENT( Sound ) - MX_FORWARD_DECLARE_ELEMENT( MusicDataChoice ) - - inline MusicDataChoicePtr makeMusicDataChoice() { return std::make_shared(); } - - class MusicDataChoice : public ElementInterface - { - public: - enum class Choice - { - note = 1, - backup = 2, - forward = 3, - direction = 4, - properties = 5, - harmony = 6, - figuredBass = 7, - print = 8, - sound = 9, - barline = 10, - grouping = 11, - link = 12, - bookmark = 13 - }; - MusicDataChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - MusicDataChoice::Choice getChoice() const; - void setChoice( const MusicDataChoice::Choice value ); - - /* _________ Note minOccurs = 1, maxOccurs = 1 _________ */ - NotePtr getNote() const; - void setNote( const NotePtr& value ); - - /* _________ Backup minOccurs = 1, maxOccurs = 1 _________ */ - BackupPtr getBackup() const; - void setBackup( const BackupPtr& value ); - - /* _________ Forward minOccurs = 1, maxOccurs = 1 _________ */ - ForwardPtr getForward() const; - void setForward( const ForwardPtr& value ); - - /* _________ Direction minOccurs = 1, maxOccurs = 1 _________ */ - DirectionPtr getDirection() const; - void setDirection( const DirectionPtr& value ); - - /* _________ Properties minOccurs = 1, maxOccurs = 1 _________ */ - PropertiesPtr getProperties() const; - void setProperties( const PropertiesPtr& value ); - - /* _________ Harmony minOccurs = 1, maxOccurs = 1 _________ */ - HarmonyPtr getHarmony() const; - void setHarmony( const HarmonyPtr& value ); - - /* _________ FiguredBass minOccurs = 1, maxOccurs = 1 _________ */ - FiguredBassPtr getFiguredBass() const; - void setFiguredBass( const FiguredBassPtr& value ); - - /* _________ Print minOccurs = 1, maxOccurs = 1 _________ */ - PrintPtr getPrint() const; - void setPrint( const PrintPtr& value ); - - /* _________ Sound minOccurs = 1, maxOccurs = 1 _________ */ - SoundPtr getSound() const; - void setSound( const SoundPtr& value ); - - /* _________ Barline minOccurs = 1, maxOccurs = 1 _________ */ - BarlinePtr getBarline() const; - void setBarline( const BarlinePtr& value ); - - /* _________ Grouping minOccurs = 1, maxOccurs = 1 _________ */ - GroupingPtr getGrouping() const; - void setGrouping( const GroupingPtr& value ); - - /* _________ Link minOccurs = 1, maxOccurs = 1 _________ */ - LinkPtr getLink() const; - void setLink( const LinkPtr& value ); - - /* _________ Bookmark minOccurs = 1, maxOccurs = 1 _________ */ - BookmarkPtr getBookmark() const; - void setBookmark( const BookmarkPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - Choice myChoice; - mutable NotePtr myNote; - mutable BackupPtr myBackup; - mutable ForwardPtr myForward; - mutable DirectionPtr myDirection; - mutable PropertiesPtr myProperties; - mutable HarmonyPtr myHarmony; - mutable FiguredBassPtr myFiguredBass; - mutable PrintPtr myPrint; - mutable SoundPtr mySound; - mutable BarlinePtr myBarline; - mutable GroupingPtr myGrouping; - mutable LinkPtr myLink; - mutable BookmarkPtr myBookmark; - }; - } +MX_FORWARD_DECLARE_ELEMENT(Backup) +MX_FORWARD_DECLARE_ELEMENT(Barline) +MX_FORWARD_DECLARE_ELEMENT(Bookmark) +MX_FORWARD_DECLARE_ELEMENT(Direction) +MX_FORWARD_DECLARE_ELEMENT(FiguredBass) +MX_FORWARD_DECLARE_ELEMENT(Forward) +MX_FORWARD_DECLARE_ELEMENT(Grouping) +MX_FORWARD_DECLARE_ELEMENT(Harmony) +MX_FORWARD_DECLARE_ELEMENT(Link) +MX_FORWARD_DECLARE_ELEMENT(Note) +MX_FORWARD_DECLARE_ELEMENT(Print) +MX_FORWARD_DECLARE_ELEMENT(Properties) +MX_FORWARD_DECLARE_ELEMENT(Sound) +MX_FORWARD_DECLARE_ELEMENT(MusicDataChoice) + +inline MusicDataChoicePtr makeMusicDataChoice() +{ + return std::make_shared(); } + +class MusicDataChoice : public ElementInterface +{ + public: + enum class Choice + { + note = 1, + backup = 2, + forward = 3, + direction = 4, + properties = 5, + harmony = 6, + figuredBass = 7, + print = 8, + sound = 9, + barline = 10, + grouping = 11, + link = 12, + bookmark = 13 + }; + MusicDataChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + MusicDataChoice::Choice getChoice() const; + void setChoice(const MusicDataChoice::Choice value); + + /* _________ Note minOccurs = 1, maxOccurs = 1 _________ */ + NotePtr getNote() const; + void setNote(const NotePtr &value); + + /* _________ Backup minOccurs = 1, maxOccurs = 1 _________ */ + BackupPtr getBackup() const; + void setBackup(const BackupPtr &value); + + /* _________ Forward minOccurs = 1, maxOccurs = 1 _________ */ + ForwardPtr getForward() const; + void setForward(const ForwardPtr &value); + + /* _________ Direction minOccurs = 1, maxOccurs = 1 _________ */ + DirectionPtr getDirection() const; + void setDirection(const DirectionPtr &value); + + /* _________ Properties minOccurs = 1, maxOccurs = 1 _________ */ + PropertiesPtr getProperties() const; + void setProperties(const PropertiesPtr &value); + + /* _________ Harmony minOccurs = 1, maxOccurs = 1 _________ */ + HarmonyPtr getHarmony() const; + void setHarmony(const HarmonyPtr &value); + + /* _________ FiguredBass minOccurs = 1, maxOccurs = 1 _________ */ + FiguredBassPtr getFiguredBass() const; + void setFiguredBass(const FiguredBassPtr &value); + + /* _________ Print minOccurs = 1, maxOccurs = 1 _________ */ + PrintPtr getPrint() const; + void setPrint(const PrintPtr &value); + + /* _________ Sound minOccurs = 1, maxOccurs = 1 _________ */ + SoundPtr getSound() const; + void setSound(const SoundPtr &value); + + /* _________ Barline minOccurs = 1, maxOccurs = 1 _________ */ + BarlinePtr getBarline() const; + void setBarline(const BarlinePtr &value); + + /* _________ Grouping minOccurs = 1, maxOccurs = 1 _________ */ + GroupingPtr getGrouping() const; + void setGrouping(const GroupingPtr &value); + + /* _________ Link minOccurs = 1, maxOccurs = 1 _________ */ + LinkPtr getLink() const; + void setLink(const LinkPtr &value); + + /* _________ Bookmark minOccurs = 1, maxOccurs = 1 _________ */ + BookmarkPtr getBookmark() const; + void setBookmark(const BookmarkPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MX_MUTEX + Choice myChoice; + mutable NotePtr myNote; + mutable BackupPtr myBackup; + mutable ForwardPtr myForward; + mutable DirectionPtr myDirection; + mutable PropertiesPtr myProperties; + mutable HarmonyPtr myHarmony; + mutable FiguredBassPtr myFiguredBass; + mutable PrintPtr myPrint; + mutable SoundPtr mySound; + mutable BarlinePtr myBarline; + mutable GroupingPtr myGrouping; + mutable LinkPtr myLink; + mutable BookmarkPtr myBookmark; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MusicDataGroup.cpp b/Sourcecode/private/mx/core/elements/MusicDataGroup.cpp index d073bbcbf..667d7ddc0 100644 --- a/Sourcecode/private/mx/core/elements/MusicDataGroup.cpp +++ b/Sourcecode/private/mx/core/elements/MusicDataGroup.cpp @@ -9,94 +9,82 @@ namespace mx { - namespace core - { - MusicDataGroup::MusicDataGroup() - :myMusicDataChoiceSet() - {} - - - bool MusicDataGroup::hasAttributes() const - { - return false; - } - - - std::ostream& MusicDataGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MusicDataGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool MusicDataGroup::hasContents() const - { - return myMusicDataChoiceSet.size() > 0; - } - - - std::ostream& MusicDataGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto it = myMusicDataChoiceSet.cbegin(); - it != myMusicDataChoiceSet.cend(); ++it ) - { - if ( it != myMusicDataChoiceSet.cbegin() ) - { - os << std::endl; - } - (*it)->streamContents( os, indentLevel, isOneLineOnly ); - } - isOneLineOnly = false; - return os; - } - +namespace core +{ +MusicDataGroup::MusicDataGroup() : myMusicDataChoiceSet() +{ +} - const MusicDataChoiceSet& MusicDataGroup::getMusicDataChoiceSet() const - { - return myMusicDataChoiceSet; - } +bool MusicDataGroup::hasAttributes() const +{ + return false; +} +std::ostream &MusicDataGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - void MusicDataGroup::addMusicDataChoice( const MusicDataChoicePtr& value ) - { - if ( value ) - { - myMusicDataChoiceSet.push_back( value ); - } - } +std::ostream &MusicDataGroup::streamName(std::ostream &os) const +{ + return os; +} +bool MusicDataGroup::hasContents() const +{ + return myMusicDataChoiceSet.size() > 0; +} - void MusicDataGroup::removeMusicDataChoice( const MusicDataChoiceSetIterConst& value ) +std::ostream &MusicDataGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto it = myMusicDataChoiceSet.cbegin(); it != myMusicDataChoiceSet.cend(); ++it) + { + if (it != myMusicDataChoiceSet.cbegin()) { - if ( value != myMusicDataChoiceSet.cend() ) - { - myMusicDataChoiceSet.erase( value ); - } + os << std::endl; } + (*it)->streamContents(os, indentLevel, isOneLineOnly); + } + isOneLineOnly = false; + return os; +} +const MusicDataChoiceSet &MusicDataGroup::getMusicDataChoiceSet() const +{ + return myMusicDataChoiceSet; +} - void MusicDataGroup::clearMusicDataChoiceSet() - { - myMusicDataChoiceSet.clear(); - } +void MusicDataGroup::addMusicDataChoice(const MusicDataChoicePtr &value) +{ + if (value) + { + myMusicDataChoiceSet.push_back(value); + } +} +void MusicDataGroup::removeMusicDataChoice(const MusicDataChoiceSetIterConst &value) +{ + if (value != myMusicDataChoiceSet.cend()) + { + myMusicDataChoiceSet.erase(value); + } +} - MusicDataChoicePtr MusicDataGroup::getMusicDataChoice( const MusicDataChoiceSetIterConst& setIterator ) const - { - if( setIterator != myMusicDataChoiceSet.cend() ) - { - return *setIterator; - } - return MusicDataChoicePtr(); - } - - - MX_FROM_XELEMENT_UNUSED( MusicDataGroup ); +void MusicDataGroup::clearMusicDataChoiceSet() +{ + myMusicDataChoiceSet.clear(); +} +MusicDataChoicePtr MusicDataGroup::getMusicDataChoice(const MusicDataChoiceSetIterConst &setIterator) const +{ + if (setIterator != myMusicDataChoiceSet.cend()) + { + return *setIterator; } + return MusicDataChoicePtr(); } + +MX_FROM_XELEMENT_UNUSED(MusicDataGroup); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MusicDataGroup.h b/Sourcecode/private/mx/core/elements/MusicDataGroup.h index 943670661..1f348de1a 100644 --- a/Sourcecode/private/mx/core/elements/MusicDataGroup.h +++ b/Sourcecode/private/mx/core/elements/MusicDataGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,37 +13,40 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MusicDataChoice ) - MX_FORWARD_DECLARE_ELEMENT( MusicDataGroup ) - - inline MusicDataGroupPtr makeMusicDataGroup() { return std::make_shared(); } - - class MusicDataGroup : public ElementInterface - { - public: - MusicDataGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MusicDataChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const MusicDataChoiceSet& getMusicDataChoiceSet() const; - void addMusicDataChoice( const MusicDataChoicePtr& value ); - void removeMusicDataChoice( const MusicDataChoiceSetIterConst& value ); - void clearMusicDataChoiceSet(); - MusicDataChoicePtr getMusicDataChoice( const MusicDataChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MusicDataChoiceSet myMusicDataChoiceSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MusicDataChoice) +MX_FORWARD_DECLARE_ELEMENT(MusicDataGroup) + +inline MusicDataGroupPtr makeMusicDataGroup() +{ + return std::make_shared(); } + +class MusicDataGroup : public ElementInterface +{ + public: + MusicDataGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ MusicDataChoice minOccurs = 0, maxOccurs = unbounded _________ */ + const MusicDataChoiceSet &getMusicDataChoiceSet() const; + void addMusicDataChoice(const MusicDataChoicePtr &value); + void removeMusicDataChoice(const MusicDataChoiceSetIterConst &value); + void clearMusicDataChoiceSet(); + MusicDataChoicePtr getMusicDataChoice(const MusicDataChoiceSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MusicDataChoiceSet myMusicDataChoiceSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MusicFont.cpp b/Sourcecode/private/mx/core/elements/MusicFont.cpp index 64615b32b..61ec4d406 100644 --- a/Sourcecode/private/mx/core/elements/MusicFont.cpp +++ b/Sourcecode/private/mx/core/elements/MusicFont.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - MusicFont::MusicFont() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool MusicFont::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MusicFont::hasContents() const { return false; } - std::ostream& MusicFont::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MusicFont::streamName( std::ostream& os ) const { os << "music-font"; return os; } - std::ostream& MusicFont::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +MusicFont::MusicFont() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool MusicFont::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyFontAttributesPtr MusicFont::getAttributes() const - { - return myAttributes; - } +bool MusicFont::hasContents() const +{ + return false; +} +std::ostream &MusicFont::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void MusicFont::setAttributes( const EmptyFontAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &MusicFont::streamName(std::ostream &os) const +{ + os << "music-font"; + return os; +} +std::ostream &MusicFont::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool MusicFont::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyFontAttributesPtr MusicFont::getAttributes() const +{ + return myAttributes; +} +void MusicFont::setAttributes(const EmptyFontAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool MusicFont::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/MusicFont.h b/Sourcecode/private/mx/core/elements/MusicFont.h index b9b244efc..bdabc7ce3 100644 --- a/Sourcecode/private/mx/core/elements/MusicFont.h +++ b/Sourcecode/private/mx/core/elements/MusicFont.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyFontAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyFontAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MusicFont ) - - inline MusicFontPtr makeMusicFont() { return std::make_shared(); } - - class MusicFont : public ElementInterface - { - public: - MusicFont(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyFontAttributesPtr getAttributes() const; - void setAttributes( const EmptyFontAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyFontAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyFontAttributes) +MX_FORWARD_DECLARE_ELEMENT(MusicFont) + +inline MusicFontPtr makeMusicFont() +{ + return std::make_shared(); } + +class MusicFont : public ElementInterface +{ + public: + MusicFont(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyFontAttributesPtr getAttributes() const; + void setAttributes(const EmptyFontAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyFontAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Mute.cpp b/Sourcecode/private/mx/core/elements/Mute.cpp index 896387a74..c36e41799 100644 --- a/Sourcecode/private/mx/core/elements/Mute.cpp +++ b/Sourcecode/private/mx/core/elements/Mute.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - Mute::Mute() - :myValue( MuteEnum::off ) - {} - - - Mute::Mute( const MuteEnum& value ) - :myValue( value ) - {} - - - bool Mute::hasAttributes() const - { - return false; - } - - - bool Mute::hasContents() const - { - return true; - } - - - std::ostream& Mute::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Mute::streamName( std::ostream& os ) const - { - os << "mute"; - return os; - } +namespace core +{ +Mute::Mute() : myValue(MuteEnum::off) +{ +} +Mute::Mute(const MuteEnum &value) : myValue(value) +{ +} - std::ostream& Mute::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Mute::hasAttributes() const +{ + return false; +} +bool Mute::hasContents() const +{ + return true; +} - MuteEnum Mute::getValue() const - { - return myValue; - } +std::ostream &Mute::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Mute::streamName(std::ostream &os) const +{ + os << "mute"; + return os; +} - void Mute::setValue( const MuteEnum& value ) - { - myValue = value; - } +std::ostream &Mute::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +MuteEnum Mute::getValue() const +{ + return myValue; +} - bool Mute::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseMuteEnum( xelement.getValue() ); - return true; - } +void Mute::setValue(const MuteEnum &value) +{ + myValue = value; +} - } +bool Mute::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseMuteEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Mute.h b/Sourcecode/private/mx/core/elements/Mute.h index a775b58e0..3ba6811a1 100644 --- a/Sourcecode/private/mx/core/elements/Mute.h +++ b/Sourcecode/private/mx/core/elements/Mute.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Mute ) - - inline MutePtr makeMute() { return std::make_shared(); } - inline MutePtr makeMute( const MuteEnum& value ) { return std::make_shared( value ); } - inline MutePtr makeMute( MuteEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Mute : public ElementInterface - { - public: - Mute(); - Mute( const MuteEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MuteEnum getValue() const; - void setValue( const MuteEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MuteEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Mute) + +inline MutePtr makeMute() +{ + return std::make_shared(); +} + +inline MutePtr makeMute(const MuteEnum &value) +{ + return std::make_shared(value); } + +inline MutePtr makeMute(MuteEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class Mute : public ElementInterface +{ + public: + Mute(); + Mute(const MuteEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MuteEnum getValue() const; + void setValue(const MuteEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MuteEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Natural.cpp b/Sourcecode/private/mx/core/elements/Natural.cpp index a5dd0404d..a5ed9d58c 100644 --- a/Sourcecode/private/mx/core/elements/Natural.cpp +++ b/Sourcecode/private/mx/core/elements/Natural.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Natural::Natural() : ElementInterface() {} - +namespace core +{ +Natural::Natural() : ElementInterface() +{ +} - bool Natural::hasAttributes() const { return false; } +bool Natural::hasAttributes() const +{ + return false; +} +bool Natural::hasContents() const +{ + return false; +} - bool Natural::hasContents() const { return false; } - std::ostream& Natural::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Natural::streamName( std::ostream& os ) const { os << "natural"; return os; } - std::ostream& Natural::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Natural::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Natural::streamName(std::ostream &os) const +{ + os << "natural"; + return os; +} - bool Natural::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &Natural::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Natural::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Natural.h b/Sourcecode/private/mx/core/elements/Natural.h index 3e7b61b57..fc90bafbd 100644 --- a/Sourcecode/private/mx/core/elements/Natural.h +++ b/Sourcecode/private/mx/core/elements/Natural.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Natural ) - - inline NaturalPtr makeNatural() { return std::make_shared(); } - - class Natural : public ElementInterface - { - public: - Natural(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Natural) + +inline NaturalPtr makeNatural() +{ + return std::make_shared(); } + +class Natural : public ElementInterface +{ + public: + Natural(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiate.cpp b/Sourcecode/private/mx/core/elements/NonArpeggiate.cpp index 46b4a6230..8a55b4804 100644 --- a/Sourcecode/private/mx/core/elements/NonArpeggiate.cpp +++ b/Sourcecode/private/mx/core/elements/NonArpeggiate.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - NonArpeggiate::NonArpeggiate() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool NonArpeggiate::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool NonArpeggiate::hasContents() const { return false; } - std::ostream& NonArpeggiate::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& NonArpeggiate::streamName( std::ostream& os ) const { os << "non-arpeggiate"; return os; } - std::ostream& NonArpeggiate::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +NonArpeggiate::NonArpeggiate() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool NonArpeggiate::hasAttributes() const +{ + return myAttributes->hasValues(); +} - NonArpeggiateAttributesPtr NonArpeggiate::getAttributes() const - { - return myAttributes; - } +bool NonArpeggiate::hasContents() const +{ + return false; +} +std::ostream &NonArpeggiate::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void NonArpeggiate::setAttributes( const NonArpeggiateAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &NonArpeggiate::streamName(std::ostream &os) const +{ + os << "non-arpeggiate"; + return os; +} +std::ostream &NonArpeggiate::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool NonArpeggiate::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +NonArpeggiateAttributesPtr NonArpeggiate::getAttributes() const +{ + return myAttributes; +} +void NonArpeggiate::setAttributes(const NonArpeggiateAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool NonArpeggiate::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiate.h b/Sourcecode/private/mx/core/elements/NonArpeggiate.h index dde9c5d83..79214a03a 100644 --- a/Sourcecode/private/mx/core/elements/NonArpeggiate.h +++ b/Sourcecode/private/mx/core/elements/NonArpeggiate.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/NonArpeggiateAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NonArpeggiateAttributes ) - MX_FORWARD_DECLARE_ELEMENT( NonArpeggiate ) - - inline NonArpeggiatePtr makeNonArpeggiate() { return std::make_shared(); } - - class NonArpeggiate : public ElementInterface - { - public: - NonArpeggiate(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonArpeggiateAttributesPtr getAttributes() const; - void setAttributes( const NonArpeggiateAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonArpeggiateAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(NonArpeggiateAttributes) +MX_FORWARD_DECLARE_ELEMENT(NonArpeggiate) + +inline NonArpeggiatePtr makeNonArpeggiate() +{ + return std::make_shared(); } + +class NonArpeggiate : public ElementInterface +{ + public: + NonArpeggiate(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NonArpeggiateAttributesPtr getAttributes() const; + void setAttributes(const NonArpeggiateAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonArpeggiateAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp b/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp index 6cac1adb4..1697b4a15 100644 --- a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp @@ -8,82 +8,84 @@ namespace mx { - namespace core +namespace core +{ +NonArpeggiateAttributes::NonArpeggiateAttributes() + : type(TopBottom::top), number(), defaultX(), defaultY(), relativeX(), relativeY(), placement(AboveBelow::below), + hasType(true), hasNumber(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasPlacement(false) +{ +} + +bool NonArpeggiateAttributes::hasValues() const +{ + return hasType || hasNumber || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasPlacement; +} + +std::ostream &NonArpeggiateAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - NonArpeggiateAttributes::NonArpeggiateAttributes() - :type( TopBottom::top ) - ,number() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,hasType( true ) - ,hasNumber( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool NonArpeggiateAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "NonArpeggiateAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool NonArpeggiateAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseTopBottom)) { - return hasType || - hasNumber || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement; + continue; } - - - std::ostream& NonArpeggiateAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool NonArpeggiateAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) { - const char* const className = "NonArpeggiateAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseTopBottom ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h b/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h index 2f004f6aa..bbd37729f 100644 --- a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h +++ b/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -16,34 +16,34 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( NonArpeggiateAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(NonArpeggiateAttributes) - struct NonArpeggiateAttributes : public AttributesInterface - { - public: - NonArpeggiateAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TopBottom type; - NumberLevel number; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - const bool hasType; - bool hasNumber; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; +struct NonArpeggiateAttributes : public AttributesInterface +{ + public: + NonArpeggiateAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TopBottom type; + NumberLevel number; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + AboveBelow placement; + const bool hasType; + bool hasNumber; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp b/Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp index b17102912..4ec37bc50 100644 --- a/Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp +++ b/Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp @@ -11,142 +11,137 @@ namespace mx { - namespace core - { - NonTraditionalKey::NonTraditionalKey() - :ElementInterface() - ,myKeyStep( std::make_shared() ) - ,myKeyAlter( std::make_shared() ) - ,myKeyAccidental( std::make_shared() ) - ,myHasKeyAccidental( false ) - {} - - - bool NonTraditionalKey::hasAttributes() const - { - return false; - } - - - std::ostream& NonTraditionalKey::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NonTraditionalKey::streamName( std::ostream& os ) const - { - return os; - } - - - bool NonTraditionalKey::hasContents() const - { - return true; - } - +namespace core +{ +NonTraditionalKey::NonTraditionalKey() + : ElementInterface(), myKeyStep(std::make_shared()), myKeyAlter(std::make_shared()), + myKeyAccidental(std::make_shared()), myHasKeyAccidental(false) +{ +} - std::ostream& NonTraditionalKey::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - if ( myKeyStep ) - { - myKeyStep->toStream( os, indentLevel ) << std::endl; - } - if ( myKeyAlter ) - { - myKeyAlter->toStream( os, indentLevel ); - } - if ( myKeyAccidental && myHasKeyAccidental ) - { - os << std::endl; - myKeyAccidental->toStream( os, indentLevel ); - } - return os; - } +bool NonTraditionalKey::hasAttributes() const +{ + return false; +} +std::ostream &NonTraditionalKey::streamAttributes(std::ostream &os) const +{ + return os; +} - KeyStepPtr NonTraditionalKey::getKeyStep() const - { - return myKeyStep; - } +std::ostream &NonTraditionalKey::streamName(std::ostream &os) const +{ + return os; +} +bool NonTraditionalKey::hasContents() const +{ + return true; +} - void NonTraditionalKey::setKeyStep( const KeyStepPtr& value ) - { - if ( value ) - { - myKeyStep = value; - } - } +std::ostream &NonTraditionalKey::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + if (myKeyStep) + { + myKeyStep->toStream(os, indentLevel) << std::endl; + } + if (myKeyAlter) + { + myKeyAlter->toStream(os, indentLevel); + } + if (myKeyAccidental && myHasKeyAccidental) + { + os << std::endl; + myKeyAccidental->toStream(os, indentLevel); + } + return os; +} +KeyStepPtr NonTraditionalKey::getKeyStep() const +{ + return myKeyStep; +} - KeyAlterPtr NonTraditionalKey::getKeyAlter() const - { - return myKeyAlter; - } +void NonTraditionalKey::setKeyStep(const KeyStepPtr &value) +{ + if (value) + { + myKeyStep = value; + } +} +KeyAlterPtr NonTraditionalKey::getKeyAlter() const +{ + return myKeyAlter; +} - void NonTraditionalKey::setKeyAlter( const KeyAlterPtr& value ) - { - if ( value ) - { - myKeyAlter = value; - } - } +void NonTraditionalKey::setKeyAlter(const KeyAlterPtr &value) +{ + if (value) + { + myKeyAlter = value; + } +} +KeyAccidentalPtr NonTraditionalKey::getKeyAccidental() const +{ + return myKeyAccidental; +} - KeyAccidentalPtr NonTraditionalKey::getKeyAccidental() const - { - return myKeyAccidental; - } +void NonTraditionalKey::setKeyAccidental(const KeyAccidentalPtr &value) +{ + if (value) + { + myKeyAccidental = value; + } +} +bool NonTraditionalKey::getHasKeyAccidental() const +{ + return myHasKeyAccidental; +} - void NonTraditionalKey::setKeyAccidental( const KeyAccidentalPtr& value ) - { - if ( value ) - { - myKeyAccidental = value; - } - } +void NonTraditionalKey::setHasKeyAccidental(const bool value) +{ + myHasKeyAccidental = value; +} +bool NonTraditionalKey::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isKeyStepFound = false; + bool isKeyAlterFound = false; - bool NonTraditionalKey::getHasKeyAccidental() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myKeyStep, isKeyStepFound)) { - return myHasKeyAccidental; + continue; } - - - void NonTraditionalKey::setHasKeyAccidental( const bool value ) + if (importElement(message, *it, isSuccess, *myKeyAlter, isKeyAlterFound)) { - myHasKeyAccidental = value; + continue; } - - - bool NonTraditionalKey::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myKeyAccidental, myHasKeyAccidental)) { - bool isSuccess = true; - bool isKeyStepFound = false; - bool isKeyAlterFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myKeyStep, isKeyStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myKeyAlter, isKeyAlterFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myKeyAccidental, myHasKeyAccidental ) ) { continue; } - } - - if( !isKeyStepFound ) - { - message << "NonTraditionalKey: '" << myKeyStep->getElementName() << "' is required but was not found" << std::endl; - } - if( !isKeyAlterFound ) - { - message << "NonTraditionalKey: '" << myKeyAlter->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isKeyStepFound) + { + message << "NonTraditionalKey: '" << myKeyStep->getElementName() << "' is required but was not found" + << std::endl; } + if (!isKeyAlterFound) + { + message << "NonTraditionalKey: '" << myKeyAlter->getElementName() << "' is required but was not found" + << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NonTraditionalKey.h b/Sourcecode/private/mx/core/elements/NonTraditionalKey.h index 1416aef61..c6b53409e 100644 --- a/Sourcecode/private/mx/core/elements/NonTraditionalKey.h +++ b/Sourcecode/private/mx/core/elements/NonTraditionalKey.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,43 +13,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( KeyAccidental ) - MX_FORWARD_DECLARE_ELEMENT( KeyAlter ) - MX_FORWARD_DECLARE_ELEMENT( KeyStep ) - MX_FORWARD_DECLARE_ELEMENT( NonTraditionalKey ) - - inline NonTraditionalKeyPtr makeNonTraditionalKey() { return std::make_shared(); } - - class NonTraditionalKey : public ElementInterface - { - public: - NonTraditionalKey(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - KeyStepPtr getKeyStep() const; - void setKeyStep( const KeyStepPtr& value ); - KeyAlterPtr getKeyAlter() const; - void setKeyAlter( const KeyAlterPtr& value ); - KeyAccidentalPtr getKeyAccidental() const; - void setKeyAccidental( const KeyAccidentalPtr& value ); - bool getHasKeyAccidental() const; - void setHasKeyAccidental( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - KeyStepPtr myKeyStep; - KeyAlterPtr myKeyAlter; - KeyAccidentalPtr myKeyAccidental; - bool myHasKeyAccidental; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(KeyAccidental) +MX_FORWARD_DECLARE_ELEMENT(KeyAlter) +MX_FORWARD_DECLARE_ELEMENT(KeyStep) +MX_FORWARD_DECLARE_ELEMENT(NonTraditionalKey) + +inline NonTraditionalKeyPtr makeNonTraditionalKey() +{ + return std::make_shared(); } + +class NonTraditionalKey : public ElementInterface +{ + public: + NonTraditionalKey(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + KeyStepPtr getKeyStep() const; + void setKeyStep(const KeyStepPtr &value); + KeyAlterPtr getKeyAlter() const; + void setKeyAlter(const KeyAlterPtr &value); + KeyAccidentalPtr getKeyAccidental() const; + void setKeyAccidental(const KeyAccidentalPtr &value); + bool getHasKeyAccidental() const; + void setHasKeyAccidental(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + KeyStepPtr myKeyStep; + KeyAlterPtr myKeyAlter; + KeyAccidentalPtr myKeyAccidental; + bool myHasKeyAccidental; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalDot.cpp b/Sourcecode/private/mx/core/elements/NormalDot.cpp index 47f9289c4..51e41fd22 100644 --- a/Sourcecode/private/mx/core/elements/NormalDot.cpp +++ b/Sourcecode/private/mx/core/elements/NormalDot.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - NormalDot::NormalDot() : ElementInterface() {} - +namespace core +{ +NormalDot::NormalDot() : ElementInterface() +{ +} - bool NormalDot::hasAttributes() const { return false; } +bool NormalDot::hasAttributes() const +{ + return false; +} +bool NormalDot::hasContents() const +{ + return false; +} - bool NormalDot::hasContents() const { return false; } - std::ostream& NormalDot::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& NormalDot::streamName( std::ostream& os ) const { os << "normal-dot"; return os; } - std::ostream& NormalDot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &NormalDot::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &NormalDot::streamName(std::ostream &os) const +{ + os << "normal-dot"; + return os; +} - bool NormalDot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &NormalDot::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool NormalDot::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalDot.h b/Sourcecode/private/mx/core/elements/NormalDot.h index 0bad92f4b..1be522c09 100644 --- a/Sourcecode/private/mx/core/elements/NormalDot.h +++ b/Sourcecode/private/mx/core/elements/NormalDot.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NormalDot ) - - inline NormalDotPtr makeNormalDot() { return std::make_shared(); } - - class NormalDot : public ElementInterface - { - public: - NormalDot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(NormalDot) + +inline NormalDotPtr makeNormalDot() +{ + return std::make_shared(); } + +class NormalDot : public ElementInterface +{ + public: + NormalDot(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp b/Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp index 02b0f311f..68f60457c 100644 --- a/Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp +++ b/Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp @@ -11,125 +11,109 @@ namespace mx { - namespace core - { - NormalNoteGroup::NormalNoteGroup() - :myFullNoteGroup( makeFullNoteGroup() ) - ,myDuration( makeDuration() ) - ,myTieSet() - {} - - - bool NormalNoteGroup::hasAttributes() const - { - return false; - } - - - std::ostream& NormalNoteGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NormalNoteGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool NormalNoteGroup::hasContents() const - { - return true; - } - - - std::ostream& NormalNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myFullNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - os << std::endl; - myDuration->toStream( os, indentLevel ); - for ( auto x : myTieSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - return os; - } - - - FullNoteGroupPtr NormalNoteGroup::getFullNoteGroup() const - { - return myFullNoteGroup; - } - - - void NormalNoteGroup::setFullNoteGroup( const FullNoteGroupPtr& value ) - { - if ( value ) - { - myFullNoteGroup = value; - } - } - +namespace core +{ +NormalNoteGroup::NormalNoteGroup() : myFullNoteGroup(makeFullNoteGroup()), myDuration(makeDuration()), myTieSet() +{ +} - DurationPtr NormalNoteGroup::getDuration() const - { - return myDuration; - } +bool NormalNoteGroup::hasAttributes() const +{ + return false; +} +std::ostream &NormalNoteGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - void NormalNoteGroup::setDuration( const DurationPtr& value ) - { - if ( value ) - { - myDuration = value; - } - } +std::ostream &NormalNoteGroup::streamName(std::ostream &os) const +{ + return os; +} +bool NormalNoteGroup::hasContents() const +{ + return true; +} - const TieSet& NormalNoteGroup::getTieSet() const - { - return myTieSet; - } +std::ostream &NormalNoteGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + myFullNoteGroup->streamContents(os, indentLevel, isOneLineOnly); + os << std::endl; + myDuration->toStream(os, indentLevel); + for (auto x : myTieSet) + { + os << std::endl; + x->toStream(os, indentLevel); + } + return os; +} +FullNoteGroupPtr NormalNoteGroup::getFullNoteGroup() const +{ + return myFullNoteGroup; +} - void NormalNoteGroup::addTie( const TiePtr& value ) - { - if ( value ) - { - if ( myTieSet.size() < 2 ) - { - myTieSet.push_back( value ); - } - } - } +void NormalNoteGroup::setFullNoteGroup(const FullNoteGroupPtr &value) +{ + if (value) + { + myFullNoteGroup = value; + } +} +DurationPtr NormalNoteGroup::getDuration() const +{ + return myDuration; +} - void NormalNoteGroup::removeTie( const TieSetIterConst& value ) - { - if ( value != myTieSet.cend() ) - { - myTieSet.erase( value ); - } - } +void NormalNoteGroup::setDuration(const DurationPtr &value) +{ + if (value) + { + myDuration = value; + } +} +const TieSet &NormalNoteGroup::getTieSet() const +{ + return myTieSet; +} - void NormalNoteGroup::clearTieSet() +void NormalNoteGroup::addTie(const TiePtr &value) +{ + if (value) + { + if (myTieSet.size() < 2) { - myTieSet.clear(); + myTieSet.push_back(value); } + } +} +void NormalNoteGroup::removeTie(const TieSetIterConst &value) +{ + if (value != myTieSet.cend()) + { + myTieSet.erase(value); + } +} - TiePtr NormalNoteGroup::getTie( const TieSetIterConst& setIterator ) const - { - if( setIterator != myTieSet.cend() ) - { - return *setIterator; - } - return TiePtr(); - } +void NormalNoteGroup::clearTieSet() +{ + myTieSet.clear(); +} - MX_FROM_XELEMENT_UNUSED( NormalNoteGroup ); +TiePtr NormalNoteGroup::getTie(const TieSetIterConst &setIterator) const +{ + if (setIterator != myTieSet.cend()) + { + return *setIterator; } + return TiePtr(); } + +MX_FROM_XELEMENT_UNUSED(NormalNoteGroup); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalNoteGroup.h b/Sourcecode/private/mx/core/elements/NormalNoteGroup.h index 6816f6923..07a842785 100644 --- a/Sourcecode/private/mx/core/elements/NormalNoteGroup.h +++ b/Sourcecode/private/mx/core/elements/NormalNoteGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,49 +13,52 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( Tie ) - MX_FORWARD_DECLARE_ELEMENT( NormalNoteGroup ) - - inline NormalNoteGroupPtr makeNormalNoteGroup() { return std::make_shared(); } - - class NormalNoteGroup : public ElementInterface - { - public: - NormalNoteGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteGroupPtr getFullNoteGroup() const; - void setFullNoteGroup( const FullNoteGroupPtr& value ); - - /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - - /* _________ Tie minOccurs = 0, maxOccurs = 2 _________ */ - const TieSet& getTieSet() const; - void addTie( const TiePtr& value ); - void removeTie( const TieSetIterConst& value ); - void clearTieSet(); - TiePtr getTie( const TieSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FullNoteGroupPtr myFullNoteGroup; - DurationPtr myDuration; - TieSet myTieSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Duration) +MX_FORWARD_DECLARE_ELEMENT(FullNoteGroup) +MX_FORWARD_DECLARE_ELEMENT(Tie) +MX_FORWARD_DECLARE_ELEMENT(NormalNoteGroup) + +inline NormalNoteGroupPtr makeNormalNoteGroup() +{ + return std::make_shared(); } + +class NormalNoteGroup : public ElementInterface +{ + public: + NormalNoteGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ + FullNoteGroupPtr getFullNoteGroup() const; + void setFullNoteGroup(const FullNoteGroupPtr &value); + + /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ + DurationPtr getDuration() const; + void setDuration(const DurationPtr &value); + + /* _________ Tie minOccurs = 0, maxOccurs = 2 _________ */ + const TieSet &getTieSet() const; + void addTie(const TiePtr &value); + void removeTie(const TieSetIterConst &value); + void clearTieSet(); + TiePtr getTie(const TieSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + FullNoteGroupPtr myFullNoteGroup; + DurationPtr myDuration; + TieSet myTieSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalNotes.cpp b/Sourcecode/private/mx/core/elements/NormalNotes.cpp index 20c2c5aa3..fdf5cedec 100644 --- a/Sourcecode/private/mx/core/elements/NormalNotes.cpp +++ b/Sourcecode/private/mx/core/elements/NormalNotes.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - NormalNotes::NormalNotes() - :myValue() - {} - - - NormalNotes::NormalNotes( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool NormalNotes::hasAttributes() const - { - return false; - } - - - bool NormalNotes::hasContents() const - { - return true; - } - - - std::ostream& NormalNotes::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NormalNotes::streamName( std::ostream& os ) const - { - os << "normal-notes"; - return os; - } +namespace core +{ +NormalNotes::NormalNotes() : myValue() +{ +} +NormalNotes::NormalNotes(const NonNegativeInteger &value) : myValue(value) +{ +} - std::ostream& NormalNotes::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool NormalNotes::hasAttributes() const +{ + return false; +} +bool NormalNotes::hasContents() const +{ + return true; +} - NonNegativeInteger NormalNotes::getValue() const - { - return myValue; - } +std::ostream &NormalNotes::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &NormalNotes::streamName(std::ostream &os) const +{ + os << "normal-notes"; + return os; +} - void NormalNotes::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } +std::ostream &NormalNotes::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NonNegativeInteger NormalNotes::getValue() const +{ + return myValue; +} - bool NormalNotes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void NormalNotes::setValue(const NonNegativeInteger &value) +{ + myValue = value; +} - } +bool NormalNotes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalNotes.h b/Sourcecode/private/mx/core/elements/NormalNotes.h index 05f6c8820..9b21c768a 100644 --- a/Sourcecode/private/mx/core/elements/NormalNotes.h +++ b/Sourcecode/private/mx/core/elements/NormalNotes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NormalNotes ) - - inline NormalNotesPtr makeNormalNotes() { return std::make_shared(); } - inline NormalNotesPtr makeNormalNotes( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline NormalNotesPtr makeNormalNotes( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class NormalNotes : public ElementInterface - { - public: - NormalNotes(); - NormalNotes( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(NormalNotes) + +inline NormalNotesPtr makeNormalNotes() +{ + return std::make_shared(); +} + +inline NormalNotesPtr makeNormalNotes(const NonNegativeInteger &value) +{ + return std::make_shared(value); } + +inline NormalNotesPtr makeNormalNotes(NonNegativeInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class NormalNotes : public ElementInterface +{ + public: + NormalNotes(); + NormalNotes(const NonNegativeInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NonNegativeInteger getValue() const; + void setValue(const NonNegativeInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalType.cpp b/Sourcecode/private/mx/core/elements/NormalType.cpp index 786f96aaf..ef9917ad8 100644 --- a/Sourcecode/private/mx/core/elements/NormalType.cpp +++ b/Sourcecode/private/mx/core/elements/NormalType.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - NormalType::NormalType() - :myValue( NoteTypeValue::eighth ) - {} - - - NormalType::NormalType( const NoteTypeValue& value ) - :myValue( value ) - {} - - - bool NormalType::hasAttributes() const - { - return false; - } - - - bool NormalType::hasContents() const - { - return true; - } - - - std::ostream& NormalType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NormalType::streamName( std::ostream& os ) const - { - os << "normal-type"; - return os; - } +namespace core +{ +NormalType::NormalType() : myValue(NoteTypeValue::eighth) +{ +} +NormalType::NormalType(const NoteTypeValue &value) : myValue(value) +{ +} - std::ostream& NormalType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool NormalType::hasAttributes() const +{ + return false; +} +bool NormalType::hasContents() const +{ + return true; +} - NoteTypeValue NormalType::getValue() const - { - return myValue; - } +std::ostream &NormalType::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &NormalType::streamName(std::ostream &os) const +{ + os << "normal-type"; + return os; +} - void NormalType::setValue( const NoteTypeValue& value ) - { - myValue = value; - } +std::ostream &NormalType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NoteTypeValue NormalType::getValue() const +{ + return myValue; +} - bool NormalType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseNoteTypeValue( xelement.getValue() ); - return true; - } +void NormalType::setValue(const NoteTypeValue &value) +{ + myValue = value; +} - } +bool NormalType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseNoteTypeValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalType.h b/Sourcecode/private/mx/core/elements/NormalType.h index 576618458..105e0299b 100644 --- a/Sourcecode/private/mx/core/elements/NormalType.h +++ b/Sourcecode/private/mx/core/elements/NormalType.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NormalType ) - - inline NormalTypePtr makeNormalType() { return std::make_shared(); } - inline NormalTypePtr makeNormalType( const NoteTypeValue& value ) { return std::make_shared( value ); } - inline NormalTypePtr makeNormalType( NoteTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class NormalType : public ElementInterface - { - public: - NormalType(); - NormalType( const NoteTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteTypeValue getValue() const; - void setValue( const NoteTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteTypeValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(NormalType) + +inline NormalTypePtr makeNormalType() +{ + return std::make_shared(); +} + +inline NormalTypePtr makeNormalType(const NoteTypeValue &value) +{ + return std::make_shared(value); } + +inline NormalTypePtr makeNormalType(NoteTypeValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class NormalType : public ElementInterface +{ + public: + NormalType(); + NormalType(const NoteTypeValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NoteTypeValue getValue() const; + void setValue(const NoteTypeValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NoteTypeValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp b/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp index 60a70ac0f..72165ae52 100644 --- a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp +++ b/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp @@ -10,148 +10,135 @@ namespace mx { - namespace core - { - NormalTypeNormalDotGroup::NormalTypeNormalDotGroup() - :myNormalType( makeNormalType() ) - ,myNormalDotSet() - {} - +namespace core +{ +NormalTypeNormalDotGroup::NormalTypeNormalDotGroup() : myNormalType(makeNormalType()), myNormalDotSet() +{ +} - bool NormalTypeNormalDotGroup::hasAttributes() const - { - return false; - } +bool NormalTypeNormalDotGroup::hasAttributes() const +{ + return false; +} +std::ostream &NormalTypeNormalDotGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& NormalTypeNormalDotGroup::streamAttributes( std::ostream& os ) const - { - return os; - } +std::ostream &NormalTypeNormalDotGroup::streamName(std::ostream &os) const +{ + return os; +} +bool NormalTypeNormalDotGroup::hasContents() const +{ + return true; +} - std::ostream& NormalTypeNormalDotGroup::streamName( std::ostream& os ) const - { - return os; - } +std::ostream &NormalTypeNormalDotGroup::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + isOneLineOnly = false; + myNormalType->toStream(os, indentLevel); + for (auto x : myNormalDotSet) + { + os << std::endl; + x->toStream(os, indentLevel); + } + return os; +} +NormalTypePtr NormalTypeNormalDotGroup::getNormalType() const +{ + return myNormalType; +} - bool NormalTypeNormalDotGroup::hasContents() const - { - return true; - } +void NormalTypeNormalDotGroup::setNormalType(const NormalTypePtr &value) +{ + if (value) + { + myNormalType = value; + } +} +const NormalDotSet &NormalTypeNormalDotGroup::getNormalDotSet() const +{ + return myNormalDotSet; +} - std::ostream& NormalTypeNormalDotGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - myNormalType->toStream( os, indentLevel ); - for ( auto x : myNormalDotSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - return os; - } +void NormalTypeNormalDotGroup::removeNormalDot(const NormalDotSetIterConst &value) +{ + if (value != myNormalDotSet.cend()) + { + myNormalDotSet.erase(value); + } +} +void NormalTypeNormalDotGroup::addNormalDot(const NormalDotPtr &value) +{ + if (value) + { + myNormalDotSet.push_back(value); + } +} - NormalTypePtr NormalTypeNormalDotGroup::getNormalType() const - { - return myNormalType; - } +void NormalTypeNormalDotGroup::clearNormalDotSet() +{ + myNormalDotSet.clear(); +} +NormalDotPtr NormalTypeNormalDotGroup::getNormalDot(const NormalDotSetIterConst &setIterator) const +{ + if (setIterator != myNormalDotSet.cend()) + { + return *setIterator; + } + return NormalDotPtr(); +} - void NormalTypeNormalDotGroup::setNormalType( const NormalTypePtr& value ) - { - if( value ) - { - myNormalType = value; - } - } +bool NormalTypeNormalDotGroup::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isNormalTypeFound = false; + bool isFirstNormalDotAdded = false; + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); - const NormalDotSet& NormalTypeNormalDotGroup::getNormalDotSet() const + if (elementName == "normal-type") { - return myNormalDotSet; + isNormalTypeFound = true; + isSuccess &= myNormalType->fromXElement(message, *it); } - - - void NormalTypeNormalDotGroup::removeNormalDot( const NormalDotSetIterConst& value ) + else if (elementName == "normal-dot") { - if ( value != myNormalDotSet.cend() ) - { - myNormalDotSet.erase( value ); - } - } + auto normalDot = makeNormalDot(); + isSuccess &= normalDot->fromXElement(message, *it); - - void NormalTypeNormalDotGroup::addNormalDot( const NormalDotPtr& value ) - { - if ( value ) + if (!isFirstNormalDotAdded && myNormalDotSet.size() == 1) { - myNormalDotSet.push_back( value ); + *(myNormalDotSet.begin()) = normalDot; + isFirstNormalDotAdded = true; } - } - - - void NormalTypeNormalDotGroup::clearNormalDotSet() - { - myNormalDotSet.clear(); - } - - - NormalDotPtr NormalTypeNormalDotGroup::getNormalDot( const NormalDotSetIterConst& setIterator ) const - { - if( setIterator != myNormalDotSet.cend() ) + else { - return *setIterator; + myNormalDotSet.push_back(normalDot); + isFirstNormalDotAdded = true; } - return NormalDotPtr(); } - - - bool NormalTypeNormalDotGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + else { - bool isSuccess = true; - bool isNormalTypeFound = false; - bool isFirstNormalDotAdded = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + if (!isNormalTypeFound) { - const std::string elementName = it->getName(); - - if( elementName == "normal-type" ) - { - isNormalTypeFound = true; - isSuccess &= myNormalType->fromXElement( message, *it ); - } - else if( elementName == "normal-dot" ) - { - auto normalDot = makeNormalDot(); - isSuccess &= normalDot->fromXElement( message, *it ); - - if( !isFirstNormalDotAdded && myNormalDotSet.size() == 1 ) - { - *( myNormalDotSet.begin() ) = normalDot; - isFirstNormalDotAdded = true; - } - else - { - myNormalDotSet.push_back( normalDot ); - isFirstNormalDotAdded = true; - } - } - else - { - if( !isNormalTypeFound ) - { - isSuccess = false; - message << "NormalTypeNormalDotGroup: 'normal-type' element is required but was not found" << std::endl; - } - break; - } + isSuccess = false; + message << "NormalTypeNormalDotGroup: 'normal-type' element is required but was not found" << std::endl; } - MX_RETURN_IS_SUCCESS; + break; } } + MX_RETURN_IS_SUCCESS; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h b/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h index 4e5a7460e..a1e7045f5 100644 --- a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h +++ b/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,43 +13,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NormalDot ) - MX_FORWARD_DECLARE_ELEMENT( NormalType ) - MX_FORWARD_DECLARE_ELEMENT( NormalTypeNormalDotGroup ) - - inline NormalTypeNormalDotGroupPtr makeNormalTypeNormalDotGroup() { return std::make_shared(); } - - class NormalTypeNormalDotGroup : public ElementInterface - { - public: - NormalTypeNormalDotGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ NormalType minOccurs = 1, maxOccurs = 1 _________ */ - NormalTypePtr getNormalType() const; - void setNormalType( const NormalTypePtr& value ); - - /* _________ NormalDot minOccurs = 0, maxOccurs = unbounded _________ */ - const NormalDotSet& getNormalDotSet() const; - void addNormalDot( const NormalDotPtr& value ); - void removeNormalDot( const NormalDotSetIterConst& value ); - void clearNormalDotSet(); - NormalDotPtr getNormalDot( const NormalDotSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NormalTypePtr myNormalType; - NormalDotSet myNormalDotSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(NormalDot) +MX_FORWARD_DECLARE_ELEMENT(NormalType) +MX_FORWARD_DECLARE_ELEMENT(NormalTypeNormalDotGroup) + +inline NormalTypeNormalDotGroupPtr makeNormalTypeNormalDotGroup() +{ + return std::make_shared(); } + +class NormalTypeNormalDotGroup : public ElementInterface +{ + public: + NormalTypeNormalDotGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ NormalType minOccurs = 1, maxOccurs = 1 _________ */ + NormalTypePtr getNormalType() const; + void setNormalType(const NormalTypePtr &value); + + /* _________ NormalDot minOccurs = 0, maxOccurs = unbounded _________ */ + const NormalDotSet &getNormalDotSet() const; + void addNormalDot(const NormalDotPtr &value); + void removeNormalDot(const NormalDotSetIterConst &value); + void clearNormalDotSet(); + NormalDotPtr getNormalDot(const NormalDotSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NormalTypePtr myNormalType; + NormalDotSet myNormalDotSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Notations.cpp b/Sourcecode/private/mx/core/elements/Notations.cpp index c04477ac3..f57fecbda 100644 --- a/Sourcecode/private/mx/core/elements/Notations.cpp +++ b/Sourcecode/private/mx/core/elements/Notations.cpp @@ -4,7 +4,6 @@ #include "mx/core/elements/Notations.h" #include "mx/core/FromXElement.h" -#include "mx/core/elements/NotationsChoice.h" #include "mx/core/elements/AccidentalMark.h" #include "mx/core/elements/Arpeggiate.h" #include "mx/core/elements/Articulations.h" @@ -15,6 +14,7 @@ #include "mx/core/elements/Glissando.h" #include "mx/core/elements/Level.h" #include "mx/core/elements/NonArpeggiate.h" +#include "mx/core/elements/NotationsChoice.h" #include "mx/core/elements/Ornaments.h" #include "mx/core/elements/OtherNotation.h" #include "mx/core/elements/Slide.h" @@ -26,260 +26,245 @@ namespace mx { - namespace core - { - Notations::Notations() - :myAttributes( std::make_shared() ) - ,myEditorialGroup( makeEditorialGroup() ) - ,myNotationsChoiceSet() - {} +namespace core +{ +Notations::Notations() + : myAttributes(std::make_shared()), myEditorialGroup(makeEditorialGroup()), + myNotationsChoiceSet() +{ +} +bool Notations::hasAttributes() const +{ + return myAttributes->hasValues(); +} - bool Notations::hasAttributes() const - { - return myAttributes->hasValues(); - } +std::ostream &Notations::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Notations::streamName(std::ostream &os) const +{ + os << "notations"; + return os; +} + +bool Notations::hasContents() const +{ + return myEditorialGroup->hasContents() || myNotationsChoiceSet.size() > 0; +} - std::ostream& Notations::streamAttributes( std::ostream& os ) const +std::ostream &Notations::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + if (myEditorialGroup->hasContents()) { - return myAttributes->toStream( os ); + os << std::endl; + myEditorialGroup->streamContents(os, indentLevel + 1, isOneLineOnly); } - - - std::ostream& Notations::streamName( std::ostream& os ) const + for (auto x : myNotationsChoiceSet) { - os << "notations"; - return os; + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); } + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +NotationsAttributesPtr Notations::getAttributes() const +{ + return myAttributes; +} - bool Notations::hasContents() const - { - return myEditorialGroup->hasContents() || myNotationsChoiceSet.size() > 0; - } +void Notations::setAttributes(const NotationsAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +EditorialGroupPtr Notations::getEditorialGroup() const +{ + return myEditorialGroup; +} - std::ostream& Notations::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - for ( auto x : myNotationsChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } +void Notations::setEditorialGroup(const EditorialGroupPtr &value) +{ + if (value) + { + myEditorialGroup = value; + } +} +const NotationsChoiceSet &Notations::getNotationsChoiceSet() const +{ + return myNotationsChoiceSet; +} - NotationsAttributesPtr Notations::getAttributes() const - { - return myAttributes; - } +void Notations::addNotationsChoice(const NotationsChoicePtr &value) +{ + if (value) + { + myNotationsChoiceSet.push_back(value); + } +} +void Notations::removeNotationsChoice(const NotationsChoiceSetIterConst &value) +{ + if (value != myNotationsChoiceSet.cend()) + { + myNotationsChoiceSet.erase(value); + } +} - void Notations::setAttributes( const NotationsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +void Notations::clearNotationsChoiceSet() +{ + myNotationsChoiceSet.clear(); +} +NotationsChoicePtr Notations::getNotationsChoice(const NotationsChoiceSetIterConst &setIterator) const +{ + if (setIterator != myNotationsChoiceSet.cend()) + { + return *setIterator; + } + return NotationsChoicePtr(); +} - EditorialGroupPtr Notations::getEditorialGroup() const - { - return myEditorialGroup; - } +bool Notations::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); - void Notations::setEditorialGroup( const EditorialGroupPtr& value ) + if (elementName == "footnote") { - if ( value ) - { - myEditorialGroup = value; - } + myEditorialGroup->setHasFootnote(true); + isSuccess &= myEditorialGroup->getFootnote()->fromXElement(message, *it); } - - - const NotationsChoiceSet& Notations::getNotationsChoiceSet() const + else if (elementName == "level") { - return myNotationsChoiceSet; + myEditorialGroup->setHasLevel(true); + isSuccess &= myEditorialGroup->getLevel()->fromXElement(message, *it); } - - - void Notations::addNotationsChoice( const NotationsChoicePtr& value ) + else if (elementName == "tied") { - if ( value ) - { - myNotationsChoiceSet.push_back( value ); - } + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::tied); + isSuccess &= choice->getTied()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); } - - - void Notations::removeNotationsChoice( const NotationsChoiceSetIterConst& value ) + else if (elementName == "tuplet") { - if ( value != myNotationsChoiceSet.cend() ) - { - myNotationsChoiceSet.erase( value ); - } + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::tuplet); + isSuccess &= choice->getTuplet()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); } - - - void Notations::clearNotationsChoiceSet() + else if (elementName == "slur") { - myNotationsChoiceSet.clear(); + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::slur); + isSuccess &= choice->getSlur()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); } - - - NotationsChoicePtr Notations::getNotationsChoice( const NotationsChoiceSetIterConst& setIterator ) const + else if (elementName == "glissando") { - if( setIterator != myNotationsChoiceSet.cend() ) - { - return *setIterator; - } - return NotationsChoicePtr(); + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::glissando); + isSuccess &= choice->getGlissando()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); } - - - bool Notations::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + else if (elementName == "slide") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::slide); + isSuccess &= choice->getSlide()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "ornaments") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::ornaments); + isSuccess &= choice->getOrnaments()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "technical") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::technical); + isSuccess &= choice->getTechnical()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "articulations") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::articulations); + isSuccess &= choice->getArticulations()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "dynamics") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::dynamics); + isSuccess &= choice->getDynamics()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "fermata") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::fermata); + isSuccess &= choice->getFermata()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "arpeggiate") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::arpeggiate); + isSuccess &= choice->getArpeggiate()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "non-arpeggiate") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::nonArpeggiate); + isSuccess &= choice->getNonArpeggiate()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "accidental-mark") + { + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::accidentalMark); + isSuccess &= choice->getAccidentalMark()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else if (elementName == "other-notations") { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "footnote" ) - { - myEditorialGroup->setHasFootnote( true ); - isSuccess &= myEditorialGroup->getFootnote()->fromXElement( message, *it ); - } - else if ( elementName == "level" ) - { - myEditorialGroup->setHasLevel( true ); - isSuccess &= myEditorialGroup->getLevel()->fromXElement( message, *it ); - } - else if ( elementName == "tied" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::tied ); - isSuccess &= choice->getTied()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "tuplet" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::tuplet ); - isSuccess &= choice->getTuplet()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "slur" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::slur ); - isSuccess &= choice->getSlur()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "glissando" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::glissando ); - isSuccess &= choice->getGlissando()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "slide" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::slide ); - isSuccess &= choice->getSlide()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "ornaments" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::ornaments ); - isSuccess &= choice->getOrnaments()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "technical" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::technical ); - isSuccess &= choice->getTechnical()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "articulations" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::articulations ); - isSuccess &= choice->getArticulations()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "dynamics" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::dynamics ); - isSuccess &= choice->getDynamics()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "fermata" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::fermata ); - isSuccess &= choice->getFermata()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "arpeggiate" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::arpeggiate ); - isSuccess &= choice->getArpeggiate()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "non-arpeggiate" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::nonArpeggiate ); - isSuccess &= choice->getNonArpeggiate()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "accidental-mark" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::accidentalMark ); - isSuccess &= choice->getAccidentalMark()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "other-notations" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::otherNotation ); - isSuccess &= choice->getOtherNotation()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else - { - isSuccess = false; - message << "Notations: fromXElement unexpected element '" << elementName << "' encountered" << std::endl; - } - } - - MX_RETURN_IS_SUCCESS; + auto choice = makeNotationsChoice(); + choice->setChoice(NotationsChoice::Choice::otherNotation); + isSuccess &= choice->getOtherNotation()->fromXElement(message, *it); + myNotationsChoiceSet.push_back(choice); + } + else + { + isSuccess = false; + message << "Notations: fromXElement unexpected element '" << elementName << "' encountered" << std::endl; } } + + MX_RETURN_IS_SUCCESS; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Notations.h b/Sourcecode/private/mx/core/elements/Notations.h index ca2b286be..60484ac83 100644 --- a/Sourcecode/private/mx/core/elements/Notations.h +++ b/Sourcecode/private/mx/core/elements/Notations.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/NotationsAttributes.h" #include @@ -14,47 +14,50 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NotationsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( NotationsChoice ) - MX_FORWARD_DECLARE_ELEMENT( Notations ) - - inline NotationsPtr makeNotations() { return std::make_shared(); } - - class Notations : public ElementInterface - { - public: - Notations(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NotationsAttributesPtr getAttributes() const; - void setAttributes( const NotationsAttributesPtr& value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - /* _________ NotationsChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const NotationsChoiceSet& getNotationsChoiceSet() const; - void addNotationsChoice( const NotationsChoicePtr& value ); - void removeNotationsChoice( const NotationsChoiceSetIterConst& value ); - void clearNotationsChoiceSet(); - NotationsChoicePtr getNotationsChoice( const NotationsChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NotationsAttributesPtr myAttributes; - EditorialGroupPtr myEditorialGroup; - NotationsChoiceSet myNotationsChoiceSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(NotationsAttributes) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) +MX_FORWARD_DECLARE_ELEMENT(NotationsChoice) +MX_FORWARD_DECLARE_ELEMENT(Notations) + +inline NotationsPtr makeNotations() +{ + return std::make_shared(); } + +class Notations : public ElementInterface +{ + public: + Notations(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NotationsAttributesPtr getAttributes() const; + void setAttributes(const NotationsAttributesPtr &value); + + /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialGroupPtr getEditorialGroup() const; + void setEditorialGroup(const EditorialGroupPtr &value); + + /* _________ NotationsChoice minOccurs = 0, maxOccurs = unbounded _________ */ + const NotationsChoiceSet &getNotationsChoiceSet() const; + void addNotationsChoice(const NotationsChoicePtr &value); + void removeNotationsChoice(const NotationsChoiceSetIterConst &value); + void clearNotationsChoiceSet(); + NotationsChoicePtr getNotationsChoice(const NotationsChoiceSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NotationsAttributesPtr myAttributes; + EditorialGroupPtr myEditorialGroup; + NotationsChoiceSet myNotationsChoiceSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NotationsAttributes.cpp b/Sourcecode/private/mx/core/elements/NotationsAttributes.cpp index e07aa4fa4..82545a8a0 100644 --- a/Sourcecode/private/mx/core/elements/NotationsAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/NotationsAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - NotationsAttributes::NotationsAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - +namespace core +{ +NotationsAttributes::NotationsAttributes() : printObject(YesNo::no), hasPrintObject(false) +{ +} - bool NotationsAttributes::hasValues() const - { - return hasPrintObject; - } +bool NotationsAttributes::hasValues() const +{ + return hasPrintObject; +} +std::ostream &NotationsAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} - std::ostream& NotationsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } +bool NotationsAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "NotationsAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool NotationsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - const char* const className = "NotationsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NotationsAttributes.h b/Sourcecode/private/mx/core/elements/NotationsAttributes.h index 729f831bc..32da3f764 100644 --- a/Sourcecode/private/mx/core/elements/NotationsAttributes.h +++ b/Sourcecode/private/mx/core/elements/NotationsAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( NotationsAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(NotationsAttributes) - struct NotationsAttributes : public AttributesInterface - { - public: - NotationsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; +struct NotationsAttributes : public AttributesInterface +{ + public: + NotationsAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NotationsChoice.cpp b/Sourcecode/private/mx/core/elements/NotationsChoice.cpp index 9575b591c..799bd207f 100644 --- a/Sourcecode/private/mx/core/elements/NotationsChoice.cpp +++ b/Sourcecode/private/mx/core/elements/NotationsChoice.cpp @@ -22,328 +22,283 @@ namespace mx { - namespace core - { - NotationsChoice::NotationsChoice() - :myChoice( Choice::tied ) - ,myTied( makeTied() ) - ,mySlur( makeSlur() ) - ,myTuplet( makeTuplet() ) - ,myGlissando( makeGlissando() ) - ,mySlide( makeSlide() ) - ,myOrnaments( makeOrnaments() ) - ,myTechnical( makeTechnical() ) - ,myArticulations( makeArticulations() ) - ,myDynamics( makeDynamics() ) - ,myFermata( makeFermata() ) - ,myArpeggiate( makeArpeggiate() ) - ,myNonArpeggiate( makeNonArpeggiate() ) - ,myAccidentalMark( makeAccidentalMark() ) - ,myOtherNotation( makeOtherNotation() ) - {} - - - bool NotationsChoice::hasAttributes() const - { - return false; - } - - - std::ostream& NotationsChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NotationsChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool NotationsChoice::hasContents() const - { - return true; - } - - - std::ostream& NotationsChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::tied: - myTied->toStream( os, indentLevel ); - break; - case Choice::slur: - mySlur->toStream( os, indentLevel ); - break; - case Choice::tuplet: - myTuplet->toStream( os, indentLevel ); - break; - case Choice::glissando: - myGlissando->toStream( os, indentLevel ); - break; - case Choice::slide: - mySlide->toStream( os, indentLevel ); - break; - case Choice::ornaments: - myOrnaments->toStream( os, indentLevel ); - break; - case Choice::technical: - myTechnical->toStream( os, indentLevel ); - break; - case Choice::articulations: - myArticulations->toStream( os, indentLevel ); - break; - case Choice::dynamics: - myDynamics->toStream( os, indentLevel ); - break; - case Choice::fermata: - myFermata->toStream( os, indentLevel ); - break; - case Choice::arpeggiate: - myArpeggiate->toStream( os, indentLevel ); - break; - case Choice::nonArpeggiate: - myNonArpeggiate->toStream( os, indentLevel ); - break; - case Choice::accidentalMark: - myAccidentalMark->toStream( os, indentLevel ); - break; - case Choice::otherNotation: - myOtherNotation->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = hasContents(); - return os; - } - - - NotationsChoice::Choice NotationsChoice::getChoice() const - { - return myChoice; - } - - - void NotationsChoice::setChoice( const NotationsChoice::Choice value ) - { - myChoice = value; - } - - - TiedPtr NotationsChoice::getTied() const - { - return myTied; - } - - - void NotationsChoice::setTied( const TiedPtr& value ) - { - if( value ) - { - myTied = value; - } - } - - - SlurPtr NotationsChoice::getSlur() const - { - return mySlur; - } - - - void NotationsChoice::setSlur( const SlurPtr& value ) - { - if( value ) - { - mySlur = value; - } - } - - - TupletPtr NotationsChoice::getTuplet() const - { - return myTuplet; - } - - - void NotationsChoice::setTuplet( const TupletPtr& value ) - { - if( value ) - { - myTuplet = value; - } - } - - - GlissandoPtr NotationsChoice::getGlissando() const - { - return myGlissando; - } - - - void NotationsChoice::setGlissando( const GlissandoPtr& value ) - { - if( value ) - { - myGlissando = value; - } - } - - - SlidePtr NotationsChoice::getSlide() const - { - return mySlide; - } - - - void NotationsChoice::setSlide( const SlidePtr& value ) - { - if( value ) - { - mySlide = value; - } - } - - - OrnamentsPtr NotationsChoice::getOrnaments() const - { - return myOrnaments; - } +namespace core +{ +NotationsChoice::NotationsChoice() + : myChoice(Choice::tied), myTied(makeTied()), mySlur(makeSlur()), myTuplet(makeTuplet()), + myGlissando(makeGlissando()), mySlide(makeSlide()), myOrnaments(makeOrnaments()), myTechnical(makeTechnical()), + myArticulations(makeArticulations()), myDynamics(makeDynamics()), myFermata(makeFermata()), + myArpeggiate(makeArpeggiate()), myNonArpeggiate(makeNonArpeggiate()), myAccidentalMark(makeAccidentalMark()), + myOtherNotation(makeOtherNotation()) +{ +} +bool NotationsChoice::hasAttributes() const +{ + return false; +} - void NotationsChoice::setOrnaments( const OrnamentsPtr& value ) - { - if( value ) - { - myOrnaments = value; - } - } +std::ostream &NotationsChoice::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &NotationsChoice::streamName(std::ostream &os) const +{ + return os; +} - TechnicalPtr NotationsChoice::getTechnical() const - { - return myTechnical; - } +bool NotationsChoice::hasContents() const +{ + return true; +} +std::ostream &NotationsChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::tied: + myTied->toStream(os, indentLevel); + break; + case Choice::slur: + mySlur->toStream(os, indentLevel); + break; + case Choice::tuplet: + myTuplet->toStream(os, indentLevel); + break; + case Choice::glissando: + myGlissando->toStream(os, indentLevel); + break; + case Choice::slide: + mySlide->toStream(os, indentLevel); + break; + case Choice::ornaments: + myOrnaments->toStream(os, indentLevel); + break; + case Choice::technical: + myTechnical->toStream(os, indentLevel); + break; + case Choice::articulations: + myArticulations->toStream(os, indentLevel); + break; + case Choice::dynamics: + myDynamics->toStream(os, indentLevel); + break; + case Choice::fermata: + myFermata->toStream(os, indentLevel); + break; + case Choice::arpeggiate: + myArpeggiate->toStream(os, indentLevel); + break; + case Choice::nonArpeggiate: + myNonArpeggiate->toStream(os, indentLevel); + break; + case Choice::accidentalMark: + myAccidentalMark->toStream(os, indentLevel); + break; + case Choice::otherNotation: + myOtherNotation->toStream(os, indentLevel); + break; + default: + break; + } + isOneLineOnly = hasContents(); + return os; +} - void NotationsChoice::setTechnical( const TechnicalPtr& value ) - { - if( value ) - { - myTechnical = value; - } - } +NotationsChoice::Choice NotationsChoice::getChoice() const +{ + return myChoice; +} +void NotationsChoice::setChoice(const NotationsChoice::Choice value) +{ + myChoice = value; +} - ArticulationsPtr NotationsChoice::getArticulations() const - { - return myArticulations; - } +TiedPtr NotationsChoice::getTied() const +{ + return myTied; +} +void NotationsChoice::setTied(const TiedPtr &value) +{ + if (value) + { + myTied = value; + } +} - void NotationsChoice::setArticulations( const ArticulationsPtr& value ) - { - if( value ) - { - myArticulations = value; - } - } +SlurPtr NotationsChoice::getSlur() const +{ + return mySlur; +} +void NotationsChoice::setSlur(const SlurPtr &value) +{ + if (value) + { + mySlur = value; + } +} - DynamicsPtr NotationsChoice::getDynamics() const - { - return myDynamics; - } +TupletPtr NotationsChoice::getTuplet() const +{ + return myTuplet; +} +void NotationsChoice::setTuplet(const TupletPtr &value) +{ + if (value) + { + myTuplet = value; + } +} - void NotationsChoice::setDynamics( const DynamicsPtr& value ) - { - if( value ) - { - myDynamics = value; - } - } +GlissandoPtr NotationsChoice::getGlissando() const +{ + return myGlissando; +} +void NotationsChoice::setGlissando(const GlissandoPtr &value) +{ + if (value) + { + myGlissando = value; + } +} - FermataPtr NotationsChoice::getFermata() const - { - return myFermata; - } +SlidePtr NotationsChoice::getSlide() const +{ + return mySlide; +} +void NotationsChoice::setSlide(const SlidePtr &value) +{ + if (value) + { + mySlide = value; + } +} - void NotationsChoice::setFermata( const FermataPtr& value ) - { - if( value ) - { - myFermata = value; - } - } +OrnamentsPtr NotationsChoice::getOrnaments() const +{ + return myOrnaments; +} +void NotationsChoice::setOrnaments(const OrnamentsPtr &value) +{ + if (value) + { + myOrnaments = value; + } +} - ArpeggiatePtr NotationsChoice::getArpeggiate() const - { - return myArpeggiate; - } +TechnicalPtr NotationsChoice::getTechnical() const +{ + return myTechnical; +} +void NotationsChoice::setTechnical(const TechnicalPtr &value) +{ + if (value) + { + myTechnical = value; + } +} - void NotationsChoice::setArpeggiate( const ArpeggiatePtr& value ) - { - if( value ) - { - myArpeggiate = value; - } - } +ArticulationsPtr NotationsChoice::getArticulations() const +{ + return myArticulations; +} +void NotationsChoice::setArticulations(const ArticulationsPtr &value) +{ + if (value) + { + myArticulations = value; + } +} - NonArpeggiatePtr NotationsChoice::getNonArpeggiate() const - { - return myNonArpeggiate; - } +DynamicsPtr NotationsChoice::getDynamics() const +{ + return myDynamics; +} +void NotationsChoice::setDynamics(const DynamicsPtr &value) +{ + if (value) + { + myDynamics = value; + } +} - void NotationsChoice::setNonArpeggiate( const NonArpeggiatePtr& value ) - { - if( value ) - { - myNonArpeggiate = value; - } - } +FermataPtr NotationsChoice::getFermata() const +{ + return myFermata; +} +void NotationsChoice::setFermata(const FermataPtr &value) +{ + if (value) + { + myFermata = value; + } +} - AccidentalMarkPtr NotationsChoice::getAccidentalMark() const - { - return myAccidentalMark; - } +ArpeggiatePtr NotationsChoice::getArpeggiate() const +{ + return myArpeggiate; +} +void NotationsChoice::setArpeggiate(const ArpeggiatePtr &value) +{ + if (value) + { + myArpeggiate = value; + } +} - void NotationsChoice::setAccidentalMark( const AccidentalMarkPtr& value ) - { - if( value ) - { - myAccidentalMark = value; - } - } +NonArpeggiatePtr NotationsChoice::getNonArpeggiate() const +{ + return myNonArpeggiate; +} +void NotationsChoice::setNonArpeggiate(const NonArpeggiatePtr &value) +{ + if (value) + { + myNonArpeggiate = value; + } +} - OtherNotationPtr NotationsChoice::getOtherNotation() const - { - return myOtherNotation; - } +AccidentalMarkPtr NotationsChoice::getAccidentalMark() const +{ + return myAccidentalMark; +} +void NotationsChoice::setAccidentalMark(const AccidentalMarkPtr &value) +{ + if (value) + { + myAccidentalMark = value; + } +} - void NotationsChoice::setOtherNotation( const OtherNotationPtr& value ) - { - if( value ) - { - myOtherNotation = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( NotationsChoice ); +OtherNotationPtr NotationsChoice::getOtherNotation() const +{ + return myOtherNotation; +} +void NotationsChoice::setOtherNotation(const OtherNotationPtr &value) +{ + if (value) + { + myOtherNotation = value; } } + +MX_FROM_XELEMENT_UNUSED(NotationsChoice); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NotationsChoice.h b/Sourcecode/private/mx/core/elements/NotationsChoice.h index cc1a1ec98..ff3b394af 100644 --- a/Sourcecode/private/mx/core/elements/NotationsChoice.h +++ b/Sourcecode/private/mx/core/elements/NotationsChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,134 +13,137 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( AccidentalMark ) - MX_FORWARD_DECLARE_ELEMENT( Arpeggiate ) - MX_FORWARD_DECLARE_ELEMENT( Articulations ) - MX_FORWARD_DECLARE_ELEMENT( Dynamics ) - MX_FORWARD_DECLARE_ELEMENT( Fermata ) - MX_FORWARD_DECLARE_ELEMENT( Glissando ) - MX_FORWARD_DECLARE_ELEMENT( NonArpeggiate ) - MX_FORWARD_DECLARE_ELEMENT( Ornaments ) - MX_FORWARD_DECLARE_ELEMENT( OtherNotation ) - MX_FORWARD_DECLARE_ELEMENT( Slide ) - MX_FORWARD_DECLARE_ELEMENT( Slur ) - MX_FORWARD_DECLARE_ELEMENT( Technical ) - MX_FORWARD_DECLARE_ELEMENT( Tied ) - MX_FORWARD_DECLARE_ELEMENT( Tuplet ) - MX_FORWARD_DECLARE_ELEMENT( NotationsChoice ) - - inline NotationsChoicePtr makeNotationsChoice() { return std::make_shared(); } - - class NotationsChoice : public ElementInterface - { - public: - enum class Choice - { - tied = 1, - slur = 2, - tuplet = 3, - glissando = 4, - slide = 5, - ornaments = 6, - technical = 7, - articulations = 8, - dynamics = 9, - fermata = 10, - arpeggiate = 11, - nonArpeggiate = 12, - accidentalMark = 13, - otherNotation = 14 - }; - NotationsChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - NotationsChoice::Choice getChoice() const; - void setChoice( const NotationsChoice::Choice value ); - - /* _________ Tied minOccurs = 1, maxOccurs = 1 _________ */ - TiedPtr getTied() const; - void setTied( const TiedPtr& value ); - - /* _________ Slur minOccurs = 1, maxOccurs = 1 _________ */ - SlurPtr getSlur() const; - void setSlur( const SlurPtr& value ); - - /* _________ Tuplet minOccurs = 1, maxOccurs = 1 _________ */ - TupletPtr getTuplet() const; - void setTuplet( const TupletPtr& value ); - - /* _________ Glissando minOccurs = 1, maxOccurs = 1 _________ */ - GlissandoPtr getGlissando() const; - void setGlissando( const GlissandoPtr& value ); - - /* _________ Slide minOccurs = 1, maxOccurs = 1 _________ */ - SlidePtr getSlide() const; - void setSlide( const SlidePtr& value ); - - /* _________ Ornaments minOccurs = 1, maxOccurs = 1 _________ */ - OrnamentsPtr getOrnaments() const; - void setOrnaments( const OrnamentsPtr& value ); - - /* _________ Technical minOccurs = 1, maxOccurs = 1 _________ */ - TechnicalPtr getTechnical() const; - void setTechnical( const TechnicalPtr& value ); - - /* _________ Articulations minOccurs = 1, maxOccurs = 1 _________ */ - ArticulationsPtr getArticulations() const; - void setArticulations( const ArticulationsPtr& value ); - - /* _________ Dynamics minOccurs = 1, maxOccurs = 1 _________ */ - DynamicsPtr getDynamics() const; - void setDynamics( const DynamicsPtr& value ); - - /* _________ Fermata minOccurs = 1, maxOccurs = 1 _________ */ - FermataPtr getFermata() const; - void setFermata( const FermataPtr& value ); - - /* _________ Arpeggiate minOccurs = 1, maxOccurs = 1 _________ */ - ArpeggiatePtr getArpeggiate() const; - void setArpeggiate( const ArpeggiatePtr& value ); - - /* _________ NonArpeggiate minOccurs = 1, maxOccurs = 1 _________ */ - NonArpeggiatePtr getNonArpeggiate() const; - void setNonArpeggiate( const NonArpeggiatePtr& value ); - - /* _________ AccidentalMark minOccurs = 1, maxOccurs = 1 _________ */ - AccidentalMarkPtr getAccidentalMark() const; - void setAccidentalMark( const AccidentalMarkPtr& value ); - - /* _________ OtherNotation minOccurs = 1, maxOccurs = 1 _________ */ - OtherNotationPtr getOtherNotation() const; - void setOtherNotation( const OtherNotationPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - TiedPtr myTied; - SlurPtr mySlur; - TupletPtr myTuplet; - GlissandoPtr myGlissando; - SlidePtr mySlide; - OrnamentsPtr myOrnaments; - TechnicalPtr myTechnical; - ArticulationsPtr myArticulations; - DynamicsPtr myDynamics; - FermataPtr myFermata; - ArpeggiatePtr myArpeggiate; - NonArpeggiatePtr myNonArpeggiate; - AccidentalMarkPtr myAccidentalMark; - OtherNotationPtr myOtherNotation; - }; - } +MX_FORWARD_DECLARE_ELEMENT(AccidentalMark) +MX_FORWARD_DECLARE_ELEMENT(Arpeggiate) +MX_FORWARD_DECLARE_ELEMENT(Articulations) +MX_FORWARD_DECLARE_ELEMENT(Dynamics) +MX_FORWARD_DECLARE_ELEMENT(Fermata) +MX_FORWARD_DECLARE_ELEMENT(Glissando) +MX_FORWARD_DECLARE_ELEMENT(NonArpeggiate) +MX_FORWARD_DECLARE_ELEMENT(Ornaments) +MX_FORWARD_DECLARE_ELEMENT(OtherNotation) +MX_FORWARD_DECLARE_ELEMENT(Slide) +MX_FORWARD_DECLARE_ELEMENT(Slur) +MX_FORWARD_DECLARE_ELEMENT(Technical) +MX_FORWARD_DECLARE_ELEMENT(Tied) +MX_FORWARD_DECLARE_ELEMENT(Tuplet) +MX_FORWARD_DECLARE_ELEMENT(NotationsChoice) + +inline NotationsChoicePtr makeNotationsChoice() +{ + return std::make_shared(); } + +class NotationsChoice : public ElementInterface +{ + public: + enum class Choice + { + tied = 1, + slur = 2, + tuplet = 3, + glissando = 4, + slide = 5, + ornaments = 6, + technical = 7, + articulations = 8, + dynamics = 9, + fermata = 10, + arpeggiate = 11, + nonArpeggiate = 12, + accidentalMark = 13, + otherNotation = 14 + }; + NotationsChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + NotationsChoice::Choice getChoice() const; + void setChoice(const NotationsChoice::Choice value); + + /* _________ Tied minOccurs = 1, maxOccurs = 1 _________ */ + TiedPtr getTied() const; + void setTied(const TiedPtr &value); + + /* _________ Slur minOccurs = 1, maxOccurs = 1 _________ */ + SlurPtr getSlur() const; + void setSlur(const SlurPtr &value); + + /* _________ Tuplet minOccurs = 1, maxOccurs = 1 _________ */ + TupletPtr getTuplet() const; + void setTuplet(const TupletPtr &value); + + /* _________ Glissando minOccurs = 1, maxOccurs = 1 _________ */ + GlissandoPtr getGlissando() const; + void setGlissando(const GlissandoPtr &value); + + /* _________ Slide minOccurs = 1, maxOccurs = 1 _________ */ + SlidePtr getSlide() const; + void setSlide(const SlidePtr &value); + + /* _________ Ornaments minOccurs = 1, maxOccurs = 1 _________ */ + OrnamentsPtr getOrnaments() const; + void setOrnaments(const OrnamentsPtr &value); + + /* _________ Technical minOccurs = 1, maxOccurs = 1 _________ */ + TechnicalPtr getTechnical() const; + void setTechnical(const TechnicalPtr &value); + + /* _________ Articulations minOccurs = 1, maxOccurs = 1 _________ */ + ArticulationsPtr getArticulations() const; + void setArticulations(const ArticulationsPtr &value); + + /* _________ Dynamics minOccurs = 1, maxOccurs = 1 _________ */ + DynamicsPtr getDynamics() const; + void setDynamics(const DynamicsPtr &value); + + /* _________ Fermata minOccurs = 1, maxOccurs = 1 _________ */ + FermataPtr getFermata() const; + void setFermata(const FermataPtr &value); + + /* _________ Arpeggiate minOccurs = 1, maxOccurs = 1 _________ */ + ArpeggiatePtr getArpeggiate() const; + void setArpeggiate(const ArpeggiatePtr &value); + + /* _________ NonArpeggiate minOccurs = 1, maxOccurs = 1 _________ */ + NonArpeggiatePtr getNonArpeggiate() const; + void setNonArpeggiate(const NonArpeggiatePtr &value); + + /* _________ AccidentalMark minOccurs = 1, maxOccurs = 1 _________ */ + AccidentalMarkPtr getAccidentalMark() const; + void setAccidentalMark(const AccidentalMarkPtr &value); + + /* _________ OtherNotation minOccurs = 1, maxOccurs = 1 _________ */ + OtherNotationPtr getOtherNotation() const; + void setOtherNotation(const OtherNotationPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + TiedPtr myTied; + SlurPtr mySlur; + TupletPtr myTuplet; + GlissandoPtr myGlissando; + SlidePtr mySlide; + OrnamentsPtr myOrnaments; + TechnicalPtr myTechnical; + ArticulationsPtr myArticulations; + DynamicsPtr myDynamics; + FermataPtr myFermata; + ArpeggiatePtr myArpeggiate; + NonArpeggiatePtr myNonArpeggiate; + AccidentalMarkPtr myAccidentalMark; + OtherNotationPtr myOtherNotation; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Note.cpp b/Sourcecode/private/mx/core/elements/Note.cpp index eba64984f..7f2589484 100644 --- a/Sourcecode/private/mx/core/elements/Note.cpp +++ b/Sourcecode/private/mx/core/elements/Note.cpp @@ -6,6 +6,7 @@ #include "mx/core/FromXElement.h" #include "mx/core/elements/Accidental.h" #include "mx/core/elements/Beam.h" +#include "mx/core/elements/Cue.h" #include "mx/core/elements/CueNoteGroup.h" #include "mx/core/elements/Dot.h" #include "mx/core/elements/Duration.h" @@ -13,22 +14,21 @@ #include "mx/core/elements/Footnote.h" #include "mx/core/elements/FullNoteGroup.h" #include "mx/core/elements/FullNoteTypeChoice.h" -#include "mx/core/elements/GraceNoteGroup.h" #include "mx/core/elements/Grace.h" -#include "mx/core/elements/Cue.h" +#include "mx/core/elements/GraceNoteGroup.h" #include "mx/core/elements/Instrument.h" #include "mx/core/elements/Level.h" #include "mx/core/elements/Lyric.h" +#include "mx/core/elements/NormalNoteGroup.h" #include "mx/core/elements/Notations.h" #include "mx/core/elements/NoteChoice.h" #include "mx/core/elements/Notehead.h" #include "mx/core/elements/NoteheadText.h" -#include "mx/core/elements/NormalNoteGroup.h" #include "mx/core/elements/Pitch.h" #include "mx/core/elements/Play.h" +#include "mx/core/elements/Rest.h" #include "mx/core/elements/Staff.h" #include "mx/core/elements/Stem.h" -#include "mx/core/elements/Rest.h" #include "mx/core/elements/Tie.h" #include "mx/core/elements/TimeModification.h" #include "mx/core/elements/Type.h" @@ -38,950 +38,858 @@ namespace mx { - namespace core - { - Note::Note() - :myAttributes( nullptr ) - ,myNoteChoice( nullptr ) - ,myInstrument( nullptr ) - ,myHasInstrument( false ) - ,myEditorialVoiceGroup( nullptr ) - ,myType( nullptr ) - ,myHasType( false ) - ,myDotSet() - ,myAccidental( nullptr ) - ,myHasAccidental( false ) - ,myTimeModification( nullptr ) - ,myHasTimeModification( false ) - ,myStem( nullptr ) - ,myHasStem( false ) - ,myNotehead( nullptr ) - ,myHasNotehead( false ) - ,myNoteheadText( nullptr ) - ,myHasNoteheadText( false ) - ,myStaff( nullptr ) - ,myHasStaff( false ) - ,myBeamSet() - ,myNotationsSet() - ,myLyricSet() - ,myPlay( nullptr ) - ,myHasPlay( false ) - {} - - - bool Note::hasAttributes() const - { - return getAttributes()->hasValues(); - } - +namespace core +{ +Note::Note() + : myAttributes(nullptr), myNoteChoice(nullptr), myInstrument(nullptr), myHasInstrument(false), + myEditorialVoiceGroup(nullptr), myType(nullptr), myHasType(false), myDotSet(), myAccidental(nullptr), + myHasAccidental(false), myTimeModification(nullptr), myHasTimeModification(false), myStem(nullptr), + myHasStem(false), myNotehead(nullptr), myHasNotehead(false), myNoteheadText(nullptr), myHasNoteheadText(false), + myStaff(nullptr), myHasStaff(false), myBeamSet(), myNotationsSet(), myLyricSet(), myPlay(nullptr), + myHasPlay(false) +{ +} - std::ostream& Note::streamAttributes( std::ostream& os ) const - { - return getAttributes()->toStream( os ); - } +bool Note::hasAttributes() const +{ + return getAttributes()->hasValues(); +} +std::ostream &Note::streamAttributes(std::ostream &os) const +{ + return getAttributes()->toStream(os); +} - std::ostream& Note::streamName( std::ostream& os ) const - { - os << "note"; - return os; - } +std::ostream &Note::streamName(std::ostream &os) const +{ + os << "note"; + return os; +} +bool Note::hasContents() const +{ + return true; +} - bool Note::hasContents() const - { - return true; - } +std::ostream &Note::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + getNoteChoice()->streamContents(os, indentLevel + 1, isOneLineOnly); + if (myHasInstrument) + { + os << std::endl; + getInstrument()->toStream(os, indentLevel + 1); + } + if (getEditorialVoiceGroup()->hasContents()) + { + os << std::endl; + getEditorialVoiceGroup()->streamContents(os, indentLevel + 1, isOneLineOnly); + } + if (myHasType) + { + os << std::endl; + getType()->toStream(os, indentLevel + 1); + } + for (auto x : myDotSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + if (myHasAccidental) + { + os << std::endl; + getAccidental()->toStream(os, indentLevel + 1); + } + if (myHasTimeModification) + { + os << std::endl; + getTimeModification()->toStream(os, indentLevel + 1); + } + if (myHasStem) + { + os << std::endl; + getStem()->toStream(os, indentLevel + 1); + } + if (myHasNotehead) + { + os << std::endl; + getNotehead()->toStream(os, indentLevel + 1); + } + if (myHasNoteheadText) + { + os << std::endl; + getNoteheadText()->toStream(os, indentLevel + 1); + } + if (myHasStaff) + { + os << std::endl; + getStaff()->toStream(os, indentLevel + 1); + } + for (auto x : myBeamSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myNotationsSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myLyricSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + if (myHasPlay) + { + os << std::endl; + getPlay()->toStream(os, indentLevel + 1); + } + isOneLineOnly = false; + os << std::endl; + return os; +} +NoteAttributesPtr Note::getAttributes() const +{ + MX_LOCK; + MX_JIT_ALLOCATE_ATTRIBUTES(NoteAttributes); + return myAttributes; +} - std::ostream& Note::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - getNoteChoice()->streamContents( os, indentLevel+1, isOneLineOnly ); - if ( myHasInstrument ) - { - os << std::endl; - getInstrument()->toStream( os, indentLevel+1 ); - } - if ( getEditorialVoiceGroup()->hasContents() ) - { - os << std::endl; - getEditorialVoiceGroup()->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasType ) - { - os << std::endl; - getType()->toStream( os, indentLevel+1 ); - } - for ( auto x : myDotSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasAccidental ) - { - os << std::endl; - getAccidental()->toStream( os, indentLevel+1 ); - } - if ( myHasTimeModification ) - { - os << std::endl; - getTimeModification()->toStream( os, indentLevel+1 ); - } - if ( myHasStem ) - { - os << std::endl; - getStem()->toStream( os, indentLevel+1 ); - } - if ( myHasNotehead ) - { - os << std::endl; - getNotehead()->toStream( os, indentLevel+1 ); - } - if ( myHasNoteheadText ) - { - os << std::endl; - getNoteheadText()->toStream( os, indentLevel+1 ); - } - if ( myHasStaff ) - { - os << std::endl; - getStaff()->toStream( os, indentLevel+1 ); - } - for ( auto x : myBeamSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myNotationsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myLyricSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasPlay ) - { - os << std::endl; - getPlay()->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - return os; - } +void Note::setAttributes(const NoteAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +NoteChoicePtr Note::getNoteChoice() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(NoteChoice); + return myNoteChoice; +} - NoteAttributesPtr Note::getAttributes() const - { - MX_LOCK; - MX_JIT_ALLOCATE_ATTRIBUTES( NoteAttributes ); - return myAttributes; - } +void Note::setNoteChoice(const NoteChoicePtr &value) +{ + if (value) + { + myNoteChoice = value; + } +} +InstrumentPtr Note::getInstrument() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(Instrument); + return myInstrument; +} - void Note::setAttributes( const NoteAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +void Note::setInstrument(const InstrumentPtr &value) +{ + if (value) + { + myInstrument = value; + } +} +bool Note::getHasInstrument() const +{ + return myHasInstrument; +} - NoteChoicePtr Note::getNoteChoice() const - { - MX_LOCK; - MX_JIT_ALLOCATE( NoteChoice ); - return myNoteChoice; - } +void Note::setHasInstrument(const bool value) +{ + myHasInstrument = value; +} +EditorialVoiceGroupPtr Note::getEditorialVoiceGroup() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(EditorialVoiceGroup); + return myEditorialVoiceGroup; +} - void Note::setNoteChoice( const NoteChoicePtr& value ) - { - if( value ) - { - myNoteChoice = value; - } - } +void Note::setEditorialVoiceGroup(const EditorialVoiceGroupPtr &value) +{ + if (value) + { + myEditorialVoiceGroup = value; + } +} +TypePtr Note::getType() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(Type); + return myType; +} - InstrumentPtr Note::getInstrument() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Instrument ); - return myInstrument; - } +void Note::setType(const TypePtr &value) +{ + if (value) + { + myType = value; + } +} +bool Note::getHasType() const +{ + return myHasType; +} - void Note::setInstrument( const InstrumentPtr& value ) - { - if( value ) - { - myInstrument = value; - } - } +void Note::setHasType(const bool value) +{ + myHasType = value; +} +const DotSet &Note::getDotSet() const +{ + return myDotSet; +} - bool Note::getHasInstrument() const - { - return myHasInstrument; - } +void Note::removeDot(const DotSetIterConst &value) +{ + if (value != myDotSet.cend()) + { + myDotSet.erase(value); + } +} +void Note::addDot(const DotPtr &value) +{ + if (value) + { + myDotSet.push_back(value); + } +} - void Note::setHasInstrument( const bool value ) - { - myHasInstrument = value; - } +void Note::clearDotSet() +{ + myDotSet.clear(); +} +DotPtr Note::getDot(const DotSetIterConst &setIterator) const +{ + if (setIterator != myDotSet.cend()) + { + return *setIterator; + } + return DotPtr(); +} - EditorialVoiceGroupPtr Note::getEditorialVoiceGroup() const - { - MX_LOCK; - MX_JIT_ALLOCATE( EditorialVoiceGroup ); - return myEditorialVoiceGroup; - } +AccidentalPtr Note::getAccidental() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(Accidental); + return myAccidental; +} +void Note::setAccidental(const AccidentalPtr &value) +{ + if (value) + { + myAccidental = value; + } +} - void Note::setEditorialVoiceGroup( const EditorialVoiceGroupPtr& value ) - { - if ( value ) - { - myEditorialVoiceGroup = value; - } - } +bool Note::getHasAccidental() const +{ + return myHasAccidental; +} +void Note::setHasAccidental(const bool value) +{ + myHasAccidental = value; +} - TypePtr Note::getType() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Type ); - return myType; - } +TimeModificationPtr Note::getTimeModification() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(TimeModification); + return myTimeModification; +} +void Note::setTimeModification(const TimeModificationPtr &value) +{ + if (value) + { + myTimeModification = value; + } +} - void Note::setType( const TypePtr& value ) - { - if( value ) - { - myType = value; - } - } +bool Note::getHasTimeModification() const +{ + return myHasTimeModification; +} +void Note::setHasTimeModification(const bool value) +{ + myHasTimeModification = value; +} - bool Note::getHasType() const - { - return myHasType; - } +StemPtr Note::getStem() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(Stem); + return myStem; +} +void Note::setStem(const StemPtr &value) +{ + if (value) + { + myStem = value; + } +} - void Note::setHasType( const bool value ) - { - myHasType = value; - } +bool Note::getHasStem() const +{ + return myHasStem; +} +void Note::setHasStem(const bool value) +{ + myHasStem = value; +} - const DotSet& Note::getDotSet() const - { - return myDotSet; - } +NoteheadPtr Note::getNotehead() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(Notehead); + return myNotehead; +} +void Note::setNotehead(const NoteheadPtr &value) +{ + if (value) + { + myNotehead = value; + } +} - void Note::removeDot( const DotSetIterConst& value ) - { - if ( value != myDotSet.cend() ) - { - myDotSet.erase( value ); - } - } +bool Note::getHasNotehead() const +{ + return myHasNotehead; +} +void Note::setHasNotehead(const bool value) +{ + myHasNotehead = value; +} - void Note::addDot( const DotPtr& value ) - { - if ( value ) - { - myDotSet.push_back( value ); - } - } +NoteheadTextPtr Note::getNoteheadText() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(NoteheadText); + return myNoteheadText; +} +void Note::setNoteheadText(const NoteheadTextPtr &value) +{ + if (value) + { + myNoteheadText = value; + } +} - void Note::clearDotSet() - { - myDotSet.clear(); - } +bool Note::getHasNoteheadText() const +{ + return myHasNoteheadText; +} +void Note::setHasNoteheadText(const bool value) +{ + myHasNoteheadText = value; +} - DotPtr Note::getDot( const DotSetIterConst& setIterator ) const - { - if( setIterator != myDotSet.cend() ) - { - return *setIterator; - } - return DotPtr(); - } +StaffPtr Note::getStaff() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(Staff); + return myStaff; +} +void Note::setStaff(const StaffPtr &value) +{ + if (value) + { + myStaff = value; + } +} - AccidentalPtr Note::getAccidental() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Accidental ); - return myAccidental; - } +bool Note::getHasStaff() const +{ + return myHasStaff; +} +void Note::setHasStaff(const bool value) +{ + myHasStaff = value; +} - void Note::setAccidental( const AccidentalPtr& value ) - { - if( value ) - { - myAccidental = value; - } - } +const BeamSet &Note::getBeamSet() const +{ + return myBeamSet; +} +void Note::removeBeam(const BeamSetIterConst &value) +{ + if (value != myBeamSet.cend()) + { + myBeamSet.erase(value); + } +} - bool Note::getHasAccidental() const +void Note::addBeam(const BeamPtr &value) +{ + if (value) + { + if (myBeamSet.size() < 8) { - return myHasAccidental; + myBeamSet.push_back(value); } + } +} +void Note::clearBeamSet() +{ + myBeamSet.clear(); +} - void Note::setHasAccidental( const bool value ) - { - myHasAccidental = value; - } +BeamPtr Note::getBeam(const BeamSetIterConst &setIterator) const +{ + if (setIterator != myBeamSet.cend()) + { + return *setIterator; + } + return BeamPtr(); +} +const NotationsSet &Note::getNotationsSet() const +{ + return myNotationsSet; +} - TimeModificationPtr Note::getTimeModification() const - { - MX_LOCK; - MX_JIT_ALLOCATE( TimeModification ); - return myTimeModification; - } +void Note::removeNotations(const NotationsSetIterConst &value) +{ + if (value != myNotationsSet.cend()) + { + myNotationsSet.erase(value); + } +} +void Note::addNotations(const NotationsPtr &value) +{ + if (value) + { + myNotationsSet.push_back(value); + } +} - void Note::setTimeModification( const TimeModificationPtr& value ) - { - if( value ) - { - myTimeModification = value; - } - } +void Note::clearNotationsSet() +{ + myNotationsSet.clear(); +} +NotationsPtr Note::getNotations(const NotationsSetIterConst &setIterator) const +{ + if (setIterator != myNotationsSet.cend()) + { + return *setIterator; + } + return NotationsPtr(); +} - bool Note::getHasTimeModification() const - { - return myHasTimeModification; - } +const LyricSet &Note::getLyricSet() const +{ + return myLyricSet; +} +void Note::removeLyric(const LyricSetIterConst &value) +{ + if (value != myLyricSet.cend()) + { + myLyricSet.erase(value); + } +} - void Note::setHasTimeModification( const bool value ) - { - myHasTimeModification = value; - } +void Note::addLyric(const LyricPtr &value) +{ + if (value) + { + myLyricSet.push_back(value); + } +} +void Note::clearLyricSet() +{ + myLyricSet.clear(); +} - StemPtr Note::getStem() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Stem ); - return myStem; - } +LyricPtr Note::getLyric(const LyricSetIterConst &setIterator) const +{ + if (setIterator != myLyricSet.cend()) + { + return *setIterator; + } + return LyricPtr(); +} +PlayPtr Note::getPlay() const +{ + MX_LOCK; + MX_JIT_ALLOCATE(Play); + return myPlay; +} - void Note::setStem( const StemPtr& value ) - { - if( value ) - { - myStem = value; - } - } +void Note::setPlay(const PlayPtr &value) +{ + if (value) + { + myPlay = value; + } +} +bool Note::getHasPlay() const +{ + return myHasPlay; +} - bool Note::getHasStem() const - { - return myHasStem; - } +void Note::setHasPlay(const bool value) +{ + myHasPlay = value; +} +bool Note::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isNoteChoiceFound = false; + bool isFirstDotAdded = false; + bool isFirstBeamAdded = false; + bool isFirstNotationsAdded = false; + bool isFirstLyricAdded = false; - void Note::setHasStem( const bool value ) - { - myHasStem = value; - } + isSuccess &= getAttributes()->fromXElement(message, xelement); + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); - NoteheadPtr Note::getNotehead() const + if (elementName == "pitch" || elementName == "unpitched" || elementName == "rest" || elementName == "chord" || + elementName == "grace" || elementName == "cue") { - MX_LOCK; - MX_JIT_ALLOCATE( Notehead ); - return myNotehead; + isNoteChoiceFound = true; + isSuccess &= parseNoteChoice(message, xelement, it); + --it; } - - - void Note::setNotehead( const NoteheadPtr& value ) + else if (elementName == "instrument") { - if( value ) - { - myNotehead = value; - } + myHasInstrument = true; + isSuccess &= getInstrument()->fromXElement(message, *it); } - - - bool Note::getHasNotehead() const + else if (elementName == "footnote" || elementName == "level" || elementName == "voice") { - return myHasNotehead; + isSuccess &= parseEditorialVoiceGroup(message, xelement, it); } - - - void Note::setHasNotehead( const bool value ) + else if (elementName == "type") { - myHasNotehead = value; + myHasType = true; + isSuccess &= getType()->fromXElement(message, *it); } - - - NoteheadTextPtr Note::getNoteheadText() const + else if (elementName == "dot") { - MX_LOCK; - MX_JIT_ALLOCATE( NoteheadText ); - return myNoteheadText; - } + auto dot = makeDot(); + isSuccess &= dot->fromXElement(message, *it); - - void Note::setNoteheadText( const NoteheadTextPtr& value ) - { - if( value ) + if (!isFirstDotAdded && myDotSet.size() == 1) + { + *(myDotSet.begin()) = dot; + isFirstDotAdded = true; + } + else { - myNoteheadText = value; + myDotSet.push_back(dot); + isFirstDotAdded = true; } } - - - bool Note::getHasNoteheadText() const + else if (elementName == "accidental") { - return myHasNoteheadText; + myHasAccidental = true; + isSuccess &= getAccidental()->fromXElement(message, *it); } - - - void Note::setHasNoteheadText( const bool value ) + else if (elementName == "time-modification") { - myHasNoteheadText = value; + myHasTimeModification = true; + isSuccess &= getTimeModification()->fromXElement(message, *it); } - - - StaffPtr Note::getStaff() const + else if (elementName == "stem") { - MX_LOCK; - MX_JIT_ALLOCATE( Staff ); - return myStaff; + myHasStem = true; + isSuccess &= getStem()->fromXElement(message, *it); } - - - void Note::setStaff( const StaffPtr& value ) + else if (elementName == "notehead") { - if ( value ) - { - myStaff = value; - } + myHasNotehead = true; + isSuccess &= getNotehead()->fromXElement(message, *it); } - - - bool Note::getHasStaff() const + else if (elementName == "notehead-text") { - return myHasStaff; + myHasNoteheadText = true; + isSuccess &= getNoteheadText()->fromXElement(message, *it); } - - - void Note::setHasStaff( const bool value ) + else if (elementName == "staff") { - myHasStaff = value; + myHasStaff = true; + isSuccess &= getStaff()->fromXElement(message, *it); } - - - const BeamSet& Note::getBeamSet() const + else if (elementName == "beam") { - return myBeamSet; - } + auto beam = makeBeam(); + isSuccess &= beam->fromXElement(message, *it); - - void Note::removeBeam( const BeamSetIterConst& value ) - { - if ( value != myBeamSet.cend() ) + if (!isFirstBeamAdded && myBeamSet.size() == 1) { - myBeamSet.erase( value ); + *(myBeamSet.begin()) = beam; + isFirstBeamAdded = true; } - } - - - void Note::addBeam( const BeamPtr& value ) - { - if ( value ) + else { - if ( myBeamSet.size() < 8 ) - { - myBeamSet.push_back( value ); - } + myBeamSet.push_back(beam); + isFirstBeamAdded = true; } } - - - void Note::clearBeamSet() + else if (elementName == "notations") { - myBeamSet.clear(); - } + auto notations = makeNotations(); + isSuccess &= notations->fromXElement(message, *it); - - BeamPtr Note::getBeam( const BeamSetIterConst& setIterator ) const - { - if( setIterator != myBeamSet.cend() ) + if (!isFirstNotationsAdded && myNotationsSet.size() == 1) + { + *(myNotationsSet.begin()) = notations; + isFirstNotationsAdded = true; + } + else { - return *setIterator; + myNotationsSet.push_back(notations); + isFirstNotationsAdded = true; } - return BeamPtr(); } - - - const NotationsSet& Note::getNotationsSet() const + else if (elementName == "lyric") { - return myNotationsSet; - } + auto lyric = makeLyric(); + isSuccess &= lyric->fromXElement(message, *it); - - void Note::removeNotations( const NotationsSetIterConst& value ) - { - if ( value != myNotationsSet.cend() ) + if (!isFirstLyricAdded && myLyricSet.size() == 1) { - myNotationsSet.erase( value ); + *(myLyricSet.begin()) = lyric; + isFirstLyricAdded = true; } - } - - - void Note::addNotations( const NotationsPtr& value ) - { - if ( value ) + else { - myNotationsSet.push_back( value ); + myLyricSet.push_back(lyric); + isFirstLyricAdded = true; } } - - - void Note::clearNotationsSet() + else if (elementName == "play") { - myNotationsSet.clear(); + myHasPlay = true; + isSuccess &= getPlay()->fromXElement(message, *it); } - - - NotationsPtr Note::getNotations( const NotationsSetIterConst& setIterator ) const + else { - if( setIterator != myNotationsSet.cend() ) - { - return *setIterator; - } - return NotationsPtr(); + isSuccess = false; + message << "Note: unexpected element '" << elementName << "'" << std::endl; } + } + if (!isNoteChoiceFound) + { + isSuccess = false; + message << "Note: 'note-choice' elements were required but not found" << std::endl; + } - const LyricSet& Note::getLyricSet() const - { - return myLyricSet; - } + MX_RETURN_IS_SUCCESS; +} +bool Note::parseNoteChoice(std::ostream &message, ::ezxml::XElement ¬eElement, ::ezxml::XElementIterator &iter) +{ + if (iter == noteElement.end()) + { + return false; + } - void Note::removeLyric( const LyricSetIterConst& value ) - { - if ( value != myLyricSet.cend() ) - { - myLyricSet.erase( value ); - } - } + bool isSuccess = true; + const std::string elementName = iter->getName(); + FullNoteGroupPtr fullNoteGroup = nullptr; - void Note::addLyric( const LyricPtr& value ) - { - if ( value ) - { - myLyricSet.push_back( value ); - } - } + if (elementName == "grace") + { + getNoteChoice()->setChoice(NoteChoice::Choice::grace); + isSuccess &= getNoteChoice()->getGraceNoteGroup()->getGrace()->fromXElement(message, *iter); + fullNoteGroup = getNoteChoice()->getGraceNoteGroup()->getFullNoteGroup(); + ++iter; + } + else if (elementName == "cue") + { + getNoteChoice()->setChoice(NoteChoice::Choice::cue); + isSuccess &= getNoteChoice()->getCueNoteGroup()->getCue()->fromXElement(message, *iter); + fullNoteGroup = getNoteChoice()->getCueNoteGroup()->getFullNoteGroup(); + ++iter; + } + else + { + getNoteChoice()->setChoice(NoteChoice::Choice::normal); + fullNoteGroup = getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup(); + } + // we should now be pointing at the full note group + isSuccess &= parseFullNoteGroup(message, noteElement, iter, fullNoteGroup); - void Note::clearLyricSet() + // NormalNoteGroups and CueNoteGroups require a duration element + if (elementName != "grace") + { + if (iter == noteElement.end() || iter->getName() != "duration") { - myLyricSet.clear(); + message << "Note: parseNoteChoice - a 'duration' element was required but not found" << std::endl; + return false; } - - LyricPtr Note::getLyric( const LyricSetIterConst& setIterator ) const + if (getNoteChoice()->getChoice() == NoteChoice::Choice::normal) { - if( setIterator != myLyricSet.cend() ) - { - return *setIterator; - } - return LyricPtr(); + getNoteChoice()->getNormalNoteGroup()->getDuration()->fromXElement(message, *iter); } - - - PlayPtr Note::getPlay() const + else if (getNoteChoice()->getChoice() == NoteChoice::Choice::cue) { - MX_LOCK; - MX_JIT_ALLOCATE( Play ); - return myPlay; + getNoteChoice()->getCueNoteGroup()->getDuration()->fromXElement(message, *iter); } + ++iter; + } + // additional stuff is optional so we may be at the end iter + if (iter == noteElement.end()) + { + MX_RETURN_IS_SUCCESS; + } - void Note::setPlay( const PlayPtr& value ) + // now we may be pointing at tie elements, but only if the choice is normal or grace + if (getNoteChoice()->getChoice() == NoteChoice::Choice::normal || + getNoteChoice()->getChoice() == NoteChoice::Choice::grace) + { + std::string possibleTieElementName = iter->getName(); + while (iter != noteElement.end() && iter->getName() == "tie") { - if( value ) + auto tie = makeTie(); + isSuccess &= tie->fromXElement(message, *iter); + if (getNoteChoice()->getChoice() == NoteChoice::Choice::normal) + { + getNoteChoice()->getNormalNoteGroup()->addTie(tie); + } + else if (getNoteChoice()->getChoice() == NoteChoice::Choice::grace) { - myPlay = value; + getNoteChoice()->getGraceNoteGroup()->addTie(tie); } + ++iter; } + } + else if (getNoteChoice()->getChoice() == NoteChoice::Choice::cue) + { + MX_RETURN_IS_SUCCESS; + } + MX_RETURN_IS_SUCCESS; +} - bool Note::getHasPlay() const - { - return myHasPlay; - } +bool Note::parseFullNoteGroup(std::ostream &message, ::ezxml::XElement ¬eElement, ::ezxml::XElementIterator &iter, + FullNoteGroupPtr &outFullNoteGroup) +{ + if (iter == noteElement.end()) + { + return false; + } + bool isSuccess = true; - void Note::setHasPlay( const bool value ) - { - myHasPlay = value; - } - - - bool Note::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isNoteChoiceFound = false; - bool isFirstDotAdded = false; - bool isFirstBeamAdded = false; - bool isFirstNotationsAdded = false; - bool isFirstLyricAdded = false; - - isSuccess &= getAttributes()->fromXElement( message, xelement ); - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "pitch" - || elementName == "unpitched" - || elementName == "rest" - || elementName == "chord" - || elementName == "grace" - || elementName == "cue" ) - { - isNoteChoiceFound = true; - isSuccess &= parseNoteChoice( message, xelement, it ); - --it; - } - else if( elementName == "instrument" ) - { - myHasInstrument = true; - isSuccess &= getInstrument()->fromXElement( message, *it ); - } - else if( elementName == "footnote" - || elementName == "level" - || elementName == "voice" ) - { - isSuccess &= parseEditorialVoiceGroup( message, xelement, it ); - } - else if( elementName == "type" ) - { - myHasType = true; - isSuccess &= getType()->fromXElement( message, *it ); - } - else if( elementName == "dot" ) - { - auto dot = makeDot(); - isSuccess &= dot->fromXElement( message, *it ); - - if( !isFirstDotAdded && myDotSet.size() == 1 ) - { - *( myDotSet.begin() ) = dot; - isFirstDotAdded = true; - } - else - { - myDotSet.push_back( dot ); - isFirstDotAdded = true; - } - } - else if( elementName == "accidental" ) - { - myHasAccidental = true; - isSuccess &= getAccidental()->fromXElement( message, *it ); - } - else if( elementName == "time-modification" ) - { - myHasTimeModification = true; - isSuccess &= getTimeModification()->fromXElement( message, *it ); - } - else if( elementName == "stem" ) - { - myHasStem = true; - isSuccess &= getStem()->fromXElement( message, *it ); - } - else if( elementName == "notehead" ) - { - myHasNotehead = true; - isSuccess &= getNotehead()->fromXElement( message, *it ); - } - else if( elementName == "notehead-text" ) - { - myHasNoteheadText = true; - isSuccess &= getNoteheadText()->fromXElement( message, *it ); - } - else if( elementName == "staff" ) - { - myHasStaff = true; - isSuccess &= getStaff()->fromXElement( message, *it ); - } - else if( elementName == "beam" ) - { - auto beam = makeBeam(); - isSuccess &= beam->fromXElement( message, *it ); - - if( !isFirstBeamAdded && myBeamSet.size() == 1 ) - { - *( myBeamSet.begin() ) = beam; - isFirstBeamAdded = true; - } - else - { - myBeamSet.push_back( beam ); - isFirstBeamAdded = true; - } - } - else if( elementName == "notations" ) - { - auto notations = makeNotations(); - isSuccess &= notations->fromXElement( message, *it ); - - if( !isFirstNotationsAdded && myNotationsSet.size() == 1 ) - { - *( myNotationsSet.begin() ) = notations; - isFirstNotationsAdded = true; - } - else - { - myNotationsSet.push_back( notations ); - isFirstNotationsAdded = true; - } - } - else if( elementName == "lyric" ) - { - auto lyric = makeLyric(); - isSuccess &= lyric->fromXElement( message, *it ); - - if( !isFirstLyricAdded && myLyricSet.size() == 1 ) - { - *( myLyricSet.begin() ) = lyric; - isFirstLyricAdded = true; - } - else - { - myLyricSet.push_back( lyric ); - isFirstLyricAdded = true; - } - } - else if( elementName == "play" ) - { - myHasPlay = true; - isSuccess &= getPlay()->fromXElement( message, *it ); - } - else - { - isSuccess = false; - message << "Note: unexpected element '" << elementName << "'" << std::endl; - } - } - - if( !isNoteChoiceFound ) - { - isSuccess = false; - message << "Note: 'note-choice' elements were required but not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } + if (iter->getName() == "chord") + { + outFullNoteGroup->setHasChord(true); + ++iter; + } + + // we should now be pointing at the FullNoteTypeChoice + if (iter == noteElement.end()) + { + message << "Note: parseFullNoteGroup did not find the FullNoteChoice" << std::endl; + return false; + } + + const std::string noteChoiceElementName = iter->getName(); + + if (noteChoiceElementName == "pitch") + { + outFullNoteGroup->getFullNoteTypeChoice()->setChoice(FullNoteTypeChoice::Choice::pitch); + isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getPitch()->fromXElement(message, *iter); + ++iter; + } + else if (noteChoiceElementName == "unpitched") + { + outFullNoteGroup->getFullNoteTypeChoice()->setChoice(FullNoteTypeChoice::Choice::unpitched); + isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getUnpitched()->fromXElement(message, *iter); + ++iter; + } + else if (noteChoiceElementName == "rest") + { + outFullNoteGroup->getFullNoteTypeChoice()->setChoice(FullNoteTypeChoice::Choice::rest); + isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getRest()->fromXElement(message, *iter); + ++iter; + } + else + { + message << "Note: parseFullNoteGroup encountered unexpected element '" << noteChoiceElementName << "'" + << std::endl; + isSuccess = false; + ++iter; + } - - bool Note::parseNoteChoice( std::ostream& message, ::ezxml::XElement& noteElement, ::ezxml::XElementIterator& iter ) + MX_RETURN_IS_SUCCESS; +} + +bool Note::parseEditorialVoiceGroup(std::ostream &message, ::ezxml::XElement ¬eElement, + ::ezxml::XElementIterator &iter) +{ + bool isSuccess = true; + bool isIterIncremented = false; + while (iter != noteElement.end() && + (iter->getName() == "footnote" || iter->getName() == "level" || iter->getName() == "voice")) + { + if (iter->getName() == "footnote") { - if( iter == noteElement.end() ) - { - return false; - } - - bool isSuccess = true; - - - const std::string elementName = iter->getName(); - FullNoteGroupPtr fullNoteGroup = nullptr; - - if( elementName == "grace" ) - { - getNoteChoice()->setChoice( NoteChoice::Choice::grace ); - isSuccess &= getNoteChoice()->getGraceNoteGroup()->getGrace()->fromXElement( message, *iter ); - fullNoteGroup = getNoteChoice()->getGraceNoteGroup()->getFullNoteGroup(); - ++iter; - } - else if ( elementName == "cue" ) - { - getNoteChoice()->setChoice( NoteChoice::Choice::cue ); - isSuccess &= getNoteChoice()->getCueNoteGroup()->getCue()->fromXElement( message, *iter ); - fullNoteGroup = getNoteChoice()->getCueNoteGroup()->getFullNoteGroup(); - ++iter; - } - else - { - getNoteChoice()->setChoice( NoteChoice::Choice::normal ); - fullNoteGroup = getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup(); - } - - // we should now be pointing at the full note group - isSuccess &= parseFullNoteGroup( message, noteElement, iter, fullNoteGroup ); - - // NormalNoteGroups and CueNoteGroups require a duration element - if( elementName != "grace" ) - { - if( iter == noteElement.end() || iter->getName() != "duration" ) - { - message << "Note: parseNoteChoice - a 'duration' element was required but not found" << std::endl; - return false; - } - - if( getNoteChoice()->getChoice() == NoteChoice::Choice::normal ) - { - getNoteChoice()->getNormalNoteGroup()->getDuration()->fromXElement( message, *iter ); - } - else if( getNoteChoice()->getChoice() == NoteChoice::Choice::cue ) - { - getNoteChoice()->getCueNoteGroup()->getDuration()->fromXElement( message, *iter ); - } - ++iter; - } - - // additional stuff is optional so we may be at the end iter - if( iter == noteElement.end() ) - { - MX_RETURN_IS_SUCCESS; - } - - // now we may be pointing at tie elements, but only if the choice is normal or grace - if( getNoteChoice()->getChoice() == NoteChoice::Choice::normal || getNoteChoice()->getChoice() == NoteChoice::Choice::grace ) - { - std::string possibleTieElementName = iter->getName(); - while( iter != noteElement.end() && iter->getName() == "tie" ) - { - auto tie = makeTie(); - isSuccess &= tie->fromXElement( message, *iter ); - if( getNoteChoice()->getChoice() == NoteChoice::Choice::normal ) - { - getNoteChoice()->getNormalNoteGroup()->addTie( tie ); - } - else if ( getNoteChoice()->getChoice() == NoteChoice::Choice::grace ) - { - getNoteChoice()->getGraceNoteGroup()->addTie( tie ); - } - ++iter; - } - } - else if( getNoteChoice()->getChoice() == NoteChoice::Choice::cue ) - { - MX_RETURN_IS_SUCCESS; - } - - - MX_RETURN_IS_SUCCESS; + getEditorialVoiceGroup()->setHasFootnote(true); + isSuccess &= getEditorialVoiceGroup()->getFootnote()->fromXElement(message, *iter); } - - - bool Note::parseFullNoteGroup( std::ostream& message, ::ezxml::XElement& noteElement, ::ezxml::XElementIterator& iter, FullNoteGroupPtr& outFullNoteGroup ) + else if (iter->getName() == "level") { - if( iter == noteElement.end() ) - { - return false; - } - - bool isSuccess = true; - - if( iter->getName() == "chord" ) - { - outFullNoteGroup->setHasChord( true ); - ++iter; - } - - // we should now be pointing at the FullNoteTypeChoice - if( iter == noteElement.end() ) - { - message << "Note: parseFullNoteGroup did not find the FullNoteChoice" << std::endl; - return false; - } - - const std::string noteChoiceElementName = iter->getName(); - - if( noteChoiceElementName == "pitch" ) - { - outFullNoteGroup->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); - isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getPitch()->fromXElement( message, *iter ); - ++iter; - } - else if( noteChoiceElementName == "unpitched" ) - { - outFullNoteGroup->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::unpitched ); - isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getUnpitched()->fromXElement( message, *iter ); - ++iter; - } - else if( noteChoiceElementName == "rest" ) - { - outFullNoteGroup->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::rest ); - isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getRest()->fromXElement( message, *iter ); - ++iter; - } - else - { - message << "Note: parseFullNoteGroup encountered unexpected element '" << noteChoiceElementName << "'" << std::endl; - isSuccess = false; - ++iter; - } - - MX_RETURN_IS_SUCCESS; + getEditorialVoiceGroup()->setHasLevel(true); + isSuccess &= getEditorialVoiceGroup()->getLevel()->fromXElement(message, *iter); } - - - bool Note::parseEditorialVoiceGroup( std::ostream& message, ::ezxml::XElement& noteElement, ::ezxml::XElementIterator& iter ) + else if (iter->getName() == "voice") { - bool isSuccess = true; - bool isIterIncremented = false; - while( iter != noteElement.end() && ( iter->getName() == "footnote" || iter->getName() == "level" || iter->getName() == "voice" ) ) - { - if( iter->getName() == "footnote" ) - { - getEditorialVoiceGroup()->setHasFootnote( true ); - isSuccess &= getEditorialVoiceGroup()->getFootnote()->fromXElement( message, *iter ); - } - else if ( iter->getName() == "level" ) - { - getEditorialVoiceGroup()->setHasLevel( true ); - isSuccess &= getEditorialVoiceGroup()->getLevel()->fromXElement( message, *iter ); - } - else if ( iter->getName() == "voice" ) - { - getEditorialVoiceGroup()->setHasVoice( true ); - isSuccess &= getEditorialVoiceGroup()->getVoice()->fromXElement( message, *iter ); - } - - ++iter; - isIterIncremented = true; - } - - if( isIterIncremented ) - { - --iter; - } - MX_RETURN_IS_SUCCESS; + getEditorialVoiceGroup()->setHasVoice(true); + isSuccess &= getEditorialVoiceGroup()->getVoice()->fromXElement(message, *iter); } + + ++iter; + isIterIncremented = true; + } + + if (isIterIncremented) + { + --iter; } + MX_RETURN_IS_SUCCESS; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Note.h b/Sourcecode/private/mx/core/elements/Note.h index acacb45d6..b0cff38ba 100644 --- a/Sourcecode/private/mx/core/elements/Note.h +++ b/Sourcecode/private/mx/core/elements/Note.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/NoteAttributes.h" #include @@ -14,184 +14,179 @@ namespace ezxml { - class XElementIterator; +class XElementIterator; } namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Accidental ) - MX_FORWARD_DECLARE_ELEMENT( Beam ) - MX_FORWARD_DECLARE_ELEMENT( Dot ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceGroup ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( Instrument ) - MX_FORWARD_DECLARE_ELEMENT( Lyric ) - MX_FORWARD_DECLARE_ELEMENT( Notations ) - MX_FORWARD_DECLARE_ELEMENT( NoteChoice ) - MX_FORWARD_DECLARE_ELEMENT( Notehead ) - MX_FORWARD_DECLARE_ELEMENT( NoteheadText ) - MX_FORWARD_DECLARE_ELEMENT( Play ) - MX_FORWARD_DECLARE_ELEMENT( Staff ) - MX_FORWARD_DECLARE_ELEMENT( Stem ) - MX_FORWARD_DECLARE_ELEMENT( TimeModification ) - MX_FORWARD_DECLARE_ELEMENT( Type ) - MX_FORWARD_DECLARE_ELEMENT( Note ) - - inline NotePtr makeNote() { return std::make_shared(); } - - class Note : public ElementInterface - { - public: - Note(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteAttributesPtr getAttributes() const; - void setAttributes( const NoteAttributesPtr& value ); - - /* _________ NoteChoice minOccurs = 1, maxOccurs = 1 _________ */ - NoteChoicePtr getNoteChoice() const; - void setNoteChoice( const NoteChoicePtr& value ); - - /* _________ Instrument minOccurs = 0, maxOccurs = 1 _________ */ - InstrumentPtr getInstrument() const; - void setInstrument( const InstrumentPtr& value ); - bool getHasInstrument() const; - void setHasInstrument( const bool value ); - - /* _________ EditorialVoiceGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialVoiceGroupPtr getEditorialVoiceGroup() const; - void setEditorialVoiceGroup( const EditorialVoiceGroupPtr& value ); - - /* _________ Type minOccurs = 0, maxOccurs = 1 _________ */ - TypePtr getType() const; - void setType( const TypePtr& value ); - bool getHasType() const; - void setHasType( const bool value ); - - /* _________ Dot minOccurs = 0, maxOccurs = unbounded _________ */ - const DotSet& getDotSet() const; - void addDot( const DotPtr& value ); - void removeDot( const DotSetIterConst& value ); - void clearDotSet(); - DotPtr getDot( const DotSetIterConst& setIterator ) const; - - /* _________ Accidental minOccurs = 0, maxOccurs = 1 _________ */ - AccidentalPtr getAccidental() const; - void setAccidental( const AccidentalPtr& value ); - bool getHasAccidental() const; - void setHasAccidental( const bool value ); - - /* _________ TimeModification minOccurs = 0, maxOccurs = 1 _________ */ - TimeModificationPtr getTimeModification() const; - void setTimeModification( const TimeModificationPtr& value ); - bool getHasTimeModification() const; - void setHasTimeModification( const bool value ); - - /* _________ Stem minOccurs = 0, maxOccurs = 1 _________ */ - StemPtr getStem() const; - void setStem( const StemPtr& value ); - bool getHasStem() const; - void setHasStem( const bool value ); - - /* _________ Notehead minOccurs = 0, maxOccurs = 1 _________ */ - NoteheadPtr getNotehead() const; - void setNotehead( const NoteheadPtr& value ); - bool getHasNotehead() const; - void setHasNotehead( const bool value ); - - /* _________ NoteheadText minOccurs = 0, maxOccurs = 1 _________ */ - NoteheadTextPtr getNoteheadText() const; - void setNoteheadText( const NoteheadTextPtr& value ); - bool getHasNoteheadText() const; - void setHasNoteheadText( const bool value ); - - /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ - StaffPtr getStaff() const; - void setStaff( const StaffPtr& value ); - bool getHasStaff() const; - void setHasStaff( const bool value ); - - /* _________ Beam minOccurs = 0, maxOccurs = 8 _________ */ - const BeamSet& getBeamSet() const; - void addBeam( const BeamPtr& value ); - void removeBeam( const BeamSetIterConst& value ); - void clearBeamSet(); - BeamPtr getBeam( const BeamSetIterConst& setIterator ) const; - - /* _________ Notations minOccurs = 0, maxOccurs = unbounded _________ */ - const NotationsSet& getNotationsSet() const; - void addNotations( const NotationsPtr& value ); - void removeNotations( const NotationsSetIterConst& value ); - void clearNotationsSet(); - NotationsPtr getNotations( const NotationsSetIterConst& setIterator ) const; - - /* _________ Lyric minOccurs = 0, maxOccurs = unbounded _________ */ - const LyricSet& getLyricSet() const; - void addLyric( const LyricPtr& value ); - void removeLyric( const LyricSetIterConst& value ); - void clearLyricSet(); - LyricPtr getLyric( const LyricSetIterConst& setIterator ) const; - - /* _________ Play minOccurs = 0, maxOccurs = 1 _________ */ - PlayPtr getPlay() const; - void setPlay( const PlayPtr& value ); - bool getHasPlay() const; - void setHasPlay( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - mutable NoteAttributesPtr myAttributes; - mutable NoteChoicePtr myNoteChoice; - mutable InstrumentPtr myInstrument; - bool myHasInstrument; - mutable EditorialVoiceGroupPtr myEditorialVoiceGroup; - mutable TypePtr myType; - bool myHasType; - DotSet myDotSet; - mutable AccidentalPtr myAccidental; - bool myHasAccidental; - mutable TimeModificationPtr myTimeModification; - bool myHasTimeModification; - mutable StemPtr myStem; - bool myHasStem; - mutable NoteheadPtr myNotehead; - bool myHasNotehead; - mutable NoteheadTextPtr myNoteheadText; - bool myHasNoteheadText; - mutable StaffPtr myStaff; - bool myHasStaff; - BeamSet myBeamSet; - NotationsSet myNotationsSet; - LyricSet myLyricSet; - mutable PlayPtr myPlay; - bool myHasPlay; - - bool parseNoteChoice( - std::ostream& message, - ::ezxml::XElement& noteElement, - ::ezxml::XElementIterator& iter ); - - bool parseFullNoteGroup( - std::ostream& message, - ::ezxml::XElement& noteElement, - ::ezxml::XElementIterator& iter, - FullNoteGroupPtr& outFullNoteGroup ); - - bool parseEditorialVoiceGroup( - std::ostream& message, - ::ezxml::XElement& noteElement, - ::ezxml::XElementIterator& iter ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(NoteAttributes) +MX_FORWARD_DECLARE_ELEMENT(Accidental) +MX_FORWARD_DECLARE_ELEMENT(Beam) +MX_FORWARD_DECLARE_ELEMENT(Dot) +MX_FORWARD_DECLARE_ELEMENT(EditorialVoiceGroup) +MX_FORWARD_DECLARE_ELEMENT(FullNoteGroup) +MX_FORWARD_DECLARE_ELEMENT(Instrument) +MX_FORWARD_DECLARE_ELEMENT(Lyric) +MX_FORWARD_DECLARE_ELEMENT(Notations) +MX_FORWARD_DECLARE_ELEMENT(NoteChoice) +MX_FORWARD_DECLARE_ELEMENT(Notehead) +MX_FORWARD_DECLARE_ELEMENT(NoteheadText) +MX_FORWARD_DECLARE_ELEMENT(Play) +MX_FORWARD_DECLARE_ELEMENT(Staff) +MX_FORWARD_DECLARE_ELEMENT(Stem) +MX_FORWARD_DECLARE_ELEMENT(TimeModification) +MX_FORWARD_DECLARE_ELEMENT(Type) +MX_FORWARD_DECLARE_ELEMENT(Note) + +inline NotePtr makeNote() +{ + return std::make_shared(); } + +class Note : public ElementInterface +{ + public: + Note(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NoteAttributesPtr getAttributes() const; + void setAttributes(const NoteAttributesPtr &value); + + /* _________ NoteChoice minOccurs = 1, maxOccurs = 1 _________ */ + NoteChoicePtr getNoteChoice() const; + void setNoteChoice(const NoteChoicePtr &value); + + /* _________ Instrument minOccurs = 0, maxOccurs = 1 _________ */ + InstrumentPtr getInstrument() const; + void setInstrument(const InstrumentPtr &value); + bool getHasInstrument() const; + void setHasInstrument(const bool value); + + /* _________ EditorialVoiceGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialVoiceGroupPtr getEditorialVoiceGroup() const; + void setEditorialVoiceGroup(const EditorialVoiceGroupPtr &value); + + /* _________ Type minOccurs = 0, maxOccurs = 1 _________ */ + TypePtr getType() const; + void setType(const TypePtr &value); + bool getHasType() const; + void setHasType(const bool value); + + /* _________ Dot minOccurs = 0, maxOccurs = unbounded _________ */ + const DotSet &getDotSet() const; + void addDot(const DotPtr &value); + void removeDot(const DotSetIterConst &value); + void clearDotSet(); + DotPtr getDot(const DotSetIterConst &setIterator) const; + + /* _________ Accidental minOccurs = 0, maxOccurs = 1 _________ */ + AccidentalPtr getAccidental() const; + void setAccidental(const AccidentalPtr &value); + bool getHasAccidental() const; + void setHasAccidental(const bool value); + + /* _________ TimeModification minOccurs = 0, maxOccurs = 1 _________ */ + TimeModificationPtr getTimeModification() const; + void setTimeModification(const TimeModificationPtr &value); + bool getHasTimeModification() const; + void setHasTimeModification(const bool value); + + /* _________ Stem minOccurs = 0, maxOccurs = 1 _________ */ + StemPtr getStem() const; + void setStem(const StemPtr &value); + bool getHasStem() const; + void setHasStem(const bool value); + + /* _________ Notehead minOccurs = 0, maxOccurs = 1 _________ */ + NoteheadPtr getNotehead() const; + void setNotehead(const NoteheadPtr &value); + bool getHasNotehead() const; + void setHasNotehead(const bool value); + + /* _________ NoteheadText minOccurs = 0, maxOccurs = 1 _________ */ + NoteheadTextPtr getNoteheadText() const; + void setNoteheadText(const NoteheadTextPtr &value); + bool getHasNoteheadText() const; + void setHasNoteheadText(const bool value); + + /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ + StaffPtr getStaff() const; + void setStaff(const StaffPtr &value); + bool getHasStaff() const; + void setHasStaff(const bool value); + + /* _________ Beam minOccurs = 0, maxOccurs = 8 _________ */ + const BeamSet &getBeamSet() const; + void addBeam(const BeamPtr &value); + void removeBeam(const BeamSetIterConst &value); + void clearBeamSet(); + BeamPtr getBeam(const BeamSetIterConst &setIterator) const; + + /* _________ Notations minOccurs = 0, maxOccurs = unbounded _________ */ + const NotationsSet &getNotationsSet() const; + void addNotations(const NotationsPtr &value); + void removeNotations(const NotationsSetIterConst &value); + void clearNotationsSet(); + NotationsPtr getNotations(const NotationsSetIterConst &setIterator) const; + + /* _________ Lyric minOccurs = 0, maxOccurs = unbounded _________ */ + const LyricSet &getLyricSet() const; + void addLyric(const LyricPtr &value); + void removeLyric(const LyricSetIterConst &value); + void clearLyricSet(); + LyricPtr getLyric(const LyricSetIterConst &setIterator) const; + + /* _________ Play minOccurs = 0, maxOccurs = 1 _________ */ + PlayPtr getPlay() const; + void setPlay(const PlayPtr &value); + bool getHasPlay() const; + void setHasPlay(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MX_MUTEX + mutable NoteAttributesPtr myAttributes; + mutable NoteChoicePtr myNoteChoice; + mutable InstrumentPtr myInstrument; + bool myHasInstrument; + mutable EditorialVoiceGroupPtr myEditorialVoiceGroup; + mutable TypePtr myType; + bool myHasType; + DotSet myDotSet; + mutable AccidentalPtr myAccidental; + bool myHasAccidental; + mutable TimeModificationPtr myTimeModification; + bool myHasTimeModification; + mutable StemPtr myStem; + bool myHasStem; + mutable NoteheadPtr myNotehead; + bool myHasNotehead; + mutable NoteheadTextPtr myNoteheadText; + bool myHasNoteheadText; + mutable StaffPtr myStaff; + bool myHasStaff; + BeamSet myBeamSet; + NotationsSet myNotationsSet; + LyricSet myLyricSet; + mutable PlayPtr myPlay; + bool myHasPlay; + + bool parseNoteChoice(std::ostream &message, ::ezxml::XElement ¬eElement, ::ezxml::XElementIterator &iter); + + bool parseFullNoteGroup(std::ostream &message, ::ezxml::XElement ¬eElement, ::ezxml::XElementIterator &iter, + FullNoteGroupPtr &outFullNoteGroup); + + bool parseEditorialVoiceGroup(std::ostream &message, ::ezxml::XElement ¬eElement, + ::ezxml::XElementIterator &iter); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteAttributes.cpp b/Sourcecode/private/mx/core/elements/NoteAttributes.cpp index 96c45bff4..46f274e98 100644 --- a/Sourcecode/private/mx/core/elements/NoteAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/NoteAttributes.cpp @@ -8,136 +8,146 @@ namespace mx { - namespace core - { - NoteAttributes::NoteAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject( YesNo::no ) - ,printDot( YesNo::no ) - ,printSpacing( YesNo::no ) - ,printLyric( YesNo::no ) - ,dynamics() - ,endDynamics() - ,attack() - ,release() - ,timeOnly() - ,pizzicato( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - ,hasPrintDot( false ) - ,hasPrintSpacing( false ) - ,hasPrintLyric( false ) - ,hasDynamics( false ) - ,hasEndDynamics( false ) - ,hasAttack( false ) - ,hasRelease( false ) - ,hasTimeOnly( false ) - ,hasPizzicato( false ) - {} - +namespace core +{ +NoteAttributes::NoteAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), printObject(YesNo::no), + printDot(YesNo::no), printSpacing(YesNo::no), printLyric(YesNo::no), dynamics(), endDynamics(), attack(), + release(), timeOnly(), pizzicato(YesNo::no), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasColor(false), hasPrintObject(false), hasPrintDot(false), hasPrintSpacing(false), hasPrintLyric(false), + hasDynamics(false), hasEndDynamics(false), hasAttack(false), hasRelease(false), hasTimeOnly(false), + hasPizzicato(false) +{ +} - bool NoteAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject || - hasPrintDot || - hasPrintSpacing || - hasPrintLyric || - hasDynamics || - hasEndDynamics || - hasAttack || - hasRelease || - hasTimeOnly || - hasPizzicato; - } +bool NoteAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPrintObject || hasPrintDot || hasPrintSpacing || hasPrintLyric || + hasDynamics || hasEndDynamics || hasAttack || hasRelease || hasTimeOnly || hasPizzicato; +} +std::ostream &NoteAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, printDot, "print-dot", hasPrintDot); + streamAttribute(os, printSpacing, "print-spacing", hasPrintSpacing); + streamAttribute(os, printLyric, "print-lyric", hasPrintLyric); + streamAttribute(os, dynamics, "dynamics", hasDynamics); + streamAttribute(os, endDynamics, "end-dynamics", hasEndDynamics); + streamAttribute(os, attack, "attack", hasAttack); + streamAttribute(os, release, "release", hasRelease); + streamAttribute(os, timeOnly, "time-only", hasTimeOnly); + streamAttribute(os, pizzicato, "pizzicato", hasPizzicato); + } + return os; +} - std::ostream& NoteAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, printDot, "print-dot", hasPrintDot ); - streamAttribute( os, printSpacing, "print-spacing", hasPrintSpacing ); - streamAttribute( os, printLyric, "print-lyric", hasPrintLyric ); - streamAttribute( os, dynamics, "dynamics", hasDynamics ); - streamAttribute( os, endDynamics, "end-dynamics", hasEndDynamics ); - streamAttribute( os, attack, "attack", hasAttack ); - streamAttribute( os, release, "release", hasRelease ); - streamAttribute( os, timeOnly, "time-only", hasTimeOnly ); - streamAttribute( os, pizzicato, "pizzicato", hasPizzicato ); - } - return os; - } +bool NoteAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "NoteAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool NoteAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "NoteAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printDot, hasPrintDot, "print-dot", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printLyric, hasPrintLyric, "print-lyric", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dynamics, hasDynamics, "dynamics" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, endDynamics, hasEndDynamics, "end-dynamics" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, attack, hasAttack, "attack" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, release, hasRelease, "release" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, pizzicato, hasPizzicato, "pizzicato", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printDot, hasPrintDot, "print-dot", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", + &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printLyric, hasPrintLyric, "print-lyric", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dynamics, hasDynamics, "dynamics")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, endDynamics, hasEndDynamics, "end-dynamics")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, attack, hasAttack, "attack")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, release, hasRelease, "release")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, pizzicato, hasPizzicato, "pizzicato", &parseYesNo)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteAttributes.h b/Sourcecode/private/mx/core/elements/NoteAttributes.h index 62ae406fe..3b0609a51 100644 --- a/Sourcecode/private/mx/core/elements/NoteAttributes.h +++ b/Sourcecode/private/mx/core/elements/NoteAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/TimeOnly.h" #include @@ -18,58 +18,58 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( NoteAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(NoteAttributes) - struct NoteAttributes : public AttributesInterface - { - public: - NoteAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - YesNo printDot; - YesNo printSpacing; - YesNo printLyric; - NonNegativeDecimal dynamics; - NonNegativeDecimal endDynamics; - DivisionsValue attack; - DivisionsValue release; - TimeOnly timeOnly; - YesNo pizzicato; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; - bool hasPrintDot; - bool hasPrintSpacing; - bool hasPrintLyric; - bool hasDynamics; - bool hasEndDynamics; - bool hasAttack; - bool hasRelease; - bool hasTimeOnly; - bool hasPizzicato; +struct NoteAttributes : public AttributesInterface +{ + public: + NoteAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + YesNo printObject; + YesNo printDot; + YesNo printSpacing; + YesNo printLyric; + NonNegativeDecimal dynamics; + NonNegativeDecimal endDynamics; + DivisionsValue attack; + DivisionsValue release; + TimeOnly timeOnly; + YesNo pizzicato; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPrintObject; + bool hasPrintDot; + bool hasPrintSpacing; + bool hasPrintLyric; + bool hasDynamics; + bool hasEndDynamics; + bool hasAttack; + bool hasRelease; + bool hasTimeOnly; + bool hasPizzicato; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteChoice.cpp b/Sourcecode/private/mx/core/elements/NoteChoice.cpp index aa3b60d0f..d02cf1cd3 100644 --- a/Sourcecode/private/mx/core/elements/NoteChoice.cpp +++ b/Sourcecode/private/mx/core/elements/NoteChoice.cpp @@ -11,117 +11,103 @@ namespace mx { - namespace core - { - NoteChoice::NoteChoice() - :myChoice( Choice::normal ) - ,myGraceNoteGroup( makeGraceNoteGroup() ) - ,myCueNoteGroup( makeCueNoteGroup() ) - ,myNormalNoteGroup( makeNormalNoteGroup() ) - {} - - - bool NoteChoice::hasAttributes() const - { - return false; - } - - - std::ostream& NoteChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NoteChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool NoteChoice::hasContents() const - { - return true; - } - - - std::ostream& NoteChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::grace: - myGraceNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - break; - case Choice::cue: - myCueNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - break; - case Choice::normal: - myNormalNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - NoteChoice::Choice NoteChoice::getChoice() const - { - return myChoice; - } - - - void NoteChoice::setChoice( const NoteChoice::Choice value ) - { - myChoice = value; - } +namespace core +{ +NoteChoice::NoteChoice() + : myChoice(Choice::normal), myGraceNoteGroup(makeGraceNoteGroup()), myCueNoteGroup(makeCueNoteGroup()), + myNormalNoteGroup(makeNormalNoteGroup()) +{ +} +bool NoteChoice::hasAttributes() const +{ + return false; +} - GraceNoteGroupPtr NoteChoice::getGraceNoteGroup() const - { - return myGraceNoteGroup; - } +std::ostream &NoteChoice::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &NoteChoice::streamName(std::ostream &os) const +{ + return os; +} - void NoteChoice::setGraceNoteGroup( const GraceNoteGroupPtr& value ) - { - if ( value ) - { - myGraceNoteGroup = value; - } - } +bool NoteChoice::hasContents() const +{ + return true; +} +std::ostream &NoteChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::grace: + myGraceNoteGroup->streamContents(os, indentLevel, isOneLineOnly); + break; + case Choice::cue: + myCueNoteGroup->streamContents(os, indentLevel, isOneLineOnly); + break; + case Choice::normal: + myNormalNoteGroup->streamContents(os, indentLevel, isOneLineOnly); + break; + default: + break; + } + isOneLineOnly = false; + return os; +} - CueNoteGroupPtr NoteChoice::getCueNoteGroup() const - { - return myCueNoteGroup; - } +NoteChoice::Choice NoteChoice::getChoice() const +{ + return myChoice; +} +void NoteChoice::setChoice(const NoteChoice::Choice value) +{ + myChoice = value; +} - void NoteChoice::setCueNoteGroup( const CueNoteGroupPtr& value ) - { - if ( value ) - { - myCueNoteGroup = value; - } - } +GraceNoteGroupPtr NoteChoice::getGraceNoteGroup() const +{ + return myGraceNoteGroup; +} +void NoteChoice::setGraceNoteGroup(const GraceNoteGroupPtr &value) +{ + if (value) + { + myGraceNoteGroup = value; + } +} - NormalNoteGroupPtr NoteChoice::getNormalNoteGroup() const - { - return myNormalNoteGroup; - } +CueNoteGroupPtr NoteChoice::getCueNoteGroup() const +{ + return myCueNoteGroup; +} +void NoteChoice::setCueNoteGroup(const CueNoteGroupPtr &value) +{ + if (value) + { + myCueNoteGroup = value; + } +} - void NoteChoice::setNormalNoteGroup( const NormalNoteGroupPtr& value ) - { - if ( value ) - { - myNormalNoteGroup = value; - } - } +NormalNoteGroupPtr NoteChoice::getNormalNoteGroup() const +{ + return myNormalNoteGroup; +} - MX_FROM_XELEMENT_UNUSED( NoteChoice ); +void NoteChoice::setNormalNoteGroup(const NormalNoteGroupPtr &value) +{ + if (value) + { + myNormalNoteGroup = value; } } + +MX_FROM_XELEMENT_UNUSED(NoteChoice); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteChoice.h b/Sourcecode/private/mx/core/elements/NoteChoice.h index de3e3b537..7e82a6d55 100644 --- a/Sourcecode/private/mx/core/elements/NoteChoice.h +++ b/Sourcecode/private/mx/core/elements/NoteChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,57 +13,60 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( CueNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( GraceNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( NormalNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( NoteChoice ) +MX_FORWARD_DECLARE_ELEMENT(CueNoteGroup) +MX_FORWARD_DECLARE_ELEMENT(GraceNoteGroup) +MX_FORWARD_DECLARE_ELEMENT(NormalNoteGroup) +MX_FORWARD_DECLARE_ELEMENT(NoteChoice) - inline NoteChoicePtr makeNoteChoice() { return std::make_shared(); } +inline NoteChoicePtr makeNoteChoice() +{ + return std::make_shared(); +} - class NoteChoice : public ElementInterface - { - public: - enum class Choice - { - grace = 1, - cue = 2, - normal = 3 - }; - NoteChoice(); +class NoteChoice : public ElementInterface +{ + public: + enum class Choice + { + grace = 1, + cue = 2, + normal = 3 + }; + NoteChoice(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - NoteChoice::Choice getChoice() const; - void setChoice( const NoteChoice::Choice value ); + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + NoteChoice::Choice getChoice() const; + void setChoice(const NoteChoice::Choice value); - /* _________ GraceNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - GraceNoteGroupPtr getGraceNoteGroup() const; - void setGraceNoteGroup( const GraceNoteGroupPtr& value ); + /* _________ GraceNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ + GraceNoteGroupPtr getGraceNoteGroup() const; + void setGraceNoteGroup(const GraceNoteGroupPtr &value); - /* _________ CueNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - CueNoteGroupPtr getCueNoteGroup() const; - void setCueNoteGroup( const CueNoteGroupPtr& value ); + /* _________ CueNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ + CueNoteGroupPtr getCueNoteGroup() const; + void setCueNoteGroup(const CueNoteGroupPtr &value); - /* _________ NormalNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - NormalNoteGroupPtr getNormalNoteGroup() const; - void setNormalNoteGroup( const NormalNoteGroupPtr& value ); + /* _________ NormalNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ + NormalNoteGroupPtr getNormalNoteGroup() const; + void setNormalNoteGroup(const NormalNoteGroupPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - Choice myChoice; - GraceNoteGroupPtr myGraceNoteGroup; - CueNoteGroupPtr myCueNoteGroup; - NormalNoteGroupPtr myNormalNoteGroup; - }; - } -} + private: + Choice myChoice; + GraceNoteGroupPtr myGraceNoteGroup; + CueNoteGroupPtr myCueNoteGroup; + NormalNoteGroupPtr myNormalNoteGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteRelationNote.cpp b/Sourcecode/private/mx/core/elements/NoteRelationNote.cpp index 2c8cfd749..037107a86 100644 --- a/Sourcecode/private/mx/core/elements/NoteRelationNote.cpp +++ b/Sourcecode/private/mx/core/elements/NoteRelationNote.cpp @@ -10,137 +10,119 @@ namespace mx { - namespace core - { - NoteRelationNote::NoteRelationNote() - :myMetronomeNoteSet() - ,myMetronomeRelationGroup( makeMetronomeRelationGroup() ) - ,myHasMetronomeRelationGroup( false ) - { - myMetronomeNoteSet.push_back( makeMetronomeNote() ); - } - - - bool NoteRelationNote::hasAttributes() const - { - return false; - } - - - std::ostream& NoteRelationNote::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NoteRelationNote::streamName( std::ostream& os ) const - { - return os; - } - - - bool NoteRelationNote::hasContents() const - { - return true; - } - - - std::ostream& NoteRelationNote::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto it = myMetronomeNoteSet.cbegin(); - it != myMetronomeNoteSet.cend(); - ++it ) - { - if ( it != myMetronomeNoteSet.cbegin() ) - { - os << std::endl; - } - (*it)->toStream( os, indentLevel ); - } - if ( myHasMetronomeRelationGroup ) - { - os << std::endl; - myMetronomeRelationGroup->streamContents( os, indentLevel, isOneLineOnly ); - } - isOneLineOnly = false; - return os; - } - - - const MetronomeNoteSet& NoteRelationNote::getMetronomeNoteSet() const - { - return myMetronomeNoteSet; - } - - - void NoteRelationNote::addMetronomeNote( const MetronomeNotePtr& value ) - { - if ( value ) - { - myMetronomeNoteSet.push_back( value ); - } - } - +namespace core +{ +NoteRelationNote::NoteRelationNote() + : myMetronomeNoteSet(), myMetronomeRelationGroup(makeMetronomeRelationGroup()), myHasMetronomeRelationGroup(false) +{ + myMetronomeNoteSet.push_back(makeMetronomeNote()); +} - void NoteRelationNote::removeMetronomeNote( const MetronomeNoteSetIterConst& setIterator ) - { - if ( setIterator != myMetronomeNoteSet.cend() ) - { - if ( myMetronomeNoteSet.size() > 1 ) - { - myMetronomeNoteSet.erase( setIterator ); - } - } - } +bool NoteRelationNote::hasAttributes() const +{ + return false; +} +std::ostream &NoteRelationNote::streamAttributes(std::ostream &os) const +{ + return os; +} - void NoteRelationNote::clearMetronomeNoteSet() - { - myMetronomeNoteSet.clear(); - myMetronomeNoteSet.push_back( makeMetronomeNote() ); - } +std::ostream &NoteRelationNote::streamName(std::ostream &os) const +{ + return os; +} +bool NoteRelationNote::hasContents() const +{ + return true; +} - MetronomeRelationGroupPtr NoteRelationNote::getMetronomeRelationGroup() const +std::ostream &NoteRelationNote::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto it = myMetronomeNoteSet.cbegin(); it != myMetronomeNoteSet.cend(); ++it) + { + if (it != myMetronomeNoteSet.cbegin()) { - return myMetronomeRelationGroup; + os << std::endl; } + (*it)->toStream(os, indentLevel); + } + if (myHasMetronomeRelationGroup) + { + os << std::endl; + myMetronomeRelationGroup->streamContents(os, indentLevel, isOneLineOnly); + } + isOneLineOnly = false; + return os; +} +const MetronomeNoteSet &NoteRelationNote::getMetronomeNoteSet() const +{ + return myMetronomeNoteSet; +} - void NoteRelationNote::setMetronomeRelationGroup( const MetronomeRelationGroupPtr& value ) - { - if ( value ) - { - myMetronomeRelationGroup = value; - } - } - +void NoteRelationNote::addMetronomeNote(const MetronomeNotePtr &value) +{ + if (value) + { + myMetronomeNoteSet.push_back(value); + } +} - bool NoteRelationNote::getHasMetronomeRelationGroup() const +void NoteRelationNote::removeMetronomeNote(const MetronomeNoteSetIterConst &setIterator) +{ + if (setIterator != myMetronomeNoteSet.cend()) + { + if (myMetronomeNoteSet.size() > 1) { - return myHasMetronomeRelationGroup; + myMetronomeNoteSet.erase(setIterator); } + } +} +void NoteRelationNote::clearMetronomeNoteSet() +{ + myMetronomeNoteSet.clear(); + myMetronomeNoteSet.push_back(makeMetronomeNote()); +} - void NoteRelationNote::setHasMetronomeRelationGroup( const bool value ) - { - myHasMetronomeRelationGroup = value; - } +MetronomeRelationGroupPtr NoteRelationNote::getMetronomeRelationGroup() const +{ + return myMetronomeRelationGroup; +} +void NoteRelationNote::setMetronomeRelationGroup(const MetronomeRelationGroupPtr &value) +{ + if (value) + { + myMetronomeRelationGroup = value; + } +} - bool NoteRelationNote::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; +bool NoteRelationNote::getHasMetronomeRelationGroup() const +{ + return myHasMetronomeRelationGroup; +} - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "metronome-note", myMetronomeNoteSet ); - importGroup( message, it, endIter, isSuccess, myMetronomeRelationGroup, myHasMetronomeRelationGroup ); - } +void NoteRelationNote::setHasMetronomeRelationGroup(const bool value) +{ + myHasMetronomeRelationGroup = value; +} - MX_RETURN_IS_SUCCESS; - } +bool NoteRelationNote::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importElementSet(message, it, endIter, isSuccess, "metronome-note", myMetronomeNoteSet); + importGroup(message, it, endIter, isSuccess, myMetronomeRelationGroup, myHasMetronomeRelationGroup); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteRelationNote.h b/Sourcecode/private/mx/core/elements/NoteRelationNote.h index 4c5c38dd0..b34c1fd01 100644 --- a/Sourcecode/private/mx/core/elements/NoteRelationNote.h +++ b/Sourcecode/private/mx/core/elements/NoteRelationNote.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,45 +13,48 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeNote ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelationGroup ) - MX_FORWARD_DECLARE_ELEMENT( NoteRelationNote ) - - inline NoteRelationNotePtr makeNoteRelationNote() { return std::make_shared(); } - - class NoteRelationNote : public ElementInterface - { - public: - NoteRelationNote(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MetronomeNote minOccurs = 1, maxOccurs = unbounded _________ */ - const MetronomeNoteSet& getMetronomeNoteSet() const; - void addMetronomeNote( const MetronomeNotePtr& value ); - void removeMetronomeNote( const MetronomeNoteSetIterConst& setIterator ); - void clearMetronomeNoteSet(); - - /* _________ MetronomeRelationGroup minOccurs = 0, maxOccurs = 1 _________ */ - MetronomeRelationGroupPtr getMetronomeRelationGroup() const; - void setMetronomeRelationGroup( const MetronomeRelationGroupPtr& value ); - bool getHasMetronomeRelationGroup() const; - void setHasMetronomeRelationGroup( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetronomeNoteSet myMetronomeNoteSet; - MetronomeRelationGroupPtr myMetronomeRelationGroup; - bool myHasMetronomeRelationGroup; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(MetronomeNote) +MX_FORWARD_DECLARE_ELEMENT(MetronomeRelationGroup) +MX_FORWARD_DECLARE_ELEMENT(NoteRelationNote) + +inline NoteRelationNotePtr makeNoteRelationNote() +{ + return std::make_shared(); } + +class NoteRelationNote : public ElementInterface +{ + public: + NoteRelationNote(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ MetronomeNote minOccurs = 1, maxOccurs = unbounded _________ */ + const MetronomeNoteSet &getMetronomeNoteSet() const; + void addMetronomeNote(const MetronomeNotePtr &value); + void removeMetronomeNote(const MetronomeNoteSetIterConst &setIterator); + void clearMetronomeNoteSet(); + + /* _________ MetronomeRelationGroup minOccurs = 0, maxOccurs = 1 _________ */ + MetronomeRelationGroupPtr getMetronomeRelationGroup() const; + void setMetronomeRelationGroup(const MetronomeRelationGroupPtr &value); + bool getHasMetronomeRelationGroup() const; + void setHasMetronomeRelationGroup(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MetronomeNoteSet myMetronomeNoteSet; + MetronomeRelationGroupPtr myMetronomeRelationGroup; + bool myHasMetronomeRelationGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteSize.cpp b/Sourcecode/private/mx/core/elements/NoteSize.cpp index edaecf47a..8eadefede 100644 --- a/Sourcecode/private/mx/core/elements/NoteSize.cpp +++ b/Sourcecode/private/mx/core/elements/NoteSize.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - NoteSize::NoteSize() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - NoteSize::NoteSize( const NonNegativeDecimal& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool NoteSize::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool NoteSize::hasContents() const - { - return true; - } - - - std::ostream& NoteSize::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& NoteSize::streamName( std::ostream& os ) const - { - os << "note-size"; - return os; - } - - - std::ostream& NoteSize::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +NoteSize::NoteSize() : myValue(), myAttributes(std::make_shared()) +{ +} +NoteSize::NoteSize(const NonNegativeDecimal &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - NoteSizeAttributesPtr NoteSize::getAttributes() const - { - return myAttributes; - } +bool NoteSize::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool NoteSize::hasContents() const +{ + return true; +} - void NoteSize::setAttributes( const NoteSizeAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &NoteSize::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &NoteSize::streamName(std::ostream &os) const +{ + os << "note-size"; + return os; +} - NonNegativeDecimal NoteSize::getValue() const - { - return myValue; - } +std::ostream &NoteSize::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NoteSizeAttributesPtr NoteSize::getAttributes() const +{ + return myAttributes; +} - void NoteSize::setValue( const NonNegativeDecimal& value ) - { - myValue = value; - } +void NoteSize::setAttributes(const NoteSizeAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +NonNegativeDecimal NoteSize::getValue() const +{ + return myValue; +} - bool NoteSize::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void NoteSize::setValue(const NonNegativeDecimal &value) +{ + myValue = value; +} - } +bool NoteSize::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteSize.h b/Sourcecode/private/mx/core/elements/NoteSize.h index 1d266482a..75b95d0eb 100644 --- a/Sourcecode/private/mx/core/elements/NoteSize.h +++ b/Sourcecode/private/mx/core/elements/NoteSize.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/NoteSizeAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteSizeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( NoteSize ) - - inline NoteSizePtr makeNoteSize() { return std::make_shared(); } - inline NoteSizePtr makeNoteSize( const NonNegativeDecimal& value ) { return std::make_shared( value ); } - inline NoteSizePtr makeNoteSize( NonNegativeDecimal&& value ) { return std::make_shared( std::move( value ) ); } - - class NoteSize : public ElementInterface - { - public: - NoteSize(); - NoteSize( const NonNegativeDecimal& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteSizeAttributesPtr getAttributes() const; - void setAttributes( const NoteSizeAttributesPtr& attributes ); - NonNegativeDecimal getValue() const; - void setValue( const NonNegativeDecimal& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeDecimal myValue; - NoteSizeAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(NoteSizeAttributes) +MX_FORWARD_DECLARE_ELEMENT(NoteSize) + +inline NoteSizePtr makeNoteSize() +{ + return std::make_shared(); } + +inline NoteSizePtr makeNoteSize(const NonNegativeDecimal &value) +{ + return std::make_shared(value); +} + +inline NoteSizePtr makeNoteSize(NonNegativeDecimal &&value) +{ + return std::make_shared(std::move(value)); +} + +class NoteSize : public ElementInterface +{ + public: + NoteSize(); + NoteSize(const NonNegativeDecimal &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NoteSizeAttributesPtr getAttributes() const; + void setAttributes(const NoteSizeAttributesPtr &attributes); + NonNegativeDecimal getValue() const; + void setValue(const NonNegativeDecimal &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeDecimal myValue; + NoteSizeAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp b/Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp index a2e4a50f4..24103e6f6 100644 --- a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - NoteSizeAttributes::NoteSizeAttributes() - :type( NoteSizeType::large ) - ,hasType( true ) - {} - +namespace core +{ +NoteSizeAttributes::NoteSizeAttributes() : type(NoteSizeType::large), hasType(true) +{ +} - bool NoteSizeAttributes::hasValues() const - { - return hasType; - } +bool NoteSizeAttributes::hasValues() const +{ + return hasType; +} +std::ostream &NoteSizeAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& NoteSizeAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool NoteSizeAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "NoteSizeAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool NoteSizeAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseNoteSizeType)) { - const char* const className = "NoteSizeAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseNoteSizeType ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.h b/Sourcecode/private/mx/core/elements/NoteSizeAttributes.h index 80b060263..a5d0dc175 100644 --- a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.h +++ b/Sourcecode/private/mx/core/elements/NoteSizeAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( NoteSizeAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(NoteSizeAttributes) - struct NoteSizeAttributes : public AttributesInterface - { - public: - NoteSizeAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - NoteSizeType type; - const bool hasType; +struct NoteSizeAttributes : public AttributesInterface +{ + public: + NoteSizeAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + NoteSizeType type; + const bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Notehead.cpp b/Sourcecode/private/mx/core/elements/Notehead.cpp index 07cecdab6..8955e117d 100644 --- a/Sourcecode/private/mx/core/elements/Notehead.cpp +++ b/Sourcecode/private/mx/core/elements/Notehead.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Notehead::Notehead() - :myValue( NoteheadValue::normal ) - ,myAttributes( std::make_shared() ) - {} - - - Notehead::Notehead( const NoteheadValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Notehead::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Notehead::hasContents() const - { - return true; - } - - - std::ostream& Notehead::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Notehead::streamName( std::ostream& os ) const - { - os << "notehead"; - return os; - } - - - std::ostream& Notehead::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Notehead::Notehead() : myValue(NoteheadValue::normal), myAttributes(std::make_shared()) +{ +} +Notehead::Notehead(const NoteheadValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - NoteheadAttributesPtr Notehead::getAttributes() const - { - return myAttributes; - } +bool Notehead::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Notehead::hasContents() const +{ + return true; +} - void Notehead::setAttributes( const NoteheadAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Notehead::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Notehead::streamName(std::ostream &os) const +{ + os << "notehead"; + return os; +} - NoteheadValue Notehead::getValue() const - { - return myValue; - } +std::ostream &Notehead::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NoteheadAttributesPtr Notehead::getAttributes() const +{ + return myAttributes; +} - void Notehead::setValue( const NoteheadValue& value ) - { - myValue = value; - } +void Notehead::setAttributes(const NoteheadAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +NoteheadValue Notehead::getValue() const +{ + return myValue; +} - bool Notehead::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseNoteheadValue( xelement.getValue() ); - return isSuccess; - } +void Notehead::setValue(const NoteheadValue &value) +{ + myValue = value; +} - } +bool Notehead::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseNoteheadValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Notehead.h b/Sourcecode/private/mx/core/elements/Notehead.h index aec8c27c7..a6c68b3d5 100644 --- a/Sourcecode/private/mx/core/elements/Notehead.h +++ b/Sourcecode/private/mx/core/elements/Notehead.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/NoteheadAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteheadAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Notehead ) - - inline NoteheadPtr makeNotehead() { return std::make_shared(); } - inline NoteheadPtr makeNotehead( const NoteheadValue& value ) { return std::make_shared( value ); } - inline NoteheadPtr makeNotehead( NoteheadValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Notehead : public ElementInterface - { - public: - Notehead(); - Notehead( const NoteheadValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteheadAttributesPtr getAttributes() const; - void setAttributes( const NoteheadAttributesPtr& attributes ); - NoteheadValue getValue() const; - void setValue( const NoteheadValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteheadValue myValue; - NoteheadAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(NoteheadAttributes) +MX_FORWARD_DECLARE_ELEMENT(Notehead) + +inline NoteheadPtr makeNotehead() +{ + return std::make_shared(); +} + +inline NoteheadPtr makeNotehead(const NoteheadValue &value) +{ + return std::make_shared(value); } + +inline NoteheadPtr makeNotehead(NoteheadValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Notehead : public ElementInterface +{ + public: + Notehead(); + Notehead(const NoteheadValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NoteheadAttributesPtr getAttributes() const; + void setAttributes(const NoteheadAttributesPtr &attributes); + NoteheadValue getValue() const; + void setValue(const NoteheadValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NoteheadValue myValue; + NoteheadAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp b/Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp index e2d8ffcd9..41172897f 100644 --- a/Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp @@ -8,75 +8,78 @@ namespace mx { - namespace core +namespace core +{ +NoteheadAttributes::NoteheadAttributes() + : filled(), parentheses(), fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), hasFilled(false), hasParentheses(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false) +{ +} + +bool NoteheadAttributes::hasValues() const +{ + return hasFilled || hasParentheses || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight | hasColor; +} + +std::ostream &NoteheadAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - NoteheadAttributes::NoteheadAttributes() - :filled() - ,parentheses() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasFilled( false ) - ,hasParentheses( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - {} + streamAttribute(os, filled, "filled", hasFilled); + streamAttribute(os, parentheses, "parentheses", hasParentheses); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + } + return os; +} +bool NoteheadAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "NoteheadAttributes"; + bool isSuccess = true; - bool NoteheadAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, filled, hasFilled, "filled", &parseYesNo)) { - return hasFilled || - hasParentheses || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight | - hasColor; + continue; } - - - std::ostream& NoteheadAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, filled, "filled", hasFilled ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - } - return os; + continue; } - - - bool NoteheadAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) { - const char* const className = "NoteheadAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, filled, hasFilled, "filled", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteheadAttributes.h b/Sourcecode/private/mx/core/elements/NoteheadAttributes.h index 93ad59995..34b1ccc73 100644 --- a/Sourcecode/private/mx/core/elements/NoteheadAttributes.h +++ b/Sourcecode/private/mx/core/elements/NoteheadAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,34 +17,34 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( NoteheadAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(NoteheadAttributes) - struct NoteheadAttributes : public AttributesInterface - { - public: - NoteheadAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo filled; - YesNo parentheses; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - bool hasFilled; - bool hasParentheses; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; +struct NoteheadAttributes : public AttributesInterface +{ + public: + NoteheadAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo filled; + YesNo parentheses; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + bool hasFilled; + bool hasParentheses; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteheadText.cpp b/Sourcecode/private/mx/core/elements/NoteheadText.cpp index cb92a2030..57d5a0467 100644 --- a/Sourcecode/private/mx/core/elements/NoteheadText.cpp +++ b/Sourcecode/private/mx/core/elements/NoteheadText.cpp @@ -3,140 +3,128 @@ // Distributed under the MIT License #include "mx/core/elements/NoteheadText.h" -#include "mx/core/elements/NoteheadTextChoice.h" #include "mx/core/FromXElement.h" #include "mx/core/elements/AccidentalText.h" #include "mx/core/elements/DisplayText.h" +#include "mx/core/elements/NoteheadTextChoice.h" #include namespace mx { - namespace core - { - NoteheadText::NoteheadText() - :myNoteheadTextChoiceSet() - { - myNoteheadTextChoiceSet.push_back( makeNoteheadTextChoice() ); - } - +namespace core +{ +NoteheadText::NoteheadText() : myNoteheadTextChoiceSet() +{ + myNoteheadTextChoiceSet.push_back(makeNoteheadTextChoice()); +} - bool NoteheadText::hasAttributes() const - { - return false; - } +bool NoteheadText::hasAttributes() const +{ + return false; +} +std::ostream &NoteheadText::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& NoteheadText::streamAttributes( std::ostream& os ) const - { - return os; - } +std::ostream &NoteheadText::streamName(std::ostream &os) const +{ + os << "notehead-text"; + return os; +} +bool NoteheadText::hasContents() const +{ + return true; +} - std::ostream& NoteheadText::streamName( std::ostream& os ) const - { - os << "notehead-text"; - return os; - } +std::ostream &NoteheadText::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + for (auto x : myNoteheadTextChoiceSet) + { + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); + } + os << std::endl; + return os; +} +const NoteheadTextChoiceSet &NoteheadText::getNoteheadTextChoiceSet() const +{ + return myNoteheadTextChoiceSet; +} - bool NoteheadText::hasContents() const - { - return true; - } +void NoteheadText::removeNoteheadTextChoice(const NoteheadTextChoiceSetIterConst &value) +{ + if (value != myNoteheadTextChoiceSet.cend()) + { + myNoteheadTextChoiceSet.erase(value); + } +} +void NoteheadText::addNoteheadTextChoice(const NoteheadTextChoicePtr &value) +{ + if (value) + { + myNoteheadTextChoiceSet.push_back(value); + } +} - std::ostream& NoteheadText::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - for( auto x : myNoteheadTextChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - return os; - } +void NoteheadText::clearNoteheadTextChoiceSet() +{ + myNoteheadTextChoiceSet.clear(); + myNoteheadTextChoiceSet.push_back(makeNoteheadTextChoice()); +} +bool NoteheadText::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isFirstItemAdded = false; + auto it = xelement.begin(); + auto endIter = xelement.end(); - const NoteheadTextChoiceSet& NoteheadText::getNoteheadTextChoiceSet() const - { - return myNoteheadTextChoiceSet; - } - - - void NoteheadText::removeNoteheadTextChoice( const NoteheadTextChoiceSetIterConst& value ) + for (; it != endIter; ++it) + { + if (it->getName() == "accidental-text") { - if ( value != myNoteheadTextChoiceSet.cend() ) + auto item = makeNoteheadTextChoice(); + item->setChoice(NoteheadTextChoice::Choice::accidentalText); + isSuccess &= item->getAccidentalText()->fromXElement(message, xelement); + + if (!isFirstItemAdded && myNoteheadTextChoiceSet.size() == 1) { - myNoteheadTextChoiceSet.erase( value ); + *myNoteheadTextChoiceSet.begin() = item; + isFirstItemAdded = true; } - } - - - void NoteheadText::addNoteheadTextChoice( const NoteheadTextChoicePtr& value ) - { - if ( value ) + else { - myNoteheadTextChoiceSet.push_back( value ); + myNoteheadTextChoiceSet.push_back(item); + isFirstItemAdded = true; } } - - - void NoteheadText::clearNoteheadTextChoiceSet() + else if (it->getName() == "display-text") { - myNoteheadTextChoiceSet.clear(); - myNoteheadTextChoiceSet.push_back( makeNoteheadTextChoice() ); - } + auto item = makeNoteheadTextChoice(); + item->setChoice(NoteheadTextChoice::Choice::displayText); + isSuccess &= item->getDisplayText()->fromXElement(message, xelement); - - bool NoteheadText::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstItemAdded = false; - auto it = xelement.begin(); - auto endIter = xelement.end(); - - for( ; it != endIter; ++ it ) + if (!isFirstItemAdded && myNoteheadTextChoiceSet.size() == 1) + { + *myNoteheadTextChoiceSet.begin() = item; + isFirstItemAdded = true; + } + else { - if( it->getName() == "accidental-text" ) - { - auto item = makeNoteheadTextChoice(); - item->setChoice( NoteheadTextChoice::Choice::accidentalText ); - isSuccess &= item->getAccidentalText()->fromXElement( message, xelement ); - - if( !isFirstItemAdded && myNoteheadTextChoiceSet.size() == 1 ) - { - *myNoteheadTextChoiceSet.begin() = item; - isFirstItemAdded = true; - } - else - { - myNoteheadTextChoiceSet.push_back( item ); - isFirstItemAdded = true; - } - } - else if( it->getName() == "display-text" ) - { - auto item = makeNoteheadTextChoice(); - item->setChoice( NoteheadTextChoice::Choice::displayText ); - isSuccess &= item->getDisplayText()->fromXElement( message, xelement ); - - if( !isFirstItemAdded && myNoteheadTextChoiceSet.size() == 1 ) - { - *myNoteheadTextChoiceSet.begin() = item; - isFirstItemAdded = true; - } - else - { - myNoteheadTextChoiceSet.push_back( item ); - isFirstItemAdded = true; - } - } - + myNoteheadTextChoiceSet.push_back(item); + isFirstItemAdded = true; } - - MX_RETURN_IS_SUCCESS; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteheadText.h b/Sourcecode/private/mx/core/elements/NoteheadText.h index 9d930c33a..af10258f7 100644 --- a/Sourcecode/private/mx/core/elements/NoteheadText.h +++ b/Sourcecode/private/mx/core/elements/NoteheadText.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,39 +13,42 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( DisplayText ) - MX_FORWARD_DECLARE_ELEMENT( NoteheadTextChoice ) - MX_FORWARD_DECLARE_ELEMENT( NoteheadText ) - - inline NoteheadTextPtr makeNoteheadText() { return std::make_shared(); } - - class NoteheadText : public ElementInterface - { - public: - NoteheadText(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ NoteheadTextChoice minOccurs = 1, maxOccurs = unbounded _________ */ - const NoteheadTextChoiceSet& getNoteheadTextChoiceSet() const; - void addNoteheadTextChoice( const NoteheadTextChoicePtr& value ); - void removeNoteheadTextChoice( const NoteheadTextChoiceSetIterConst& value ); - void clearNoteheadTextChoiceSet(); - NoteheadTextChoicePtr getNoteheadTextChoice( const NoteheadTextChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteheadTextChoiceSet myNoteheadTextChoiceSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(AccidentalText) +MX_FORWARD_DECLARE_ELEMENT(DisplayText) +MX_FORWARD_DECLARE_ELEMENT(NoteheadTextChoice) +MX_FORWARD_DECLARE_ELEMENT(NoteheadText) + +inline NoteheadTextPtr makeNoteheadText() +{ + return std::make_shared(); } + +class NoteheadText : public ElementInterface +{ + public: + NoteheadText(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ NoteheadTextChoice minOccurs = 1, maxOccurs = unbounded _________ */ + const NoteheadTextChoiceSet &getNoteheadTextChoiceSet() const; + void addNoteheadTextChoice(const NoteheadTextChoicePtr &value); + void removeNoteheadTextChoice(const NoteheadTextChoiceSetIterConst &value); + void clearNoteheadTextChoiceSet(); + NoteheadTextChoicePtr getNoteheadTextChoice(const NoteheadTextChoiceSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NoteheadTextChoiceSet myNoteheadTextChoiceSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp b/Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp index b5050a622..22f0a91b9 100644 --- a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp +++ b/Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp @@ -10,120 +10,107 @@ namespace mx { - namespace core +namespace core +{ +NoteheadTextChoice::NoteheadTextChoice() + : myChoice(Choice::displayText), myDisplayText(makeDisplayText()), myAccidentalText(makeAccidentalText()) +{ +} + +bool NoteheadTextChoice::hasAttributes() const +{ + return false; +} + +std::ostream &NoteheadTextChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &NoteheadTextChoice::streamName(std::ostream &os) const +{ + os << "notehead-text"; + return os; +} + +bool NoteheadTextChoice::hasContents() const +{ + return true; +} + +std::ostream &NoteheadTextChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + MX_UNUSED(isOneLineOnly); + switch (myChoice) { - NoteheadTextChoice::NoteheadTextChoice() - :myChoice( Choice::displayText ) - ,myDisplayText( makeDisplayText() ) - ,myAccidentalText( makeAccidentalText() ) - {} - - - bool NoteheadTextChoice::hasAttributes() const - { - return false; - } - - - std::ostream& NoteheadTextChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NoteheadTextChoice::streamName( std::ostream& os ) const - { - os << "notehead-text"; - return os; - } - - - bool NoteheadTextChoice::hasContents() const - { - return true; - } - - - std::ostream& NoteheadTextChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - MX_UNUSED( isOneLineOnly ); - switch ( myChoice ) - { - case Choice::displayText: - myDisplayText->toStream( os, indentLevel ); - break; - case Choice::accidentalText: - myAccidentalText->toStream( os, indentLevel ); - break; - default: - break; - } - return os; - } - - - NoteheadTextChoice::Choice NoteheadTextChoice::getChoice() const - { - return myChoice; - } - - - void NoteheadTextChoice::setChoice( NoteheadTextChoice::Choice value ) - { - myChoice = value; - } - - - DisplayTextPtr NoteheadTextChoice::getDisplayText() const - { - return myDisplayText; - } - - - void NoteheadTextChoice::setDisplayText( const DisplayTextPtr& value ) - { - if( value ) - { - myDisplayText = value; - } - } - - - AccidentalTextPtr NoteheadTextChoice::getAccidentalText() const - { - return myAccidentalText; - } - - - void NoteheadTextChoice::setAccidentalText( const AccidentalTextPtr& value ) - { - if( value ) - { - myAccidentalText = value; - } - } - - - bool NoteheadTextChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - - if( xelement.getName() == "display-text" ) - { - myChoice = Choice::displayText; - return getDisplayText()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "accidental-text" ) - { - myChoice = Choice::accidentalText; - return getAccidentalText()->fromXElement( message, xelement ); - } - - message << "NoteheadTextChoice: '" << xelement.getName() << "' is not a valid element" << std::endl; - - return false; - } - + case Choice::displayText: + myDisplayText->toStream(os, indentLevel); + break; + case Choice::accidentalText: + myAccidentalText->toStream(os, indentLevel); + break; + default: + break; } + return os; +} + +NoteheadTextChoice::Choice NoteheadTextChoice::getChoice() const +{ + return myChoice; +} + +void NoteheadTextChoice::setChoice(NoteheadTextChoice::Choice value) +{ + myChoice = value; +} + +DisplayTextPtr NoteheadTextChoice::getDisplayText() const +{ + return myDisplayText; } + +void NoteheadTextChoice::setDisplayText(const DisplayTextPtr &value) +{ + if (value) + { + myDisplayText = value; + } +} + +AccidentalTextPtr NoteheadTextChoice::getAccidentalText() const +{ + return myAccidentalText; +} + +void NoteheadTextChoice::setAccidentalText(const AccidentalTextPtr &value) +{ + if (value) + { + myAccidentalText = value; + } +} + +bool NoteheadTextChoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + + if (xelement.getName() == "display-text") + { + myChoice = Choice::displayText; + return getDisplayText()->fromXElement(message, xelement); + } + + if (xelement.getName() == "accidental-text") + { + myChoice = Choice::accidentalText; + return getAccidentalText()->fromXElement(message, xelement); + } + + message << "NoteheadTextChoice: '" << xelement.getName() << "' is not a valid element" << std::endl; + + return false; +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.h b/Sourcecode/private/mx/core/elements/NoteheadTextChoice.h index 62c5fea42..1d0929454 100644 --- a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.h +++ b/Sourcecode/private/mx/core/elements/NoteheadTextChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,51 +13,53 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( DisplayText ) - MX_FORWARD_DECLARE_ELEMENT( NoteheadTextChoice ) - - inline NoteheadTextChoicePtr makeNoteheadTextChoice() { return std::make_shared(); } - - class NoteheadTextChoice : public ElementInterface - { - public: - - enum class Choice - { - displayText = 0, - accidentalText = 1 - }; - - NoteheadTextChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - NoteheadTextChoice::Choice getChoice() const; - void setChoice( NoteheadTextChoice::Choice value ); - - /* _________ DisplayText minOccurs = 1, maxOccurs = 1 _________ */ - DisplayTextPtr getDisplayText() const; - void setDisplayText( const DisplayTextPtr& value ); - - /* _________ AccidentalText minOccurs = 1, maxOccurs = 1 _________ */ - AccidentalTextPtr getAccidentalText() const; - void setAccidentalText( const AccidentalTextPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - DisplayTextPtr myDisplayText; - AccidentalTextPtr myAccidentalText; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(AccidentalText) +MX_FORWARD_DECLARE_ELEMENT(DisplayText) +MX_FORWARD_DECLARE_ELEMENT(NoteheadTextChoice) + +inline NoteheadTextChoicePtr makeNoteheadTextChoice() +{ + return std::make_shared(); } + +class NoteheadTextChoice : public ElementInterface +{ + public: + enum class Choice + { + displayText = 0, + accidentalText = 1 + }; + + NoteheadTextChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + NoteheadTextChoice::Choice getChoice() const; + void setChoice(NoteheadTextChoice::Choice value); + + /* _________ DisplayText minOccurs = 1, maxOccurs = 1 _________ */ + DisplayTextPtr getDisplayText() const; + void setDisplayText(const DisplayTextPtr &value); + + /* _________ AccidentalText minOccurs = 1, maxOccurs = 1 _________ */ + AccidentalTextPtr getAccidentalText() const; + void setAccidentalText(const AccidentalTextPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + DisplayTextPtr myDisplayText; + AccidentalTextPtr myAccidentalText; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Octave.cpp b/Sourcecode/private/mx/core/elements/Octave.cpp index c48407e7c..a494d7236 100644 --- a/Sourcecode/private/mx/core/elements/Octave.cpp +++ b/Sourcecode/private/mx/core/elements/Octave.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Octave::Octave() - :myValue() - {} - - - Octave::Octave( const OctaveValue& value ) - :myValue( value ) - {} - - - bool Octave::hasAttributes() const - { - return false; - } - - - bool Octave::hasContents() const - { - return true; - } - - - std::ostream& Octave::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Octave::streamName( std::ostream& os ) const - { - os << "octave"; - return os; - } +namespace core +{ +Octave::Octave() : myValue() +{ +} +Octave::Octave(const OctaveValue &value) : myValue(value) +{ +} - std::ostream& Octave::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Octave::hasAttributes() const +{ + return false; +} +bool Octave::hasContents() const +{ + return true; +} - OctaveValue Octave::getValue() const - { - return myValue; - } +std::ostream &Octave::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Octave::streamName(std::ostream &os) const +{ + os << "octave"; + return os; +} - void Octave::setValue( const OctaveValue& value ) - { - myValue = value; - } +std::ostream &Octave::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OctaveValue Octave::getValue() const +{ + return myValue; +} - bool Octave::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Octave::setValue(const OctaveValue &value) +{ + myValue = value; +} - } +bool Octave::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Octave.h b/Sourcecode/private/mx/core/elements/Octave.h index 7c1aaa90e..2bcdf0987 100644 --- a/Sourcecode/private/mx/core/elements/Octave.h +++ b/Sourcecode/private/mx/core/elements/Octave.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Octave ) - - inline OctavePtr makeOctave() { return std::make_shared(); } - inline OctavePtr makeOctave( const OctaveValue& value ) { return std::make_shared( value ); } - inline OctavePtr makeOctave( OctaveValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Octave : public ElementInterface - { - public: - Octave(); - Octave( const OctaveValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OctaveValue getValue() const; - void setValue( const OctaveValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OctaveValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Octave) + +inline OctavePtr makeOctave() +{ + return std::make_shared(); +} + +inline OctavePtr makeOctave(const OctaveValue &value) +{ + return std::make_shared(value); } + +inline OctavePtr makeOctave(OctaveValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Octave : public ElementInterface +{ + public: + Octave(); + Octave(const OctaveValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OctaveValue getValue() const; + void setValue(const OctaveValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + OctaveValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OctaveChange.cpp b/Sourcecode/private/mx/core/elements/OctaveChange.cpp index 6974b3a28..e20391a14 100644 --- a/Sourcecode/private/mx/core/elements/OctaveChange.cpp +++ b/Sourcecode/private/mx/core/elements/OctaveChange.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - OctaveChange::OctaveChange() - :myValue() - {} - - - OctaveChange::OctaveChange( const Integer& value ) - :myValue( value ) - {} - - - bool OctaveChange::hasAttributes() const - { - return false; - } - - - bool OctaveChange::hasContents() const - { - return true; - } - - - std::ostream& OctaveChange::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& OctaveChange::streamName( std::ostream& os ) const - { - os << "octave-change"; - return os; - } +namespace core +{ +OctaveChange::OctaveChange() : myValue() +{ +} +OctaveChange::OctaveChange(const Integer &value) : myValue(value) +{ +} - std::ostream& OctaveChange::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool OctaveChange::hasAttributes() const +{ + return false; +} +bool OctaveChange::hasContents() const +{ + return true; +} - Integer OctaveChange::getValue() const - { - return myValue; - } +std::ostream &OctaveChange::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &OctaveChange::streamName(std::ostream &os) const +{ + os << "octave-change"; + return os; +} - void OctaveChange::setValue( const Integer& value ) - { - myValue = value; - } +std::ostream &OctaveChange::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Integer OctaveChange::getValue() const +{ + return myValue; +} - bool OctaveChange::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue.parse( xelement.getValue() ); - return true; - } +void OctaveChange::setValue(const Integer &value) +{ + myValue = value; +} - } +bool OctaveChange::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OctaveChange.h b/Sourcecode/private/mx/core/elements/OctaveChange.h index ed9e74a51..3d69764d9 100644 --- a/Sourcecode/private/mx/core/elements/OctaveChange.h +++ b/Sourcecode/private/mx/core/elements/OctaveChange.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( OctaveChange ) - - inline OctaveChangePtr makeOctaveChange() { return std::make_shared(); } - inline OctaveChangePtr makeOctaveChange( const Integer& value ) { return std::make_shared( value ); } - inline OctaveChangePtr makeOctaveChange( Integer&& value ) { return std::make_shared( std::move( value ) ); } - - class OctaveChange : public ElementInterface - { - public: - OctaveChange(); - OctaveChange( const Integer& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Integer getValue() const; - void setValue( const Integer& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Integer myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(OctaveChange) + +inline OctaveChangePtr makeOctaveChange() +{ + return std::make_shared(); +} + +inline OctaveChangePtr makeOctaveChange(const Integer &value) +{ + return std::make_shared(value); } + +inline OctaveChangePtr makeOctaveChange(Integer &&value) +{ + return std::make_shared(std::move(value)); +} + +class OctaveChange : public ElementInterface +{ + public: + OctaveChange(); + OctaveChange(const Integer &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Integer getValue() const; + void setValue(const Integer &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Integer myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OctaveShift.cpp b/Sourcecode/private/mx/core/elements/OctaveShift.cpp index e21f60432..8bc2a4dc0 100644 --- a/Sourcecode/private/mx/core/elements/OctaveShift.cpp +++ b/Sourcecode/private/mx/core/elements/OctaveShift.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - OctaveShift::OctaveShift() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool OctaveShift::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OctaveShift::hasContents() const { return false; } - std::ostream& OctaveShift::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OctaveShift::streamName( std::ostream& os ) const { os << "octave-shift"; return os; } - std::ostream& OctaveShift::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +OctaveShift::OctaveShift() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool OctaveShift::hasAttributes() const +{ + return myAttributes->hasValues(); +} - OctaveShiftAttributesPtr OctaveShift::getAttributes() const - { - return myAttributes; - } +bool OctaveShift::hasContents() const +{ + return false; +} +std::ostream &OctaveShift::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void OctaveShift::setAttributes( const OctaveShiftAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OctaveShift::streamName(std::ostream &os) const +{ + os << "octave-shift"; + return os; +} +std::ostream &OctaveShift::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool OctaveShift::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +OctaveShiftAttributesPtr OctaveShift::getAttributes() const +{ + return myAttributes; +} +void OctaveShift::setAttributes(const OctaveShiftAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool OctaveShift::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OctaveShift.h b/Sourcecode/private/mx/core/elements/OctaveShift.h index 2e4e8ea08..38eab57bc 100644 --- a/Sourcecode/private/mx/core/elements/OctaveShift.h +++ b/Sourcecode/private/mx/core/elements/OctaveShift.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/OctaveShiftAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OctaveShiftAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OctaveShift ) - - inline OctaveShiftPtr makeOctaveShift() { return std::make_shared(); } - - class OctaveShift : public ElementInterface - { - public: - OctaveShift(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OctaveShiftAttributesPtr getAttributes() const; - void setAttributes( const OctaveShiftAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OctaveShiftAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OctaveShiftAttributes) +MX_FORWARD_DECLARE_ELEMENT(OctaveShift) + +inline OctaveShiftPtr makeOctaveShift() +{ + return std::make_shared(); } + +class OctaveShift : public ElementInterface +{ + public: + OctaveShift(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OctaveShiftAttributesPtr getAttributes() const; + void setAttributes(const OctaveShiftAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + OctaveShiftAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp b/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp index 3167f3c5e..0b2bed8af 100644 --- a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp @@ -8,112 +8,118 @@ namespace mx { - namespace core +namespace core +{ +OctaveShiftAttributes::OctaveShiftAttributes() + : type(UpDownStopContinue::up), number(), size(8), dashLength(), spaceLength(), defaultX(), defaultY(), relativeX(), + relativeY(), fontFamily(), fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), + fontWeight(FontWeight::normal), hasType(true), hasNumber(false), hasSize(false), hasDashLength(false), + hasSpaceLength(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false) +{ +} + +bool OctaveShiftAttributes::hasValues() const +{ + return hasType || hasNumber || hasSize || hasDashLength || hasSpaceLength || hasDefaultX || hasDefaultY || + hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight; +} + +std::ostream &OctaveShiftAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - OctaveShiftAttributes::OctaveShiftAttributes() - :type( UpDownStopContinue::up ) - ,number() - ,size( 8 ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,hasType( true ) - ,hasNumber( false ) - ,hasSize( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, size, "size", hasSize); + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, spaceLength, "space-length", hasSpaceLength); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} +bool OctaveShiftAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OctaveShiftAttributes"; + bool isSuccess = true; + bool isTypeFound = false; - bool OctaveShiftAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseUpDownStopContinue)) { - return hasType || - hasNumber || - hasSize || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& OctaveShiftAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, size, "size", hasSize ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool OctaveShiftAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, size, hasSize, "size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dashLength, hasDashLength, "dash-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length")) { - const char* const className = "OctaveShiftAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseUpDownStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, size, hasSize, "size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h b/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h index 124bb20b2..9ba4bafe6 100644 --- a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h +++ b/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -18,46 +18,46 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OctaveShiftAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OctaveShiftAttributes) - struct OctaveShiftAttributes : public AttributesInterface - { - public: - OctaveShiftAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - UpDownStopContinue type; - NumberLevel number; - PositiveInteger size; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - const bool hasType; - bool hasNumber; - bool hasSize; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct OctaveShiftAttributes : public AttributesInterface +{ + public: + OctaveShiftAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + UpDownStopContinue type; + NumberLevel number; + PositiveInteger size; + TenthsValue dashLength; + TenthsValue spaceLength; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + const bool hasType; + bool hasNumber; + bool hasSize; + bool hasDashLength; + bool hasSpaceLength; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Offset.cpp b/Sourcecode/private/mx/core/elements/Offset.cpp index 5a6a3df24..9c956aa14 100644 --- a/Sourcecode/private/mx/core/elements/Offset.cpp +++ b/Sourcecode/private/mx/core/elements/Offset.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Offset::Offset() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Offset::Offset( const DivisionsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Offset::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Offset::hasContents() const - { - return true; - } - - - std::ostream& Offset::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Offset::streamName( std::ostream& os ) const - { - os << "offset"; - return os; - } - - - std::ostream& Offset::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Offset::Offset() : myValue(), myAttributes(std::make_shared()) +{ +} +Offset::Offset(const DivisionsValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - OffsetAttributesPtr Offset::getAttributes() const - { - return myAttributes; - } +bool Offset::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Offset::hasContents() const +{ + return true; +} - void Offset::setAttributes( const OffsetAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Offset::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Offset::streamName(std::ostream &os) const +{ + os << "offset"; + return os; +} - DivisionsValue Offset::getValue() const - { - return myValue; - } +std::ostream &Offset::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OffsetAttributesPtr Offset::getAttributes() const +{ + return myAttributes; +} - void Offset::setValue( const DivisionsValue& value ) - { - myValue = value; - } +void Offset::setAttributes(const OffsetAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +DivisionsValue Offset::getValue() const +{ + return myValue; +} - bool Offset::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Offset::setValue(const DivisionsValue &value) +{ + myValue = value; +} - } +bool Offset::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Offset.h b/Sourcecode/private/mx/core/elements/Offset.h index 9abb121e1..83cad689d 100644 --- a/Sourcecode/private/mx/core/elements/Offset.h +++ b/Sourcecode/private/mx/core/elements/Offset.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/OffsetAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OffsetAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Offset ) - - inline OffsetPtr makeOffset() { return std::make_shared(); } - inline OffsetPtr makeOffset( const DivisionsValue& value ) { return std::make_shared( value ); } - inline OffsetPtr makeOffset( DivisionsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Offset : public ElementInterface - { - public: - Offset(); - Offset( const DivisionsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OffsetAttributesPtr getAttributes() const; - void setAttributes( const OffsetAttributesPtr& attributes ); - DivisionsValue getValue() const; - void setValue( const DivisionsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DivisionsValue myValue; - OffsetAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OffsetAttributes) +MX_FORWARD_DECLARE_ELEMENT(Offset) + +inline OffsetPtr makeOffset() +{ + return std::make_shared(); } + +inline OffsetPtr makeOffset(const DivisionsValue &value) +{ + return std::make_shared(value); +} + +inline OffsetPtr makeOffset(DivisionsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Offset : public ElementInterface +{ + public: + Offset(); + Offset(const DivisionsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OffsetAttributesPtr getAttributes() const; + void setAttributes(const OffsetAttributesPtr &attributes); + DivisionsValue getValue() const; + void setValue(const DivisionsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + DivisionsValue myValue; + OffsetAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OffsetAttributes.cpp b/Sourcecode/private/mx/core/elements/OffsetAttributes.cpp index c255e40f6..a0ec470f7 100644 --- a/Sourcecode/private/mx/core/elements/OffsetAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OffsetAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - OffsetAttributes::OffsetAttributes() - :sound() - ,hasSound( false ) - {} - +namespace core +{ +OffsetAttributes::OffsetAttributes() : sound(), hasSound(false) +{ +} - bool OffsetAttributes::hasValues() const - { - return hasSound; - } +bool OffsetAttributes::hasValues() const +{ + return hasSound; +} +std::ostream &OffsetAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, sound, "sound", hasSound); + } + return os; +} - std::ostream& OffsetAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, sound, "sound", hasSound ); - } - return os; - } +bool OffsetAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OffsetAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OffsetAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, sound, hasSound, "sound", &parseYesNo)) { - const char* const className = "OffsetAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, sound, hasSound, "sound", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OffsetAttributes.h b/Sourcecode/private/mx/core/elements/OffsetAttributes.h index e360c3968..30d7a8156 100644 --- a/Sourcecode/private/mx/core/elements/OffsetAttributes.h +++ b/Sourcecode/private/mx/core/elements/OffsetAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OffsetAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OffsetAttributes) - struct OffsetAttributes : public AttributesInterface - { - public: - OffsetAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo sound; - bool hasSound; +struct OffsetAttributes : public AttributesInterface +{ + public: + OffsetAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo sound; + bool hasSound; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OpenString.cpp b/Sourcecode/private/mx/core/elements/OpenString.cpp index 76eb8fd91..3c553cadc 100644 --- a/Sourcecode/private/mx/core/elements/OpenString.cpp +++ b/Sourcecode/private/mx/core/elements/OpenString.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - OpenString::OpenString() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool OpenString::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OpenString::hasContents() const { return false; } - std::ostream& OpenString::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OpenString::streamName( std::ostream& os ) const { os << "open-string"; return os; } - std::ostream& OpenString::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +OpenString::OpenString() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool OpenString::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr OpenString::getAttributes() const - { - return myAttributes; - } +bool OpenString::hasContents() const +{ + return false; +} +std::ostream &OpenString::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void OpenString::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OpenString::streamName(std::ostream &os) const +{ + os << "open-string"; + return os; +} +std::ostream &OpenString::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool OpenString::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr OpenString::getAttributes() const +{ + return myAttributes; +} +void OpenString::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool OpenString::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OpenString.h b/Sourcecode/private/mx/core/elements/OpenString.h index ea2c00538..fc6ab654d 100644 --- a/Sourcecode/private/mx/core/elements/OpenString.h +++ b/Sourcecode/private/mx/core/elements/OpenString.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OpenString ) - - inline OpenStringPtr makeOpenString() { return std::make_shared(); } - - class OpenString : public ElementInterface - { - public: - OpenString(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(OpenString) + +inline OpenStringPtr makeOpenString() +{ + return std::make_shared(); } + +class OpenString : public ElementInterface +{ + public: + OpenString(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Opus.cpp b/Sourcecode/private/mx/core/elements/Opus.cpp index f46d04956..88d5bc2c5 100644 --- a/Sourcecode/private/mx/core/elements/Opus.cpp +++ b/Sourcecode/private/mx/core/elements/Opus.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Opus::Opus() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Opus::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Opus::hasContents() const { return false; } - std::ostream& Opus::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Opus::streamName( std::ostream& os ) const { os << "opus"; return os; } - std::ostream& Opus::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Opus::Opus() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Opus::hasAttributes() const +{ + return myAttributes->hasValues(); +} - OpusAttributesPtr Opus::getAttributes() const - { - return myAttributes; - } +bool Opus::hasContents() const +{ + return false; +} +std::ostream &Opus::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Opus::setAttributes( const OpusAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Opus::streamName(std::ostream &os) const +{ + os << "opus"; + return os; +} +std::ostream &Opus::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Opus::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +OpusAttributesPtr Opus::getAttributes() const +{ + return myAttributes; +} +void Opus::setAttributes(const OpusAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Opus::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Opus.h b/Sourcecode/private/mx/core/elements/Opus.h index f289d9afc..1b066f86e 100644 --- a/Sourcecode/private/mx/core/elements/Opus.h +++ b/Sourcecode/private/mx/core/elements/Opus.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/OpusAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OpusAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Opus ) - - inline OpusPtr makeOpus() { return std::make_shared(); } - - class Opus : public ElementInterface - { - public: - Opus(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OpusAttributesPtr getAttributes() const; - void setAttributes( const OpusAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OpusAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OpusAttributes) +MX_FORWARD_DECLARE_ELEMENT(Opus) + +inline OpusPtr makeOpus() +{ + return std::make_shared(); } + +class Opus : public ElementInterface +{ + public: + Opus(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OpusAttributesPtr getAttributes() const; + void setAttributes(const OpusAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + OpusAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OpusAttributes.cpp b/Sourcecode/private/mx/core/elements/OpusAttributes.cpp index dd5aa181f..877531c3c 100644 --- a/Sourcecode/private/mx/core/elements/OpusAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OpusAttributes.cpp @@ -8,83 +8,81 @@ namespace mx { - namespace core +namespace core +{ +OpusAttributes::OpusAttributes() + : href(), type(XlinkType::simple), role(), title(), show(XlinkShow::replace), actuate(XlinkActuate::onRequest), + hasHref(true), hasType(false), hasRole(false), hasTitle(false), hasShow(false), hasActuate(false) +{ +} + +bool OpusAttributes::hasValues() const +{ + return hasHref || hasType || hasRole || hasTitle || hasShow || hasActuate; +} + +std::ostream &OpusAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - OpusAttributes::OpusAttributes() - :href() - ,type( XlinkType::simple ) - ,role() - ,title() - ,show( XlinkShow::replace ) - ,actuate( XlinkActuate::onRequest ) - ,hasHref( true ) - ,hasType( false ) - ,hasRole( false ) - ,hasTitle( false ) - ,hasShow( false ) - ,hasActuate( false ) - {} + streamAttribute(os, href, "xlink:href", hasHref); + streamAttribute(os, type, "xlink:type", hasType); + streamAttribute(os, role, "xlink:role", hasRole); + streamAttribute(os, title, "xlink:title", hasTitle); + streamAttribute(os, show, "xlink:show", hasShow); + streamAttribute(os, actuate, "xlink:actuate", hasActuate); + } + return os; +} +bool OpusAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OpusAttributes"; + bool isSuccess = true; + bool isHrefFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OpusAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, href, isHrefFound, "href")) { - return hasHref || - hasType || - hasRole || - hasTitle || - hasShow || - hasActuate; + continue; } - - std::ostream& OpusAttributes::toStream( std::ostream& os ) const + if (it->getName() == "xlink:type") { - if ( hasValues() ) - { - streamAttribute( os, href, "xlink:href", hasHref ); - streamAttribute( os, type, "xlink:type", hasType ); - streamAttribute( os, role, "xlink:role", hasRole ); - streamAttribute( os, title, "xlink:title", hasTitle ); - streamAttribute( os, show, "xlink:show", hasShow ); - streamAttribute( os, actuate, "xlink:actuate", hasActuate ); - } - return os; + hasType = true; + continue; } - - bool OpusAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, role, hasRole, "role")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, title, hasTitle, "title")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, show, hasShow, "show", &parseXlinkShow)) { - const char* const className = "OpusAttributes"; - bool isSuccess = true; - bool isHrefFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, href, isHrefFound, "href" ) ) { continue; } - - if( it->getName() == "xlink:type" ) - { - hasType = true; - continue; - } - - if( parseAttribute( message, it, className, isSuccess, role, hasRole, "role" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, title, hasTitle, "title" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, show, hasShow, "show", &parseXlinkShow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, actuate, hasActuate, "actuate", &parseXlinkActuate ) ) { continue; } - } - - if( !isHrefFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + if (parseAttribute(message, it, className, isSuccess, actuate, hasActuate, "actuate", &parseXlinkActuate)) + { + continue; + } + } + if (!isHrefFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OpusAttributes.h b/Sourcecode/private/mx/core/elements/OpusAttributes.h index 27178e784..c52693c79 100644 --- a/Sourcecode/private/mx/core/elements/OpusAttributes.h +++ b/Sourcecode/private/mx/core/elements/OpusAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XlinkHref.h" #include "mx/core/XlinkRole.h" #include "mx/core/XlinkTitle.h" @@ -17,32 +17,32 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OpusAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OpusAttributes) - struct OpusAttributes : public AttributesInterface - { - public: - OpusAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XlinkHref href; - const XlinkType type; - XlinkRole role; - XlinkTitle title; - XlinkShow show; - XlinkActuate actuate; - const bool hasHref; - bool hasType; - bool hasRole; - bool hasTitle; - bool hasShow; - bool hasActuate; +struct OpusAttributes : public AttributesInterface +{ + public: + OpusAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XlinkHref href; + const XlinkType type; + XlinkRole role; + XlinkTitle title; + XlinkShow show; + XlinkActuate actuate; + const bool hasHref; + bool hasType; + bool hasRole; + bool hasTitle; + bool hasShow; + bool hasActuate; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Ornaments.cpp b/Sourcecode/private/mx/core/elements/Ornaments.cpp index 2c938ceed..73cf281dd 100644 --- a/Sourcecode/private/mx/core/elements/Ornaments.cpp +++ b/Sourcecode/private/mx/core/elements/Ornaments.cpp @@ -6,196 +6,167 @@ #include "mx/core/FromXElement.h" #include "mx/core/elements/AccidentalMark.h" #include "mx/core/elements/OrnamentsChoice.h" -#include #include +#include namespace mx { - namespace core - { - Ornaments::Ornaments() - :myOrnamentsChoiceSet() - ,myAccidentalMarkSet() - {} - +namespace core +{ +Ornaments::Ornaments() : myOrnamentsChoiceSet(), myAccidentalMarkSet() +{ +} - bool Ornaments::hasAttributes() const - { - return false; - } +bool Ornaments::hasAttributes() const +{ + return false; +} +std::ostream &Ornaments::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& Ornaments::streamAttributes( std::ostream& os ) const - { - return os; - } +std::ostream &Ornaments::streamName(std::ostream &os) const +{ + os << "ornaments"; + return os; +} +bool Ornaments::hasContents() const +{ + return true; +} - std::ostream& Ornaments::streamName( std::ostream& os ) const - { - os << "ornaments"; - return os; - } +std::ostream &Ornaments::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto x : myOrnamentsChoiceSet) + { + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); + } + for (auto x : myAccidentalMarkSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + isOneLineOnly = false; + os << std::endl; + return os; +} +const OrnamentsChoiceSet &Ornaments::getOrnamentsChoiceSet() const +{ + return myOrnamentsChoiceSet; +} - bool Ornaments::hasContents() const - { - return true; - } +void Ornaments::removeOrnamentsChoice(const OrnamentsChoiceSetIterConst &value) +{ + if (value != myOrnamentsChoiceSet.cend()) + { + myOrnamentsChoiceSet.erase(value); + } +} +void Ornaments::addOrnamentsChoice(const OrnamentsChoicePtr &value) +{ + if (value) + { + myOrnamentsChoiceSet.push_back(value); + } +} - std::ostream& Ornaments::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myOrnamentsChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - for ( auto x : myAccidentalMarkSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - const OrnamentsChoiceSet& Ornaments::getOrnamentsChoiceSet() const - { - return myOrnamentsChoiceSet; - } - - - void Ornaments::removeOrnamentsChoice( const OrnamentsChoiceSetIterConst& value ) - { - if ( value != myOrnamentsChoiceSet.cend() ) - { - myOrnamentsChoiceSet.erase( value ); - } - } - - - void Ornaments::addOrnamentsChoice( const OrnamentsChoicePtr& value ) - { - if ( value ) - { - myOrnamentsChoiceSet.push_back( value ); - } - } - - - void Ornaments::clearOrnamentsChoiceSet() - { - myOrnamentsChoiceSet.clear(); - } - - - OrnamentsChoicePtr Ornaments::getOrnamentsChoice( const OrnamentsChoiceSetIterConst& setIterator ) const - { - if( setIterator != myOrnamentsChoiceSet.cend() ) - { - return *setIterator; - } - return OrnamentsChoicePtr(); - } +void Ornaments::clearOrnamentsChoiceSet() +{ + myOrnamentsChoiceSet.clear(); +} +OrnamentsChoicePtr Ornaments::getOrnamentsChoice(const OrnamentsChoiceSetIterConst &setIterator) const +{ + if (setIterator != myOrnamentsChoiceSet.cend()) + { + return *setIterator; + } + return OrnamentsChoicePtr(); +} - const AccidentalMarkSet& Ornaments::getAccidentalMarkSet() const - { - return myAccidentalMarkSet; - } +const AccidentalMarkSet &Ornaments::getAccidentalMarkSet() const +{ + return myAccidentalMarkSet; +} +void Ornaments::removeAccidentalMark(const AccidentalMarkSetIterConst &value) +{ + if (value != myAccidentalMarkSet.cend()) + { + myAccidentalMarkSet.erase(value); + } +} - void Ornaments::removeAccidentalMark( const AccidentalMarkSetIterConst& value ) - { - if ( value != myAccidentalMarkSet.cend() ) - { - myAccidentalMarkSet.erase( value ); - } - } +void Ornaments::addAccidentalMark(const AccidentalMarkPtr &value) +{ + if (value) + { + myAccidentalMarkSet.push_back(value); + } +} +void Ornaments::clearAccidentalMarkSet() +{ + myAccidentalMarkSet.clear(); +} - void Ornaments::addAccidentalMark( const AccidentalMarkPtr& value ) - { - if ( value ) - { - myAccidentalMarkSet.push_back( value ); - } - } +AccidentalMarkPtr Ornaments::getAccidentalMark(const AccidentalMarkSetIterConst &setIterator) const +{ + if (setIterator != myAccidentalMarkSet.cend()) + { + return *setIterator; + } + return AccidentalMarkPtr(); +} +constexpr const char *const ornamentsChoices[] = { + "trill-mark", "turn", "delayed-turn", "inverted-turn", "delayed-inverted-turn", + "vertical-turn", "shake", "wavy-line", "mordent", "inverted-mordent", + "schleifer", "tremolo", "other-ornament"}; - void Ornaments::clearAccidentalMarkSet() - { - myAccidentalMarkSet.clear(); - } +constexpr size_t ornamentsChoicesSize = 13; +bool Ornaments::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; - AccidentalMarkPtr Ornaments::getAccidentalMark( const AccidentalMarkSetIterConst& setIterator ) const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (isOrnamentsChoice(it->getName().c_str())) { - if( setIterator != myAccidentalMarkSet.cend() ) - { - return *setIterator; - } - return AccidentalMarkPtr(); + auto item = makeOrnamentsChoice(); + isSuccess &= item->fromXElement(message, *it); + addOrnamentsChoice(item); + continue; } - - - constexpr const char* const ornamentsChoices[] = - { - "trill-mark" - , "turn" - , "delayed-turn" - , "inverted-turn" - , "delayed-inverted-turn" - , "vertical-turn" - , "shake" - , "wavy-line" - , "mordent" - , "inverted-mordent" - , "schleifer" - , "tremolo" - , "other-ornament" - }; - - - constexpr size_t ornamentsChoicesSize = 13; - - - bool Ornaments::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + + if (importElementSet(message, it, endIter, isSuccess, "accidental-mark", myAccidentalMarkSet)) { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if( isOrnamentsChoice( it->getName().c_str() ) ) - { - auto item = makeOrnamentsChoice(); - isSuccess &= item->fromXElement( message, *it ); - addOrnamentsChoice( item ); - continue; - } - - if( importElementSet( message, it, endIter, isSuccess, "accidental-mark", myAccidentalMarkSet ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - - - bool Ornaments::isOrnamentsChoice( const char* const name ) const + } + + MX_RETURN_IS_SUCCESS; +} + +bool Ornaments::isOrnamentsChoice(const char *const name) const +{ + for (size_t i = 0; i < ornamentsChoicesSize; ++i) + { + if (strcmp(name, ornamentsChoices[i]) == 0) { - for( size_t i = 0; i < ornamentsChoicesSize; ++ i ) - { - if( strcmp( name, ornamentsChoices[i] ) == 0 ) - { - return true; - } - } - return false; + return true; } - } + return false; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Ornaments.h b/Sourcecode/private/mx/core/elements/Ornaments.h index 3a7273c5f..9cdfe7bf1 100644 --- a/Sourcecode/private/mx/core/elements/Ornaments.h +++ b/Sourcecode/private/mx/core/elements/Ornaments.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,49 +13,51 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccidentalMark ) - MX_FORWARD_DECLARE_ELEMENT( OrnamentsChoice ) - MX_FORWARD_DECLARE_ELEMENT( Ornaments ) - - inline OrnamentsPtr makeOrnaments() { return std::make_shared(); } - - class Ornaments : public ElementInterface - { - public: - Ornaments(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ OrnamentsChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const OrnamentsChoiceSet& getOrnamentsChoiceSet() const; - void addOrnamentsChoice( const OrnamentsChoicePtr& value ); - void removeOrnamentsChoice( const OrnamentsChoiceSetIterConst& value ); - void clearOrnamentsChoiceSet(); - OrnamentsChoicePtr getOrnamentsChoice( const OrnamentsChoiceSetIterConst& setIterator ) const; - - - /* _________ AccidentalMark minOccurs = 0, maxOccurs = unbounded _________ */ - const AccidentalMarkSet& getAccidentalMarkSet() const; - void addAccidentalMark( const AccidentalMarkPtr& value ); - void removeAccidentalMark( const AccidentalMarkSetIterConst& value ); - void clearAccidentalMarkSet(); - AccidentalMarkPtr getAccidentalMark( const AccidentalMarkSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OrnamentsChoiceSet myOrnamentsChoiceSet; - AccidentalMarkSet myAccidentalMarkSet; - - bool isOrnamentsChoice( const char* const name ) const; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(AccidentalMark) +MX_FORWARD_DECLARE_ELEMENT(OrnamentsChoice) +MX_FORWARD_DECLARE_ELEMENT(Ornaments) + +inline OrnamentsPtr makeOrnaments() +{ + return std::make_shared(); } + +class Ornaments : public ElementInterface +{ + public: + Ornaments(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ OrnamentsChoice minOccurs = 0, maxOccurs = unbounded _________ */ + const OrnamentsChoiceSet &getOrnamentsChoiceSet() const; + void addOrnamentsChoice(const OrnamentsChoicePtr &value); + void removeOrnamentsChoice(const OrnamentsChoiceSetIterConst &value); + void clearOrnamentsChoiceSet(); + OrnamentsChoicePtr getOrnamentsChoice(const OrnamentsChoiceSetIterConst &setIterator) const; + + /* _________ AccidentalMark minOccurs = 0, maxOccurs = unbounded _________ */ + const AccidentalMarkSet &getAccidentalMarkSet() const; + void addAccidentalMark(const AccidentalMarkPtr &value); + void removeAccidentalMark(const AccidentalMarkSetIterConst &value); + void clearAccidentalMarkSet(); + AccidentalMarkPtr getAccidentalMark(const AccidentalMarkSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + OrnamentsChoiceSet myOrnamentsChoiceSet; + AccidentalMarkSet myAccidentalMarkSet; + + bool isOrnamentsChoice(const char *const name) const; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp b/Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp index 811fd4fdf..1a73cdc8d 100644 --- a/Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp +++ b/Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp @@ -21,414 +21,359 @@ namespace mx { - namespace core +namespace core +{ +OrnamentsChoice::OrnamentsChoice() + : myChoice(Choice::trillMark), myTrillMark(makeTrillMark()), myTurn(makeTurn()), myDelayedTurn(makeDelayedTurn()), + myInvertedTurn(makeInvertedTurn()), myDelayedInvertedTurn(makeDelayedInvertedTurn()), + myVerticalTurn(makeVerticalTurn()), myShake(makeShake()), myWavyLine(makeWavyLine()), myMordent(makeMordent()), + myInvertedMordent(makeInvertedMordent()), mySchleifer(makeSchleifer()), myTremolo(makeTremolo()), + myOtherOrnament(makeOtherOrnament()) +{ +} + +bool OrnamentsChoice::hasAttributes() const +{ + return false; +} + +std::ostream &OrnamentsChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &OrnamentsChoice::streamName(std::ostream &os) const +{ + return os; +} + +bool OrnamentsChoice::hasContents() const +{ + return true; +} + +std::ostream &OrnamentsChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(isOneLineOnly); + + switch (myChoice) { - OrnamentsChoice::OrnamentsChoice() - :myChoice( Choice::trillMark ) - ,myTrillMark( makeTrillMark() ) - ,myTurn( makeTurn() ) - ,myDelayedTurn( makeDelayedTurn() ) - ,myInvertedTurn( makeInvertedTurn() ) - ,myDelayedInvertedTurn( makeDelayedInvertedTurn() ) - ,myVerticalTurn( makeVerticalTurn() ) - ,myShake( makeShake() ) - ,myWavyLine( makeWavyLine() ) - ,myMordent( makeMordent() ) - ,myInvertedMordent( makeInvertedMordent() ) - ,mySchleifer( makeSchleifer() ) - ,myTremolo( makeTremolo() ) - ,myOtherOrnament( makeOtherOrnament() ) - {} - - - bool OrnamentsChoice::hasAttributes() const - { - return false; - } - - - std::ostream& OrnamentsChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& OrnamentsChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool OrnamentsChoice::hasContents() const - { - return true; - } - - - std::ostream& OrnamentsChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - - switch ( myChoice ) - { - case Choice::trillMark: - { - myTrillMark->toStream( os, indentLevel ); - } - break; - case Choice::turn: - { - myTurn->toStream( os, indentLevel ); - } - break; - case Choice::delayedTurn: - { - myDelayedTurn->toStream( os, indentLevel ); - } - break; - case Choice::invertedTurn: - { - myInvertedTurn->toStream( os, indentLevel ); - } - break; - case Choice::delayedInvertedTurn: - { - myDelayedInvertedTurn->toStream( os, indentLevel ); - } - break; - case Choice::verticalTurn: - { - myVerticalTurn->toStream( os, indentLevel ); - } - break; - case Choice::shake: - { - myShake->toStream( os, indentLevel ); - } - break; - case Choice::wavyLine: - { - myWavyLine->toStream( os, indentLevel ); - } - break; - case Choice::mordent: - { - myMordent->toStream( os, indentLevel ); - } - break; - case Choice::invertedMordent: - { - myInvertedMordent->toStream( os, indentLevel ); - } - break; - case Choice::schleifer: - { - mySchleifer->toStream( os, indentLevel ); - } - break; - case Choice::tremolo: - { - myTremolo->toStream( os, indentLevel ); - } - break; - case Choice::otherOrnament: - { - myOtherOrnament->toStream( os, indentLevel ); - } - break; - default: - break; - } - return os; - } - - - OrnamentsChoice::Choice OrnamentsChoice::getChoice() const - { - return myChoice; - } - - - void OrnamentsChoice::setChoice( const OrnamentsChoice::Choice value ) - { - myChoice = value; - } - - - TrillMarkPtr OrnamentsChoice::getTrillMark() const - { - return myTrillMark; - } - - - void OrnamentsChoice::setTrillMark( const TrillMarkPtr& value ) - { - if( value ) - { - myTrillMark = value; - } - } - - - TurnPtr OrnamentsChoice::getTurn() const - { - return myTurn; - } - - - void OrnamentsChoice::setTurn( const TurnPtr& value ) - { - if( value ) - { - myTurn = value; - } - } - - - DelayedTurnPtr OrnamentsChoice::getDelayedTurn() const - { - return myDelayedTurn; - } - - - void OrnamentsChoice::setDelayedTurn( const DelayedTurnPtr& value ) - { - if( value ) - { - myDelayedTurn = value; - } - } - - - InvertedTurnPtr OrnamentsChoice::getInvertedTurn() const - { - return myInvertedTurn; - } - - - void OrnamentsChoice::setInvertedTurn( const InvertedTurnPtr& value ) - { - if( value ) - { - myInvertedTurn = value; - } - } - - - DelayedInvertedTurnPtr OrnamentsChoice::getDelayedInvertedTurn() const - { - return myDelayedInvertedTurn; - } + case Choice::trillMark: { + myTrillMark->toStream(os, indentLevel); + } + break; + case Choice::turn: { + myTurn->toStream(os, indentLevel); + } + break; + case Choice::delayedTurn: { + myDelayedTurn->toStream(os, indentLevel); + } + break; + case Choice::invertedTurn: { + myInvertedTurn->toStream(os, indentLevel); + } + break; + case Choice::delayedInvertedTurn: { + myDelayedInvertedTurn->toStream(os, indentLevel); + } + break; + case Choice::verticalTurn: { + myVerticalTurn->toStream(os, indentLevel); + } + break; + case Choice::shake: { + myShake->toStream(os, indentLevel); + } + break; + case Choice::wavyLine: { + myWavyLine->toStream(os, indentLevel); + } + break; + case Choice::mordent: { + myMordent->toStream(os, indentLevel); + } + break; + case Choice::invertedMordent: { + myInvertedMordent->toStream(os, indentLevel); + } + break; + case Choice::schleifer: { + mySchleifer->toStream(os, indentLevel); + } + break; + case Choice::tremolo: { + myTremolo->toStream(os, indentLevel); + } + break; + case Choice::otherOrnament: { + myOtherOrnament->toStream(os, indentLevel); + } + break; + default: + break; + } + return os; +} +OrnamentsChoice::Choice OrnamentsChoice::getChoice() const +{ + return myChoice; +} - void OrnamentsChoice::setDelayedInvertedTurn( const DelayedInvertedTurnPtr& value ) - { - if( value ) - { - myDelayedInvertedTurn = value; - } - } +void OrnamentsChoice::setChoice(const OrnamentsChoice::Choice value) +{ + myChoice = value; +} +TrillMarkPtr OrnamentsChoice::getTrillMark() const +{ + return myTrillMark; +} - VerticalTurnPtr OrnamentsChoice::getVerticalTurn() const - { - return myVerticalTurn; - } +void OrnamentsChoice::setTrillMark(const TrillMarkPtr &value) +{ + if (value) + { + myTrillMark = value; + } +} + +TurnPtr OrnamentsChoice::getTurn() const +{ + return myTurn; +} +void OrnamentsChoice::setTurn(const TurnPtr &value) +{ + if (value) + { + myTurn = value; + } +} - void OrnamentsChoice::setVerticalTurn( const VerticalTurnPtr& value ) - { - if( value ) - { - myVerticalTurn = value; - } - } +DelayedTurnPtr OrnamentsChoice::getDelayedTurn() const +{ + return myDelayedTurn; +} +void OrnamentsChoice::setDelayedTurn(const DelayedTurnPtr &value) +{ + if (value) + { + myDelayedTurn = value; + } +} - ShakePtr OrnamentsChoice::getShake() const - { - return myShake; - } +InvertedTurnPtr OrnamentsChoice::getInvertedTurn() const +{ + return myInvertedTurn; +} +void OrnamentsChoice::setInvertedTurn(const InvertedTurnPtr &value) +{ + if (value) + { + myInvertedTurn = value; + } +} - void OrnamentsChoice::setShake( const ShakePtr& value ) - { - if( value ) - { - myShake = value; - } - } +DelayedInvertedTurnPtr OrnamentsChoice::getDelayedInvertedTurn() const +{ + return myDelayedInvertedTurn; +} +void OrnamentsChoice::setDelayedInvertedTurn(const DelayedInvertedTurnPtr &value) +{ + if (value) + { + myDelayedInvertedTurn = value; + } +} - WavyLinePtr OrnamentsChoice::getWavyLine() const - { - return myWavyLine; - } +VerticalTurnPtr OrnamentsChoice::getVerticalTurn() const +{ + return myVerticalTurn; +} +void OrnamentsChoice::setVerticalTurn(const VerticalTurnPtr &value) +{ + if (value) + { + myVerticalTurn = value; + } +} - void OrnamentsChoice::setWavyLine( const WavyLinePtr& value ) - { - if( value ) - { - myWavyLine = value; - } - } - - - MordentPtr OrnamentsChoice::getMordent() const - { - return myMordent; - } - - - void OrnamentsChoice::setMordent( const MordentPtr& value ) - { - if( value ) - { - myMordent = value; - } - } - - - InvertedMordentPtr OrnamentsChoice::getInvertedMordent() const - { - return myInvertedMordent; - } - - - void OrnamentsChoice::setInvertedMordent( const InvertedMordentPtr& value ) - { - if( value ) - { - myInvertedMordent = value; - } - } - - - SchleiferPtr OrnamentsChoice::getSchleifer() const - { - return mySchleifer; - } - - - void OrnamentsChoice::setSchleifer( const SchleiferPtr& value ) - { - if( value ) - { - mySchleifer = value; - } - } - - - TremoloPtr OrnamentsChoice::getTremolo() const - { - return myTremolo; - } - - - void OrnamentsChoice::setTremolo( const TremoloPtr& value ) - { - if( value ) - { - myTremolo = value; - } - } - - - OtherOrnamentPtr OrnamentsChoice::getOtherOrnament() const - { - return myOtherOrnament; - } - - - void OrnamentsChoice::setOtherOrnament( const OtherOrnamentPtr& value ) - { - if( value ) - { - myOtherOrnament = value; - } - } - - - bool OrnamentsChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - const std::string elementName = xelement.getName(); - - if( elementName == "trill-mark" ) - { - myChoice = Choice::trillMark; - isSuccess &= getTrillMark()->fromXElement( message, xelement ); - } - else if ( elementName == "turn" ) - { - myChoice = Choice::turn; - isSuccess &= getTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "delayed-turn" ) - { - myChoice = Choice::delayedTurn; - isSuccess &= getDelayedTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "inverted-turn" ) - { - myChoice = Choice::invertedTurn; - isSuccess &= getInvertedTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "delayed-inverted-turn" ) - { - myChoice = Choice::delayedInvertedTurn; - isSuccess &= getDelayedInvertedTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "vertical-turn" ) - { - myChoice = Choice::verticalTurn; - isSuccess &= getVerticalTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "shake" ) - { - myChoice = Choice::shake; - isSuccess &= getShake()->fromXElement( message, xelement ); - } - else if ( elementName == "wavy-line" ) - { - myChoice = Choice::wavyLine; - isSuccess &= getWavyLine()->fromXElement( message, xelement ); - } - else if ( elementName == "mordent" ) - { - myChoice = Choice::mordent; - isSuccess &= getMordent()->fromXElement( message, xelement ); - } - else if ( elementName == "inverted-mordent" ) - { - myChoice = Choice::invertedMordent; - isSuccess &= getInvertedMordent()->fromXElement( message, xelement ); - } - else if ( elementName == "schleifer" ) - { - myChoice = Choice::schleifer; - isSuccess &= getSchleifer()->fromXElement( message, xelement ); - } - else if ( elementName == "tremolo" ) - { - myChoice = Choice::tremolo; - isSuccess &= getTremolo()->fromXElement( message, xelement ); - } - else if ( elementName == "other-ornament" ) - { - myChoice = Choice::otherOrnament; - isSuccess &= getOtherOrnament()->fromXElement( message, xelement ); - } - else - { - message << "OrnamentsChoice::fromXElement unrecognized element '" << elementName << "'" << std::endl; - isSuccess = false; - } - - MX_RETURN_IS_SUCCESS; - } +ShakePtr OrnamentsChoice::getShake() const +{ + return myShake; +} +void OrnamentsChoice::setShake(const ShakePtr &value) +{ + if (value) + { + myShake = value; } } + +WavyLinePtr OrnamentsChoice::getWavyLine() const +{ + return myWavyLine; +} + +void OrnamentsChoice::setWavyLine(const WavyLinePtr &value) +{ + if (value) + { + myWavyLine = value; + } +} + +MordentPtr OrnamentsChoice::getMordent() const +{ + return myMordent; +} + +void OrnamentsChoice::setMordent(const MordentPtr &value) +{ + if (value) + { + myMordent = value; + } +} + +InvertedMordentPtr OrnamentsChoice::getInvertedMordent() const +{ + return myInvertedMordent; +} + +void OrnamentsChoice::setInvertedMordent(const InvertedMordentPtr &value) +{ + if (value) + { + myInvertedMordent = value; + } +} + +SchleiferPtr OrnamentsChoice::getSchleifer() const +{ + return mySchleifer; +} + +void OrnamentsChoice::setSchleifer(const SchleiferPtr &value) +{ + if (value) + { + mySchleifer = value; + } +} + +TremoloPtr OrnamentsChoice::getTremolo() const +{ + return myTremolo; +} + +void OrnamentsChoice::setTremolo(const TremoloPtr &value) +{ + if (value) + { + myTremolo = value; + } +} + +OtherOrnamentPtr OrnamentsChoice::getOtherOrnament() const +{ + return myOtherOrnament; +} + +void OrnamentsChoice::setOtherOrnament(const OtherOrnamentPtr &value) +{ + if (value) + { + myOtherOrnament = value; + } +} + +bool OrnamentsChoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + + const std::string elementName = xelement.getName(); + + if (elementName == "trill-mark") + { + myChoice = Choice::trillMark; + isSuccess &= getTrillMark()->fromXElement(message, xelement); + } + else if (elementName == "turn") + { + myChoice = Choice::turn; + isSuccess &= getTurn()->fromXElement(message, xelement); + } + else if (elementName == "delayed-turn") + { + myChoice = Choice::delayedTurn; + isSuccess &= getDelayedTurn()->fromXElement(message, xelement); + } + else if (elementName == "inverted-turn") + { + myChoice = Choice::invertedTurn; + isSuccess &= getInvertedTurn()->fromXElement(message, xelement); + } + else if (elementName == "delayed-inverted-turn") + { + myChoice = Choice::delayedInvertedTurn; + isSuccess &= getDelayedInvertedTurn()->fromXElement(message, xelement); + } + else if (elementName == "vertical-turn") + { + myChoice = Choice::verticalTurn; + isSuccess &= getVerticalTurn()->fromXElement(message, xelement); + } + else if (elementName == "shake") + { + myChoice = Choice::shake; + isSuccess &= getShake()->fromXElement(message, xelement); + } + else if (elementName == "wavy-line") + { + myChoice = Choice::wavyLine; + isSuccess &= getWavyLine()->fromXElement(message, xelement); + } + else if (elementName == "mordent") + { + myChoice = Choice::mordent; + isSuccess &= getMordent()->fromXElement(message, xelement); + } + else if (elementName == "inverted-mordent") + { + myChoice = Choice::invertedMordent; + isSuccess &= getInvertedMordent()->fromXElement(message, xelement); + } + else if (elementName == "schleifer") + { + myChoice = Choice::schleifer; + isSuccess &= getSchleifer()->fromXElement(message, xelement); + } + else if (elementName == "tremolo") + { + myChoice = Choice::tremolo; + isSuccess &= getTremolo()->fromXElement(message, xelement); + } + else if (elementName == "other-ornament") + { + myChoice = Choice::otherOrnament; + isSuccess &= getOtherOrnament()->fromXElement(message, xelement); + } + else + { + message << "OrnamentsChoice::fromXElement unrecognized element '" << elementName << "'" << std::endl; + isSuccess = false; + } + + MX_RETURN_IS_SUCCESS; +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OrnamentsChoice.h b/Sourcecode/private/mx/core/elements/OrnamentsChoice.h index 5596c9947..a478d0f97 100644 --- a/Sourcecode/private/mx/core/elements/OrnamentsChoice.h +++ b/Sourcecode/private/mx/core/elements/OrnamentsChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,127 +13,130 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( DelayedInvertedTurn ) - MX_FORWARD_DECLARE_ELEMENT( DelayedTurn ) - MX_FORWARD_DECLARE_ELEMENT( InvertedMordent ) - MX_FORWARD_DECLARE_ELEMENT( InvertedTurn ) - MX_FORWARD_DECLARE_ELEMENT( Mordent ) - MX_FORWARD_DECLARE_ELEMENT( OtherOrnament ) - MX_FORWARD_DECLARE_ELEMENT( Schleifer ) - MX_FORWARD_DECLARE_ELEMENT( Shake ) - MX_FORWARD_DECLARE_ELEMENT( Tremolo ) - MX_FORWARD_DECLARE_ELEMENT( TrillMark ) - MX_FORWARD_DECLARE_ELEMENT( Turn ) - MX_FORWARD_DECLARE_ELEMENT( VerticalTurn ) - MX_FORWARD_DECLARE_ELEMENT( WavyLine ) - MX_FORWARD_DECLARE_ELEMENT( OrnamentsChoice ) - - inline OrnamentsChoicePtr makeOrnamentsChoice() { return std::make_shared(); } - - class OrnamentsChoice : public ElementInterface - { - public: - enum class Choice - { - trillMark = 1, - turn = 2, - delayedTurn = 3, - invertedTurn = 4, - delayedInvertedTurn = 5, - verticalTurn = 6, - shake = 7, - wavyLine = 8, - mordent = 9, - invertedMordent = 10, - schleifer = 11, - tremolo = 12, - otherOrnament = 13 - }; - OrnamentsChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice enum _________ */ - OrnamentsChoice::Choice getChoice() const; - void setChoice( const OrnamentsChoice::Choice value ); - - /* _________ TrillMark minOccurs = 1, maxOccurs = 1 _________ */ - TrillMarkPtr getTrillMark() const; - void setTrillMark( const TrillMarkPtr& value ); - - /* _________ Turn minOccurs = 1, maxOccurs = 1 _________ */ - TurnPtr getTurn() const; - void setTurn( const TurnPtr& value ); - - /* _________ DelayedTurn minOccurs = 1, maxOccurs = 1 _________ */ - DelayedTurnPtr getDelayedTurn() const; - void setDelayedTurn( const DelayedTurnPtr& value ); - - /* _________ InvertedTurn minOccurs = 1, maxOccurs = 1 _________ */ - InvertedTurnPtr getInvertedTurn() const; - void setInvertedTurn( const InvertedTurnPtr& value ); - - /* _________ DelayedInvertedTurn minOccurs = 1, maxOccurs = 1 _________ */ - DelayedInvertedTurnPtr getDelayedInvertedTurn() const; - void setDelayedInvertedTurn( const DelayedInvertedTurnPtr& value ); - - /* _________ VerticalTurn minOccurs = 1, maxOccurs = 1 _________ */ - VerticalTurnPtr getVerticalTurn() const; - void setVerticalTurn( const VerticalTurnPtr& value ); - - /* _________ Shake minOccurs = 1, maxOccurs = 1 _________ */ - ShakePtr getShake() const; - void setShake( const ShakePtr& value ); - - /* _________ WavyLine minOccurs = 1, maxOccurs = 1 _________ */ - WavyLinePtr getWavyLine() const; - void setWavyLine( const WavyLinePtr& value ); - - /* _________ Mordent minOccurs = 1, maxOccurs = 1 _________ */ - MordentPtr getMordent() const; - void setMordent( const MordentPtr& value ); - - /* _________ InvertedMordent minOccurs = 1, maxOccurs = 1 _________ */ - InvertedMordentPtr getInvertedMordent() const; - void setInvertedMordent( const InvertedMordentPtr& value ); - - /* _________ Schleifer minOccurs = 1, maxOccurs = 1 _________ */ - SchleiferPtr getSchleifer() const; - void setSchleifer( const SchleiferPtr& value ); - - /* _________ Tremolo minOccurs = 1, maxOccurs = 1 _________ */ - TremoloPtr getTremolo() const; - void setTremolo( const TremoloPtr& value ); - - /* _________ OtherOrnament minOccurs = 1, maxOccurs = 1 _________ */ - OtherOrnamentPtr getOtherOrnament() const; - void setOtherOrnament( const OtherOrnamentPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - TrillMarkPtr myTrillMark; - TurnPtr myTurn; - DelayedTurnPtr myDelayedTurn; - InvertedTurnPtr myInvertedTurn; - DelayedInvertedTurnPtr myDelayedInvertedTurn; - VerticalTurnPtr myVerticalTurn; - ShakePtr myShake; - WavyLinePtr myWavyLine; - MordentPtr myMordent; - InvertedMordentPtr myInvertedMordent; - SchleiferPtr mySchleifer; - TremoloPtr myTremolo; - OtherOrnamentPtr myOtherOrnament; - }; - } +MX_FORWARD_DECLARE_ELEMENT(DelayedInvertedTurn) +MX_FORWARD_DECLARE_ELEMENT(DelayedTurn) +MX_FORWARD_DECLARE_ELEMENT(InvertedMordent) +MX_FORWARD_DECLARE_ELEMENT(InvertedTurn) +MX_FORWARD_DECLARE_ELEMENT(Mordent) +MX_FORWARD_DECLARE_ELEMENT(OtherOrnament) +MX_FORWARD_DECLARE_ELEMENT(Schleifer) +MX_FORWARD_DECLARE_ELEMENT(Shake) +MX_FORWARD_DECLARE_ELEMENT(Tremolo) +MX_FORWARD_DECLARE_ELEMENT(TrillMark) +MX_FORWARD_DECLARE_ELEMENT(Turn) +MX_FORWARD_DECLARE_ELEMENT(VerticalTurn) +MX_FORWARD_DECLARE_ELEMENT(WavyLine) +MX_FORWARD_DECLARE_ELEMENT(OrnamentsChoice) + +inline OrnamentsChoicePtr makeOrnamentsChoice() +{ + return std::make_shared(); } + +class OrnamentsChoice : public ElementInterface +{ + public: + enum class Choice + { + trillMark = 1, + turn = 2, + delayedTurn = 3, + invertedTurn = 4, + delayedInvertedTurn = 5, + verticalTurn = 6, + shake = 7, + wavyLine = 8, + mordent = 9, + invertedMordent = 10, + schleifer = 11, + tremolo = 12, + otherOrnament = 13 + }; + OrnamentsChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice enum _________ */ + OrnamentsChoice::Choice getChoice() const; + void setChoice(const OrnamentsChoice::Choice value); + + /* _________ TrillMark minOccurs = 1, maxOccurs = 1 _________ */ + TrillMarkPtr getTrillMark() const; + void setTrillMark(const TrillMarkPtr &value); + + /* _________ Turn minOccurs = 1, maxOccurs = 1 _________ */ + TurnPtr getTurn() const; + void setTurn(const TurnPtr &value); + + /* _________ DelayedTurn minOccurs = 1, maxOccurs = 1 _________ */ + DelayedTurnPtr getDelayedTurn() const; + void setDelayedTurn(const DelayedTurnPtr &value); + + /* _________ InvertedTurn minOccurs = 1, maxOccurs = 1 _________ */ + InvertedTurnPtr getInvertedTurn() const; + void setInvertedTurn(const InvertedTurnPtr &value); + + /* _________ DelayedInvertedTurn minOccurs = 1, maxOccurs = 1 _________ */ + DelayedInvertedTurnPtr getDelayedInvertedTurn() const; + void setDelayedInvertedTurn(const DelayedInvertedTurnPtr &value); + + /* _________ VerticalTurn minOccurs = 1, maxOccurs = 1 _________ */ + VerticalTurnPtr getVerticalTurn() const; + void setVerticalTurn(const VerticalTurnPtr &value); + + /* _________ Shake minOccurs = 1, maxOccurs = 1 _________ */ + ShakePtr getShake() const; + void setShake(const ShakePtr &value); + + /* _________ WavyLine minOccurs = 1, maxOccurs = 1 _________ */ + WavyLinePtr getWavyLine() const; + void setWavyLine(const WavyLinePtr &value); + + /* _________ Mordent minOccurs = 1, maxOccurs = 1 _________ */ + MordentPtr getMordent() const; + void setMordent(const MordentPtr &value); + + /* _________ InvertedMordent minOccurs = 1, maxOccurs = 1 _________ */ + InvertedMordentPtr getInvertedMordent() const; + void setInvertedMordent(const InvertedMordentPtr &value); + + /* _________ Schleifer minOccurs = 1, maxOccurs = 1 _________ */ + SchleiferPtr getSchleifer() const; + void setSchleifer(const SchleiferPtr &value); + + /* _________ Tremolo minOccurs = 1, maxOccurs = 1 _________ */ + TremoloPtr getTremolo() const; + void setTremolo(const TremoloPtr &value); + + /* _________ OtherOrnament minOccurs = 1, maxOccurs = 1 _________ */ + OtherOrnamentPtr getOtherOrnament() const; + void setOtherOrnament(const OtherOrnamentPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + TrillMarkPtr myTrillMark; + TurnPtr myTurn; + DelayedTurnPtr myDelayedTurn; + InvertedTurnPtr myInvertedTurn; + DelayedInvertedTurnPtr myDelayedInvertedTurn; + VerticalTurnPtr myVerticalTurn; + ShakePtr myShake; + WavyLinePtr myWavyLine; + MordentPtr myMordent; + InvertedMordentPtr myInvertedMordent; + SchleiferPtr mySchleifer; + TremoloPtr myTremolo; + OtherOrnamentPtr myOtherOrnament; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherAppearance.cpp b/Sourcecode/private/mx/core/elements/OtherAppearance.cpp index 08c9f06d4..e20e9e435 100644 --- a/Sourcecode/private/mx/core/elements/OtherAppearance.cpp +++ b/Sourcecode/private/mx/core/elements/OtherAppearance.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - OtherAppearance::OtherAppearance() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherAppearance::OtherAppearance( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherAppearance::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherAppearance::hasContents() const - { - return true; - } - - - std::ostream& OtherAppearance::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherAppearance::streamName( std::ostream& os ) const - { - os << "other-appearance"; - return os; - } - - - std::ostream& OtherAppearance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +OtherAppearance::OtherAppearance() : myValue(), myAttributes(std::make_shared()) +{ +} +OtherAppearance::OtherAppearance(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - OtherAppearanceAttributesPtr OtherAppearance::getAttributes() const - { - return myAttributes; - } +bool OtherAppearance::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool OtherAppearance::hasContents() const +{ + return true; +} - void OtherAppearance::setAttributes( const OtherAppearanceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OtherAppearance::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &OtherAppearance::streamName(std::ostream &os) const +{ + os << "other-appearance"; + return os; +} - XsString OtherAppearance::getValue() const - { - return myValue; - } +std::ostream &OtherAppearance::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OtherAppearanceAttributesPtr OtherAppearance::getAttributes() const +{ + return myAttributes; +} - void OtherAppearance::setValue( const XsString& value ) - { - myValue = value; - } +void OtherAppearance::setAttributes(const OtherAppearanceAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString OtherAppearance::getValue() const +{ + return myValue; +} - bool OtherAppearance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void OtherAppearance::setValue(const XsString &value) +{ + myValue = value; +} - } +bool OtherAppearance::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherAppearance.h b/Sourcecode/private/mx/core/elements/OtherAppearance.h index 909e8eec7..b6ece0ae9 100644 --- a/Sourcecode/private/mx/core/elements/OtherAppearance.h +++ b/Sourcecode/private/mx/core/elements/OtherAppearance.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/OtherAppearanceAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherAppearanceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherAppearance ) - - inline OtherAppearancePtr makeOtherAppearance() { return std::make_shared(); } - inline OtherAppearancePtr makeOtherAppearance( const XsString& value ) { return std::make_shared( value ); } - inline OtherAppearancePtr makeOtherAppearance( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherAppearance : public ElementInterface - { - public: - OtherAppearance(); - OtherAppearance( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherAppearanceAttributesPtr getAttributes() const; - void setAttributes( const OtherAppearanceAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherAppearanceAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OtherAppearanceAttributes) +MX_FORWARD_DECLARE_ELEMENT(OtherAppearance) + +inline OtherAppearancePtr makeOtherAppearance() +{ + return std::make_shared(); +} + +inline OtherAppearancePtr makeOtherAppearance(const XsString &value) +{ + return std::make_shared(value); } + +inline OtherAppearancePtr makeOtherAppearance(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class OtherAppearance : public ElementInterface +{ + public: + OtherAppearance(); + OtherAppearance(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OtherAppearanceAttributesPtr getAttributes() const; + void setAttributes(const OtherAppearanceAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + OtherAppearanceAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp index a6460dc9b..8d61f080e 100644 --- a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - OtherAppearanceAttributes::OtherAppearanceAttributes() - :type( "undefined" ) - ,hasType( true ) - {} - +namespace core +{ +OtherAppearanceAttributes::OtherAppearanceAttributes() : type("undefined"), hasType(true) +{ +} - bool OtherAppearanceAttributes::hasValues() const - { - return hasType; - } +bool OtherAppearanceAttributes::hasValues() const +{ + return hasType; +} +std::ostream &OtherAppearanceAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& OtherAppearanceAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool OtherAppearanceAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OtherAppearanceAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OtherAppearanceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type")) { - const char* const className = "OtherAppearanceAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h b/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h index e5d566059..ffe165a45 100644 --- a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h +++ b/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OtherAppearanceAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OtherAppearanceAttributes) - struct OtherAppearanceAttributes : public AttributesInterface - { - public: - OtherAppearanceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - const bool hasType; +struct OtherAppearanceAttributes : public AttributesInterface +{ + public: + OtherAppearanceAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken type; + const bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherArticulation.cpp b/Sourcecode/private/mx/core/elements/OtherArticulation.cpp index b8bca2397..393110401 100644 --- a/Sourcecode/private/mx/core/elements/OtherArticulation.cpp +++ b/Sourcecode/private/mx/core/elements/OtherArticulation.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - OtherArticulation::OtherArticulation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherArticulation::OtherArticulation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherArticulation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherArticulation::hasContents() const - { - return true; - } - - - std::ostream& OtherArticulation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherArticulation::streamName( std::ostream& os ) const - { - os << "other-articulation"; - return os; - } - - - std::ostream& OtherArticulation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +OtherArticulation::OtherArticulation() : myValue(), myAttributes(std::make_shared()) +{ +} +OtherArticulation::OtherArticulation(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - OtherArticulationAttributesPtr OtherArticulation::getAttributes() const - { - return myAttributes; - } +bool OtherArticulation::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool OtherArticulation::hasContents() const +{ + return true; +} - void OtherArticulation::setAttributes( const OtherArticulationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OtherArticulation::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &OtherArticulation::streamName(std::ostream &os) const +{ + os << "other-articulation"; + return os; +} - XsString OtherArticulation::getValue() const - { - return myValue; - } +std::ostream &OtherArticulation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OtherArticulationAttributesPtr OtherArticulation::getAttributes() const +{ + return myAttributes; +} - void OtherArticulation::setValue( const XsString& value ) - { - myValue = value; - } +void OtherArticulation::setAttributes(const OtherArticulationAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString OtherArticulation::getValue() const +{ + return myValue; +} - bool OtherArticulation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void OtherArticulation::setValue(const XsString &value) +{ + myValue = value; +} - } +bool OtherArticulation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherArticulation.h b/Sourcecode/private/mx/core/elements/OtherArticulation.h index 67c9c6ef4..77060380e 100644 --- a/Sourcecode/private/mx/core/elements/OtherArticulation.h +++ b/Sourcecode/private/mx/core/elements/OtherArticulation.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/OtherArticulationAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherArticulationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherArticulation ) - - inline OtherArticulationPtr makeOtherArticulation() { return std::make_shared(); } - inline OtherArticulationPtr makeOtherArticulation( const XsString& value ) { return std::make_shared( value ); } - inline OtherArticulationPtr makeOtherArticulation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherArticulation : public ElementInterface - { - public: - OtherArticulation(); - OtherArticulation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherArticulationAttributesPtr getAttributes() const; - void setAttributes( const OtherArticulationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherArticulationAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OtherArticulationAttributes) +MX_FORWARD_DECLARE_ELEMENT(OtherArticulation) + +inline OtherArticulationPtr makeOtherArticulation() +{ + return std::make_shared(); +} + +inline OtherArticulationPtr makeOtherArticulation(const XsString &value) +{ + return std::make_shared(value); } + +inline OtherArticulationPtr makeOtherArticulation(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class OtherArticulation : public ElementInterface +{ + public: + OtherArticulation(); + OtherArticulation(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OtherArticulationAttributesPtr getAttributes() const; + void setAttributes(const OtherArticulationAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + OtherArticulationAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp index d54dd9e6a..567c87de9 100644 --- a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +OtherArticulationAttributes::OtherArticulationAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), placement(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool OtherArticulationAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &OtherArticulationAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - OtherArticulationAttributes::OtherArticulationAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool OtherArticulationAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OtherArticulationAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OtherArticulationAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& OtherArticulationAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool OtherArticulationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "OtherArticulationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h b/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h index 548ca2444..8bc98c16b 100644 --- a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h +++ b/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OtherArticulationAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OtherArticulationAttributes) - struct OtherArticulationAttributes : public AttributesInterface - { - public: - OtherArticulationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct OtherArticulationAttributes : public AttributesInterface +{ + public: + OtherArticulationAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherDirection.cpp b/Sourcecode/private/mx/core/elements/OtherDirection.cpp index 4441d294d..29990afac 100644 --- a/Sourcecode/private/mx/core/elements/OtherDirection.cpp +++ b/Sourcecode/private/mx/core/elements/OtherDirection.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - OtherDirection::OtherDirection() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherDirection::OtherDirection( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherDirection::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherDirection::hasContents() const - { - return true; - } - - - std::ostream& OtherDirection::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherDirection::streamName( std::ostream& os ) const - { - os << "other-direction"; - return os; - } - - - std::ostream& OtherDirection::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +OtherDirection::OtherDirection() : myValue(), myAttributes(std::make_shared()) +{ +} +OtherDirection::OtherDirection(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - OtherDirectionAttributesPtr OtherDirection::getAttributes() const - { - return myAttributes; - } +bool OtherDirection::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool OtherDirection::hasContents() const +{ + return true; +} - void OtherDirection::setAttributes( const OtherDirectionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OtherDirection::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &OtherDirection::streamName(std::ostream &os) const +{ + os << "other-direction"; + return os; +} - XsString OtherDirection::getValue() const - { - return myValue; - } +std::ostream &OtherDirection::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OtherDirectionAttributesPtr OtherDirection::getAttributes() const +{ + return myAttributes; +} - void OtherDirection::setValue( const XsString& value ) - { - myValue = value; - } +void OtherDirection::setAttributes(const OtherDirectionAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString OtherDirection::getValue() const +{ + return myValue; +} - bool OtherDirection::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void OtherDirection::setValue(const XsString &value) +{ + myValue = value; +} - } +bool OtherDirection::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherDirection.h b/Sourcecode/private/mx/core/elements/OtherDirection.h index fa243fe35..07951ff9d 100644 --- a/Sourcecode/private/mx/core/elements/OtherDirection.h +++ b/Sourcecode/private/mx/core/elements/OtherDirection.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/OtherDirectionAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherDirectionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherDirection ) - - inline OtherDirectionPtr makeOtherDirection() { return std::make_shared(); } - inline OtherDirectionPtr makeOtherDirection( const XsString& value ) { return std::make_shared( value ); } - inline OtherDirectionPtr makeOtherDirection( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherDirection : public ElementInterface - { - public: - OtherDirection(); - OtherDirection( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherDirectionAttributesPtr getAttributes() const; - void setAttributes( const OtherDirectionAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherDirectionAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OtherDirectionAttributes) +MX_FORWARD_DECLARE_ELEMENT(OtherDirection) + +inline OtherDirectionPtr makeOtherDirection() +{ + return std::make_shared(); +} + +inline OtherDirectionPtr makeOtherDirection(const XsString &value) +{ + return std::make_shared(value); } + +inline OtherDirectionPtr makeOtherDirection(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class OtherDirection : public ElementInterface +{ + public: + OtherDirection(); + OtherDirection(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OtherDirectionAttributesPtr getAttributes() const; + void setAttributes(const OtherDirectionAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + OtherDirectionAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp index dc7abc07f..0fc415488 100644 --- a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp @@ -8,91 +8,95 @@ namespace mx { - namespace core +namespace core +{ +OtherDirectionAttributes::OtherDirectionAttributes() + : printObject(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), halign(), hasPrintObject(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasHalign(false) +{ +} + +bool OtherDirectionAttributes::hasValues() const +{ + return hasPrintObject || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight || hasHalign; +} + +std::ostream &OtherDirectionAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - OtherDirectionAttributes::OtherDirectionAttributes() - :printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + } + return os; +} + +bool OtherDirectionAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OtherDirectionAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OtherDirectionAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - return hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; + continue; } - - - std::ostream& OtherDirectionAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; + continue; } - - - bool OtherDirectionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "OtherDirectionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h b/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h index 99e43c70e..51a85e935 100644 --- a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h +++ b/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,40 +17,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OtherDirectionAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OtherDirectionAttributes) - struct OtherDirectionAttributes : public AttributesInterface - { - public: - OtherDirectionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; +struct OtherDirectionAttributes : public AttributesInterface +{ + public: + OtherDirectionAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + bool hasPrintObject; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherNotation.cpp b/Sourcecode/private/mx/core/elements/OtherNotation.cpp index 1b169ca65..15f275e98 100644 --- a/Sourcecode/private/mx/core/elements/OtherNotation.cpp +++ b/Sourcecode/private/mx/core/elements/OtherNotation.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - OtherNotation::OtherNotation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherNotation::OtherNotation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherNotation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherNotation::hasContents() const - { - return true; - } - - - std::ostream& OtherNotation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherNotation::streamName( std::ostream& os ) const - { - os << "other-notation"; - return os; - } - - - std::ostream& OtherNotation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +OtherNotation::OtherNotation() : myValue(), myAttributes(std::make_shared()) +{ +} +OtherNotation::OtherNotation(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - OtherNotationAttributesPtr OtherNotation::getAttributes() const - { - return myAttributes; - } +bool OtherNotation::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool OtherNotation::hasContents() const +{ + return true; +} - void OtherNotation::setAttributes( const OtherNotationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OtherNotation::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &OtherNotation::streamName(std::ostream &os) const +{ + os << "other-notation"; + return os; +} - XsString OtherNotation::getValue() const - { - return myValue; - } +std::ostream &OtherNotation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OtherNotationAttributesPtr OtherNotation::getAttributes() const +{ + return myAttributes; +} - void OtherNotation::setValue( const XsString& value ) - { - myValue = value; - } +void OtherNotation::setAttributes(const OtherNotationAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString OtherNotation::getValue() const +{ + return myValue; +} - bool OtherNotation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void OtherNotation::setValue(const XsString &value) +{ + myValue = value; +} - } +bool OtherNotation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherNotation.h b/Sourcecode/private/mx/core/elements/OtherNotation.h index 887d0fc4d..605ce5b62 100644 --- a/Sourcecode/private/mx/core/elements/OtherNotation.h +++ b/Sourcecode/private/mx/core/elements/OtherNotation.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/OtherNotationAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherNotationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherNotation ) - - inline OtherNotationPtr makeOtherNotation() { return std::make_shared(); } - inline OtherNotationPtr makeOtherNotation( const XsString& value ) { return std::make_shared( value ); } - inline OtherNotationPtr makeOtherNotation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherNotation : public ElementInterface - { - public: - OtherNotation(); - OtherNotation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherNotationAttributesPtr getAttributes() const; - void setAttributes( const OtherNotationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherNotationAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OtherNotationAttributes) +MX_FORWARD_DECLARE_ELEMENT(OtherNotation) + +inline OtherNotationPtr makeOtherNotation() +{ + return std::make_shared(); +} + +inline OtherNotationPtr makeOtherNotation(const XsString &value) +{ + return std::make_shared(value); } + +inline OtherNotationPtr makeOtherNotation(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class OtherNotation : public ElementInterface +{ + public: + OtherNotation(); + OtherNotation(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OtherNotationAttributesPtr getAttributes() const; + void setAttributes(const OtherNotationAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + OtherNotationAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp index 77c37bf99..1d8adf424 100644 --- a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp @@ -8,107 +8,113 @@ namespace mx { - namespace core +namespace core +{ +OtherNotationAttributes::OtherNotationAttributes() + : type(StartStopSingle::start), number(1), printObject(), defaultX(), defaultY(), relativeX(), relativeY(), + fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), placement(), hasType(true), hasNumber(false), hasPrintObject(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool OtherNotationAttributes::hasValues() const +{ + return hasType || hasNumber || hasPrintObject || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || + hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasPlacement; +} + +std::ostream &OtherNotationAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - OtherNotationAttributes::OtherNotationAttributes() - :type( StartStopSingle::start ) - ,number( 1 ) - ,printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasType( true ) - ,hasNumber( false ) - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} +bool OtherNotationAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OtherNotationAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OtherNotationAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopSingle)) { - return hasType || - hasNumber || - hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& OtherNotationAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool OtherNotationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - const char* const className = "OtherNotationAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopSingle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.h b/Sourcecode/private/mx/core/elements/OtherNotationAttributes.h index 1e3ad6740..8c4051bba 100644 --- a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.h +++ b/Sourcecode/private/mx/core/elements/OtherNotationAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -18,44 +18,44 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OtherNotationAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OtherNotationAttributes) - struct OtherNotationAttributes : public AttributesInterface - { - public: - OtherNotationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopSingle type; - NumberLevel number; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - const bool hasType; - bool hasNumber; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct OtherNotationAttributes : public AttributesInterface +{ + public: + OtherNotationAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStopSingle type; + NumberLevel number; + YesNo printObject; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + const bool hasType; + bool hasNumber; + bool hasPrintObject; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherOrnament.cpp b/Sourcecode/private/mx/core/elements/OtherOrnament.cpp index 081ba8272..9d58ea3fa 100644 --- a/Sourcecode/private/mx/core/elements/OtherOrnament.cpp +++ b/Sourcecode/private/mx/core/elements/OtherOrnament.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - OtherOrnament::OtherOrnament() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherOrnament::OtherOrnament( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherOrnament::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherOrnament::hasContents() const - { - return true; - } - - - std::ostream& OtherOrnament::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherOrnament::streamName( std::ostream& os ) const - { - os << "other-ornament"; - return os; - } - - - std::ostream& OtherOrnament::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +OtherOrnament::OtherOrnament() : myValue(), myAttributes(std::make_shared()) +{ +} +OtherOrnament::OtherOrnament(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - OtherOrnamentAttributesPtr OtherOrnament::getAttributes() const - { - return myAttributes; - } +bool OtherOrnament::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool OtherOrnament::hasContents() const +{ + return true; +} - void OtherOrnament::setAttributes( const OtherOrnamentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OtherOrnament::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &OtherOrnament::streamName(std::ostream &os) const +{ + os << "other-ornament"; + return os; +} - XsString OtherOrnament::getValue() const - { - return myValue; - } +std::ostream &OtherOrnament::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OtherOrnamentAttributesPtr OtherOrnament::getAttributes() const +{ + return myAttributes; +} - void OtherOrnament::setValue( const XsString& value ) - { - myValue = value; - } +void OtherOrnament::setAttributes(const OtherOrnamentAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString OtherOrnament::getValue() const +{ + return myValue; +} - bool OtherOrnament::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void OtherOrnament::setValue(const XsString &value) +{ + myValue = value; +} - } +bool OtherOrnament::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherOrnament.h b/Sourcecode/private/mx/core/elements/OtherOrnament.h index 928fc5988..61ae67060 100644 --- a/Sourcecode/private/mx/core/elements/OtherOrnament.h +++ b/Sourcecode/private/mx/core/elements/OtherOrnament.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/OtherOrnamentAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherOrnamentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherOrnament ) - - inline OtherOrnamentPtr makeOtherOrnament() { return std::make_shared(); } - inline OtherOrnamentPtr makeOtherOrnament( const XsString& value ) { return std::make_shared( value ); } - inline OtherOrnamentPtr makeOtherOrnament( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherOrnament : public ElementInterface - { - public: - OtherOrnament(); - OtherOrnament( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherOrnamentAttributesPtr getAttributes() const; - void setAttributes( const OtherOrnamentAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherOrnamentAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OtherOrnamentAttributes) +MX_FORWARD_DECLARE_ELEMENT(OtherOrnament) + +inline OtherOrnamentPtr makeOtherOrnament() +{ + return std::make_shared(); +} + +inline OtherOrnamentPtr makeOtherOrnament(const XsString &value) +{ + return std::make_shared(value); } + +inline OtherOrnamentPtr makeOtherOrnament(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class OtherOrnament : public ElementInterface +{ + public: + OtherOrnament(); + OtherOrnament(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OtherOrnamentAttributesPtr getAttributes() const; + void setAttributes(const OtherOrnamentAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + OtherOrnamentAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp index d91428035..c3057a3bf 100644 --- a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +OtherOrnamentAttributes::OtherOrnamentAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), placement(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool OtherOrnamentAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &OtherOrnamentAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - OtherOrnamentAttributes::OtherOrnamentAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool OtherOrnamentAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OtherOrnamentAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OtherOrnamentAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& OtherOrnamentAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool OtherOrnamentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "OtherOrnamentAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h b/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h index 27dab6e84..025a41761 100644 --- a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h +++ b/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OtherOrnamentAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OtherOrnamentAttributes) - struct OtherOrnamentAttributes : public AttributesInterface - { - public: - OtherOrnamentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct OtherOrnamentAttributes : public AttributesInterface +{ + public: + OtherOrnamentAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherPercussion.cpp b/Sourcecode/private/mx/core/elements/OtherPercussion.cpp index fd5bcea67..d3ff2ddf1 100644 --- a/Sourcecode/private/mx/core/elements/OtherPercussion.cpp +++ b/Sourcecode/private/mx/core/elements/OtherPercussion.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - OtherPercussion::OtherPercussion() - :myValue() - {} - - - OtherPercussion::OtherPercussion( const XsString& value ) - :myValue( value ) - {} - - - bool OtherPercussion::hasAttributes() const - { - return false; - } - - - bool OtherPercussion::hasContents() const - { - return true; - } - - - std::ostream& OtherPercussion::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& OtherPercussion::streamName( std::ostream& os ) const - { - os << "other-percussion"; - return os; - } +namespace core +{ +OtherPercussion::OtherPercussion() : myValue() +{ +} +OtherPercussion::OtherPercussion(const XsString &value) : myValue(value) +{ +} - std::ostream& OtherPercussion::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool OtherPercussion::hasAttributes() const +{ + return false; +} +bool OtherPercussion::hasContents() const +{ + return true; +} - XsString OtherPercussion::getValue() const - { - return myValue; - } +std::ostream &OtherPercussion::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &OtherPercussion::streamName(std::ostream &os) const +{ + os << "other-percussion"; + return os; +} - void OtherPercussion::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &OtherPercussion::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString OtherPercussion::getValue() const +{ + return myValue; +} - bool OtherPercussion::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void OtherPercussion::setValue(const XsString &value) +{ + myValue = value; +} - } +bool OtherPercussion::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherPercussion.h b/Sourcecode/private/mx/core/elements/OtherPercussion.h index 78f482003..f9a3e5291 100644 --- a/Sourcecode/private/mx/core/elements/OtherPercussion.h +++ b/Sourcecode/private/mx/core/elements/OtherPercussion.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( OtherPercussion ) - - inline OtherPercussionPtr makeOtherPercussion() { return std::make_shared(); } - inline OtherPercussionPtr makeOtherPercussion( const XsString& value ) { return std::make_shared( value ); } - inline OtherPercussionPtr makeOtherPercussion( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherPercussion : public ElementInterface - { - public: - OtherPercussion(); - OtherPercussion( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(OtherPercussion) + +inline OtherPercussionPtr makeOtherPercussion() +{ + return std::make_shared(); +} + +inline OtherPercussionPtr makeOtherPercussion(const XsString &value) +{ + return std::make_shared(value); } + +inline OtherPercussionPtr makeOtherPercussion(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class OtherPercussion : public ElementInterface +{ + public: + OtherPercussion(); + OtherPercussion(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherPlay.cpp b/Sourcecode/private/mx/core/elements/OtherPlay.cpp index d6567c5e4..7a37e89ec 100644 --- a/Sourcecode/private/mx/core/elements/OtherPlay.cpp +++ b/Sourcecode/private/mx/core/elements/OtherPlay.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - OtherPlay::OtherPlay() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherPlay::OtherPlay( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherPlay::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherPlay::hasContents() const - { - return true; - } - - - std::ostream& OtherPlay::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherPlay::streamName( std::ostream& os ) const - { - os << "other-play"; - return os; - } - - - std::ostream& OtherPlay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +OtherPlay::OtherPlay() : myValue(), myAttributes(std::make_shared()) +{ +} +OtherPlay::OtherPlay(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - OtherPlayAttributesPtr OtherPlay::getAttributes() const - { - return myAttributes; - } +bool OtherPlay::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool OtherPlay::hasContents() const +{ + return true; +} - void OtherPlay::setAttributes( const OtherPlayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OtherPlay::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &OtherPlay::streamName(std::ostream &os) const +{ + os << "other-play"; + return os; +} - XsString OtherPlay::getValue() const - { - return myValue; - } +std::ostream &OtherPlay::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OtherPlayAttributesPtr OtherPlay::getAttributes() const +{ + return myAttributes; +} - void OtherPlay::setValue( const XsString& value ) - { - myValue = value; - } +void OtherPlay::setAttributes(const OtherPlayAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString OtherPlay::getValue() const +{ + return myValue; +} - bool OtherPlay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } +void OtherPlay::setValue(const XsString &value) +{ + myValue = value; +} - } +bool OtherPlay::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherPlay.h b/Sourcecode/private/mx/core/elements/OtherPlay.h index d5a5b7882..f371ad9d3 100644 --- a/Sourcecode/private/mx/core/elements/OtherPlay.h +++ b/Sourcecode/private/mx/core/elements/OtherPlay.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/OtherPlayAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherPlayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherPlay ) - - inline OtherPlayPtr makeOtherPlay() { return std::make_shared(); } - inline OtherPlayPtr makeOtherPlay( const XsString& value ) { return std::make_shared( value ); } - inline OtherPlayPtr makeOtherPlay( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherPlay : public ElementInterface - { - public: - OtherPlay(); - OtherPlay( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherPlayAttributesPtr getAttributes() const; - void setAttributes( const OtherPlayAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherPlayAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OtherPlayAttributes) +MX_FORWARD_DECLARE_ELEMENT(OtherPlay) + +inline OtherPlayPtr makeOtherPlay() +{ + return std::make_shared(); +} + +inline OtherPlayPtr makeOtherPlay(const XsString &value) +{ + return std::make_shared(value); } + +inline OtherPlayPtr makeOtherPlay(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class OtherPlay : public ElementInterface +{ + public: + OtherPlay(); + OtherPlay(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OtherPlayAttributesPtr getAttributes() const; + void setAttributes(const OtherPlayAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + OtherPlayAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp index c5b831653..6ca535126 100644 --- a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - OtherPlayAttributes::OtherPlayAttributes() - :type() - ,hasType( true ) - {} - +namespace core +{ +OtherPlayAttributes::OtherPlayAttributes() : type(), hasType(true) +{ +} - bool OtherPlayAttributes::hasValues() const - { - return hasType; - } +bool OtherPlayAttributes::hasValues() const +{ + return hasType; +} +std::ostream &OtherPlayAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& OtherPlayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool OtherPlayAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OtherPlayAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OtherPlayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type")) { - const char* const className = "OtherPlayAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.h b/Sourcecode/private/mx/core/elements/OtherPlayAttributes.h index 20a26d642..2c93213ff 100644 --- a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.h +++ b/Sourcecode/private/mx/core/elements/OtherPlayAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OtherPlayAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OtherPlayAttributes) - struct OtherPlayAttributes : public AttributesInterface - { - public: - OtherPlayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - const bool hasType; +struct OtherPlayAttributes : public AttributesInterface +{ + public: + OtherPlayAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken type; + const bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherTechnical.cpp b/Sourcecode/private/mx/core/elements/OtherTechnical.cpp index 3baf810ff..c77ee59bc 100644 --- a/Sourcecode/private/mx/core/elements/OtherTechnical.cpp +++ b/Sourcecode/private/mx/core/elements/OtherTechnical.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - OtherTechnical::OtherTechnical() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherTechnical::OtherTechnical( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherTechnical::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherTechnical::hasContents() const - { - return true; - } - - - std::ostream& OtherTechnical::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherTechnical::streamName( std::ostream& os ) const - { - os << "other-technical"; - return os; - } - - - std::ostream& OtherTechnical::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +OtherTechnical::OtherTechnical() : myValue(), myAttributes(std::make_shared()) +{ +} +OtherTechnical::OtherTechnical(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - OtherTechnicalAttributesPtr OtherTechnical::getAttributes() const - { - return myAttributes; - } +bool OtherTechnical::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool OtherTechnical::hasContents() const +{ + return true; +} - void OtherTechnical::setAttributes( const OtherTechnicalAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &OtherTechnical::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &OtherTechnical::streamName(std::ostream &os) const +{ + os << "other-technical"; + return os; +} - XsString OtherTechnical::getValue() const - { - return myValue; - } +std::ostream &OtherTechnical::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +OtherTechnicalAttributesPtr OtherTechnical::getAttributes() const +{ + return myAttributes; +} - void OtherTechnical::setValue( const XsString& value ) - { - myValue = value; - } +void OtherTechnical::setAttributes(const OtherTechnicalAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString OtherTechnical::getValue() const +{ + return myValue; +} - bool OtherTechnical::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void OtherTechnical::setValue(const XsString &value) +{ + myValue = value; +} - } +bool OtherTechnical::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherTechnical.h b/Sourcecode/private/mx/core/elements/OtherTechnical.h index 14be7adf5..b340925f7 100644 --- a/Sourcecode/private/mx/core/elements/OtherTechnical.h +++ b/Sourcecode/private/mx/core/elements/OtherTechnical.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/OtherTechnicalAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherTechnicalAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherTechnical ) - - inline OtherTechnicalPtr makeOtherTechnical() { return std::make_shared(); } - inline OtherTechnicalPtr makeOtherTechnical( const XsString& value ) { return std::make_shared( value ); } - inline OtherTechnicalPtr makeOtherTechnical( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherTechnical : public ElementInterface - { - public: - OtherTechnical(); - OtherTechnical( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherTechnicalAttributesPtr getAttributes() const; - void setAttributes( const OtherTechnicalAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherTechnicalAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(OtherTechnicalAttributes) +MX_FORWARD_DECLARE_ELEMENT(OtherTechnical) + +inline OtherTechnicalPtr makeOtherTechnical() +{ + return std::make_shared(); +} + +inline OtherTechnicalPtr makeOtherTechnical(const XsString &value) +{ + return std::make_shared(value); } + +inline OtherTechnicalPtr makeOtherTechnical(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class OtherTechnical : public ElementInterface +{ + public: + OtherTechnical(); + OtherTechnical(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + OtherTechnicalAttributesPtr getAttributes() const; + void setAttributes(const OtherTechnicalAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + OtherTechnicalAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp index 7b55e9c4a..2dc2ed455 100644 --- a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +OtherTechnicalAttributes::OtherTechnicalAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), placement(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool OtherTechnicalAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &OtherTechnicalAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - OtherTechnicalAttributes::OtherTechnicalAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool OtherTechnicalAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "OtherTechnicalAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool OtherTechnicalAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& OtherTechnicalAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool OtherTechnicalAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "OtherTechnicalAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h b/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h index d7543de61..156a2bbe3 100644 --- a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h +++ b/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( OtherTechnicalAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(OtherTechnicalAttributes) - struct OtherTechnicalAttributes : public AttributesInterface - { - public: - OtherTechnicalAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct OtherTechnicalAttributes : public AttributesInterface +{ + public: + OtherTechnicalAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageHeight.cpp b/Sourcecode/private/mx/core/elements/PageHeight.cpp index 9d1cbde85..58147544b 100644 --- a/Sourcecode/private/mx/core/elements/PageHeight.cpp +++ b/Sourcecode/private/mx/core/elements/PageHeight.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - PageHeight::PageHeight() - :myValue() - {} - - - PageHeight::PageHeight( const TenthsValue& value ) - :myValue( value ) - {} - - - bool PageHeight::hasAttributes() const - { - return false; - } - - - bool PageHeight::hasContents() const - { - return true; - } - - - std::ostream& PageHeight::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PageHeight::streamName( std::ostream& os ) const - { - os << "page-height"; - return os; - } +namespace core +{ +PageHeight::PageHeight() : myValue() +{ +} +PageHeight::PageHeight(const TenthsValue &value) : myValue(value) +{ +} - std::ostream& PageHeight::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool PageHeight::hasAttributes() const +{ + return false; +} +bool PageHeight::hasContents() const +{ + return true; +} - TenthsValue PageHeight::getValue() const - { - return myValue; - } +std::ostream &PageHeight::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &PageHeight::streamName(std::ostream &os) const +{ + os << "page-height"; + return os; +} - void PageHeight::setValue( const TenthsValue& value ) - { - myValue = value; - } +std::ostream &PageHeight::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TenthsValue PageHeight::getValue() const +{ + return myValue; +} - bool PageHeight::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void PageHeight::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool PageHeight::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageHeight.h b/Sourcecode/private/mx/core/elements/PageHeight.h index e55cd34e5..31c3c5c83 100644 --- a/Sourcecode/private/mx/core/elements/PageHeight.h +++ b/Sourcecode/private/mx/core/elements/PageHeight.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PageHeight ) - - inline PageHeightPtr makePageHeight() { return std::make_shared(); } - inline PageHeightPtr makePageHeight( const TenthsValue& value ) { return std::make_shared( value ); } - inline PageHeightPtr makePageHeight( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class PageHeight : public ElementInterface - { - public: - PageHeight(); - PageHeight( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PageHeight) + +inline PageHeightPtr makePageHeight() +{ + return std::make_shared(); } + +inline PageHeightPtr makePageHeight(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline PageHeightPtr makePageHeight(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class PageHeight : public ElementInterface +{ + public: + PageHeight(); + PageHeight(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageLayout.cpp b/Sourcecode/private/mx/core/elements/PageLayout.cpp index 9f36d9ab7..364fcb72a 100644 --- a/Sourcecode/private/mx/core/elements/PageLayout.cpp +++ b/Sourcecode/private/mx/core/elements/PageLayout.cpp @@ -11,154 +11,143 @@ namespace mx { - namespace core - { - PageLayout::PageLayout() - :myPageHeight( makePageHeight() ) - ,myPageWidth( makePageWidth() ) - ,myPageMarginsSet() - {} - - - bool PageLayout::hasAttributes() const - { - return false; - } - - - std::ostream& PageLayout::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PageLayout::streamName( std::ostream& os ) const - { - os << "page-layout"; - return os; - } - - - bool PageLayout::hasContents() const - { - return true; - } - - - std::ostream& PageLayout::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myPageHeight->toStream( os, indentLevel+1 ); - os << std::endl; - myPageWidth->toStream( os, indentLevel+1 ); - for ( auto x : myPageMarginsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - PageHeightPtr PageLayout::getPageHeight() const - { - return myPageHeight; - } +namespace core +{ +PageLayout::PageLayout() : myPageHeight(makePageHeight()), myPageWidth(makePageWidth()), myPageMarginsSet() +{ +} +bool PageLayout::hasAttributes() const +{ + return false; +} - void PageLayout::setPageHeight( const PageHeightPtr& value ) - { - if( value ) - { - myPageHeight = value; - } - } +std::ostream &PageLayout::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &PageLayout::streamName(std::ostream &os) const +{ + os << "page-layout"; + return os; +} - PageWidthPtr PageLayout::getPageWidth() const - { - return myPageWidth; - } +bool PageLayout::hasContents() const +{ + return true; +} +std::ostream &PageLayout::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myPageHeight->toStream(os, indentLevel + 1); + os << std::endl; + myPageWidth->toStream(os, indentLevel + 1); + for (auto x : myPageMarginsSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} - void PageLayout::setPageWidth( const PageWidthPtr& value ) - { - if( value ) - { - myPageWidth = value; - } - } +PageHeightPtr PageLayout::getPageHeight() const +{ + return myPageHeight; +} +void PageLayout::setPageHeight(const PageHeightPtr &value) +{ + if (value) + { + myPageHeight = value; + } +} - const PageMarginsSet& PageLayout::getPageMarginsSet() const - { - return myPageMarginsSet; - } +PageWidthPtr PageLayout::getPageWidth() const +{ + return myPageWidth; +} +void PageLayout::setPageWidth(const PageWidthPtr &value) +{ + if (value) + { + myPageWidth = value; + } +} - void PageLayout::removePageMargins( const PageMarginsSetIterConst& value ) - { - if ( value != myPageMarginsSet.cend() ) - { - myPageMarginsSet.erase( value ); - } - } +const PageMarginsSet &PageLayout::getPageMarginsSet() const +{ + return myPageMarginsSet; +} +void PageLayout::removePageMargins(const PageMarginsSetIterConst &value) +{ + if (value != myPageMarginsSet.cend()) + { + myPageMarginsSet.erase(value); + } +} - void PageLayout::addPageMargins( const PageMarginsPtr& value ) +void PageLayout::addPageMargins(const PageMarginsPtr &value) +{ + if (value) + { + if (myPageMarginsSet.size() < 2) { - if ( value ) - { - if( myPageMarginsSet.size() < 2 ) - { - myPageMarginsSet.push_back( value ); - } - } + myPageMarginsSet.push_back(value); } + } +} +void PageLayout::clearPageMarginsSet() +{ + myPageMarginsSet.clear(); +} - void PageLayout::clearPageMarginsSet() - { - myPageMarginsSet.clear(); - } +PageMarginsPtr PageLayout::getPageMargins(const PageMarginsSetIterConst &setIterator) const +{ + if (setIterator != myPageMarginsSet.cend()) + { + return *setIterator; + } + return PageMarginsPtr(); +} +bool PageLayout::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isPageHeightFound = false; + bool isPageWidthFound = false; - PageMarginsPtr PageLayout::getPageMargins( const PageMarginsSetIterConst& setIterator ) const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myPageHeight, isPageHeightFound)) { - if( setIterator != myPageMarginsSet.cend() ) - { - return *setIterator; - } - return PageMarginsPtr(); + continue; } - - - bool PageLayout::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myPageWidth, isPageWidthFound)) { - bool isSuccess = true; - bool isPageHeightFound = false; - bool isPageWidthFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myPageHeight, isPageHeightFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPageWidth, isPageWidthFound ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "page-margins", myPageMarginsSet ); - } - - if( !isPageHeightFound ) - { - message << "PageLayout: '" << myPageHeight->getElementName() << "' is required but was not found" << std::endl; - } - if( !isPageWidthFound ) - { - message << "PageLayout: '" << myPageWidth->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + importElementSet(message, it, endIter, isSuccess, "page-margins", myPageMarginsSet); + } + if (!isPageHeightFound) + { + message << "PageLayout: '" << myPageHeight->getElementName() << "' is required but was not found" << std::endl; } + if (!isPageWidthFound) + { + message << "PageLayout: '" << myPageWidth->getElementName() << "' is required but was not found" << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageLayout.h b/Sourcecode/private/mx/core/elements/PageLayout.h index 9b0dd4a43..399f453aa 100644 --- a/Sourcecode/private/mx/core/elements/PageLayout.h +++ b/Sourcecode/private/mx/core/elements/PageLayout.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,49 +13,52 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PageHeight ) - MX_FORWARD_DECLARE_ELEMENT( PageMargins ) - MX_FORWARD_DECLARE_ELEMENT( PageWidth ) - MX_FORWARD_DECLARE_ELEMENT( PageLayout ) - - inline PageLayoutPtr makePageLayout() { return std::make_shared(); } - - class PageLayout : public ElementInterface - { - public: - PageLayout(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ PageHeight minOccurs = 1, maxOccurs = 1 _________ */ - PageHeightPtr getPageHeight() const; - void setPageHeight( const PageHeightPtr& value ); - - /* _________ PageWidth minOccurs = 1, maxOccurs = 1 _________ */ - PageWidthPtr getPageWidth() const; - void setPageWidth( const PageWidthPtr& value ); - - /* _________ PageMargins minOccurs = 0, maxOccurs = 2 _________ */ - const PageMarginsSet& getPageMarginsSet() const; - void addPageMargins( const PageMarginsPtr& value ); - void removePageMargins( const PageMarginsSetIterConst& value ); - void clearPageMarginsSet(); - PageMarginsPtr getPageMargins( const PageMarginsSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PageHeightPtr myPageHeight; - PageWidthPtr myPageWidth; - PageMarginsSet myPageMarginsSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PageHeight) +MX_FORWARD_DECLARE_ELEMENT(PageMargins) +MX_FORWARD_DECLARE_ELEMENT(PageWidth) +MX_FORWARD_DECLARE_ELEMENT(PageLayout) + +inline PageLayoutPtr makePageLayout() +{ + return std::make_shared(); } + +class PageLayout : public ElementInterface +{ + public: + PageLayout(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ PageHeight minOccurs = 1, maxOccurs = 1 _________ */ + PageHeightPtr getPageHeight() const; + void setPageHeight(const PageHeightPtr &value); + + /* _________ PageWidth minOccurs = 1, maxOccurs = 1 _________ */ + PageWidthPtr getPageWidth() const; + void setPageWidth(const PageWidthPtr &value); + + /* _________ PageMargins minOccurs = 0, maxOccurs = 2 _________ */ + const PageMarginsSet &getPageMarginsSet() const; + void addPageMargins(const PageMarginsPtr &value); + void removePageMargins(const PageMarginsSetIterConst &value); + void clearPageMarginsSet(); + PageMarginsPtr getPageMargins(const PageMarginsSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PageHeightPtr myPageHeight; + PageWidthPtr myPageWidth; + PageMarginsSet myPageMarginsSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageMargins.cpp b/Sourcecode/private/mx/core/elements/PageMargins.cpp index 733308c3e..97a80e01e 100644 --- a/Sourcecode/private/mx/core/elements/PageMargins.cpp +++ b/Sourcecode/private/mx/core/elements/PageMargins.cpp @@ -12,169 +12,165 @@ namespace mx { - namespace core - { - PageMargins::PageMargins() - :myAttributes( std::make_shared() ) - ,myLeftMargin( makeLeftMargin() ) - ,myRightMargin( makeRightMargin() ) - ,myTopMargin( makeTopMargin() ) - ,myBottomMargin( makeBottomMargin() ) - {} - - - bool PageMargins::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PageMargins::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PageMargins::streamName( std::ostream& os ) const - { - os << "page-margins"; - return os; - } - - - bool PageMargins::hasContents() const - { - return true; - } - - - std::ostream& PageMargins::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myLeftMargin->toStream( os, indentLevel+1 ); - os << std::endl; - myRightMargin->toStream( os, indentLevel+1 ); - os << std::endl; - myTopMargin->toStream( os, indentLevel+1 ); - os << std::endl; - myBottomMargin->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } +namespace core +{ +PageMargins::PageMargins() + : myAttributes(std::make_shared()), myLeftMargin(makeLeftMargin()), + myRightMargin(makeRightMargin()), myTopMargin(makeTopMargin()), myBottomMargin(makeBottomMargin()) +{ +} +bool PageMargins::hasAttributes() const +{ + return myAttributes->hasValues(); +} - PageMarginsAttributesPtr PageMargins::getAttributes() const - { - return myAttributes; - } +std::ostream &PageMargins::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &PageMargins::streamName(std::ostream &os) const +{ + os << "page-margins"; + return os; +} - void PageMargins::setAttributes( const PageMarginsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool PageMargins::hasContents() const +{ + return true; +} +std::ostream &PageMargins::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myLeftMargin->toStream(os, indentLevel + 1); + os << std::endl; + myRightMargin->toStream(os, indentLevel + 1); + os << std::endl; + myTopMargin->toStream(os, indentLevel + 1); + os << std::endl; + myBottomMargin->toStream(os, indentLevel + 1); + os << std::endl; + return os; +} - LeftMarginPtr PageMargins::getLeftMargin() const - { - return myLeftMargin; - } +PageMarginsAttributesPtr PageMargins::getAttributes() const +{ + return myAttributes; +} +void PageMargins::setAttributes(const PageMarginsAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - void PageMargins::setLeftMargin( const LeftMarginPtr& value ) - { - if( value ) - { - myLeftMargin = value; - } - } +LeftMarginPtr PageMargins::getLeftMargin() const +{ + return myLeftMargin; +} +void PageMargins::setLeftMargin(const LeftMarginPtr &value) +{ + if (value) + { + myLeftMargin = value; + } +} - RightMarginPtr PageMargins::getRightMargin() const - { - return myRightMargin; - } +RightMarginPtr PageMargins::getRightMargin() const +{ + return myRightMargin; +} +void PageMargins::setRightMargin(const RightMarginPtr &value) +{ + if (value) + { + myRightMargin = value; + } +} - void PageMargins::setRightMargin( const RightMarginPtr& value ) - { - if( value ) - { - myRightMargin = value; - } - } +TopMarginPtr PageMargins::getTopMargin() const +{ + return myTopMargin; +} +void PageMargins::setTopMargin(const TopMarginPtr &value) +{ + if (value) + { + myTopMargin = value; + } +} - TopMarginPtr PageMargins::getTopMargin() const - { - return myTopMargin; - } +BottomMarginPtr PageMargins::getBottomMargin() const +{ + return myBottomMargin; +} +void PageMargins::setBottomMargin(const BottomMarginPtr &value) +{ + if (value) + { + myBottomMargin = value; + } +} - void PageMargins::setTopMargin( const TopMarginPtr& value ) +bool PageMargins::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isLeftMarginFound = false; + bool isRightMarginFound = false; + bool isTopMarginFound = false; + bool isBottomMarginFound = false; + + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myLeftMargin, isLeftMarginFound)) { - if( value ) - { - myTopMargin = value; - } + continue; } - - - BottomMarginPtr PageMargins::getBottomMargin() const + if (importElement(message, *it, isSuccess, *myRightMargin, isRightMarginFound)) { - return myBottomMargin; + continue; } - - - void PageMargins::setBottomMargin( const BottomMarginPtr& value ) + if (importElement(message, *it, isSuccess, *myTopMargin, isTopMarginFound)) { - if( value ) - { - myBottomMargin = value; - } + continue; } - - - bool PageMargins::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myBottomMargin, isBottomMarginFound)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isLeftMarginFound = false; - bool isRightMarginFound = false; - bool isTopMarginFound = false; - bool isBottomMarginFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myLeftMargin, isLeftMarginFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRightMargin, isRightMarginFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTopMargin, isTopMarginFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBottomMargin, isBottomMarginFound ) ) { continue; } - } - - if( !isLeftMarginFound ) - { - message << "PageMargins: '" << myLeftMargin->getElementName() << "' is required but was not found" << std::endl; - } - if( !isRightMarginFound ) - { - message << "PageMargins: '" << myRightMargin->getElementName() << "' is required but was not found" << std::endl; - } - if( !isTopMarginFound ) - { - message << "PageMargins: '" << myTopMargin->getElementName() << "' is required but was not found" << std::endl; - } - if( !isBottomMarginFound ) - { - message << "PageMargins: '" << myBottomMargin->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isLeftMarginFound) + { + message << "PageMargins: '" << myLeftMargin->getElementName() << "' is required but was not found" << std::endl; + } + if (!isRightMarginFound) + { + message << "PageMargins: '" << myRightMargin->getElementName() << "' is required but was not found" + << std::endl; } + if (!isTopMarginFound) + { + message << "PageMargins: '" << myTopMargin->getElementName() << "' is required but was not found" << std::endl; + } + if (!isBottomMarginFound) + { + message << "PageMargins: '" << myBottomMargin->getElementName() << "' is required but was not found" + << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageMargins.h b/Sourcecode/private/mx/core/elements/PageMargins.h index 4f382bd85..ba10f1e14 100644 --- a/Sourcecode/private/mx/core/elements/PageMargins.h +++ b/Sourcecode/private/mx/core/elements/PageMargins.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PageMarginsAttributes.h" #include @@ -14,56 +14,59 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PageMarginsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BottomMargin ) - MX_FORWARD_DECLARE_ELEMENT( LeftMargin ) - MX_FORWARD_DECLARE_ELEMENT( RightMargin ) - MX_FORWARD_DECLARE_ELEMENT( TopMargin ) - MX_FORWARD_DECLARE_ELEMENT( PageMargins ) +MX_FORWARD_DECLARE_ATTRIBUTES(PageMarginsAttributes) +MX_FORWARD_DECLARE_ELEMENT(BottomMargin) +MX_FORWARD_DECLARE_ELEMENT(LeftMargin) +MX_FORWARD_DECLARE_ELEMENT(RightMargin) +MX_FORWARD_DECLARE_ELEMENT(TopMargin) +MX_FORWARD_DECLARE_ELEMENT(PageMargins) - inline PageMarginsPtr makePageMargins() { return std::make_shared(); } +inline PageMarginsPtr makePageMargins() +{ + return std::make_shared(); +} - class PageMargins : public ElementInterface - { - public: - PageMargins(); +class PageMargins : public ElementInterface +{ + public: + PageMargins(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PageMarginsAttributesPtr getAttributes() const; - void setAttributes( const PageMarginsAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PageMarginsAttributesPtr getAttributes() const; + void setAttributes(const PageMarginsAttributesPtr &value); - /* _________ LeftMargin minOccurs = 1, maxOccurs = 1 _________ */ - LeftMarginPtr getLeftMargin() const; - void setLeftMargin( const LeftMarginPtr& value ); + /* _________ LeftMargin minOccurs = 1, maxOccurs = 1 _________ */ + LeftMarginPtr getLeftMargin() const; + void setLeftMargin(const LeftMarginPtr &value); - /* _________ RightMargin minOccurs = 1, maxOccurs = 1 _________ */ - RightMarginPtr getRightMargin() const; - void setRightMargin( const RightMarginPtr& value ); + /* _________ RightMargin minOccurs = 1, maxOccurs = 1 _________ */ + RightMarginPtr getRightMargin() const; + void setRightMargin(const RightMarginPtr &value); - /* _________ TopMargin minOccurs = 1, maxOccurs = 1 _________ */ - TopMarginPtr getTopMargin() const; - void setTopMargin( const TopMarginPtr& value ); + /* _________ TopMargin minOccurs = 1, maxOccurs = 1 _________ */ + TopMarginPtr getTopMargin() const; + void setTopMargin(const TopMarginPtr &value); - /* _________ BottomMargin minOccurs = 1, maxOccurs = 1 _________ */ - BottomMarginPtr getBottomMargin() const; - void setBottomMargin( const BottomMarginPtr& value ); + /* _________ BottomMargin minOccurs = 1, maxOccurs = 1 _________ */ + BottomMarginPtr getBottomMargin() const; + void setBottomMargin(const BottomMarginPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - PageMarginsAttributesPtr myAttributes; - LeftMarginPtr myLeftMargin; - RightMarginPtr myRightMargin; - TopMarginPtr myTopMargin; - BottomMarginPtr myBottomMargin; - }; - } -} + private: + PageMarginsAttributesPtr myAttributes; + LeftMarginPtr myLeftMargin; + RightMarginPtr myRightMargin; + TopMarginPtr myTopMargin; + BottomMarginPtr myBottomMargin; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp b/Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp index d10f197b7..b3f315db3 100644 --- a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - PageMarginsAttributes::PageMarginsAttributes() - :type( MarginType::both ) - ,hasType( false ) - {} - +namespace core +{ +PageMarginsAttributes::PageMarginsAttributes() : type(MarginType::both), hasType(false) +{ +} - bool PageMarginsAttributes::hasValues() const - { - return hasType; - } +bool PageMarginsAttributes::hasValues() const +{ + return hasType; +} +std::ostream &PageMarginsAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& PageMarginsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool PageMarginsAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PageMarginsAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PageMarginsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type", &parseMarginType)) { - const char* const className = "PageMarginsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseMarginType ) ) { continue; } - } - - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.h b/Sourcecode/private/mx/core/elements/PageMarginsAttributes.h index bcdecd8f7..0093b1c0a 100644 --- a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.h +++ b/Sourcecode/private/mx/core/elements/PageMarginsAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PageMarginsAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PageMarginsAttributes) - struct PageMarginsAttributes : public AttributesInterface - { - public: - PageMarginsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - MarginType type; - bool hasType; +struct PageMarginsAttributes : public AttributesInterface +{ + public: + PageMarginsAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + MarginType type; + bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageWidth.cpp b/Sourcecode/private/mx/core/elements/PageWidth.cpp index 98c25bff8..364d91eb2 100644 --- a/Sourcecode/private/mx/core/elements/PageWidth.cpp +++ b/Sourcecode/private/mx/core/elements/PageWidth.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - PageWidth::PageWidth() - :myValue() - {} - - - PageWidth::PageWidth( const TenthsValue& value ) - :myValue( value ) - {} - - - bool PageWidth::hasAttributes() const - { - return false; - } - - - bool PageWidth::hasContents() const - { - return true; - } - - - std::ostream& PageWidth::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PageWidth::streamName( std::ostream& os ) const - { - os << "page-width"; - return os; - } +namespace core +{ +PageWidth::PageWidth() : myValue() +{ +} +PageWidth::PageWidth(const TenthsValue &value) : myValue(value) +{ +} - std::ostream& PageWidth::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool PageWidth::hasAttributes() const +{ + return false; +} +bool PageWidth::hasContents() const +{ + return true; +} - TenthsValue PageWidth::getValue() const - { - return myValue; - } +std::ostream &PageWidth::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &PageWidth::streamName(std::ostream &os) const +{ + os << "page-width"; + return os; +} - void PageWidth::setValue( const TenthsValue& value ) - { - myValue = value; - } +std::ostream &PageWidth::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TenthsValue PageWidth::getValue() const +{ + return myValue; +} - bool PageWidth::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void PageWidth::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool PageWidth::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PageWidth.h b/Sourcecode/private/mx/core/elements/PageWidth.h index 8eaff1fac..a552b8043 100644 --- a/Sourcecode/private/mx/core/elements/PageWidth.h +++ b/Sourcecode/private/mx/core/elements/PageWidth.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PageWidth ) - - inline PageWidthPtr makePageWidth() { return std::make_shared(); } - inline PageWidthPtr makePageWidth( const TenthsValue& value ) { return std::make_shared( value ); } - inline PageWidthPtr makePageWidth( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class PageWidth : public ElementInterface - { - public: - PageWidth(); - PageWidth( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PageWidth) + +inline PageWidthPtr makePageWidth() +{ + return std::make_shared(); } + +inline PageWidthPtr makePageWidth(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline PageWidthPtr makePageWidth(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class PageWidth : public ElementInterface +{ + public: + PageWidth(); + PageWidth(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pan.cpp b/Sourcecode/private/mx/core/elements/Pan.cpp index e2184c92f..76b8cc83f 100644 --- a/Sourcecode/private/mx/core/elements/Pan.cpp +++ b/Sourcecode/private/mx/core/elements/Pan.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Pan::Pan() - :myValue() - {} - - - Pan::Pan( const RotationDegrees& value ) - :myValue( value ) - {} - - - bool Pan::hasAttributes() const - { - return false; - } - - - bool Pan::hasContents() const - { - return true; - } - - - std::ostream& Pan::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Pan::streamName( std::ostream& os ) const - { - os << "pan"; - return os; - } +namespace core +{ +Pan::Pan() : myValue() +{ +} +Pan::Pan(const RotationDegrees &value) : myValue(value) +{ +} - std::ostream& Pan::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Pan::hasAttributes() const +{ + return false; +} +bool Pan::hasContents() const +{ + return true; +} - RotationDegrees Pan::getValue() const - { - return myValue; - } +std::ostream &Pan::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Pan::streamName(std::ostream &os) const +{ + os << "pan"; + return os; +} - void Pan::setValue( const RotationDegrees& value ) - { - myValue = value; - } +std::ostream &Pan::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +RotationDegrees Pan::getValue() const +{ + return myValue; +} - bool Pan::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Pan::setValue(const RotationDegrees &value) +{ + myValue = value; +} - } +bool Pan::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pan.h b/Sourcecode/private/mx/core/elements/Pan.h index c112febe3..8bf0afdef 100644 --- a/Sourcecode/private/mx/core/elements/Pan.h +++ b/Sourcecode/private/mx/core/elements/Pan.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Pan ) - - inline PanPtr makePan() { return std::make_shared(); } - inline PanPtr makePan( const RotationDegrees& value ) { return std::make_shared( value ); } - inline PanPtr makePan( RotationDegrees&& value ) { return std::make_shared( std::move( value ) ); } - - class Pan : public ElementInterface - { - public: - Pan(); - Pan( const RotationDegrees& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RotationDegrees getValue() const; - void setValue( const RotationDegrees& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RotationDegrees myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Pan) + +inline PanPtr makePan() +{ + return std::make_shared(); } + +inline PanPtr makePan(const RotationDegrees &value) +{ + return std::make_shared(value); +} + +inline PanPtr makePan(RotationDegrees &&value) +{ + return std::make_shared(std::move(value)); +} + +class Pan : public ElementInterface +{ + public: + Pan(); + Pan(const RotationDegrees &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RotationDegrees getValue() const; + void setValue(const RotationDegrees &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + RotationDegrees myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviation.cpp b/Sourcecode/private/mx/core/elements/PartAbbreviation.cpp index 56cc7ccc2..e2c46fc5f 100644 --- a/Sourcecode/private/mx/core/elements/PartAbbreviation.cpp +++ b/Sourcecode/private/mx/core/elements/PartAbbreviation.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - PartAbbreviation::PartAbbreviation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PartAbbreviation::PartAbbreviation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PartAbbreviation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PartAbbreviation::hasContents() const - { - return true; - } - - - std::ostream& PartAbbreviation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PartAbbreviation::streamName( std::ostream& os ) const - { - os << "part-abbreviation"; - return os; - } - - - std::ostream& PartAbbreviation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +PartAbbreviation::PartAbbreviation() : myValue(), myAttributes(std::make_shared()) +{ +} +PartAbbreviation::PartAbbreviation(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - PartAbbreviationAttributesPtr PartAbbreviation::getAttributes() const - { - return myAttributes; - } +bool PartAbbreviation::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool PartAbbreviation::hasContents() const +{ + return true; +} - void PartAbbreviation::setAttributes( const PartAbbreviationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &PartAbbreviation::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &PartAbbreviation::streamName(std::ostream &os) const +{ + os << "part-abbreviation"; + return os; +} - XsString PartAbbreviation::getValue() const - { - return myValue; - } +std::ostream &PartAbbreviation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PartAbbreviationAttributesPtr PartAbbreviation::getAttributes() const +{ + return myAttributes; +} - void PartAbbreviation::setValue( const XsString& value ) - { - myValue = value; - } +void PartAbbreviation::setAttributes(const PartAbbreviationAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString PartAbbreviation::getValue() const +{ + return myValue; +} - bool PartAbbreviation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } +void PartAbbreviation::setValue(const XsString &value) +{ + myValue = value; +} - } +bool PartAbbreviation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviation.h b/Sourcecode/private/mx/core/elements/PartAbbreviation.h index 38ea5e6ed..1789e641e 100644 --- a/Sourcecode/private/mx/core/elements/PartAbbreviation.h +++ b/Sourcecode/private/mx/core/elements/PartAbbreviation.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/PartAbbreviationAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAbbreviationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviation ) - - inline PartAbbreviationPtr makePartAbbreviation() { return std::make_shared(); } - inline PartAbbreviationPtr makePartAbbreviation( const XsString& value ) { return std::make_shared( value ); } - inline PartAbbreviationPtr makePartAbbreviation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PartAbbreviation : public ElementInterface - { - public: - PartAbbreviation(); - PartAbbreviation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartAbbreviationAttributesPtr getAttributes() const; - void setAttributes( const PartAbbreviationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PartAbbreviationAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PartAbbreviationAttributes) +MX_FORWARD_DECLARE_ELEMENT(PartAbbreviation) + +inline PartAbbreviationPtr makePartAbbreviation() +{ + return std::make_shared(); +} + +inline PartAbbreviationPtr makePartAbbreviation(const XsString &value) +{ + return std::make_shared(value); } + +inline PartAbbreviationPtr makePartAbbreviation(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class PartAbbreviation : public ElementInterface +{ + public: + PartAbbreviation(); + PartAbbreviation(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PartAbbreviationAttributesPtr getAttributes() const; + void setAttributes(const PartAbbreviationAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + PartAbbreviationAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp b/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp index 5c872120a..0168e1e07 100644 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp @@ -8,91 +8,96 @@ namespace mx { - namespace core +namespace core +{ +PartAbbreviationAttributes::PartAbbreviationAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), printObject(), + justify(LeftCenterRight::center), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasPrintObject(false), hasJustify(false) +{ +} + +bool PartAbbreviationAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPrintObject || hasJustify; +} + +std::ostream &PartAbbreviationAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PartAbbreviationAttributes::PartAbbreviationAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,printObject() - ,justify( LeftCenterRight::center ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPrintObject( false ) - ,hasJustify( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, justify, "justify", hasJustify); + } + return os; +} + +bool PartAbbreviationAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PartAbbreviationAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PartAbbreviationAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPrintObject || - hasJustify; + continue; } - - - std::ostream& PartAbbreviationAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, justify, "justify", hasJustify ); - } - return os; + continue; } - - - bool PartAbbreviationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "PartAbbreviationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h b/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h index e0d50dbbb..b4b8f5afb 100644 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h +++ b/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,40 +17,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PartAbbreviationAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PartAbbreviationAttributes) - struct PartAbbreviationAttributes : public AttributesInterface - { - public: - PartAbbreviationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - YesNo printObject; - LeftCenterRight justify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPrintObject; - bool hasJustify; +struct PartAbbreviationAttributes : public AttributesInterface +{ + public: + PartAbbreviationAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + YesNo printObject; + LeftCenterRight justify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPrintObject; + bool hasJustify; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp index bf3d93570..107ce12fc 100644 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp +++ b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp @@ -9,135 +9,124 @@ namespace mx { - namespace core - { - PartAbbreviationDisplay::PartAbbreviationDisplay() - :myAttributes( std::make_shared() ) - ,myDisplayTextOrAccidentalTextSet() - {} - +namespace core +{ +PartAbbreviationDisplay::PartAbbreviationDisplay() + : myAttributes(std::make_shared()), myDisplayTextOrAccidentalTextSet() +{ +} - bool PartAbbreviationDisplay::hasAttributes() const - { - return myAttributes->hasValues(); - } +bool PartAbbreviationDisplay::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &PartAbbreviationDisplay::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - std::ostream& PartAbbreviationDisplay::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +std::ostream &PartAbbreviationDisplay::streamName(std::ostream &os) const +{ + os << "part-abbreviation-display"; + return os; +} +bool PartAbbreviationDisplay::hasContents() const +{ + return myDisplayTextOrAccidentalTextSet.size() > 0; +} - std::ostream& PartAbbreviationDisplay::streamName( std::ostream& os ) const +std::ostream &PartAbbreviationDisplay::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + if (hasContents()) + { + for (auto x : myDisplayTextOrAccidentalTextSet) { - os << "part-abbreviation-display"; - return os; + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); } + isOneLineOnly = !hasContents(); + os << std::endl; + } + else + { + isOneLineOnly = true; + } + return os; +} +PartAbbreviationDisplayAttributesPtr PartAbbreviationDisplay::getAttributes() const +{ + return myAttributes; +} - bool PartAbbreviationDisplay::hasContents() const - { - return myDisplayTextOrAccidentalTextSet.size() > 0; - } +void PartAbbreviationDisplay::setAttributes(const PartAbbreviationDisplayAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +const DisplayTextOrAccidentalTextSet &PartAbbreviationDisplay::getDisplayTextOrAccidentalText() const +{ + return myDisplayTextOrAccidentalTextSet; +} - std::ostream& PartAbbreviationDisplay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myDisplayTextOrAccidentalTextSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = !hasContents(); - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } +void PartAbbreviationDisplay::addDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextPtr &value) +{ + if (value) + { + myDisplayTextOrAccidentalTextSet.push_back(value); + } +} +void PartAbbreviationDisplay::removeDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) +{ + if (setIterator != myDisplayTextOrAccidentalTextSet.cend()) + { + myDisplayTextOrAccidentalTextSet.erase(setIterator); + } +} - PartAbbreviationDisplayAttributesPtr PartAbbreviationDisplay::getAttributes() const - { - return myAttributes; - } +void PartAbbreviationDisplay::clearDisplayTextOrAccidentalTextSet() +{ + myDisplayTextOrAccidentalTextSet.clear(); +} +DisplayTextOrAccidentalTextPtr PartAbbreviationDisplay::getDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) const +{ + if (setIterator != myDisplayTextOrAccidentalTextSet.cend()) + { + return *setIterator; + } + return makeDisplayTextOrAccidentalText(); +} - void PartAbbreviationDisplay::setAttributes( const PartAbbreviationDisplayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const DisplayTextOrAccidentalTextSet& PartAbbreviationDisplay::getDisplayTextOrAccidentalText() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - void PartAbbreviationDisplay::addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ) - { - if ( value ) - { - myDisplayTextOrAccidentalTextSet.push_back( value ); - } - } - - - void PartAbbreviationDisplay::removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - myDisplayTextOrAccidentalTextSet.erase( setIterator ); - } - } - - - void PartAbbreviationDisplay::clearDisplayTextOrAccidentalTextSet() - { - myDisplayTextOrAccidentalTextSet.clear(); - } - - - DisplayTextOrAccidentalTextPtr PartAbbreviationDisplay::getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - return *setIterator; - } - return makeDisplayTextOrAccidentalText(); - } +const DisplayTextOrAccidentalTextSet &PartAbbreviationDisplay::getDisplayTextOrAccidentalTextSet() const +{ + return myDisplayTextOrAccidentalTextSet; +} - - const DisplayTextOrAccidentalTextSet& PartAbbreviationDisplay::getDisplayTextOrAccidentalTextSet() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - bool PartAbbreviationDisplay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeDisplayTextOrAccidentalText(); - isSuccess &= item->fromXElement( message, *it ); - myDisplayTextOrAccidentalTextSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } +bool PartAbbreviationDisplay::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + auto item = makeDisplayTextOrAccidentalText(); + isSuccess &= item->fromXElement(message, *it); + myDisplayTextOrAccidentalTextSet.push_back(item); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h index 54337cd55..0056d55f0 100644 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h +++ b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PartAbbreviationDisplayAttributes.h" #include @@ -14,42 +14,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAbbreviationDisplayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviationDisplay ) - - inline PartAbbreviationDisplayPtr makePartAbbreviationDisplay() { return std::make_shared(); } - - class PartAbbreviationDisplay : public ElementInterface - { - public: - PartAbbreviationDisplay(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartAbbreviationDisplayAttributesPtr getAttributes() const; - void setAttributes( const PartAbbreviationDisplayAttributesPtr& value ); - - /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalText() const; - void addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ); - void removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ); - void clearDisplayTextOrAccidentalTextSet(); - DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const; - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalTextSet() const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartAbbreviationDisplayAttributesPtr myAttributes; - DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PartAbbreviationDisplayAttributes) +MX_FORWARD_DECLARE_ELEMENT(DisplayTextOrAccidentalText) +MX_FORWARD_DECLARE_ELEMENT(PartAbbreviationDisplay) + +inline PartAbbreviationDisplayPtr makePartAbbreviationDisplay() +{ + return std::make_shared(); } + +class PartAbbreviationDisplay : public ElementInterface +{ + public: + PartAbbreviationDisplay(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PartAbbreviationDisplayAttributesPtr getAttributes() const; + void setAttributes(const PartAbbreviationDisplayAttributesPtr &value); + + /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ + const DisplayTextOrAccidentalTextSet &getDisplayTextOrAccidentalText() const; + void addDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextPtr &value); + void removeDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextSetIterConst &setIterator); + void clearDisplayTextOrAccidentalTextSet(); + DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) const; + const DisplayTextOrAccidentalTextSet &getDisplayTextOrAccidentalTextSet() const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PartAbbreviationDisplayAttributesPtr myAttributes; + DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp index 23b3ca14f..04c9a4875 100644 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - PartAbbreviationDisplayAttributes::PartAbbreviationDisplayAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - +namespace core +{ +PartAbbreviationDisplayAttributes::PartAbbreviationDisplayAttributes() : printObject(YesNo::no), hasPrintObject(false) +{ +} - bool PartAbbreviationDisplayAttributes::hasValues() const - { - return hasPrintObject; - } +bool PartAbbreviationDisplayAttributes::hasValues() const +{ + return hasPrintObject; +} +std::ostream &PartAbbreviationDisplayAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} - std::ostream& PartAbbreviationDisplayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } +bool PartAbbreviationDisplayAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PartAbbreviationDisplayAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PartAbbreviationDisplayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - const char* const className = "PartAbbreviationDisplayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h index 3b5d8b35f..d2085f9b3 100644 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h +++ b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PartAbbreviationDisplayAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PartAbbreviationDisplayAttributes) - struct PartAbbreviationDisplayAttributes : public AttributesInterface - { - public: - PartAbbreviationDisplayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; +struct PartAbbreviationDisplayAttributes : public AttributesInterface +{ + public: + PartAbbreviationDisplayAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAttributes.cpp b/Sourcecode/private/mx/core/elements/PartAttributes.cpp index d61c13d0a..53d86d392 100644 --- a/Sourcecode/private/mx/core/elements/PartAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PartAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - PartAttributes::PartAttributes() - :id() - ,hasId( true ) - {} - +namespace core +{ +PartAttributes::PartAttributes() : id(), hasId(true) +{ +} - bool PartAttributes::hasValues() const - { - return hasId; - } +bool PartAttributes::hasValues() const +{ + return hasId; +} +std::ostream &PartAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, id, "id", hasId); + } + return os; +} - std::ostream& PartAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } +bool PartAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PartAttributes"; + bool isSuccess = true; + bool isIdFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PartAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, id, isIdFound, "id")) { - const char* const className = "PartAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'id' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isIdFound) + { + isSuccess = false; + message << className << ": 'id' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartAttributes.h b/Sourcecode/private/mx/core/elements/PartAttributes.h index d6d73b6c2..32e03504b 100644 --- a/Sourcecode/private/mx/core/elements/PartAttributes.h +++ b/Sourcecode/private/mx/core/elements/PartAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsIDREF.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PartAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PartAttributes) - struct PartAttributes : public AttributesInterface - { - public: - PartAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsIDREF id; - const bool hasId; +struct PartAttributes : public AttributesInterface +{ + public: + PartAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsIDREF id; + const bool hasId; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartGroup.cpp b/Sourcecode/private/mx/core/elements/PartGroup.cpp index 91cef5edd..9af056fa9 100644 --- a/Sourcecode/private/mx/core/elements/PartGroup.cpp +++ b/Sourcecode/private/mx/core/elements/PartGroup.cpp @@ -16,353 +16,322 @@ namespace mx { - namespace core - { - PartGroup::PartGroup() - :myAttributes( std::make_shared() ) - ,myGroupName( makeGroupName() ) - ,myHasGroupName( false ) - ,myGroupNameDisplay( makeGroupNameDisplay() ) - ,myHasGroupNameDisplay( false ) - ,myGroupAbbreviation( makeGroupAbbreviation() ) - ,myHasGroupAbbreviation( false ) - ,myGroupAbbreviationDisplay( makeGroupAbbreviationDisplay() ) - ,myHasGroupAbbreviationDisplay( false ) - ,myGroupSymbol( makeGroupSymbol() ) - ,myHasGroupSymbol( false ) - ,myGroupBarline( makeGroupBarline() ) - ,myHasGroupBarline( false ) - ,myGroupTime( makeGroupTime() ) - ,myHasGroupTime( false ) - ,myEditorialGroup( makeEditorialGroup() ) - {} - - - bool PartGroup::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PartGroup::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PartGroup::streamName( std::ostream& os ) const - { - os << "part-group"; - return os; - } - +namespace core +{ +PartGroup::PartGroup() + : myAttributes(std::make_shared()), myGroupName(makeGroupName()), myHasGroupName(false), + myGroupNameDisplay(makeGroupNameDisplay()), myHasGroupNameDisplay(false), + myGroupAbbreviation(makeGroupAbbreviation()), myHasGroupAbbreviation(false), + myGroupAbbreviationDisplay(makeGroupAbbreviationDisplay()), myHasGroupAbbreviationDisplay(false), + myGroupSymbol(makeGroupSymbol()), myHasGroupSymbol(false), myGroupBarline(makeGroupBarline()), + myHasGroupBarline(false), myGroupTime(makeGroupTime()), myHasGroupTime(false), + myEditorialGroup(makeEditorialGroup()) +{ +} - bool PartGroup::hasContents() const - { - return myHasGroupName - || myHasGroupNameDisplay - || myHasGroupAbbreviation - || myHasGroupAbbreviationDisplay - || myHasGroupSymbol - || myHasGroupBarline - || myHasGroupTime - || myEditorialGroup->hasContents(); - } +bool PartGroup::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &PartGroup::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - std::ostream& PartGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myHasGroupName ) - { - os << std::endl; - myGroupName->toStream( os, indentLevel+1 ); - } - if ( myHasGroupNameDisplay ) - { - os << std::endl; - myGroupNameDisplay->toStream( os, indentLevel+1 ); - } - if ( myHasGroupAbbreviation ) - { - os << std::endl; - myGroupAbbreviation->toStream( os, indentLevel+1 ); - } - if ( myHasGroupAbbreviationDisplay ) - { - os << std::endl; - myGroupAbbreviationDisplay->toStream( os, indentLevel+1 ); - } - if ( myHasGroupSymbol ) - { - os << std::endl; - myGroupSymbol->toStream( os, indentLevel+1 ); - } - if ( myHasGroupBarline ) - { - os << std::endl; - myGroupBarline->toStream( os, indentLevel+1 ); - } - if ( myHasGroupTime ) - { - os << std::endl; - myGroupTime->toStream( os, indentLevel+1 ); - } - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } +std::ostream &PartGroup::streamName(std::ostream &os) const +{ + os << "part-group"; + return os; +} +bool PartGroup::hasContents() const +{ + return myHasGroupName || myHasGroupNameDisplay || myHasGroupAbbreviation || myHasGroupAbbreviationDisplay || + myHasGroupSymbol || myHasGroupBarline || myHasGroupTime || myEditorialGroup->hasContents(); +} - PartGroupAttributesPtr PartGroup::getAttributes() const +std::ostream &PartGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + if (myHasGroupName) { - return myAttributes; + os << std::endl; + myGroupName->toStream(os, indentLevel + 1); } - - - void PartGroup::setAttributes( const PartGroupAttributesPtr& value ) + if (myHasGroupNameDisplay) { - if ( value ) - { - myAttributes = value; - } + os << std::endl; + myGroupNameDisplay->toStream(os, indentLevel + 1); } - - - GroupNamePtr PartGroup::getGroupName() const + if (myHasGroupAbbreviation) { - return myGroupName; + os << std::endl; + myGroupAbbreviation->toStream(os, indentLevel + 1); } - - - void PartGroup::setGroupName( const GroupNamePtr& value ) + if (myHasGroupAbbreviationDisplay) { - if( value ) - { - myGroupName = value; - } + os << std::endl; + myGroupAbbreviationDisplay->toStream(os, indentLevel + 1); } - - - bool PartGroup::getHasGroupName() const + if (myHasGroupSymbol) { - return myHasGroupName; + os << std::endl; + myGroupSymbol->toStream(os, indentLevel + 1); } - - - void PartGroup::setHasGroupName( const bool value ) + if (myHasGroupBarline) { - myHasGroupName = value; + os << std::endl; + myGroupBarline->toStream(os, indentLevel + 1); } - - - GroupNameDisplayPtr PartGroup::getGroupNameDisplay() const + if (myHasGroupTime) { - return myGroupNameDisplay; + os << std::endl; + myGroupTime->toStream(os, indentLevel + 1); } - - - void PartGroup::setGroupNameDisplay( const GroupNameDisplayPtr& value ) + if (myEditorialGroup->hasContents()) { - if( value ) - { - myGroupNameDisplay = value; - } - } - - - bool PartGroup::getHasGroupNameDisplay() const - { - return myHasGroupNameDisplay; - } - - - void PartGroup::setHasGroupNameDisplay( const bool value ) - { - myHasGroupNameDisplay = value; + os << std::endl; + myEditorialGroup->streamContents(os, indentLevel + 1, isOneLineOnly); } + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +PartGroupAttributesPtr PartGroup::getAttributes() const +{ + return myAttributes; +} - GroupAbbreviationPtr PartGroup::getGroupAbbreviation() const - { - return myGroupAbbreviation; - } +void PartGroup::setAttributes(const PartGroupAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +GroupNamePtr PartGroup::getGroupName() const +{ + return myGroupName; +} - void PartGroup::setGroupAbbreviation( const GroupAbbreviationPtr& value ) - { - if( value ) - { - myGroupAbbreviation = value; - } - } +void PartGroup::setGroupName(const GroupNamePtr &value) +{ + if (value) + { + myGroupName = value; + } +} +bool PartGroup::getHasGroupName() const +{ + return myHasGroupName; +} - bool PartGroup::getHasGroupAbbreviation() const - { - return myHasGroupAbbreviation; - } +void PartGroup::setHasGroupName(const bool value) +{ + myHasGroupName = value; +} +GroupNameDisplayPtr PartGroup::getGroupNameDisplay() const +{ + return myGroupNameDisplay; +} - void PartGroup::setHasGroupAbbreviation( const bool value ) - { - myHasGroupAbbreviation = value; - } +void PartGroup::setGroupNameDisplay(const GroupNameDisplayPtr &value) +{ + if (value) + { + myGroupNameDisplay = value; + } +} +bool PartGroup::getHasGroupNameDisplay() const +{ + return myHasGroupNameDisplay; +} - GroupAbbreviationDisplayPtr PartGroup::getGroupAbbreviationDisplay() const - { - return myGroupAbbreviationDisplay; - } +void PartGroup::setHasGroupNameDisplay(const bool value) +{ + myHasGroupNameDisplay = value; +} +GroupAbbreviationPtr PartGroup::getGroupAbbreviation() const +{ + return myGroupAbbreviation; +} - void PartGroup::setGroupAbbreviationDisplay( const GroupAbbreviationDisplayPtr& value ) - { - if( value ) - { - myGroupAbbreviationDisplay = value; - } - } +void PartGroup::setGroupAbbreviation(const GroupAbbreviationPtr &value) +{ + if (value) + { + myGroupAbbreviation = value; + } +} +bool PartGroup::getHasGroupAbbreviation() const +{ + return myHasGroupAbbreviation; +} - bool PartGroup::getHasGroupAbbreviationDisplay() const - { - return myHasGroupAbbreviationDisplay; - } +void PartGroup::setHasGroupAbbreviation(const bool value) +{ + myHasGroupAbbreviation = value; +} +GroupAbbreviationDisplayPtr PartGroup::getGroupAbbreviationDisplay() const +{ + return myGroupAbbreviationDisplay; +} - void PartGroup::setHasGroupAbbreviationDisplay( const bool value ) - { - myHasGroupAbbreviationDisplay = value; - } +void PartGroup::setGroupAbbreviationDisplay(const GroupAbbreviationDisplayPtr &value) +{ + if (value) + { + myGroupAbbreviationDisplay = value; + } +} +bool PartGroup::getHasGroupAbbreviationDisplay() const +{ + return myHasGroupAbbreviationDisplay; +} - GroupSymbolPtr PartGroup::getGroupSymbol() const - { - return myGroupSymbol; - } +void PartGroup::setHasGroupAbbreviationDisplay(const bool value) +{ + myHasGroupAbbreviationDisplay = value; +} +GroupSymbolPtr PartGroup::getGroupSymbol() const +{ + return myGroupSymbol; +} - void PartGroup::setGroupSymbol( const GroupSymbolPtr& value ) - { - if( value ) - { - myGroupSymbol = value; - } - } +void PartGroup::setGroupSymbol(const GroupSymbolPtr &value) +{ + if (value) + { + myGroupSymbol = value; + } +} +bool PartGroup::getHasGroupSymbol() const +{ + return myHasGroupSymbol; +} - bool PartGroup::getHasGroupSymbol() const - { - return myHasGroupSymbol; - } +void PartGroup::setHasGroupSymbol(const bool value) +{ + myHasGroupSymbol = value; +} +GroupBarlinePtr PartGroup::getGroupBarline() const +{ + return myGroupBarline; +} - void PartGroup::setHasGroupSymbol( const bool value ) - { - myHasGroupSymbol = value; - } +void PartGroup::setGroupBarline(const GroupBarlinePtr &value) +{ + if (value) + { + myGroupBarline = value; + } +} +bool PartGroup::getHasGroupBarline() const +{ + return myHasGroupBarline; +} - GroupBarlinePtr PartGroup::getGroupBarline() const - { - return myGroupBarline; - } +void PartGroup::setHasGroupBarline(const bool value) +{ + myHasGroupBarline = value; +} +GroupTimePtr PartGroup::getGroupTime() const +{ + return myGroupTime; +} - void PartGroup::setGroupBarline( const GroupBarlinePtr& value ) - { - if( value ) - { - myGroupBarline = value; - } - } +void PartGroup::setGroupTime(const GroupTimePtr &value) +{ + if (value) + { + myGroupTime = value; + } +} +bool PartGroup::getHasGroupTime() const +{ + return myHasGroupTime; +} - bool PartGroup::getHasGroupBarline() const - { - return myHasGroupBarline; - } +void PartGroup::setHasGroupTime(const bool value) +{ + myHasGroupTime = value; +} +EditorialGroupPtr PartGroup::getEditorialGroup() const +{ + return myEditorialGroup; +} - void PartGroup::setHasGroupBarline( const bool value ) - { - myHasGroupBarline = value; - } +void PartGroup::setEditorialGroup(const EditorialGroupPtr &value) +{ + if (value) + { + myEditorialGroup = value; + } +} +bool PartGroup::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - GroupTimePtr PartGroup::getGroupTime() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myGroupName, myHasGroupName)) { - return myGroupTime; + continue; } - - - void PartGroup::setGroupTime( const GroupTimePtr& value ) + if (importElement(message, *it, isSuccess, *myGroupNameDisplay, myHasGroupNameDisplay)) { - if( value ) - { - myGroupTime = value; - } + continue; } - - - bool PartGroup::getHasGroupTime() const + if (importElement(message, *it, isSuccess, *myGroupAbbreviation, myHasGroupAbbreviation)) { - return myHasGroupTime; + continue; } - - - void PartGroup::setHasGroupTime( const bool value ) + if (importElement(message, *it, isSuccess, *myGroupAbbreviationDisplay, myHasGroupAbbreviationDisplay)) { - myHasGroupTime = value; + continue; } - - - EditorialGroupPtr PartGroup::getEditorialGroup() const + if (importElement(message, *it, isSuccess, *myGroupSymbol, myHasGroupSymbol)) { - return myEditorialGroup; + continue; } - - - void PartGroup::setEditorialGroup( const EditorialGroupPtr& value ) + if (importElement(message, *it, isSuccess, *myGroupBarline, myHasGroupBarline)) { - if( value ) - { - myEditorialGroup = value; - } + continue; } - - - bool PartGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myGroupTime, myHasGroupTime)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myGroupName, myHasGroupName ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupNameDisplay, myHasGroupNameDisplay ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupAbbreviation, myHasGroupAbbreviation ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupAbbreviationDisplay, myHasGroupAbbreviationDisplay ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupSymbol, myHasGroupSymbol ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupBarline, myHasGroupBarline ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupTime, myHasGroupTime ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - } - - MX_RETURN_IS_SUCCESS; + continue; } + importGroup(message, it, endIter, isSuccess, myEditorialGroup); } + + MX_RETURN_IS_SUCCESS; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartGroup.h b/Sourcecode/private/mx/core/elements/PartGroup.h index be9493039..d3f057d4f 100644 --- a/Sourcecode/private/mx/core/elements/PartGroup.h +++ b/Sourcecode/private/mx/core/elements/PartGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PartGroupAttributes.h" #include @@ -14,101 +14,104 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartGroupAttributes ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( GroupAbbreviation ) - MX_FORWARD_DECLARE_ELEMENT( GroupAbbreviationDisplay ) - MX_FORWARD_DECLARE_ELEMENT( GroupBarline ) - MX_FORWARD_DECLARE_ELEMENT( GroupName ) - MX_FORWARD_DECLARE_ELEMENT( GroupNameDisplay ) - MX_FORWARD_DECLARE_ELEMENT( GroupSymbol ) - MX_FORWARD_DECLARE_ELEMENT( GroupTime ) - MX_FORWARD_DECLARE_ELEMENT( PartGroup ) - - inline PartGroupPtr makePartGroup() { return std::make_shared(); } - - class PartGroup : public ElementInterface - { - public: - PartGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartGroupAttributesPtr getAttributes() const; - void setAttributes( const PartGroupAttributesPtr& value ); - - /* _________ GroupName minOccurs = 0, maxOccurs = 1 _________ */ - GroupNamePtr getGroupName() const; - void setGroupName( const GroupNamePtr& value ); - bool getHasGroupName() const; - void setHasGroupName( const bool value ); - - /* _________ GroupNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ - GroupNameDisplayPtr getGroupNameDisplay() const; - void setGroupNameDisplay( const GroupNameDisplayPtr& value ); - bool getHasGroupNameDisplay() const; - void setHasGroupNameDisplay( const bool value ); - - /* _________ GroupAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ - GroupAbbreviationPtr getGroupAbbreviation() const; - void setGroupAbbreviation( const GroupAbbreviationPtr& value ); - bool getHasGroupAbbreviation() const; - void setHasGroupAbbreviation( const bool value ); - - /* _________ GroupAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ - GroupAbbreviationDisplayPtr getGroupAbbreviationDisplay() const; - void setGroupAbbreviationDisplay( const GroupAbbreviationDisplayPtr& value ); - bool getHasGroupAbbreviationDisplay() const; - void setHasGroupAbbreviationDisplay( const bool value ); - - /* _________ GroupSymbol minOccurs = 0, maxOccurs = 1 _________ */ - GroupSymbolPtr getGroupSymbol() const; - void setGroupSymbol( const GroupSymbolPtr& value ); - bool getHasGroupSymbol() const; - void setHasGroupSymbol( const bool value ); - - /* _________ GroupBarline minOccurs = 0, maxOccurs = 1 _________ */ - GroupBarlinePtr getGroupBarline() const; - void setGroupBarline( const GroupBarlinePtr& value ); - bool getHasGroupBarline() const; - void setHasGroupBarline( const bool value ); - - /* _________ GroupTime minOccurs = 0, maxOccurs = 1 _________ */ - GroupTimePtr getGroupTime() const; - void setGroupTime( const GroupTimePtr& value ); - bool getHasGroupTime() const; - void setHasGroupTime( const bool value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartGroupAttributesPtr myAttributes; - GroupNamePtr myGroupName; - bool myHasGroupName; - GroupNameDisplayPtr myGroupNameDisplay; - bool myHasGroupNameDisplay; - GroupAbbreviationPtr myGroupAbbreviation; - bool myHasGroupAbbreviation; - GroupAbbreviationDisplayPtr myGroupAbbreviationDisplay; - bool myHasGroupAbbreviationDisplay; - GroupSymbolPtr myGroupSymbol; - bool myHasGroupSymbol; - GroupBarlinePtr myGroupBarline; - bool myHasGroupBarline; - GroupTimePtr myGroupTime; - bool myHasGroupTime; - EditorialGroupPtr myEditorialGroup; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PartGroupAttributes) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) +MX_FORWARD_DECLARE_ELEMENT(GroupAbbreviation) +MX_FORWARD_DECLARE_ELEMENT(GroupAbbreviationDisplay) +MX_FORWARD_DECLARE_ELEMENT(GroupBarline) +MX_FORWARD_DECLARE_ELEMENT(GroupName) +MX_FORWARD_DECLARE_ELEMENT(GroupNameDisplay) +MX_FORWARD_DECLARE_ELEMENT(GroupSymbol) +MX_FORWARD_DECLARE_ELEMENT(GroupTime) +MX_FORWARD_DECLARE_ELEMENT(PartGroup) + +inline PartGroupPtr makePartGroup() +{ + return std::make_shared(); } + +class PartGroup : public ElementInterface +{ + public: + PartGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PartGroupAttributesPtr getAttributes() const; + void setAttributes(const PartGroupAttributesPtr &value); + + /* _________ GroupName minOccurs = 0, maxOccurs = 1 _________ */ + GroupNamePtr getGroupName() const; + void setGroupName(const GroupNamePtr &value); + bool getHasGroupName() const; + void setHasGroupName(const bool value); + + /* _________ GroupNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ + GroupNameDisplayPtr getGroupNameDisplay() const; + void setGroupNameDisplay(const GroupNameDisplayPtr &value); + bool getHasGroupNameDisplay() const; + void setHasGroupNameDisplay(const bool value); + + /* _________ GroupAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ + GroupAbbreviationPtr getGroupAbbreviation() const; + void setGroupAbbreviation(const GroupAbbreviationPtr &value); + bool getHasGroupAbbreviation() const; + void setHasGroupAbbreviation(const bool value); + + /* _________ GroupAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ + GroupAbbreviationDisplayPtr getGroupAbbreviationDisplay() const; + void setGroupAbbreviationDisplay(const GroupAbbreviationDisplayPtr &value); + bool getHasGroupAbbreviationDisplay() const; + void setHasGroupAbbreviationDisplay(const bool value); + + /* _________ GroupSymbol minOccurs = 0, maxOccurs = 1 _________ */ + GroupSymbolPtr getGroupSymbol() const; + void setGroupSymbol(const GroupSymbolPtr &value); + bool getHasGroupSymbol() const; + void setHasGroupSymbol(const bool value); + + /* _________ GroupBarline minOccurs = 0, maxOccurs = 1 _________ */ + GroupBarlinePtr getGroupBarline() const; + void setGroupBarline(const GroupBarlinePtr &value); + bool getHasGroupBarline() const; + void setHasGroupBarline(const bool value); + + /* _________ GroupTime minOccurs = 0, maxOccurs = 1 _________ */ + GroupTimePtr getGroupTime() const; + void setGroupTime(const GroupTimePtr &value); + bool getHasGroupTime() const; + void setHasGroupTime(const bool value); + + /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialGroupPtr getEditorialGroup() const; + void setEditorialGroup(const EditorialGroupPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PartGroupAttributesPtr myAttributes; + GroupNamePtr myGroupName; + bool myHasGroupName; + GroupNameDisplayPtr myGroupNameDisplay; + bool myHasGroupNameDisplay; + GroupAbbreviationPtr myGroupAbbreviation; + bool myHasGroupAbbreviation; + GroupAbbreviationDisplayPtr myGroupAbbreviationDisplay; + bool myHasGroupAbbreviationDisplay; + GroupSymbolPtr myGroupSymbol; + bool myHasGroupSymbol; + GroupBarlinePtr myGroupBarline; + bool myHasGroupBarline; + GroupTimePtr myGroupTime; + bool myHasGroupTime; + EditorialGroupPtr myEditorialGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp b/Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp index c2ac65ec5..102ff3cf9 100644 --- a/Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp @@ -8,57 +8,57 @@ namespace mx { - namespace core - { - PartGroupAttributes::PartGroupAttributes() - :type( StartStop::start ) - ,number( XsToken( "1" ) ) - ,hasType( true ) - ,hasNumber( false ) - {} +namespace core +{ +PartGroupAttributes::PartGroupAttributes() + : type(StartStop::start), number(XsToken("1")), hasType(true), hasNumber(false) +{ +} +bool PartGroupAttributes::hasValues() const +{ + return hasType || hasNumber; +} - bool PartGroupAttributes::hasValues() const - { - return hasType || - hasNumber; - } +std::ostream &PartGroupAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + } + return os; +} + +bool PartGroupAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PartGroupAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - std::ostream& PartGroupAttributes::toStream( std::ostream& os ) const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - } - return os; + continue; } - - - bool PartGroupAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - const char* const className = "PartGroupAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartGroupAttributes.h b/Sourcecode/private/mx/core/elements/PartGroupAttributes.h index 31c3d4fec..64f0f529f 100644 --- a/Sourcecode/private/mx/core/elements/PartGroupAttributes.h +++ b/Sourcecode/private/mx/core/elements/PartGroupAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -15,24 +15,24 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PartGroupAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PartGroupAttributes) - struct PartGroupAttributes : public AttributesInterface - { - public: - PartGroupAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - XsToken number; - const bool hasType; - bool hasNumber; +struct PartGroupAttributes : public AttributesInterface +{ + public: + PartGroupAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + XsToken number; + const bool hasType; + bool hasNumber; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp b/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp index e3bf66945..3e0c6bc2e 100644 --- a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp +++ b/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp @@ -10,101 +10,88 @@ namespace mx { - namespace core - { - PartGroupOrScorePart::PartGroupOrScorePart() - :myChoice( Choice::partGroup ) - ,myPartGroup( makePartGroup() ) - ,myScorePart( makeScorePart() ) - {} - - - bool PartGroupOrScorePart::hasAttributes() const - { - return false; - } - - - std::ostream& PartGroupOrScorePart::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PartGroupOrScorePart::streamName( std::ostream& os ) const - { - return os; - } - - - bool PartGroupOrScorePart::hasContents() const - { - return ( myChoice == Choice::partGroup && myPartGroup->hasContents() ) - || ( myChoice == Choice::scorePart && myScorePart->hasContents() ); - } - - - std::ostream& PartGroupOrScorePart::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::partGroup: - myPartGroup->toStream( os, indentLevel ); - break; - case Choice::scorePart: - myScorePart->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - PartGroupOrScorePart::Choice PartGroupOrScorePart::getChoice() const - { - return myChoice; - } +namespace core +{ +PartGroupOrScorePart::PartGroupOrScorePart() + : myChoice(Choice::partGroup), myPartGroup(makePartGroup()), myScorePart(makeScorePart()) +{ +} +bool PartGroupOrScorePart::hasAttributes() const +{ + return false; +} - void PartGroupOrScorePart::setChoice( const PartGroupOrScorePart::Choice value ) - { - myChoice = value; - } +std::ostream &PartGroupOrScorePart::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &PartGroupOrScorePart::streamName(std::ostream &os) const +{ + return os; +} - PartGroupPtr PartGroupOrScorePart::getPartGroup() const - { - return myPartGroup; - } +bool PartGroupOrScorePart::hasContents() const +{ + return (myChoice == Choice::partGroup && myPartGroup->hasContents()) || + (myChoice == Choice::scorePart && myScorePart->hasContents()); +} +std::ostream &PartGroupOrScorePart::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::partGroup: + myPartGroup->toStream(os, indentLevel); + break; + case Choice::scorePart: + myScorePart->toStream(os, indentLevel); + break; + default: + break; + } + isOneLineOnly = false; + return os; +} - void PartGroupOrScorePart::setPartGroup( const PartGroupPtr& value ) - { - if ( value ) - { - myPartGroup = value; - } - } +PartGroupOrScorePart::Choice PartGroupOrScorePart::getChoice() const +{ + return myChoice; +} +void PartGroupOrScorePart::setChoice(const PartGroupOrScorePart::Choice value) +{ + myChoice = value; +} - ScorePartPtr PartGroupOrScorePart::getScorePart() const - { - return myScorePart; - } +PartGroupPtr PartGroupOrScorePart::getPartGroup() const +{ + return myPartGroup; +} +void PartGroupOrScorePart::setPartGroup(const PartGroupPtr &value) +{ + if (value) + { + myPartGroup = value; + } +} - void PartGroupOrScorePart::setScorePart( const ScorePartPtr& value ) - { - if ( value ) - { - myScorePart = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( PartGroupOrScorePart ) +ScorePartPtr PartGroupOrScorePart::getScorePart() const +{ + return myScorePart; +} +void PartGroupOrScorePart::setScorePart(const ScorePartPtr &value) +{ + if (value) + { + myScorePart = value; } } + +MX_FROM_XELEMENT_UNUSED(PartGroupOrScorePart) + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h b/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h index 6eeaf5806..4a54997a5 100644 --- a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h +++ b/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,50 +13,53 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( PartGroup ) - MX_FORWARD_DECLARE_ELEMENT( ScorePart ) - MX_FORWARD_DECLARE_ELEMENT( PartGroupOrScorePart ) - - inline PartGroupOrScorePartPtr makePartGroupOrScorePart() { return std::make_shared(); } - - class PartGroupOrScorePart : public ElementInterface - { - public: - enum class Choice - { - partGroup = 1, - scorePart = 2 - }; - PartGroupOrScorePart(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - PartGroupOrScorePart::Choice getChoice() const; - void setChoice( const PartGroupOrScorePart::Choice value ); - - /* _________ PartGroup minOccurs = 1, maxPartGroupOccurs = 1 _________ */ - PartGroupPtr getPartGroup() const; - void setPartGroup( const PartGroupPtr& value ); - - /* _________ ScorePart minOccurs = 1, maxOccurs = 1 _________ */ - ScorePartPtr getScorePart() const; - void setScorePart( const ScorePartPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - PartGroupPtr myPartGroup; - ScorePartPtr myScorePart; - }; - } +MX_FORWARD_DECLARE_ELEMENT(PartGroup) +MX_FORWARD_DECLARE_ELEMENT(ScorePart) +MX_FORWARD_DECLARE_ELEMENT(PartGroupOrScorePart) + +inline PartGroupOrScorePartPtr makePartGroupOrScorePart() +{ + return std::make_shared(); } + +class PartGroupOrScorePart : public ElementInterface +{ + public: + enum class Choice + { + partGroup = 1, + scorePart = 2 + }; + PartGroupOrScorePart(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + PartGroupOrScorePart::Choice getChoice() const; + void setChoice(const PartGroupOrScorePart::Choice value); + + /* _________ PartGroup minOccurs = 1, maxPartGroupOccurs = 1 _________ */ + PartGroupPtr getPartGroup() const; + void setPartGroup(const PartGroupPtr &value); + + /* _________ ScorePart minOccurs = 1, maxOccurs = 1 _________ */ + ScorePartPtr getScorePart() const; + void setScorePart(const ScorePartPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + PartGroupPtr myPartGroup; + ScorePartPtr myScorePart; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartList.cpp b/Sourcecode/private/mx/core/elements/PartList.cpp index a2b482992..15b2e48f1 100644 --- a/Sourcecode/private/mx/core/elements/PartList.cpp +++ b/Sourcecode/private/mx/core/elements/PartList.cpp @@ -11,208 +11,188 @@ namespace mx { - namespace core - { - PartList::PartList() - :myPartGroupSet() - ,myScorePart( makeScorePart() ) - ,myPartGroupOrScorePartSet() - {} - - - bool PartList::hasAttributes() const - { - return false; - } - - - std::ostream& PartList::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PartList::streamName( std::ostream& os ) const - { - os << "part-list"; - return os; - } - +namespace core +{ +PartList::PartList() : myPartGroupSet(), myScorePart(makeScorePart()), myPartGroupOrScorePartSet() +{ +} - bool PartList::hasContents() const - { - return true; - } +bool PartList::hasAttributes() const +{ + return false; +} +std::ostream &PartList::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& PartList::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myPartGroupSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - myScorePart->toStream( os, indentLevel+1 ); - for ( auto x : myPartGroupOrScorePartSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = false; - os << std::endl; - return os; - } +std::ostream &PartList::streamName(std::ostream &os) const +{ + os << "part-list"; + return os; +} +bool PartList::hasContents() const +{ + return true; +} - const PartGroupSet& PartList::getPartGroupSet() const - { - return myPartGroupSet; - } +std::ostream &PartList::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + for (auto x : myPartGroupSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + os << std::endl; + myScorePart->toStream(os, indentLevel + 1); + for (auto x : myPartGroupOrScorePartSet) + { + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); + } + isOneLineOnly = false; + os << std::endl; + return os; +} +const PartGroupSet &PartList::getPartGroupSet() const +{ + return myPartGroupSet; +} - void PartList::addPartGroup( const PartGroupPtr& value ) - { - if ( value ) - { - myPartGroupSet.push_back( value ); - } - } +void PartList::addPartGroup(const PartGroupPtr &value) +{ + if (value) + { + myPartGroupSet.push_back(value); + } +} +void PartList::removePartGroup(const PartGroupSetIterConst &value) +{ + if (value != myPartGroupSet.cend()) + { + myPartGroupSet.erase(value); + } +} - void PartList::removePartGroup( const PartGroupSetIterConst& value ) - { - if ( value != myPartGroupSet.cend() ) - { - myPartGroupSet.erase( value ); - } - } +void PartList::clearPartGroupSet() +{ + myPartGroupSet.clear(); +} +PartGroupPtr PartList::getPartGroup(const PartGroupSetIterConst &setIterator) const +{ + if (setIterator != myPartGroupSet.cend()) + { + return *setIterator; + } + return PartGroupPtr(); +} - void PartList::clearPartGroupSet() - { - myPartGroupSet.clear(); - } +ScorePartPtr PartList::getScorePart() const +{ + return myScorePart; +} +void PartList::setScorePart(const ScorePartPtr &value) +{ + if (value) + { + myScorePart = value; + } +} - PartGroupPtr PartList::getPartGroup( const PartGroupSetIterConst& setIterator ) const - { - if( setIterator != myPartGroupSet.cend() ) - { - return *setIterator; - } - return PartGroupPtr(); - } +const PartGroupOrScorePartSet &PartList::getPartGroupOrScorePartSet() const +{ + return myPartGroupOrScorePartSet; +} +void PartList::addPartGroupOrScorePart(const PartGroupOrScorePartPtr &value) +{ + if (value) + { + myPartGroupOrScorePartSet.push_back(value); + } +} - ScorePartPtr PartList::getScorePart() const - { - return myScorePart; - } +void PartList::removePartGroupOrScorePart(const PartGroupOrScorePartSetIterConst &value) +{ + if (value != myPartGroupOrScorePartSet.cend()) + { + myPartGroupOrScorePartSet.erase(value); + } +} +void PartList::clearPartGroupOrScorePartSet() +{ + myPartGroupOrScorePartSet.clear(); +} - void PartList::setScorePart( const ScorePartPtr& value ) - { - if ( value ) - { - myScorePart = value; - } - } +PartGroupOrScorePartPtr PartList::getPartGroupOrScorePart(const PartGroupOrScorePartSetIterConst &setIterator) const +{ + if (setIterator != myPartGroupOrScorePartSet.cend()) + { + return *setIterator; + } + return PartGroupOrScorePartPtr(); +} +bool PartList::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isFirstScorePartEncountered = false; - const PartGroupOrScorePartSet& PartList::getPartGroupOrScorePartSet() const + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); + if (elementName != "part-group" && elementName != "score-part") { - return myPartGroupOrScorePartSet; + message << "PartList: fromXElement encountered unexpected element '" << elementName << "'" << std::endl; } - - - void PartList::addPartGroupOrScorePart( const PartGroupOrScorePartPtr& value ) + if (!isFirstScorePartEncountered) { - if ( value ) + if (elementName == "part-group") { - myPartGroupOrScorePartSet.push_back( value ); + auto partGroup = makePartGroup(); + isSuccess &= partGroup->fromXElement(message, *it); + myPartGroupSet.push_back(partGroup); } - } - - - void PartList::removePartGroupOrScorePart( const PartGroupOrScorePartSetIterConst& value ) - { - if ( value != myPartGroupOrScorePartSet.cend() ) + else if (elementName == "score-part") { - myPartGroupOrScorePartSet.erase( value ); + isFirstScorePartEncountered = true; + isSuccess &= myScorePart->fromXElement(message, *it); } } - - - void PartList::clearPartGroupOrScorePartSet() + else { - myPartGroupOrScorePartSet.clear(); - } + auto partGroupOrScorePart = makePartGroupOrScorePart(); - - PartGroupOrScorePartPtr PartList::getPartGroupOrScorePart( const PartGroupOrScorePartSetIterConst& setIterator ) const - { - if( setIterator != myPartGroupOrScorePartSet.cend() ) + if (elementName == "part-group") { - return *setIterator; + partGroupOrScorePart->setChoice(PartGroupOrScorePart::Choice::partGroup); + partGroupOrScorePart->getPartGroup()->fromXElement(message, *it); } - return PartGroupOrScorePartPtr(); - } - - - bool PartList::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstScorePartEncountered = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + else if (elementName == "score-part") { - const std::string elementName = it->getName(); - if( elementName != "part-group" && elementName != "score-part" ) - { - message << "PartList: fromXElement encountered unexpected element '" << elementName << "'" << std::endl; - } - if( !isFirstScorePartEncountered ) - { - if( elementName == "part-group" ) - { - auto partGroup = makePartGroup(); - isSuccess &= partGroup->fromXElement( message, *it ); - myPartGroupSet.push_back( partGroup ); - } - else if( elementName == "score-part" ) - { - isFirstScorePartEncountered = true; - isSuccess &= myScorePart->fromXElement( message, *it ); - } - } - else - { - auto partGroupOrScorePart = makePartGroupOrScorePart(); - - if( elementName == "part-group" ) - { - partGroupOrScorePart->setChoice( PartGroupOrScorePart::Choice::partGroup ); - partGroupOrScorePart->getPartGroup()->fromXElement( message, *it ); - } - else if( elementName == "score-part" ) - { - partGroupOrScorePart->setChoice( PartGroupOrScorePart::Choice::scorePart ); - partGroupOrScorePart->getScorePart()->fromXElement( message, *it ); - } - - myPartGroupOrScorePartSet.push_back( partGroupOrScorePart ); - } + partGroupOrScorePart->setChoice(PartGroupOrScorePart::Choice::scorePart); + partGroupOrScorePart->getScorePart()->fromXElement(message, *it); } - - if( !isFirstScorePartEncountered ) - { - message << "PartList: at least one 'score-part' elements are required but none were found" << std::endl; - isSuccess = false; - } - - MX_RETURN_IS_SUCCESS; + + myPartGroupOrScorePartSet.push_back(partGroupOrScorePart); } + } + if (!isFirstScorePartEncountered) + { + message << "PartList: at least one 'score-part' elements are required but none were found" << std::endl; + isSuccess = false; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartList.h b/Sourcecode/private/mx/core/elements/PartList.h index f3073d2ff..901032352 100644 --- a/Sourcecode/private/mx/core/elements/PartList.h +++ b/Sourcecode/private/mx/core/elements/PartList.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,52 +13,55 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PartGroup) +MX_FORWARD_DECLARE_ELEMENT(PartGroupOrScorePart) +MX_FORWARD_DECLARE_ELEMENT(ScorePart) +MX_FORWARD_DECLARE_ELEMENT(PartList) - MX_FORWARD_DECLARE_ELEMENT( PartGroup ) - MX_FORWARD_DECLARE_ELEMENT( PartGroupOrScorePart ) - MX_FORWARD_DECLARE_ELEMENT( ScorePart ) - MX_FORWARD_DECLARE_ELEMENT( PartList ) +inline PartListPtr makePartList() +{ + return std::make_shared(); +} - inline PartListPtr makePartList() { return std::make_shared(); } +class PartList : public ElementInterface +{ + public: + PartList(); - class PartList : public ElementInterface - { - public: - PartList(); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + /* _________ PartGroup minOccurs = 0, maxOccurs = unbounded _________ */ + const PartGroupSet &getPartGroupSet() const; + void addPartGroup(const PartGroupPtr &value); + void removePartGroup(const PartGroupSetIterConst &value); + void clearPartGroupSet(); + PartGroupPtr getPartGroup(const PartGroupSetIterConst &setIterator) const; - /* _________ PartGroup minOccurs = 0, maxOccurs = unbounded _________ */ - const PartGroupSet& getPartGroupSet() const; - void addPartGroup( const PartGroupPtr& value ); - void removePartGroup( const PartGroupSetIterConst& value ); - void clearPartGroupSet(); - PartGroupPtr getPartGroup( const PartGroupSetIterConst& setIterator ) const; + /* _________ ScorePart minOccurs = 1, maxOccurs = 1 _________ */ + ScorePartPtr getScorePart() const; + void setScorePart(const ScorePartPtr &value); - /* _________ ScorePart minOccurs = 1, maxOccurs = 1 _________ */ - ScorePartPtr getScorePart() const; - void setScorePart( const ScorePartPtr& value ); + /* _________ PartGroupOrScorePart minOccurs = 0, maxOccurs = unbounded _________ */ + const PartGroupOrScorePartSet &getPartGroupOrScorePartSet() const; + void addPartGroupOrScorePart(const PartGroupOrScorePartPtr &value); + void removePartGroupOrScorePart(const PartGroupOrScorePartSetIterConst &value); + void clearPartGroupOrScorePartSet(); + PartGroupOrScorePartPtr getPartGroupOrScorePart(const PartGroupOrScorePartSetIterConst &setIterator) const; - /* _________ PartGroupOrScorePart minOccurs = 0, maxOccurs = unbounded _________ */ - const PartGroupOrScorePartSet& getPartGroupOrScorePartSet() const; - void addPartGroupOrScorePart( const PartGroupOrScorePartPtr& value ); - void removePartGroupOrScorePart( const PartGroupOrScorePartSetIterConst& value ); - void clearPartGroupOrScorePartSet(); - PartGroupOrScorePartPtr getPartGroupOrScorePart( const PartGroupOrScorePartSetIterConst& setIterator ) const; + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartGroupSet myPartGroupSet; - ScorePartPtr myScorePart; - PartGroupOrScorePartSet myPartGroupOrScorePartSet; - }; - } -} + private: + PartGroupSet myPartGroupSet; + ScorePartPtr myScorePart; + PartGroupOrScorePartSet myPartGroupOrScorePartSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartName.cpp b/Sourcecode/private/mx/core/elements/PartName.cpp index f12b24bce..2beb52fa7 100644 --- a/Sourcecode/private/mx/core/elements/PartName.cpp +++ b/Sourcecode/private/mx/core/elements/PartName.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - PartName::PartName() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PartName::PartName( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PartName::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PartName::hasContents() const - { - return true; - } - - - std::ostream& PartName::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PartName::streamName( std::ostream& os ) const - { - os << "part-name"; - return os; - } - - - std::ostream& PartName::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +PartName::PartName() : myValue(), myAttributes(std::make_shared()) +{ +} +PartName::PartName(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - PartNameAttributesPtr PartName::getAttributes() const - { - return myAttributes; - } +bool PartName::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool PartName::hasContents() const +{ + return true; +} - void PartName::setAttributes( const PartNameAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &PartName::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &PartName::streamName(std::ostream &os) const +{ + os << "part-name"; + return os; +} - XsString PartName::getValue() const - { - return myValue; - } +std::ostream &PartName::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PartNameAttributesPtr PartName::getAttributes() const +{ + return myAttributes; +} - void PartName::setValue( const XsString& value ) - { - myValue = value; - } +void PartName::setAttributes(const PartNameAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString PartName::getValue() const +{ + return myValue; +} - bool PartName::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void PartName::setValue(const XsString &value) +{ + myValue = value; +} - } +bool PartName::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartName.h b/Sourcecode/private/mx/core/elements/PartName.h index 7ed462c35..d8fdd23b2 100644 --- a/Sourcecode/private/mx/core/elements/PartName.h +++ b/Sourcecode/private/mx/core/elements/PartName.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/PartNameAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartNameAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartName ) - - inline PartNamePtr makePartName() { return std::make_shared(); } - inline PartNamePtr makePartName( const XsString& value ) { return std::make_shared( value ); } - inline PartNamePtr makePartName( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PartName : public ElementInterface - { - public: - PartName(); - PartName( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartNameAttributesPtr getAttributes() const; - void setAttributes( const PartNameAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PartNameAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PartNameAttributes) +MX_FORWARD_DECLARE_ELEMENT(PartName) + +inline PartNamePtr makePartName() +{ + return std::make_shared(); +} + +inline PartNamePtr makePartName(const XsString &value) +{ + return std::make_shared(value); } + +inline PartNamePtr makePartName(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class PartName : public ElementInterface +{ + public: + PartName(); + PartName(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PartNameAttributesPtr getAttributes() const; + void setAttributes(const PartNameAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + PartNameAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartNameAttributes.cpp b/Sourcecode/private/mx/core/elements/PartNameAttributes.cpp index 2bb37ae65..e10c1db00 100644 --- a/Sourcecode/private/mx/core/elements/PartNameAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PartNameAttributes.cpp @@ -8,96 +8,101 @@ namespace mx { - namespace core +namespace core +{ +PartNameAttributes::PartNameAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), color(), printObject(), + justify(LeftCenterRight::center), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasColor(false), hasPrintObject(false), hasJustify(false) +{ +} + +bool PartNameAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPrintObject || hasJustify; +} + +std::ostream &PartNameAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PartNameAttributes::PartNameAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject() - ,justify( LeftCenterRight::center ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - ,hasJustify( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, justify, "justify", hasJustify); + } + return os; +} + +bool PartNameAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PartNameAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PartNameAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject || - hasJustify; + continue; } - - - std::ostream& PartNameAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, justify, "justify", hasJustify ); - } - return os; + continue; } - - - bool PartNameAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "PartNameAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartNameAttributes.h b/Sourcecode/private/mx/core/elements/PartNameAttributes.h index 4e36da8d5..131b4568d 100644 --- a/Sourcecode/private/mx/core/elements/PartNameAttributes.h +++ b/Sourcecode/private/mx/core/elements/PartNameAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,42 +18,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PartNameAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PartNameAttributes) - struct PartNameAttributes : public AttributesInterface - { - public: - PartNameAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - LeftCenterRight justify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; - bool hasJustify; +struct PartNameAttributes : public AttributesInterface +{ + public: + PartNameAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + YesNo printObject; + LeftCenterRight justify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPrintObject; + bool hasJustify; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplay.cpp b/Sourcecode/private/mx/core/elements/PartNameDisplay.cpp index 33c73fca9..883f550a7 100644 --- a/Sourcecode/private/mx/core/elements/PartNameDisplay.cpp +++ b/Sourcecode/private/mx/core/elements/PartNameDisplay.cpp @@ -9,135 +9,122 @@ namespace mx { - namespace core - { - PartNameDisplay::PartNameDisplay() - :myAttributes( std::make_shared() ) - ,myDisplayTextOrAccidentalTextSet() - {} - - - bool PartNameDisplay::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PartNameDisplay::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PartNameDisplay::streamName( std::ostream& os ) const - { - os << "part-name-display"; - return os; - } - - - bool PartNameDisplay::hasContents() const - { - return true; - } - - - std::ostream& PartNameDisplay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myDisplayTextOrAccidentalTextSet.size() > 0 ) - { - for ( auto x : myDisplayTextOrAccidentalTextSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - +namespace core +{ +PartNameDisplay::PartNameDisplay() + : myAttributes(std::make_shared()), myDisplayTextOrAccidentalTextSet() +{ +} - PartNameDisplayAttributesPtr PartNameDisplay::getAttributes() const - { - return myAttributes; - } +bool PartNameDisplay::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &PartNameDisplay::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void PartNameDisplay::setAttributes( const PartNameDisplayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &PartNameDisplay::streamName(std::ostream &os) const +{ + os << "part-name-display"; + return os; +} +bool PartNameDisplay::hasContents() const +{ + return true; +} - const DisplayTextOrAccidentalTextSet& PartNameDisplay::getDisplayTextOrAccidentalText() const +std::ostream &PartNameDisplay::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myDisplayTextOrAccidentalTextSet.size() > 0) + { + for (auto x : myDisplayTextOrAccidentalTextSet) { - return myDisplayTextOrAccidentalTextSet; + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); } + isOneLineOnly = false; + os << std::endl; + } + else + { + isOneLineOnly = true; + } + return os; +} +PartNameDisplayAttributesPtr PartNameDisplay::getAttributes() const +{ + return myAttributes; +} - void PartNameDisplay::addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ) - { - if ( value ) - { - myDisplayTextOrAccidentalTextSet.push_back( value ); - } - } - +void PartNameDisplay::setAttributes(const PartNameDisplayAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - void PartNameDisplay::removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - myDisplayTextOrAccidentalTextSet.erase( setIterator ); - } - } +const DisplayTextOrAccidentalTextSet &PartNameDisplay::getDisplayTextOrAccidentalText() const +{ + return myDisplayTextOrAccidentalTextSet; +} +void PartNameDisplay::addDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextPtr &value) +{ + if (value) + { + myDisplayTextOrAccidentalTextSet.push_back(value); + } +} - void PartNameDisplay::clearDisplayTextOrAccidentalTextSet() - { - myDisplayTextOrAccidentalTextSet.clear(); - } +void PartNameDisplay::removeDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextSetIterConst &setIterator) +{ + if (setIterator != myDisplayTextOrAccidentalTextSet.cend()) + { + myDisplayTextOrAccidentalTextSet.erase(setIterator); + } +} +void PartNameDisplay::clearDisplayTextOrAccidentalTextSet() +{ + myDisplayTextOrAccidentalTextSet.clear(); +} - DisplayTextOrAccidentalTextPtr PartNameDisplay::getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - return *setIterator; - } - return makeDisplayTextOrAccidentalText(); - } - - - const DisplayTextOrAccidentalTextSet& PartNameDisplay::getDisplayTextOrAccidentalTextSet() const - { - return myDisplayTextOrAccidentalTextSet; - } +DisplayTextOrAccidentalTextPtr PartNameDisplay::getDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) const +{ + if (setIterator != myDisplayTextOrAccidentalTextSet.cend()) + { + return *setIterator; + } + return makeDisplayTextOrAccidentalText(); +} +const DisplayTextOrAccidentalTextSet &PartNameDisplay::getDisplayTextOrAccidentalTextSet() const +{ + return myDisplayTextOrAccidentalTextSet; +} - bool PartNameDisplay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeDisplayTextOrAccidentalText(); - isSuccess &= item->fromXElement( message, *it ); - myDisplayTextOrAccidentalTextSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } +bool PartNameDisplay::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + auto item = makeDisplayTextOrAccidentalText(); + isSuccess &= item->fromXElement(message, *it); + myDisplayTextOrAccidentalTextSet.push_back(item); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplay.h b/Sourcecode/private/mx/core/elements/PartNameDisplay.h index 4fdc20555..3dd52cb0e 100644 --- a/Sourcecode/private/mx/core/elements/PartNameDisplay.h +++ b/Sourcecode/private/mx/core/elements/PartNameDisplay.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PartNameDisplayAttributes.h" #include @@ -14,42 +14,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartNameDisplayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( PartNameDisplay ) - - inline PartNameDisplayPtr makePartNameDisplay() { return std::make_shared(); } - - class PartNameDisplay : public ElementInterface - { - public: - PartNameDisplay(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartNameDisplayAttributesPtr getAttributes() const; - void setAttributes( const PartNameDisplayAttributesPtr& value ); - - /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalText() const; - void addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ); - void removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ); - void clearDisplayTextOrAccidentalTextSet(); - DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const; - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalTextSet() const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartNameDisplayAttributesPtr myAttributes; - DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PartNameDisplayAttributes) +MX_FORWARD_DECLARE_ELEMENT(DisplayTextOrAccidentalText) +MX_FORWARD_DECLARE_ELEMENT(PartNameDisplay) + +inline PartNameDisplayPtr makePartNameDisplay() +{ + return std::make_shared(); } + +class PartNameDisplay : public ElementInterface +{ + public: + PartNameDisplay(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PartNameDisplayAttributesPtr getAttributes() const; + void setAttributes(const PartNameDisplayAttributesPtr &value); + + /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ + const DisplayTextOrAccidentalTextSet &getDisplayTextOrAccidentalText() const; + void addDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextPtr &value); + void removeDisplayTextOrAccidentalText(const DisplayTextOrAccidentalTextSetIterConst &setIterator); + void clearDisplayTextOrAccidentalTextSet(); + DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( + const DisplayTextOrAccidentalTextSetIterConst &setIterator) const; + const DisplayTextOrAccidentalTextSet &getDisplayTextOrAccidentalTextSet() const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PartNameDisplayAttributesPtr myAttributes; + DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp b/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp index 0b1b412b3..ab36f84a5 100644 --- a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - PartNameDisplayAttributes::PartNameDisplayAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - +namespace core +{ +PartNameDisplayAttributes::PartNameDisplayAttributes() : printObject(YesNo::no), hasPrintObject(false) +{ +} - bool PartNameDisplayAttributes::hasValues() const - { - return hasPrintObject; - } +bool PartNameDisplayAttributes::hasValues() const +{ + return hasPrintObject; +} +std::ostream &PartNameDisplayAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, printObject, "print-object", hasPrintObject); + } + return os; +} - std::ostream& PartNameDisplayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } +bool PartNameDisplayAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PartNameDisplayAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PartNameDisplayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - const char* const className = "PartNameDisplayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h b/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h index f511c9088..64fa6d3dd 100644 --- a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h +++ b/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PartNameDisplayAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PartNameDisplayAttributes) - struct PartNameDisplayAttributes : public AttributesInterface - { - public: - PartNameDisplayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; +struct PartNameDisplayAttributes : public AttributesInterface +{ + public: + PartNameDisplayAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + bool hasPrintObject; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartSymbol.cpp b/Sourcecode/private/mx/core/elements/PartSymbol.cpp index 82460e404..943fa67e5 100644 --- a/Sourcecode/private/mx/core/elements/PartSymbol.cpp +++ b/Sourcecode/private/mx/core/elements/PartSymbol.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - PartSymbol::PartSymbol() - :myValue( GroupSymbolValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - PartSymbol::PartSymbol( const GroupSymbolValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PartSymbol::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PartSymbol::hasContents() const - { - return true; - } - - - std::ostream& PartSymbol::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PartSymbol::streamName( std::ostream& os ) const - { - os << "part-symbol"; - return os; - } - - - std::ostream& PartSymbol::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +PartSymbol::PartSymbol() : myValue(GroupSymbolValue::none), myAttributes(std::make_shared()) +{ +} +PartSymbol::PartSymbol(const GroupSymbolValue &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - PartSymbolAttributesPtr PartSymbol::getAttributes() const - { - return myAttributes; - } +bool PartSymbol::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool PartSymbol::hasContents() const +{ + return true; +} - void PartSymbol::setAttributes( const PartSymbolAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &PartSymbol::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &PartSymbol::streamName(std::ostream &os) const +{ + os << "part-symbol"; + return os; +} - GroupSymbolValue PartSymbol::getValue() const - { - return myValue; - } +std::ostream &PartSymbol::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PartSymbolAttributesPtr PartSymbol::getAttributes() const +{ + return myAttributes; +} - void PartSymbol::setValue( const GroupSymbolValue& value ) - { - myValue = value; - } +void PartSymbol::setAttributes(const PartSymbolAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +GroupSymbolValue PartSymbol::getValue() const +{ + return myValue; +} - bool PartSymbol::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseGroupSymbolValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void PartSymbol::setValue(const GroupSymbolValue &value) +{ + myValue = value; +} - } +bool PartSymbol::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseGroupSymbolValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartSymbol.h b/Sourcecode/private/mx/core/elements/PartSymbol.h index 9be5f0197..7952609ad 100644 --- a/Sourcecode/private/mx/core/elements/PartSymbol.h +++ b/Sourcecode/private/mx/core/elements/PartSymbol.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PartSymbolAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartSymbolAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartSymbol ) - - inline PartSymbolPtr makePartSymbol() { return std::make_shared(); } - inline PartSymbolPtr makePartSymbol( const GroupSymbolValue& value ) { return std::make_shared( value ); } - inline PartSymbolPtr makePartSymbol( GroupSymbolValue&& value ) { return std::make_shared( std::move( value ) ); } - - class PartSymbol : public ElementInterface - { - public: - PartSymbol(); - PartSymbol( const GroupSymbolValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartSymbolAttributesPtr getAttributes() const; - void setAttributes( const PartSymbolAttributesPtr& attributes ); - GroupSymbolValue getValue() const; - void setValue( const GroupSymbolValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupSymbolValue myValue; - PartSymbolAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PartSymbolAttributes) +MX_FORWARD_DECLARE_ELEMENT(PartSymbol) + +inline PartSymbolPtr makePartSymbol() +{ + return std::make_shared(); +} + +inline PartSymbolPtr makePartSymbol(const GroupSymbolValue &value) +{ + return std::make_shared(value); } + +inline PartSymbolPtr makePartSymbol(GroupSymbolValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class PartSymbol : public ElementInterface +{ + public: + PartSymbol(); + PartSymbol(const GroupSymbolValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PartSymbolAttributesPtr getAttributes() const; + void setAttributes(const PartSymbolAttributesPtr &attributes); + GroupSymbolValue getValue() const; + void setValue(const GroupSymbolValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + GroupSymbolValue myValue; + PartSymbolAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp b/Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp index aaf9a2279..1b848d80d 100644 --- a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp @@ -8,71 +8,71 @@ namespace mx { - namespace core +namespace core +{ +PartSymbolAttributes::PartSymbolAttributes() + : topStaff(), bottomStaff(), defaultX(), defaultY(), relativeX(), relativeY(), hasTopStaff(false), + hasBottomStaff(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false) +{ +} + +bool PartSymbolAttributes::hasValues() const +{ + return hasTopStaff || hasBottomStaff || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY; +} + +std::ostream &PartSymbolAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PartSymbolAttributes::PartSymbolAttributes() - :topStaff() - ,bottomStaff() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasTopStaff( false ) - ,hasBottomStaff( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} + streamAttribute(os, topStaff, "top-staff", hasTopStaff); + streamAttribute(os, bottomStaff, "bottom-staff", hasBottomStaff); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + } + return os; +} +bool PartSymbolAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PartSymbolAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PartSymbolAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, topStaff, hasTopStaff, "top-staff")) { - return hasTopStaff || - hasBottomStaff || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; + continue; } - - - std::ostream& PartSymbolAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, bottomStaff, hasBottomStaff, "bottom-staff")) { - if ( hasValues() ) - { - streamAttribute( os, topStaff, "top-staff", hasTopStaff ); - streamAttribute( os, bottomStaff, "bottom-staff", hasBottomStaff ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; + continue; } - - - bool PartSymbolAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - const char* const className = "PartSymbolAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, topStaff, hasTopStaff, "top-staff" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bottomStaff, hasBottomStaff, "bottom-staff" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.h b/Sourcecode/private/mx/core/elements/PartSymbolAttributes.h index f150554ca..c10dcc10c 100644 --- a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.h +++ b/Sourcecode/private/mx/core/elements/PartSymbolAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -15,32 +15,32 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PartSymbolAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PartSymbolAttributes) - struct PartSymbolAttributes : public AttributesInterface - { - public: - PartSymbolAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber topStaff; - StaffNumber bottomStaff; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - bool hasTopStaff; - bool hasBottomStaff; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; +struct PartSymbolAttributes : public AttributesInterface +{ + public: + PartSymbolAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StaffNumber topStaff; + StaffNumber bottomStaff; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + bool hasTopStaff; + bool hasBottomStaff; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp b/Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp index 381a58265..b9d2bd0bc 100644 --- a/Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp +++ b/Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp @@ -4,8 +4,6 @@ #include "mx/core/elements/PartwiseMeasure.h" #include "mx/core/FromXElement.h" -#include "mx/core/elements/MusicDataGroup.h" -#include "mx/core/elements/MusicDataChoice.h" #include "mx/core/elements/Backup.h" #include "mx/core/elements/Barline.h" #include "mx/core/elements/Bookmark.h" @@ -15,6 +13,8 @@ #include "mx/core/elements/Grouping.h" #include "mx/core/elements/Harmony.h" #include "mx/core/elements/Link.h" +#include "mx/core/elements/MusicDataChoice.h" +#include "mx/core/elements/MusicDataGroup.h" #include "mx/core/elements/Note.h" #include "mx/core/elements/Print.h" #include "mx/core/elements/Properties.h" @@ -23,202 +23,191 @@ namespace mx { - namespace core +namespace core +{ +PartwiseMeasure::PartwiseMeasure() : myAttributes(nullptr), myMusicDataGroup(makeMusicDataGroup()) +{ +} + +bool PartwiseMeasure::hasAttributes() const +{ + return getAttributes()->hasValues(); +} + +std::ostream &PartwiseMeasure::streamAttributes(std::ostream &os) const +{ + return getAttributes()->toStream(os); +} + +std::ostream &PartwiseMeasure::streamName(std::ostream &os) const +{ + os << "measure"; + return os; +} + +bool PartwiseMeasure::hasContents() const +{ + return myMusicDataGroup->hasContents(); +} + +std::ostream &PartwiseMeasure::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) { - PartwiseMeasure::PartwiseMeasure() - :myAttributes( nullptr ) - ,myMusicDataGroup( makeMusicDataGroup() ) - {} + os << std::endl; + myMusicDataGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +MeasureAttributesPtr PartwiseMeasure::getAttributes() const +{ + MX_LOCK + MX_JIT_ALLOCATE_ATTRIBUTES(MeasureAttributes); + return myAttributes; +} - bool PartwiseMeasure::hasAttributes() const - { - return getAttributes()->hasValues(); - } +void PartwiseMeasure::setAttributes(const MeasureAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +MusicDataGroupPtr PartwiseMeasure::getMusicDataGroup() const +{ + return myMusicDataGroup; +} - std::ostream& PartwiseMeasure::streamAttributes( std::ostream& os ) const - { - return getAttributes()->toStream( os ); - } +void PartwiseMeasure::setMusicDataGroup(const MusicDataGroupPtr &value) +{ + if (value) + { + myMusicDataGroup = value; + } +} +bool PartwiseMeasure::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isFirstMusicDataChoiceAdded = false; + isSuccess &= getAttributes()->fromXElement(message, xelement); - std::ostream& PartwiseMeasure::streamName( std::ostream& os ) const - { - os << "measure"; - return os; - } + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); + auto choiceObject = makeMusicDataChoice(); + bool choiceObjectShouldBeAdded = true; - bool PartwiseMeasure::hasContents() const + if (elementName == "note") { - return myMusicDataGroup->hasContents(); + choiceObject->setChoice(MusicDataChoice::Choice::note); + isSuccess &= choiceObject->getNote()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; } - - - std::ostream& PartwiseMeasure::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const + else if (elementName == "backup") { - if ( hasContents() ) - { - os << std::endl; - myMusicDataGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; + choiceObject->setChoice(MusicDataChoice::Choice::backup); + isSuccess &= choiceObject->getBackup()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; } - - - MeasureAttributesPtr PartwiseMeasure::getAttributes() const + else if (elementName == "forward") { - MX_LOCK - MX_JIT_ALLOCATE_ATTRIBUTES( MeasureAttributes ); - return myAttributes; + choiceObject->setChoice(MusicDataChoice::Choice::forward); + isSuccess &= choiceObject->getForward()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; } - - - void PartwiseMeasure::setAttributes( const MeasureAttributesPtr& value ) + else if (elementName == "direction") { - if ( value ) - { - myAttributes = value; - } + choiceObject->setChoice(MusicDataChoice::Choice::direction); + isSuccess &= choiceObject->getDirection()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; } - - - MusicDataGroupPtr PartwiseMeasure::getMusicDataGroup() const + else if (elementName == "attributes") { - return myMusicDataGroup; + choiceObject->setChoice(MusicDataChoice::Choice::properties); + isSuccess &= choiceObject->getProperties()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else if (elementName == "harmony") + { + choiceObject->setChoice(MusicDataChoice::Choice::harmony); + isSuccess &= choiceObject->getHarmony()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else if (elementName == "figured-bass") + { + choiceObject->setChoice(MusicDataChoice::Choice::figuredBass); + isSuccess &= choiceObject->getFiguredBass()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else if (elementName == "print") + { + choiceObject->setChoice(MusicDataChoice::Choice::print); + isSuccess &= choiceObject->getPrint()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else if (elementName == "sound") + { + choiceObject->setChoice(MusicDataChoice::Choice::sound); + isSuccess &= choiceObject->getSound()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else if (elementName == "barline") + { + choiceObject->setChoice(MusicDataChoice::Choice::barline); + isSuccess &= choiceObject->getBarline()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else if (elementName == "grouping") + { + choiceObject->setChoice(MusicDataChoice::Choice::grouping); + isSuccess &= choiceObject->getGrouping()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else if (elementName == "link") + { + choiceObject->setChoice(MusicDataChoice::Choice::link); + isSuccess &= choiceObject->getLink()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else if (elementName == "bookmark") + { + choiceObject->setChoice(MusicDataChoice::Choice::bookmark); + isSuccess &= choiceObject->getBookmark()->fromXElement(message, *it); + MX_DEBUG_THROW_ON_PARSE_ISSUE; + } + else + { + choiceObjectShouldBeAdded = false; } - - void PartwiseMeasure::setMusicDataGroup( const MusicDataGroupPtr& value ) + if (choiceObjectShouldBeAdded) { - if ( value ) + if (!isFirstMusicDataChoiceAdded && myMusicDataGroup->getMusicDataChoiceSet().size() == 1) { - myMusicDataGroup = value; + myMusicDataGroup->addMusicDataChoice(choiceObject); + myMusicDataGroup->removeMusicDataChoice(myMusicDataGroup->getMusicDataChoiceSet().cbegin()); + isFirstMusicDataChoiceAdded = true; } - } - - - bool PartwiseMeasure::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstMusicDataChoiceAdded = false; - isSuccess &= getAttributes()->fromXElement( message, xelement ); - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + else { - const std::string elementName = it->getName(); - - auto choiceObject = makeMusicDataChoice(); - bool choiceObjectShouldBeAdded = true; - - if( elementName == "note" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::note ); - isSuccess &= choiceObject->getNote()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "backup" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::backup ); - isSuccess &= choiceObject->getBackup()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "forward" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::forward ); - isSuccess &= choiceObject->getForward()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "direction" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::direction ); - isSuccess &= choiceObject->getDirection()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "attributes" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::properties ); - isSuccess &= choiceObject->getProperties()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "harmony" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::harmony ); - isSuccess &= choiceObject->getHarmony()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "figured-bass" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::figuredBass ); - isSuccess &= choiceObject->getFiguredBass()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "print" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::print ); - isSuccess &= choiceObject->getPrint()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "sound" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::sound ); - isSuccess &= choiceObject->getSound()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "barline" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::barline ); - isSuccess &= choiceObject->getBarline()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "grouping" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::grouping ); - isSuccess &= choiceObject->getGrouping()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "link" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::link ); - isSuccess &= choiceObject->getLink()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "bookmark" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::bookmark ); - isSuccess &= choiceObject->getBookmark()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else - { - choiceObjectShouldBeAdded = false; - } - - if( choiceObjectShouldBeAdded ) - { - if( !isFirstMusicDataChoiceAdded && myMusicDataGroup->getMusicDataChoiceSet().size() == 1 ) - { - myMusicDataGroup->addMusicDataChoice( choiceObject ); - myMusicDataGroup->removeMusicDataChoice( myMusicDataGroup->getMusicDataChoiceSet().cbegin() ); - isFirstMusicDataChoiceAdded = true; - } - else - { - myMusicDataGroup->addMusicDataChoice( choiceObject ); - isFirstMusicDataChoiceAdded = true; - } - } + myMusicDataGroup->addMusicDataChoice(choiceObject); + isFirstMusicDataChoiceAdded = true; } - - MX_RETURN_IS_SUCCESS; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartwiseMeasure.h b/Sourcecode/private/mx/core/elements/PartwiseMeasure.h index 7e64dea6b..aae0a2cf1 100644 --- a/Sourcecode/private/mx/core/elements/PartwiseMeasure.h +++ b/Sourcecode/private/mx/core/elements/PartwiseMeasure.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/MeasureAttributes.h" #include @@ -14,39 +14,42 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MusicDataGroup ) - MX_FORWARD_DECLARE_ELEMENT( PartwiseMeasure ) - - inline PartwiseMeasurePtr makePartwiseMeasure() { return std::make_shared(); } - - class PartwiseMeasure : public ElementInterface - { - public: - PartwiseMeasure(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MeasureAttributesPtr getAttributes() const; - void setAttributes( const MeasureAttributesPtr& value ); - - /* _________ MusicDataGroup minOccurs = 1, maxOccurs = 1 _________ */ - MusicDataGroupPtr getMusicDataGroup() const; - void setMusicDataGroup( const MusicDataGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - mutable MeasureAttributesPtr myAttributes; - MusicDataGroupPtr myMusicDataGroup; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(MeasureAttributes) +MX_FORWARD_DECLARE_ELEMENT(MusicDataGroup) +MX_FORWARD_DECLARE_ELEMENT(PartwiseMeasure) + +inline PartwiseMeasurePtr makePartwiseMeasure() +{ + return std::make_shared(); } + +class PartwiseMeasure : public ElementInterface +{ + public: + PartwiseMeasure(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + MeasureAttributesPtr getAttributes() const; + void setAttributes(const MeasureAttributesPtr &value); + + /* _________ MusicDataGroup minOccurs = 1, maxOccurs = 1 _________ */ + MusicDataGroupPtr getMusicDataGroup() const; + void setMusicDataGroup(const MusicDataGroupPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MX_MUTEX + mutable MeasureAttributesPtr myAttributes; + MusicDataGroupPtr myMusicDataGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartwisePart.cpp b/Sourcecode/private/mx/core/elements/PartwisePart.cpp index 4030bad6e..5d1c06235 100644 --- a/Sourcecode/private/mx/core/elements/PartwisePart.cpp +++ b/Sourcecode/private/mx/core/elements/PartwisePart.cpp @@ -3,156 +3,142 @@ // Distributed under the MIT License #include "mx/core/elements/PartwisePart.h" -#include "mx/core/elements/PartwiseMeasure.h" #include "mx/core/FromXElement.h" +#include "mx/core/elements/PartwiseMeasure.h" #include namespace mx { - namespace core - { - PartwisePart::PartwisePart() - :myAttributes( std::make_shared() ) - ,myPartwiseMeasureSet() - { - myPartwiseMeasureSet.push_back( makePartwiseMeasure() ); - } - - - bool PartwisePart::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PartwisePart::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PartwisePart::streamName( std::ostream& os ) const - { - os << "part"; - return os; - } - +namespace core +{ +PartwisePart::PartwisePart() : myAttributes(std::make_shared()), myPartwiseMeasureSet() +{ + myPartwiseMeasureSet.push_back(makePartwiseMeasure()); +} - bool PartwisePart::hasContents() const - { - return true; - } +bool PartwisePart::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &PartwisePart::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - std::ostream& PartwisePart::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myPartwiseMeasureSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } +std::ostream &PartwisePart::streamName(std::ostream &os) const +{ + os << "part"; + return os; +} +bool PartwisePart::hasContents() const +{ + return true; +} - PartAttributesPtr PartwisePart::getAttributes() const +std::ostream &PartwisePart::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + for (auto x : myPartwiseMeasureSet) { - return myAttributes; + os << std::endl; + x->toStream(os, indentLevel + 1); } + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +PartAttributesPtr PartwisePart::getAttributes() const +{ + return myAttributes; +} - void PartwisePart::setAttributes( const PartAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - +void PartwisePart::setAttributes(const PartAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - const PartwiseMeasureSet& PartwisePart::getPartwiseMeasureSet() const - { - return myPartwiseMeasureSet; - } +const PartwiseMeasureSet &PartwisePart::getPartwiseMeasureSet() const +{ + return myPartwiseMeasureSet; +} +void PartwisePart::addPartwiseMeasure(const PartwiseMeasurePtr &value) +{ + if (value) + { + myPartwiseMeasureSet.push_back(value); + } +} - void PartwisePart::addPartwiseMeasure( const PartwiseMeasurePtr& value ) +void PartwisePart::removePartwiseMeasure(const PartwiseMeasureSetIterConst &value) +{ + if (value != myPartwiseMeasureSet.cend()) + { + if (myPartwiseMeasureSet.size() > 1) { - if ( value ) - { - myPartwiseMeasureSet.push_back( value ); - } + myPartwiseMeasureSet.erase(value); } + } +} +void PartwisePart::clearPartwiseMeasureSet() +{ + myPartwiseMeasureSet.clear(); + myPartwiseMeasureSet.push_back(makePartwiseMeasure()); +} - void PartwisePart::removePartwiseMeasure( const PartwiseMeasureSetIterConst& value ) - { - if ( value != myPartwiseMeasureSet.cend() ) - { - if ( myPartwiseMeasureSet.size() > 1 ) - { - myPartwiseMeasureSet.erase( value ); - } - } - } +PartwiseMeasurePtr PartwisePart::getPartwiseMeasure(const PartwiseMeasureSetIterConst &setIterator) const +{ + if (setIterator != myPartwiseMeasureSet.cend()) + { + return *setIterator; + } + return PartwiseMeasurePtr(); +} +bool PartwisePart::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isFirstAdded = false; - void PartwisePart::clearPartwiseMeasureSet() + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + if (it->getName() != "measure") { - myPartwiseMeasureSet.clear(); - myPartwiseMeasureSet.push_back( makePartwiseMeasure() ); + message << "PartwisePart: encountered an unexpected element '" << it->getName() << "'" << std::endl; + isSuccess = false; } - - - PartwiseMeasurePtr PartwisePart::getPartwiseMeasure( const PartwiseMeasureSetIterConst& setIterator ) const + else { - if( setIterator != myPartwiseMeasureSet.cend() ) + auto measure = makePartwiseMeasure(); + isSuccess &= measure->fromXElement(message, *it); + if (!isFirstAdded && myPartwiseMeasureSet.size() == 1) { - return *setIterator; + *myPartwiseMeasureSet.begin() = measure; + isFirstAdded = true; } - return PartwiseMeasurePtr(); - } - - bool PartwisePart::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isFirstAdded = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + else { - if( it->getName() != "measure" ) - { - message << "PartwisePart: encountered an unexpected element '" << it->getName() << "'" << std::endl; - isSuccess = false; - } - else - { - auto measure = makePartwiseMeasure(); - isSuccess &= measure->fromXElement( message, *it ); - if( !isFirstAdded && myPartwiseMeasureSet.size() == 1 ) - { - *myPartwiseMeasureSet.begin() = measure; - isFirstAdded = true; - } - else - { - myPartwiseMeasureSet.push_back( measure ); - isFirstAdded = true; - } - } + myPartwiseMeasureSet.push_back(measure); + isFirstAdded = true; } - - MX_RETURN_IS_SUCCESS; } } + + MX_RETURN_IS_SUCCESS; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PartwisePart.h b/Sourcecode/private/mx/core/elements/PartwisePart.h index 5f07ea5d6..3c05d0b67 100644 --- a/Sourcecode/private/mx/core/elements/PartwisePart.h +++ b/Sourcecode/private/mx/core/elements/PartwisePart.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PartAttributes.h" #include @@ -14,41 +14,44 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartwiseMeasure ) - MX_FORWARD_DECLARE_ELEMENT( PartwisePart ) - - inline PartwisePartPtr makePartwisePart() { return std::make_shared(); } - - class PartwisePart : public ElementInterface - { - public: - PartwisePart(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartAttributesPtr getAttributes() const; - void setAttributes( const PartAttributesPtr& value ); - - /* _________ PartwiseMeasure minOccurs = 0, maxOccurs = unbounded _________ */ - const PartwiseMeasureSet& getPartwiseMeasureSet() const; - void addPartwiseMeasure( const PartwiseMeasurePtr& value ); - void removePartwiseMeasure( const PartwiseMeasureSetIterConst& value ); - void clearPartwiseMeasureSet(); - PartwiseMeasurePtr getPartwiseMeasure( const PartwiseMeasureSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartAttributesPtr myAttributes; - PartwiseMeasureSet myPartwiseMeasureSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PartAttributes) +MX_FORWARD_DECLARE_ELEMENT(PartwiseMeasure) +MX_FORWARD_DECLARE_ELEMENT(PartwisePart) + +inline PartwisePartPtr makePartwisePart() +{ + return std::make_shared(); } + +class PartwisePart : public ElementInterface +{ + public: + PartwisePart(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PartAttributesPtr getAttributes() const; + void setAttributes(const PartAttributesPtr &value); + + /* _________ PartwiseMeasure minOccurs = 0, maxOccurs = unbounded _________ */ + const PartwiseMeasureSet &getPartwiseMeasureSet() const; + void addPartwiseMeasure(const PartwiseMeasurePtr &value); + void removePartwiseMeasure(const PartwiseMeasureSetIterConst &value); + void clearPartwiseMeasureSet(); + PartwiseMeasurePtr getPartwiseMeasure(const PartwiseMeasureSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PartAttributesPtr myAttributes; + PartwiseMeasureSet myPartwiseMeasureSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pedal.cpp b/Sourcecode/private/mx/core/elements/Pedal.cpp index cbb91ecf5..855f19e47 100644 --- a/Sourcecode/private/mx/core/elements/Pedal.cpp +++ b/Sourcecode/private/mx/core/elements/Pedal.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Pedal::Pedal() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Pedal::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Pedal::hasContents() const { return false; } - std::ostream& Pedal::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Pedal::streamName( std::ostream& os ) const { os << "pedal"; return os; } - std::ostream& Pedal::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Pedal::Pedal() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Pedal::hasAttributes() const +{ + return myAttributes->hasValues(); +} - PedalAttributesPtr Pedal::getAttributes() const - { - return myAttributes; - } +bool Pedal::hasContents() const +{ + return false; +} +std::ostream &Pedal::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Pedal::setAttributes( const PedalAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Pedal::streamName(std::ostream &os) const +{ + os << "pedal"; + return os; +} +std::ostream &Pedal::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Pedal::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +PedalAttributesPtr Pedal::getAttributes() const +{ + return myAttributes; +} +void Pedal::setAttributes(const PedalAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Pedal::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pedal.h b/Sourcecode/private/mx/core/elements/Pedal.h index 6e784913f..a3462e5d7 100644 --- a/Sourcecode/private/mx/core/elements/Pedal.h +++ b/Sourcecode/private/mx/core/elements/Pedal.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PedalAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PedalAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Pedal ) - - inline PedalPtr makePedal() { return std::make_shared(); } - - class Pedal : public ElementInterface - { - public: - Pedal(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PedalAttributesPtr getAttributes() const; - void setAttributes( const PedalAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PedalAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PedalAttributes) +MX_FORWARD_DECLARE_ELEMENT(Pedal) + +inline PedalPtr makePedal() +{ + return std::make_shared(); } + +class Pedal : public ElementInterface +{ + public: + Pedal(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PedalAttributesPtr getAttributes() const; + void setAttributes(const PedalAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PedalAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PedalAlter.cpp b/Sourcecode/private/mx/core/elements/PedalAlter.cpp index 1bfb939ec..54d3257ad 100644 --- a/Sourcecode/private/mx/core/elements/PedalAlter.cpp +++ b/Sourcecode/private/mx/core/elements/PedalAlter.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - PedalAlter::PedalAlter() - :myValue() - {} - - - PedalAlter::PedalAlter( const Semitones& value ) - :myValue( value ) - {} - - - bool PedalAlter::hasAttributes() const - { - return false; - } - - - bool PedalAlter::hasContents() const - { - return true; - } - - - std::ostream& PedalAlter::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PedalAlter::streamName( std::ostream& os ) const - { - os << "pedal-alter"; - return os; - } +namespace core +{ +PedalAlter::PedalAlter() : myValue() +{ +} +PedalAlter::PedalAlter(const Semitones &value) : myValue(value) +{ +} - std::ostream& PedalAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool PedalAlter::hasAttributes() const +{ + return false; +} +bool PedalAlter::hasContents() const +{ + return true; +} - Semitones PedalAlter::getValue() const - { - return myValue; - } +std::ostream &PedalAlter::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &PedalAlter::streamName(std::ostream &os) const +{ + os << "pedal-alter"; + return os; +} - void PedalAlter::setValue( const Semitones& value ) - { - myValue = value; - } +std::ostream &PedalAlter::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +Semitones PedalAlter::getValue() const +{ + return myValue; +} - bool PedalAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void PedalAlter::setValue(const Semitones &value) +{ + myValue = value; +} - } +bool PedalAlter::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PedalAlter.h b/Sourcecode/private/mx/core/elements/PedalAlter.h index a97c38420..0233f00d6 100644 --- a/Sourcecode/private/mx/core/elements/PedalAlter.h +++ b/Sourcecode/private/mx/core/elements/PedalAlter.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PedalAlter ) - - inline PedalAlterPtr makePedalAlter() { return std::make_shared(); } - inline PedalAlterPtr makePedalAlter( const Semitones& value ) { return std::make_shared( value ); } - inline PedalAlterPtr makePedalAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class PedalAlter : public ElementInterface - { - public: - PedalAlter(); - PedalAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PedalAlter) + +inline PedalAlterPtr makePedalAlter() +{ + return std::make_shared(); } + +inline PedalAlterPtr makePedalAlter(const Semitones &value) +{ + return std::make_shared(value); +} + +inline PedalAlterPtr makePedalAlter(Semitones &&value) +{ + return std::make_shared(std::move(value)); +} + +class PedalAlter : public ElementInterface +{ + public: + PedalAlter(); + PedalAlter(const Semitones &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + Semitones getValue() const; + void setValue(const Semitones &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Semitones myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PedalAttributes.cpp b/Sourcecode/private/mx/core/elements/PedalAttributes.cpp index ae1602451..31fbc57e6 100644 --- a/Sourcecode/private/mx/core/elements/PedalAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PedalAttributes.cpp @@ -8,107 +8,113 @@ namespace mx { - namespace core +namespace core +{ +PedalAttributes::PedalAttributes() + : type(StartStopChangeContinue::start), line(YesNo::no), sign(YesNo::no), defaultX(), defaultY(), relativeX(), + relativeY(), fontFamily(), fontStyle(FontStyle::normal), fontSize(CssFontSize::medium), + fontWeight(FontWeight::normal), halign(LeftCenterRight::center), hasType(true), hasLine(false), hasSign(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasHalign(false) +{ +} + +bool PedalAttributes::hasValues() const +{ + return hasType || hasLine || hasSign || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || + hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasHalign; +} + +std::ostream &PedalAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PedalAttributes::PedalAttributes() - :type( StartStopChangeContinue::start ) - ,line( YesNo::no ) - ,sign( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,halign( LeftCenterRight::center ) - ,hasType( true ) - ,hasLine( false ) - ,hasSign( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, line, "line", hasLine); + streamAttribute(os, sign, "sign", hasSign); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + } + return os; +} +bool PedalAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PedalAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PedalAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopChangeContinue)) { - return hasType || - hasLine || - hasSign || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; + continue; } - - - std::ostream& PedalAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, line, hasLine, "line", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, line, "line", hasLine ); - streamAttribute( os, sign, "sign", hasSign ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; + continue; } - - - bool PedalAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, sign, hasSign, "sign", &parseYesNo)) { - const char* const className = "PedalAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopChangeContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, line, hasLine, "line", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, sign, hasSign, "sign", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PedalAttributes.h b/Sourcecode/private/mx/core/elements/PedalAttributes.h index ceb555974..7c4582c73 100644 --- a/Sourcecode/private/mx/core/elements/PedalAttributes.h +++ b/Sourcecode/private/mx/core/elements/PedalAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,44 +17,44 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PedalAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PedalAttributes) - struct PedalAttributes : public AttributesInterface - { - public: - PedalAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopChangeContinue type; - YesNo line; - YesNo sign; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - const bool hasType; - bool hasLine; - bool hasSign; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; +struct PedalAttributes : public AttributesInterface +{ + public: + PedalAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStopChangeContinue type; + YesNo line; + YesNo sign; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + const bool hasType; + bool hasLine; + bool hasSign; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PedalStep.cpp b/Sourcecode/private/mx/core/elements/PedalStep.cpp index b88562616..3d589c6c1 100644 --- a/Sourcecode/private/mx/core/elements/PedalStep.cpp +++ b/Sourcecode/private/mx/core/elements/PedalStep.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - PedalStep::PedalStep() - :myValue( StepEnum::a ) - {} - - - PedalStep::PedalStep( const StepEnum& value ) - :myValue( value ) - {} - - - bool PedalStep::hasAttributes() const - { - return false; - } - - - bool PedalStep::hasContents() const - { - return true; - } - - - std::ostream& PedalStep::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PedalStep::streamName( std::ostream& os ) const - { - os << "pedal-step"; - return os; - } +namespace core +{ +PedalStep::PedalStep() : myValue(StepEnum::a) +{ +} +PedalStep::PedalStep(const StepEnum &value) : myValue(value) +{ +} - std::ostream& PedalStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool PedalStep::hasAttributes() const +{ + return false; +} +bool PedalStep::hasContents() const +{ + return true; +} - StepEnum PedalStep::getValue() const - { - return myValue; - } +std::ostream &PedalStep::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &PedalStep::streamName(std::ostream &os) const +{ + os << "pedal-step"; + return os; +} - void PedalStep::setValue( const StepEnum& value ) - { - myValue = value; - } +std::ostream &PedalStep::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StepEnum PedalStep::getValue() const +{ + return myValue; +} - bool PedalStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStepEnum( xelement.getValue() ); - return true; - } +void PedalStep::setValue(const StepEnum &value) +{ + myValue = value; +} - } +bool PedalStep::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseStepEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PedalStep.h b/Sourcecode/private/mx/core/elements/PedalStep.h index 998b15337..b24d88033 100644 --- a/Sourcecode/private/mx/core/elements/PedalStep.h +++ b/Sourcecode/private/mx/core/elements/PedalStep.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PedalStep ) - - inline PedalStepPtr makePedalStep() { return std::make_shared(); } - inline PedalStepPtr makePedalStep( const StepEnum& value ) { return std::make_shared( value ); } - inline PedalStepPtr makePedalStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class PedalStep : public ElementInterface - { - public: - PedalStep(); - PedalStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PedalStep) + +inline PedalStepPtr makePedalStep() +{ + return std::make_shared(); +} + +inline PedalStepPtr makePedalStep(const StepEnum &value) +{ + return std::make_shared(value); } + +inline PedalStepPtr makePedalStep(StepEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class PedalStep : public ElementInterface +{ + public: + PedalStep(); + PedalStep(const StepEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StepEnum getValue() const; + void setValue(const StepEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StepEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PedalTuning.cpp b/Sourcecode/private/mx/core/elements/PedalTuning.cpp index f6632aeca..78ff5a963 100644 --- a/Sourcecode/private/mx/core/elements/PedalTuning.cpp +++ b/Sourcecode/private/mx/core/elements/PedalTuning.cpp @@ -10,104 +10,99 @@ namespace mx { - namespace core - { - PedalTuning::PedalTuning() - :myPedalStep( makePedalStep() ) - ,myPedalAlter( makePedalAlter() ) - {} - - - bool PedalTuning::hasAttributes() const - { - return false; - } - - - std::ostream& PedalTuning::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PedalTuning::streamName( std::ostream& os ) const - { - os << "pedal-tuning"; - return os; - } - +namespace core +{ +PedalTuning::PedalTuning() : myPedalStep(makePedalStep()), myPedalAlter(makePedalAlter()) +{ +} - bool PedalTuning::hasContents() const - { - return true; - } +bool PedalTuning::hasAttributes() const +{ + return false; +} +std::ostream &PedalTuning::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& PedalTuning::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myPedalStep->toStream( os, indentLevel+1 ); - os << std::endl; - myPedalAlter->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } +std::ostream &PedalTuning::streamName(std::ostream &os) const +{ + os << "pedal-tuning"; + return os; +} +bool PedalTuning::hasContents() const +{ + return true; +} - PedalStepPtr PedalTuning::getPedalStep() const - { - return myPedalStep; - } +std::ostream &PedalTuning::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myPedalStep->toStream(os, indentLevel + 1); + os << std::endl; + myPedalAlter->toStream(os, indentLevel + 1); + os << std::endl; + return os; +} +PedalStepPtr PedalTuning::getPedalStep() const +{ + return myPedalStep; +} - void PedalTuning::setPedalStep( const PedalStepPtr& value ) - { - if( value ) - { - myPedalStep = value; - } - } +void PedalTuning::setPedalStep(const PedalStepPtr &value) +{ + if (value) + { + myPedalStep = value; + } +} +PedalAlterPtr PedalTuning::getPedalAlter() const +{ + return myPedalAlter; +} - PedalAlterPtr PedalTuning::getPedalAlter() const - { - return myPedalAlter; - } +void PedalTuning::setPedalAlter(const PedalAlterPtr &value) +{ + if (value) + { + myPedalAlter = value; + } +} +bool PedalTuning::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isPedalStepFound = false; + bool isPedalAlterFound = false; - void PedalTuning::setPedalAlter( const PedalAlterPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myPedalStep, isPedalStepFound)) { - if( value ) - { - myPedalAlter = value; - } + continue; } - - - bool PedalTuning::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myPedalAlter, isPedalAlterFound)) { - bool isSuccess = true; - bool isPedalStepFound = false; - bool isPedalAlterFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myPedalStep, isPedalStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPedalAlter, isPedalAlterFound ) ) { continue; } - } - - if( !isPedalStepFound ) - { - message << "PedalTuning: '" << myPedalStep->getElementName() << "' is required but was not found" << std::endl; - } - if( !isPedalAlterFound ) - { - message << "PedalTuning: '" << myPedalAlter->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isPedalStepFound) + { + message << "PedalTuning: '" << myPedalStep->getElementName() << "' is required but was not found" << std::endl; } + if (!isPedalAlterFound) + { + message << "PedalTuning: '" << myPedalAlter->getElementName() << "' is required but was not found" << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PedalTuning.h b/Sourcecode/private/mx/core/elements/PedalTuning.h index 9c0b4ccff..3286edc0e 100644 --- a/Sourcecode/private/mx/core/elements/PedalTuning.h +++ b/Sourcecode/private/mx/core/elements/PedalTuning.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,40 +13,43 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PedalAlter ) - MX_FORWARD_DECLARE_ELEMENT( PedalStep ) - MX_FORWARD_DECLARE_ELEMENT( PedalTuning ) - - inline PedalTuningPtr makePedalTuning() { return std::make_shared(); } - - class PedalTuning : public ElementInterface - { - public: - PedalTuning(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ PedalStep minOccurs = 1, maxOccurs = 1 _________ */ - PedalStepPtr getPedalStep() const; - void setPedalStep( const PedalStepPtr& value ); - - /* _________ PedalAlter minOccurs = 1, maxOccurs = 1 _________ */ - PedalAlterPtr getPedalAlter() const; - void setPedalAlter( const PedalAlterPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PedalStepPtr myPedalStep; - PedalAlterPtr myPedalAlter; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PedalAlter) +MX_FORWARD_DECLARE_ELEMENT(PedalStep) +MX_FORWARD_DECLARE_ELEMENT(PedalTuning) + +inline PedalTuningPtr makePedalTuning() +{ + return std::make_shared(); } + +class PedalTuning : public ElementInterface +{ + public: + PedalTuning(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ PedalStep minOccurs = 1, maxOccurs = 1 _________ */ + PedalStepPtr getPedalStep() const; + void setPedalStep(const PedalStepPtr &value); + + /* _________ PedalAlter minOccurs = 1, maxOccurs = 1 _________ */ + PedalAlterPtr getPedalAlter() const; + void setPedalAlter(const PedalAlterPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PedalStepPtr myPedalStep; + PedalAlterPtr myPedalAlter; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PerMinute.cpp b/Sourcecode/private/mx/core/elements/PerMinute.cpp index fc2bf6a91..fa8ca0c89 100644 --- a/Sourcecode/private/mx/core/elements/PerMinute.cpp +++ b/Sourcecode/private/mx/core/elements/PerMinute.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - PerMinute::PerMinute() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PerMinute::PerMinute( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PerMinute::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PerMinute::hasContents() const - { - return true; - } - - - std::ostream& PerMinute::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PerMinute::streamName( std::ostream& os ) const - { - os << "per-minute"; - return os; - } - - - std::ostream& PerMinute::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +PerMinute::PerMinute() : myValue(), myAttributes(std::make_shared()) +{ +} +PerMinute::PerMinute(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - PerMinuteAttributesPtr PerMinute::getAttributes() const - { - return myAttributes; - } +bool PerMinute::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool PerMinute::hasContents() const +{ + return true; +} - void PerMinute::setAttributes( const PerMinuteAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &PerMinute::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &PerMinute::streamName(std::ostream &os) const +{ + os << "per-minute"; + return os; +} - XsString PerMinute::getValue() const - { - return myValue; - } +std::ostream &PerMinute::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PerMinuteAttributesPtr PerMinute::getAttributes() const +{ + return myAttributes; +} - void PerMinute::setValue( const XsString& value ) - { - myValue = value; - } +void PerMinute::setAttributes(const PerMinuteAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString PerMinute::getValue() const +{ + return myValue; +} - bool PerMinute::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void PerMinute::setValue(const XsString &value) +{ + myValue = value; +} - } +bool PerMinute::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PerMinute.h b/Sourcecode/private/mx/core/elements/PerMinute.h index 274ed5d6d..79198e0a4 100644 --- a/Sourcecode/private/mx/core/elements/PerMinute.h +++ b/Sourcecode/private/mx/core/elements/PerMinute.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/PerMinuteAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PerMinuteAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PerMinute ) - - inline PerMinutePtr makePerMinute() { return std::make_shared(); } - inline PerMinutePtr makePerMinute( const XsString& value ) { return std::make_shared( value ); } - inline PerMinutePtr makePerMinute( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PerMinute : public ElementInterface - { - public: - PerMinute(); - PerMinute( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PerMinuteAttributesPtr getAttributes() const; - void setAttributes( const PerMinuteAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PerMinuteAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PerMinuteAttributes) +MX_FORWARD_DECLARE_ELEMENT(PerMinute) + +inline PerMinutePtr makePerMinute() +{ + return std::make_shared(); +} + +inline PerMinutePtr makePerMinute(const XsString &value) +{ + return std::make_shared(value); } + +inline PerMinutePtr makePerMinute(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class PerMinute : public ElementInterface +{ + public: + PerMinute(); + PerMinute(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PerMinuteAttributesPtr getAttributes() const; + void setAttributes(const PerMinuteAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + PerMinuteAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp b/Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp index 4a1475ab3..4710d162d 100644 --- a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp @@ -8,61 +8,63 @@ namespace mx { - namespace core +namespace core +{ +PerMinuteAttributes::PerMinuteAttributes() + : fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false) +{ +} + +bool PerMinuteAttributes::hasValues() const +{ + return hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight; +} + +std::ostream &PerMinuteAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PerMinuteAttributes::PerMinuteAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool PerMinuteAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PerMinuteAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PerMinuteAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& PerMinuteAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool PerMinuteAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) { - const char* const className = "PerMinuteAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.h b/Sourcecode/private/mx/core/elements/PerMinuteAttributes.h index 3f76fcdcd..3998d4201 100644 --- a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.h +++ b/Sourcecode/private/mx/core/elements/PerMinuteAttributes.h @@ -4,11 +4,11 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -16,28 +16,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PerMinuteAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PerMinuteAttributes) - struct PerMinuteAttributes : public AttributesInterface - { - public: - PerMinuteAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct PerMinuteAttributes : public AttributesInterface +{ + public: + PerMinuteAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp b/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp index 34fb5ee2d..0277d6881 100644 --- a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp +++ b/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp @@ -10,109 +10,95 @@ namespace mx { - namespace core - { - PerMinuteOrBeatUnitChoice::PerMinuteOrBeatUnitChoice() - :myChoice( Choice::perMinute ) - ,myPerMinute( makePerMinute() ) - ,myBeatUnitGroup( makeBeatUnitGroup() ) - {} - - - bool PerMinuteOrBeatUnitChoice::hasAttributes() const - { - return false; - } - - - std::ostream& PerMinuteOrBeatUnitChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PerMinuteOrBeatUnitChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool PerMinuteOrBeatUnitChoice::hasContents() const - { - return true; - } - - - std::ostream& PerMinuteOrBeatUnitChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::perMinute: - { - myPerMinute->toStream( os, indentLevel ); - } - break; - case Choice::beatUnitGroup: - { - myBeatUnitGroup->streamContents( os, indentLevel, isOneLineOnly ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - PerMinuteOrBeatUnitChoice::Choice PerMinuteOrBeatUnitChoice::getChoice() const - { - return myChoice; - } - - - void PerMinuteOrBeatUnitChoice::setChoice( const PerMinuteOrBeatUnitChoice::Choice value ) - { - myChoice = value; - } +namespace core +{ +PerMinuteOrBeatUnitChoice::PerMinuteOrBeatUnitChoice() + : myChoice(Choice::perMinute), myPerMinute(makePerMinute()), myBeatUnitGroup(makeBeatUnitGroup()) +{ +} +bool PerMinuteOrBeatUnitChoice::hasAttributes() const +{ + return false; +} - PerMinutePtr PerMinuteOrBeatUnitChoice::getPerMinute() const - { - return myPerMinute; - } +std::ostream &PerMinuteOrBeatUnitChoice::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &PerMinuteOrBeatUnitChoice::streamName(std::ostream &os) const +{ + return os; +} - void PerMinuteOrBeatUnitChoice::setPerMinute( const PerMinutePtr& value ) - { - if ( value ) - { - myPerMinute = value; - } - } +bool PerMinuteOrBeatUnitChoice::hasContents() const +{ + return true; +} +std::ostream &PerMinuteOrBeatUnitChoice::streamContents(std::ostream &os, const int indentLevel, + bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::perMinute: { + myPerMinute->toStream(os, indentLevel); + } + break; + case Choice::beatUnitGroup: { + myBeatUnitGroup->streamContents(os, indentLevel, isOneLineOnly); + } + break; + default: + break; + } + isOneLineOnly = false; + return os; +} - BeatUnitGroupPtr PerMinuteOrBeatUnitChoice::getBeatUnitGroup() const - { - return myBeatUnitGroup; - } +PerMinuteOrBeatUnitChoice::Choice PerMinuteOrBeatUnitChoice::getChoice() const +{ + return myChoice; +} +void PerMinuteOrBeatUnitChoice::setChoice(const PerMinuteOrBeatUnitChoice::Choice value) +{ + myChoice = value; +} - void PerMinuteOrBeatUnitChoice::setBeatUnitGroup( const BeatUnitGroupPtr& value ) - { - if ( value ) - { - myBeatUnitGroup = value; - } - } +PerMinutePtr PerMinuteOrBeatUnitChoice::getPerMinute() const +{ + return myPerMinute; +} +void PerMinuteOrBeatUnitChoice::setPerMinute(const PerMinutePtr &value) +{ + if (value) + { + myPerMinute = value; + } +} - bool PerMinuteOrBeatUnitChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( perMinute, "per-minute", PerMinute ); - MX_CHOICE_IF( beatUnitGroup, "beat-unit-group", BeatUnitGroup ); - MX_BAD_ELEMENT_FAILURE( PerMinuteOrBeatUnitChoice ); - } +BeatUnitGroupPtr PerMinuteOrBeatUnitChoice::getBeatUnitGroup() const +{ + return myBeatUnitGroup; +} +void PerMinuteOrBeatUnitChoice::setBeatUnitGroup(const BeatUnitGroupPtr &value) +{ + if (value) + { + myBeatUnitGroup = value; } } + +bool PerMinuteOrBeatUnitChoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_CHOICE_IF(perMinute, "per-minute", PerMinute); + MX_CHOICE_IF(beatUnitGroup, "beat-unit-group", BeatUnitGroup); + MX_BAD_ELEMENT_FAILURE(PerMinuteOrBeatUnitChoice); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h b/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h index a98a12cfe..a24b67003 100644 --- a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h +++ b/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,44 +13,47 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(BeatUnitGroup) +MX_FORWARD_DECLARE_ELEMENT(PerMinute) +MX_FORWARD_DECLARE_ELEMENT(PerMinuteOrBeatUnitChoice) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitGroup ) - MX_FORWARD_DECLARE_ELEMENT( PerMinute ) - MX_FORWARD_DECLARE_ELEMENT( PerMinuteOrBeatUnitChoice ) - - inline PerMinuteOrBeatUnitChoicePtr makePerMinuteOrBeatUnitChoice() { return std::make_shared(); } - - class PerMinuteOrBeatUnitChoice : public ElementInterface - { - public: - enum class Choice - { - perMinute = 0, - beatUnitGroup = 1 - }; - PerMinuteOrBeatUnitChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PerMinuteOrBeatUnitChoice::Choice getChoice() const; - void setChoice( const PerMinuteOrBeatUnitChoice::Choice value ); - PerMinutePtr getPerMinute() const; - void setPerMinute( const PerMinutePtr& value ); - BeatUnitGroupPtr getBeatUnitGroup() const; - void setBeatUnitGroup( const BeatUnitGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - PerMinutePtr myPerMinute; - BeatUnitGroupPtr myBeatUnitGroup; - }; - } +inline PerMinuteOrBeatUnitChoicePtr makePerMinuteOrBeatUnitChoice() +{ + return std::make_shared(); } + +class PerMinuteOrBeatUnitChoice : public ElementInterface +{ + public: + enum class Choice + { + perMinute = 0, + beatUnitGroup = 1 + }; + PerMinuteOrBeatUnitChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PerMinuteOrBeatUnitChoice::Choice getChoice() const; + void setChoice(const PerMinuteOrBeatUnitChoice::Choice value); + PerMinutePtr getPerMinute() const; + void setPerMinute(const PerMinutePtr &value); + BeatUnitGroupPtr getBeatUnitGroup() const; + void setBeatUnitGroup(const BeatUnitGroupPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + PerMinutePtr myPerMinute; + BeatUnitGroupPtr myBeatUnitGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Percussion.cpp b/Sourcecode/private/mx/core/elements/Percussion.cpp index 689ecafde..3f64e0151 100644 --- a/Sourcecode/private/mx/core/elements/Percussion.cpp +++ b/Sourcecode/private/mx/core/elements/Percussion.cpp @@ -9,86 +9,75 @@ namespace mx { - namespace core - { - Percussion::Percussion() - :myAttributes( std::make_shared() ) - ,myChoice( makePercussionChoice() ) - {} - - - bool Percussion::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Percussion::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Percussion::streamName( std::ostream& os ) const - { - os << "percussion"; - return os; - } - - - bool Percussion::hasContents() const - { - return true; - } - - - std::ostream& Percussion::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - isOneLineOnly = false; - os << std::endl; - return os; - } - - - PercussionAttributesPtr Percussion::getAttributes() const - { - return myAttributes; - } +namespace core +{ +Percussion::Percussion() : myAttributes(std::make_shared()), myChoice(makePercussionChoice()) +{ +} +bool Percussion::hasAttributes() const +{ + return myAttributes->hasValues(); +} - void Percussion::setAttributes( const PercussionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Percussion::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Percussion::streamName(std::ostream &os) const +{ + os << "percussion"; + return os; +} - PercussionChoicePtr Percussion::getPercussionChoice() const - { - return myChoice; - } +bool Percussion::hasContents() const +{ + return true; +} +std::ostream &Percussion::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myChoice->streamContents(os, indentLevel + 1, isOneLineOnly); + isOneLineOnly = false; + os << std::endl; + return os; +} - void Percussion::setPercussionChoice( const PercussionChoicePtr& value ) - { - if( value ) - { - myChoice = value; - } - } +PercussionAttributesPtr Percussion::getAttributes() const +{ + return myAttributes; +} +void Percussion::setAttributes(const PercussionAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - bool Percussion::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - isSuccess &= myChoice->fromXElement( message, xelement ); - MX_RETURN_IS_SUCCESS; - } +PercussionChoicePtr Percussion::getPercussionChoice() const +{ + return myChoice; +} +void Percussion::setPercussionChoice(const PercussionChoicePtr &value) +{ + if (value) + { + myChoice = value; } } + +bool Percussion::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + isSuccess &= myChoice->fromXElement(message, xelement); + MX_RETURN_IS_SUCCESS; +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Percussion.h b/Sourcecode/private/mx/core/elements/Percussion.h index cc944e742..89372df0c 100644 --- a/Sourcecode/private/mx/core/elements/Percussion.h +++ b/Sourcecode/private/mx/core/elements/Percussion.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PercussionAttributes.h" #include @@ -14,36 +14,39 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PercussionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PercussionChoice ) - MX_FORWARD_DECLARE_ELEMENT( Percussion ) - - inline PercussionPtr makePercussion() { return std::make_shared(); } - - class Percussion : public ElementInterface - { - public: - Percussion(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PercussionAttributesPtr getAttributes() const; - void setAttributes( const PercussionAttributesPtr& value ); - PercussionChoicePtr getPercussionChoice() const; - void setPercussionChoice( const PercussionChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PercussionAttributesPtr myAttributes; - PercussionChoicePtr myChoice; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PercussionAttributes) +MX_FORWARD_DECLARE_ELEMENT(PercussionChoice) +MX_FORWARD_DECLARE_ELEMENT(Percussion) + +inline PercussionPtr makePercussion() +{ + return std::make_shared(); } + +class Percussion : public ElementInterface +{ + public: + Percussion(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PercussionAttributesPtr getAttributes() const; + void setAttributes(const PercussionAttributesPtr &value); + PercussionChoicePtr getPercussionChoice() const; + void setPercussionChoice(const PercussionChoicePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PercussionAttributesPtr myAttributes; + PercussionChoicePtr myChoice; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PercussionAttributes.cpp b/Sourcecode/private/mx/core/elements/PercussionAttributes.cpp index 2b14834b0..bd3616ff7 100644 --- a/Sourcecode/private/mx/core/elements/PercussionAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PercussionAttributes.cpp @@ -8,101 +8,107 @@ namespace mx { - namespace core +namespace core +{ +PercussionAttributes::PercussionAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), halign(LeftCenterRight::center), valign(), + enclosure(), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), + hasHalign(false), hasValign(false), hasEnclosure(false) +{ +} + +bool PercussionAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasHalign || hasValign || hasEnclosure; +} + +std::ostream &PercussionAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PercussionAttributes::PercussionAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign( LeftCenterRight::center ) - ,valign() - ,enclosure() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasEnclosure( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, valign, "valign", hasValign); + streamAttribute(os, enclosure, "enclosure", hasEnclosure); + } + return os; +} +bool PercussionAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PercussionAttributes"; + bool isSuccess = true; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PercussionAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign || - hasEnclosure; + continue; } - - - std::ostream& PercussionAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; + continue; } - - - bool PercussionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "PercussionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, valign, hasValign, "valign", &parseValign)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", + &parseEnclosureShape)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PercussionAttributes.h b/Sourcecode/private/mx/core/elements/PercussionAttributes.h index b3181a1da..52ae39b76 100644 --- a/Sourcecode/private/mx/core/elements/PercussionAttributes.h +++ b/Sourcecode/private/mx/core/elements/PercussionAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,44 +18,44 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PercussionAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PercussionAttributes) - struct PercussionAttributes : public AttributesInterface - { - public: - PercussionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - EnclosureShape enclosure; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasEnclosure; +struct PercussionAttributes : public AttributesInterface +{ + public: + PercussionAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + LeftCenterRight halign; + Valign valign; + EnclosureShape enclosure; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasHalign; + bool hasValign; + bool hasEnclosure; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PercussionChoice.cpp b/Sourcecode/private/mx/core/elements/PercussionChoice.cpp index a006ac768..2a00f1714 100644 --- a/Sourcecode/private/mx/core/elements/PercussionChoice.cpp +++ b/Sourcecode/private/mx/core/elements/PercussionChoice.cpp @@ -21,418 +21,361 @@ namespace mx { - namespace core +namespace core +{ +PercussionChoice::PercussionChoice() + + : myChoice(PercussionChoice::Choice::glass), myGlass(makeGlass()), myMetal(makeMetal()), myWood(makeWood()), + myPitched(makePitched()), myMembrane(makeMembrane()), myEffect(makeEffect()), myTimpani(makeTimpani()), + myBeater(makeBeater()), myStick(makeStick()), myStickType(makeStickType()), myStickMaterial(makeStickMaterial()), + myStickLocation(makeStickLocation()), myOtherPercussion(makeOtherPercussion()) +{ +} + +bool PercussionChoice::hasAttributes() const +{ + return false; +} + +std::ostream &PercussionChoice::streamAttributes(std::ostream &os) const +{ + return os; +} + +std::ostream &PercussionChoice::streamName(std::ostream &os) const +{ + return os; +} + +bool PercussionChoice::hasContents() const +{ + return true; +} + +std::ostream &PercussionChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) { - PercussionChoice::PercussionChoice() - - - :myChoice( PercussionChoice::Choice::glass ) - ,myGlass( makeGlass() ) - ,myMetal( makeMetal() ) - ,myWood( makeWood() ) - ,myPitched( makePitched() ) - ,myMembrane( makeMembrane() ) - ,myEffect( makeEffect() ) - ,myTimpani( makeTimpani() ) - ,myBeater( makeBeater() ) - ,myStick( makeStick() ) - ,myStickType( makeStickType() ) - ,myStickMaterial( makeStickMaterial() ) - ,myStickLocation( makeStickLocation() ) - ,myOtherPercussion( makeOtherPercussion() ) - {} - - - bool PercussionChoice::hasAttributes() const - { - return false; - } - - - std::ostream& PercussionChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PercussionChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool PercussionChoice::hasContents() const - { - return true; - } - - - std::ostream& PercussionChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::glass: - { - myGlass->toStream( os, indentLevel ); - } - break; - case Choice::metal: - { - myMetal->toStream( os, indentLevel ); - } - break; - case Choice::wood: - { - myWood->toStream( os, indentLevel ); - } - break; - case Choice::pitched: - { - myPitched->toStream( os, indentLevel ); - } - break; - case Choice::membrane: - { - myMembrane->toStream( os, indentLevel ); - } - break; - case Choice::effect: - { - myEffect->toStream( os, indentLevel ); - } - break; - case Choice::timpani: - { - myTimpani->toStream( os, indentLevel ); - } - break; - case Choice::beater: - { - myBeater->toStream( os, indentLevel ); - } - break; - case Choice::stick: - { - myStick->toStream( os, indentLevel ); - } - break; - case Choice::stickType: - { - myStickType->toStream( os, indentLevel ); - } - break; - case Choice::stickMaterial: - { - myStickMaterial->toStream( os, indentLevel ); - } - break; - case Choice::stickLocation: - { - myStickLocation->toStream( os, indentLevel ); - } - break; - case Choice::otherPercussion: - { - myOtherPercussion->toStream( os, indentLevel ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - PercussionChoice::Choice PercussionChoice::getChoice() const - { - return myChoice; - } - - - void PercussionChoice::setChoice( const PercussionChoice::Choice value ) - { - myChoice = value; - } - - - GlassPtr PercussionChoice::getGlass() const - { - return myGlass; - } - - - void PercussionChoice::setGlass( const GlassPtr& value ) - { - if( value ) - { - myGlass = value; - } - } - - - MetalPtr PercussionChoice::getMetal() const - { - return myMetal; - } - - - void PercussionChoice::setMetal( const MetalPtr& value ) - { - if( value ) - { - myMetal = value; - } - } - - - WoodPtr PercussionChoice::getWood() const - { - return myWood; - } - - - void PercussionChoice::setWood( const WoodPtr& value ) - { - if( value ) - { - myWood = value; - } - } - - - PitchedPtr PercussionChoice::getPitched() const - { - return myPitched; - } - - - void PercussionChoice::setPitched( const PitchedPtr& value ) - { - if( value ) - { - myPitched = value; - } - } - - - MembranePtr PercussionChoice::getMembrane() const - { - return myMembrane; - } + case Choice::glass: { + myGlass->toStream(os, indentLevel); + } + break; + case Choice::metal: { + myMetal->toStream(os, indentLevel); + } + break; + case Choice::wood: { + myWood->toStream(os, indentLevel); + } + break; + case Choice::pitched: { + myPitched->toStream(os, indentLevel); + } + break; + case Choice::membrane: { + myMembrane->toStream(os, indentLevel); + } + break; + case Choice::effect: { + myEffect->toStream(os, indentLevel); + } + break; + case Choice::timpani: { + myTimpani->toStream(os, indentLevel); + } + break; + case Choice::beater: { + myBeater->toStream(os, indentLevel); + } + break; + case Choice::stick: { + myStick->toStream(os, indentLevel); + } + break; + case Choice::stickType: { + myStickType->toStream(os, indentLevel); + } + break; + case Choice::stickMaterial: { + myStickMaterial->toStream(os, indentLevel); + } + break; + case Choice::stickLocation: { + myStickLocation->toStream(os, indentLevel); + } + break; + case Choice::otherPercussion: { + myOtherPercussion->toStream(os, indentLevel); + } + break; + default: + break; + } + isOneLineOnly = false; + return os; +} +PercussionChoice::Choice PercussionChoice::getChoice() const +{ + return myChoice; +} - void PercussionChoice::setMembrane( const MembranePtr& value ) - { - if( value ) - { - myMembrane = value; - } - } +void PercussionChoice::setChoice(const PercussionChoice::Choice value) +{ + myChoice = value; +} +GlassPtr PercussionChoice::getGlass() const +{ + return myGlass; +} - EffectPtr PercussionChoice::getEffect() const - { - return myEffect; - } +void PercussionChoice::setGlass(const GlassPtr &value) +{ + if (value) + { + myGlass = value; + } +} +MetalPtr PercussionChoice::getMetal() const +{ + return myMetal; +} - void PercussionChoice::setEffect( const EffectPtr& value ) - { - if( value ) - { - myEffect = value; - } - } +void PercussionChoice::setMetal(const MetalPtr &value) +{ + if (value) + { + myMetal = value; + } +} +WoodPtr PercussionChoice::getWood() const +{ + return myWood; +} - TimpaniPtr PercussionChoice::getTimpani() const - { - return myTimpani; - } +void PercussionChoice::setWood(const WoodPtr &value) +{ + if (value) + { + myWood = value; + } +} +PitchedPtr PercussionChoice::getPitched() const +{ + return myPitched; +} + +void PercussionChoice::setPitched(const PitchedPtr &value) +{ + if (value) + { + myPitched = value; + } +} - void PercussionChoice::setTimpani( const TimpaniPtr& value ) - { - if( value ) - { - myTimpani = value; - } - } +MembranePtr PercussionChoice::getMembrane() const +{ + return myMembrane; +} +void PercussionChoice::setMembrane(const MembranePtr &value) +{ + if (value) + { + myMembrane = value; + } +} - BeaterPtr PercussionChoice::getBeater() const - { - return myBeater; - } +EffectPtr PercussionChoice::getEffect() const +{ + return myEffect; +} +void PercussionChoice::setEffect(const EffectPtr &value) +{ + if (value) + { + myEffect = value; + } +} - void PercussionChoice::setBeater( const BeaterPtr& value ) - { - if( value ) - { - myBeater = value; - } - } - - - StickPtr PercussionChoice::getStick() const - { - return myStick; - } - - - void PercussionChoice::setStick( const StickPtr& value ) - { - if( value ) - { - myStick = value; - } - } - - - StickTypePtr PercussionChoice::getStickType() const - { - return myStickType; - } - - - void PercussionChoice::setStickType( const StickTypePtr& value ) - { - if( value ) - { - myStickType = value; - } - } - - - StickMaterialPtr PercussionChoice::getStickMaterial() const - { - return myStickMaterial; - } - - - void PercussionChoice::setStickMaterial( const StickMaterialPtr& value ) - { - if( value ) - { - myStickMaterial = value; - } - } - - - StickLocationPtr PercussionChoice::getStickLocation() const - { - return myStickLocation; - } - - - void PercussionChoice::setStickLocation( const StickLocationPtr& value ) - { - if( value ) - { - myStickLocation = value; - } - } - - - OtherPercussionPtr PercussionChoice::getOtherPercussion() const - { - return myOtherPercussion; - } - - - void PercussionChoice::setOtherPercussion( const OtherPercussionPtr& value ) - { - if( value ) - { - myOtherPercussion = value; - } - } - - - bool PercussionChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - if( xelement.getName() == "glass" ) - { - myChoice = Choice::glass; - return getGlass()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "metal" ) - { - myChoice = Choice::metal; - return getMetal()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "wood" ) - { - myChoice = Choice::wood; - return getWood()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "pitched" ) - { - myChoice = Choice::pitched; - return getPitched()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "membrane" ) - { - myChoice = Choice::membrane; - return getMembrane()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "effect" ) - { - myChoice = Choice::effect; - return getEffect()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "timpani" ) - { - myChoice = Choice::timpani; - return getTimpani()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "beater" ) - { - myChoice = Choice::beater; - return getBeater()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stick" ) - { - myChoice = Choice::stick; - return getStick()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stick-type" ) - { - myChoice = Choice::stickType; - return getStickType()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stick-material" ) - { - myChoice = Choice::stickMaterial; - return getStickMaterial()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stick-location" ) - { - myChoice = Choice::stickLocation; - return getStickLocation()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "other-percussion" ) - { - myChoice = Choice::otherPercussion; - return getOtherPercussion()->fromXElement( message, xelement ); - } - - MX_BAD_ELEMENT_FAILURE( PercussionChoice ); - } +TimpaniPtr PercussionChoice::getTimpani() const +{ + return myTimpani; +} +void PercussionChoice::setTimpani(const TimpaniPtr &value) +{ + if (value) + { + myTimpani = value; } } + +BeaterPtr PercussionChoice::getBeater() const +{ + return myBeater; +} + +void PercussionChoice::setBeater(const BeaterPtr &value) +{ + if (value) + { + myBeater = value; + } +} + +StickPtr PercussionChoice::getStick() const +{ + return myStick; +} + +void PercussionChoice::setStick(const StickPtr &value) +{ + if (value) + { + myStick = value; + } +} + +StickTypePtr PercussionChoice::getStickType() const +{ + return myStickType; +} + +void PercussionChoice::setStickType(const StickTypePtr &value) +{ + if (value) + { + myStickType = value; + } +} + +StickMaterialPtr PercussionChoice::getStickMaterial() const +{ + return myStickMaterial; +} + +void PercussionChoice::setStickMaterial(const StickMaterialPtr &value) +{ + if (value) + { + myStickMaterial = value; + } +} + +StickLocationPtr PercussionChoice::getStickLocation() const +{ + return myStickLocation; +} + +void PercussionChoice::setStickLocation(const StickLocationPtr &value) +{ + if (value) + { + myStickLocation = value; + } +} + +OtherPercussionPtr PercussionChoice::getOtherPercussion() const +{ + return myOtherPercussion; +} + +void PercussionChoice::setOtherPercussion(const OtherPercussionPtr &value) +{ + if (value) + { + myOtherPercussion = value; + } +} + +bool PercussionChoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + if (xelement.getName() == "glass") + { + myChoice = Choice::glass; + return getGlass()->fromXElement(message, xelement); + } + + if (xelement.getName() == "metal") + { + myChoice = Choice::metal; + return getMetal()->fromXElement(message, xelement); + } + + if (xelement.getName() == "wood") + { + myChoice = Choice::wood; + return getWood()->fromXElement(message, xelement); + } + + if (xelement.getName() == "pitched") + { + myChoice = Choice::pitched; + return getPitched()->fromXElement(message, xelement); + } + + if (xelement.getName() == "membrane") + { + myChoice = Choice::membrane; + return getMembrane()->fromXElement(message, xelement); + } + + if (xelement.getName() == "effect") + { + myChoice = Choice::effect; + return getEffect()->fromXElement(message, xelement); + } + + if (xelement.getName() == "timpani") + { + myChoice = Choice::timpani; + return getTimpani()->fromXElement(message, xelement); + } + + if (xelement.getName() == "beater") + { + myChoice = Choice::beater; + return getBeater()->fromXElement(message, xelement); + } + + if (xelement.getName() == "stick") + { + myChoice = Choice::stick; + return getStick()->fromXElement(message, xelement); + } + + if (xelement.getName() == "stick-type") + { + myChoice = Choice::stickType; + return getStickType()->fromXElement(message, xelement); + } + + if (xelement.getName() == "stick-material") + { + myChoice = Choice::stickMaterial; + return getStickMaterial()->fromXElement(message, xelement); + } + + if (xelement.getName() == "stick-location") + { + myChoice = Choice::stickLocation; + return getStickLocation()->fromXElement(message, xelement); + } + + if (xelement.getName() == "other-percussion") + { + myChoice = Choice::otherPercussion; + return getOtherPercussion()->fromXElement(message, xelement); + } + + MX_BAD_ELEMENT_FAILURE(PercussionChoice); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PercussionChoice.h b/Sourcecode/private/mx/core/elements/PercussionChoice.h index 2f42f55c6..1ab933d31 100644 --- a/Sourcecode/private/mx/core/elements/PercussionChoice.h +++ b/Sourcecode/private/mx/core/elements/PercussionChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,125 +13,128 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Beater ) - MX_FORWARD_DECLARE_ELEMENT( Effect ) - MX_FORWARD_DECLARE_ELEMENT( Glass ) - MX_FORWARD_DECLARE_ELEMENT( Membrane ) - MX_FORWARD_DECLARE_ELEMENT( Metal ) - MX_FORWARD_DECLARE_ELEMENT( OtherPercussion ) - MX_FORWARD_DECLARE_ELEMENT( Pitched ) - MX_FORWARD_DECLARE_ELEMENT( Stick ) - MX_FORWARD_DECLARE_ELEMENT( StickLocation ) - MX_FORWARD_DECLARE_ELEMENT( StickMaterial ) - MX_FORWARD_DECLARE_ELEMENT( StickType ) - MX_FORWARD_DECLARE_ELEMENT( Timpani ) - MX_FORWARD_DECLARE_ELEMENT( Wood ) - MX_FORWARD_DECLARE_ELEMENT( PercussionChoice ) - - inline PercussionChoicePtr makePercussionChoice() { return std::make_shared(); } - - class PercussionChoice : public ElementInterface - { - public: - enum class Choice - { - glass = 1, - metal = 2, - wood = 3, - pitched = 4, - membrane = 5, - effect = 6, - timpani = 7, - beater = 8, - stick = 9, - stickType = 10, - stickMaterial = 11, - stickLocation = 12, - otherPercussion = 13 - }; - PercussionChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PercussionChoice::Choice getChoice() const; - void setChoice( const PercussionChoice::Choice value ); - - /* _________ Glass minOccurs = 1, maxOccurs = 1 _________ */ - GlassPtr getGlass() const; - void setGlass( const GlassPtr& value ); - - /* _________ Metal minOccurs = 1, maxOccurs = 1 _________ */ - MetalPtr getMetal() const; - void setMetal( const MetalPtr& value ); - - /* _________ Wood minOccurs = 1, maxOccurs = 1 _________ */ - WoodPtr getWood() const; - void setWood( const WoodPtr& value ); - - /* _________ Pitched minOccurs = 1, maxOccurs = 1 _________ */ - PitchedPtr getPitched() const; - void setPitched( const PitchedPtr& value ); - - /* _________ Membrane minOccurs = 1, maxOccurs = 1 _________ */ - MembranePtr getMembrane() const; - void setMembrane( const MembranePtr& value ); - - /* _________ Effect minOccurs = 1, maxOccurs = 1 _________ */ - EffectPtr getEffect() const; - void setEffect( const EffectPtr& value ); - - /* _________ Timpani minOccurs = 1, maxOccurs = 1 _________ */ - TimpaniPtr getTimpani() const; - void setTimpani( const TimpaniPtr& value ); - - /* _________ Beater minOccurs = 1, maxOccurs = 1 _________ */ - BeaterPtr getBeater() const; - void setBeater( const BeaterPtr& value ); - - /* _________ Stick minOccurs = 1, maxOccurs = 1 _________ */ - StickPtr getStick() const; - void setStick( const StickPtr& value ); - - /* _________ StickType minOccurs = 1, maxOccurs = 1 _________ */ - StickTypePtr getStickType() const; - void setStickType( const StickTypePtr& value ); - - /* _________ StickMaterial minOccurs = 1, maxOccurs = 1 _________ */ - StickMaterialPtr getStickMaterial() const; - void setStickMaterial( const StickMaterialPtr& value ); - - /* _________ StickLocation minOccurs = 1, maxOccurs = 1 _________ */ - StickLocationPtr getStickLocation() const; - void setStickLocation( const StickLocationPtr& value ); - - /* _________ OtherPercussion minOccurs = 1, maxOccurs = 1 _________ */ - OtherPercussionPtr getOtherPercussion() const; - void setOtherPercussion( const OtherPercussionPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - GlassPtr myGlass; - MetalPtr myMetal; - WoodPtr myWood; - PitchedPtr myPitched; - MembranePtr myMembrane; - EffectPtr myEffect; - TimpaniPtr myTimpani; - BeaterPtr myBeater; - StickPtr myStick; - StickTypePtr myStickType; - StickMaterialPtr myStickMaterial; - StickLocationPtr myStickLocation; - OtherPercussionPtr myOtherPercussion; - }; - } +MX_FORWARD_DECLARE_ELEMENT(Beater) +MX_FORWARD_DECLARE_ELEMENT(Effect) +MX_FORWARD_DECLARE_ELEMENT(Glass) +MX_FORWARD_DECLARE_ELEMENT(Membrane) +MX_FORWARD_DECLARE_ELEMENT(Metal) +MX_FORWARD_DECLARE_ELEMENT(OtherPercussion) +MX_FORWARD_DECLARE_ELEMENT(Pitched) +MX_FORWARD_DECLARE_ELEMENT(Stick) +MX_FORWARD_DECLARE_ELEMENT(StickLocation) +MX_FORWARD_DECLARE_ELEMENT(StickMaterial) +MX_FORWARD_DECLARE_ELEMENT(StickType) +MX_FORWARD_DECLARE_ELEMENT(Timpani) +MX_FORWARD_DECLARE_ELEMENT(Wood) +MX_FORWARD_DECLARE_ELEMENT(PercussionChoice) + +inline PercussionChoicePtr makePercussionChoice() +{ + return std::make_shared(); } + +class PercussionChoice : public ElementInterface +{ + public: + enum class Choice + { + glass = 1, + metal = 2, + wood = 3, + pitched = 4, + membrane = 5, + effect = 6, + timpani = 7, + beater = 8, + stick = 9, + stickType = 10, + stickMaterial = 11, + stickLocation = 12, + otherPercussion = 13 + }; + PercussionChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PercussionChoice::Choice getChoice() const; + void setChoice(const PercussionChoice::Choice value); + + /* _________ Glass minOccurs = 1, maxOccurs = 1 _________ */ + GlassPtr getGlass() const; + void setGlass(const GlassPtr &value); + + /* _________ Metal minOccurs = 1, maxOccurs = 1 _________ */ + MetalPtr getMetal() const; + void setMetal(const MetalPtr &value); + + /* _________ Wood minOccurs = 1, maxOccurs = 1 _________ */ + WoodPtr getWood() const; + void setWood(const WoodPtr &value); + + /* _________ Pitched minOccurs = 1, maxOccurs = 1 _________ */ + PitchedPtr getPitched() const; + void setPitched(const PitchedPtr &value); + + /* _________ Membrane minOccurs = 1, maxOccurs = 1 _________ */ + MembranePtr getMembrane() const; + void setMembrane(const MembranePtr &value); + + /* _________ Effect minOccurs = 1, maxOccurs = 1 _________ */ + EffectPtr getEffect() const; + void setEffect(const EffectPtr &value); + + /* _________ Timpani minOccurs = 1, maxOccurs = 1 _________ */ + TimpaniPtr getTimpani() const; + void setTimpani(const TimpaniPtr &value); + + /* _________ Beater minOccurs = 1, maxOccurs = 1 _________ */ + BeaterPtr getBeater() const; + void setBeater(const BeaterPtr &value); + + /* _________ Stick minOccurs = 1, maxOccurs = 1 _________ */ + StickPtr getStick() const; + void setStick(const StickPtr &value); + + /* _________ StickType minOccurs = 1, maxOccurs = 1 _________ */ + StickTypePtr getStickType() const; + void setStickType(const StickTypePtr &value); + + /* _________ StickMaterial minOccurs = 1, maxOccurs = 1 _________ */ + StickMaterialPtr getStickMaterial() const; + void setStickMaterial(const StickMaterialPtr &value); + + /* _________ StickLocation minOccurs = 1, maxOccurs = 1 _________ */ + StickLocationPtr getStickLocation() const; + void setStickLocation(const StickLocationPtr &value); + + /* _________ OtherPercussion minOccurs = 1, maxOccurs = 1 _________ */ + OtherPercussionPtr getOtherPercussion() const; + void setOtherPercussion(const OtherPercussionPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + GlassPtr myGlass; + MetalPtr myMetal; + WoodPtr myWood; + PitchedPtr myPitched; + MembranePtr myMembrane; + EffectPtr myEffect; + TimpaniPtr myTimpani; + BeaterPtr myBeater; + StickPtr myStick; + StickTypePtr myStickType; + StickMaterialPtr myStickMaterial; + StickLocationPtr myStickLocation; + OtherPercussionPtr myOtherPercussion; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pitch.cpp b/Sourcecode/private/mx/core/elements/Pitch.cpp index 32b1d07a3..b668bf735 100644 --- a/Sourcecode/private/mx/core/elements/Pitch.cpp +++ b/Sourcecode/private/mx/core/elements/Pitch.cpp @@ -11,141 +11,133 @@ namespace mx { - namespace core - { - Pitch::Pitch() - :myStep( makeStep() ) - ,myAlter( makeAlter() ) - ,myHasAlter( false ) - ,myOctave( makeOctave() ) - {} - - - bool Pitch::hasAttributes() const - { - return false; - } - - - std::ostream& Pitch::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Pitch::streamName( std::ostream& os ) const - { - os << "pitch"; - return os; - } - +namespace core +{ +Pitch::Pitch() : myStep(makeStep()), myAlter(makeAlter()), myHasAlter(false), myOctave(makeOctave()) +{ +} - bool Pitch::hasContents() const - { - return true; - } +bool Pitch::hasAttributes() const +{ + return false; +} +std::ostream &Pitch::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& Pitch::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myStep->toStream( os, indentLevel+1 ); - if ( myHasAlter ) - { - os << std::endl; - myAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - myOctave->toStream( os, indentLevel+1 ); - isOneLineOnly = false; - os << std::endl; - return os; - } +std::ostream &Pitch::streamName(std::ostream &os) const +{ + os << "pitch"; + return os; +} +bool Pitch::hasContents() const +{ + return true; +} - StepPtr Pitch::getStep() const - { - return myStep; - } +std::ostream &Pitch::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myStep->toStream(os, indentLevel + 1); + if (myHasAlter) + { + os << std::endl; + myAlter->toStream(os, indentLevel + 1); + } + os << std::endl; + myOctave->toStream(os, indentLevel + 1); + isOneLineOnly = false; + os << std::endl; + return os; +} +StepPtr Pitch::getStep() const +{ + return myStep; +} - void Pitch::setStep( const StepPtr& value ) - { - if( value ) - { - myStep = value; - } - } +void Pitch::setStep(const StepPtr &value) +{ + if (value) + { + myStep = value; + } +} +AlterPtr Pitch::getAlter() const +{ + return myAlter; +} - AlterPtr Pitch::getAlter() const - { - return myAlter; - } +void Pitch::setAlter(const AlterPtr &value) +{ + if (value) + { + myAlter = value; + } +} +bool Pitch::getHasAlter() const +{ + return myHasAlter; +} - void Pitch::setAlter( const AlterPtr& value ) - { - if( value ) - { - myAlter = value; - } - } +void Pitch::setHasAlter(const bool value) +{ + myHasAlter = value; +} +OctavePtr Pitch::getOctave() const +{ + return myOctave; +} - bool Pitch::getHasAlter() const - { - return myHasAlter; - } +void Pitch::setOctave(const OctavePtr &value) +{ + if (value) + { + myOctave = value; + } +} +bool Pitch::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isStepFound = false; + bool isOctaveFound = false; - void Pitch::setHasAlter( const bool value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myStep, isStepFound)) { - myHasAlter = value; + continue; } - - - OctavePtr Pitch::getOctave() const + if (importElement(message, *it, isSuccess, *myAlter, myHasAlter)) { - return myOctave; + continue; } - - - void Pitch::setOctave( const OctavePtr& value ) + if (importElement(message, *it, isSuccess, *myOctave, isOctaveFound)) { - if( value ) - { - myOctave = value; - } + continue; } + } + if (!isStepFound) + { + message << "Pitch: 'step' element is required but was not found" << std::endl; + } - bool Pitch::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isStepFound = false; - bool isOctaveFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myStep, isStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myAlter, myHasAlter ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myOctave, isOctaveFound ) ) { continue; } - } - - if( !isStepFound ) - { - message << "Pitch: 'step' element is required but was not found" << std::endl; - } - - if( !isOctaveFound ) - { - message << "Pitch: 'octave' element is required but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - + if (!isOctaveFound) + { + message << "Pitch: 'octave' element is required but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pitch.h b/Sourcecode/private/mx/core/elements/Pitch.h index 85eb4870b..747494ebc 100644 --- a/Sourcecode/private/mx/core/elements/Pitch.h +++ b/Sourcecode/private/mx/core/elements/Pitch.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,49 +13,52 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Alter ) - MX_FORWARD_DECLARE_ELEMENT( Octave ) - MX_FORWARD_DECLARE_ELEMENT( Step ) - MX_FORWARD_DECLARE_ELEMENT( Pitch ) - - inline PitchPtr makePitch() { return std::make_shared(); } - - class Pitch : public ElementInterface - { - public: - Pitch(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Step minOccurs = 1, maxOccurs = 1 _________ */ - StepPtr getStep() const; - void setStep( const StepPtr& value ); - - /* _________ Alter minOccurs = 0, maxOccurs = 1 _________ */ - AlterPtr getAlter() const; - void setAlter( const AlterPtr& value ); - bool getHasAlter() const; - void setHasAlter( const bool value ); - - /* _________ Octave minOccurs = 1, maxOccurs = 1 _________ */ - OctavePtr getOctave() const; - void setOctave( const OctavePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepPtr myStep; - AlterPtr myAlter; - bool myHasAlter; - OctavePtr myOctave; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Alter) +MX_FORWARD_DECLARE_ELEMENT(Octave) +MX_FORWARD_DECLARE_ELEMENT(Step) +MX_FORWARD_DECLARE_ELEMENT(Pitch) + +inline PitchPtr makePitch() +{ + return std::make_shared(); } + +class Pitch : public ElementInterface +{ + public: + Pitch(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Step minOccurs = 1, maxOccurs = 1 _________ */ + StepPtr getStep() const; + void setStep(const StepPtr &value); + + /* _________ Alter minOccurs = 0, maxOccurs = 1 _________ */ + AlterPtr getAlter() const; + void setAlter(const AlterPtr &value); + bool getHasAlter() const; + void setHasAlter(const bool value); + + /* _________ Octave minOccurs = 1, maxOccurs = 1 _________ */ + OctavePtr getOctave() const; + void setOctave(const OctavePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StepPtr myStep; + AlterPtr myAlter; + bool myHasAlter; + OctavePtr myOctave; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pitched.cpp b/Sourcecode/private/mx/core/elements/Pitched.cpp index 27e15cf8e..4802d0447 100644 --- a/Sourcecode/private/mx/core/elements/Pitched.cpp +++ b/Sourcecode/private/mx/core/elements/Pitched.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Pitched::Pitched() - :myValue( PitchedEnum::xylophone ) - {} - - - Pitched::Pitched( const PitchedEnum& value ) - :myValue( value ) - {} - - - bool Pitched::hasAttributes() const - { - return false; - } - - - bool Pitched::hasContents() const - { - return true; - } - - - std::ostream& Pitched::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Pitched::streamName( std::ostream& os ) const - { - os << "pitched"; - return os; - } +namespace core +{ +Pitched::Pitched() : myValue(PitchedEnum::xylophone) +{ +} +Pitched::Pitched(const PitchedEnum &value) : myValue(value) +{ +} - std::ostream& Pitched::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Pitched::hasAttributes() const +{ + return false; +} +bool Pitched::hasContents() const +{ + return true; +} - PitchedEnum Pitched::getValue() const - { - return myValue; - } +std::ostream &Pitched::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Pitched::streamName(std::ostream &os) const +{ + os << "pitched"; + return os; +} - void Pitched::setValue( const PitchedEnum& value ) - { - myValue = value; - } +std::ostream &Pitched::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PitchedEnum Pitched::getValue() const +{ + return myValue; +} - bool Pitched::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parsePitchedEnum( xelement.getValue() ); - return true; - } +void Pitched::setValue(const PitchedEnum &value) +{ + myValue = value; +} - } +bool Pitched::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue = parsePitchedEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pitched.h b/Sourcecode/private/mx/core/elements/Pitched.h index a31af2377..b8d734ce5 100644 --- a/Sourcecode/private/mx/core/elements/Pitched.h +++ b/Sourcecode/private/mx/core/elements/Pitched.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Pitched ) - - inline PitchedPtr makePitched() { return std::make_shared(); } - inline PitchedPtr makePitched( const PitchedEnum& value ) { return std::make_shared( value ); } - inline PitchedPtr makePitched( PitchedEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Pitched : public ElementInterface - { - public: - Pitched(); - Pitched( const PitchedEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PitchedEnum getValue() const; - void setValue( const PitchedEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PitchedEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Pitched) + +inline PitchedPtr makePitched() +{ + return std::make_shared(); +} + +inline PitchedPtr makePitched(const PitchedEnum &value) +{ + return std::make_shared(value); } + +inline PitchedPtr makePitched(PitchedEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class Pitched : public ElementInterface +{ + public: + Pitched(); + Pitched(const PitchedEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PitchedEnum getValue() const; + void setValue(const PitchedEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PitchedEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Play.cpp b/Sourcecode/private/mx/core/elements/Play.cpp index bd489ab85..b2929e6b0 100644 --- a/Sourcecode/private/mx/core/elements/Play.cpp +++ b/Sourcecode/private/mx/core/elements/Play.cpp @@ -12,190 +12,165 @@ namespace mx { - namespace core +namespace core +{ +Play::Play() + : myAttributes(std::make_shared()), myChoice(Choice::ipa), myIpa(makeIpa()), myMute(makeMute()), + mySemiPitched(makeSemiPitched()), myOtherPlay(makeOtherPlay()) +{ +} + +bool Play::hasAttributes() const +{ + return myAttributes->hasValues(); +} + +std::ostream &Play::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} + +std::ostream &Play::streamName(std::ostream &os) const +{ + os << "play"; + return os; +} + +bool Play::hasContents() const +{ + return true; +} + +std::ostream &Play::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + switch (myChoice) { - Play::Play() - :myAttributes( std::make_shared() ) - ,myChoice( Choice::ipa ) - ,myIpa( makeIpa() ) - ,myMute( makeMute() ) - ,mySemiPitched( makeSemiPitched() ) - ,myOtherPlay( makeOtherPlay() ) - {} - - - bool Play::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Play::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Play::streamName( std::ostream& os ) const - { - os << "play"; - return os; - } - - - bool Play::hasContents() const - { - return true; - } - - - std::ostream& Play::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - switch ( myChoice ) - { - case Choice::ipa: - { - myIpa->toStream( os, indentLevel+1 ); - } - break; - case Choice::mute: - { - myMute->toStream( os, indentLevel+1 ); - } - break; - case Choice::semiPitched: - { - mySemiPitched->toStream( os, indentLevel+1 ); - } - break; - case Choice::otherPlay: - { - myOtherPlay->toStream( os, indentLevel+1 ); - } - break; - default: - break; - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - PlayAttributesPtr Play::getAttributes() const - { - return myAttributes; - } - - - void Play::setAttributes( const PlayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - Play::Choice Play::getChoice() const - { - return myChoice; - } - - - void Play::setChoice( const Play::Choice value ) - { - myChoice = value; - } - - - IpaPtr Play::getIpa() const - { - return myIpa; - } - - - void Play::setIpa( const IpaPtr& value ) - { - if( value ) - { - myIpa = value; - } - } - - - MutePtr Play::getMute() const - { - return myMute; - } - - - void Play::setMute( const MutePtr& value ) - { - if( value ) - { - myMute = value; - } - } - - - SemiPitchedPtr Play::getSemiPitched() const - { - return mySemiPitched; - } - - - void Play::setSemiPitched( const SemiPitchedPtr& value ) - { - if( value ) - { - mySemiPitched = value; - } - } - - - OtherPlayPtr Play::getOtherPlay() const - { - return myOtherPlay; - } - - - void Play::setOtherPlay( const OtherPlayPtr& value ) - { - if( value ) - { - myOtherPlay = value; - } - } - - - bool Play::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - if( xelement.getName() == "ipa" ) - { - myChoice = Choice::ipa; - return getIpa()->fromXElement( message, xelement ); - } - else if( xelement.getName() == "mute" ) - { - myChoice = Choice::mute; - return getMute()->fromXElement( message, xelement ); - } - else if( xelement.getName() == "semi-pitched" ) - { - myChoice = Choice::semiPitched; - return getSemiPitched()->fromXElement( message, xelement ); - } - else if( xelement.getName() == "other-play" ) - { - myChoice = Choice::otherPlay; - return getOtherPlay()->fromXElement( message, xelement ); - } - - message << "Encoding: '" << xelement.getName() << "' is not valid" << std::endl; - return false; - } + case Choice::ipa: { + myIpa->toStream(os, indentLevel + 1); + } + break; + case Choice::mute: { + myMute->toStream(os, indentLevel + 1); + } + break; + case Choice::semiPitched: { + mySemiPitched->toStream(os, indentLevel + 1); + } + break; + case Choice::otherPlay: { + myOtherPlay->toStream(os, indentLevel + 1); + } + break; + default: + break; + } + isOneLineOnly = false; + os << std::endl; + return os; +} + +PlayAttributesPtr Play::getAttributes() const +{ + return myAttributes; +} +void Play::setAttributes(const PlayAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +Play::Choice Play::getChoice() const +{ + return myChoice; +} + +void Play::setChoice(const Play::Choice value) +{ + myChoice = value; +} + +IpaPtr Play::getIpa() const +{ + return myIpa; +} + +void Play::setIpa(const IpaPtr &value) +{ + if (value) + { + myIpa = value; + } +} + +MutePtr Play::getMute() const +{ + return myMute; +} + +void Play::setMute(const MutePtr &value) +{ + if (value) + { + myMute = value; + } +} + +SemiPitchedPtr Play::getSemiPitched() const +{ + return mySemiPitched; +} + +void Play::setSemiPitched(const SemiPitchedPtr &value) +{ + if (value) + { + mySemiPitched = value; + } +} + +OtherPlayPtr Play::getOtherPlay() const +{ + return myOtherPlay; +} + +void Play::setOtherPlay(const OtherPlayPtr &value) +{ + if (value) + { + myOtherPlay = value; + } +} + +bool Play::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + if (xelement.getName() == "ipa") + { + myChoice = Choice::ipa; + return getIpa()->fromXElement(message, xelement); + } + else if (xelement.getName() == "mute") + { + myChoice = Choice::mute; + return getMute()->fromXElement(message, xelement); + } + else if (xelement.getName() == "semi-pitched") + { + myChoice = Choice::semiPitched; + return getSemiPitched()->fromXElement(message, xelement); + } + else if (xelement.getName() == "other-play") + { + myChoice = Choice::otherPlay; + return getOtherPlay()->fromXElement(message, xelement); + } + + message << "Encoding: '" << xelement.getName() << "' is not valid" << std::endl; + return false; +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Play.h b/Sourcecode/private/mx/core/elements/Play.h index e939ed8e6..b630110d1 100644 --- a/Sourcecode/private/mx/core/elements/Play.h +++ b/Sourcecode/private/mx/core/elements/Play.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PlayAttributes.h" #include @@ -14,69 +14,71 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PlayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Ipa ) - MX_FORWARD_DECLARE_ELEMENT( Mute ) - MX_FORWARD_DECLARE_ELEMENT( OtherPlay ) - MX_FORWARD_DECLARE_ELEMENT( SemiPitched ) - MX_FORWARD_DECLARE_ELEMENT( Play ) +MX_FORWARD_DECLARE_ATTRIBUTES(PlayAttributes) +MX_FORWARD_DECLARE_ELEMENT(Ipa) +MX_FORWARD_DECLARE_ELEMENT(Mute) +MX_FORWARD_DECLARE_ELEMENT(OtherPlay) +MX_FORWARD_DECLARE_ELEMENT(SemiPitched) +MX_FORWARD_DECLARE_ELEMENT(Play) - inline PlayPtr makePlay() { return std::make_shared(); } +inline PlayPtr makePlay() +{ + return std::make_shared(); +} - class Play : public ElementInterface - { - public: - enum class Choice - { - ipa = 1, - mute = 2, - semiPitched = 3, - otherPlay = 4 - }; - Play(); +class Play : public ElementInterface +{ + public: + enum class Choice + { + ipa = 1, + mute = 2, + semiPitched = 3, + otherPlay = 4 + }; + Play(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PlayAttributesPtr getAttributes() const; - void setAttributes( const PlayAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PlayAttributesPtr getAttributes() const; + void setAttributes(const PlayAttributesPtr &value); - /* _________ Choice __________ */ - Play::Choice getChoice() const; - void setChoice( const Play::Choice value ); + /* _________ Choice __________ */ + Play::Choice getChoice() const; + void setChoice(const Play::Choice value); - /* _________ Ipa minOccurs = 1, maxOccurs = 1 _________ */ - IpaPtr getIpa() const; - void setIpa( const IpaPtr& value ); + /* _________ Ipa minOccurs = 1, maxOccurs = 1 _________ */ + IpaPtr getIpa() const; + void setIpa(const IpaPtr &value); - /* _________ Mute minOccurs = 1, maxOccurs = 1 _________ */ - MutePtr getMute() const; - void setMute( const MutePtr& value ); + /* _________ Mute minOccurs = 1, maxOccurs = 1 _________ */ + MutePtr getMute() const; + void setMute(const MutePtr &value); - /* _________ SemiPitched minOccurs = 1, maxOccurs = 1 _________ */ - SemiPitchedPtr getSemiPitched() const; - void setSemiPitched( const SemiPitchedPtr& value ); + /* _________ SemiPitched minOccurs = 1, maxOccurs = 1 _________ */ + SemiPitchedPtr getSemiPitched() const; + void setSemiPitched(const SemiPitchedPtr &value); - /* _________ OtherPlay minOccurs = 1, maxOccurs = 1 _________ */ - OtherPlayPtr getOtherPlay() const; - void setOtherPlay( const OtherPlayPtr& value ); - + /* _________ OtherPlay minOccurs = 1, maxOccurs = 1 _________ */ + OtherPlayPtr getOtherPlay() const; + void setOtherPlay(const OtherPlayPtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - PlayAttributesPtr myAttributes; - Choice myChoice; - IpaPtr myIpa; - MutePtr myMute; - SemiPitchedPtr mySemiPitched; - OtherPlayPtr myOtherPlay; - }; - } -} + private: + PlayAttributesPtr myAttributes; + Choice myChoice; + IpaPtr myIpa; + MutePtr myMute; + SemiPitchedPtr mySemiPitched; + OtherPlayPtr myOtherPlay; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PlayAttributes.cpp b/Sourcecode/private/mx/core/elements/PlayAttributes.cpp index e028efefa..0bcdea715 100644 --- a/Sourcecode/private/mx/core/elements/PlayAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PlayAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - PlayAttributes::PlayAttributes() - :id() - ,hasId( false ) - {} - +namespace core +{ +PlayAttributes::PlayAttributes() : id(), hasId(false) +{ +} - bool PlayAttributes::hasValues() const - { - return hasId; - } +bool PlayAttributes::hasValues() const +{ + return hasId; +} +std::ostream &PlayAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, id, "id", hasId); + } + return os; +} - std::ostream& PlayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } +bool PlayAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PlayAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PlayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, id, hasId, "id")) { - const char* const className = "PlayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, hasId, "id" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PlayAttributes.h b/Sourcecode/private/mx/core/elements/PlayAttributes.h index e300001f4..4a222cc83 100644 --- a/Sourcecode/private/mx/core/elements/PlayAttributes.h +++ b/Sourcecode/private/mx/core/elements/PlayAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsIDREF.h" #include @@ -15,22 +15,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PlayAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PlayAttributes) - struct PlayAttributes : public AttributesInterface - { - public: - PlayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsIDREF id; - bool hasId; +struct PlayAttributes : public AttributesInterface +{ + public: + PlayAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsIDREF id; + bool hasId; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Plop.cpp b/Sourcecode/private/mx/core/elements/Plop.cpp index 96a0def57..50e085b48 100644 --- a/Sourcecode/private/mx/core/elements/Plop.cpp +++ b/Sourcecode/private/mx/core/elements/Plop.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Plop::Plop() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Plop::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Plop::hasContents() const { return false; } - std::ostream& Plop::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Plop::streamName( std::ostream& os ) const { os << "plop"; return os; } - std::ostream& Plop::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Plop::Plop() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Plop::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyLineAttributesPtr Plop::getAttributes() const - { - return myAttributes; - } +bool Plop::hasContents() const +{ + return false; +} +std::ostream &Plop::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Plop::setAttributes( const EmptyLineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Plop::streamName(std::ostream &os) const +{ + os << "plop"; + return os; +} +std::ostream &Plop::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Plop::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyLineAttributesPtr Plop::getAttributes() const +{ + return myAttributes; +} +void Plop::setAttributes(const EmptyLineAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Plop::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Plop.h b/Sourcecode/private/mx/core/elements/Plop.h index 760e64505..58ede582f 100644 --- a/Sourcecode/private/mx/core/elements/Plop.h +++ b/Sourcecode/private/mx/core/elements/Plop.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyLineAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Plop ) - - inline PlopPtr makePlop() { return std::make_shared(); } - - class Plop : public ElementInterface - { - public: - Plop(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyLineAttributesPtr getAttributes() const; - void setAttributes( const EmptyLineAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyLineAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyLineAttributes) +MX_FORWARD_DECLARE_ELEMENT(Plop) + +inline PlopPtr makePlop() +{ + return std::make_shared(); } + +class Plop : public ElementInterface +{ + public: + Plop(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyLineAttributesPtr getAttributes() const; + void setAttributes(const EmptyLineAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyLineAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pluck.cpp b/Sourcecode/private/mx/core/elements/Pluck.cpp index ff394fd83..bd85f1964 100644 --- a/Sourcecode/private/mx/core/elements/Pluck.cpp +++ b/Sourcecode/private/mx/core/elements/Pluck.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Pluck::Pluck() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Pluck::Pluck( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Pluck::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Pluck::hasContents() const - { - return true; - } - - - std::ostream& Pluck::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Pluck::streamName( std::ostream& os ) const - { - os << "pluck"; - return os; - } - - - std::ostream& Pluck::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Pluck::Pluck() : myValue(), myAttributes(std::make_shared()) +{ +} +Pluck::Pluck(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - PluckAttributesPtr Pluck::getAttributes() const - { - return myAttributes; - } +bool Pluck::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Pluck::hasContents() const +{ + return true; +} - void Pluck::setAttributes( const PluckAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Pluck::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Pluck::streamName(std::ostream &os) const +{ + os << "pluck"; + return os; +} - XsString Pluck::getValue() const - { - return myValue; - } +std::ostream &Pluck::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PluckAttributesPtr Pluck::getAttributes() const +{ + return myAttributes; +} - void Pluck::setValue( const XsString& value ) - { - myValue = value; - } +void Pluck::setAttributes(const PluckAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Pluck::getValue() const +{ + return myValue; +} - bool Pluck::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } +void Pluck::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Pluck::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Pluck.h b/Sourcecode/private/mx/core/elements/Pluck.h index 72c163cf6..e7fb6492b 100644 --- a/Sourcecode/private/mx/core/elements/Pluck.h +++ b/Sourcecode/private/mx/core/elements/Pluck.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/PluckAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PluckAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Pluck ) - - inline PluckPtr makePluck() { return std::make_shared(); } - inline PluckPtr makePluck( const XsString& value ) { return std::make_shared( value ); } - inline PluckPtr makePluck( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Pluck : public ElementInterface - { - public: - Pluck(); - Pluck( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PluckAttributesPtr getAttributes() const; - void setAttributes( const PluckAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PluckAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PluckAttributes) +MX_FORWARD_DECLARE_ELEMENT(Pluck) + +inline PluckPtr makePluck() +{ + return std::make_shared(); +} + +inline PluckPtr makePluck(const XsString &value) +{ + return std::make_shared(value); } + +inline PluckPtr makePluck(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Pluck : public ElementInterface +{ + public: + Pluck(); + Pluck(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PluckAttributesPtr getAttributes() const; + void setAttributes(const PluckAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + PluckAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PluckAttributes.cpp b/Sourcecode/private/mx/core/elements/PluckAttributes.cpp index a95059b2d..c876f36ab 100644 --- a/Sourcecode/private/mx/core/elements/PluckAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PluckAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +PluckAttributes::PluckAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), placement(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool PluckAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &PluckAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PluckAttributes::PluckAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool PluckAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PluckAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PluckAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& PluckAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool PluckAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "PluckAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PluckAttributes.h b/Sourcecode/private/mx/core/elements/PluckAttributes.h index 22b051cd1..05127b27c 100644 --- a/Sourcecode/private/mx/core/elements/PluckAttributes.h +++ b/Sourcecode/private/mx/core/elements/PluckAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PluckAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PluckAttributes) - struct PluckAttributes : public AttributesInterface - { - public: - PluckAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct PluckAttributes : public AttributesInterface +{ + public: + PluckAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PreBend.cpp b/Sourcecode/private/mx/core/elements/PreBend.cpp index eb90e121b..35e278dd2 100644 --- a/Sourcecode/private/mx/core/elements/PreBend.cpp +++ b/Sourcecode/private/mx/core/elements/PreBend.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - PreBend::PreBend() : ElementInterface() {} - +namespace core +{ +PreBend::PreBend() : ElementInterface() +{ +} - bool PreBend::hasAttributes() const { return false; } +bool PreBend::hasAttributes() const +{ + return false; +} +bool PreBend::hasContents() const +{ + return false; +} - bool PreBend::hasContents() const { return false; } - std::ostream& PreBend::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& PreBend::streamName( std::ostream& os ) const { os << "pre-bend"; return os; } - std::ostream& PreBend::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &PreBend::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &PreBend::streamName(std::ostream &os) const +{ + os << "pre-bend"; + return os; +} - bool PreBend::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &PreBend::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool PreBend::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PreBend.h b/Sourcecode/private/mx/core/elements/PreBend.h index f4d0c2839..d618212b0 100644 --- a/Sourcecode/private/mx/core/elements/PreBend.h +++ b/Sourcecode/private/mx/core/elements/PreBend.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PreBend ) - - inline PreBendPtr makePreBend() { return std::make_shared(); } - - class PreBend : public ElementInterface - { - public: - PreBend(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(PreBend) + +inline PreBendPtr makePreBend() +{ + return std::make_shared(); } + +class PreBend : public ElementInterface +{ + public: + PreBend(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Prefix.cpp b/Sourcecode/private/mx/core/elements/Prefix.cpp index 047a3077a..2842b7017 100644 --- a/Sourcecode/private/mx/core/elements/Prefix.cpp +++ b/Sourcecode/private/mx/core/elements/Prefix.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Prefix::Prefix() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Prefix::Prefix( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Prefix::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Prefix::hasContents() const - { - return true; - } - - - std::ostream& Prefix::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Prefix::streamName( std::ostream& os ) const - { - os << "prefix"; - return os; - } - - - std::ostream& Prefix::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Prefix::Prefix() : myValue(), myAttributes(std::make_shared()) +{ +} +Prefix::Prefix(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - PrefixAttributesPtr Prefix::getAttributes() const - { - return myAttributes; - } +bool Prefix::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Prefix::hasContents() const +{ + return true; +} - void Prefix::setAttributes( const PrefixAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Prefix::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Prefix::streamName(std::ostream &os) const +{ + os << "prefix"; + return os; +} - XsString Prefix::getValue() const - { - return myValue; - } +std::ostream &Prefix::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PrefixAttributesPtr Prefix::getAttributes() const +{ + return myAttributes; +} - void Prefix::setValue( const XsString& value ) - { - myValue = value; - } +void Prefix::setAttributes(const PrefixAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Prefix::getValue() const +{ + return myValue; +} - bool Prefix::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Prefix::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Prefix::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Prefix.h b/Sourcecode/private/mx/core/elements/Prefix.h index 2b2fb0ab9..2a2340244 100644 --- a/Sourcecode/private/mx/core/elements/Prefix.h +++ b/Sourcecode/private/mx/core/elements/Prefix.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/PrefixAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PrefixAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Prefix ) - - inline PrefixPtr makePrefix() { return std::make_shared(); } - inline PrefixPtr makePrefix( const XsString& value ) { return std::make_shared( value ); } - inline PrefixPtr makePrefix( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Prefix : public ElementInterface - { - public: - Prefix(); - Prefix( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PrefixAttributesPtr getAttributes() const; - void setAttributes( const PrefixAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PrefixAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PrefixAttributes) +MX_FORWARD_DECLARE_ELEMENT(Prefix) + +inline PrefixPtr makePrefix() +{ + return std::make_shared(); +} + +inline PrefixPtr makePrefix(const XsString &value) +{ + return std::make_shared(value); } + +inline PrefixPtr makePrefix(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Prefix : public ElementInterface +{ + public: + Prefix(); + Prefix(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PrefixAttributesPtr getAttributes() const; + void setAttributes(const PrefixAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + PrefixAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PrefixAttributes.cpp b/Sourcecode/private/mx/core/elements/PrefixAttributes.cpp index d3ac584ca..12ae62f22 100644 --- a/Sourcecode/private/mx/core/elements/PrefixAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PrefixAttributes.cpp @@ -8,81 +8,85 @@ namespace mx { - namespace core +namespace core +{ +PrefixAttributes::PrefixAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false) +{ +} + +bool PrefixAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight; +} + +std::ostream &PrefixAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PrefixAttributes::PrefixAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool PrefixAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PrefixAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PrefixAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& PrefixAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool PrefixAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "PrefixAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PrefixAttributes.h b/Sourcecode/private/mx/core/elements/PrefixAttributes.h index db2dcb7a5..dbc55a3c8 100644 --- a/Sourcecode/private/mx/core/elements/PrefixAttributes.h +++ b/Sourcecode/private/mx/core/elements/PrefixAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,36 +17,36 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PrefixAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PrefixAttributes) - struct PrefixAttributes : public AttributesInterface - { - public: - PrefixAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct PrefixAttributes : public AttributesInterface +{ + public: + PrefixAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoice.cpp b/Sourcecode/private/mx/core/elements/PrincipalVoice.cpp index 8e981dffc..eb8ec6f75 100644 --- a/Sourcecode/private/mx/core/elements/PrincipalVoice.cpp +++ b/Sourcecode/private/mx/core/elements/PrincipalVoice.cpp @@ -8,92 +8,80 @@ namespace mx { - namespace core - { - PrincipalVoice::PrincipalVoice() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PrincipalVoice::PrincipalVoice( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PrincipalVoice::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PrincipalVoice::hasContents() const - { - return true; - } - - - std::ostream& PrincipalVoice::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PrincipalVoice::streamName( std::ostream& os ) const - { - os << "principal-voice"; - return os; - } - - - std::ostream& PrincipalVoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +PrincipalVoice::PrincipalVoice() : myValue(), myAttributes(std::make_shared()) +{ +} +PrincipalVoice::PrincipalVoice(const XsString &value) + : myValue(value), myAttributes(std::make_shared()) +{ +} - PrincipalVoiceAttributesPtr PrincipalVoice::getAttributes() const - { - return myAttributes; - } +bool PrincipalVoice::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool PrincipalVoice::hasContents() const +{ + return true; +} - void PrincipalVoice::setAttributes( const PrincipalVoiceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &PrincipalVoice::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &PrincipalVoice::streamName(std::ostream &os) const +{ + os << "principal-voice"; + return os; +} - XsString PrincipalVoice::getValue() const - { - return myValue; - } +std::ostream &PrincipalVoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PrincipalVoiceAttributesPtr PrincipalVoice::getAttributes() const +{ + return myAttributes; +} - void PrincipalVoice::setValue( const XsString& value ) - { - myValue = value; - } +void PrincipalVoice::setAttributes(const PrincipalVoiceAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString PrincipalVoice::getValue() const +{ + return myValue; +} - bool PrincipalVoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void PrincipalVoice::setValue(const XsString &value) +{ + myValue = value; +} - } +bool PrincipalVoice::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoice.h b/Sourcecode/private/mx/core/elements/PrincipalVoice.h index 37ff1a9ed..090cd510d 100644 --- a/Sourcecode/private/mx/core/elements/PrincipalVoice.h +++ b/Sourcecode/private/mx/core/elements/PrincipalVoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/PrincipalVoiceAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PrincipalVoiceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PrincipalVoice ) - - inline PrincipalVoicePtr makePrincipalVoice() { return std::make_shared(); } - inline PrincipalVoicePtr makePrincipalVoice( const XsString& value ) { return std::make_shared( value ); } - inline PrincipalVoicePtr makePrincipalVoice( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PrincipalVoice : public ElementInterface - { - public: - PrincipalVoice(); - PrincipalVoice( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PrincipalVoiceAttributesPtr getAttributes() const; - void setAttributes( const PrincipalVoiceAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PrincipalVoiceAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PrincipalVoiceAttributes) +MX_FORWARD_DECLARE_ELEMENT(PrincipalVoice) + +inline PrincipalVoicePtr makePrincipalVoice() +{ + return std::make_shared(); +} + +inline PrincipalVoicePtr makePrincipalVoice(const XsString &value) +{ + return std::make_shared(value); } + +inline PrincipalVoicePtr makePrincipalVoice(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class PrincipalVoice : public ElementInterface +{ + public: + PrincipalVoice(); + PrincipalVoice(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PrincipalVoiceAttributesPtr getAttributes() const; + void setAttributes(const PrincipalVoiceAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + PrincipalVoiceAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp b/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp index 41ec545cb..3204aeee0 100644 --- a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp @@ -8,108 +8,115 @@ namespace mx { - namespace core +namespace core +{ +PrincipalVoiceAttributes::PrincipalVoiceAttributes() + : type(StartStop::start), symbol(PrincipalVoiceSymbol::none), defaultX(), defaultY(), relativeX(), relativeY(), + fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), halign(), hasType(true), hasSymbol(true), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false), hasHalign(false) +{ +} + +bool PrincipalVoiceAttributes::hasValues() const +{ + return hasType || hasSymbol || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight || hasHalign; +} + +std::ostream &PrincipalVoiceAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PrincipalVoiceAttributes::PrincipalVoiceAttributes() - :type( StartStop::start ) - ,symbol( PrincipalVoiceSymbol::none ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,hasType( true ) - ,hasSymbol( true ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, symbol, "symbol", hasSymbol); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + } + return os; +} +bool PrincipalVoiceAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PrincipalVoiceAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + bool isSymbolFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PrincipalVoiceAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - return hasType || - hasSymbol || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; + continue; } - - - std::ostream& PrincipalVoiceAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, symbol, isSymbolFound, "symbol", + &parsePrincipalVoiceSymbol)) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, symbol, "symbol", hasSymbol ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; + continue; } - - - bool PrincipalVoiceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - const char* const className = "PrincipalVoiceAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - bool isSymbolFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, symbol, isSymbolFound, "symbol", &parsePrincipalVoiceSymbol ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isSymbolFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + if (!isSymbolFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; + } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h b/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h index 354303956..46097d1bc 100644 --- a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h +++ b/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,42 +17,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PrincipalVoiceAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PrincipalVoiceAttributes) - struct PrincipalVoiceAttributes : public AttributesInterface - { - public: - PrincipalVoiceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - PrincipalVoiceSymbol symbol; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - const bool hasType; - const bool hasSymbol; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; +struct PrincipalVoiceAttributes : public AttributesInterface +{ + public: + PrincipalVoiceAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + PrincipalVoiceSymbol symbol; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + const bool hasType; + const bool hasSymbol; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Print.cpp b/Sourcecode/private/mx/core/elements/Print.cpp index 69082f6e2..574d8e36a 100644 --- a/Sourcecode/private/mx/core/elements/Print.cpp +++ b/Sourcecode/private/mx/core/elements/Print.cpp @@ -13,246 +13,224 @@ namespace mx { - namespace core - { - Print::Print() - :myAttributes( std::make_shared() ) - ,myLayoutGroup( makeLayoutGroup() ) - ,myMeasureLayout( makeMeasureLayout() ) - ,myHasMeasureLayout( false ) - ,myMeasureNumbering( makeMeasureNumbering() ) - ,myHasMeasureNumbering( false ) - ,myPartNameDisplay( makePartNameDisplay() ) - ,myHasPartNameDisplay( false ) - ,myPartAbbreviationDisplay( makePartAbbreviationDisplay() ) - ,myHasPartAbbreviationDisplay( false ) - {} - - - bool Print::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Print::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Print::streamName( std::ostream& os ) const - { - os << "print"; - return os; - } - - - bool Print::hasContents() const - { - return myLayoutGroup->hasContents() - || myHasMeasureLayout - || myHasMeasureNumbering - || myHasPartNameDisplay - || myHasPartAbbreviationDisplay; - } - - - std::ostream& Print::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myLayoutGroup->hasContents() ) - { - os << std::endl; - myLayoutGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasMeasureLayout ) - { - os << std::endl; - myMeasureLayout->toStream( os, indentLevel+1 ); - } - if ( myHasMeasureNumbering ) - { - os << std::endl; - myMeasureNumbering->toStream( os, indentLevel+1 ); - } - if ( myHasPartNameDisplay ) - { - os << std::endl; - myPartNameDisplay->toStream( os, indentLevel+1 ); - } - if ( myHasPartAbbreviationDisplay ) - { - os << std::endl; - myPartAbbreviationDisplay->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - +namespace core +{ +Print::Print() + : myAttributes(std::make_shared()), myLayoutGroup(makeLayoutGroup()), + myMeasureLayout(makeMeasureLayout()), myHasMeasureLayout(false), myMeasureNumbering(makeMeasureNumbering()), + myHasMeasureNumbering(false), myPartNameDisplay(makePartNameDisplay()), myHasPartNameDisplay(false), + myPartAbbreviationDisplay(makePartAbbreviationDisplay()), myHasPartAbbreviationDisplay(false) +{ +} - PrintAttributesPtr Print::getAttributes() const - { - return myAttributes; - } +bool Print::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Print::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void Print::setAttributes( const PrintAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Print::streamName(std::ostream &os) const +{ + os << "print"; + return os; +} +bool Print::hasContents() const +{ + return myLayoutGroup->hasContents() || myHasMeasureLayout || myHasMeasureNumbering || myHasPartNameDisplay || + myHasPartAbbreviationDisplay; +} - LayoutGroupPtr Print::getLayoutGroup() const +std::ostream &Print::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + if (myLayoutGroup->hasContents()) { - return myLayoutGroup; + os << std::endl; + myLayoutGroup->streamContents(os, indentLevel + 1, isOneLineOnly); } - - - void Print::setLayoutGroup( const LayoutGroupPtr& value ) + if (myHasMeasureLayout) { - if ( value ) - { - myLayoutGroup = value; - } + os << std::endl; + myMeasureLayout->toStream(os, indentLevel + 1); } - - - MeasureLayoutPtr Print::getMeasureLayout() const + if (myHasMeasureNumbering) { - return myMeasureLayout; + os << std::endl; + myMeasureNumbering->toStream(os, indentLevel + 1); } - - - void Print::setMeasureLayout( const MeasureLayoutPtr& value ) + if (myHasPartNameDisplay) { - if ( value ) - { - myMeasureLayout = value; - } + os << std::endl; + myPartNameDisplay->toStream(os, indentLevel + 1); } - - - bool Print::getHasMeasureLayout() const + if (myHasPartAbbreviationDisplay) { - return myHasMeasureLayout; + os << std::endl; + myPartAbbreviationDisplay->toStream(os, indentLevel + 1); } + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +PrintAttributesPtr Print::getAttributes() const +{ + return myAttributes; +} - void Print::setHasMeasureLayout( const bool value ) - { - myHasMeasureLayout = value; - } +void Print::setAttributes(const PrintAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +LayoutGroupPtr Print::getLayoutGroup() const +{ + return myLayoutGroup; +} - MeasureNumberingPtr Print::getMeasureNumbering() const - { - return myMeasureNumbering; - } +void Print::setLayoutGroup(const LayoutGroupPtr &value) +{ + if (value) + { + myLayoutGroup = value; + } +} +MeasureLayoutPtr Print::getMeasureLayout() const +{ + return myMeasureLayout; +} - void Print::setMeasureNumbering( const MeasureNumberingPtr& value ) - { - if ( value ) - { - myMeasureNumbering = value; - } - } +void Print::setMeasureLayout(const MeasureLayoutPtr &value) +{ + if (value) + { + myMeasureLayout = value; + } +} +bool Print::getHasMeasureLayout() const +{ + return myHasMeasureLayout; +} - bool Print::getHasMeasureNumbering() const - { - return myHasMeasureNumbering; - } +void Print::setHasMeasureLayout(const bool value) +{ + myHasMeasureLayout = value; +} +MeasureNumberingPtr Print::getMeasureNumbering() const +{ + return myMeasureNumbering; +} - void Print::setHasMeasureNumbering( const bool value ) - { - myHasMeasureNumbering = value; - } +void Print::setMeasureNumbering(const MeasureNumberingPtr &value) +{ + if (value) + { + myMeasureNumbering = value; + } +} +bool Print::getHasMeasureNumbering() const +{ + return myHasMeasureNumbering; +} - PartNameDisplayPtr Print::getPartNameDisplay() const - { - return myPartNameDisplay; - } +void Print::setHasMeasureNumbering(const bool value) +{ + myHasMeasureNumbering = value; +} +PartNameDisplayPtr Print::getPartNameDisplay() const +{ + return myPartNameDisplay; +} - void Print::setPartNameDisplay( const PartNameDisplayPtr& value ) - { - if ( value ) - { - myPartNameDisplay = value; - } - } +void Print::setPartNameDisplay(const PartNameDisplayPtr &value) +{ + if (value) + { + myPartNameDisplay = value; + } +} +bool Print::getHasPartNameDisplay() const +{ + return myHasPartNameDisplay; +} - bool Print::getHasPartNameDisplay() const - { - return myHasPartNameDisplay; - } +void Print::setHasPartNameDisplay(const bool value) +{ + myHasPartNameDisplay = value; +} +PartAbbreviationDisplayPtr Print::getPartAbbreviationDisplay() const +{ + return myPartAbbreviationDisplay; +} - void Print::setHasPartNameDisplay( const bool value ) - { - myHasPartNameDisplay = value; - } +void Print::setPartAbbreviationDisplay(const PartAbbreviationDisplayPtr &value) +{ + if (value) + { + myPartAbbreviationDisplay = value; + } +} +bool Print::getHasPartAbbreviationDisplay() const +{ + return myHasPartAbbreviationDisplay; +} - PartAbbreviationDisplayPtr Print::getPartAbbreviationDisplay() const - { - return myPartAbbreviationDisplay; - } +void Print::setHasPartAbbreviationDisplay(const bool value) +{ + myHasPartAbbreviationDisplay = value; +} +bool Print::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - void Print::setPartAbbreviationDisplay( const PartAbbreviationDisplayPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importGroup(message, it, endIter, isSuccess, myLayoutGroup); + if (importElement(message, *it, isSuccess, *myMeasureLayout, myHasMeasureLayout)) { - if ( value ) - { - myPartAbbreviationDisplay = value; - } + continue; } - - - bool Print::getHasPartAbbreviationDisplay() const + if (importElement(message, *it, isSuccess, *myMeasureNumbering, myHasMeasureNumbering)) { - return myHasPartAbbreviationDisplay; + continue; } - - - void Print::setHasPartAbbreviationDisplay( const bool value ) + if (importElement(message, *it, isSuccess, *myPartNameDisplay, myHasPartNameDisplay)) { - myHasPartAbbreviationDisplay = value; + continue; } - - - bool Print::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myPartAbbreviationDisplay, myHasPartAbbreviationDisplay)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importGroup( message, it, endIter, isSuccess, myLayoutGroup ); - if ( importElement( message, *it, isSuccess, *myMeasureLayout, myHasMeasureLayout ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMeasureNumbering, myHasMeasureNumbering ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPartNameDisplay, myHasPartNameDisplay ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPartAbbreviationDisplay, myHasPartAbbreviationDisplay ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Print.h b/Sourcecode/private/mx/core/elements/Print.h index a89e87cff..25a6d9c8f 100644 --- a/Sourcecode/private/mx/core/elements/Print.h +++ b/Sourcecode/private/mx/core/elements/Print.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/PrintAttributes.h" #include @@ -14,74 +14,77 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PrintAttributes) +MX_FORWARD_DECLARE_ELEMENT(LayoutGroup) +MX_FORWARD_DECLARE_ELEMENT(MeasureLayout) +MX_FORWARD_DECLARE_ELEMENT(MeasureNumbering) +MX_FORWARD_DECLARE_ELEMENT(PartAbbreviationDisplay) +MX_FORWARD_DECLARE_ELEMENT(PartNameDisplay) +MX_FORWARD_DECLARE_ELEMENT(Print) - MX_FORWARD_DECLARE_ATTRIBUTES( PrintAttributes ) - MX_FORWARD_DECLARE_ELEMENT( LayoutGroup ) - MX_FORWARD_DECLARE_ELEMENT( MeasureLayout ) - MX_FORWARD_DECLARE_ELEMENT( MeasureNumbering ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviationDisplay ) - MX_FORWARD_DECLARE_ELEMENT( PartNameDisplay ) - MX_FORWARD_DECLARE_ELEMENT( Print ) +inline PrintPtr makePrint() +{ + return std::make_shared(); +} - inline PrintPtr makePrint() { return std::make_shared(); } +class Print : public ElementInterface +{ + public: + Print(); - class Print : public ElementInterface - { - public: - Print(); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PrintAttributesPtr getAttributes() const; + void setAttributes(const PrintAttributesPtr &value); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PrintAttributesPtr getAttributes() const; - void setAttributes( const PrintAttributesPtr& value ); + /* _________ LayoutGroup minOccurs = 1, maxOccurs = 1 _________ */ + LayoutGroupPtr getLayoutGroup() const; + void setLayoutGroup(const LayoutGroupPtr &value); - /* _________ LayoutGroup minOccurs = 1, maxOccurs = 1 _________ */ - LayoutGroupPtr getLayoutGroup() const; - void setLayoutGroup( const LayoutGroupPtr& value ); + /* _________ MeasureLayout minOccurs = 0, maxOccurs = 1 _________ */ + MeasureLayoutPtr getMeasureLayout() const; + void setMeasureLayout(const MeasureLayoutPtr &value); + bool getHasMeasureLayout() const; + void setHasMeasureLayout(const bool value); - /* _________ MeasureLayout minOccurs = 0, maxOccurs = 1 _________ */ - MeasureLayoutPtr getMeasureLayout() const; - void setMeasureLayout( const MeasureLayoutPtr& value ); - bool getHasMeasureLayout() const; - void setHasMeasureLayout( const bool value ); + /* _________ MeasureNumbering minOccurs = 0, maxOccurs = 1 _________ */ + MeasureNumberingPtr getMeasureNumbering() const; + void setMeasureNumbering(const MeasureNumberingPtr &value); + bool getHasMeasureNumbering() const; + void setHasMeasureNumbering(const bool value); - /* _________ MeasureNumbering minOccurs = 0, maxOccurs = 1 _________ */ - MeasureNumberingPtr getMeasureNumbering() const; - void setMeasureNumbering( const MeasureNumberingPtr& value ); - bool getHasMeasureNumbering() const; - void setHasMeasureNumbering( const bool value ); + /* _________ PartNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ + PartNameDisplayPtr getPartNameDisplay() const; + void setPartNameDisplay(const PartNameDisplayPtr &value); + bool getHasPartNameDisplay() const; + void setHasPartNameDisplay(const bool value); - /* _________ PartNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ - PartNameDisplayPtr getPartNameDisplay() const; - void setPartNameDisplay( const PartNameDisplayPtr& value ); - bool getHasPartNameDisplay() const; - void setHasPartNameDisplay( const bool value ); + /* _________ PartAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ + PartAbbreviationDisplayPtr getPartAbbreviationDisplay() const; + void setPartAbbreviationDisplay(const PartAbbreviationDisplayPtr &value); + bool getHasPartAbbreviationDisplay() const; + void setHasPartAbbreviationDisplay(const bool value); - /* _________ PartAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ - PartAbbreviationDisplayPtr getPartAbbreviationDisplay() const; - void setPartAbbreviationDisplay( const PartAbbreviationDisplayPtr& value ); - bool getHasPartAbbreviationDisplay() const; - void setHasPartAbbreviationDisplay( const bool value ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PrintAttributesPtr myAttributes; - LayoutGroupPtr myLayoutGroup; - MeasureLayoutPtr myMeasureLayout; - bool myHasMeasureLayout; - MeasureNumberingPtr myMeasureNumbering; - bool myHasMeasureNumbering; - PartNameDisplayPtr myPartNameDisplay; - bool myHasPartNameDisplay; - PartAbbreviationDisplayPtr myPartAbbreviationDisplay; - bool myHasPartAbbreviationDisplay; - }; - } -} + private: + PrintAttributesPtr myAttributes; + LayoutGroupPtr myLayoutGroup; + MeasureLayoutPtr myMeasureLayout; + bool myHasMeasureLayout; + MeasureNumberingPtr myMeasureNumbering; + bool myHasMeasureNumbering; + PartNameDisplayPtr myPartNameDisplay; + bool myHasPartNameDisplay; + PartAbbreviationDisplayPtr myPartAbbreviationDisplay; + bool myHasPartAbbreviationDisplay; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PrintAttributes.cpp b/Sourcecode/private/mx/core/elements/PrintAttributes.cpp index 6fcf9dadb..cc7e11e8d 100644 --- a/Sourcecode/private/mx/core/elements/PrintAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PrintAttributes.cpp @@ -8,66 +8,66 @@ namespace mx { - namespace core +namespace core +{ +PrintAttributes::PrintAttributes() + : staffSpacing(), newSystem(YesNo::no), newPage(YesNo::no), blankPage(), pageNumber(), hasStaffSpacing(false), + hasNewSystem(false), hasNewPage(false), hasBlankPage(false), hasPageNumber(false) +{ +} + +bool PrintAttributes::hasValues() const +{ + return hasStaffSpacing || hasNewSystem || hasNewPage || hasBlankPage || hasPageNumber; +} + +std::ostream &PrintAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PrintAttributes::PrintAttributes() - :staffSpacing() - ,newSystem( YesNo::no ) - ,newPage( YesNo::no ) - ,blankPage() - ,pageNumber() - ,hasStaffSpacing( false ) - ,hasNewSystem( false ) - ,hasNewPage( false ) - ,hasBlankPage( false ) - ,hasPageNumber( false ) - {} + streamAttribute(os, staffSpacing, "staff-spacing", hasStaffSpacing); + streamAttribute(os, newSystem, "new-system", hasNewSystem); + streamAttribute(os, newPage, "new-page", hasNewPage); + streamAttribute(os, blankPage, "blank-page", hasBlankPage); + streamAttribute(os, pageNumber, "page-number", hasPageNumber); + } + return os; +} + +bool PrintAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PrintAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PrintAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, staffSpacing, hasStaffSpacing, "staff-spacing")) { - return hasStaffSpacing || - hasNewSystem || - hasNewPage || - hasBlankPage || - hasPageNumber; + continue; } - - - std::ostream& PrintAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, newSystem, hasNewSystem, "new-system", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, staffSpacing, "staff-spacing", hasStaffSpacing ); - streamAttribute( os, newSystem, "new-system", hasNewSystem ); - streamAttribute( os, newPage, "new-page", hasNewPage ); - streamAttribute( os, blankPage, "blank-page", hasBlankPage ); - streamAttribute( os, pageNumber, "page-number", hasPageNumber ); - } - return os; + continue; } - - - bool PrintAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, newPage, hasNewPage, "new-page", &parseYesNo)) { - const char* const className = "PrintAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, staffSpacing, hasStaffSpacing, "staff-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, newSystem, hasNewSystem, "new-system", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, newPage, hasNewPage, "new-page", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, blankPage, hasBlankPage, "blank-page" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, pageNumber, hasPageNumber, "page-number" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, blankPage, hasBlankPage, "blank-page")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, pageNumber, hasPageNumber, "page-number")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PrintAttributes.h b/Sourcecode/private/mx/core/elements/PrintAttributes.h index e69e30238..5a9b26402 100644 --- a/Sourcecode/private/mx/core/elements/PrintAttributes.h +++ b/Sourcecode/private/mx/core/elements/PrintAttributes.h @@ -4,11 +4,11 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -17,30 +17,30 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PrintAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PrintAttributes) - struct PrintAttributes : public AttributesInterface - { - public: - PrintAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue staffSpacing; - YesNo newSystem; - YesNo newPage; - PositiveInteger blankPage; - XsToken pageNumber; - bool hasStaffSpacing; - bool hasNewSystem; - bool hasNewPage; - bool hasBlankPage; - bool hasPageNumber; +struct PrintAttributes : public AttributesInterface +{ + public: + PrintAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue staffSpacing; + YesNo newSystem; + YesNo newPage; + PositiveInteger blankPage; + XsToken pageNumber; + bool hasStaffSpacing; + bool hasNewSystem; + bool hasNewPage; + bool hasBlankPage; + bool hasPageNumber; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Properties.cpp b/Sourcecode/private/mx/core/elements/Properties.cpp index 4b44fdcf5..4adcd0467 100644 --- a/Sourcecode/private/mx/core/elements/Properties.cpp +++ b/Sourcecode/private/mx/core/elements/Properties.cpp @@ -22,579 +22,533 @@ namespace mx { - namespace core - { - Properties::Properties() - :myEditorialGroup( makeEditorialGroup() ) - ,myDivisions( makeDivisions() ) - ,myHasDivisions( false ) - ,myKeySet() - ,myTimeSet() - ,myStaves( makeStaves() ) - ,myHasStaves( false ) - ,myPartSymbol( makePartSymbol() ) - ,myHasPartSymbol( false ) - ,myInstruments( makeInstruments() ) - ,myHasInstruments( false ) - ,myClefSet() - ,myStaffDetailsSet() - ,myTransposeSet() - ,myDirectiveSet() - ,myMeasureStyleSet() - {} - - - bool Properties::hasAttributes() const - { - return false; - } - +namespace core +{ +Properties::Properties() + : myEditorialGroup(makeEditorialGroup()), myDivisions(makeDivisions()), myHasDivisions(false), myKeySet(), + myTimeSet(), myStaves(makeStaves()), myHasStaves(false), myPartSymbol(makePartSymbol()), myHasPartSymbol(false), + myInstruments(makeInstruments()), myHasInstruments(false), myClefSet(), myStaffDetailsSet(), myTransposeSet(), + myDirectiveSet(), myMeasureStyleSet() +{ +} - std::ostream& Properties::streamAttributes( std::ostream& os ) const - { - return os; - } +bool Properties::hasAttributes() const +{ + return false; +} +std::ostream &Properties::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& Properties::streamName( std::ostream& os ) const - { - os << "attributes"; - return os; - } +std::ostream &Properties::streamName(std::ostream &os) const +{ + os << "attributes"; + return os; +} +bool Properties::hasContents() const +{ + return myEditorialGroup->hasContents() || myHasDivisions || myKeySet.size() > 0 || myTimeSet.size() > 0 || + myHasStaves || myHasPartSymbol || myHasInstruments || myClefSet.size() > 0 || myStaffDetailsSet.size() > 0 || + myTransposeSet.size() > 0 || myDirectiveSet.size() > 0 || myMeasureStyleSet.size() > 0; +} - bool Properties::hasContents() const +std::ostream &Properties::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (this->hasContents()) + { + if (myEditorialGroup->hasContents()) { - return myEditorialGroup->hasContents() - || myHasDivisions - || myKeySet.size() > 0 - || myTimeSet.size() > 0 - || myHasStaves - || myHasPartSymbol - || myHasInstruments - || myClefSet.size() > 0 - || myStaffDetailsSet.size() > 0 - || myTransposeSet.size() > 0 - || myDirectiveSet.size() > 0 - || myMeasureStyleSet.size() > 0; + os << std::endl; + myEditorialGroup->streamContents(os, indentLevel + 1, isOneLineOnly); } - - - std::ostream& Properties::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const + if (myHasDivisions) { - if ( this->hasContents() ) - { - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasDivisions ) - { - os << std::endl; - myDivisions->toStream( os, indentLevel+1 ); - } - for ( auto x : myKeySet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myTimeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasStaves ) - { - os << std::endl; - myStaves->toStream( os, indentLevel+1 ); - } - if ( myHasPartSymbol ) - { - os << std::endl; - myPartSymbol->toStream( os, indentLevel+1 ); - } - if ( myHasInstruments ) - { - os << std::endl; - myInstruments->toStream( os, indentLevel+1 ); - } - for ( auto x : myClefSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myStaffDetailsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myTransposeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myDirectiveSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myMeasureStyleSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; + os << std::endl; + myDivisions->toStream(os, indentLevel + 1); } - - - EditorialGroupPtr Properties::getEditorialGroup() const + for (auto x : myKeySet) { - return myEditorialGroup; + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - void Properties::setEditorialGroup( const EditorialGroupPtr& value ) + for (auto x : myTimeSet) { - if ( value ) - { - myEditorialGroup = value; - } + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - DivisionsPtr Properties::getDivisions() const + if (myHasStaves) { - return myDivisions; + os << std::endl; + myStaves->toStream(os, indentLevel + 1); } - - - void Properties::setDivisions( const DivisionsPtr& value ) + if (myHasPartSymbol) { - if( value ) - { - myDivisions = value; - } + os << std::endl; + myPartSymbol->toStream(os, indentLevel + 1); } - - - bool Properties::getHasDivisions() const + if (myHasInstruments) { - return myHasDivisions; + os << std::endl; + myInstruments->toStream(os, indentLevel + 1); } - - - void Properties::setHasDivisions( const bool value ) + for (auto x : myClefSet) { - myHasDivisions = value; + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - const KeySet& Properties::getKeySet() const + for (auto x : myStaffDetailsSet) { - return myKeySet; + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - void Properties::removeKey( const KeySetIterConst& value ) - { - if ( value != myKeySet.cend() ) - { - myKeySet.erase( value ); - } - } - - - void Properties::addKey( const KeyPtr& value ) + for (auto x : myTransposeSet) { - if ( value ) - { - myKeySet.push_back( value ); - } + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - void Properties::clearKeySet() + for (auto x : myDirectiveSet) { - myKeySet.clear(); + os << std::endl; + x->toStream(os, indentLevel + 1); } - - - KeyPtr Properties::getKey( const KeySetIterConst& setIterator ) const + for (auto x : myMeasureStyleSet) { - if( setIterator != myKeySet.cend() ) - { - return *setIterator; - } - return KeyPtr(); - } - - - const TimeSet& Properties::getTimeSet() const - { - return myTimeSet; - } - - - void Properties::removeTime( const TimeSetIterConst& value ) - { - if ( value != myTimeSet.cend() ) - { - myTimeSet.erase( value ); - } - } - - - void Properties::addTime( const TimePtr& value ) - { - if ( value ) - { - myTimeSet.push_back( value ); - } + os << std::endl; + x->toStream(os, indentLevel + 1); } + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +EditorialGroupPtr Properties::getEditorialGroup() const +{ + return myEditorialGroup; +} - void Properties::clearTimeSet() - { - myTimeSet.clear(); - } +void Properties::setEditorialGroup(const EditorialGroupPtr &value) +{ + if (value) + { + myEditorialGroup = value; + } +} +DivisionsPtr Properties::getDivisions() const +{ + return myDivisions; +} - TimePtr Properties::getTime( const TimeSetIterConst& setIterator ) const - { - if( setIterator != myTimeSet.cend() ) - { - return *setIterator; - } - return TimePtr(); - } +void Properties::setDivisions(const DivisionsPtr &value) +{ + if (value) + { + myDivisions = value; + } +} +bool Properties::getHasDivisions() const +{ + return myHasDivisions; +} - StavesPtr Properties::getStaves() const - { - return myStaves; - } +void Properties::setHasDivisions(const bool value) +{ + myHasDivisions = value; +} +const KeySet &Properties::getKeySet() const +{ + return myKeySet; +} - void Properties::setStaves( const StavesPtr& value ) - { - if( value ) - { - myStaves = value; - } - } +void Properties::removeKey(const KeySetIterConst &value) +{ + if (value != myKeySet.cend()) + { + myKeySet.erase(value); + } +} +void Properties::addKey(const KeyPtr &value) +{ + if (value) + { + myKeySet.push_back(value); + } +} - bool Properties::getHasStaves() const - { - return myHasStaves; - } +void Properties::clearKeySet() +{ + myKeySet.clear(); +} +KeyPtr Properties::getKey(const KeySetIterConst &setIterator) const +{ + if (setIterator != myKeySet.cend()) + { + return *setIterator; + } + return KeyPtr(); +} - void Properties::setHasStaves( const bool value ) - { - myHasStaves = value; - } +const TimeSet &Properties::getTimeSet() const +{ + return myTimeSet; +} +void Properties::removeTime(const TimeSetIterConst &value) +{ + if (value != myTimeSet.cend()) + { + myTimeSet.erase(value); + } +} - PartSymbolPtr Properties::getPartSymbol() const - { - return myPartSymbol; - } +void Properties::addTime(const TimePtr &value) +{ + if (value) + { + myTimeSet.push_back(value); + } +} +void Properties::clearTimeSet() +{ + myTimeSet.clear(); +} - void Properties::setPartSymbol( const PartSymbolPtr& value ) - { - if( value ) - { - myPartSymbol = value; - } - } +TimePtr Properties::getTime(const TimeSetIterConst &setIterator) const +{ + if (setIterator != myTimeSet.cend()) + { + return *setIterator; + } + return TimePtr(); +} +StavesPtr Properties::getStaves() const +{ + return myStaves; +} - bool Properties::getHasPartSymbol() const - { - return myHasPartSymbol; - } +void Properties::setStaves(const StavesPtr &value) +{ + if (value) + { + myStaves = value; + } +} +bool Properties::getHasStaves() const +{ + return myHasStaves; +} - void Properties::setHasPartSymbol( const bool value ) - { - myHasPartSymbol = value; - } +void Properties::setHasStaves(const bool value) +{ + myHasStaves = value; +} +PartSymbolPtr Properties::getPartSymbol() const +{ + return myPartSymbol; +} - InstrumentsPtr Properties::getInstruments() const - { - return myInstruments; - } +void Properties::setPartSymbol(const PartSymbolPtr &value) +{ + if (value) + { + myPartSymbol = value; + } +} +bool Properties::getHasPartSymbol() const +{ + return myHasPartSymbol; +} - void Properties::setInstruments( const InstrumentsPtr& value ) - { - if( value ) - { - myInstruments = value; - } - } +void Properties::setHasPartSymbol(const bool value) +{ + myHasPartSymbol = value; +} +InstrumentsPtr Properties::getInstruments() const +{ + return myInstruments; +} - bool Properties::getHasInstruments() const - { - return myHasInstruments; - } +void Properties::setInstruments(const InstrumentsPtr &value) +{ + if (value) + { + myInstruments = value; + } +} +bool Properties::getHasInstruments() const +{ + return myHasInstruments; +} - void Properties::setHasInstruments( const bool value ) - { - myHasInstruments = value; - } +void Properties::setHasInstruments(const bool value) +{ + myHasInstruments = value; +} +const ClefSet &Properties::getClefSet() const +{ + return myClefSet; +} - const ClefSet& Properties::getClefSet() const - { - return myClefSet; - } +void Properties::removeClef(const ClefSetIterConst &value) +{ + if (value != myClefSet.cend()) + { + myClefSet.erase(value); + } +} +void Properties::addClef(const ClefPtr &value) +{ + if (value) + { + myClefSet.push_back(value); + } +} - void Properties::removeClef( const ClefSetIterConst& value ) - { - if ( value != myClefSet.cend() ) - { - myClefSet.erase( value ); - } - } +void Properties::clearClefSet() +{ + myClefSet.clear(); +} +ClefPtr Properties::getClef(const ClefSetIterConst &setIterator) const +{ + if (setIterator != myClefSet.cend()) + { + return *setIterator; + } + return ClefPtr(); +} - void Properties::addClef( const ClefPtr& value ) - { - if ( value ) - { - myClefSet.push_back( value ); - } - } +const StaffDetailsSet &Properties::getStaffDetailsSet() const +{ + return myStaffDetailsSet; +} +void Properties::removeStaffDetails(const StaffDetailsSetIterConst &value) +{ + if (value != myStaffDetailsSet.cend()) + { + myStaffDetailsSet.erase(value); + } +} - void Properties::clearClefSet() - { - myClefSet.clear(); - } +void Properties::addStaffDetails(const StaffDetailsPtr &value) +{ + if (value) + { + myStaffDetailsSet.push_back(value); + } +} +void Properties::clearStaffDetailsSet() +{ + myStaffDetailsSet.clear(); +} - ClefPtr Properties::getClef( const ClefSetIterConst& setIterator ) const - { - if( setIterator != myClefSet.cend() ) - { - return *setIterator; - } - return ClefPtr(); - } +StaffDetailsPtr Properties::getStaffDetails(const StaffDetailsSetIterConst &setIterator) const +{ + if (setIterator != myStaffDetailsSet.cend()) + { + return *setIterator; + } + return StaffDetailsPtr(); +} +const TransposeSet &Properties::getTransposeSet() const +{ + return myTransposeSet; +} - const StaffDetailsSet& Properties::getStaffDetailsSet() const - { - return myStaffDetailsSet; - } +void Properties::removeTranspose(const TransposeSetIterConst &value) +{ + if (value != myTransposeSet.cend()) + { + myTransposeSet.erase(value); + } +} +void Properties::addTranspose(const TransposePtr &value) +{ + if (value) + { + myTransposeSet.push_back(value); + } +} - void Properties::removeStaffDetails( const StaffDetailsSetIterConst& value ) - { - if ( value != myStaffDetailsSet.cend() ) - { - myStaffDetailsSet.erase( value ); - } - } +void Properties::clearTransposeSet() +{ + myTransposeSet.clear(); +} +TransposePtr Properties::getTranspose(const TransposeSetIterConst &setIterator) const +{ + if (setIterator != myTransposeSet.cend()) + { + return *setIterator; + } + return TransposePtr(); +} - void Properties::addStaffDetails( const StaffDetailsPtr& value ) - { - if ( value ) - { - myStaffDetailsSet.push_back( value ); - } - } +const DirectiveSet &Properties::getDirectiveSet() const +{ + return myDirectiveSet; +} +void Properties::removeDirective(const DirectiveSetIterConst &value) +{ + if (value != myDirectiveSet.cend()) + { + myDirectiveSet.erase(value); + } +} - void Properties::clearStaffDetailsSet() - { - myStaffDetailsSet.clear(); - } +void Properties::addDirective(const DirectivePtr &value) +{ + if (value) + { + myDirectiveSet.push_back(value); + } +} +void Properties::clearDirectiveSet() +{ + myDirectiveSet.clear(); +} - StaffDetailsPtr Properties::getStaffDetails( const StaffDetailsSetIterConst& setIterator ) const - { - if( setIterator != myStaffDetailsSet.cend() ) - { - return *setIterator; - } - return StaffDetailsPtr(); - } +DirectivePtr Properties::getDirective(const DirectiveSetIterConst &setIterator) const +{ + if (setIterator != myDirectiveSet.cend()) + { + return *setIterator; + } + return DirectivePtr(); +} +const MeasureStyleSet &Properties::getMeasureStyleSet() const +{ + return myMeasureStyleSet; +} - const TransposeSet& Properties::getTransposeSet() const - { - return myTransposeSet; - } +void Properties::removeMeasureStyle(const MeasureStyleSetIterConst &value) +{ + if (value != myMeasureStyleSet.cend()) + { + myMeasureStyleSet.erase(value); + } +} +void Properties::addMeasureStyle(const MeasureStylePtr &value) +{ + if (value) + { + myMeasureStyleSet.push_back(value); + } +} - void Properties::removeTranspose( const TransposeSetIterConst& value ) - { - if ( value != myTransposeSet.cend() ) - { - myTransposeSet.erase( value ); - } - } +void Properties::clearMeasureStyleSet() +{ + myMeasureStyleSet.clear(); +} +MeasureStylePtr Properties::getMeasureStyle(const MeasureStyleSetIterConst &setIterator) const +{ + if (setIterator != myMeasureStyleSet.cend()) + { + return *setIterator; + } + return MeasureStylePtr(); +} - void Properties::addTranspose( const TransposePtr& value ) - { - if ( value ) - { - myTransposeSet.push_back( value ); - } - } +bool Properties::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + ::ezxml::XElementIterator end = xelement.end(); + bool hasFootnote = false; + bool hasLevel = false; - void Properties::clearTransposeSet() + for (auto it = xelement.begin(); it != end; ++it) + { + importElement(message, *it, isSuccess, *myEditorialGroup->getFootnote(), hasFootnote); + if (hasFootnote) { - myTransposeSet.clear(); + myEditorialGroup->setHasFootnote(true); } - - TransposePtr Properties::getTranspose( const TransposeSetIterConst& setIterator ) const + importElement(message, *it, isSuccess, *myEditorialGroup->getLevel(), hasLevel); + if (hasLevel) { - if( setIterator != myTransposeSet.cend() ) - { - return *setIterator; - } - return TransposePtr(); + myEditorialGroup->setHasLevel(true); } - - const DirectiveSet& Properties::getDirectiveSet() const + if (importElement(message, *it, isSuccess, *myDivisions, myHasDivisions)) { - return myDirectiveSet; + continue; } - - - void Properties::removeDirective( const DirectiveSetIterConst& value ) + if (importElementSet(message, it, end, isSuccess, "key", myKeySet)) { - if ( value != myDirectiveSet.cend() ) - { - myDirectiveSet.erase( value ); - } + continue; } - - - void Properties::addDirective( const DirectivePtr& value ) + if (importElementSet(message, it, end, isSuccess, "time", myTimeSet)) { - if ( value ) - { - myDirectiveSet.push_back( value ); - } + continue; } - - - void Properties::clearDirectiveSet() + if (importElement(message, *it, isSuccess, *myStaves, myHasStaves)) { - myDirectiveSet.clear(); + continue; } - - - DirectivePtr Properties::getDirective( const DirectiveSetIterConst& setIterator ) const + if (importElement(message, *it, isSuccess, *myPartSymbol, myHasPartSymbol)) { - if( setIterator != myDirectiveSet.cend() ) - { - return *setIterator; - } - return DirectivePtr(); + continue; } - - - const MeasureStyleSet& Properties::getMeasureStyleSet() const + if (importElement(message, *it, isSuccess, *myInstruments, myHasInstruments)) { - return myMeasureStyleSet; + continue; } - - - void Properties::removeMeasureStyle( const MeasureStyleSetIterConst& value ) + if (importElementSet(message, it, end, isSuccess, "clef", myClefSet)) { - if ( value != myMeasureStyleSet.cend() ) - { - myMeasureStyleSet.erase( value ); - } + continue; } - - - void Properties::addMeasureStyle( const MeasureStylePtr& value ) + if (importElementSet(message, it, end, isSuccess, "staff-details", myStaffDetailsSet)) { - if ( value ) - { - myMeasureStyleSet.push_back( value ); - } + continue; } - - - void Properties::clearMeasureStyleSet() + if (importElementSet(message, it, end, isSuccess, "transpose", myTransposeSet)) { - myMeasureStyleSet.clear(); + continue; } - - - MeasureStylePtr Properties::getMeasureStyle( const MeasureStyleSetIterConst& setIterator ) const + if (importElementSet(message, it, end, isSuccess, "directive", myDirectiveSet)) { - if( setIterator != myMeasureStyleSet.cend() ) - { - return *setIterator; - } - return MeasureStylePtr(); + continue; } - - - bool Properties::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElementSet(message, it, end, isSuccess, "measure-style", myMeasureStyleSet)) { - bool isSuccess = true; - ::ezxml::XElementIterator end = xelement.end(); - - bool hasFootnote = false; - bool hasLevel = false; - - for( auto it = xelement.begin(); it != end; ++it ) - { - importElement( message, *it, isSuccess, *myEditorialGroup->getFootnote(), hasFootnote ); - if( hasFootnote ) - { - myEditorialGroup->setHasFootnote( true ); - } - - importElement( message, *it, isSuccess, *myEditorialGroup->getLevel(), hasLevel ); - if( hasLevel ) - { - myEditorialGroup->setHasLevel( true ); - } - - if ( importElement( message, *it, isSuccess, *myDivisions, myHasDivisions ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "key", myKeySet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "time", myTimeSet ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myStaves, myHasStaves ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPartSymbol, myHasPartSymbol ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myInstruments, myHasInstruments ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "clef", myClefSet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "staff-details", myStaffDetailsSet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "transpose", myTransposeSet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "directive", myDirectiveSet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "measure-style", myMeasureStyleSet ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Properties.h b/Sourcecode/private/mx/core/elements/Properties.h index 8617bcd7e..cc4b70815 100644 --- a/Sourcecode/private/mx/core/elements/Properties.h +++ b/Sourcecode/private/mx/core/elements/Properties.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,133 +13,136 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Clef ) - MX_FORWARD_DECLARE_ELEMENT( Directive ) - MX_FORWARD_DECLARE_ELEMENT( Divisions ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Instruments ) - MX_FORWARD_DECLARE_ELEMENT( Key ) - MX_FORWARD_DECLARE_ELEMENT( MeasureStyle ) - MX_FORWARD_DECLARE_ELEMENT( PartSymbol ) - MX_FORWARD_DECLARE_ELEMENT( StaffDetails ) - MX_FORWARD_DECLARE_ELEMENT( Staves ) - MX_FORWARD_DECLARE_ELEMENT( Time ) - MX_FORWARD_DECLARE_ELEMENT( Transpose ) - MX_FORWARD_DECLARE_ELEMENT( Properties ) - - inline PropertiesPtr makeProperties() { return std::make_shared(); } - - class Properties : public ElementInterface - { - public: - Properties(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - /* _________ Divisions minOccurs = 0, maxOccurs = 1 _________ */ - DivisionsPtr getDivisions() const; - void setDivisions( const DivisionsPtr& value ); - bool getHasDivisions() const; - void setHasDivisions( const bool value ); - - /* _________ Key minOccurs = 0, maxOccurs = unbounded _________ */ - const KeySet& getKeySet() const; - void addKey( const KeyPtr& value ); - void removeKey( const KeySetIterConst& value ); - void clearKeySet(); - KeyPtr getKey( const KeySetIterConst& setIterator ) const; - - /* _________ Time minOccurs = 0, maxOccurs = unbounded _________ */ - const TimeSet& getTimeSet() const; - void addTime( const TimePtr& value ); - void removeTime( const TimeSetIterConst& value ); - void clearTimeSet(); - TimePtr getTime( const TimeSetIterConst& setIterator ) const; - - /* _________ Staves minOccurs = 0, maxOccurs = 1 _________ */ - StavesPtr getStaves() const; - void setStaves( const StavesPtr& value ); - bool getHasStaves() const; - void setHasStaves( const bool value ); - - /* _________ PartSymbol minOccurs = 0, maxOccurs = 1 _________ */ - PartSymbolPtr getPartSymbol() const; - void setPartSymbol( const PartSymbolPtr& value ); - bool getHasPartSymbol() const; - void setHasPartSymbol( const bool value ); - - /* _________ Instruments minOccurs = 0, maxOccurs = 1 _________ */ - InstrumentsPtr getInstruments() const; - void setInstruments( const InstrumentsPtr& value ); - bool getHasInstruments() const; - void setHasInstruments( const bool value ); - - /* _________ Clef minOccurs = 0, maxOccurs = unbounded _________ */ - const ClefSet& getClefSet() const; - void addClef( const ClefPtr& value ); - void removeClef( const ClefSetIterConst& value ); - void clearClefSet(); - ClefPtr getClef( const ClefSetIterConst& setIterator ) const; - - /* _________ StaffDetails minOccurs = 0, maxOccurs = unbounded _________ */ - const StaffDetailsSet& getStaffDetailsSet() const; - void addStaffDetails( const StaffDetailsPtr& value ); - void removeStaffDetails( const StaffDetailsSetIterConst& value ); - void clearStaffDetailsSet(); - StaffDetailsPtr getStaffDetails( const StaffDetailsSetIterConst& setIterator ) const; - - /* _________ Transpose minOccurs = 0, maxOccurs = unbounded _________ */ - const TransposeSet& getTransposeSet() const; - void addTranspose( const TransposePtr& value ); - void removeTranspose( const TransposeSetIterConst& value ); - void clearTransposeSet(); - TransposePtr getTranspose( const TransposeSetIterConst& setIterator ) const; - - /* _________ Directive minOccurs = 0, maxOccurs = unbounded _________ */ - const DirectiveSet& getDirectiveSet() const; - void addDirective( const DirectivePtr& value ); - void removeDirective( const DirectiveSetIterConst& value ); - void clearDirectiveSet(); - DirectivePtr getDirective( const DirectiveSetIterConst& setIterator ) const; - - /* _________ MeasureStyle minOccurs = 0, maxOccurs = unbounded _________ */ - const MeasureStyleSet& getMeasureStyleSet() const; - void addMeasureStyle( const MeasureStylePtr& value ); - void removeMeasureStyle( const MeasureStyleSetIterConst& value ); - void clearMeasureStyleSet(); - MeasureStylePtr getMeasureStyle( const MeasureStyleSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EditorialGroupPtr myEditorialGroup; - DivisionsPtr myDivisions; - bool myHasDivisions; - KeySet myKeySet; - TimeSet myTimeSet; - StavesPtr myStaves; - bool myHasStaves; - PartSymbolPtr myPartSymbol; - bool myHasPartSymbol; - InstrumentsPtr myInstruments; - bool myHasInstruments; - ClefSet myClefSet; - StaffDetailsSet myStaffDetailsSet; - TransposeSet myTransposeSet; - DirectiveSet myDirectiveSet; - MeasureStyleSet myMeasureStyleSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Clef) +MX_FORWARD_DECLARE_ELEMENT(Directive) +MX_FORWARD_DECLARE_ELEMENT(Divisions) +MX_FORWARD_DECLARE_ELEMENT(EditorialGroup) +MX_FORWARD_DECLARE_ELEMENT(Instruments) +MX_FORWARD_DECLARE_ELEMENT(Key) +MX_FORWARD_DECLARE_ELEMENT(MeasureStyle) +MX_FORWARD_DECLARE_ELEMENT(PartSymbol) +MX_FORWARD_DECLARE_ELEMENT(StaffDetails) +MX_FORWARD_DECLARE_ELEMENT(Staves) +MX_FORWARD_DECLARE_ELEMENT(Time) +MX_FORWARD_DECLARE_ELEMENT(Transpose) +MX_FORWARD_DECLARE_ELEMENT(Properties) + +inline PropertiesPtr makeProperties() +{ + return std::make_shared(); } + +class Properties : public ElementInterface +{ + public: + Properties(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ + EditorialGroupPtr getEditorialGroup() const; + void setEditorialGroup(const EditorialGroupPtr &value); + + /* _________ Divisions minOccurs = 0, maxOccurs = 1 _________ */ + DivisionsPtr getDivisions() const; + void setDivisions(const DivisionsPtr &value); + bool getHasDivisions() const; + void setHasDivisions(const bool value); + + /* _________ Key minOccurs = 0, maxOccurs = unbounded _________ */ + const KeySet &getKeySet() const; + void addKey(const KeyPtr &value); + void removeKey(const KeySetIterConst &value); + void clearKeySet(); + KeyPtr getKey(const KeySetIterConst &setIterator) const; + + /* _________ Time minOccurs = 0, maxOccurs = unbounded _________ */ + const TimeSet &getTimeSet() const; + void addTime(const TimePtr &value); + void removeTime(const TimeSetIterConst &value); + void clearTimeSet(); + TimePtr getTime(const TimeSetIterConst &setIterator) const; + + /* _________ Staves minOccurs = 0, maxOccurs = 1 _________ */ + StavesPtr getStaves() const; + void setStaves(const StavesPtr &value); + bool getHasStaves() const; + void setHasStaves(const bool value); + + /* _________ PartSymbol minOccurs = 0, maxOccurs = 1 _________ */ + PartSymbolPtr getPartSymbol() const; + void setPartSymbol(const PartSymbolPtr &value); + bool getHasPartSymbol() const; + void setHasPartSymbol(const bool value); + + /* _________ Instruments minOccurs = 0, maxOccurs = 1 _________ */ + InstrumentsPtr getInstruments() const; + void setInstruments(const InstrumentsPtr &value); + bool getHasInstruments() const; + void setHasInstruments(const bool value); + + /* _________ Clef minOccurs = 0, maxOccurs = unbounded _________ */ + const ClefSet &getClefSet() const; + void addClef(const ClefPtr &value); + void removeClef(const ClefSetIterConst &value); + void clearClefSet(); + ClefPtr getClef(const ClefSetIterConst &setIterator) const; + + /* _________ StaffDetails minOccurs = 0, maxOccurs = unbounded _________ */ + const StaffDetailsSet &getStaffDetailsSet() const; + void addStaffDetails(const StaffDetailsPtr &value); + void removeStaffDetails(const StaffDetailsSetIterConst &value); + void clearStaffDetailsSet(); + StaffDetailsPtr getStaffDetails(const StaffDetailsSetIterConst &setIterator) const; + + /* _________ Transpose minOccurs = 0, maxOccurs = unbounded _________ */ + const TransposeSet &getTransposeSet() const; + void addTranspose(const TransposePtr &value); + void removeTranspose(const TransposeSetIterConst &value); + void clearTransposeSet(); + TransposePtr getTranspose(const TransposeSetIterConst &setIterator) const; + + /* _________ Directive minOccurs = 0, maxOccurs = unbounded _________ */ + const DirectiveSet &getDirectiveSet() const; + void addDirective(const DirectivePtr &value); + void removeDirective(const DirectiveSetIterConst &value); + void clearDirectiveSet(); + DirectivePtr getDirective(const DirectiveSetIterConst &setIterator) const; + + /* _________ MeasureStyle minOccurs = 0, maxOccurs = unbounded _________ */ + const MeasureStyleSet &getMeasureStyleSet() const; + void addMeasureStyle(const MeasureStylePtr &value); + void removeMeasureStyle(const MeasureStyleSetIterConst &value); + void clearMeasureStyleSet(); + MeasureStylePtr getMeasureStyle(const MeasureStyleSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EditorialGroupPtr myEditorialGroup; + DivisionsPtr myDivisions; + bool myHasDivisions; + KeySet myKeySet; + TimeSet myTimeSet; + StavesPtr myStaves; + bool myHasStaves; + PartSymbolPtr myPartSymbol; + bool myHasPartSymbol; + InstrumentsPtr myInstruments; + bool myHasInstruments; + ClefSet myClefSet; + StaffDetailsSet myStaffDetailsSet; + TransposeSet myTransposeSet; + DirectiveSet myDirectiveSet; + MeasureStyleSet myMeasureStyleSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PullOff.cpp b/Sourcecode/private/mx/core/elements/PullOff.cpp index f18966ee8..d34b2ce45 100644 --- a/Sourcecode/private/mx/core/elements/PullOff.cpp +++ b/Sourcecode/private/mx/core/elements/PullOff.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - PullOff::PullOff() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PullOff::PullOff( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PullOff::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PullOff::hasContents() const - { - return true; - } - - - std::ostream& PullOff::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PullOff::streamName( std::ostream& os ) const - { - os << "pull-off"; - return os; - } - - - std::ostream& PullOff::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +PullOff::PullOff() : myValue(), myAttributes(std::make_shared()) +{ +} +PullOff::PullOff(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - PullOffAttributesPtr PullOff::getAttributes() const - { - return myAttributes; - } +bool PullOff::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool PullOff::hasContents() const +{ + return true; +} - void PullOff::setAttributes( const PullOffAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &PullOff::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &PullOff::streamName(std::ostream &os) const +{ + os << "pull-off"; + return os; +} - XsString PullOff::getValue() const - { - return myValue; - } +std::ostream &PullOff::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PullOffAttributesPtr PullOff::getAttributes() const +{ + return myAttributes; +} - void PullOff::setValue( const XsString& value ) - { - myValue = value; - } +void PullOff::setAttributes(const PullOffAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString PullOff::getValue() const +{ + return myValue; +} - bool PullOff::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void PullOff::setValue(const XsString &value) +{ + myValue = value; +} - } +bool PullOff::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PullOff.h b/Sourcecode/private/mx/core/elements/PullOff.h index f5372a969..45e94b80f 100644 --- a/Sourcecode/private/mx/core/elements/PullOff.h +++ b/Sourcecode/private/mx/core/elements/PullOff.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/PullOffAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PullOffAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PullOff ) - - inline PullOffPtr makePullOff() { return std::make_shared(); } - inline PullOffPtr makePullOff( const XsString& value ) { return std::make_shared( value ); } - inline PullOffPtr makePullOff( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PullOff : public ElementInterface - { - public: - PullOff(); - PullOff( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PullOffAttributesPtr getAttributes() const; - void setAttributes( const PullOffAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PullOffAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(PullOffAttributes) +MX_FORWARD_DECLARE_ELEMENT(PullOff) + +inline PullOffPtr makePullOff() +{ + return std::make_shared(); +} + +inline PullOffPtr makePullOff(const XsString &value) +{ + return std::make_shared(value); } + +inline PullOffPtr makePullOff(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class PullOff : public ElementInterface +{ + public: + PullOff(); + PullOff(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PullOffAttributesPtr getAttributes() const; + void setAttributes(const PullOffAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + PullOffAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PullOffAttributes.cpp b/Sourcecode/private/mx/core/elements/PullOffAttributes.cpp index bffb05d0b..fbc2bc5fc 100644 --- a/Sourcecode/private/mx/core/elements/PullOffAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/PullOffAttributes.cpp @@ -8,102 +8,108 @@ namespace mx { - namespace core +namespace core +{ +PullOffAttributes::PullOffAttributes() + : type(StartStop::start), number(1), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), + placement(), hasType(true), hasNumber(false), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasPlacement(false) +{ +} + +bool PullOffAttributes::hasValues() const +{ + return hasType || hasNumber || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight || hasPlacement; +} + +std::ostream &PullOffAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - PullOffAttributes::PullOffAttributes() - :type( StartStop::start ) - ,number( 1 ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasType( true ) - ,hasNumber( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} +bool PullOffAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "PullOffAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool PullOffAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - return hasType || - hasNumber || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& PullOffAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool PullOffAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "PullOffAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/PullOffAttributes.h b/Sourcecode/private/mx/core/elements/PullOffAttributes.h index d096e9243..643ef5dcb 100644 --- a/Sourcecode/private/mx/core/elements/PullOffAttributes.h +++ b/Sourcecode/private/mx/core/elements/PullOffAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -18,42 +18,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( PullOffAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(PullOffAttributes) - struct PullOffAttributes : public AttributesInterface - { - public: - PullOffAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - NumberLevel number; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - const bool hasType; - bool hasNumber; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct PullOffAttributes : public AttributesInterface +{ + public: + PullOffAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + NumberLevel number; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + const bool hasType; + bool hasNumber; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Rehearsal.cpp b/Sourcecode/private/mx/core/elements/Rehearsal.cpp index 594613753..9db3deccf 100644 --- a/Sourcecode/private/mx/core/elements/Rehearsal.cpp +++ b/Sourcecode/private/mx/core/elements/Rehearsal.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Rehearsal::Rehearsal() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Rehearsal::Rehearsal( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Rehearsal::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Rehearsal::hasContents() const - { - return true; - } - - - std::ostream& Rehearsal::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Rehearsal::streamName( std::ostream& os ) const - { - os << "rehearsal"; - return os; - } - - - std::ostream& Rehearsal::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Rehearsal::Rehearsal() : myValue(), myAttributes(std::make_shared()) +{ +} +Rehearsal::Rehearsal(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - RehearsalAttributesPtr Rehearsal::getAttributes() const - { - return myAttributes; - } +bool Rehearsal::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Rehearsal::hasContents() const +{ + return true; +} - void Rehearsal::setAttributes( const RehearsalAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Rehearsal::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Rehearsal::streamName(std::ostream &os) const +{ + os << "rehearsal"; + return os; +} - XsString Rehearsal::getValue() const - { - return myValue; - } +std::ostream &Rehearsal::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +RehearsalAttributesPtr Rehearsal::getAttributes() const +{ + return myAttributes; +} - void Rehearsal::setValue( const XsString& value ) - { - myValue = value; - } +void Rehearsal::setAttributes(const RehearsalAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Rehearsal::getValue() const +{ + return myValue; +} - bool Rehearsal::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Rehearsal::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Rehearsal::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Rehearsal.h b/Sourcecode/private/mx/core/elements/Rehearsal.h index 60304682c..3f07fc177 100644 --- a/Sourcecode/private/mx/core/elements/Rehearsal.h +++ b/Sourcecode/private/mx/core/elements/Rehearsal.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/RehearsalAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RehearsalAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Rehearsal ) - - inline RehearsalPtr makeRehearsal() { return std::make_shared(); } - inline RehearsalPtr makeRehearsal( const XsString& value ) { return std::make_shared( value ); } - inline RehearsalPtr makeRehearsal( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Rehearsal : public ElementInterface - { - public: - Rehearsal(); - Rehearsal( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RehearsalAttributesPtr getAttributes() const; - void setAttributes( const RehearsalAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - RehearsalAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(RehearsalAttributes) +MX_FORWARD_DECLARE_ELEMENT(Rehearsal) + +inline RehearsalPtr makeRehearsal() +{ + return std::make_shared(); +} + +inline RehearsalPtr makeRehearsal(const XsString &value) +{ + return std::make_shared(value); } + +inline RehearsalPtr makeRehearsal(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Rehearsal : public ElementInterface +{ + public: + Rehearsal(); + Rehearsal(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RehearsalAttributesPtr getAttributes() const; + void setAttributes(const RehearsalAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + RehearsalAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp b/Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp index 5217fffac..ef8e88337 100644 --- a/Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp @@ -8,138 +8,154 @@ namespace mx { - namespace core - { - RehearsalAttributes::RehearsalAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( XmlLang{ "it" } ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - +namespace core +{ +RehearsalAttributes::RehearsalAttributes() + : justify(LeftCenterRight::center), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), + fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), halign(), + underline(), overline(), lineThrough(), rotation(), letterSpacing(), lineHeight(), lang(XmlLang{"it"}), + space(XmlSpace::default_), enclosure(EnclosureShape::rectangle), hasJustify(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasHalign(false), hasUnderline(false), hasOverline(false), + hasLineThrough(false), hasRotation(false), hasLetterSpacing(false), hasLineHeight(false), hasLang(false), + hasSpace(false), hasEnclosure(false) +{ +} - bool RehearsalAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } +bool RehearsalAttributes::hasValues() const +{ + return hasJustify || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight || hasHalign || hasUnderline || hasOverline || hasLineThrough || hasRotation || + hasLetterSpacing || hasLineHeight || hasLang || hasSpace || hasEnclosure; +} +std::ostream &RehearsalAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, justify, "justify", hasJustify); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + streamAttribute(os, underline, "underline", hasUnderline); + streamAttribute(os, overline, "overline", hasOverline); + streamAttribute(os, lineThrough, "line-through", hasLineThrough); + streamAttribute(os, rotation, "rotation", hasRotation); + streamAttribute(os, letterSpacing, "letter-spacing", hasLetterSpacing); + streamAttribute(os, lineHeight, "line-height", hasLineHeight); + streamAttribute(os, lang, "xml:lang", hasLang); + streamAttribute(os, space, "xml:space", hasSpace); + streamAttribute(os, enclosure, "enclosure", hasEnclosure); + } + return os; +} - std::ostream& RehearsalAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } +bool RehearsalAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "RehearsalAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool RehearsalAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "RehearsalAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - return isSuccess; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, underline, hasUnderline, "underline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, overline, hasOverline, "overline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, rotation, hasRotation, "rotation")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "xml:lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", + &parseEnclosureShape)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RehearsalAttributes.h b/Sourcecode/private/mx/core/elements/RehearsalAttributes.h index 15bb0fd73..5c9d0077b 100644 --- a/Sourcecode/private/mx/core/elements/RehearsalAttributes.h +++ b/Sourcecode/private/mx/core/elements/RehearsalAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/NumberOrNormal.h" #include "mx/core/XmlLang.h" @@ -20,58 +20,58 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( RehearsalAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(RehearsalAttributes) - struct RehearsalAttributes : public AttributesInterface - { - public: - RehearsalAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; +struct RehearsalAttributes : public AttributesInterface +{ + public: + RehearsalAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + LeftCenterRight justify; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + NumberOfLines underline; + NumberOfLines overline; + NumberOfLines lineThrough; + RotationDegrees rotation; + NumberOrNormal letterSpacing; + NumberOrNormal lineHeight; + XmlLang lang; + XmlSpace space; + EnclosureShape enclosure; + bool hasJustify; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; + bool hasUnderline; + bool hasOverline; + bool hasLineThrough; + bool hasRotation; + bool hasLetterSpacing; + bool hasLineHeight; + bool hasLang; + bool hasSpace; + bool hasEnclosure; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Relation.cpp b/Sourcecode/private/mx/core/elements/Relation.cpp index 885bb92c2..cd90551a7 100644 --- a/Sourcecode/private/mx/core/elements/Relation.cpp +++ b/Sourcecode/private/mx/core/elements/Relation.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Relation::Relation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Relation::Relation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Relation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Relation::hasContents() const - { - return true; - } - - - std::ostream& Relation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Relation::streamName( std::ostream& os ) const - { - os << "relation"; - return os; - } - - - std::ostream& Relation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Relation::Relation() : myValue(), myAttributes(std::make_shared()) +{ +} +Relation::Relation(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - RelationAttributesPtr Relation::getAttributes() const - { - return myAttributes; - } +bool Relation::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Relation::hasContents() const +{ + return true; +} - void Relation::setAttributes( const RelationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Relation::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Relation::streamName(std::ostream &os) const +{ + os << "relation"; + return os; +} - XsString Relation::getValue() const - { - return myValue; - } +std::ostream &Relation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +RelationAttributesPtr Relation::getAttributes() const +{ + return myAttributes; +} - void Relation::setValue( const XsString& value ) - { - myValue = value; - } +void Relation::setAttributes(const RelationAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Relation::getValue() const +{ + return myValue; +} - bool Relation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Relation::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Relation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Relation.h b/Sourcecode/private/mx/core/elements/Relation.h index 4b89a9de2..0e671f717 100644 --- a/Sourcecode/private/mx/core/elements/Relation.h +++ b/Sourcecode/private/mx/core/elements/Relation.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/RelationAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RelationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Relation ) - - inline RelationPtr makeRelation() { return std::make_shared(); } - inline RelationPtr makeRelation( const XsString& value ) { return std::make_shared( value ); } - inline RelationPtr makeRelation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Relation : public ElementInterface - { - public: - Relation(); - Relation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RelationAttributesPtr getAttributes() const; - void setAttributes( const RelationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - RelationAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(RelationAttributes) +MX_FORWARD_DECLARE_ELEMENT(Relation) + +inline RelationPtr makeRelation() +{ + return std::make_shared(); +} + +inline RelationPtr makeRelation(const XsString &value) +{ + return std::make_shared(value); } + +inline RelationPtr makeRelation(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Relation : public ElementInterface +{ + public: + Relation(); + Relation(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RelationAttributesPtr getAttributes() const; + void setAttributes(const RelationAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + RelationAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RelationAttributes.cpp b/Sourcecode/private/mx/core/elements/RelationAttributes.cpp index 33de198bf..f9efe4261 100644 --- a/Sourcecode/private/mx/core/elements/RelationAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/RelationAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - RelationAttributes::RelationAttributes() - :type() - ,hasType( false ) - {} - +namespace core +{ +RelationAttributes::RelationAttributes() : type(), hasType(false) +{ +} - bool RelationAttributes::hasValues() const - { - return hasType; - } +bool RelationAttributes::hasValues() const +{ + return hasType; +} +std::ostream &RelationAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& RelationAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool RelationAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "RelationAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool RelationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type")) { - const char* const className = "RelationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RelationAttributes.h b/Sourcecode/private/mx/core/elements/RelationAttributes.h index 5780692ce..08968bae4 100644 --- a/Sourcecode/private/mx/core/elements/RelationAttributes.h +++ b/Sourcecode/private/mx/core/elements/RelationAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( RelationAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(RelationAttributes) - struct RelationAttributes : public AttributesInterface - { - public: - RelationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; +struct RelationAttributes : public AttributesInterface +{ + public: + RelationAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken type; + bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Release.cpp b/Sourcecode/private/mx/core/elements/Release.cpp index e7f3fde5e..d5d768459 100644 --- a/Sourcecode/private/mx/core/elements/Release.cpp +++ b/Sourcecode/private/mx/core/elements/Release.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Release::Release() : ElementInterface() {} - +namespace core +{ +Release::Release() : ElementInterface() +{ +} - bool Release::hasAttributes() const { return false; } +bool Release::hasAttributes() const +{ + return false; +} +bool Release::hasContents() const +{ + return false; +} - bool Release::hasContents() const { return false; } - std::ostream& Release::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Release::streamName( std::ostream& os ) const { os << "release"; return os; } - std::ostream& Release::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Release::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Release::streamName(std::ostream &os) const +{ + os << "release"; + return os; +} - bool Release::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &Release::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Release::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Release.h b/Sourcecode/private/mx/core/elements/Release.h index 154439dd2..5076ef297 100644 --- a/Sourcecode/private/mx/core/elements/Release.h +++ b/Sourcecode/private/mx/core/elements/Release.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Release ) - - inline ReleasePtr makeRelease() { return std::make_shared(); } - - class Release : public ElementInterface - { - public: - Release(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Release) + +inline ReleasePtr makeRelease() +{ + return std::make_shared(); } + +class Release : public ElementInterface +{ + public: + Release(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Repeat.cpp b/Sourcecode/private/mx/core/elements/Repeat.cpp index deeac9bef..2b474e858 100644 --- a/Sourcecode/private/mx/core/elements/Repeat.cpp +++ b/Sourcecode/private/mx/core/elements/Repeat.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Repeat::Repeat() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Repeat::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Repeat::hasContents() const { return false; } - std::ostream& Repeat::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Repeat::streamName( std::ostream& os ) const { os << "repeat"; return os; } - std::ostream& Repeat::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Repeat::Repeat() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Repeat::hasAttributes() const +{ + return myAttributes->hasValues(); +} - RepeatAttributesPtr Repeat::getAttributes() const - { - return myAttributes; - } +bool Repeat::hasContents() const +{ + return false; +} +std::ostream &Repeat::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Repeat::setAttributes( const RepeatAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Repeat::streamName(std::ostream &os) const +{ + os << "repeat"; + return os; +} +std::ostream &Repeat::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Repeat::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +RepeatAttributesPtr Repeat::getAttributes() const +{ + return myAttributes; +} +void Repeat::setAttributes(const RepeatAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Repeat::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Repeat.h b/Sourcecode/private/mx/core/elements/Repeat.h index 7f697cea6..d98535780 100644 --- a/Sourcecode/private/mx/core/elements/Repeat.h +++ b/Sourcecode/private/mx/core/elements/Repeat.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/RepeatAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RepeatAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Repeat ) - - inline RepeatPtr makeRepeat() { return std::make_shared(); } - - class Repeat : public ElementInterface - { - public: - Repeat(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RepeatAttributesPtr getAttributes() const; - void setAttributes( const RepeatAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RepeatAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(RepeatAttributes) +MX_FORWARD_DECLARE_ELEMENT(Repeat) + +inline RepeatPtr makeRepeat() +{ + return std::make_shared(); } + +class Repeat : public ElementInterface +{ + public: + Repeat(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RepeatAttributesPtr getAttributes() const; + void setAttributes(const RepeatAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + RepeatAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RepeatAttributes.cpp b/Sourcecode/private/mx/core/elements/RepeatAttributes.cpp index c3ae62638..e68af30c3 100644 --- a/Sourcecode/private/mx/core/elements/RepeatAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/RepeatAttributes.cpp @@ -8,62 +8,64 @@ namespace mx { - namespace core +namespace core +{ +RepeatAttributes::RepeatAttributes() + : direction(BackwardForward::backward), times(), winged(Winged::none), hasDirection(true), hasTimes(false), + hasWinged(false) +{ +} + +bool RepeatAttributes::hasValues() const +{ + return hasDirection || hasTimes || hasWinged; +} + +std::ostream &RepeatAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - RepeatAttributes::RepeatAttributes() - :direction( BackwardForward::backward ) - ,times() - ,winged( Winged::none ) - ,hasDirection( true ) - ,hasTimes( false ) - ,hasWinged( false ) - {} + streamAttribute(os, direction, "direction", hasDirection); + streamAttribute(os, times, "times", hasTimes); + streamAttribute(os, winged, "winged", hasWinged); + } + return os; +} +bool RepeatAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "RepeatAttributes"; + bool isSuccess = true; + bool isDirectionFound = false; - bool RepeatAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, direction, isDirectionFound, "direction", + &parseBackwardForward)) { - return hasDirection || - hasTimes || - hasWinged; + continue; } - - - std::ostream& RepeatAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, times, hasTimes, "times")) { - if ( hasValues() ) - { - streamAttribute( os, direction, "direction", hasDirection ); - streamAttribute( os, times, "times", hasTimes ); - streamAttribute( os, winged, "winged", hasWinged ); - } - return os; + continue; } - - - bool RepeatAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, winged, hasWinged, "winged", &parseWinged)) { - const char* const className = "RepeatAttributes"; - bool isSuccess = true; - bool isDirectionFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, direction, isDirectionFound, "direction", &parseBackwardForward ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, times, hasTimes, "times" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, winged, hasWinged, "winged", &parseWinged ) ) { continue; } - } - - if( !isDirectionFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isDirectionFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RepeatAttributes.h b/Sourcecode/private/mx/core/elements/RepeatAttributes.h index 2501c627f..c1112504c 100644 --- a/Sourcecode/private/mx/core/elements/RepeatAttributes.h +++ b/Sourcecode/private/mx/core/elements/RepeatAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -15,26 +15,26 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( RepeatAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(RepeatAttributes) - struct RepeatAttributes : public AttributesInterface - { - public: - RepeatAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - BackwardForward direction; - NonNegativeInteger times; - Winged winged; - const bool hasDirection; - bool hasTimes; - bool hasWinged; +struct RepeatAttributes : public AttributesInterface +{ + public: + RepeatAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + BackwardForward direction; + NonNegativeInteger times; + Winged winged; + const bool hasDirection; + bool hasTimes; + bool hasWinged; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Rest.cpp b/Sourcecode/private/mx/core/elements/Rest.cpp index 6f9f445cf..82f8160bc 100644 --- a/Sourcecode/private/mx/core/elements/Rest.cpp +++ b/Sourcecode/private/mx/core/elements/Rest.cpp @@ -9,109 +9,97 @@ namespace mx { - namespace core - { - Rest::Rest() - :myAttributes( std::make_shared() ) - ,myDisplayStepOctaveGroup( makeDisplayStepOctaveGroup() ) - ,myHasDisplayStepOctaveGroup( false ) - {} - - - bool Rest::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Rest::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Rest::streamName( std::ostream& os ) const - { - os << "rest"; - return os; - } - - - bool Rest::hasContents() const - { - return myHasDisplayStepOctaveGroup; - } - - - std::ostream& Rest::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasDisplayStepOctaveGroup ) - { - os << std::endl; - myDisplayStepOctaveGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - RestAttributesPtr Rest::getAttributes() const - { - return myAttributes; - } - +namespace core +{ +Rest::Rest() + : myAttributes(std::make_shared()), myDisplayStepOctaveGroup(makeDisplayStepOctaveGroup()), + myHasDisplayStepOctaveGroup(false) +{ +} - void Rest::setAttributes( const RestAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool Rest::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Rest::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - DisplayStepOctaveGroupPtr Rest::getDisplayStepOctaveGroup() const - { - return myDisplayStepOctaveGroup; - } +std::ostream &Rest::streamName(std::ostream &os) const +{ + os << "rest"; + return os; +} +bool Rest::hasContents() const +{ + return myHasDisplayStepOctaveGroup; +} - void Rest::setDisplayStepOctaveGroup( const DisplayStepOctaveGroupPtr& value ) - { - if ( value ) - { - myDisplayStepOctaveGroup = value; - } - } +std::ostream &Rest::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasDisplayStepOctaveGroup) + { + os << std::endl; + myDisplayStepOctaveGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + isOneLineOnly = false; + os << std::endl; + } + else + { + isOneLineOnly = true; + } + return os; +} +RestAttributesPtr Rest::getAttributes() const +{ + return myAttributes; +} - bool Rest::getHasDisplayStepOctaveGroup() const - { - return myHasDisplayStepOctaveGroup; - } +void Rest::setAttributes(const RestAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +DisplayStepOctaveGroupPtr Rest::getDisplayStepOctaveGroup() const +{ + return myDisplayStepOctaveGroup; +} - void Rest::setHasDisplayStepOctaveGroup( const bool value ) - { - myHasDisplayStepOctaveGroup = value; - } +void Rest::setDisplayStepOctaveGroup(const DisplayStepOctaveGroupPtr &value) +{ + if (value) + { + myDisplayStepOctaveGroup = value; + } +} +bool Rest::getHasDisplayStepOctaveGroup() const +{ + return myHasDisplayStepOctaveGroup; +} - bool Rest::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); +void Rest::setHasDisplayStepOctaveGroup(const bool value) +{ + myHasDisplayStepOctaveGroup = value; +} - auto it = xelement.begin(); - auto endIter = xelement.end(); - importGroup( message, it, endIter, isSuccess, myDisplayStepOctaveGroup, myHasDisplayStepOctaveGroup ); - MX_RETURN_IS_SUCCESS; - } +bool Rest::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - } + auto it = xelement.begin(); + auto endIter = xelement.end(); + importGroup(message, it, endIter, isSuccess, myDisplayStepOctaveGroup, myHasDisplayStepOctaveGroup); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Rest.h b/Sourcecode/private/mx/core/elements/Rest.h index 7d95883b5..52253ba51 100644 --- a/Sourcecode/private/mx/core/elements/Rest.h +++ b/Sourcecode/private/mx/core/elements/Rest.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/RestAttributes.h" #include @@ -14,41 +14,44 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RestAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayStepOctaveGroup ) - MX_FORWARD_DECLARE_ELEMENT( Rest ) - - inline RestPtr makeRest() { return std::make_shared(); } - - class Rest : public ElementInterface - { - public: - Rest(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RestAttributesPtr getAttributes() const; - void setAttributes( const RestAttributesPtr& value ); - - /* _________ DisplayStepOctaveGroup minOccurs = 0, maxOccurs = 1 _________ */ - DisplayStepOctaveGroupPtr getDisplayStepOctaveGroup() const; - void setDisplayStepOctaveGroup( const DisplayStepOctaveGroupPtr& value ); - bool getHasDisplayStepOctaveGroup() const; - void setHasDisplayStepOctaveGroup( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RestAttributesPtr myAttributes; - DisplayStepOctaveGroupPtr myDisplayStepOctaveGroup; - bool myHasDisplayStepOctaveGroup; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(RestAttributes) +MX_FORWARD_DECLARE_ELEMENT(DisplayStepOctaveGroup) +MX_FORWARD_DECLARE_ELEMENT(Rest) + +inline RestPtr makeRest() +{ + return std::make_shared(); } + +class Rest : public ElementInterface +{ + public: + Rest(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RestAttributesPtr getAttributes() const; + void setAttributes(const RestAttributesPtr &value); + + /* _________ DisplayStepOctaveGroup minOccurs = 0, maxOccurs = 1 _________ */ + DisplayStepOctaveGroupPtr getDisplayStepOctaveGroup() const; + void setDisplayStepOctaveGroup(const DisplayStepOctaveGroupPtr &value); + bool getHasDisplayStepOctaveGroup() const; + void setHasDisplayStepOctaveGroup(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + RestAttributesPtr myAttributes; + DisplayStepOctaveGroupPtr myDisplayStepOctaveGroup; + bool myHasDisplayStepOctaveGroup; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RestAttributes.cpp b/Sourcecode/private/mx/core/elements/RestAttributes.cpp index 2fbcf6a23..15140b513 100644 --- a/Sourcecode/private/mx/core/elements/RestAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/RestAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - RestAttributes::RestAttributes() - :measure( YesNo::no ) - ,hasMeasure( false ) - {} - +namespace core +{ +RestAttributes::RestAttributes() : measure(YesNo::no), hasMeasure(false) +{ +} - bool RestAttributes::hasValues() const - { - return hasMeasure; - } +bool RestAttributes::hasValues() const +{ + return hasMeasure; +} +std::ostream &RestAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, measure, "measure", hasMeasure); + } + return os; +} - std::ostream& RestAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, measure, "measure", hasMeasure ); - } - return os; - } +bool RestAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "RestAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool RestAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, measure, hasMeasure, "measure", &parseYesNo)) { - const char* const className = "RestAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, measure, hasMeasure, "measure", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RestAttributes.h b/Sourcecode/private/mx/core/elements/RestAttributes.h index ca5f7f508..5a6bdf307 100644 --- a/Sourcecode/private/mx/core/elements/RestAttributes.h +++ b/Sourcecode/private/mx/core/elements/RestAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( RestAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(RestAttributes) - struct RestAttributes : public AttributesInterface - { - public: - RestAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo measure; - bool hasMeasure; +struct RestAttributes : public AttributesInterface +{ + public: + RestAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo measure; + bool hasMeasure; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RightDivider.cpp b/Sourcecode/private/mx/core/elements/RightDivider.cpp index 629532189..182f3a30d 100644 --- a/Sourcecode/private/mx/core/elements/RightDivider.cpp +++ b/Sourcecode/private/mx/core/elements/RightDivider.cpp @@ -8,59 +8,62 @@ namespace mx { - namespace core - { - RightDivider::RightDivider() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool RightDivider::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool RightDivider::hasContents() const { return false; } - std::ostream& RightDivider::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& RightDivider::streamName( std::ostream& os ) const { os << "right-divider"; return os; } - std::ostream& RightDivider::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +RightDivider::RightDivider() + : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool RightDivider::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPrintObjectStyleAlignAttributesPtr RightDivider::getAttributes() const - { - return myAttributes; - } +bool RightDivider::hasContents() const +{ + return false; +} +std::ostream &RightDivider::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void RightDivider::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &RightDivider::streamName(std::ostream &os) const +{ + os << "right-divider"; + return os; +} +std::ostream &RightDivider::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool RightDivider::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPrintObjectStyleAlignAttributesPtr RightDivider::getAttributes() const +{ + return myAttributes; +} +void RightDivider::setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool RightDivider::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RightDivider.h b/Sourcecode/private/mx/core/elements/RightDivider.h index ac7810c91..296c19c4e 100644 --- a/Sourcecode/private/mx/core/elements/RightDivider.h +++ b/Sourcecode/private/mx/core/elements/RightDivider.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,31 +14,34 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( RightDivider ) - - inline RightDividerPtr makeRightDivider() { return std::make_shared(); } - - class RightDivider : public ElementInterface - { - public: - RightDivider(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); +namespace core +{ - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); +MX_FORWARD_DECLARE_ELEMENT(RightDivider) - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } +inline RightDividerPtr makeRightDivider() +{ + return std::make_shared(); } + +class RightDivider : public ElementInterface +{ + public: + RightDivider(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; + void setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPrintObjectStyleAlignAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RightMargin.cpp b/Sourcecode/private/mx/core/elements/RightMargin.cpp index d44e12fc6..b64ea78fd 100644 --- a/Sourcecode/private/mx/core/elements/RightMargin.cpp +++ b/Sourcecode/private/mx/core/elements/RightMargin.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - RightMargin::RightMargin() - :myValue() - {} - - - RightMargin::RightMargin( const TenthsValue& value ) - :myValue( value ) - {} - - - bool RightMargin::hasAttributes() const - { - return false; - } - - - bool RightMargin::hasContents() const - { - return true; - } - - - std::ostream& RightMargin::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& RightMargin::streamName( std::ostream& os ) const - { - os << "right-margin"; - return os; - } +namespace core +{ +RightMargin::RightMargin() : myValue() +{ +} +RightMargin::RightMargin(const TenthsValue &value) : myValue(value) +{ +} - std::ostream& RightMargin::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool RightMargin::hasAttributes() const +{ + return false; +} +bool RightMargin::hasContents() const +{ + return true; +} - TenthsValue RightMargin::getValue() const - { - return myValue; - } +std::ostream &RightMargin::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &RightMargin::streamName(std::ostream &os) const +{ + os << "right-margin"; + return os; +} - void RightMargin::setValue( const TenthsValue& value ) - { - myValue = value; - } +std::ostream &RightMargin::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TenthsValue RightMargin::getValue() const +{ + return myValue; +} - bool RightMargin::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void RightMargin::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool RightMargin::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RightMargin.h b/Sourcecode/private/mx/core/elements/RightMargin.h index 5271ae076..845bf96fc 100644 --- a/Sourcecode/private/mx/core/elements/RightMargin.h +++ b/Sourcecode/private/mx/core/elements/RightMargin.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( RightMargin ) - - inline RightMarginPtr makeRightMargin() { return std::make_shared(); } - inline RightMarginPtr makeRightMargin( const TenthsValue& value ) { return std::make_shared( value ); } - inline RightMarginPtr makeRightMargin( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class RightMargin : public ElementInterface - { - public: - RightMargin(); - RightMargin( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(RightMargin) + +inline RightMarginPtr makeRightMargin() +{ + return std::make_shared(); } + +inline RightMarginPtr makeRightMargin(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline RightMarginPtr makeRightMargin(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class RightMargin : public ElementInterface +{ + public: + RightMargin(); + RightMargin(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Rights.cpp b/Sourcecode/private/mx/core/elements/Rights.cpp index 094655d44..275366c47 100644 --- a/Sourcecode/private/mx/core/elements/Rights.cpp +++ b/Sourcecode/private/mx/core/elements/Rights.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Rights::Rights() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Rights::Rights( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Rights::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Rights::hasContents() const - { - return true; - } - - - std::ostream& Rights::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Rights::streamName( std::ostream& os ) const - { - os << "rights"; - return os; - } - - - std::ostream& Rights::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Rights::Rights() : myValue(), myAttributes(std::make_shared()) +{ +} +Rights::Rights(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - RightsAttributesPtr Rights::getAttributes() const - { - return myAttributes; - } +bool Rights::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Rights::hasContents() const +{ + return true; +} - void Rights::setAttributes( const RightsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Rights::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Rights::streamName(std::ostream &os) const +{ + os << "rights"; + return os; +} - XsString Rights::getValue() const - { - return myValue; - } +std::ostream &Rights::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +RightsAttributesPtr Rights::getAttributes() const +{ + return myAttributes; +} - void Rights::setValue( const XsString& value ) - { - myValue = value; - } +void Rights::setAttributes(const RightsAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Rights::getValue() const +{ + return myValue; +} - bool Rights::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Rights::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Rights::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Rights.h b/Sourcecode/private/mx/core/elements/Rights.h index 444185aab..795017f90 100644 --- a/Sourcecode/private/mx/core/elements/Rights.h +++ b/Sourcecode/private/mx/core/elements/Rights.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/RightsAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RightsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Rights ) - - inline RightsPtr makeRights() { return std::make_shared(); } - inline RightsPtr makeRights( const XsString& value ) { return std::make_shared( value ); } - inline RightsPtr makeRights( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Rights : public ElementInterface - { - public: - Rights(); - Rights( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RightsAttributesPtr getAttributes() const; - void setAttributes( const RightsAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - RightsAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(RightsAttributes) +MX_FORWARD_DECLARE_ELEMENT(Rights) + +inline RightsPtr makeRights() +{ + return std::make_shared(); +} + +inline RightsPtr makeRights(const XsString &value) +{ + return std::make_shared(value); } + +inline RightsPtr makeRights(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Rights : public ElementInterface +{ + public: + Rights(); + Rights(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RightsAttributesPtr getAttributes() const; + void setAttributes(const RightsAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + RightsAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RightsAttributes.cpp b/Sourcecode/private/mx/core/elements/RightsAttributes.cpp index e68fb5a7c..19168e49b 100644 --- a/Sourcecode/private/mx/core/elements/RightsAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/RightsAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - RightsAttributes::RightsAttributes() - :type() - ,hasType( false ) - {} - +namespace core +{ +RightsAttributes::RightsAttributes() : type(), hasType(false) +{ +} - bool RightsAttributes::hasValues() const - { - return hasType; - } +bool RightsAttributes::hasValues() const +{ + return hasType; +} +std::ostream &RightsAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + } + return os; +} - std::ostream& RightsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } +bool RightsAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "RightsAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool RightsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type")) { - const char* const className = "RightsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RightsAttributes.h b/Sourcecode/private/mx/core/elements/RightsAttributes.h index 692da61d8..f67f6ccb4 100644 --- a/Sourcecode/private/mx/core/elements/RightsAttributes.h +++ b/Sourcecode/private/mx/core/elements/RightsAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( RightsAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(RightsAttributes) - struct RightsAttributes : public AttributesInterface - { - public: - RightsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; +struct RightsAttributes : public AttributesInterface +{ + public: + RightsAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken type; + bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Root.cpp b/Sourcecode/private/mx/core/elements/Root.cpp index 8e52e4c92..505c8d3a0 100644 --- a/Sourcecode/private/mx/core/elements/Root.cpp +++ b/Sourcecode/private/mx/core/elements/Root.cpp @@ -10,115 +10,107 @@ namespace mx { - namespace core - { - Root::Root() - :myRootStep( makeRootStep() ) - ,myRootAlter( makeRootAlter() ) - ,myHasRootAlter( false ) - {} - - - bool Root::hasAttributes() const - { - return false; - } - - - std::ostream& Root::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Root::streamName( std::ostream& os ) const - { - os << "root"; - return os; - } - - - bool Root::hasContents() const - { - return true; - } - +namespace core +{ +Root::Root() : myRootStep(makeRootStep()), myRootAlter(makeRootAlter()), myHasRootAlter(false) +{ +} - std::ostream& Root::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myRootStep->toStream( os, indentLevel+1 ); - if ( myHasRootAlter ) - { - os << std::endl; - myRootAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } +bool Root::hasAttributes() const +{ + return false; +} +std::ostream &Root::streamAttributes(std::ostream &os) const +{ + return os; +} - RootStepPtr Root::getRootStep() const - { - return myRootStep; - } +std::ostream &Root::streamName(std::ostream &os) const +{ + os << "root"; + return os; +} +bool Root::hasContents() const +{ + return true; +} - void Root::setRootStep( const RootStepPtr& value ) - { - if( value ) - { - myRootStep = value; - } - } +std::ostream &Root::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myRootStep->toStream(os, indentLevel + 1); + if (myHasRootAlter) + { + os << std::endl; + myRootAlter->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} +RootStepPtr Root::getRootStep() const +{ + return myRootStep; +} - RootAlterPtr Root::getRootAlter() const - { - return myRootAlter; - } +void Root::setRootStep(const RootStepPtr &value) +{ + if (value) + { + myRootStep = value; + } +} +RootAlterPtr Root::getRootAlter() const +{ + return myRootAlter; +} - void Root::setRootAlter( const RootAlterPtr& value ) - { - if( value ) - { - myRootAlter = value; - } - } +void Root::setRootAlter(const RootAlterPtr &value) +{ + if (value) + { + myRootAlter = value; + } +} +bool Root::getHasRootAlter() const +{ + return myHasRootAlter; +} - bool Root::getHasRootAlter() const - { - return myHasRootAlter; - } +void Root::setHasRootAlter(const bool value) +{ + myHasRootAlter = value; +} +bool Root::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isRootStepFound = false; - void Root::setHasRootAlter( const bool value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myRootStep, isRootStepFound)) { - myHasRootAlter = value; + continue; } - - - bool Root::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myRootAlter, myHasRootAlter)) { - bool isSuccess = true; - bool isRootStepFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myRootStep, isRootStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRootAlter, myHasRootAlter ) ) { continue; } - } - - if( !isRootStepFound ) - { - message << "Root: '" << myRootStep->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isRootStepFound) + { + message << "Root: '" << myRootStep->getElementName() << "' is required but was not found" << std::endl; } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Root.h b/Sourcecode/private/mx/core/elements/Root.h index 280d5c20b..0433e6ae4 100644 --- a/Sourcecode/private/mx/core/elements/Root.h +++ b/Sourcecode/private/mx/core/elements/Root.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,43 +13,46 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( RootAlter ) - MX_FORWARD_DECLARE_ELEMENT( RootStep ) - MX_FORWARD_DECLARE_ELEMENT( Root ) - - inline RootPtr makeRoot() { return std::make_shared(); } - - class Root : public ElementInterface - { - public: - Root(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ RootStep minOccurs = 1, maxOccurs = 1 _________ */ - RootStepPtr getRootStep() const; - void setRootStep( const RootStepPtr& value ); - - /* _________ RootAlter minOccurs = 0, maxOccurs = 1 _________ */ - RootAlterPtr getRootAlter() const; - void setRootAlter( const RootAlterPtr& value ); - bool getHasRootAlter() const; - void setHasRootAlter( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RootStepPtr myRootStep; - RootAlterPtr myRootAlter; - bool myHasRootAlter; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(RootAlter) +MX_FORWARD_DECLARE_ELEMENT(RootStep) +MX_FORWARD_DECLARE_ELEMENT(Root) + +inline RootPtr makeRoot() +{ + return std::make_shared(); } + +class Root : public ElementInterface +{ + public: + Root(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ RootStep minOccurs = 1, maxOccurs = 1 _________ */ + RootStepPtr getRootStep() const; + void setRootStep(const RootStepPtr &value); + + /* _________ RootAlter minOccurs = 0, maxOccurs = 1 _________ */ + RootAlterPtr getRootAlter() const; + void setRootAlter(const RootAlterPtr &value); + bool getHasRootAlter() const; + void setHasRootAlter(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + RootStepPtr myRootStep; + RootAlterPtr myRootAlter; + bool myHasRootAlter; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RootAlter.cpp b/Sourcecode/private/mx/core/elements/RootAlter.cpp index 22027774f..83a6ae735 100644 --- a/Sourcecode/private/mx/core/elements/RootAlter.cpp +++ b/Sourcecode/private/mx/core/elements/RootAlter.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - RootAlter::RootAlter() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - RootAlter::RootAlter( const Semitones& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool RootAlter::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool RootAlter::hasContents() const - { - return true; - } - - - std::ostream& RootAlter::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& RootAlter::streamName( std::ostream& os ) const - { - os << "root-alter"; - return os; - } - - - std::ostream& RootAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +RootAlter::RootAlter() : myValue(), myAttributes(std::make_shared()) +{ +} +RootAlter::RootAlter(const Semitones &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - RootAlterAttributesPtr RootAlter::getAttributes() const - { - return myAttributes; - } +bool RootAlter::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool RootAlter::hasContents() const +{ + return true; +} - void RootAlter::setAttributes( const RootAlterAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &RootAlter::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &RootAlter::streamName(std::ostream &os) const +{ + os << "root-alter"; + return os; +} - Semitones RootAlter::getValue() const - { - return myValue; - } +std::ostream &RootAlter::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +RootAlterAttributesPtr RootAlter::getAttributes() const +{ + return myAttributes; +} - void RootAlter::setValue( const Semitones& value ) - { - myValue = value; - } +void RootAlter::setAttributes(const RootAlterAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +Semitones RootAlter::getValue() const +{ + return myValue; +} - bool RootAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void RootAlter::setValue(const Semitones &value) +{ + myValue = value; +} - } +bool RootAlter::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RootAlter.h b/Sourcecode/private/mx/core/elements/RootAlter.h index 5c58bb0bc..2f81d6040 100644 --- a/Sourcecode/private/mx/core/elements/RootAlter.h +++ b/Sourcecode/private/mx/core/elements/RootAlter.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/RootAlterAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RootAlterAttributes ) - MX_FORWARD_DECLARE_ELEMENT( RootAlter ) - - inline RootAlterPtr makeRootAlter() { return std::make_shared(); } - inline RootAlterPtr makeRootAlter( const Semitones& value ) { return std::make_shared( value ); } - inline RootAlterPtr makeRootAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class RootAlter : public ElementInterface - { - public: - RootAlter(); - RootAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RootAlterAttributesPtr getAttributes() const; - void setAttributes( const RootAlterAttributesPtr& attributes ); - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - RootAlterAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(RootAlterAttributes) +MX_FORWARD_DECLARE_ELEMENT(RootAlter) + +inline RootAlterPtr makeRootAlter() +{ + return std::make_shared(); } + +inline RootAlterPtr makeRootAlter(const Semitones &value) +{ + return std::make_shared(value); +} + +inline RootAlterPtr makeRootAlter(Semitones &&value) +{ + return std::make_shared(std::move(value)); +} + +class RootAlter : public ElementInterface +{ + public: + RootAlter(); + RootAlter(const Semitones &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RootAlterAttributesPtr getAttributes() const; + void setAttributes(const RootAlterAttributesPtr &attributes); + Semitones getValue() const; + void setValue(const Semitones &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Semitones myValue; + RootAlterAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp b/Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp index 494512873..ba34ed8da 100644 --- a/Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp @@ -8,91 +8,95 @@ namespace mx { - namespace core +namespace core +{ +RootAlterAttributes::RootAlterAttributes() + : printObject(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), location(), hasPrintObject(false), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasLocation(false) +{ +} + +bool RootAlterAttributes::hasValues() const +{ + return hasPrintObject || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || + hasFontStyle || hasFontSize || hasFontWeight || hasLocation; +} + +std::ostream &RootAlterAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - RootAlterAttributes::RootAlterAttributes() - :printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,location() - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasLocation( false ) - {} + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, location, "location", hasLocation); + } + return os; +} + +bool RootAlterAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "RootAlterAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool RootAlterAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - return hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasLocation; + continue; } - - - std::ostream& RootAlterAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, location, "location", hasLocation ); - } - return os; + continue; } - - - bool RootAlterAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "RootAlterAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RootAlterAttributes.h b/Sourcecode/private/mx/core/elements/RootAlterAttributes.h index 78ed71b0c..7b3d4d083 100644 --- a/Sourcecode/private/mx/core/elements/RootAlterAttributes.h +++ b/Sourcecode/private/mx/core/elements/RootAlterAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,40 +17,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( RootAlterAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(RootAlterAttributes) - struct RootAlterAttributes : public AttributesInterface - { - public: - RootAlterAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftRight location; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasLocation; +struct RootAlterAttributes : public AttributesInterface +{ + public: + RootAlterAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo printObject; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftRight location; + bool hasPrintObject; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasLocation; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RootStep.cpp b/Sourcecode/private/mx/core/elements/RootStep.cpp index 4ab6246db..260e84235 100644 --- a/Sourcecode/private/mx/core/elements/RootStep.cpp +++ b/Sourcecode/private/mx/core/elements/RootStep.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - RootStep::RootStep() - :myValue( StepEnum::a ) - ,myAttributes( std::make_shared() ) - {} - - - RootStep::RootStep( const StepEnum& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool RootStep::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool RootStep::hasContents() const - { - return true; - } - - - std::ostream& RootStep::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& RootStep::streamName( std::ostream& os ) const - { - os << "root-step"; - return os; - } - - - std::ostream& RootStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +RootStep::RootStep() : myValue(StepEnum::a), myAttributes(std::make_shared()) +{ +} +RootStep::RootStep(const StepEnum &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - RootStepAttributesPtr RootStep::getAttributes() const - { - return myAttributes; - } +bool RootStep::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool RootStep::hasContents() const +{ + return true; +} - void RootStep::setAttributes( const RootStepAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &RootStep::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &RootStep::streamName(std::ostream &os) const +{ + os << "root-step"; + return os; +} - StepEnum RootStep::getValue() const - { - return myValue; - } +std::ostream &RootStep::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +RootStepAttributesPtr RootStep::getAttributes() const +{ + return myAttributes; +} - void RootStep::setValue( const StepEnum& value ) - { - myValue = value; - } +void RootStep::setAttributes(const RootStepAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +StepEnum RootStep::getValue() const +{ + return myValue; +} - bool RootStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseStepEnum( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void RootStep::setValue(const StepEnum &value) +{ + myValue = value; +} - } +bool RootStep::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseStepEnum(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RootStep.h b/Sourcecode/private/mx/core/elements/RootStep.h index a8af32c3a..2bd339df6 100644 --- a/Sourcecode/private/mx/core/elements/RootStep.h +++ b/Sourcecode/private/mx/core/elements/RootStep.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/RootStepAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RootStepAttributes ) - MX_FORWARD_DECLARE_ELEMENT( RootStep ) - - inline RootStepPtr makeRootStep() { return std::make_shared(); } - inline RootStepPtr makeRootStep( const StepEnum& value ) { return std::make_shared( value ); } - inline RootStepPtr makeRootStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class RootStep : public ElementInterface - { - public: - RootStep(); - RootStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RootStepAttributesPtr getAttributes() const; - void setAttributes( const RootStepAttributesPtr& attributes ); - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - RootStepAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(RootStepAttributes) +MX_FORWARD_DECLARE_ELEMENT(RootStep) + +inline RootStepPtr makeRootStep() +{ + return std::make_shared(); +} + +inline RootStepPtr makeRootStep(const StepEnum &value) +{ + return std::make_shared(value); } + +inline RootStepPtr makeRootStep(StepEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class RootStep : public ElementInterface +{ + public: + RootStep(); + RootStep(const StepEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + RootStepAttributesPtr getAttributes() const; + void setAttributes(const RootStepAttributesPtr &attributes); + StepEnum getValue() const; + void setValue(const StepEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StepEnum myValue; + RootStepAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RootStepAttributes.cpp b/Sourcecode/private/mx/core/elements/RootStepAttributes.cpp index 568bb3c5c..3c2a353c1 100644 --- a/Sourcecode/private/mx/core/elements/RootStepAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/RootStepAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +RootStepAttributes::RootStepAttributes() + : text(), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasText(false), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false) +{ +} + +bool RootStepAttributes::hasValues() const +{ + return hasText || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight; +} + +std::ostream &RootStepAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - RootStepAttributes::RootStepAttributes() - :text() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasText( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, text, "text", hasText); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool RootStepAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "RootStepAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool RootStepAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, text, hasText, "text")) { - return hasText || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& RootStepAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool RootStepAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "RootStepAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/RootStepAttributes.h b/Sourcecode/private/mx/core/elements/RootStepAttributes.h index f89704134..cd568ff29 100644 --- a/Sourcecode/private/mx/core/elements/RootStepAttributes.h +++ b/Sourcecode/private/mx/core/elements/RootStepAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( RootStepAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(RootStepAttributes) - struct RootStepAttributes : public AttributesInterface - { - public: - RootStepAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken text; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasText; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct RootStepAttributes : public AttributesInterface +{ + public: + RootStepAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken text; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasText; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Scaling.cpp b/Sourcecode/private/mx/core/elements/Scaling.cpp index 959cc20bc..f919dc9b7 100644 --- a/Sourcecode/private/mx/core/elements/Scaling.cpp +++ b/Sourcecode/private/mx/core/elements/Scaling.cpp @@ -10,104 +10,99 @@ namespace mx { - namespace core - { - Scaling::Scaling() - :myMillimeters( makeMillimeters( MillimetersValue( 7 ) ) ) - ,myTenths( makeTenths( TenthsValue( 40 ) ) ) - {} - - - bool Scaling::hasAttributes() const - { - return false; - } - - - std::ostream& Scaling::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Scaling::streamName( std::ostream& os ) const - { - os << "scaling"; - return os; - } - +namespace core +{ +Scaling::Scaling() : myMillimeters(makeMillimeters(MillimetersValue(7))), myTenths(makeTenths(TenthsValue(40))) +{ +} - bool Scaling::hasContents() const - { - return true; - } +bool Scaling::hasAttributes() const +{ + return false; +} +std::ostream &Scaling::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& Scaling::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myMillimeters->toStream( os, indentLevel+1 ); - os << std::endl; - myTenths->toStream( os, indentLevel+1 ); - os << std::endl; - isOneLineOnly = false; - return os; - } +std::ostream &Scaling::streamName(std::ostream &os) const +{ + os << "scaling"; + return os; +} +bool Scaling::hasContents() const +{ + return true; +} - MillimetersPtr Scaling::getMillimeters() const - { - return myMillimeters; - } +std::ostream &Scaling::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myMillimeters->toStream(os, indentLevel + 1); + os << std::endl; + myTenths->toStream(os, indentLevel + 1); + os << std::endl; + isOneLineOnly = false; + return os; +} +MillimetersPtr Scaling::getMillimeters() const +{ + return myMillimeters; +} - void Scaling::setMillimeters( const MillimetersPtr& value ) - { - if( value ) - { - myMillimeters = value; - } - } +void Scaling::setMillimeters(const MillimetersPtr &value) +{ + if (value) + { + myMillimeters = value; + } +} +TenthsPtr Scaling::getTenths() const +{ + return myTenths; +} - TenthsPtr Scaling::getTenths() const - { - return myTenths; - } +void Scaling::setTenths(const TenthsPtr &value) +{ + if (value) + { + myTenths = value; + } +} +bool Scaling::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isMillimetersFound = false; + bool isTenthsFound = false; - void Scaling::setTenths( const TenthsPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myMillimeters, isMillimetersFound)) { - if( value ) - { - myTenths = value; - } + continue; } - - - bool Scaling::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myTenths, isTenthsFound)) { - bool isSuccess = true; - bool isMillimetersFound = false; - bool isTenthsFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMillimeters, isMillimetersFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTenths, isTenthsFound ) ) { continue; } - } - - if( !isMillimetersFound ) - { - message << "Scaling: '" << myMillimeters->getElementName() << "' is required but was not found" << std::endl; - } - if( !isTenthsFound ) - { - message << "Scaling: '" << myTenths->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isMillimetersFound) + { + message << "Scaling: '" << myMillimeters->getElementName() << "' is required but was not found" << std::endl; } + if (!isTenthsFound) + { + message << "Scaling: '" << myTenths->getElementName() << "' is required but was not found" << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Scaling.h b/Sourcecode/private/mx/core/elements/Scaling.h index 2b5249050..c7170af05 100644 --- a/Sourcecode/private/mx/core/elements/Scaling.h +++ b/Sourcecode/private/mx/core/elements/Scaling.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,40 +13,43 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Millimeters ) - MX_FORWARD_DECLARE_ELEMENT( Tenths ) - MX_FORWARD_DECLARE_ELEMENT( Scaling ) - - inline ScalingPtr makeScaling() { return std::make_shared(); } - - class Scaling : public ElementInterface - { - public: - Scaling(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Millimeters minOccurs = 1, maxOccurs = 1 _________ */ - MillimetersPtr getMillimeters() const; - void setMillimeters( const MillimetersPtr& value ); - - /* _________ Tenths minOccurs = 1, maxOccurs = 1 _________ */ - TenthsPtr getTenths() const; - void setTenths( const TenthsPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MillimetersPtr myMillimeters; - TenthsPtr myTenths; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Millimeters) +MX_FORWARD_DECLARE_ELEMENT(Tenths) +MX_FORWARD_DECLARE_ELEMENT(Scaling) + +inline ScalingPtr makeScaling() +{ + return std::make_shared(); } + +class Scaling : public ElementInterface +{ + public: + Scaling(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Millimeters minOccurs = 1, maxOccurs = 1 _________ */ + MillimetersPtr getMillimeters() const; + void setMillimeters(const MillimetersPtr &value); + + /* _________ Tenths minOccurs = 1, maxOccurs = 1 _________ */ + TenthsPtr getTenths() const; + void setTenths(const TenthsPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + MillimetersPtr myMillimeters; + TenthsPtr myTenths; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Schleifer.cpp b/Sourcecode/private/mx/core/elements/Schleifer.cpp index aa9b31421..4b4dbff2a 100644 --- a/Sourcecode/private/mx/core/elements/Schleifer.cpp +++ b/Sourcecode/private/mx/core/elements/Schleifer.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Schleifer::Schleifer() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Schleifer::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Schleifer::hasContents() const { return false; } - std::ostream& Schleifer::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Schleifer::streamName( std::ostream& os ) const { os << "schleifer"; return os; } - std::ostream& Schleifer::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Schleifer::Schleifer() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Schleifer::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Schleifer::getAttributes() const - { - return myAttributes; - } +bool Schleifer::hasContents() const +{ + return false; +} +std::ostream &Schleifer::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Schleifer::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Schleifer::streamName(std::ostream &os) const +{ + os << "schleifer"; + return os; +} +std::ostream &Schleifer::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Schleifer::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Schleifer::getAttributes() const +{ + return myAttributes; +} +void Schleifer::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Schleifer::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Schleifer.h b/Sourcecode/private/mx/core/elements/Schleifer.h index 6efed5c80..83458e4d7 100644 --- a/Sourcecode/private/mx/core/elements/Schleifer.h +++ b/Sourcecode/private/mx/core/elements/Schleifer.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Schleifer ) - - inline SchleiferPtr makeSchleifer() { return std::make_shared(); } - - class Schleifer : public ElementInterface - { - public: - Schleifer(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Schleifer) + +inline SchleiferPtr makeSchleifer() +{ + return std::make_shared(); } + +class Schleifer : public ElementInterface +{ + public: + Schleifer(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Scoop.cpp b/Sourcecode/private/mx/core/elements/Scoop.cpp index a798856e0..b0921f7ec 100644 --- a/Sourcecode/private/mx/core/elements/Scoop.cpp +++ b/Sourcecode/private/mx/core/elements/Scoop.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Scoop::Scoop() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Scoop::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Scoop::hasContents() const { return false; } - std::ostream& Scoop::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Scoop::streamName( std::ostream& os ) const { os << "scoop"; return os; } - std::ostream& Scoop::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Scoop::Scoop() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Scoop::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyLineAttributesPtr Scoop::getAttributes() const - { - return myAttributes; - } +bool Scoop::hasContents() const +{ + return false; +} +std::ostream &Scoop::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Scoop::setAttributes( const EmptyLineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Scoop::streamName(std::ostream &os) const +{ + os << "scoop"; + return os; +} +std::ostream &Scoop::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Scoop::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyLineAttributesPtr Scoop::getAttributes() const +{ + return myAttributes; +} +void Scoop::setAttributes(const EmptyLineAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Scoop::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Scoop.h b/Sourcecode/private/mx/core/elements/Scoop.h index 8ac5ff8b8..26975f3f4 100644 --- a/Sourcecode/private/mx/core/elements/Scoop.h +++ b/Sourcecode/private/mx/core/elements/Scoop.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyLineAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Scoop ) - - inline ScoopPtr makeScoop() { return std::make_shared(); } - - class Scoop : public ElementInterface - { - public: - Scoop(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyLineAttributesPtr getAttributes() const; - void setAttributes( const EmptyLineAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyLineAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyLineAttributes) +MX_FORWARD_DECLARE_ELEMENT(Scoop) + +inline ScoopPtr makeScoop() +{ + return std::make_shared(); } + +class Scoop : public ElementInterface +{ + public: + Scoop(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyLineAttributesPtr getAttributes() const; + void setAttributes(const EmptyLineAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyLineAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Scordatura.cpp b/Sourcecode/private/mx/core/elements/Scordatura.cpp index c5359fe7f..97caef60d 100644 --- a/Sourcecode/private/mx/core/elements/Scordatura.cpp +++ b/Sourcecode/private/mx/core/elements/Scordatura.cpp @@ -9,109 +9,97 @@ namespace mx { - namespace core - { - Scordatura::Scordatura() - :myAccordSet() - { - myAccordSet.push_back( makeAccord() ); - } - - - bool Scordatura::hasAttributes() const - { - return false; - } - - - std::ostream& Scordatura::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Scordatura::streamName( std::ostream& os ) const - { - os << "scordatura"; - return os; - } - - - bool Scordatura::hasContents() const - { - return true; - } - - - std::ostream& Scordatura::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - for ( auto x : myAccordSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - const AccordSet& Scordatura::getAccordSet() const - { - return myAccordSet; - } - +namespace core +{ +Scordatura::Scordatura() : myAccordSet() +{ + myAccordSet.push_back(makeAccord()); +} - void Scordatura::removeAccord( const AccordSetIterConst& value ) - { - if ( value != myAccordSet.cend() ) - { - if ( myAccordSet.size() > 1 ) - { - myAccordSet.erase( value ); - } - } - } +bool Scordatura::hasAttributes() const +{ + return false; +} +std::ostream &Scordatura::streamAttributes(std::ostream &os) const +{ + return os; +} - void Scordatura::addAccord( const AccordPtr& value ) - { - if ( value ) - { - myAccordSet.push_back( value ); - } - } +std::ostream &Scordatura::streamName(std::ostream &os) const +{ + os << "scordatura"; + return os; +} +bool Scordatura::hasContents() const +{ + return true; +} - void Scordatura::clearAccordSet() - { - myAccordSet.clear(); - myAccordSet.push_back( makeAccord() ); - } +std::ostream &Scordatura::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + for (auto x : myAccordSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + os << std::endl; + return os; +} +const AccordSet &Scordatura::getAccordSet() const +{ + return myAccordSet; +} - AccordPtr Scordatura::getAccord( const AccordSetIterConst& setIterator ) const +void Scordatura::removeAccord(const AccordSetIterConst &value) +{ + if (value != myAccordSet.cend()) + { + if (myAccordSet.size() > 1) { - if( setIterator != myAccordSet.cend() ) - { - return *setIterator; - } - return AccordPtr(); + myAccordSet.erase(value); } + } +} +void Scordatura::addAccord(const AccordPtr &value) +{ + if (value) + { + myAccordSet.push_back(value); + } +} - bool Scordatura::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; +void Scordatura::clearAccordSet() +{ + myAccordSet.clear(); + myAccordSet.push_back(makeAccord()); +} - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "accord", myAccordSet ); - } +AccordPtr Scordatura::getAccord(const AccordSetIterConst &setIterator) const +{ + if (setIterator != myAccordSet.cend()) + { + return *setIterator; + } + return AccordPtr(); +} - MX_RETURN_IS_SUCCESS; - } +bool Scordatura::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + importElementSet(message, it, endIter, isSuccess, "accord", myAccordSet); } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Scordatura.h b/Sourcecode/private/mx/core/elements/Scordatura.h index 5bf8bb8b3..0eff77eaa 100644 --- a/Sourcecode/private/mx/core/elements/Scordatura.h +++ b/Sourcecode/private/mx/core/elements/Scordatura.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,37 +13,40 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Accord ) - MX_FORWARD_DECLARE_ELEMENT( Scordatura ) - - inline ScordaturaPtr makeScordatura() { return std::make_shared(); } - - class Scordatura : public ElementInterface - { - public: - Scordatura(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Accord minOccurs = 1, maxOccurs = unbounded _________ */ - const AccordSet& getAccordSet() const; - void addAccord( const AccordPtr& value ); - void removeAccord( const AccordSetIterConst& value ); - void clearAccordSet(); - AccordPtr getAccord( const AccordSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccordSet myAccordSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Accord) +MX_FORWARD_DECLARE_ELEMENT(Scordatura) + +inline ScordaturaPtr makeScordatura() +{ + return std::make_shared(); } + +class Scordatura : public ElementInterface +{ + public: + Scordatura(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Accord minOccurs = 1, maxOccurs = unbounded _________ */ + const AccordSet &getAccordSet() const; + void addAccord(const AccordPtr &value); + void removeAccord(const AccordSetIterConst &value); + void clearAccordSet(); + AccordPtr getAccord(const AccordSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + AccordSet myAccordSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp b/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp index 76736415f..ee7ba8c91 100644 --- a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp +++ b/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp @@ -15,374 +15,332 @@ namespace mx { - namespace core - { - ScoreHeaderGroup::ScoreHeaderGroup() - :myWork( makeWork() ) - ,myHasWork( false ) - ,myMovementNumber( makeMovementNumber() ) - ,myHasMovementNumber( false ) - ,myMovementTitle( makeMovementTitle() ) - ,myHasMovementTitle( false ) - ,myIdentification( makeIdentification() ) - ,myHasIdentification( false ) - ,myDefaults( makeDefaults() ) - ,myHasDefaults( false ) - ,myCreditSet() - ,myPartList( makePartList() ) - {} - - - bool ScoreHeaderGroup::hasAttributes() const - { - return false; - } - +namespace core +{ +ScoreHeaderGroup::ScoreHeaderGroup() + : myWork(makeWork()), myHasWork(false), myMovementNumber(makeMovementNumber()), myHasMovementNumber(false), + myMovementTitle(makeMovementTitle()), myHasMovementTitle(false), myIdentification(makeIdentification()), + myHasIdentification(false), myDefaults(makeDefaults()), myHasDefaults(false), myCreditSet(), + myPartList(makePartList()) +{ +} - std::ostream& ScoreHeaderGroup::streamAttributes( std::ostream& os ) const - { - return os; - } +bool ScoreHeaderGroup::hasAttributes() const +{ + return false; +} +std::ostream &ScoreHeaderGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& ScoreHeaderGroup::streamName( std::ostream& os ) const - { - return os; - } +std::ostream &ScoreHeaderGroup::streamName(std::ostream &os) const +{ + return os; +} +bool ScoreHeaderGroup::hasContents() const +{ + return true; +} - bool ScoreHeaderGroup::hasContents() const +std::ostream &ScoreHeaderGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + bool isFirst = true; + if (myHasWork) + { + if (!isFirst) { - return true; + os << std::endl; } - - - std::ostream& ScoreHeaderGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const + myWork->toStream(os, indentLevel); + isFirst = false; + } + if (myHasMovementNumber) + { + if (!isFirst) { - isOneLineOnly = false; - bool isFirst = true; - if ( myHasWork ) - { - if ( !isFirst ) - { - os << std::endl; - } - myWork->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasMovementNumber ) - { - if ( !isFirst ) - { - os << std::endl; - } - myMovementNumber->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasMovementTitle ) - { - if ( !isFirst ) - { - os << std::endl; - } - myMovementTitle->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasIdentification ) - { - if ( !isFirst ) - { - os << std::endl; - } - myIdentification->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasDefaults ) - { - if ( !isFirst ) - { - os << std::endl; - } - myDefaults->toStream( os, indentLevel ); - isFirst = false; - } - for ( auto x : myCreditSet ) - { - if ( !isFirst ) - { - os << std::endl; - } - x->toStream( os, indentLevel ); - isFirst = false; - } - if ( !isFirst ) - { - os << std::endl; - } - myPartList->toStream( os, indentLevel ); - return os; + os << std::endl; } - - - WorkPtr ScoreHeaderGroup::getWork() const + myMovementNumber->toStream(os, indentLevel); + isFirst = false; + } + if (myHasMovementTitle) + { + if (!isFirst) { - return myWork; + os << std::endl; } - - - void ScoreHeaderGroup::setWork( const WorkPtr& value ) + myMovementTitle->toStream(os, indentLevel); + isFirst = false; + } + if (myHasIdentification) + { + if (!isFirst) { - if ( value ) - { - myWork = value; - } + os << std::endl; } - - - bool ScoreHeaderGroup::getHasWork() const + myIdentification->toStream(os, indentLevel); + isFirst = false; + } + if (myHasDefaults) + { + if (!isFirst) { - return myHasWork; + os << std::endl; } - - - void ScoreHeaderGroup::setHasWork( const bool value ) + myDefaults->toStream(os, indentLevel); + isFirst = false; + } + for (auto x : myCreditSet) + { + if (!isFirst) { - myHasWork = value; + os << std::endl; } + x->toStream(os, indentLevel); + isFirst = false; + } + if (!isFirst) + { + os << std::endl; + } + myPartList->toStream(os, indentLevel); + return os; +} +WorkPtr ScoreHeaderGroup::getWork() const +{ + return myWork; +} - MovementNumberPtr ScoreHeaderGroup::getMovementNumber() const - { - return myMovementNumber; - } - +void ScoreHeaderGroup::setWork(const WorkPtr &value) +{ + if (value) + { + myWork = value; + } +} - void ScoreHeaderGroup::setMovementNumber( const MovementNumberPtr& value ) - { - if ( value ) - { - myMovementNumber = value; - } - } +bool ScoreHeaderGroup::getHasWork() const +{ + return myHasWork; +} +void ScoreHeaderGroup::setHasWork(const bool value) +{ + myHasWork = value; +} - bool ScoreHeaderGroup::getHasMovementNumber() const - { - return myHasMovementNumber; - } +MovementNumberPtr ScoreHeaderGroup::getMovementNumber() const +{ + return myMovementNumber; +} +void ScoreHeaderGroup::setMovementNumber(const MovementNumberPtr &value) +{ + if (value) + { + myMovementNumber = value; + } +} - void ScoreHeaderGroup::setHasMovementNumber( const bool value ) - { - myHasMovementNumber = value; - } +bool ScoreHeaderGroup::getHasMovementNumber() const +{ + return myHasMovementNumber; +} +void ScoreHeaderGroup::setHasMovementNumber(const bool value) +{ + myHasMovementNumber = value; +} - MovementTitlePtr ScoreHeaderGroup::getMovementTitle() const - { - return myMovementTitle; - } +MovementTitlePtr ScoreHeaderGroup::getMovementTitle() const +{ + return myMovementTitle; +} +void ScoreHeaderGroup::setMovementTitle(const MovementTitlePtr &value) +{ + if (value) + { + myMovementTitle = value; + } +} - void ScoreHeaderGroup::setMovementTitle( const MovementTitlePtr& value ) - { - if ( value ) - { - myMovementTitle = value; - } - } +bool ScoreHeaderGroup::getHasMovementTitle() const +{ + return myHasMovementTitle; +} +void ScoreHeaderGroup::setHasMovementTitle(const bool value) +{ + myHasMovementTitle = value; +} - bool ScoreHeaderGroup::getHasMovementTitle() const - { - return myHasMovementTitle; - } +IdentificationPtr ScoreHeaderGroup::getIdentification() const +{ + return myIdentification; +} +void ScoreHeaderGroup::setIdentification(const IdentificationPtr &value) +{ + if (value) + { + myIdentification = value; + } +} - void ScoreHeaderGroup::setHasMovementTitle( const bool value ) - { - myHasMovementTitle = value; - } +bool ScoreHeaderGroup::getHasIdentification() const +{ + return myHasIdentification; +} +void ScoreHeaderGroup::setHasIdentification(const bool value) +{ + myHasIdentification = value; +} - IdentificationPtr ScoreHeaderGroup::getIdentification() const - { - return myIdentification; - } +DefaultsPtr ScoreHeaderGroup::getDefaults() const +{ + return myDefaults; +} +void ScoreHeaderGroup::setDefaults(const DefaultsPtr &value) +{ + if (value) + { + myDefaults = value; + } +} - void ScoreHeaderGroup::setIdentification( const IdentificationPtr& value ) - { - if ( value ) - { - myIdentification = value; - } - } +bool ScoreHeaderGroup::getHasDefaults() const +{ + return myHasDefaults; +} +void ScoreHeaderGroup::setHasDefaults(const bool value) +{ + myHasDefaults = value; +} - bool ScoreHeaderGroup::getHasIdentification() const - { - return myHasIdentification; - } +const CreditSet &ScoreHeaderGroup::getCreditSet() const +{ + return myCreditSet; +} +void ScoreHeaderGroup::addCredit(const CreditPtr &value) +{ + if (value) + { + myCreditSet.push_back(value); + } +} - void ScoreHeaderGroup::setHasIdentification( const bool value ) - { - myHasIdentification = value; - } +void ScoreHeaderGroup::removeCredit(const CreditSetIterConst &value) +{ + if (value != myCreditSet.cend()) + { + myCreditSet.erase(value); + } +} +void ScoreHeaderGroup::clearCreditSet() +{ + myCreditSet.clear(); +} - DefaultsPtr ScoreHeaderGroup::getDefaults() const - { - return myDefaults; - } +CreditPtr ScoreHeaderGroup::getCredit(const CreditSetIterConst &setIterator) const +{ + if (setIterator != myCreditSet.cend()) + { + return *setIterator; + } + return CreditPtr(); +} +PartListPtr ScoreHeaderGroup::getPartList() const +{ + return myPartList; +} - void ScoreHeaderGroup::setDefaults( const DefaultsPtr& value ) - { - if ( value ) - { - myDefaults = value; - } - } +void ScoreHeaderGroup::setPartList(const PartListPtr &value) +{ + if (value) + { + myPartList = value; + } +} +bool ScoreHeaderGroup::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isPartListFound = false; + bool isFirstCreditAdded = false; + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); - bool ScoreHeaderGroup::getHasDefaults() const + if (elementName == "work") { - return myHasDefaults; + myHasWork = true; + isSuccess &= myWork->fromXElement(message, *it); } - - - void ScoreHeaderGroup::setHasDefaults( const bool value ) + else if (elementName == "movement-number") { - myHasDefaults = value; + myHasMovementNumber = true; + isSuccess &= myMovementNumber->fromXElement(message, *it); } - - - const CreditSet& ScoreHeaderGroup::getCreditSet() const + else if (elementName == "movement-title") { - return myCreditSet; + myHasMovementTitle = true; + isSuccess &= myMovementTitle->fromXElement(message, *it); } - - - void ScoreHeaderGroup::addCredit( const CreditPtr& value ) + else if (elementName == "identification") { - if ( value ) - { - myCreditSet.push_back( value ); - } + myHasIdentification = true; + isSuccess &= myIdentification->fromXElement(message, *it); } - - - void ScoreHeaderGroup::removeCredit( const CreditSetIterConst& value ) + else if (elementName == "defaults") { - if ( value != myCreditSet.cend() ) - { - myCreditSet.erase( value ); - } + myHasDefaults = true; + isSuccess &= myDefaults->fromXElement(message, *it); } - - - void ScoreHeaderGroup::clearCreditSet() + else if (elementName == "credit") { - myCreditSet.clear(); - } + auto credit = makeCredit(); + isSuccess &= credit->fromXElement(message, *it); - - CreditPtr ScoreHeaderGroup::getCredit( const CreditSetIterConst& setIterator ) const - { - if( setIterator != myCreditSet.cend() ) + if (!isFirstCreditAdded && myCreditSet.size() == 1) { - return *setIterator; + *(myCreditSet.begin()) = credit; + isFirstCreditAdded = true; } - return CreditPtr(); - } - - - PartListPtr ScoreHeaderGroup::getPartList() const - { - return myPartList; - } - - - void ScoreHeaderGroup::setPartList( const PartListPtr& value ) - { - if ( value ) + else { - myPartList = value; + myCreditSet.push_back(credit); + isFirstCreditAdded = true; } } - - - bool ScoreHeaderGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + else if (elementName == "part-list") + { + isPartListFound = true; + isSuccess &= myPartList->fromXElement(message, *it); + } + else { - bool isSuccess = true; - bool isPartListFound = false; - bool isFirstCreditAdded = false; - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + if (!isPartListFound) { - const std::string elementName = it->getName(); - - if( elementName == "work" ) - { - myHasWork = true; - isSuccess &= myWork->fromXElement( message, *it ); - } - else if( elementName == "movement-number" ) - { - myHasMovementNumber = true; - isSuccess &= myMovementNumber->fromXElement( message, *it ); - } - else if( elementName == "movement-title" ) - { - myHasMovementTitle = true; - isSuccess &= myMovementTitle->fromXElement( message, *it ); - } - else if( elementName == "identification" ) - { - myHasIdentification = true; - isSuccess &= myIdentification->fromXElement( message, *it ); - } - else if( elementName == "defaults" ) - { - myHasDefaults = true; - isSuccess &= myDefaults->fromXElement( message, *it ); - } - else if( elementName == "credit" ) - { - auto credit = makeCredit(); - isSuccess &= credit->fromXElement( message, *it ); - - if( !isFirstCreditAdded && myCreditSet.size() == 1 ) - { - *( myCreditSet.begin() ) = credit; - isFirstCreditAdded = true; - } - else - { - myCreditSet.push_back( credit ); - isFirstCreditAdded = true; - } - - } - else if( elementName == "part-list" ) - { - isPartListFound = true; - isSuccess &= myPartList->fromXElement( message, *it ); - } - else - { - if( !isPartListFound ) - { - message << "ScoreHeaderGroup: a 'part-list' element is required but was not found" << std::endl; - return false; - } - } - + message << "ScoreHeaderGroup: a 'part-list' element is required but was not found" << std::endl; + return false; } - - MX_RETURN_IS_SUCCESS; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h b/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h index 37249356a..ab2da6623 100644 --- a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h +++ b/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,88 +13,91 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Credit ) - MX_FORWARD_DECLARE_ELEMENT( Defaults ) - MX_FORWARD_DECLARE_ELEMENT( Identification ) - MX_FORWARD_DECLARE_ELEMENT( MovementNumber ) - MX_FORWARD_DECLARE_ELEMENT( MovementTitle ) - MX_FORWARD_DECLARE_ELEMENT( PartList ) - MX_FORWARD_DECLARE_ELEMENT( Work ) - MX_FORWARD_DECLARE_ELEMENT( ScoreHeaderGroup ) - - inline ScoreHeaderGroupPtr makeScoreHeaderGroup() { return std::make_shared(); } - - class ScoreHeaderGroup : public ElementInterface - { - public: - ScoreHeaderGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Work minOccurs = 0, maxOccurs = 1 _________ */ - WorkPtr getWork() const; - void setWork( const WorkPtr& value ); - bool getHasWork() const; - void setHasWork( const bool value ); - - /* _________ MovementNumber minOccurs = 0, maxOccurs = 1 _________ */ - MovementNumberPtr getMovementNumber() const; - void setMovementNumber( const MovementNumberPtr& value ); - bool getHasMovementNumber() const; - void setHasMovementNumber( const bool value ); - - /* _________ MovementTitle minOccurs = 0, maxOccurs = 1 _________ */ - MovementTitlePtr getMovementTitle() const; - void setMovementTitle( const MovementTitlePtr& value ); - bool getHasMovementTitle() const; - void setHasMovementTitle( const bool value ); - - /* _________ Identification minOccurs = 0, maxOccurs = 1 _________ */ - IdentificationPtr getIdentification() const; - void setIdentification( const IdentificationPtr& value ); - bool getHasIdentification() const; - void setHasIdentification( const bool value ); - - /* _________ Defaults minOccurs = 0, maxOccurs = 1 _________ */ - DefaultsPtr getDefaults() const; - void setDefaults( const DefaultsPtr& value ); - bool getHasDefaults() const; - void setHasDefaults( const bool value ); - - /* _________ Credit minOccurs = 0, maxOccurs = unbounded _________ */ - const CreditSet& getCreditSet() const; - void addCredit( const CreditPtr& value ); - void removeCredit( const CreditSetIterConst& value ); - void clearCreditSet(); - CreditPtr getCredit( const CreditSetIterConst& setIterator ) const; - - /* _________ PartList minOccurs = 1, maxOccurs = 1 _________ */ - PartListPtr getPartList() const; - void setPartList( const PartListPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - WorkPtr myWork; - bool myHasWork; - MovementNumberPtr myMovementNumber; - bool myHasMovementNumber; - MovementTitlePtr myMovementTitle; - bool myHasMovementTitle; - IdentificationPtr myIdentification; - bool myHasIdentification; - DefaultsPtr myDefaults; - bool myHasDefaults; - CreditSet myCreditSet; - PartListPtr myPartList; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Credit) +MX_FORWARD_DECLARE_ELEMENT(Defaults) +MX_FORWARD_DECLARE_ELEMENT(Identification) +MX_FORWARD_DECLARE_ELEMENT(MovementNumber) +MX_FORWARD_DECLARE_ELEMENT(MovementTitle) +MX_FORWARD_DECLARE_ELEMENT(PartList) +MX_FORWARD_DECLARE_ELEMENT(Work) +MX_FORWARD_DECLARE_ELEMENT(ScoreHeaderGroup) + +inline ScoreHeaderGroupPtr makeScoreHeaderGroup() +{ + return std::make_shared(); } + +class ScoreHeaderGroup : public ElementInterface +{ + public: + ScoreHeaderGroup(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Work minOccurs = 0, maxOccurs = 1 _________ */ + WorkPtr getWork() const; + void setWork(const WorkPtr &value); + bool getHasWork() const; + void setHasWork(const bool value); + + /* _________ MovementNumber minOccurs = 0, maxOccurs = 1 _________ */ + MovementNumberPtr getMovementNumber() const; + void setMovementNumber(const MovementNumberPtr &value); + bool getHasMovementNumber() const; + void setHasMovementNumber(const bool value); + + /* _________ MovementTitle minOccurs = 0, maxOccurs = 1 _________ */ + MovementTitlePtr getMovementTitle() const; + void setMovementTitle(const MovementTitlePtr &value); + bool getHasMovementTitle() const; + void setHasMovementTitle(const bool value); + + /* _________ Identification minOccurs = 0, maxOccurs = 1 _________ */ + IdentificationPtr getIdentification() const; + void setIdentification(const IdentificationPtr &value); + bool getHasIdentification() const; + void setHasIdentification(const bool value); + + /* _________ Defaults minOccurs = 0, maxOccurs = 1 _________ */ + DefaultsPtr getDefaults() const; + void setDefaults(const DefaultsPtr &value); + bool getHasDefaults() const; + void setHasDefaults(const bool value); + + /* _________ Credit minOccurs = 0, maxOccurs = unbounded _________ */ + const CreditSet &getCreditSet() const; + void addCredit(const CreditPtr &value); + void removeCredit(const CreditSetIterConst &value); + void clearCreditSet(); + CreditPtr getCredit(const CreditSetIterConst &setIterator) const; + + /* _________ PartList minOccurs = 1, maxOccurs = 1 _________ */ + PartListPtr getPartList() const; + void setPartList(const PartListPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + WorkPtr myWork; + bool myHasWork; + MovementNumberPtr myMovementNumber; + bool myHasMovementNumber; + MovementTitlePtr myMovementTitle; + bool myHasMovementTitle; + IdentificationPtr myIdentification; + bool myHasIdentification; + DefaultsPtr myDefaults; + bool myHasDefaults; + CreditSet myCreditSet; + PartListPtr myPartList; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrument.cpp b/Sourcecode/private/mx/core/elements/ScoreInstrument.cpp index afbd8f28b..03dc863d8 100644 --- a/Sourcecode/private/mx/core/elements/ScoreInstrument.cpp +++ b/Sourcecode/private/mx/core/elements/ScoreInstrument.cpp @@ -8,258 +8,243 @@ #include "mx/core/elements/InstrumentAbbreviation.h" #include "mx/core/elements/InstrumentName.h" #include "mx/core/elements/InstrumentSound.h" -#include "mx/core/elements/SoloOrEnsembleChoice.h" #include "mx/core/elements/Solo.h" +#include "mx/core/elements/SoloOrEnsembleChoice.h" #include "mx/core/elements/VirtualInstrument.h" #include namespace mx { - namespace core - { - ScoreInstrument::ScoreInstrument() - :myAttributes( std::make_shared() ) - ,myInstrumentName( makeInstrumentName() ) - ,myInstrumentAbbreviation( makeInstrumentAbbreviation() ) - ,myHasInstrumentAbbreviation( false ) - ,myInstrumentSound( makeInstrumentSound() ) - ,myHasInstrumentSound( false ) - ,mySoloOrEnsembleChoice( makeSoloOrEnsembleChoice() ) - ,myHasSoloOrEnsembleChoice( false ) - ,myVirtualInstrument( makeVirtualInstrument() ) - ,myHasVirtualInstrument( false ) - {} - - - bool ScoreInstrument::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& ScoreInstrument::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& ScoreInstrument::streamName( std::ostream& os ) const - { - os << "score-instrument"; - return os; - } - - - bool ScoreInstrument::hasContents() const - { - return true; - } - - - std::ostream& ScoreInstrument::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myInstrumentName->toStream( os, indentLevel+1 ); - if ( myHasInstrumentAbbreviation ) - { - os << std::endl; - myInstrumentAbbreviation->toStream( os, indentLevel+1 ); - } - if ( myHasInstrumentSound ) - { - os << std::endl; - myInstrumentSound->toStream( os, indentLevel+1 ); - } - if ( myHasSoloOrEnsembleChoice ) - { - os << std::endl; - mySoloOrEnsembleChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasVirtualInstrument ) - { - os << std::endl; - myVirtualInstrument->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - ScoreInstrumentAttributesPtr ScoreInstrument::getAttributes() const - { - return myAttributes; - } - - - void ScoreInstrument::setAttributes( const ScoreInstrumentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - +namespace core +{ +ScoreInstrument::ScoreInstrument() + : myAttributes(std::make_shared()), myInstrumentName(makeInstrumentName()), + myInstrumentAbbreviation(makeInstrumentAbbreviation()), myHasInstrumentAbbreviation(false), + myInstrumentSound(makeInstrumentSound()), myHasInstrumentSound(false), + mySoloOrEnsembleChoice(makeSoloOrEnsembleChoice()), myHasSoloOrEnsembleChoice(false), + myVirtualInstrument(makeVirtualInstrument()), myHasVirtualInstrument(false) +{ +} - InstrumentNamePtr ScoreInstrument::getInstrumentName() const - { - return myInstrumentName; - } +bool ScoreInstrument::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &ScoreInstrument::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void ScoreInstrument::setInstrumentName( const InstrumentNamePtr& value ) - { - if( value ) - { - myInstrumentName = value; - } - } +std::ostream &ScoreInstrument::streamName(std::ostream &os) const +{ + os << "score-instrument"; + return os; +} +bool ScoreInstrument::hasContents() const +{ + return true; +} - InstrumentAbbreviationPtr ScoreInstrument::getInstrumentAbbreviation() const - { - return myInstrumentAbbreviation; - } +std::ostream &ScoreInstrument::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myInstrumentName->toStream(os, indentLevel + 1); + if (myHasInstrumentAbbreviation) + { + os << std::endl; + myInstrumentAbbreviation->toStream(os, indentLevel + 1); + } + if (myHasInstrumentSound) + { + os << std::endl; + myInstrumentSound->toStream(os, indentLevel + 1); + } + if (myHasSoloOrEnsembleChoice) + { + os << std::endl; + mySoloOrEnsembleChoice->streamContents(os, indentLevel + 1, isOneLineOnly); + } + if (myHasVirtualInstrument) + { + os << std::endl; + myVirtualInstrument->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} +ScoreInstrumentAttributesPtr ScoreInstrument::getAttributes() const +{ + return myAttributes; +} - void ScoreInstrument::setInstrumentAbbreviation( const InstrumentAbbreviationPtr& value ) - { - if( value ) - { - myInstrumentAbbreviation = value; - } - } +void ScoreInstrument::setAttributes(const ScoreInstrumentAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +InstrumentNamePtr ScoreInstrument::getInstrumentName() const +{ + return myInstrumentName; +} - bool ScoreInstrument::getHasInstrumentAbbreviation() const - { - return myHasInstrumentAbbreviation; - } +void ScoreInstrument::setInstrumentName(const InstrumentNamePtr &value) +{ + if (value) + { + myInstrumentName = value; + } +} +InstrumentAbbreviationPtr ScoreInstrument::getInstrumentAbbreviation() const +{ + return myInstrumentAbbreviation; +} - void ScoreInstrument::setHasInstrumentAbbreviation( const bool value ) - { - myHasInstrumentAbbreviation = value; - } +void ScoreInstrument::setInstrumentAbbreviation(const InstrumentAbbreviationPtr &value) +{ + if (value) + { + myInstrumentAbbreviation = value; + } +} +bool ScoreInstrument::getHasInstrumentAbbreviation() const +{ + return myHasInstrumentAbbreviation; +} - InstrumentSoundPtr ScoreInstrument::getInstrumentSound() const - { - return myInstrumentSound; - } +void ScoreInstrument::setHasInstrumentAbbreviation(const bool value) +{ + myHasInstrumentAbbreviation = value; +} +InstrumentSoundPtr ScoreInstrument::getInstrumentSound() const +{ + return myInstrumentSound; +} - void ScoreInstrument::setInstrumentSound( const InstrumentSoundPtr& value ) - { - if( value ) - { - myInstrumentSound = value; - } - } +void ScoreInstrument::setInstrumentSound(const InstrumentSoundPtr &value) +{ + if (value) + { + myInstrumentSound = value; + } +} +bool ScoreInstrument::getHasInstrumentSound() const +{ + return myHasInstrumentSound; +} - bool ScoreInstrument::getHasInstrumentSound() const - { - return myHasInstrumentSound; - } +void ScoreInstrument::setHasInstrumentSound(const bool value) +{ + myHasInstrumentSound = value; +} +SoloOrEnsembleChoicePtr ScoreInstrument::getSoloOrEnsembleChoice() const +{ + return mySoloOrEnsembleChoice; +} - void ScoreInstrument::setHasInstrumentSound( const bool value ) - { - myHasInstrumentSound = value; - } +void ScoreInstrument::setSoloOrEnsembleChoice(const SoloOrEnsembleChoicePtr &value) +{ + if (value) + { + mySoloOrEnsembleChoice = value; + } +} +bool ScoreInstrument::getHasSoloOrEnsembleChoice() const +{ + return myHasSoloOrEnsembleChoice; +} - SoloOrEnsembleChoicePtr ScoreInstrument::getSoloOrEnsembleChoice() const - { - return mySoloOrEnsembleChoice; - } +void ScoreInstrument::setHasSoloOrEnsembleChoice(const bool value) +{ + myHasSoloOrEnsembleChoice = value; +} +VirtualInstrumentPtr ScoreInstrument::getVirtualInstrument() const +{ + return myVirtualInstrument; +} - void ScoreInstrument::setSoloOrEnsembleChoice( const SoloOrEnsembleChoicePtr& value ) - { - if ( value ) - { - mySoloOrEnsembleChoice = value; - } - } +void ScoreInstrument::setVirtualInstrument(const VirtualInstrumentPtr &value) +{ + if (value) + { + myVirtualInstrument = value; + } +} +bool ScoreInstrument::getHasVirtualInstrument() const +{ + return myHasVirtualInstrument; +} - bool ScoreInstrument::getHasSoloOrEnsembleChoice() const - { - return myHasSoloOrEnsembleChoice; - } +void ScoreInstrument::setHasVirtualInstrument(const bool value) +{ + myHasVirtualInstrument = value; +} +bool ScoreInstrument::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isInstrumentNameFound = false; - void ScoreInstrument::setHasSoloOrEnsembleChoice( const bool value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myInstrumentName, isInstrumentNameFound)) { - myHasSoloOrEnsembleChoice = value; + continue; } - - - VirtualInstrumentPtr ScoreInstrument::getVirtualInstrument() const + if (importElement(message, *it, isSuccess, *myInstrumentAbbreviation, myHasInstrumentAbbreviation)) { - return myVirtualInstrument; + continue; } - - - void ScoreInstrument::setVirtualInstrument( const VirtualInstrumentPtr& value ) + if (importElement(message, *it, isSuccess, *myInstrumentSound, myHasInstrumentSound)) { - if( value ) - { - myVirtualInstrument = value; - } + continue; } - - bool ScoreInstrument::getHasVirtualInstrument() const + if (checkSetChoiceMember(message, *it, isSuccess, mySoloOrEnsembleChoice, "solo", + &SoloOrEnsembleChoice::getSolo, static_cast(SoloOrEnsembleChoice::Choice::solo))) { - return myHasVirtualInstrument; + myHasSoloOrEnsembleChoice = true; + continue; } - - void ScoreInstrument::setHasVirtualInstrument( const bool value ) + if (checkSetChoiceMember(message, *it, isSuccess, mySoloOrEnsembleChoice, "ensemble", + &SoloOrEnsembleChoice::getEnsemble, + static_cast(SoloOrEnsembleChoice::Choice::ensemble))) { - myHasVirtualInstrument = value; + myHasSoloOrEnsembleChoice = true; + continue; } - - bool ScoreInstrument::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myVirtualInstrument, myHasVirtualInstrument)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isInstrumentNameFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myInstrumentName, isInstrumentNameFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myInstrumentAbbreviation, myHasInstrumentAbbreviation ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myInstrumentSound, myHasInstrumentSound ) ) { continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, mySoloOrEnsembleChoice, - "solo", &SoloOrEnsembleChoice::getSolo, - static_cast( SoloOrEnsembleChoice::Choice::solo ) ) ) - { myHasSoloOrEnsembleChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, mySoloOrEnsembleChoice, - "ensemble", &SoloOrEnsembleChoice::getEnsemble, - static_cast( SoloOrEnsembleChoice::Choice::ensemble ) ) ) - { myHasSoloOrEnsembleChoice = true; continue; } - - if ( importElement( message, *it, isSuccess, *myVirtualInstrument, myHasVirtualInstrument ) ) { continue; } - } - - if( !isInstrumentNameFound ) - { - message << "ScoreInstrument: 'instrument-name' not found" << std::endl; - isSuccess = false; - } - - return isSuccess; + continue; } + } + if (!isInstrumentNameFound) + { + message << "ScoreInstrument: 'instrument-name' not found" << std::endl; + isSuccess = false; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrument.h b/Sourcecode/private/mx/core/elements/ScoreInstrument.h index 1985a2b16..94dd41b0c 100644 --- a/Sourcecode/private/mx/core/elements/ScoreInstrument.h +++ b/Sourcecode/private/mx/core/elements/ScoreInstrument.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ScoreInstrumentAttributes.h" #include @@ -14,74 +14,77 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ScoreInstrumentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( InstrumentAbbreviation ) - MX_FORWARD_DECLARE_ELEMENT( InstrumentName ) - MX_FORWARD_DECLARE_ELEMENT( InstrumentSound ) - MX_FORWARD_DECLARE_ELEMENT( SoloOrEnsembleChoice ) - MX_FORWARD_DECLARE_ELEMENT( VirtualInstrument ) - MX_FORWARD_DECLARE_ELEMENT( ScoreInstrument ) +MX_FORWARD_DECLARE_ATTRIBUTES(ScoreInstrumentAttributes) +MX_FORWARD_DECLARE_ELEMENT(InstrumentAbbreviation) +MX_FORWARD_DECLARE_ELEMENT(InstrumentName) +MX_FORWARD_DECLARE_ELEMENT(InstrumentSound) +MX_FORWARD_DECLARE_ELEMENT(SoloOrEnsembleChoice) +MX_FORWARD_DECLARE_ELEMENT(VirtualInstrument) +MX_FORWARD_DECLARE_ELEMENT(ScoreInstrument) - inline ScoreInstrumentPtr makeScoreInstrument() { return std::make_shared(); } +inline ScoreInstrumentPtr makeScoreInstrument() +{ + return std::make_shared(); +} - class ScoreInstrument : public ElementInterface - { - public: - ScoreInstrument(); +class ScoreInstrument : public ElementInterface +{ + public: + ScoreInstrument(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ScoreInstrumentAttributesPtr getAttributes() const; - void setAttributes( const ScoreInstrumentAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ScoreInstrumentAttributesPtr getAttributes() const; + void setAttributes(const ScoreInstrumentAttributesPtr &value); - /* _________ InstrumentName minOccurs = 1, maxOccurs = 1 _________ */ - InstrumentNamePtr getInstrumentName() const; - void setInstrumentName( const InstrumentNamePtr& value ); + /* _________ InstrumentName minOccurs = 1, maxOccurs = 1 _________ */ + InstrumentNamePtr getInstrumentName() const; + void setInstrumentName(const InstrumentNamePtr &value); - /* _________ InstrumentAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ - InstrumentAbbreviationPtr getInstrumentAbbreviation() const; - void setInstrumentAbbreviation( const InstrumentAbbreviationPtr& value ); - bool getHasInstrumentAbbreviation() const; - void setHasInstrumentAbbreviation( const bool value ); + /* _________ InstrumentAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ + InstrumentAbbreviationPtr getInstrumentAbbreviation() const; + void setInstrumentAbbreviation(const InstrumentAbbreviationPtr &value); + bool getHasInstrumentAbbreviation() const; + void setHasInstrumentAbbreviation(const bool value); - /* _________ SoloOrEnsembleChoice minOccurs = 0, maxOccurs = 1 _________ */ - SoloOrEnsembleChoicePtr getSoloOrEnsembleChoice() const; - void setSoloOrEnsembleChoice( const SoloOrEnsembleChoicePtr& value ); - bool getHasSoloOrEnsembleChoice() const; - void setHasSoloOrEnsembleChoice( const bool value ); + /* _________ SoloOrEnsembleChoice minOccurs = 0, maxOccurs = 1 _________ */ + SoloOrEnsembleChoicePtr getSoloOrEnsembleChoice() const; + void setSoloOrEnsembleChoice(const SoloOrEnsembleChoicePtr &value); + bool getHasSoloOrEnsembleChoice() const; + void setHasSoloOrEnsembleChoice(const bool value); - /* _________ InstrumentSound minOccurs = 0, maxOccurs = 1 _________ */ - InstrumentSoundPtr getInstrumentSound() const; - void setInstrumentSound( const InstrumentSoundPtr& value ); - bool getHasInstrumentSound() const; - void setHasInstrumentSound( const bool value ); + /* _________ InstrumentSound minOccurs = 0, maxOccurs = 1 _________ */ + InstrumentSoundPtr getInstrumentSound() const; + void setInstrumentSound(const InstrumentSoundPtr &value); + bool getHasInstrumentSound() const; + void setHasInstrumentSound(const bool value); - /* _________ VirtualInstrument minOccurs = 0, maxOccurs = 1 _________ */ - VirtualInstrumentPtr getVirtualInstrument() const; - void setVirtualInstrument( const VirtualInstrumentPtr& value ); - bool getHasVirtualInstrument() const; - void setHasVirtualInstrument( const bool value ); + /* _________ VirtualInstrument minOccurs = 0, maxOccurs = 1 _________ */ + VirtualInstrumentPtr getVirtualInstrument() const; + void setVirtualInstrument(const VirtualInstrumentPtr &value); + bool getHasVirtualInstrument() const; + void setHasVirtualInstrument(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - ScoreInstrumentAttributesPtr myAttributes; - InstrumentNamePtr myInstrumentName; - InstrumentAbbreviationPtr myInstrumentAbbreviation; - bool myHasInstrumentAbbreviation; - InstrumentSoundPtr myInstrumentSound; - bool myHasInstrumentSound; - SoloOrEnsembleChoicePtr mySoloOrEnsembleChoice; - bool myHasSoloOrEnsembleChoice; - VirtualInstrumentPtr myVirtualInstrument; - bool myHasVirtualInstrument; - }; - } -} + private: + ScoreInstrumentAttributesPtr myAttributes; + InstrumentNamePtr myInstrumentName; + InstrumentAbbreviationPtr myInstrumentAbbreviation; + bool myHasInstrumentAbbreviation; + InstrumentSoundPtr myInstrumentSound; + bool myHasInstrumentSound; + SoloOrEnsembleChoicePtr mySoloOrEnsembleChoice; + bool myHasSoloOrEnsembleChoice; + VirtualInstrumentPtr myVirtualInstrument; + bool myHasVirtualInstrument; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp b/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp index e50b9d322..41e95c56f 100644 --- a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - ScoreInstrumentAttributes::ScoreInstrumentAttributes() - :id() - ,hasId( true ) - {} - +namespace core +{ +ScoreInstrumentAttributes::ScoreInstrumentAttributes() : id(), hasId(true) +{ +} - bool ScoreInstrumentAttributes::hasValues() const - { - return hasId; - } +bool ScoreInstrumentAttributes::hasValues() const +{ + return hasId; +} +std::ostream &ScoreInstrumentAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, id, "id", hasId); + } + return os; +} - std::ostream& ScoreInstrumentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } +bool ScoreInstrumentAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ScoreInstrumentAttributes"; + bool isSuccess = true; + bool isIdFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool ScoreInstrumentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, id, isIdFound, "id")) { - const char* const className = "ScoreInstrumentAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isIdFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h b/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h index 0f6bb8370..f90641b02 100644 --- a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h +++ b/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsID.h" #include @@ -15,22 +15,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ScoreInstrumentAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(ScoreInstrumentAttributes) - struct ScoreInstrumentAttributes : public AttributesInterface - { - public: - ScoreInstrumentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsID id; - const bool hasId; +struct ScoreInstrumentAttributes : public AttributesInterface +{ + public: + ScoreInstrumentAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsID id; + const bool hasId; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScorePart.cpp b/Sourcecode/private/mx/core/elements/ScorePart.cpp index 618294cd7..809f90cae 100644 --- a/Sourcecode/private/mx/core/elements/ScorePart.cpp +++ b/Sourcecode/private/mx/core/elements/ScorePart.cpp @@ -6,442 +6,395 @@ #include "mx/core/FromXElement.h" #include "mx/core/elements/Group.h" #include "mx/core/elements/Identification.h" +#include "mx/core/elements/MidiDevice.h" #include "mx/core/elements/MidiDeviceInstrumentGroup.h" +#include "mx/core/elements/MidiInstrument.h" #include "mx/core/elements/PartAbbreviation.h" #include "mx/core/elements/PartAbbreviationDisplay.h" #include "mx/core/elements/PartName.h" #include "mx/core/elements/PartNameDisplay.h" #include "mx/core/elements/ScoreInstrument.h" -#include "mx/core/elements/MidiDevice.h" -#include "mx/core/elements/MidiInstrument.h" #include namespace mx { - namespace core - { - ScorePart::ScorePart() - :myAttributes( std::make_shared() ) - ,myIdentification( makeIdentification() ) - ,myHasIdentification( false ) - ,myPartName( makePartName() ) - ,myPartNameDisplay( makePartNameDisplay() ) - ,myHasPartNameDisplay( false ) - ,myPartAbbreviation( makePartAbbreviation() ) - ,myHasPartAbbreviation( false ) - ,myPartAbbreviationDisplay( makePartAbbreviationDisplay() ) - ,myHasPartAbbreviationDisplay( false ) - ,myGroupSet() - ,myScoreInstrumentSet() - ,myMidiDeviceInstrumentGroupSet() - {} - - - bool ScorePart::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& ScorePart::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - +namespace core +{ +ScorePart::ScorePart() + : myAttributes(std::make_shared()), myIdentification(makeIdentification()), + myHasIdentification(false), myPartName(makePartName()), myPartNameDisplay(makePartNameDisplay()), + myHasPartNameDisplay(false), myPartAbbreviation(makePartAbbreviation()), myHasPartAbbreviation(false), + myPartAbbreviationDisplay(makePartAbbreviationDisplay()), myHasPartAbbreviationDisplay(false), myGroupSet(), + myScoreInstrumentSet(), myMidiDeviceInstrumentGroupSet() +{ +} - std::ostream& ScorePart::streamName( std::ostream& os ) const - { - os << "score-part"; - return os; - } +bool ScorePart::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &ScorePart::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - bool ScorePart::hasContents() const - { - return true; - } +std::ostream &ScorePart::streamName(std::ostream &os) const +{ + os << "score-part"; + return os; +} +bool ScorePart::hasContents() const +{ + return true; +} - std::ostream& ScorePart::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const +std::ostream &ScorePart::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasIdentification) + { + os << std::endl; + myIdentification->toStream(os, indentLevel + 1); + } + os << std::endl; + myPartName->toStream(os, indentLevel + 1); + if (myHasPartNameDisplay) + { + os << std::endl; + myPartNameDisplay->toStream(os, indentLevel + 1); + } + if (myHasPartAbbreviation) + { + os << std::endl; + myPartAbbreviation->toStream(os, indentLevel + 1); + } + if (myHasPartAbbreviationDisplay) + { + os << std::endl; + myPartAbbreviationDisplay->toStream(os, indentLevel + 1); + } + for (auto x : myGroupSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myScoreInstrumentSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + for (auto x : myMidiDeviceInstrumentGroupSet) + { + if (x->hasContents()) { - if ( myHasIdentification ) - { - os << std::endl; - myIdentification->toStream( os, indentLevel+1 ); - } os << std::endl; - myPartName->toStream( os, indentLevel+1 ); - if ( myHasPartNameDisplay ) - { - os << std::endl; - myPartNameDisplay->toStream( os, indentLevel+1 ); - } - if ( myHasPartAbbreviation ) - { - os << std::endl; - myPartAbbreviation->toStream( os, indentLevel+1 ); - } - if ( myHasPartAbbreviationDisplay ) - { - os << std::endl; - myPartAbbreviationDisplay->toStream( os, indentLevel+1 ); - } - for ( auto x : myGroupSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myScoreInstrumentSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myMidiDeviceInstrumentGroupSet ) - { - if ( x->hasContents() ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - ScorePartAttributesPtr ScorePart::getAttributes() const - { - return myAttributes; - } - - - void ScorePart::setAttributes( const ScorePartAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - IdentificationPtr ScorePart::getIdentification() const - { - return myIdentification; - } - - - void ScorePart::setIdentification( const IdentificationPtr& value ) - { - if( value ) - { - myIdentification = value; - } - } - - - bool ScorePart::getHasIdentification() const - { - return myHasIdentification; - } - - - void ScorePart::setHasIdentification( const bool value ) - { - myHasIdentification = value; - } - - - PartNamePtr ScorePart::getPartName() const - { - return myPartName; - } - - - void ScorePart::setPartName( const PartNamePtr& value ) - { - if( value ) - { - myPartName = value; - } - } - - - PartNameDisplayPtr ScorePart::getPartNameDisplay() const - { - return myPartNameDisplay; - } - - - void ScorePart::setPartNameDisplay( const PartNameDisplayPtr& value ) - { - if( value ) - { - myPartNameDisplay = value; - } - } - - - bool ScorePart::getHasPartNameDisplay() const - { - return myHasPartNameDisplay; - } - - - void ScorePart::setHasPartNameDisplay( const bool value ) - { - myHasPartNameDisplay = value; + x->streamContents(os, indentLevel + 1, isOneLineOnly); } + } + isOneLineOnly = false; + os << std::endl; + return os; +} +ScorePartAttributesPtr ScorePart::getAttributes() const +{ + return myAttributes; +} - PartAbbreviationPtr ScorePart::getPartAbbreviation() const - { - return myPartAbbreviation; - } +void ScorePart::setAttributes(const ScorePartAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +IdentificationPtr ScorePart::getIdentification() const +{ + return myIdentification; +} - void ScorePart::setPartAbbreviation( const PartAbbreviationPtr& value ) - { - if( value ) - { - myPartAbbreviation = value; - } - } +void ScorePart::setIdentification(const IdentificationPtr &value) +{ + if (value) + { + myIdentification = value; + } +} +bool ScorePart::getHasIdentification() const +{ + return myHasIdentification; +} - bool ScorePart::getHasPartAbbreviation() const - { - return myHasPartAbbreviation; - } +void ScorePart::setHasIdentification(const bool value) +{ + myHasIdentification = value; +} +PartNamePtr ScorePart::getPartName() const +{ + return myPartName; +} - void ScorePart::setHasPartAbbreviation( const bool value ) - { - myHasPartAbbreviation = value; - } +void ScorePart::setPartName(const PartNamePtr &value) +{ + if (value) + { + myPartName = value; + } +} +PartNameDisplayPtr ScorePart::getPartNameDisplay() const +{ + return myPartNameDisplay; +} - PartAbbreviationDisplayPtr ScorePart::getPartAbbreviationDisplay() const - { - return myPartAbbreviationDisplay; - } +void ScorePart::setPartNameDisplay(const PartNameDisplayPtr &value) +{ + if (value) + { + myPartNameDisplay = value; + } +} +bool ScorePart::getHasPartNameDisplay() const +{ + return myHasPartNameDisplay; +} - void ScorePart::setPartAbbreviationDisplay( const PartAbbreviationDisplayPtr& value ) - { - if( value ) - { - myPartAbbreviationDisplay = value; - } - } +void ScorePart::setHasPartNameDisplay(const bool value) +{ + myHasPartNameDisplay = value; +} +PartAbbreviationPtr ScorePart::getPartAbbreviation() const +{ + return myPartAbbreviation; +} - bool ScorePart::getHasPartAbbreviationDisplay() const - { - return myHasPartAbbreviationDisplay; - } +void ScorePart::setPartAbbreviation(const PartAbbreviationPtr &value) +{ + if (value) + { + myPartAbbreviation = value; + } +} +bool ScorePart::getHasPartAbbreviation() const +{ + return myHasPartAbbreviation; +} - void ScorePart::setHasPartAbbreviationDisplay( const bool value ) - { - myHasPartAbbreviationDisplay = value; - } +void ScorePart::setHasPartAbbreviation(const bool value) +{ + myHasPartAbbreviation = value; +} +PartAbbreviationDisplayPtr ScorePart::getPartAbbreviationDisplay() const +{ + return myPartAbbreviationDisplay; +} - const GroupSet& ScorePart::getGroupSet() const - { - return myGroupSet; - } +void ScorePart::setPartAbbreviationDisplay(const PartAbbreviationDisplayPtr &value) +{ + if (value) + { + myPartAbbreviationDisplay = value; + } +} +bool ScorePart::getHasPartAbbreviationDisplay() const +{ + return myHasPartAbbreviationDisplay; +} - void ScorePart::removeGroup( const GroupSetIterConst& value ) - { - if ( value != myGroupSet.cend() ) - { - myGroupSet.erase( value ); - } - } +void ScorePart::setHasPartAbbreviationDisplay(const bool value) +{ + myHasPartAbbreviationDisplay = value; +} +const GroupSet &ScorePart::getGroupSet() const +{ + return myGroupSet; +} - void ScorePart::addGroup( const GroupPtr& value ) - { - if ( value ) - { - myGroupSet.push_back( value ); - } - } +void ScorePart::removeGroup(const GroupSetIterConst &value) +{ + if (value != myGroupSet.cend()) + { + myGroupSet.erase(value); + } +} +void ScorePart::addGroup(const GroupPtr &value) +{ + if (value) + { + myGroupSet.push_back(value); + } +} - void ScorePart::clearGroupSet() - { - myGroupSet.clear(); - } +void ScorePart::clearGroupSet() +{ + myGroupSet.clear(); +} +GroupPtr ScorePart::getGroup(const GroupSetIterConst &setIterator) const +{ + if (setIterator != myGroupSet.cend()) + { + return *setIterator; + } + return GroupPtr(); +} - GroupPtr ScorePart::getGroup( const GroupSetIterConst& setIterator ) const - { - if( setIterator != myGroupSet.cend() ) - { - return *setIterator; - } - return GroupPtr(); - } +const ScoreInstrumentSet &ScorePart::getScoreInstrumentSet() const +{ + return myScoreInstrumentSet; +} +void ScorePart::removeScoreInstrument(const ScoreInstrumentSetIterConst &value) +{ + if (value != myScoreInstrumentSet.cend()) + { + myScoreInstrumentSet.erase(value); + } +} - const ScoreInstrumentSet& ScorePart::getScoreInstrumentSet() const - { - return myScoreInstrumentSet; - } +void ScorePart::addScoreInstrument(const ScoreInstrumentPtr &value) +{ + if (value) + { + myScoreInstrumentSet.push_back(value); + } +} +void ScorePart::clearScoreInstrumentSet() +{ + myScoreInstrumentSet.clear(); +} - void ScorePart::removeScoreInstrument( const ScoreInstrumentSetIterConst& value ) - { - if ( value != myScoreInstrumentSet.cend() ) - { - myScoreInstrumentSet.erase( value ); - } - } +ScoreInstrumentPtr ScorePart::getScoreInstrument(const ScoreInstrumentSetIterConst &setIterator) const +{ + if (setIterator != myScoreInstrumentSet.cend()) + { + return *setIterator; + } + return ScoreInstrumentPtr(); +} +const MidiDeviceInstrumentGroupSet &ScorePart::getMidiDeviceInstrumentGroupSet() const +{ + return myMidiDeviceInstrumentGroupSet; +} - void ScorePart::addScoreInstrument( const ScoreInstrumentPtr& value ) - { - if ( value ) - { - myScoreInstrumentSet.push_back( value ); - } - } +void ScorePart::addMidiDeviceInstrumentGroup(const MidiDeviceInstrumentGroupPtr &value) +{ + if (value) + { + myMidiDeviceInstrumentGroupSet.push_back(value); + } +} +void ScorePart::removeMidiDeviceInstrumentGroup(const MidiDeviceInstrumentGroupSetIterConst &value) +{ + if (value != myMidiDeviceInstrumentGroupSet.cend()) + { + myMidiDeviceInstrumentGroupSet.erase(value); + } +} - void ScorePart::clearScoreInstrumentSet() - { - myScoreInstrumentSet.clear(); - } +void ScorePart::clearMidiDeviceInstrumentGroupSet() +{ + myMidiDeviceInstrumentGroupSet.clear(); +} +MidiDeviceInstrumentGroupPtr ScorePart::getMidiDeviceInstrumentGroup( + const MidiDeviceInstrumentGroupSetIterConst &setIterator) const +{ + if (setIterator != myMidiDeviceInstrumentGroupSet.cend()) + { + return *setIterator; + } + return MidiDeviceInstrumentGroupPtr(); +} - ScoreInstrumentPtr ScorePart::getScoreInstrument( const ScoreInstrumentSetIterConst& setIterator ) const - { - if( setIterator != myScoreInstrumentSet.cend() ) - { - return *setIterator; - } - return ScoreInstrumentPtr(); - } +bool ScorePart::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isPartNameFound = false; - const MidiDeviceInstrumentGroupSet& ScorePart::getMidiDeviceInstrumentGroupSet() const - { - return myMidiDeviceInstrumentGroupSet; - } + ::ezxml::XElementIterator end = xelement.end(); + for (auto it = xelement.begin(); it != end; ++it) + { + importElement(message, *it, isSuccess, *myIdentification, myHasIdentification); + importElement(message, *it, isSuccess, *myPartName, isPartNameFound); + importElement(message, *it, isSuccess, *myPartNameDisplay, myHasPartNameDisplay); + importElement(message, *it, isSuccess, *myPartAbbreviation, myHasPartAbbreviation); + importElement(message, *it, isSuccess, *myPartAbbreviationDisplay, myHasPartAbbreviationDisplay); + importElementSet(message, it, end, isSuccess, "group", myGroupSet); + importElementSet(message, it, end, isSuccess, "score-instrument", myScoreInstrumentSet); + importMidiDeviceInstrumentGroupSet(message, it, end, isSuccess); + } - void ScorePart::addMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupPtr& value ) - { - if ( value ) - { - myMidiDeviceInstrumentGroupSet.push_back( value ); - } - } + if (!isPartNameFound) + { + message << "ScorePart: 'part-name' element is required but was not found" << std::endl; + } + MX_RETURN_IS_SUCCESS; +} - void ScorePart::removeMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupSetIterConst& value ) +void ScorePart::importMidiDeviceInstrumentGroupSet(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess) +{ + bool doDecrementIter = false; + while (iter != endIter && (iter->getName() == "midi-device" || iter->getName() == "midi-instrument")) + { + auto item = makeMidiDeviceInstrumentGroup(); + if (iter->getName() == "midi-device") { - if ( value != myMidiDeviceInstrumentGroupSet.cend() ) - { - myMidiDeviceInstrumentGroupSet.erase( value ); - } + item->setHasMidiDevice(true); + auto midiDevice = item->getMidiDevice(); + isSuccess &= midiDevice->fromXElement(message, *iter); + doDecrementIter = true; + ++iter; } - - void ScorePart::clearMidiDeviceInstrumentGroupSet() + if (iter != endIter && iter->getName() == "midi-instrument") { - myMidiDeviceInstrumentGroupSet.clear(); + item->setHasMidiInstrument(true); + auto midiInstrument = item->getMidiInstrument(); + isSuccess &= midiInstrument->fromXElement(message, *iter); + importGroup(message, iter, endIter, isSuccess, midiInstrument); + doDecrementIter = true; + ++iter; } - - MidiDeviceInstrumentGroupPtr ScorePart::getMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupSetIterConst& setIterator ) const + if (item->getHasMidiDevice() || item->getHasMidiInstrument()) { - if( setIterator != myMidiDeviceInstrumentGroupSet.cend() ) - { - return *setIterator; - } - return MidiDeviceInstrumentGroupPtr(); + myMidiDeviceInstrumentGroupSet.push_back(item); } - - bool ScorePart::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - bool isPartNameFound = false; - - ::ezxml::XElementIterator end = xelement.end(); - - for( auto it = xelement.begin(); it != end; ++it ) - { - importElement( message, *it, isSuccess, *myIdentification, myHasIdentification ); - importElement( message, *it, isSuccess, *myPartName, isPartNameFound ); - importElement( message, *it, isSuccess, *myPartNameDisplay, myHasPartNameDisplay ); - importElement( message, *it, isSuccess, *myPartAbbreviation, myHasPartAbbreviation ); - importElement( message, *it, isSuccess, *myPartAbbreviationDisplay, myHasPartAbbreviationDisplay ); - importElementSet( message, it, end, isSuccess, "group", myGroupSet ); - importElementSet( message, it, end, isSuccess, "score-instrument", myScoreInstrumentSet ); - importMidiDeviceInstrumentGroupSet( message, it, end, isSuccess ); - } - - if( !isPartNameFound ) - { - message << "ScorePart: 'part-name' element is required but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - - void ScorePart::importMidiDeviceInstrumentGroupSet( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ) + if (iter != endIter && iter->getName() != "midi-device" && iter->getName() != "midi-instrument") { - bool doDecrementIter = false; - while( iter != endIter && ( iter->getName() == "midi-device" || iter->getName() == "midi-instrument" ) ) - { - auto item = makeMidiDeviceInstrumentGroup(); - if( iter->getName() == "midi-device" ) - { - item->setHasMidiDevice( true ); - auto midiDevice = item->getMidiDevice(); - isSuccess &= midiDevice->fromXElement( message, *iter ); - doDecrementIter = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "midi-instrument" ) - { - item->setHasMidiInstrument( true ); - auto midiInstrument = item->getMidiInstrument(); - isSuccess &= midiInstrument->fromXElement( message, *iter ); - importGroup( message, iter, endIter, isSuccess, midiInstrument ); - doDecrementIter = true; - ++iter; - } - - if( item->getHasMidiDevice() || item->getHasMidiInstrument() ) - { - myMidiDeviceInstrumentGroupSet.push_back( item ); - } - - if( iter != endIter && iter->getName() != "midi-device" && iter->getName() != "midi-instrument" ) - { - if( doDecrementIter ) - { - --iter; - } - return; - } - } - if( doDecrementIter ) + if (doDecrementIter) { --iter; } + return; } - + } + if (doDecrementIter) + { + --iter; } } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScorePart.h b/Sourcecode/private/mx/core/elements/ScorePart.h index 9de271cc0..4443c27c1 100644 --- a/Sourcecode/private/mx/core/elements/ScorePart.h +++ b/Sourcecode/private/mx/core/elements/ScorePart.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ScorePartAttributes.h" #include @@ -14,112 +14,113 @@ namespace ezxml { - class XElementIterator; +class XElementIterator; } namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScorePartAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Group ) - MX_FORWARD_DECLARE_ELEMENT( Identification ) - MX_FORWARD_DECLARE_ELEMENT( MidiDeviceInstrumentGroup ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviation ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviationDisplay ) - MX_FORWARD_DECLARE_ELEMENT( PartName ) - MX_FORWARD_DECLARE_ELEMENT( PartNameDisplay ) - MX_FORWARD_DECLARE_ELEMENT( ScoreInstrument ) - MX_FORWARD_DECLARE_ELEMENT( ScorePart ) - - inline ScorePartPtr makeScorePart() { return std::make_shared(); } - - class ScorePart : public ElementInterface - { - public: - ScorePart(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ScorePartAttributesPtr getAttributes() const; - void setAttributes( const ScorePartAttributesPtr& value ); - - /* _________ Identification minOccurs = 0, maxOccurs = 1 _________ */ - IdentificationPtr getIdentification() const; - void setIdentification( const IdentificationPtr& value ); - bool getHasIdentification() const; - void setHasIdentification( const bool value ); - - /* _________ PartName minOccurs = 1, maxOccurs = 1 _________ */ - PartNamePtr getPartName() const; - void setPartName( const PartNamePtr& value ); - - /* _________ PartNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ - PartNameDisplayPtr getPartNameDisplay() const; - void setPartNameDisplay( const PartNameDisplayPtr& value ); - bool getHasPartNameDisplay() const; - void setHasPartNameDisplay( const bool value ); - - /* _________ PartAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ - PartAbbreviationPtr getPartAbbreviation() const; - void setPartAbbreviation( const PartAbbreviationPtr& value ); - bool getHasPartAbbreviation() const; - void setHasPartAbbreviation( const bool value ); - - /* _________ PartAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ - PartAbbreviationDisplayPtr getPartAbbreviationDisplay() const; - void setPartAbbreviationDisplay( const PartAbbreviationDisplayPtr& value ); - bool getHasPartAbbreviationDisplay() const; - void setHasPartAbbreviationDisplay( const bool value ); - - /* _________ Group minOccurs = 0, maxOccurs = unbounded _________ */ - const GroupSet& getGroupSet() const; - void addGroup( const GroupPtr& value ); - void removeGroup( const GroupSetIterConst& value ); - void clearGroupSet(); - GroupPtr getGroup( const GroupSetIterConst& setIterator ) const; - - /* _________ ScoreInstrument minOccurs = 0, maxOccurs = unbounded _________ */ - const ScoreInstrumentSet& getScoreInstrumentSet() const; - void addScoreInstrument( const ScoreInstrumentPtr& value ); - void removeScoreInstrument( const ScoreInstrumentSetIterConst& value ); - void clearScoreInstrumentSet(); - ScoreInstrumentPtr getScoreInstrument( const ScoreInstrumentSetIterConst& setIterator ) const; - - /* _________ MidiDeviceInstrumentGroup minOccurs = 0, maxOccurs = unbounded _________ */ - const MidiDeviceInstrumentGroupSet& getMidiDeviceInstrumentGroupSet() const; - void addMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupPtr& value ); - void removeMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupSetIterConst& value ); - void clearMidiDeviceInstrumentGroupSet(); - MidiDeviceInstrumentGroupPtr getMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScorePartAttributesPtr myAttributes; - IdentificationPtr myIdentification; - bool myHasIdentification; - PartNamePtr myPartName; - PartNameDisplayPtr myPartNameDisplay; - bool myHasPartNameDisplay; - PartAbbreviationPtr myPartAbbreviation; - bool myHasPartAbbreviation; - PartAbbreviationDisplayPtr myPartAbbreviationDisplay; - bool myHasPartAbbreviationDisplay; - GroupSet myGroupSet; - ScoreInstrumentSet myScoreInstrumentSet; - MidiDeviceInstrumentGroupSet myMidiDeviceInstrumentGroupSet; - - void importMidiDeviceInstrumentGroupSet( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(ScorePartAttributes) +MX_FORWARD_DECLARE_ELEMENT(Group) +MX_FORWARD_DECLARE_ELEMENT(Identification) +MX_FORWARD_DECLARE_ELEMENT(MidiDeviceInstrumentGroup) +MX_FORWARD_DECLARE_ELEMENT(PartAbbreviation) +MX_FORWARD_DECLARE_ELEMENT(PartAbbreviationDisplay) +MX_FORWARD_DECLARE_ELEMENT(PartName) +MX_FORWARD_DECLARE_ELEMENT(PartNameDisplay) +MX_FORWARD_DECLARE_ELEMENT(ScoreInstrument) +MX_FORWARD_DECLARE_ELEMENT(ScorePart) + +inline ScorePartPtr makeScorePart() +{ + return std::make_shared(); } + +class ScorePart : public ElementInterface +{ + public: + ScorePart(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ScorePartAttributesPtr getAttributes() const; + void setAttributes(const ScorePartAttributesPtr &value); + + /* _________ Identification minOccurs = 0, maxOccurs = 1 _________ */ + IdentificationPtr getIdentification() const; + void setIdentification(const IdentificationPtr &value); + bool getHasIdentification() const; + void setHasIdentification(const bool value); + + /* _________ PartName minOccurs = 1, maxOccurs = 1 _________ */ + PartNamePtr getPartName() const; + void setPartName(const PartNamePtr &value); + + /* _________ PartNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ + PartNameDisplayPtr getPartNameDisplay() const; + void setPartNameDisplay(const PartNameDisplayPtr &value); + bool getHasPartNameDisplay() const; + void setHasPartNameDisplay(const bool value); + + /* _________ PartAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ + PartAbbreviationPtr getPartAbbreviation() const; + void setPartAbbreviation(const PartAbbreviationPtr &value); + bool getHasPartAbbreviation() const; + void setHasPartAbbreviation(const bool value); + + /* _________ PartAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ + PartAbbreviationDisplayPtr getPartAbbreviationDisplay() const; + void setPartAbbreviationDisplay(const PartAbbreviationDisplayPtr &value); + bool getHasPartAbbreviationDisplay() const; + void setHasPartAbbreviationDisplay(const bool value); + + /* _________ Group minOccurs = 0, maxOccurs = unbounded _________ */ + const GroupSet &getGroupSet() const; + void addGroup(const GroupPtr &value); + void removeGroup(const GroupSetIterConst &value); + void clearGroupSet(); + GroupPtr getGroup(const GroupSetIterConst &setIterator) const; + + /* _________ ScoreInstrument minOccurs = 0, maxOccurs = unbounded _________ */ + const ScoreInstrumentSet &getScoreInstrumentSet() const; + void addScoreInstrument(const ScoreInstrumentPtr &value); + void removeScoreInstrument(const ScoreInstrumentSetIterConst &value); + void clearScoreInstrumentSet(); + ScoreInstrumentPtr getScoreInstrument(const ScoreInstrumentSetIterConst &setIterator) const; + + /* _________ MidiDeviceInstrumentGroup minOccurs = 0, maxOccurs = unbounded _________ */ + const MidiDeviceInstrumentGroupSet &getMidiDeviceInstrumentGroupSet() const; + void addMidiDeviceInstrumentGroup(const MidiDeviceInstrumentGroupPtr &value); + void removeMidiDeviceInstrumentGroup(const MidiDeviceInstrumentGroupSetIterConst &value); + void clearMidiDeviceInstrumentGroupSet(); + MidiDeviceInstrumentGroupPtr getMidiDeviceInstrumentGroup( + const MidiDeviceInstrumentGroupSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ScorePartAttributesPtr myAttributes; + IdentificationPtr myIdentification; + bool myHasIdentification; + PartNamePtr myPartName; + PartNameDisplayPtr myPartNameDisplay; + bool myHasPartNameDisplay; + PartAbbreviationPtr myPartAbbreviation; + bool myHasPartAbbreviation; + PartAbbreviationDisplayPtr myPartAbbreviationDisplay; + bool myHasPartAbbreviationDisplay; + GroupSet myGroupSet; + ScoreInstrumentSet myScoreInstrumentSet; + MidiDeviceInstrumentGroupSet myMidiDeviceInstrumentGroupSet; + + void importMidiDeviceInstrumentGroupSet(std::ostream &message, ::ezxml::XElementIterator &iter, + ::ezxml::XElementIterator &endIter, bool &isSuccess); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp b/Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp index 047032beb..d8e8e9421 100644 --- a/Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp @@ -8,52 +8,51 @@ namespace mx { - namespace core - { - ScorePartAttributes::ScorePartAttributes() - :id() - ,hasId( true ) - {} - +namespace core +{ +ScorePartAttributes::ScorePartAttributes() : id(), hasId(true) +{ +} - bool ScorePartAttributes::hasValues() const - { - return hasId; - } +bool ScorePartAttributes::hasValues() const +{ + return hasId; +} +std::ostream &ScorePartAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, id, "id", hasId); + } + return os; +} - std::ostream& ScorePartAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } +bool ScorePartAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ScorePartAttributes"; + bool isSuccess = true; + bool isIdFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool ScorePartAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, id, isIdFound, "id")) { - const char* const className = "ScorePartAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'id' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isIdFound) + { + isSuccess = false; + message << className << ": 'id' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScorePartAttributes.h b/Sourcecode/private/mx/core/elements/ScorePartAttributes.h index 803f2a57d..09f9c6dd6 100644 --- a/Sourcecode/private/mx/core/elements/ScorePartAttributes.h +++ b/Sourcecode/private/mx/core/elements/ScorePartAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsID.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( ScorePartAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(ScorePartAttributes) - struct ScorePartAttributes : public AttributesInterface - { - public: - ScorePartAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsID id; - const bool hasId; +struct ScorePartAttributes : public AttributesInterface +{ + public: + ScorePartAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsID id; + const bool hasId; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScorePartwise.cpp b/Sourcecode/private/mx/core/elements/ScorePartwise.cpp index c10d52cdb..5dedc7a18 100644 --- a/Sourcecode/private/mx/core/elements/ScorePartwise.cpp +++ b/Sourcecode/private/mx/core/elements/ScorePartwise.cpp @@ -10,176 +10,156 @@ namespace mx { - namespace core - { - ScorePartwise::ScorePartwise() - :myAttributes( std::make_shared() ) - ,myScoreHeaderGroup( makeScoreHeaderGroup() ) - ,myPartwisePartSet() - { - myPartwisePartSet.push_back( makePartwisePart() ); - } - - - bool ScorePartwise::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& ScorePartwise::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - +namespace core +{ +ScorePartwise::ScorePartwise() + : myAttributes(std::make_shared()), myScoreHeaderGroup(makeScoreHeaderGroup()), + myPartwisePartSet() +{ + myPartwisePartSet.push_back(makePartwisePart()); +} - std::ostream& ScorePartwise::streamName( std::ostream& os ) const - { - os << "score-partwise"; - return os; - } +bool ScorePartwise::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &ScorePartwise::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - bool ScorePartwise::hasContents() const - { - return true; - } +std::ostream &ScorePartwise::streamName(std::ostream &os) const +{ + os << "score-partwise"; + return os; +} +bool ScorePartwise::hasContents() const +{ + return true; +} - std::ostream& ScorePartwise::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myScoreHeaderGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - for ( auto x : myPartwisePartSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } +std::ostream &ScorePartwise::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myScoreHeaderGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + for (auto x : myPartwisePartSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} +ScorePartwiseAttributesPtr ScorePartwise::getAttributes() const +{ + return myAttributes; +} - ScorePartwiseAttributesPtr ScorePartwise::getAttributes() const - { - return myAttributes; - } +void ScorePartwise::setAttributes(const ScorePartwiseAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +ScoreHeaderGroupPtr ScorePartwise::getScoreHeaderGroup() const +{ + return myScoreHeaderGroup; +} - void ScorePartwise::setAttributes( const ScorePartwiseAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +void ScorePartwise::setScoreHeaderGroup(const ScoreHeaderGroupPtr &value) +{ + if (value) + { + myScoreHeaderGroup = value; + } +} +const PartwisePartSet &ScorePartwise::getPartwisePartSet() const +{ + return myPartwisePartSet; +} - ScoreHeaderGroupPtr ScorePartwise::getScoreHeaderGroup() const +void ScorePartwise::removePartwisePart(const PartwisePartSetIterConst &value) +{ + if (value != myPartwisePartSet.cend()) + { + if (myPartwisePartSet.size() > 1) { - return myScoreHeaderGroup; + myPartwisePartSet.erase(value); } + } +} +void ScorePartwise::addPartwisePart(const PartwisePartPtr &value) +{ + if (value) + { + myPartwisePartSet.push_back(value); + } +} - void ScorePartwise::setScoreHeaderGroup( const ScoreHeaderGroupPtr& value ) - { - if ( value ) - { - myScoreHeaderGroup = value; - } - } +void ScorePartwise::clearPartwisePartSet() +{ + myPartwisePartSet.clear(); + myPartwisePartSet.push_back(makePartwisePart()); +} +PartwisePartPtr ScorePartwise::getPartwisePart(const PartwisePartSetIterConst &setIterator) const +{ + if (setIterator != myPartwisePartSet.cend()) + { + return *setIterator; + } + return PartwisePartPtr(); +} - const PartwisePartSet& ScorePartwise::getPartwisePartSet() const - { - return myPartwisePartSet; - } +bool ScorePartwise::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isFirstPartAdded = false; + isSuccess &= myAttributes->fromXElement(message, xelement); + isSuccess &= myScoreHeaderGroup->fromXElement(message, xelement); - void ScorePartwise::removePartwisePart( const PartwisePartSetIterConst& value ) - { - if ( value != myPartwisePartSet.cend() ) - { - if ( myPartwisePartSet.size() > 1 ) - { - myPartwisePartSet.erase( value ); - } - } - } + auto it = xelement.begin(); + auto end = xelement.end(); + for (; it != xelement.end(); ++it) + { + const std::string elementName = it->getName(); - void ScorePartwise::addPartwisePart( const PartwisePartPtr& value ) + if (elementName == "work" || elementName == "movement-number" || elementName == "movement-title" || + elementName == "identification" || elementName == "defaults" || elementName == "credit") { - if ( value ) - { - myPartwisePartSet.push_back( value ); - } + continue; } - - - void ScorePartwise::clearPartwisePartSet() + else if (elementName == "part") { - myPartwisePartSet.clear(); - myPartwisePartSet.push_back( makePartwisePart() ); - } + auto part = makePartwisePart(); - - PartwisePartPtr ScorePartwise::getPartwisePart( const PartwisePartSetIterConst& setIterator ) const - { - if( setIterator != myPartwisePartSet.cend() ) + if (!isFirstPartAdded && myPartwisePartSet.size() == 1) { - return *setIterator; + *(myPartwisePartSet.begin()) = part; + isFirstPartAdded = true; } - return PartwisePartPtr(); - } - - - bool ScorePartwise::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstPartAdded = false; - - isSuccess &= myAttributes->fromXElement( message, xelement ); - isSuccess &= myScoreHeaderGroup->fromXElement( message, xelement ); - - auto it = xelement.begin(); - auto end = xelement.end(); - - for( ; it != xelement.end(); ++it ) + else { - const std::string elementName = it->getName(); - - if( elementName == "work" - || elementName == "movement-number" - || elementName == "movement-title" - || elementName == "identification" - || elementName == "defaults" - || elementName == "credit" ) - { - continue; - } - else if( elementName == "part" ) - { - auto part = makePartwisePart(); - - if( !isFirstPartAdded && myPartwisePartSet.size() == 1 ) - { - *( myPartwisePartSet.begin() ) = part; - isFirstPartAdded = true; - } - else - { - myPartwisePartSet.push_back( part ); - isFirstPartAdded = true; - } - - isSuccess &= part->fromXElement( message, *it ); - } + myPartwisePartSet.push_back(part); + isFirstPartAdded = true; } - - MX_RETURN_IS_SUCCESS; - } + isSuccess &= part->fromXElement(message, *it); + } } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScorePartwise.h b/Sourcecode/private/mx/core/elements/ScorePartwise.h index 0fc3f2209..71dc0c0d4 100644 --- a/Sourcecode/private/mx/core/elements/ScorePartwise.h +++ b/Sourcecode/private/mx/core/elements/ScorePartwise.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ScorePartwiseAttributes.h" #include @@ -14,47 +14,50 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScorePartwiseAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartwisePart ) - MX_FORWARD_DECLARE_ELEMENT( ScoreHeaderGroup ) - MX_FORWARD_DECLARE_ELEMENT( ScorePartwise ) - - inline ScorePartwisePtr makeScorePartwise() { return std::make_shared(); } - - class ScorePartwise : public ElementInterface - { - public: - ScorePartwise(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ScorePartwiseAttributesPtr getAttributes() const; - void setAttributes( const ScorePartwiseAttributesPtr& value ); - - /* _________ ScoreHeaderGroup minOccurs = 1, maxOccurs = 1 _________ */ - ScoreHeaderGroupPtr getScoreHeaderGroup() const; - void setScoreHeaderGroup( const ScoreHeaderGroupPtr& value ); - - /* _________ PartwisePart minOccurs = 1, maxOccurs = unbounded _________ */ - const PartwisePartSet& getPartwisePartSet() const; - void addPartwisePart( const PartwisePartPtr& value ); - void removePartwisePart( const PartwisePartSetIterConst& value ); - void clearPartwisePartSet(); - PartwisePartPtr getPartwisePart( const PartwisePartSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScorePartwiseAttributesPtr myAttributes; - ScoreHeaderGroupPtr myScoreHeaderGroup; - PartwisePartSet myPartwisePartSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(ScorePartwiseAttributes) +MX_FORWARD_DECLARE_ELEMENT(PartwisePart) +MX_FORWARD_DECLARE_ELEMENT(ScoreHeaderGroup) +MX_FORWARD_DECLARE_ELEMENT(ScorePartwise) + +inline ScorePartwisePtr makeScorePartwise() +{ + return std::make_shared(); } + +class ScorePartwise : public ElementInterface +{ + public: + ScorePartwise(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ScorePartwiseAttributesPtr getAttributes() const; + void setAttributes(const ScorePartwiseAttributesPtr &value); + + /* _________ ScoreHeaderGroup minOccurs = 1, maxOccurs = 1 _________ */ + ScoreHeaderGroupPtr getScoreHeaderGroup() const; + void setScoreHeaderGroup(const ScoreHeaderGroupPtr &value); + + /* _________ PartwisePart minOccurs = 1, maxOccurs = unbounded _________ */ + const PartwisePartSet &getPartwisePartSet() const; + void addPartwisePart(const PartwisePartPtr &value); + void removePartwisePart(const PartwisePartSetIterConst &value); + void clearPartwisePartSet(); + PartwisePartPtr getPartwisePart(const PartwisePartSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ScorePartwiseAttributesPtr myAttributes; + ScoreHeaderGroupPtr myScoreHeaderGroup; + PartwisePartSet myPartwisePartSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp b/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp index 9daad9e45..e632a1809 100644 --- a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp @@ -3,54 +3,52 @@ // Distributed under the MIT License #include "mx/core/elements/ScorePartwiseAttributes.h" -#include "mx/core/FromXElement.h" -#include "ezxml/XElement.h" #include "ezxml/XAttributeIterator.h" +#include "ezxml/XElement.h" +#include "mx/core/FromXElement.h" #include namespace mx { - namespace core - { - ScorePartwiseAttributes::ScorePartwiseAttributes() - :version( "3.0" ) - ,hasVersion( false ) - {} - +namespace core +{ +ScorePartwiseAttributes::ScorePartwiseAttributes() : version("3.0"), hasVersion(false) +{ +} - bool ScorePartwiseAttributes::hasValues() const - { - return hasVersion; - } +bool ScorePartwiseAttributes::hasValues() const +{ + return hasVersion; +} +std::ostream &ScorePartwiseAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, version, "version", hasVersion); + } + return os; +} - std::ostream& ScorePartwiseAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, version, "version", hasVersion ); - } - return os; - } +bool ScorePartwiseAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ScorePartwiseAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool ScorePartwiseAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, version, hasVersion, "version")) { - const char* const className = "ScorePartwiseAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, version, hasVersion, "version" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h b/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h index e1610e54f..2d6a285b8 100644 --- a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h +++ b/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h @@ -14,21 +14,21 @@ namespace mx { - namespace core - { - MX_FORWARD_DECLARE_ATTRIBUTES( ScorePartwiseAttributes ) +namespace core +{ +MX_FORWARD_DECLARE_ATTRIBUTES(ScorePartwiseAttributes) - struct ScorePartwiseAttributes : public AttributesInterface - { - public: - ScorePartwiseAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken version; - bool hasVersion; +struct ScorePartwiseAttributes : public AttributesInterface +{ + public: + ScorePartwiseAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken version; + bool hasVersion; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewise.cpp b/Sourcecode/private/mx/core/elements/ScoreTimewise.cpp index 785757ac2..561461a22 100644 --- a/Sourcecode/private/mx/core/elements/ScoreTimewise.cpp +++ b/Sourcecode/private/mx/core/elements/ScoreTimewise.cpp @@ -3,186 +3,165 @@ // Distributed under the MIT License #include "mx/core/elements/ScoreTimewise.h" -#include "mx/core/elements/ScoreHeaderGroup.h" -#include "mx/core/elements/TimewiseMeasure.h" -#include "mx/core/FromXElement.h" #include "ezxml/XElement.h" #include "ezxml/XElementIterator.h" +#include "mx/core/FromXElement.h" +#include "mx/core/elements/ScoreHeaderGroup.h" +#include "mx/core/elements/TimewiseMeasure.h" #include namespace mx { - namespace core - { - ScoreTimewise::ScoreTimewise() - :myAttributes( std::make_shared() ) - ,myScoreHeaderGroup( makeScoreHeaderGroup() ) - ,myTimewiseMeasureSet() - { - myTimewiseMeasureSet.push_back( makeTimewiseMeasure() ); - } - - - bool ScoreTimewise::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& ScoreTimewise::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - +namespace core +{ +ScoreTimewise::ScoreTimewise() + : myAttributes(std::make_shared()), myScoreHeaderGroup(makeScoreHeaderGroup()), + myTimewiseMeasureSet() +{ + myTimewiseMeasureSet.push_back(makeTimewiseMeasure()); +} - std::ostream& ScoreTimewise::streamName( std::ostream& os ) const - { - os << "score-timewise"; - return os; - } +bool ScoreTimewise::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &ScoreTimewise::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - bool ScoreTimewise::hasContents() const - { - return true; - } +std::ostream &ScoreTimewise::streamName(std::ostream &os) const +{ + os << "score-timewise"; + return os; +} +bool ScoreTimewise::hasContents() const +{ + return true; +} - std::ostream& ScoreTimewise::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myScoreHeaderGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - for ( auto x : myTimewiseMeasureSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } +std::ostream &ScoreTimewise::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myScoreHeaderGroup->streamContents(os, indentLevel + 1, isOneLineOnly); + for (auto x : myTimewiseMeasureSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + os << std::endl; + isOneLineOnly = false; + return os; +} +ScoreTimewiseAttributesPtr ScoreTimewise::getAttributes() const +{ + return myAttributes; +} - ScoreTimewiseAttributesPtr ScoreTimewise::getAttributes() const - { - return myAttributes; - } +void ScoreTimewise::setAttributes(const ScoreTimewiseAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +ScoreHeaderGroupPtr ScoreTimewise::getScoreHeaderGroup() const +{ + return myScoreHeaderGroup; +} - void ScoreTimewise::setAttributes( const ScoreTimewiseAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +void ScoreTimewise::setScoreHeaderGroup(const ScoreHeaderGroupPtr &value) +{ + if (value) + { + myScoreHeaderGroup = value; + } +} +const TimewiseMeasureSet &ScoreTimewise::getTimewiseMeasureSet() const +{ + return myTimewiseMeasureSet; +} - ScoreHeaderGroupPtr ScoreTimewise::getScoreHeaderGroup() const +void ScoreTimewise::removeTimewiseMeasure(const TimewiseMeasureSetIterConst &value) +{ + if (value != myTimewiseMeasureSet.cend()) + { + if (myTimewiseMeasureSet.size() > 1) { - return myScoreHeaderGroup; + myTimewiseMeasureSet.erase(value); } + } +} +void ScoreTimewise::addTimewiseMeasure(const TimewiseMeasurePtr &value) +{ + if (value) + { + myTimewiseMeasureSet.push_back(value); + } +} - void ScoreTimewise::setScoreHeaderGroup( const ScoreHeaderGroupPtr& value ) - { - if ( value ) - { - myScoreHeaderGroup = value; - } - } +void ScoreTimewise::clearTimewiseMeasureSet() +{ + myTimewiseMeasureSet.clear(); + myTimewiseMeasureSet.push_back(makeTimewiseMeasure()); +} +TimewiseMeasurePtr ScoreTimewise::getTimewiseMeasure(const TimewiseMeasureSetIterConst &setIterator) const +{ + if (setIterator != myTimewiseMeasureSet.cend()) + { + return *setIterator; + } + return TimewiseMeasurePtr(); +} - const TimewiseMeasureSet& ScoreTimewise::getTimewiseMeasureSet() const - { - return myTimewiseMeasureSet; - } +bool ScoreTimewise::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isFirstMeasureAdded = false; + isSuccess &= myAttributes->fromXElement(message, xelement); + isSuccess &= myScoreHeaderGroup->fromXElement(message, xelement); - void ScoreTimewise::removeTimewiseMeasure( const TimewiseMeasureSetIterConst& value ) - { - if ( value != myTimewiseMeasureSet.cend() ) - { - if ( myTimewiseMeasureSet.size() > 1 ) - { - myTimewiseMeasureSet.erase( value ); - } - } - } + auto it = xelement.begin(); + auto end = xelement.end(); + for (; it != end; ++it) + { + const std::string elementName = it->getName(); - void ScoreTimewise::addTimewiseMeasure( const TimewiseMeasurePtr& value ) + if (elementName == "work" || elementName == "movement-number" || elementName == "movement-title" || + elementName == "identification" || elementName == "defaults" || elementName == "credit") { - if ( value ) - { - myTimewiseMeasureSet.push_back( value ); - } + continue; } - - - void ScoreTimewise::clearTimewiseMeasureSet() + else if (elementName == "measure") { - myTimewiseMeasureSet.clear(); - myTimewiseMeasureSet.push_back( makeTimewiseMeasure() ); - } - + auto measure = makeTimewiseMeasure(); - TimewiseMeasurePtr ScoreTimewise::getTimewiseMeasure( const TimewiseMeasureSetIterConst& setIterator ) const - { - if( setIterator != myTimewiseMeasureSet.cend() ) + if (!isFirstMeasureAdded && myTimewiseMeasureSet.size() == 1) { - return *setIterator; + *(myTimewiseMeasureSet.begin()) = measure; + isFirstMeasureAdded = true; } - return TimewiseMeasurePtr(); - } - - bool ScoreTimewise::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstMeasureAdded = false; - - isSuccess &= myAttributes->fromXElement( message, xelement ); - isSuccess &= myScoreHeaderGroup->fromXElement( message, xelement ); - - auto it = xelement.begin(); - auto end = xelement.end(); - - for( ; it != end; ++it ) + else { - const std::string elementName = it->getName(); - - if( elementName == "work" - || elementName == "movement-number" - || elementName == "movement-title" - || elementName == "identification" - || elementName == "defaults" - || elementName == "credit" ) - { - continue; - } - else if( elementName == "measure" ) - { - auto measure = makeTimewiseMeasure(); - - if( !isFirstMeasureAdded && myTimewiseMeasureSet.size() == 1 ) - { - *( myTimewiseMeasureSet.begin() ) = measure; - isFirstMeasureAdded = true; - } - else - { - myTimewiseMeasureSet.push_back( measure ); - isFirstMeasureAdded = true; - } - - isSuccess &= measure->fromXElement( message, *it ); - } + myTimewiseMeasureSet.push_back(measure); + isFirstMeasureAdded = true; } - - MX_RETURN_IS_SUCCESS; - } + isSuccess &= measure->fromXElement(message, *it); + } } -} + MX_RETURN_IS_SUCCESS; +} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewise.h b/Sourcecode/private/mx/core/elements/ScoreTimewise.h index bd8bee8c9..02c7f436d 100644 --- a/Sourcecode/private/mx/core/elements/ScoreTimewise.h +++ b/Sourcecode/private/mx/core/elements/ScoreTimewise.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/ScoreTimewiseAttributes.h" #include @@ -14,46 +14,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScoreTimewiseAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ScoreHeaderGroup ) - MX_FORWARD_DECLARE_ELEMENT( TimewiseMeasure ) - MX_FORWARD_DECLARE_ELEMENT( ScoreTimewise ) - - inline ScoreTimewisePtr makeScoreTimewise() { return std::make_shared(); } - - class ScoreTimewise : public ElementInterface - { - public: - ScoreTimewise(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ScoreTimewiseAttributesPtr getAttributes() const; - void setAttributes( const ScoreTimewiseAttributesPtr& value ); - - /* _________ ScoreHeaderGroup minOccurs = 1, maxOccurs = 1 _________ */ - ScoreHeaderGroupPtr getScoreHeaderGroup() const; - void setScoreHeaderGroup( const ScoreHeaderGroupPtr& value ); - - /* _________ TimewiseMeasure minOccurs = 1, maxOccurs = unbounded _________ */ - const TimewiseMeasureSet& getTimewiseMeasureSet() const; - void addTimewiseMeasure( const TimewiseMeasurePtr& value ); - void removeTimewiseMeasure( const TimewiseMeasureSetIterConst& value ); - void clearTimewiseMeasureSet(); - TimewiseMeasurePtr getTimewiseMeasure( const TimewiseMeasureSetIterConst& setIterator ) const; - - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScoreTimewiseAttributesPtr myAttributes; - ScoreHeaderGroupPtr myScoreHeaderGroup; - TimewiseMeasureSet myTimewiseMeasureSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(ScoreTimewiseAttributes) +MX_FORWARD_DECLARE_ELEMENT(ScoreHeaderGroup) +MX_FORWARD_DECLARE_ELEMENT(TimewiseMeasure) +MX_FORWARD_DECLARE_ELEMENT(ScoreTimewise) + +inline ScoreTimewisePtr makeScoreTimewise() +{ + return std::make_shared(); } + +class ScoreTimewise : public ElementInterface +{ + public: + ScoreTimewise(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ScoreTimewiseAttributesPtr getAttributes() const; + void setAttributes(const ScoreTimewiseAttributesPtr &value); + + /* _________ ScoreHeaderGroup minOccurs = 1, maxOccurs = 1 _________ */ + ScoreHeaderGroupPtr getScoreHeaderGroup() const; + void setScoreHeaderGroup(const ScoreHeaderGroupPtr &value); + + /* _________ TimewiseMeasure minOccurs = 1, maxOccurs = unbounded _________ */ + const TimewiseMeasureSet &getTimewiseMeasureSet() const; + void addTimewiseMeasure(const TimewiseMeasurePtr &value); + void removeTimewiseMeasure(const TimewiseMeasureSetIterConst &value); + void clearTimewiseMeasureSet(); + TimewiseMeasurePtr getTimewiseMeasure(const TimewiseMeasureSetIterConst &setIterator) const; + + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ScoreTimewiseAttributesPtr myAttributes; + ScoreHeaderGroupPtr myScoreHeaderGroup; + TimewiseMeasureSet myTimewiseMeasureSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp b/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp index 502e292cb..575a60276 100644 --- a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp @@ -3,52 +3,51 @@ // Distributed under the MIT License #include "mx/core/elements/ScoreTimewiseAttributes.h" -#include "mx/core/FromXElement.h" -#include "ezxml/XElement.h" #include "ezxml/XAttributeIterator.h" +#include "ezxml/XElement.h" +#include "mx/core/FromXElement.h" #include namespace mx { - namespace core - { - ScoreTimewiseAttributes::ScoreTimewiseAttributes() - :version( "3.0" ) - ,hasVersion( false ) - {} - +namespace core +{ +ScoreTimewiseAttributes::ScoreTimewiseAttributes() : version("3.0"), hasVersion(false) +{ +} - bool ScoreTimewiseAttributes::hasValues() const - { - return hasVersion; - } +bool ScoreTimewiseAttributes::hasValues() const +{ + return hasVersion; +} +std::ostream &ScoreTimewiseAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, version, "version", hasVersion); + } + return os; +} - std::ostream& ScoreTimewiseAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, version, "version", hasVersion ); - } - return os; - } +bool ScoreTimewiseAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "ScoreTimewiseAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool ScoreTimewiseAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, version, hasVersion, "version")) { - const char* const className = "ScoreTimewiseAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, version, hasVersion, "version" ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h b/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h index 14ff64c4b..87a4b18cd 100644 --- a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h +++ b/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsToken.h" #include @@ -14,21 +14,21 @@ namespace mx { - namespace core - { - MX_FORWARD_DECLARE_ATTRIBUTES( ScoreTimewiseAttributes ) +namespace core +{ +MX_FORWARD_DECLARE_ATTRIBUTES(ScoreTimewiseAttributes) - struct ScoreTimewiseAttributes : public AttributesInterface - { - public: - ScoreTimewiseAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken version; - bool hasVersion; +struct ScoreTimewiseAttributes : public AttributesInterface +{ + public: + ScoreTimewiseAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + XsToken version; + bool hasVersion; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Segno.cpp b/Sourcecode/private/mx/core/elements/Segno.cpp index f9b5178f1..faad0bb4e 100644 --- a/Sourcecode/private/mx/core/elements/Segno.cpp +++ b/Sourcecode/private/mx/core/elements/Segno.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Segno::Segno() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Segno::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Segno::hasContents() const { return false; } - std::ostream& Segno::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Segno::streamName( std::ostream& os ) const { os << "segno"; return os; } - std::ostream& Segno::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Segno::Segno() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Segno::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPrintObjectStyleAlignAttributesPtr Segno::getAttributes() const - { - return myAttributes; - } +bool Segno::hasContents() const +{ + return false; +} +std::ostream &Segno::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Segno::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Segno::streamName(std::ostream &os) const +{ + os << "segno"; + return os; +} +std::ostream &Segno::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Segno::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPrintObjectStyleAlignAttributesPtr Segno::getAttributes() const +{ + return myAttributes; +} +void Segno::setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Segno::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Segno.h b/Sourcecode/private/mx/core/elements/Segno.h index ddc059486..f34355174 100644 --- a/Sourcecode/private/mx/core/elements/Segno.h +++ b/Sourcecode/private/mx/core/elements/Segno.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,31 +14,34 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Segno ) - - inline SegnoPtr makeSegno() { return std::make_shared(); } - - class Segno : public ElementInterface - { - public: - Segno(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); +namespace core +{ - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); +MX_FORWARD_DECLARE_ELEMENT(Segno) - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } +inline SegnoPtr makeSegno() +{ + return std::make_shared(); } + +class Segno : public ElementInterface +{ + public: + Segno(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; + void setAttributes(const EmptyPrintObjectStyleAlignAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPrintObjectStyleAlignAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SemiPitched.cpp b/Sourcecode/private/mx/core/elements/SemiPitched.cpp index 8e5933d2d..5cb0368d5 100644 --- a/Sourcecode/private/mx/core/elements/SemiPitched.cpp +++ b/Sourcecode/private/mx/core/elements/SemiPitched.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - SemiPitched::SemiPitched() - :myValue( SemiPitchedEnum::medium ) - {} - - - SemiPitched::SemiPitched( const SemiPitchedEnum& value ) - :myValue( value ) - {} - - - bool SemiPitched::hasAttributes() const - { - return false; - } - - - bool SemiPitched::hasContents() const - { - return true; - } - - - std::ostream& SemiPitched::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SemiPitched::streamName( std::ostream& os ) const - { - os << "semi-pitched"; - return os; - } +namespace core +{ +SemiPitched::SemiPitched() : myValue(SemiPitchedEnum::medium) +{ +} +SemiPitched::SemiPitched(const SemiPitchedEnum &value) : myValue(value) +{ +} - std::ostream& SemiPitched::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool SemiPitched::hasAttributes() const +{ + return false; +} +bool SemiPitched::hasContents() const +{ + return true; +} - SemiPitchedEnum SemiPitched::getValue() const - { - return myValue; - } +std::ostream &SemiPitched::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &SemiPitched::streamName(std::ostream &os) const +{ + os << "semi-pitched"; + return os; +} - void SemiPitched::setValue( const SemiPitchedEnum& value ) - { - myValue = value; - } +std::ostream &SemiPitched::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +SemiPitchedEnum SemiPitched::getValue() const +{ + return myValue; +} - bool SemiPitched::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseSemiPitchedEnum( xelement.getValue() ); - return true; - } +void SemiPitched::setValue(const SemiPitchedEnum &value) +{ + myValue = value; +} - } +bool SemiPitched::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseSemiPitchedEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SemiPitched.h b/Sourcecode/private/mx/core/elements/SemiPitched.h index 01b32805f..345c74acc 100644 --- a/Sourcecode/private/mx/core/elements/SemiPitched.h +++ b/Sourcecode/private/mx/core/elements/SemiPitched.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SemiPitched ) - - inline SemiPitchedPtr makeSemiPitched() { return std::make_shared(); } - inline SemiPitchedPtr makeSemiPitched( const SemiPitchedEnum& value ) { return std::make_shared( value ); } - inline SemiPitchedPtr makeSemiPitched( SemiPitchedEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class SemiPitched : public ElementInterface - { - public: - SemiPitched(); - SemiPitched( const SemiPitchedEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SemiPitchedEnum getValue() const; - void setValue( const SemiPitchedEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SemiPitchedEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(SemiPitched) + +inline SemiPitchedPtr makeSemiPitched() +{ + return std::make_shared(); +} + +inline SemiPitchedPtr makeSemiPitched(const SemiPitchedEnum &value) +{ + return std::make_shared(value); } + +inline SemiPitchedPtr makeSemiPitched(SemiPitchedEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class SemiPitched : public ElementInterface +{ + public: + SemiPitched(); + SemiPitched(const SemiPitchedEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + SemiPitchedEnum getValue() const; + void setValue(const SemiPitchedEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + SemiPitchedEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SenzaMisura.cpp b/Sourcecode/private/mx/core/elements/SenzaMisura.cpp index f4fe7f082..8e69005bd 100644 --- a/Sourcecode/private/mx/core/elements/SenzaMisura.cpp +++ b/Sourcecode/private/mx/core/elements/SenzaMisura.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - SenzaMisura::SenzaMisura() - :myValue() - {} - - - SenzaMisura::SenzaMisura( const XsString& value ) - :myValue( value ) - {} - - - bool SenzaMisura::hasAttributes() const - { - return false; - } - - - bool SenzaMisura::hasContents() const - { - return true; - } - - - std::ostream& SenzaMisura::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SenzaMisura::streamName( std::ostream& os ) const - { - os << "senza-misura"; - return os; - } +namespace core +{ +SenzaMisura::SenzaMisura() : myValue() +{ +} +SenzaMisura::SenzaMisura(const XsString &value) : myValue(value) +{ +} - std::ostream& SenzaMisura::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool SenzaMisura::hasAttributes() const +{ + return false; +} +bool SenzaMisura::hasContents() const +{ + return true; +} - XsString SenzaMisura::getValue() const - { - return myValue; - } +std::ostream &SenzaMisura::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &SenzaMisura::streamName(std::ostream &os) const +{ + os << "senza-misura"; + return os; +} - void SenzaMisura::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &SenzaMisura::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString SenzaMisura::getValue() const +{ + return myValue; +} - bool SenzaMisura::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void SenzaMisura::setValue(const XsString &value) +{ + myValue = value; +} - } +bool SenzaMisura::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SenzaMisura.h b/Sourcecode/private/mx/core/elements/SenzaMisura.h index a4785a860..d27c0f633 100644 --- a/Sourcecode/private/mx/core/elements/SenzaMisura.h +++ b/Sourcecode/private/mx/core/elements/SenzaMisura.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SenzaMisura ) - - inline SenzaMisuraPtr makeSenzaMisura() { return std::make_shared(); } - inline SenzaMisuraPtr makeSenzaMisura( const XsString& value ) { return std::make_shared( value ); } - inline SenzaMisuraPtr makeSenzaMisura( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class SenzaMisura : public ElementInterface - { - public: - SenzaMisura(); - SenzaMisura( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(SenzaMisura) + +inline SenzaMisuraPtr makeSenzaMisura() +{ + return std::make_shared(); +} + +inline SenzaMisuraPtr makeSenzaMisura(const XsString &value) +{ + return std::make_shared(value); } + +inline SenzaMisuraPtr makeSenzaMisura(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class SenzaMisura : public ElementInterface +{ + public: + SenzaMisura(); + SenzaMisura(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Shake.cpp b/Sourcecode/private/mx/core/elements/Shake.cpp index 17bb7d589..2eddb7e45 100644 --- a/Sourcecode/private/mx/core/elements/Shake.cpp +++ b/Sourcecode/private/mx/core/elements/Shake.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Shake::Shake() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Shake::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Shake::hasContents() const { return false; } - std::ostream& Shake::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Shake::streamName( std::ostream& os ) const { os << "shake"; return os; } - std::ostream& Shake::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Shake::Shake() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Shake::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyTrillSoundAttributesPtr Shake::getAttributes() const - { - return myAttributes; - } +bool Shake::hasContents() const +{ + return false; +} +std::ostream &Shake::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Shake::setAttributes( const EmptyTrillSoundAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Shake::streamName(std::ostream &os) const +{ + os << "shake"; + return os; +} +std::ostream &Shake::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Shake::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyTrillSoundAttributesPtr Shake::getAttributes() const +{ + return myAttributes; +} +void Shake::setAttributes(const EmptyTrillSoundAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Shake::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Shake.h b/Sourcecode/private/mx/core/elements/Shake.h index e519b4e06..a91324f15 100644 --- a/Sourcecode/private/mx/core/elements/Shake.h +++ b/Sourcecode/private/mx/core/elements/Shake.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyTrillSoundAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyTrillSoundAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Shake ) - - inline ShakePtr makeShake() { return std::make_shared(); } - - class Shake : public ElementInterface - { - public: - Shake(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyTrillSoundAttributesPtr getAttributes() const; - void setAttributes( const EmptyTrillSoundAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyTrillSoundAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyTrillSoundAttributes) +MX_FORWARD_DECLARE_ELEMENT(Shake) + +inline ShakePtr makeShake() +{ + return std::make_shared(); } + +class Shake : public ElementInterface +{ + public: + Shake(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyTrillSoundAttributesPtr getAttributes() const; + void setAttributes(const EmptyTrillSoundAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyTrillSoundAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Sign.cpp b/Sourcecode/private/mx/core/elements/Sign.cpp index 5b0134281..8cce03c14 100644 --- a/Sourcecode/private/mx/core/elements/Sign.cpp +++ b/Sourcecode/private/mx/core/elements/Sign.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - Sign::Sign() - :myValue( ClefSign::g ) - {} - - - Sign::Sign( const ClefSign& value ) - :myValue( value ) - {} - - - bool Sign::hasAttributes() const - { - return false; - } - - - bool Sign::hasContents() const - { - return true; - } - - - std::ostream& Sign::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Sign::streamName( std::ostream& os ) const - { - os << "sign"; - return os; - } +namespace core +{ +Sign::Sign() : myValue(ClefSign::g) +{ +} +Sign::Sign(const ClefSign &value) : myValue(value) +{ +} - std::ostream& Sign::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Sign::hasAttributes() const +{ + return false; +} +bool Sign::hasContents() const +{ + return true; +} - ClefSign Sign::getValue() const - { - return myValue; - } +std::ostream &Sign::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Sign::streamName(std::ostream &os) const +{ + os << "sign"; + return os; +} - void Sign::setValue( const ClefSign& value ) - { - myValue = value; - } +std::ostream &Sign::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +ClefSign Sign::getValue() const +{ + return myValue; +} - bool Sign::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseClefSign( xelement.getValue() ); - return true; - } +void Sign::setValue(const ClefSign &value) +{ + myValue = value; +} - } +bool Sign::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseClefSign(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Sign.h b/Sourcecode/private/mx/core/elements/Sign.h index fedf5c055..d258d3282 100644 --- a/Sourcecode/private/mx/core/elements/Sign.h +++ b/Sourcecode/private/mx/core/elements/Sign.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Sign ) - - inline SignPtr makeSign() { return std::make_shared(); } - inline SignPtr makeSign( const ClefSign& value ) { return std::make_shared( value ); } - inline SignPtr makeSign( ClefSign&& value ) { return std::make_shared( std::move( value ) ); } - - class Sign : public ElementInterface - { - public: - Sign(); - Sign( const ClefSign& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ClefSign getValue() const; - void setValue( const ClefSign& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ClefSign myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Sign) + +inline SignPtr makeSign() +{ + return std::make_shared(); +} + +inline SignPtr makeSign(const ClefSign &value) +{ + return std::make_shared(value); } + +inline SignPtr makeSign(ClefSign &&value) +{ + return std::make_shared(std::move(value)); +} + +class Sign : public ElementInterface +{ + public: + Sign(); + Sign(const ClefSign &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + ClefSign getValue() const; + void setValue(const ClefSign &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + ClefSign myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Slash.cpp b/Sourcecode/private/mx/core/elements/Slash.cpp index b731611f7..5e529bf9e 100644 --- a/Sourcecode/private/mx/core/elements/Slash.cpp +++ b/Sourcecode/private/mx/core/elements/Slash.cpp @@ -10,137 +10,124 @@ namespace mx { - namespace core - { - Slash::Slash() - :myAttributes( std::make_shared() ) - ,mySlashType( makeSlashType() ) - ,mySlashDotSet() - {} - - - bool Slash::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Slash::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - +namespace core +{ +Slash::Slash() : myAttributes(std::make_shared()), mySlashType(makeSlashType()), mySlashDotSet() +{ +} - std::ostream& Slash::streamName( std::ostream& os ) const - { - os << "slash"; - return os; - } +bool Slash::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Slash::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - bool Slash::hasContents() const - { - return true; - } +std::ostream &Slash::streamName(std::ostream &os) const +{ + os << "slash"; + return os; +} +bool Slash::hasContents() const +{ + return true; +} - std::ostream& Slash::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const +std::ostream &Slash::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + mySlashType->toStream(os, indentLevel + 1); + for (auto x : mySlashDotSet) + { + if (x) { - isOneLineOnly = false; os << std::endl; - mySlashType->toStream( os, indentLevel+1 ); - for ( auto x : mySlashDotSet ) - { - if ( x ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - os << std::endl; - return os; - } - - - SlashAttributesPtr Slash::getAttributes() const - { - return myAttributes; - } - - - void Slash::setAttributes( const SlashAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - SlashTypePtr Slash::getSlashType() const - { - return mySlashType; - } - - - void Slash::setSlashType( const SlashTypePtr& value ) - { - if( value ) - { - mySlashType = value; - } + x->toStream(os, indentLevel + 1); } + } + os << std::endl; + return os; +} +SlashAttributesPtr Slash::getAttributes() const +{ + return myAttributes; +} - const SlashDotSet& Slash::getSlashDotSet() const - { - return mySlashDotSet; - } +void Slash::setAttributes(const SlashAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +SlashTypePtr Slash::getSlashType() const +{ + return mySlashType; +} - void Slash::removeSlashDot( const SlashDotSetIterConst& value ) - { - if ( value != mySlashDotSet.cend() ) - { - mySlashDotSet.erase( value ); - } - } +void Slash::setSlashType(const SlashTypePtr &value) +{ + if (value) + { + mySlashType = value; + } +} +const SlashDotSet &Slash::getSlashDotSet() const +{ + return mySlashDotSet; +} - void Slash::addSlashDot( const SlashDotPtr& value ) - { - if ( value ) - { - mySlashDotSet.push_back( value ); - } - } +void Slash::removeSlashDot(const SlashDotSetIterConst &value) +{ + if (value != mySlashDotSet.cend()) + { + mySlashDotSet.erase(value); + } +} +void Slash::addSlashDot(const SlashDotPtr &value) +{ + if (value) + { + mySlashDotSet.push_back(value); + } +} - void Slash::clearSlashDotSet() - { - mySlashDotSet.clear(); - } +void Slash::clearSlashDotSet() +{ + mySlashDotSet.clear(); +} +bool Slash::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isSlashTypeFound = false; - bool Slash::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *mySlashType, isSlashTypeFound)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isSlashTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *mySlashType, isSlashTypeFound ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "slash-dot", mySlashDotSet ); - } - - if( !isSlashTypeFound ) - { - message << "Slash: '" << mySlashType->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + importElementSet(message, it, endIter, isSuccess, "slash-dot", mySlashDotSet); + } + if (!isSlashTypeFound) + { + message << "Slash: '" << mySlashType->getElementName() << "' is required but was not found" << std::endl; } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Slash.h b/Sourcecode/private/mx/core/elements/Slash.h index e70165a4e..49ced3e91 100644 --- a/Sourcecode/private/mx/core/elements/Slash.h +++ b/Sourcecode/private/mx/core/elements/Slash.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/SlashAttributes.h" #include @@ -14,46 +14,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlashAttributes ) - MX_FORWARD_DECLARE_ELEMENT( SlashDot ) - MX_FORWARD_DECLARE_ELEMENT( SlashType ) - MX_FORWARD_DECLARE_ELEMENT( Slash ) - - inline SlashPtr makeSlash() { return std::make_shared(); } - - class Slash : public ElementInterface - { - public: - Slash(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SlashAttributesPtr getAttributes() const; - void setAttributes( const SlashAttributesPtr& value ); - - /* _________ SlashType minOccurs = 1, maxOccurs = 1 _________ */ - SlashTypePtr getSlashType() const; - void setSlashType( const SlashTypePtr& value ); - - /* _________ SlashDot minOccurs = 0, maxOccurs = unbounded _________ */ - const SlashDotSet& getSlashDotSet() const; - void addSlashDot( const SlashDotPtr& value ); - void removeSlashDot( const SlashDotSetIterConst& value ); - void clearSlashDotSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SlashAttributesPtr myAttributes; - SlashTypePtr mySlashType; - SlashDotSet mySlashDotSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(SlashAttributes) +MX_FORWARD_DECLARE_ELEMENT(SlashDot) +MX_FORWARD_DECLARE_ELEMENT(SlashType) +MX_FORWARD_DECLARE_ELEMENT(Slash) + +inline SlashPtr makeSlash() +{ + return std::make_shared(); } + +class Slash : public ElementInterface +{ + public: + Slash(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + SlashAttributesPtr getAttributes() const; + void setAttributes(const SlashAttributesPtr &value); + + /* _________ SlashType minOccurs = 1, maxOccurs = 1 _________ */ + SlashTypePtr getSlashType() const; + void setSlashType(const SlashTypePtr &value); + + /* _________ SlashDot minOccurs = 0, maxOccurs = unbounded _________ */ + const SlashDotSet &getSlashDotSet() const; + void addSlashDot(const SlashDotPtr &value); + void removeSlashDot(const SlashDotSetIterConst &value); + void clearSlashDotSet(); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + SlashAttributesPtr myAttributes; + SlashTypePtr mySlashType; + SlashDotSet mySlashDotSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlashAttributes.cpp b/Sourcecode/private/mx/core/elements/SlashAttributes.cpp index 81e75b2ed..1101cf3f0 100644 --- a/Sourcecode/private/mx/core/elements/SlashAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/SlashAttributes.cpp @@ -8,62 +8,63 @@ namespace mx { - namespace core +namespace core +{ +SlashAttributes::SlashAttributes() + : type(StartStop::start), useDots(YesNo::no), useStems(YesNo::no), hasType(true), hasUseDots(false), + hasUseStems(false) +{ +} + +bool SlashAttributes::hasValues() const +{ + return hasType || hasUseDots || hasUseStems; +} + +std::ostream &SlashAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - SlashAttributes::SlashAttributes() - :type( StartStop::start ) - ,useDots( YesNo::no ) - ,useStems( YesNo::no ) - ,hasType( true ) - ,hasUseDots( false ) - ,hasUseStems( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, useDots, "use-dots", hasUseDots); + streamAttribute(os, useStems, "use-stems", hasUseStems); + } + return os; +} +bool SlashAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "SlashAttributes"; + bool isSuccess = true; + bool isTypeFound = false; - bool SlashAttributes::hasValues() const + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); + + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - return hasType || - hasUseDots || - hasUseStems; + continue; } - - - std::ostream& SlashAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, useDots, hasUseDots, "use-dots", &parseYesNo)) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, useDots, "use-dots", hasUseDots ); - streamAttribute( os, useStems, "use-stems", hasUseStems ); - } - return os; + continue; } - - - bool SlashAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, useStems, hasUseStems, "use-stems", &parseYesNo)) { - const char* const className = "SlashAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, useDots, hasUseDots, "use-dots", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, useStems, hasUseStems, "use-stems", &parseYesNo ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlashAttributes.h b/Sourcecode/private/mx/core/elements/SlashAttributes.h index c3956c72c..d6ef4f2dd 100644 --- a/Sourcecode/private/mx/core/elements/SlashAttributes.h +++ b/Sourcecode/private/mx/core/elements/SlashAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,26 +14,26 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( SlashAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(SlashAttributes) - struct SlashAttributes : public AttributesInterface - { - public: - SlashAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - YesNo useDots; - YesNo useStems; - const bool hasType; - bool hasUseDots; - bool hasUseStems; +struct SlashAttributes : public AttributesInterface +{ + public: + SlashAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + YesNo useDots; + YesNo useStems; + const bool hasType; + bool hasUseDots; + bool hasUseStems; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlashDot.cpp b/Sourcecode/private/mx/core/elements/SlashDot.cpp index 8751c89cd..a17e4442e 100644 --- a/Sourcecode/private/mx/core/elements/SlashDot.cpp +++ b/Sourcecode/private/mx/core/elements/SlashDot.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - SlashDot::SlashDot() : ElementInterface() {} - +namespace core +{ +SlashDot::SlashDot() : ElementInterface() +{ +} - bool SlashDot::hasAttributes() const { return false; } +bool SlashDot::hasAttributes() const +{ + return false; +} +bool SlashDot::hasContents() const +{ + return false; +} - bool SlashDot::hasContents() const { return false; } - std::ostream& SlashDot::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& SlashDot::streamName( std::ostream& os ) const { os << "slash-dot"; return os; } - std::ostream& SlashDot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &SlashDot::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &SlashDot::streamName(std::ostream &os) const +{ + os << "slash-dot"; + return os; +} - bool SlashDot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &SlashDot::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool SlashDot::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlashDot.h b/Sourcecode/private/mx/core/elements/SlashDot.h index 4d920b910..fde56bc76 100644 --- a/Sourcecode/private/mx/core/elements/SlashDot.h +++ b/Sourcecode/private/mx/core/elements/SlashDot.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SlashDot ) - - inline SlashDotPtr makeSlashDot() { return std::make_shared(); } - - class SlashDot : public ElementInterface - { - public: - SlashDot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(SlashDot) + +inline SlashDotPtr makeSlashDot() +{ + return std::make_shared(); } + +class SlashDot : public ElementInterface +{ + public: + SlashDot(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlashType.cpp b/Sourcecode/private/mx/core/elements/SlashType.cpp index 84135872b..ec2e0b181 100644 --- a/Sourcecode/private/mx/core/elements/SlashType.cpp +++ b/Sourcecode/private/mx/core/elements/SlashType.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - SlashType::SlashType() - :myValue( NoteTypeValue::eighth ) - {} - - - SlashType::SlashType( const NoteTypeValue& value ) - :myValue( value ) - {} - - - bool SlashType::hasAttributes() const - { - return false; - } - - - bool SlashType::hasContents() const - { - return true; - } - - - std::ostream& SlashType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SlashType::streamName( std::ostream& os ) const - { - os << "slash-type"; - return os; - } +namespace core +{ +SlashType::SlashType() : myValue(NoteTypeValue::eighth) +{ +} +SlashType::SlashType(const NoteTypeValue &value) : myValue(value) +{ +} - std::ostream& SlashType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool SlashType::hasAttributes() const +{ + return false; +} +bool SlashType::hasContents() const +{ + return true; +} - NoteTypeValue SlashType::getValue() const - { - return myValue; - } +std::ostream &SlashType::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &SlashType::streamName(std::ostream &os) const +{ + os << "slash-type"; + return os; +} - void SlashType::setValue( const NoteTypeValue& value ) - { - myValue = value; - } +std::ostream &SlashType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NoteTypeValue SlashType::getValue() const +{ + return myValue; +} - bool SlashType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseNoteTypeValue( xelement.getValue() ); - return true; - } +void SlashType::setValue(const NoteTypeValue &value) +{ + myValue = value; +} - } +bool SlashType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseNoteTypeValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlashType.h b/Sourcecode/private/mx/core/elements/SlashType.h index d8c120489..caf753082 100644 --- a/Sourcecode/private/mx/core/elements/SlashType.h +++ b/Sourcecode/private/mx/core/elements/SlashType.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SlashType ) - - inline SlashTypePtr makeSlashType() { return std::make_shared(); } - inline SlashTypePtr makeSlashType( const NoteTypeValue& value ) { return std::make_shared( value ); } - inline SlashTypePtr makeSlashType( NoteTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class SlashType : public ElementInterface - { - public: - SlashType(); - SlashType( const NoteTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteTypeValue getValue() const; - void setValue( const NoteTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteTypeValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(SlashType) + +inline SlashTypePtr makeSlashType() +{ + return std::make_shared(); +} + +inline SlashTypePtr makeSlashType(const NoteTypeValue &value) +{ + return std::make_shared(value); } + +inline SlashTypePtr makeSlashType(NoteTypeValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class SlashType : public ElementInterface +{ + public: + SlashType(); + SlashType(const NoteTypeValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NoteTypeValue getValue() const; + void setValue(const NoteTypeValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NoteTypeValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Slide.cpp b/Sourcecode/private/mx/core/elements/Slide.cpp index 718d1cba4..1ae0818e9 100644 --- a/Sourcecode/private/mx/core/elements/Slide.cpp +++ b/Sourcecode/private/mx/core/elements/Slide.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Slide::Slide() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Slide::Slide( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Slide::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Slide::hasContents() const - { - return true; - } - - - std::ostream& Slide::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Slide::streamName( std::ostream& os ) const - { - os << "slide"; - return os; - } - - - std::ostream& Slide::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Slide::Slide() : myValue(), myAttributes(std::make_shared()) +{ +} +Slide::Slide(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - SlideAttributesPtr Slide::getAttributes() const - { - return myAttributes; - } +bool Slide::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Slide::hasContents() const +{ + return true; +} - void Slide::setAttributes( const SlideAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Slide::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Slide::streamName(std::ostream &os) const +{ + os << "slide"; + return os; +} - XsString Slide::getValue() const - { - return myValue; - } +std::ostream &Slide::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +SlideAttributesPtr Slide::getAttributes() const +{ + return myAttributes; +} - void Slide::setValue( const XsString& value ) - { - myValue = value; - } +void Slide::setAttributes(const SlideAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Slide::getValue() const +{ + return myValue; +} - bool Slide::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Slide::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Slide::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Slide.h b/Sourcecode/private/mx/core/elements/Slide.h index 38fa90e4c..545e61b1e 100644 --- a/Sourcecode/private/mx/core/elements/Slide.h +++ b/Sourcecode/private/mx/core/elements/Slide.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/SlideAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlideAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Slide ) - - inline SlidePtr makeSlide() { return std::make_shared(); } - inline SlidePtr makeSlide( const XsString& value ) { return std::make_shared( value ); } - inline SlidePtr makeSlide( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Slide : public ElementInterface - { - public: - Slide(); - Slide( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SlideAttributesPtr getAttributes() const; - void setAttributes( const SlideAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - SlideAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(SlideAttributes) +MX_FORWARD_DECLARE_ELEMENT(Slide) + +inline SlidePtr makeSlide() +{ + return std::make_shared(); +} + +inline SlidePtr makeSlide(const XsString &value) +{ + return std::make_shared(value); } + +inline SlidePtr makeSlide(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Slide : public ElementInterface +{ + public: + Slide(); + Slide(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + SlideAttributesPtr getAttributes() const; + void setAttributes(const SlideAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + SlideAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlideAttributes.cpp b/Sourcecode/private/mx/core/elements/SlideAttributes.cpp index 673ddc3f3..6922e6482 100644 --- a/Sourcecode/private/mx/core/elements/SlideAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/SlideAttributes.cpp @@ -8,132 +8,140 @@ namespace mx { - namespace core - { - SlideAttributes::SlideAttributes() - :type( StartStop::start ) - ,number( 1 ) - ,lineType( LineType::solid ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,accelerate() - ,beats() - ,firstBeat() - ,lastBeat() - ,hasType( true ) - ,hasNumber( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasFirstBeat( false ) - ,hasLastBeat( false ) - {} - +namespace core +{ +SlideAttributes::SlideAttributes() + : type(StartStop::start), number(1), lineType(LineType::solid), dashLength(), spaceLength(), defaultX(), defaultY(), + relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), accelerate(), beats(), firstBeat(), lastBeat(), hasType(true), hasNumber(false), + hasLineType(false), hasDashLength(false), hasSpaceLength(false), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false), hasAccelerate(false), hasBeats(false), hasFirstBeat(false), hasLastBeat(false) +{ +} - bool SlideAttributes::hasValues() const - { - return hasType || - hasNumber || - hasLineType || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasAccelerate || - hasBeats || - hasFirstBeat || - hasLastBeat; - } +bool SlideAttributes::hasValues() const +{ + return hasType || hasNumber || hasLineType || hasDashLength || hasSpaceLength || hasDefaultX || hasDefaultY || + hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || + hasAccelerate || hasBeats || hasFirstBeat || hasLastBeat; +} +std::ostream &SlideAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, lineType, "line-type", hasLineType); + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, spaceLength, "space-length", hasSpaceLength); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, accelerate, "accelerate", hasAccelerate); + streamAttribute(os, beats, "beats", hasBeats); + streamAttribute(os, firstBeat, "first-beat", hasFirstBeat); + streamAttribute(os, lastBeat, "last-beat", hasLastBeat); + } + return os; +} - std::ostream& SlideAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, firstBeat, "first-beat", hasFirstBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - } - return os; - } +bool SlideAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "SlideAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool SlideAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SlideAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, firstBeat, hasFirstBeat, "first-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dashLength, hasDashLength, "dash-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, beats, hasBeats, "beats")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, firstBeat, hasFirstBeat, "first-beat")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat")) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlideAttributes.h b/Sourcecode/private/mx/core/elements/SlideAttributes.h index 54e9b7a8a..7a4ebc501 100644 --- a/Sourcecode/private/mx/core/elements/SlideAttributes.h +++ b/Sourcecode/private/mx/core/elements/SlideAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -18,54 +18,54 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( SlideAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(SlideAttributes) - struct SlideAttributes : public AttributesInterface - { - public: - SlideAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - NumberLevel number; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - YesNo accelerate; - TrillBeats beats; - Percent firstBeat; - Percent lastBeat; - const bool hasType; - bool hasNumber; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasAccelerate; - bool hasBeats; - bool hasFirstBeat; - bool hasLastBeat; +struct SlideAttributes : public AttributesInterface +{ + public: + SlideAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + NumberLevel number; + LineType lineType; + TenthsValue dashLength; + TenthsValue spaceLength; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + YesNo accelerate; + TrillBeats beats; + Percent firstBeat; + Percent lastBeat; + const bool hasType; + bool hasNumber; + bool hasLineType; + bool hasDashLength; + bool hasSpaceLength; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasAccelerate; + bool hasBeats; + bool hasFirstBeat; + bool hasLastBeat; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Slur.cpp b/Sourcecode/private/mx/core/elements/Slur.cpp index b60e1e0d1..f56ca293a 100644 --- a/Sourcecode/private/mx/core/elements/Slur.cpp +++ b/Sourcecode/private/mx/core/elements/Slur.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Slur::Slur() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Slur::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Slur::hasContents() const { return false; } - std::ostream& Slur::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Slur::streamName( std::ostream& os ) const { os << "slur"; return os; } - std::ostream& Slur::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Slur::Slur() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Slur::hasAttributes() const +{ + return myAttributes->hasValues(); +} - SlurAttributesPtr Slur::getAttributes() const - { - return myAttributes; - } +bool Slur::hasContents() const +{ + return false; +} +std::ostream &Slur::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Slur::setAttributes( const SlurAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Slur::streamName(std::ostream &os) const +{ + os << "slur"; + return os; +} +std::ostream &Slur::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Slur::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +SlurAttributesPtr Slur::getAttributes() const +{ + return myAttributes; +} +void Slur::setAttributes(const SlurAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Slur::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Slur.h b/Sourcecode/private/mx/core/elements/Slur.h index c356bb926..de078e032 100644 --- a/Sourcecode/private/mx/core/elements/Slur.h +++ b/Sourcecode/private/mx/core/elements/Slur.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/SlurAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlurAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Slur ) - - inline SlurPtr makeSlur() { return std::make_shared(); } - - class Slur : public ElementInterface - { - public: - Slur(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SlurAttributesPtr getAttributes() const; - void setAttributes( const SlurAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SlurAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(SlurAttributes) +MX_FORWARD_DECLARE_ELEMENT(Slur) + +inline SlurPtr makeSlur() +{ + return std::make_shared(); } + +class Slur : public ElementInterface +{ + public: + Slur(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + SlurAttributesPtr getAttributes() const; + void setAttributes(const SlurAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + SlurAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlurAttributes.cpp b/Sourcecode/private/mx/core/elements/SlurAttributes.cpp index 47864ee9b..7f680e6ce 100644 --- a/Sourcecode/private/mx/core/elements/SlurAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/SlurAttributes.cpp @@ -8,135 +8,146 @@ namespace mx { - namespace core - { - SlurAttributes::SlurAttributes() - :type( StartStopContinue::start ) - ,number( 1 ) - ,lineType( LineType::solid ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,orientation() - ,bezierOffset() - ,bezierOffset2() - ,bezierX() - ,bezierY() - ,bezierX2() - ,bezierY2() - ,color() - ,hasType( true ) - ,hasNumber( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - ,hasOrientation( false ) - ,hasBezierOffset( false ) - ,hasBezierOffset2( false ) - ,hasBezierX( false ) - ,hasBezierY( false ) - ,hasBezierX2( false ) - ,hasBezierY2( false ) - ,hasColor( false ) - {} - +namespace core +{ +SlurAttributes::SlurAttributes() + : type(StartStopContinue::start), number(1), lineType(LineType::solid), dashLength(), spaceLength(), defaultX(), + defaultY(), relativeX(), relativeY(), placement(AboveBelow::below), orientation(), bezierOffset(), + bezierOffset2(), bezierX(), bezierY(), bezierX2(), bezierY2(), color(), hasType(true), hasNumber(false), + hasLineType(false), hasDashLength(false), hasSpaceLength(false), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasPlacement(false), hasOrientation(false), hasBezierOffset(false), + hasBezierOffset2(false), hasBezierX(false), hasBezierY(false), hasBezierX2(false), hasBezierY2(false), + hasColor(false) +{ +} - bool SlurAttributes::hasValues() const - { - return hasType || - hasNumber || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement || - hasOrientation || - hasBezierOffset || - hasBezierOffset2 || - hasBezierX || - hasBezierY || - hasBezierX2 || - hasBezierY2; - } +bool SlurAttributes::hasValues() const +{ + return hasType || hasNumber || hasDashLength || hasSpaceLength || hasDefaultX || hasDefaultY || hasRelativeX || + hasRelativeY || hasPlacement || hasOrientation || hasBezierOffset || hasBezierOffset2 || hasBezierX || + hasBezierY || hasBezierX2 || hasBezierY2; +} +std::ostream &SlurAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, lineType, "line-type", hasLineType); + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, spaceLength, "space-length", hasSpaceLength); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, orientation, "orientation", hasOrientation); + streamAttribute(os, bezierOffset, "bezier-offset", hasBezierOffset); + streamAttribute(os, bezierOffset2, "bezier-offset2", hasBezierOffset2); + streamAttribute(os, bezierX, "bezier-x", hasBezierX); + streamAttribute(os, bezierY, "bezier-y", hasBezierY); + streamAttribute(os, bezierX2, "bezier-x2", hasBezierX2); + streamAttribute(os, bezierY2, "bezier-y2", hasBezierY2); + streamAttribute(os, color, "color", hasColor); + } + return os; +} - std::ostream& SlurAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, orientation, "orientation", hasOrientation ); - streamAttribute( os, bezierOffset, "bezier-offset", hasBezierOffset ); - streamAttribute( os, bezierOffset2, "bezier-offset2", hasBezierOffset2 ); - streamAttribute( os, bezierX, "bezier-x", hasBezierX ); - streamAttribute( os, bezierY, "bezier-y", hasBezierY ); - streamAttribute( os, bezierX2, "bezier-x2", hasBezierX2 ); - streamAttribute( os, bezierY2, "bezier-y2", hasBezierY2 ); - streamAttribute( os, color, "color", hasColor ); - } - return os; - } +bool SlurAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "SlurAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool SlurAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SlurAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, orientation, hasOrientation, "orientation", &parseOverUnder ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierOffset, hasBezierOffset, "bezier-offset" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierOffset2, hasBezierOffset2, "bezier-offset2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierX, hasBezierX, "bezier-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierY, hasBezierY, "bezier-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierX2, hasBezierX2, "bezier-x2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierY2, hasBezierY2, "bezier-y2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'type' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dashLength, hasDashLength, "dash-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } + if (parseAttribute(message, it, className, isSuccess, orientation, hasOrientation, "orientation", + &parseOverUnder)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierOffset, hasBezierOffset, "bezier-offset")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierOffset2, hasBezierOffset2, "bezier-offset2")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierX, hasBezierX, "bezier-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierY, hasBezierY, "bezier-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierX2, hasBezierX2, "bezier-x2")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierY2, hasBezierY2, "bezier-y2")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'type' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SlurAttributes.h b/Sourcecode/private/mx/core/elements/SlurAttributes.h index 29be72be6..df035c9da 100644 --- a/Sourcecode/private/mx/core/elements/SlurAttributes.h +++ b/Sourcecode/private/mx/core/elements/SlurAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/Color.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" -#include "mx/core/Color.h" #include #include @@ -17,79 +17,79 @@ namespace mx { - namespace core - { +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(SlurAttributes) - MX_FORWARD_DECLARE_ATTRIBUTES( SlurAttributes ) +/* + + + + + + + + + + */ - /* - - - - - - - - - - */ +/* + + + + + + +*/ + +struct SlurAttributes : public AttributesInterface +{ + public: + SlurAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; - /* - - - - - - - */ + StartStopContinue type; + NumberLevel number; + LineType lineType; + TenthsValue dashLength; + TenthsValue spaceLength; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + AboveBelow placement; + OverUnder orientation; + DivisionsValue bezierOffset; + DivisionsValue bezierOffset2; + TenthsValue bezierX; + TenthsValue bezierY; + TenthsValue bezierX2; + TenthsValue bezierY2; + Color color; - struct SlurAttributes : public AttributesInterface - { - public: - SlurAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - - StartStopContinue type; - NumberLevel number; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - OverUnder orientation; - DivisionsValue bezierOffset; - DivisionsValue bezierOffset2; - TenthsValue bezierX; - TenthsValue bezierY; - TenthsValue bezierX2; - TenthsValue bezierY2; - Color color; - - const bool hasType; - bool hasNumber; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; - bool hasOrientation; - bool hasBezierOffset; - bool hasBezierOffset2; - bool hasBezierX; - bool hasBezierY; - bool hasBezierX2; - bool hasBezierY2; - bool hasColor; + const bool hasType; + bool hasNumber; + bool hasLineType; + bool hasDashLength; + bool hasSpaceLength; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasPlacement; + bool hasOrientation; + bool hasBezierOffset; + bool hasBezierOffset2; + bool hasBezierX; + bool hasBezierY; + bool hasBezierX2; + bool hasBezierY2; + bool hasColor; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SnapPizzicato.cpp b/Sourcecode/private/mx/core/elements/SnapPizzicato.cpp index 4988439bf..7d77ef9c4 100644 --- a/Sourcecode/private/mx/core/elements/SnapPizzicato.cpp +++ b/Sourcecode/private/mx/core/elements/SnapPizzicato.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - SnapPizzicato::SnapPizzicato() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool SnapPizzicato::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool SnapPizzicato::hasContents() const { return false; } - std::ostream& SnapPizzicato::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& SnapPizzicato::streamName( std::ostream& os ) const { os << "snap-pizzicato"; return os; } - std::ostream& SnapPizzicato::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +SnapPizzicato::SnapPizzicato() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool SnapPizzicato::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr SnapPizzicato::getAttributes() const - { - return myAttributes; - } +bool SnapPizzicato::hasContents() const +{ + return false; +} +std::ostream &SnapPizzicato::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void SnapPizzicato::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &SnapPizzicato::streamName(std::ostream &os) const +{ + os << "snap-pizzicato"; + return os; +} +std::ostream &SnapPizzicato::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool SnapPizzicato::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr SnapPizzicato::getAttributes() const +{ + return myAttributes; +} +void SnapPizzicato::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool SnapPizzicato::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SnapPizzicato.h b/Sourcecode/private/mx/core/elements/SnapPizzicato.h index 91dbce55d..fbe939837 100644 --- a/Sourcecode/private/mx/core/elements/SnapPizzicato.h +++ b/Sourcecode/private/mx/core/elements/SnapPizzicato.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( SnapPizzicato ) - - inline SnapPizzicatoPtr makeSnapPizzicato() { return std::make_shared(); } - - class SnapPizzicato : public ElementInterface - { - public: - SnapPizzicato(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(SnapPizzicato) + +inline SnapPizzicatoPtr makeSnapPizzicato() +{ + return std::make_shared(); } + +class SnapPizzicato : public ElementInterface +{ + public: + SnapPizzicato(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Software.cpp b/Sourcecode/private/mx/core/elements/Software.cpp index 8c3421beb..627067e65 100644 --- a/Sourcecode/private/mx/core/elements/Software.cpp +++ b/Sourcecode/private/mx/core/elements/Software.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Software::Software() - :myValue() - {} - - - Software::Software( const XsString& value ) - :myValue( value ) - {} - - - bool Software::hasAttributes() const - { - return false; - } - - - bool Software::hasContents() const - { - return true; - } - - - std::ostream& Software::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Software::streamName( std::ostream& os ) const - { - os << "software"; - return os; - } +namespace core +{ +Software::Software() : myValue() +{ +} +Software::Software(const XsString &value) : myValue(value) +{ +} - std::ostream& Software::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Software::hasAttributes() const +{ + return false; +} +bool Software::hasContents() const +{ + return true; +} - XsString Software::getValue() const - { - return myValue; - } +std::ostream &Software::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Software::streamName(std::ostream &os) const +{ + os << "software"; + return os; +} - void Software::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &Software::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString Software::getValue() const +{ + return myValue; +} - bool Software::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void Software::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Software::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Software.h b/Sourcecode/private/mx/core/elements/Software.h index 4c2261dba..01563eaca 100644 --- a/Sourcecode/private/mx/core/elements/Software.h +++ b/Sourcecode/private/mx/core/elements/Software.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Software ) - - inline SoftwarePtr makeSoftware() { return std::make_shared(); } - inline SoftwarePtr makeSoftware( const XsString& value ) { return std::make_shared( value ); } - inline SoftwarePtr makeSoftware( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Software : public ElementInterface - { - public: - Software(); - Software( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Software) + +inline SoftwarePtr makeSoftware() +{ + return std::make_shared(); +} + +inline SoftwarePtr makeSoftware(const XsString &value) +{ + return std::make_shared(value); } + +inline SoftwarePtr makeSoftware(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Software : public ElementInterface +{ + public: + Software(); + Software(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Solo.cpp b/Sourcecode/private/mx/core/elements/Solo.cpp index f49560a71..da6dc3a0a 100644 --- a/Sourcecode/private/mx/core/elements/Solo.cpp +++ b/Sourcecode/private/mx/core/elements/Solo.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - Solo::Solo() : ElementInterface() {} - +namespace core +{ +Solo::Solo() : ElementInterface() +{ +} - bool Solo::hasAttributes() const { return false; } +bool Solo::hasAttributes() const +{ + return false; +} +bool Solo::hasContents() const +{ + return false; +} - bool Solo::hasContents() const { return false; } - std::ostream& Solo::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Solo::streamName( std::ostream& os ) const { os << "solo"; return os; } - std::ostream& Solo::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &Solo::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Solo::streamName(std::ostream &os) const +{ + os << "solo"; + return os; +} - bool Solo::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( xelement ); - MX_UNUSED( message ); - return true; - } +std::ostream &Solo::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool Solo::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(xelement); + MX_UNUSED(message); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Solo.h b/Sourcecode/private/mx/core/elements/Solo.h index e9c6118b8..63c024f96 100644 --- a/Sourcecode/private/mx/core/elements/Solo.h +++ b/Sourcecode/private/mx/core/elements/Solo.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Solo ) - - inline SoloPtr makeSolo() { return std::make_shared(); } - - class Solo : public ElementInterface - { - public: - Solo(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Solo) + +inline SoloPtr makeSolo() +{ + return std::make_shared(); } + +class Solo : public ElementInterface +{ + public: + Solo(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp b/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp index 3d3a3d5e0..74a44bdb7 100644 --- a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp +++ b/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp @@ -10,104 +10,88 @@ namespace mx { - namespace core - { - SoloOrEnsembleChoice::SoloOrEnsembleChoice() - :myChoice( Choice::solo ) - ,mySolo( makeSolo() ) - ,myEnsemble( makeEnsemble() ) - {} - - - bool SoloOrEnsembleChoice::hasAttributes() const - { - return false; - } - - - std::ostream& SoloOrEnsembleChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SoloOrEnsembleChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool SoloOrEnsembleChoice::hasContents() const - { - return true; - } - - - std::ostream& SoloOrEnsembleChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::solo: - { - mySolo->toStream( os, indentLevel ); - } - break; - case Choice::ensemble: - { - myEnsemble->toStream( os, indentLevel ); - } - break; - default: - break; - } - isOneLineOnly = true; - return os; - } - - - SoloOrEnsembleChoice::Choice SoloOrEnsembleChoice::getChoice() const - { - return myChoice; - } - - - void SoloOrEnsembleChoice::setChoice( const SoloOrEnsembleChoice::Choice value ) - { - myChoice = value; - } +namespace core +{ +SoloOrEnsembleChoice::SoloOrEnsembleChoice() : myChoice(Choice::solo), mySolo(makeSolo()), myEnsemble(makeEnsemble()) +{ +} +bool SoloOrEnsembleChoice::hasAttributes() const +{ + return false; +} - SoloPtr SoloOrEnsembleChoice::getSolo() const - { - return mySolo; - } +std::ostream &SoloOrEnsembleChoice::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &SoloOrEnsembleChoice::streamName(std::ostream &os) const +{ + return os; +} - void SoloOrEnsembleChoice::setSolo( const SoloPtr& value ) - { - if ( value ) - { - mySolo = value; - } - } +bool SoloOrEnsembleChoice::hasContents() const +{ + return true; +} +std::ostream &SoloOrEnsembleChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::solo: { + mySolo->toStream(os, indentLevel); + } + break; + case Choice::ensemble: { + myEnsemble->toStream(os, indentLevel); + } + break; + default: + break; + } + isOneLineOnly = true; + return os; +} - EnsemblePtr SoloOrEnsembleChoice::getEnsemble() const - { - return myEnsemble; - } +SoloOrEnsembleChoice::Choice SoloOrEnsembleChoice::getChoice() const +{ + return myChoice; +} +void SoloOrEnsembleChoice::setChoice(const SoloOrEnsembleChoice::Choice value) +{ + myChoice = value; +} - void SoloOrEnsembleChoice::setEnsemble( const EnsemblePtr& value ) - { - if ( value ) - { - myEnsemble = value; - } - } +SoloPtr SoloOrEnsembleChoice::getSolo() const +{ + return mySolo; +} +void SoloOrEnsembleChoice::setSolo(const SoloPtr &value) +{ + if (value) + { + mySolo = value; + } +} - MX_FROM_XELEMENT_UNUSED( SoloOrEnsembleChoice ); +EnsemblePtr SoloOrEnsembleChoice::getEnsemble() const +{ + return myEnsemble; +} +void SoloOrEnsembleChoice::setEnsemble(const EnsemblePtr &value) +{ + if (value) + { + myEnsemble = value; } } + +MX_FROM_XELEMENT_UNUSED(SoloOrEnsembleChoice); + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h b/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h index 304edc690..a4b01d188 100644 --- a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h +++ b/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,50 +13,53 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Ensemble ) - MX_FORWARD_DECLARE_ELEMENT( Solo ) - MX_FORWARD_DECLARE_ELEMENT( SoloOrEnsembleChoice ) - - inline SoloOrEnsembleChoicePtr makeSoloOrEnsembleChoice() { return std::make_shared(); } - - class SoloOrEnsembleChoice : public ElementInterface - { - public: - enum class Choice - { - solo = 1, - ensemble = 2 - }; - SoloOrEnsembleChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice _________ */ - SoloOrEnsembleChoice::Choice getChoice() const; - void setChoice( const SoloOrEnsembleChoice::Choice value ); - - /* _________ Solo minOccurs = 1, maxOccurs = 1 _________ */ - SoloPtr getSolo() const; - void setSolo( const SoloPtr& value ); - - /* _________ Ensemble minOccurs = 1, maxOccurs = 1 _________ */ - EnsemblePtr getEnsemble() const; - void setEnsemble( const EnsemblePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - SoloPtr mySolo; - EnsemblePtr myEnsemble; - }; - } +MX_FORWARD_DECLARE_ELEMENT(Ensemble) +MX_FORWARD_DECLARE_ELEMENT(Solo) +MX_FORWARD_DECLARE_ELEMENT(SoloOrEnsembleChoice) + +inline SoloOrEnsembleChoicePtr makeSoloOrEnsembleChoice() +{ + return std::make_shared(); } + +class SoloOrEnsembleChoice : public ElementInterface +{ + public: + enum class Choice + { + solo = 1, + ensemble = 2 + }; + SoloOrEnsembleChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice _________ */ + SoloOrEnsembleChoice::Choice getChoice() const; + void setChoice(const SoloOrEnsembleChoice::Choice value); + + /* _________ Solo minOccurs = 1, maxOccurs = 1 _________ */ + SoloPtr getSolo() const; + void setSolo(const SoloPtr &value); + + /* _________ Ensemble minOccurs = 1, maxOccurs = 1 _________ */ + EnsemblePtr getEnsemble() const; + void setEnsemble(const EnsemblePtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + SoloPtr mySolo; + EnsemblePtr myEnsemble; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Sound.cpp b/Sourcecode/private/mx/core/elements/Sound.cpp index eedab009a..9f3789065 100644 --- a/Sourcecode/private/mx/core/elements/Sound.cpp +++ b/Sourcecode/private/mx/core/elements/Sound.cpp @@ -11,185 +11,170 @@ namespace mx { - namespace core - { - Sound::Sound() - :myAttributes( std::make_shared() ) - ,myMidiDevice( makeMidiDevice() ) - ,myHasMidiDevice( false ) - ,myMidiInstrument( makeMidiInstrument() ) - ,myHasMidiInstrument( false ) - ,myPlay( makePlay() ) - ,myHasPlay( false ) - {} - - - bool Sound::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Sound::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Sound::streamName( std::ostream& os ) const - { - os << "sound"; - return os; - } - - - bool Sound::hasContents() const - { - return myHasMidiDevice || myHasMidiInstrument || myHasPlay; - } - - - std::ostream& Sound::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasMidiDevice ) - { - os << std::endl; - myMidiDevice->toStream( os, indentLevel+1 ); - } - if ( myMidiInstrument ) - { - os << std::endl; - myMidiInstrument->toStream( os, indentLevel+1 ); - } - if ( myHasPlay ) - { - os << std::endl; - myPlay->toStream( os, indentLevel+1 ); - } - if ( hasContents() ) - { - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - SoundAttributesPtr Sound::getAttributes() const - { - return myAttributes; - } - - - void Sound::setAttributes( const SoundAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - +namespace core +{ +Sound::Sound() + : myAttributes(std::make_shared()), myMidiDevice(makeMidiDevice()), myHasMidiDevice(false), + myMidiInstrument(makeMidiInstrument()), myHasMidiInstrument(false), myPlay(makePlay()), myHasPlay(false) +{ +} - MidiDevicePtr Sound::getMidiDevice() const - { - return myMidiDevice; - } +bool Sound::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Sound::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void Sound::setMidiDevice( const MidiDevicePtr& value ) - { - if( value ) - { - myMidiDevice = value; - } - } +std::ostream &Sound::streamName(std::ostream &os) const +{ + os << "sound"; + return os; +} +bool Sound::hasContents() const +{ + return myHasMidiDevice || myHasMidiInstrument || myHasPlay; +} - bool Sound::getHasMidiDevice() const - { - return myHasMidiDevice; - } +std::ostream &Sound::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasMidiDevice) + { + os << std::endl; + myMidiDevice->toStream(os, indentLevel + 1); + } + if (myMidiInstrument) + { + os << std::endl; + myMidiInstrument->toStream(os, indentLevel + 1); + } + if (myHasPlay) + { + os << std::endl; + myPlay->toStream(os, indentLevel + 1); + } + if (hasContents()) + { + os << std::endl; + isOneLineOnly = false; + } + else + { + isOneLineOnly = true; + } + return os; +} +SoundAttributesPtr Sound::getAttributes() const +{ + return myAttributes; +} - void Sound::setHasMidiDevice( const bool value ) - { - myHasMidiDevice = value; - } +void Sound::setAttributes(const SoundAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +MidiDevicePtr Sound::getMidiDevice() const +{ + return myMidiDevice; +} - MidiInstrumentPtr Sound::getMidiInstrument() const - { - return myMidiInstrument; - } +void Sound::setMidiDevice(const MidiDevicePtr &value) +{ + if (value) + { + myMidiDevice = value; + } +} +bool Sound::getHasMidiDevice() const +{ + return myHasMidiDevice; +} - void Sound::setMidiInstrument( const MidiInstrumentPtr& value ) - { - if( value ) - { - myMidiInstrument = value; - } - } +void Sound::setHasMidiDevice(const bool value) +{ + myHasMidiDevice = value; +} +MidiInstrumentPtr Sound::getMidiInstrument() const +{ + return myMidiInstrument; +} - bool Sound::getHasMidiInstrument() const - { - return myHasMidiInstrument; - } +void Sound::setMidiInstrument(const MidiInstrumentPtr &value) +{ + if (value) + { + myMidiInstrument = value; + } +} +bool Sound::getHasMidiInstrument() const +{ + return myHasMidiInstrument; +} - void Sound::setHasMidiInstrument( const bool value ) - { - myHasMidiInstrument = value; - } +void Sound::setHasMidiInstrument(const bool value) +{ + myHasMidiInstrument = value; +} +PlayPtr Sound::getPlay() const +{ + return myPlay; +} - PlayPtr Sound::getPlay() const - { - return myPlay; - } +void Sound::setPlay(const PlayPtr &value) +{ + if (value) + { + myPlay = value; + } +} +bool Sound::getHasPlay() const +{ + return myHasPlay; +} - void Sound::setPlay( const PlayPtr& value ) - { - if( value ) - { - myPlay = value; - } - } +void Sound::setHasPlay(const bool value) +{ + myHasPlay = value; +} +bool Sound::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - bool Sound::getHasPlay() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myMidiDevice, myHasMidiDevice)) { - return myHasPlay; + continue; } - - - void Sound::setHasPlay( const bool value ) + if (importElement(message, *it, isSuccess, *myMidiInstrument, myHasMidiInstrument)) { - myHasPlay = value; + continue; } - - - bool Sound::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myPlay, myHasPlay)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMidiDevice, myHasMidiDevice ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiInstrument, myHasMidiInstrument ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPlay, myHasPlay ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Sound.h b/Sourcecode/private/mx/core/elements/Sound.h index b901fddfe..e061414fd 100644 --- a/Sourcecode/private/mx/core/elements/Sound.h +++ b/Sourcecode/private/mx/core/elements/Sound.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/SoundAttributes.h" #include @@ -14,59 +14,62 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( SoundAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MidiDevice ) - MX_FORWARD_DECLARE_ELEMENT( MidiInstrument ) - MX_FORWARD_DECLARE_ELEMENT( Play ) - MX_FORWARD_DECLARE_ELEMENT( Sound ) +MX_FORWARD_DECLARE_ATTRIBUTES(SoundAttributes) +MX_FORWARD_DECLARE_ELEMENT(MidiDevice) +MX_FORWARD_DECLARE_ELEMENT(MidiInstrument) +MX_FORWARD_DECLARE_ELEMENT(Play) +MX_FORWARD_DECLARE_ELEMENT(Sound) - inline SoundPtr makeSound() { return std::make_shared(); } +inline SoundPtr makeSound() +{ + return std::make_shared(); +} - class Sound : public ElementInterface - { - public: - Sound(); +class Sound : public ElementInterface +{ + public: + Sound(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SoundAttributesPtr getAttributes() const; - void setAttributes( const SoundAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + SoundAttributesPtr getAttributes() const; + void setAttributes(const SoundAttributesPtr &value); - /* _________ MidiDevice minOccurs = 0, maxOccurs = 1 _________ */ - MidiDevicePtr getMidiDevice() const; - void setMidiDevice( const MidiDevicePtr& value ); - bool getHasMidiDevice() const; - void setHasMidiDevice( const bool value ); + /* _________ MidiDevice minOccurs = 0, maxOccurs = 1 _________ */ + MidiDevicePtr getMidiDevice() const; + void setMidiDevice(const MidiDevicePtr &value); + bool getHasMidiDevice() const; + void setHasMidiDevice(const bool value); - /* _________ MidiInstrument minOccurs = 0, maxOccurs = 1 _________ */ - MidiInstrumentPtr getMidiInstrument() const; - void setMidiInstrument( const MidiInstrumentPtr& value ); - bool getHasMidiInstrument() const; - void setHasMidiInstrument( const bool value ); + /* _________ MidiInstrument minOccurs = 0, maxOccurs = 1 _________ */ + MidiInstrumentPtr getMidiInstrument() const; + void setMidiInstrument(const MidiInstrumentPtr &value); + bool getHasMidiInstrument() const; + void setHasMidiInstrument(const bool value); - /* _________ Play minOccurs = 0, maxOccurs = 1 _________ */ - PlayPtr getPlay() const; - void setPlay( const PlayPtr& value ); - bool getHasPlay() const; - void setHasPlay( const bool value ); + /* _________ Play minOccurs = 0, maxOccurs = 1 _________ */ + PlayPtr getPlay() const; + void setPlay(const PlayPtr &value); + bool getHasPlay() const; + void setHasPlay(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - SoundAttributesPtr myAttributes; - MidiDevicePtr myMidiDevice; - bool myHasMidiDevice; - MidiInstrumentPtr myMidiInstrument; - bool myHasMidiInstrument; - PlayPtr myPlay; - bool myHasPlay; - }; - } -} + private: + SoundAttributesPtr myAttributes; + MidiDevicePtr myMidiDevice; + bool myHasMidiDevice; + MidiInstrumentPtr myMidiInstrument; + bool myHasMidiInstrument; + PlayPtr myPlay; + bool myHasPlay; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SoundAttributes.cpp b/Sourcecode/private/mx/core/elements/SoundAttributes.cpp index 25496d81a..25d7938d6 100644 --- a/Sourcecode/private/mx/core/elements/SoundAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/SoundAttributes.cpp @@ -8,126 +8,133 @@ namespace mx { - namespace core - { - SoundAttributes::SoundAttributes() - :tempo() - ,dynamics() - ,dacapo( YesNo::no ) - ,segno() - ,dalsegno() - ,coda() - ,tocoda() - ,divisions() - ,forwardRepeat( YesNo::no ) - ,fine() - ,timeOnly() - ,pizzicato( YesNo::no ) - ,pan() - ,elevation() - ,damperPedal() - ,softPedal() - ,sostenutoPedal() - ,hasTempo( false ) - ,hasDynamics( false ) - ,hasDacapo( false ) - ,hasSegno( false ) - ,hasDalsegno( false ) - ,hasCoda( false ) - ,hasTocoda( false ) - ,hasDivisions( false ) - ,hasForwardRepeat( false ) - ,hasFine( false ) - ,hasTimeOnly( false ) - ,hasPizzicato( false ) - ,hasPan( false ) - ,hasElevation( false ) - ,hasDamperPedal( false ) - ,hasSoftPedal( false ) - ,hasSostenutoPedal( false ) - {} - +namespace core +{ +SoundAttributes::SoundAttributes() + : tempo(), dynamics(), dacapo(YesNo::no), segno(), dalsegno(), coda(), tocoda(), divisions(), + forwardRepeat(YesNo::no), fine(), timeOnly(), pizzicato(YesNo::no), pan(), elevation(), damperPedal(), + softPedal(), sostenutoPedal(), hasTempo(false), hasDynamics(false), hasDacapo(false), hasSegno(false), + hasDalsegno(false), hasCoda(false), hasTocoda(false), hasDivisions(false), hasForwardRepeat(false), + hasFine(false), hasTimeOnly(false), hasPizzicato(false), hasPan(false), hasElevation(false), + hasDamperPedal(false), hasSoftPedal(false), hasSostenutoPedal(false) +{ +} - bool SoundAttributes::hasValues() const - { - return hasTempo || - hasDynamics || - hasDacapo || - hasSegno || - hasDalsegno || - hasCoda || - hasTocoda || - hasDivisions || - hasForwardRepeat || - hasFine || - hasTimeOnly || - hasPizzicato || - hasPan || - hasElevation || - hasDamperPedal || - hasSoftPedal || - hasSostenutoPedal; - } +bool SoundAttributes::hasValues() const +{ + return hasTempo || hasDynamics || hasDacapo || hasSegno || hasDalsegno || hasCoda || hasTocoda || hasDivisions || + hasForwardRepeat || hasFine || hasTimeOnly || hasPizzicato || hasPan || hasElevation || hasDamperPedal || + hasSoftPedal || hasSostenutoPedal; +} +std::ostream &SoundAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, tempo, "tempo", hasTempo); + streamAttribute(os, dynamics, "dynamics", hasDynamics); + streamAttribute(os, dacapo, "dacapo", hasDacapo); + streamAttribute(os, segno, "segno", hasSegno); + streamAttribute(os, dalsegno, "dalsegno", hasDalsegno); + streamAttribute(os, coda, "coda", hasCoda); + streamAttribute(os, tocoda, "tocoda", hasTocoda); + streamAttribute(os, divisions, "divisions", hasDivisions); + streamAttribute(os, forwardRepeat, "forward-repeat", hasForwardRepeat); + streamAttribute(os, fine, "fine", hasFine); + streamAttribute(os, timeOnly, "time-only", hasTimeOnly); + streamAttribute(os, pizzicato, "pizzicato", hasPizzicato); + streamAttribute(os, pan, "pan", hasPan); + streamAttribute(os, elevation, "elevation", hasElevation); + streamAttribute(os, damperPedal, "damper-pedal", hasDamperPedal); + streamAttribute(os, softPedal, "soft-pedal", hasSoftPedal); + streamAttribute(os, sostenutoPedal, "sostenuto-pedal", hasSostenutoPedal); + } + return os; +} - std::ostream& SoundAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, tempo, "tempo", hasTempo ); - streamAttribute( os, dynamics, "dynamics", hasDynamics ); - streamAttribute( os, dacapo, "dacapo", hasDacapo ); - streamAttribute( os, segno, "segno", hasSegno ); - streamAttribute( os, dalsegno, "dalsegno", hasDalsegno ); - streamAttribute( os, coda, "coda", hasCoda ); - streamAttribute( os, tocoda, "tocoda", hasTocoda ); - streamAttribute( os, divisions, "divisions", hasDivisions ); - streamAttribute( os, forwardRepeat, "forward-repeat", hasForwardRepeat ); - streamAttribute( os, fine, "fine", hasFine ); - streamAttribute( os, timeOnly, "time-only", hasTimeOnly ); - streamAttribute( os, pizzicato, "pizzicato", hasPizzicato ); - streamAttribute( os, pan, "pan", hasPan ); - streamAttribute( os, elevation, "elevation", hasElevation ); - streamAttribute( os, damperPedal, "damper-pedal", hasDamperPedal ); - streamAttribute( os, softPedal, "soft-pedal", hasSoftPedal ); - streamAttribute( os, sostenutoPedal, "sostenuto-pedal", hasSostenutoPedal ); - } - return os; - } +bool SoundAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "SoundAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool SoundAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SoundAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, tempo, hasTempo, "tempo" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dynamics, hasDynamics, "dynamics" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dacapo, hasDacapo, "dacapo", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, segno, hasSegno, "segno" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dalsegno, hasDalsegno, "dalsegno" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, coda, hasCoda, "coda" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, tocoda, hasTocoda, "tocoda" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, divisions, hasDivisions, "divisions" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, forwardRepeat, hasForwardRepeat, "forward-repeat", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fine, hasFine, "fine" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, pizzicato, hasPizzicato, "pizzicato", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, pan, hasPan, "pan" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, elevation, hasElevation, "elevation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, damperPedal, hasDamperPedal, "damper-pedal" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, softPedal, hasSoftPedal, "soft-pedal" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, sostenutoPedal, hasSostenutoPedal, "sostenuto-pedal" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, tempo, hasTempo, "tempo")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dynamics, hasDynamics, "dynamics")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dacapo, hasDacapo, "dacapo", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, segno, hasSegno, "segno")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dalsegno, hasDalsegno, "dalsegno")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, coda, hasCoda, "coda")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, tocoda, hasTocoda, "tocoda")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, divisions, hasDivisions, "divisions")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, forwardRepeat, hasForwardRepeat, "forward-repeat", + &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fine, hasFine, "fine")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, pizzicato, hasPizzicato, "pizzicato", &parseYesNo)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, pan, hasPan, "pan")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, elevation, hasElevation, "elevation")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, damperPedal, hasDamperPedal, "damper-pedal")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, softPedal, hasSoftPedal, "soft-pedal")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, sostenutoPedal, hasSostenutoPedal, "sostenuto-pedal")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SoundAttributes.h b/Sourcecode/private/mx/core/elements/SoundAttributes.h index 0305fd8df..9f8e47057 100644 --- a/Sourcecode/private/mx/core/elements/SoundAttributes.h +++ b/Sourcecode/private/mx/core/elements/SoundAttributes.h @@ -4,11 +4,11 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/TimeOnly.h" #include "mx/core/YesNoNumber.h" @@ -18,54 +18,54 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( SoundAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(SoundAttributes) - struct SoundAttributes : public AttributesInterface - { - public: - SoundAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - NonNegativeDecimal tempo; - NonNegativeDecimal dynamics; - YesNo dacapo; - XsToken segno; - XsToken dalsegno; - XsToken coda; - XsToken tocoda; - DivisionsValue divisions; - YesNo forwardRepeat; - XsToken fine; - TimeOnly timeOnly; - YesNo pizzicato; - RotationDegrees pan; - RotationDegrees elevation; - YesNoNumber damperPedal; - YesNoNumber softPedal; - YesNoNumber sostenutoPedal; - bool hasTempo; - bool hasDynamics; - bool hasDacapo; - bool hasSegno; - bool hasDalsegno; - bool hasCoda; - bool hasTocoda; - bool hasDivisions; - bool hasForwardRepeat; - bool hasFine; - bool hasTimeOnly; - bool hasPizzicato; - bool hasPan; - bool hasElevation; - bool hasDamperPedal; - bool hasSoftPedal; - bool hasSostenutoPedal; +struct SoundAttributes : public AttributesInterface +{ + public: + SoundAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + NonNegativeDecimal tempo; + NonNegativeDecimal dynamics; + YesNo dacapo; + XsToken segno; + XsToken dalsegno; + XsToken coda; + XsToken tocoda; + DivisionsValue divisions; + YesNo forwardRepeat; + XsToken fine; + TimeOnly timeOnly; + YesNo pizzicato; + RotationDegrees pan; + RotationDegrees elevation; + YesNoNumber damperPedal; + YesNoNumber softPedal; + YesNoNumber sostenutoPedal; + bool hasTempo; + bool hasDynamics; + bool hasDacapo; + bool hasSegno; + bool hasDalsegno; + bool hasCoda; + bool hasTocoda; + bool hasDivisions; + bool hasForwardRepeat; + bool hasFine; + bool hasTimeOnly; + bool hasPizzicato; + bool hasPan; + bool hasElevation; + bool hasDamperPedal; + bool hasSoftPedal; + bool hasSostenutoPedal; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SoundingPitch.cpp b/Sourcecode/private/mx/core/elements/SoundingPitch.cpp index c3e86344f..b6c9aac81 100644 --- a/Sourcecode/private/mx/core/elements/SoundingPitch.cpp +++ b/Sourcecode/private/mx/core/elements/SoundingPitch.cpp @@ -8,31 +8,46 @@ namespace mx { - namespace core - { - SoundingPitch::SoundingPitch() : ElementInterface() {} - +namespace core +{ +SoundingPitch::SoundingPitch() : ElementInterface() +{ +} - bool SoundingPitch::hasAttributes() const { return false; } +bool SoundingPitch::hasAttributes() const +{ + return false; +} +bool SoundingPitch::hasContents() const +{ + return false; +} - bool SoundingPitch::hasContents() const { return false; } - std::ostream& SoundingPitch::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& SoundingPitch::streamName( std::ostream& os ) const { os << "sounding-pitch"; return os; } - std::ostream& SoundingPitch::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +std::ostream &SoundingPitch::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &SoundingPitch::streamName(std::ostream &os) const +{ + os << "sounding-pitch"; + return os; +} - bool SoundingPitch::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } +std::ostream &SoundingPitch::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - } +bool SoundingPitch::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SoundingPitch.h b/Sourcecode/private/mx/core/elements/SoundingPitch.h index c8d19a372..7b3a9b5ae 100644 --- a/Sourcecode/private/mx/core/elements/SoundingPitch.h +++ b/Sourcecode/private/mx/core/elements/SoundingPitch.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,26 +13,29 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SoundingPitch ) - - inline SoundingPitchPtr makeSoundingPitch() { return std::make_shared(); } - - class SoundingPitch : public ElementInterface - { - public: - SoundingPitch(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(SoundingPitch) + +inline SoundingPitchPtr makeSoundingPitch() +{ + return std::make_shared(); } + +class SoundingPitch : public ElementInterface +{ + public: + SoundingPitch(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Source.cpp b/Sourcecode/private/mx/core/elements/Source.cpp index 68df179e0..bf1d2641d 100644 --- a/Sourcecode/private/mx/core/elements/Source.cpp +++ b/Sourcecode/private/mx/core/elements/Source.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Source::Source() - :myValue() - {} - - - Source::Source( const XsString& value ) - :myValue( value ) - {} - - - bool Source::hasAttributes() const - { - return false; - } - - - bool Source::hasContents() const - { - return true; - } - - - std::ostream& Source::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Source::streamName( std::ostream& os ) const - { - os << "source"; - return os; - } +namespace core +{ +Source::Source() : myValue() +{ +} +Source::Source(const XsString &value) : myValue(value) +{ +} - std::ostream& Source::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Source::hasAttributes() const +{ + return false; +} +bool Source::hasContents() const +{ + return true; +} - XsString Source::getValue() const - { - return myValue; - } +std::ostream &Source::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Source::streamName(std::ostream &os) const +{ + os << "source"; + return os; +} - void Source::setValue( const XsString& value ) - { - myValue = value; - } +std::ostream &Source::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +XsString Source::getValue() const +{ + return myValue; +} - bool Source::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } +void Source::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Source::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.setValue(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Source.h b/Sourcecode/private/mx/core/elements/Source.h index fbacd99dc..795a5e8b4 100644 --- a/Sourcecode/private/mx/core/elements/Source.h +++ b/Sourcecode/private/mx/core/elements/Source.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Source ) - - inline SourcePtr makeSource() { return std::make_shared(); } - inline SourcePtr makeSource( const XsString& value ) { return std::make_shared( value ); } - inline SourcePtr makeSource( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Source : public ElementInterface - { - public: - Source(); - Source( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Source) + +inline SourcePtr makeSource() +{ + return std::make_shared(); +} + +inline SourcePtr makeSource(const XsString &value) +{ + return std::make_shared(value); } + +inline SourcePtr makeSource(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Source : public ElementInterface +{ + public: + Source(); + Source(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Spiccato.cpp b/Sourcecode/private/mx/core/elements/Spiccato.cpp index b81e1d9e8..689c1a0ff 100644 --- a/Sourcecode/private/mx/core/elements/Spiccato.cpp +++ b/Sourcecode/private/mx/core/elements/Spiccato.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Spiccato::Spiccato() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Spiccato::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Spiccato::hasContents() const { return false; } - std::ostream& Spiccato::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Spiccato::streamName( std::ostream& os ) const { os << "spiccato"; return os; } - std::ostream& Spiccato::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Spiccato::Spiccato() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Spiccato::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Spiccato::getAttributes() const - { - return myAttributes; - } +bool Spiccato::hasContents() const +{ + return false; +} +std::ostream &Spiccato::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Spiccato::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Spiccato::streamName(std::ostream &os) const +{ + os << "spiccato"; + return os; +} +std::ostream &Spiccato::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Spiccato::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Spiccato::getAttributes() const +{ + return myAttributes; +} +void Spiccato::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Spiccato::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Spiccato.h b/Sourcecode/private/mx/core/elements/Spiccato.h index eb8fbb457..ad768dbe4 100644 --- a/Sourcecode/private/mx/core/elements/Spiccato.h +++ b/Sourcecode/private/mx/core/elements/Spiccato.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Spiccato ) - - inline SpiccatoPtr makeSpiccato() { return std::make_shared(); } - - class Spiccato : public ElementInterface - { - public: - Spiccato(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Spiccato) + +inline SpiccatoPtr makeSpiccato() +{ + return std::make_shared(); } + +class Spiccato : public ElementInterface +{ + public: + Spiccato(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Staccatissimo.cpp b/Sourcecode/private/mx/core/elements/Staccatissimo.cpp index 5e7f994bc..62d79ac2d 100644 --- a/Sourcecode/private/mx/core/elements/Staccatissimo.cpp +++ b/Sourcecode/private/mx/core/elements/Staccatissimo.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Staccatissimo::Staccatissimo() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Staccatissimo::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Staccatissimo::hasContents() const { return false; } - std::ostream& Staccatissimo::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Staccatissimo::streamName( std::ostream& os ) const { os << "staccatissimo"; return os; } - std::ostream& Staccatissimo::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Staccatissimo::Staccatissimo() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Staccatissimo::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Staccatissimo::getAttributes() const - { - return myAttributes; - } +bool Staccatissimo::hasContents() const +{ + return false; +} +std::ostream &Staccatissimo::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Staccatissimo::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Staccatissimo::streamName(std::ostream &os) const +{ + os << "staccatissimo"; + return os; +} +std::ostream &Staccatissimo::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Staccatissimo::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Staccatissimo::getAttributes() const +{ + return myAttributes; +} +void Staccatissimo::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Staccatissimo::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Staccatissimo.h b/Sourcecode/private/mx/core/elements/Staccatissimo.h index 9ce7a54cc..35367f1b5 100644 --- a/Sourcecode/private/mx/core/elements/Staccatissimo.h +++ b/Sourcecode/private/mx/core/elements/Staccatissimo.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Staccatissimo ) - - inline StaccatissimoPtr makeStaccatissimo() { return std::make_shared(); } - - class Staccatissimo : public ElementInterface - { - public: - Staccatissimo(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Staccatissimo) + +inline StaccatissimoPtr makeStaccatissimo() +{ + return std::make_shared(); } + +class Staccatissimo : public ElementInterface +{ + public: + Staccatissimo(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Staccato.cpp b/Sourcecode/private/mx/core/elements/Staccato.cpp index 58f82be2d..66bef94d6 100644 --- a/Sourcecode/private/mx/core/elements/Staccato.cpp +++ b/Sourcecode/private/mx/core/elements/Staccato.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Staccato::Staccato() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Staccato::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Staccato::hasContents() const { return false; } - std::ostream& Staccato::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Staccato::streamName( std::ostream& os ) const { os << "staccato"; return os; } - std::ostream& Staccato::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Staccato::Staccato() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Staccato::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Staccato::getAttributes() const - { - return myAttributes; - } +bool Staccato::hasContents() const +{ + return false; +} +std::ostream &Staccato::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Staccato::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Staccato::streamName(std::ostream &os) const +{ + os << "staccato"; + return os; +} +std::ostream &Staccato::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Staccato::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Staccato::getAttributes() const +{ + return myAttributes; +} +void Staccato::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Staccato::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Staccato.h b/Sourcecode/private/mx/core/elements/Staccato.h index 238c6abd6..bf0e6bb93 100644 --- a/Sourcecode/private/mx/core/elements/Staccato.h +++ b/Sourcecode/private/mx/core/elements/Staccato.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Staccato ) - - inline StaccatoPtr makeStaccato() { return std::make_shared(); } - - class Staccato : public ElementInterface - { - public: - Staccato(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Staccato) + +inline StaccatoPtr makeStaccato() +{ + return std::make_shared(); } + +class Staccato : public ElementInterface +{ + public: + Staccato(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Staff.cpp b/Sourcecode/private/mx/core/elements/Staff.cpp index fe045eccb..eb9a152b7 100644 --- a/Sourcecode/private/mx/core/elements/Staff.cpp +++ b/Sourcecode/private/mx/core/elements/Staff.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Staff::Staff() - :myValue() - {} - - - Staff::Staff( const PositiveInteger& value ) - :myValue( value ) - {} - - - bool Staff::hasAttributes() const - { - return false; - } - - - bool Staff::hasContents() const - { - return true; - } - - - std::ostream& Staff::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Staff::streamName( std::ostream& os ) const - { - os << "staff"; - return os; - } +namespace core +{ +Staff::Staff() : myValue() +{ +} +Staff::Staff(const PositiveInteger &value) : myValue(value) +{ +} - std::ostream& Staff::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Staff::hasAttributes() const +{ + return false; +} +bool Staff::hasContents() const +{ + return true; +} - PositiveInteger Staff::getValue() const - { - return myValue; - } +std::ostream &Staff::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Staff::streamName(std::ostream &os) const +{ + os << "staff"; + return os; +} - void Staff::setValue( const PositiveInteger& value ) - { - myValue = value; - } +std::ostream &Staff::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +PositiveInteger Staff::getValue() const +{ + return myValue; +} - bool Staff::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Staff::setValue(const PositiveInteger &value) +{ + myValue = value; +} - } +bool Staff::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Staff.h b/Sourcecode/private/mx/core/elements/Staff.h index 66479e044..87f516c8d 100644 --- a/Sourcecode/private/mx/core/elements/Staff.h +++ b/Sourcecode/private/mx/core/elements/Staff.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Staff ) - - inline StaffPtr makeStaff() { return std::make_shared(); } - inline StaffPtr makeStaff( const PositiveInteger& value ) { return std::make_shared( value ); } - inline StaffPtr makeStaff( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Staff : public ElementInterface - { - public: - Staff(); - Staff( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Staff) + +inline StaffPtr makeStaff() +{ + return std::make_shared(); +} + +inline StaffPtr makeStaff(const PositiveInteger &value) +{ + return std::make_shared(value); } + +inline StaffPtr makeStaff(PositiveInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class Staff : public ElementInterface +{ + public: + Staff(); + Staff(const PositiveInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + PositiveInteger getValue() const; + void setValue(const PositiveInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + PositiveInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffDetails.cpp b/Sourcecode/private/mx/core/elements/StaffDetails.cpp index c0f9624e7..bc7279291 100644 --- a/Sourcecode/private/mx/core/elements/StaffDetails.cpp +++ b/Sourcecode/private/mx/core/elements/StaffDetails.cpp @@ -13,261 +13,231 @@ namespace mx { - namespace core - { - StaffDetails::StaffDetails() - :myAttributes( std::make_shared() ) - ,myStaffType( makeStaffType() ) - ,myHasStaffType( false ) - ,myStaffLines( makeStaffLines( NonNegativeInteger( 5 ) ) ) - ,myHasStaffLines( false ) - ,myStaffTuningSet() - ,myCapo( makeCapo() ) - ,myHasCapo( false ) - ,myStaffSize( makeStaffSize() ) - ,myHasStaffSize( false ) - {} - - - bool StaffDetails::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& StaffDetails::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& StaffDetails::streamName( std::ostream& os ) const - { - os << "staff-details"; - return os; - } - - - bool StaffDetails::hasContents() const - { - return myHasStaffType - || myHasStaffLines - || myStaffTuningSet.size() > 0 - || myHasCapo - || myHasStaffSize; - } - - - std::ostream& StaffDetails::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = !( myHasStaffType - || myHasStaffLines - || myStaffTuningSet.size() > 0 - || myHasCapo - || myHasStaffSize); - if ( myHasStaffType ) - { - os << std::endl; - myStaffType->toStream( os, indentLevel+1 ); - } - if ( myHasStaffLines ) - { - os << std::endl; - myStaffLines->toStream( os, indentLevel+1 ); - } - for ( auto x : myStaffTuningSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasCapo ) - { - os << std::endl; - myCapo->toStream( os, indentLevel+1 ); - } - if ( myHasStaffSize ) - { - os << std::endl; - myStaffSize->toStream( os, indentLevel+1 ); - } - if( hasContents() ) - { - os << std::endl; - } - return os; - } - - - StaffDetailsAttributesPtr StaffDetails::getAttributes() const - { - return myAttributes; - } - - - void StaffDetails::setAttributes( const StaffDetailsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - StaffTypePtr StaffDetails::getStaffType() const - { - return myStaffType; - } - - - void StaffDetails::setStaffType( const StaffTypePtr& value ) - { - if( value ) - { - myStaffType = value; - } - } - - - bool StaffDetails::getHasStaffType() const - { - return myHasStaffType; - } - +namespace core +{ +StaffDetails::StaffDetails() + : myAttributes(std::make_shared()), myStaffType(makeStaffType()), myHasStaffType(false), + myStaffLines(makeStaffLines(NonNegativeInteger(5))), myHasStaffLines(false), myStaffTuningSet(), + myCapo(makeCapo()), myHasCapo(false), myStaffSize(makeStaffSize()), myHasStaffSize(false) +{ +} - void StaffDetails::setHasStaffType( const bool value ) - { - myHasStaffType = value; - } +bool StaffDetails::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &StaffDetails::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - StaffLinesPtr StaffDetails::getStaffLines() const - { - return myStaffLines; - } +std::ostream &StaffDetails::streamName(std::ostream &os) const +{ + os << "staff-details"; + return os; +} +bool StaffDetails::hasContents() const +{ + return myHasStaffType || myHasStaffLines || myStaffTuningSet.size() > 0 || myHasCapo || myHasStaffSize; +} - void StaffDetails::setStaffLines( const StaffLinesPtr& value ) - { - if( value ) - { - myStaffLines = value; - } - } +std::ostream &StaffDetails::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = !(myHasStaffType || myHasStaffLines || myStaffTuningSet.size() > 0 || myHasCapo || myHasStaffSize); + if (myHasStaffType) + { + os << std::endl; + myStaffType->toStream(os, indentLevel + 1); + } + if (myHasStaffLines) + { + os << std::endl; + myStaffLines->toStream(os, indentLevel + 1); + } + for (auto x : myStaffTuningSet) + { + os << std::endl; + x->toStream(os, indentLevel + 1); + } + if (myHasCapo) + { + os << std::endl; + myCapo->toStream(os, indentLevel + 1); + } + if (myHasStaffSize) + { + os << std::endl; + myStaffSize->toStream(os, indentLevel + 1); + } + if (hasContents()) + { + os << std::endl; + } + return os; +} +StaffDetailsAttributesPtr StaffDetails::getAttributes() const +{ + return myAttributes; +} - bool StaffDetails::getHasStaffLines() const - { - return myHasStaffLines; - } +void StaffDetails::setAttributes(const StaffDetailsAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +StaffTypePtr StaffDetails::getStaffType() const +{ + return myStaffType; +} - void StaffDetails::setHasStaffLines( const bool value ) - { - myHasStaffLines = value; - } +void StaffDetails::setStaffType(const StaffTypePtr &value) +{ + if (value) + { + myStaffType = value; + } +} +bool StaffDetails::getHasStaffType() const +{ + return myHasStaffType; +} - const StaffTuningSet& StaffDetails::getStaffTuningSet() const - { - return myStaffTuningSet; - } +void StaffDetails::setHasStaffType(const bool value) +{ + myHasStaffType = value; +} +StaffLinesPtr StaffDetails::getStaffLines() const +{ + return myStaffLines; +} - void StaffDetails::removeStaffTuning( const StaffTuningSetIterConst& value ) - { - if ( value != myStaffTuningSet.cend() ) - { - myStaffTuningSet.erase( value ); - } - } +void StaffDetails::setStaffLines(const StaffLinesPtr &value) +{ + if (value) + { + myStaffLines = value; + } +} +bool StaffDetails::getHasStaffLines() const +{ + return myHasStaffLines; +} - void StaffDetails::addStaffTuning( const StaffTuningPtr& value ) - { - if ( value ) - { - myStaffTuningSet.push_back( value ); - } - } +void StaffDetails::setHasStaffLines(const bool value) +{ + myHasStaffLines = value; +} +const StaffTuningSet &StaffDetails::getStaffTuningSet() const +{ + return myStaffTuningSet; +} - void StaffDetails::clearStaffTuningSet() - { - myStaffTuningSet.clear(); - } +void StaffDetails::removeStaffTuning(const StaffTuningSetIterConst &value) +{ + if (value != myStaffTuningSet.cend()) + { + myStaffTuningSet.erase(value); + } +} +void StaffDetails::addStaffTuning(const StaffTuningPtr &value) +{ + if (value) + { + myStaffTuningSet.push_back(value); + } +} - CapoPtr StaffDetails::getCapo() const - { - return myCapo; - } +void StaffDetails::clearStaffTuningSet() +{ + myStaffTuningSet.clear(); +} +CapoPtr StaffDetails::getCapo() const +{ + return myCapo; +} - void StaffDetails::setCapo( const CapoPtr& value ) - { - if( value ) - { - myCapo = value; - } - } +void StaffDetails::setCapo(const CapoPtr &value) +{ + if (value) + { + myCapo = value; + } +} +bool StaffDetails::getHasCapo() const +{ + return myHasCapo; +} - bool StaffDetails::getHasCapo() const - { - return myHasCapo; - } +void StaffDetails::setHasCapo(const bool value) +{ + myHasCapo = value; +} +StaffSizePtr StaffDetails::getStaffSize() const +{ + return myStaffSize; +} - void StaffDetails::setHasCapo( const bool value ) - { - myHasCapo = value; - } +void StaffDetails::setStaffSize(const StaffSizePtr &value) +{ + if (value) + { + myStaffSize = value; + } +} +bool StaffDetails::getHasStaffSize() const +{ + return myHasStaffSize; +} - StaffSizePtr StaffDetails::getStaffSize() const - { - return myStaffSize; - } +void StaffDetails::setHasStaffSize(const bool value) +{ + myHasStaffSize = value; +} +bool StaffDetails::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - void StaffDetails::setStaffSize( const StaffSizePtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myStaffType, myHasStaffType)) { - if( value ) - { - myStaffSize = value; - } + continue; } - - - bool StaffDetails::getHasStaffSize() const + if (importElement(message, *it, isSuccess, *myStaffLines, myHasStaffLines)) { - return myHasStaffSize; + continue; } - - - void StaffDetails::setHasStaffSize( const bool value ) + importElementSet(message, it, endIter, isSuccess, "staff-tuning", myStaffTuningSet); + if (importElement(message, *it, isSuccess, *myCapo, myHasCapo)) { - myHasStaffSize = value; + continue; } - - - bool StaffDetails::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myStaffSize, myHasStaffSize)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myStaffType, myHasStaffType ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myStaffLines, myHasStaffLines ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "staff-tuning", myStaffTuningSet ); - if ( importElement( message, *it, isSuccess, *myCapo, myHasCapo ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myStaffSize, myHasStaffSize ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffDetails.h b/Sourcecode/private/mx/core/elements/StaffDetails.h index ec60545b4..21a091a8c 100644 --- a/Sourcecode/private/mx/core/elements/StaffDetails.h +++ b/Sourcecode/private/mx/core/elements/StaffDetails.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/StaffDetailsAttributes.h" #include @@ -14,78 +14,81 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StaffDetailsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Capo ) - MX_FORWARD_DECLARE_ELEMENT( StaffLines ) - MX_FORWARD_DECLARE_ELEMENT( StaffSize ) - MX_FORWARD_DECLARE_ELEMENT( StaffTuning ) - MX_FORWARD_DECLARE_ELEMENT( StaffType ) - MX_FORWARD_DECLARE_ELEMENT( StaffDetails ) +MX_FORWARD_DECLARE_ATTRIBUTES(StaffDetailsAttributes) +MX_FORWARD_DECLARE_ELEMENT(Capo) +MX_FORWARD_DECLARE_ELEMENT(StaffLines) +MX_FORWARD_DECLARE_ELEMENT(StaffSize) +MX_FORWARD_DECLARE_ELEMENT(StaffTuning) +MX_FORWARD_DECLARE_ELEMENT(StaffType) +MX_FORWARD_DECLARE_ELEMENT(StaffDetails) - inline StaffDetailsPtr makeStaffDetails() { return std::make_shared(); } +inline StaffDetailsPtr makeStaffDetails() +{ + return std::make_shared(); +} - class StaffDetails : public ElementInterface - { - public: - StaffDetails(); +class StaffDetails : public ElementInterface +{ + public: + StaffDetails(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffDetailsAttributesPtr getAttributes() const; - void setAttributes( const StaffDetailsAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StaffDetailsAttributesPtr getAttributes() const; + void setAttributes(const StaffDetailsAttributesPtr &value); - /* _________ StaffType minOccurs = 0, maxOccurs = 1 _________ */ - StaffTypePtr getStaffType() const; - void setStaffType( const StaffTypePtr& value ); - bool getHasStaffType() const; - void setHasStaffType( const bool value ); + /* _________ StaffType minOccurs = 0, maxOccurs = 1 _________ */ + StaffTypePtr getStaffType() const; + void setStaffType(const StaffTypePtr &value); + bool getHasStaffType() const; + void setHasStaffType(const bool value); - /* _________ StaffLines minOccurs = 0, maxOccurs = 1 _________ */ - StaffLinesPtr getStaffLines() const; - void setStaffLines( const StaffLinesPtr& value ); - bool getHasStaffLines() const; - void setHasStaffLines( const bool value ); + /* _________ StaffLines minOccurs = 0, maxOccurs = 1 _________ */ + StaffLinesPtr getStaffLines() const; + void setStaffLines(const StaffLinesPtr &value); + bool getHasStaffLines() const; + void setHasStaffLines(const bool value); - /* _________ StaffTuning minOccurs = 0, maxOccurs = unbounded _________ */ - const StaffTuningSet& getStaffTuningSet() const; - void addStaffTuning( const StaffTuningPtr& value ); - void removeStaffTuning( const StaffTuningSetIterConst& value ); - bool getHasStaffTuning() const; - void setHasStaffTuning( const bool value ); - void clearStaffTuningSet(); + /* _________ StaffTuning minOccurs = 0, maxOccurs = unbounded _________ */ + const StaffTuningSet &getStaffTuningSet() const; + void addStaffTuning(const StaffTuningPtr &value); + void removeStaffTuning(const StaffTuningSetIterConst &value); + bool getHasStaffTuning() const; + void setHasStaffTuning(const bool value); + void clearStaffTuningSet(); - /* _________ Capo minOccurs = 0, maxOccurs = 1 _________ */ - CapoPtr getCapo() const; - void setCapo( const CapoPtr& value ); - bool getHasCapo() const; - void setHasCapo( const bool value ); + /* _________ Capo minOccurs = 0, maxOccurs = 1 _________ */ + CapoPtr getCapo() const; + void setCapo(const CapoPtr &value); + bool getHasCapo() const; + void setHasCapo(const bool value); - /* _________ StaffSize minOccurs = 0, maxOccurs = 1 _________ */ - StaffSizePtr getStaffSize() const; - void setStaffSize( const StaffSizePtr& value ); - bool getHasStaffSize() const; - void setHasStaffSize( const bool value ); + /* _________ StaffSize minOccurs = 0, maxOccurs = 1 _________ */ + StaffSizePtr getStaffSize() const; + void setStaffSize(const StaffSizePtr &value); + bool getHasStaffSize() const; + void setHasStaffSize(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - StaffDetailsAttributesPtr myAttributes; - StaffTypePtr myStaffType; - bool myHasStaffType; - StaffLinesPtr myStaffLines; - bool myHasStaffLines; - StaffTuningSet myStaffTuningSet; - CapoPtr myCapo; - bool myHasCapo; - StaffSizePtr myStaffSize; - bool myHasStaffSize; - }; - } -} + private: + StaffDetailsAttributesPtr myAttributes; + StaffTypePtr myStaffType; + bool myHasStaffType; + StaffLinesPtr myStaffLines; + bool myHasStaffLines; + StaffTuningSet myStaffTuningSet; + CapoPtr myCapo; + bool myHasCapo; + StaffSizePtr myStaffSize; + bool myHasStaffSize; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp b/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp index d7b215dce..408a38d9f 100644 --- a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp @@ -8,61 +8,62 @@ namespace mx { - namespace core +namespace core +{ +StaffDetailsAttributes::StaffDetailsAttributes() + : number(), showFrets(ShowFrets::numbers), printObject(YesNo::no), printSpacing(YesNo::no), hasNumber(false), + hasShowFrets(false), hasPrintObject(false), hasPrintSpacing(false) +{ +} + +bool StaffDetailsAttributes::hasValues() const +{ + return hasNumber || hasShowFrets || hasPrintObject || hasPrintSpacing; +} + +std::ostream &StaffDetailsAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - StaffDetailsAttributes::StaffDetailsAttributes() - :number() - ,showFrets( ShowFrets::numbers ) - ,printObject( YesNo::no ) - ,printSpacing( YesNo::no ) - ,hasNumber( false ) - ,hasShowFrets( false ) - ,hasPrintObject( false ) - ,hasPrintSpacing( false ) - {} + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, showFrets, "show-frets", hasShowFrets); + streamAttribute(os, printObject, "print-object", hasPrintObject); + streamAttribute(os, printSpacing, "print-spacing", hasPrintSpacing); + } + return os; +} + +bool StaffDetailsAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "StaffDetailsAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool StaffDetailsAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - return hasNumber || - hasShowFrets || - hasPrintObject || - hasPrintSpacing; + continue; } - - - std::ostream& StaffDetailsAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, showFrets, hasShowFrets, "show-frets", &parseShowFrets)) { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, showFrets, "show-frets", hasShowFrets ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, printSpacing, "print-spacing", hasPrintSpacing ); - } - return os; + continue; } - - - bool StaffDetailsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo)) { - const char* const className = "StaffDetailsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, showFrets, hasShowFrets, "show-frets", &parseShowFrets ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", &parseYesNo ) ) { continue; } - } - - - return isSuccess; + continue; + } + if (parseAttribute(message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", + &parseYesNo)) + { + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h b/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h index 2fee30e3e..b3e577955 100644 --- a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h +++ b/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -15,28 +15,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StaffDetailsAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(StaffDetailsAttributes) - struct StaffDetailsAttributes : public AttributesInterface - { - public: - StaffDetailsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - ShowFrets showFrets; - YesNo printObject; - YesNo printSpacing; - bool hasNumber; - bool hasShowFrets; - bool hasPrintObject; - bool hasPrintSpacing; +struct StaffDetailsAttributes : public AttributesInterface +{ + public: + StaffDetailsAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StaffNumber number; + ShowFrets showFrets; + YesNo printObject; + YesNo printSpacing; + bool hasNumber; + bool hasShowFrets; + bool hasPrintObject; + bool hasPrintSpacing; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffDistance.cpp b/Sourcecode/private/mx/core/elements/StaffDistance.cpp index c23d022f1..64db46305 100644 --- a/Sourcecode/private/mx/core/elements/StaffDistance.cpp +++ b/Sourcecode/private/mx/core/elements/StaffDistance.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - StaffDistance::StaffDistance() - :myValue() - {} - - - StaffDistance::StaffDistance( const TenthsValue& value ) - :myValue( value ) - {} - - - bool StaffDistance::hasAttributes() const - { - return false; - } - - - bool StaffDistance::hasContents() const - { - return true; - } - - - std::ostream& StaffDistance::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StaffDistance::streamName( std::ostream& os ) const - { - os << "staff-distance"; - return os; - } +namespace core +{ +StaffDistance::StaffDistance() : myValue() +{ +} +StaffDistance::StaffDistance(const TenthsValue &value) : myValue(value) +{ +} - std::ostream& StaffDistance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool StaffDistance::hasAttributes() const +{ + return false; +} +bool StaffDistance::hasContents() const +{ + return true; +} - TenthsValue StaffDistance::getValue() const - { - return myValue; - } +std::ostream &StaffDistance::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &StaffDistance::streamName(std::ostream &os) const +{ + os << "staff-distance"; + return os; +} - void StaffDistance::setValue( const TenthsValue& value ) - { - myValue = value; - } +std::ostream &StaffDistance::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TenthsValue StaffDistance::getValue() const +{ + return myValue; +} - bool StaffDistance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void StaffDistance::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool StaffDistance::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffDistance.h b/Sourcecode/private/mx/core/elements/StaffDistance.h index 11af07bb1..4db8a4220 100644 --- a/Sourcecode/private/mx/core/elements/StaffDistance.h +++ b/Sourcecode/private/mx/core/elements/StaffDistance.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StaffDistance ) - - inline StaffDistancePtr makeStaffDistance() { return std::make_shared(); } - inline StaffDistancePtr makeStaffDistance( const TenthsValue& value ) { return std::make_shared( value ); } - inline StaffDistancePtr makeStaffDistance( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class StaffDistance : public ElementInterface - { - public: - StaffDistance(); - StaffDistance( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(StaffDistance) + +inline StaffDistancePtr makeStaffDistance() +{ + return std::make_shared(); } + +inline StaffDistancePtr makeStaffDistance(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline StaffDistancePtr makeStaffDistance(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class StaffDistance : public ElementInterface +{ + public: + StaffDistance(); + StaffDistance(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffLayout.cpp b/Sourcecode/private/mx/core/elements/StaffLayout.cpp index 1b7fd99d4..12e92f843 100644 --- a/Sourcecode/private/mx/core/elements/StaffLayout.cpp +++ b/Sourcecode/private/mx/core/elements/StaffLayout.cpp @@ -9,111 +9,102 @@ namespace mx { - namespace core - { - StaffLayout::StaffLayout() - :myAttributes( std::make_shared() ) - ,myStaffDistance( makeStaffDistance() ) - ,myHasStaffDistance( false ) - {} - - - bool StaffLayout::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& StaffLayout::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& StaffLayout::streamName( std::ostream& os ) const - { - os << "staff-layout"; - return os; - } - - - bool StaffLayout::hasContents() const - { - return myHasStaffDistance; - } - - - std::ostream& StaffLayout::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasStaffDistance ) - { - os << std::endl; - myStaffDistance->toStream( os, indentLevel+1 ); - } - isOneLineOnly = ! hasContents(); - if ( ! isOneLineOnly ) - { - os << std::endl; - } - return os; - } - +namespace core +{ +StaffLayout::StaffLayout() + : myAttributes(std::make_shared()), myStaffDistance(makeStaffDistance()), + myHasStaffDistance(false) +{ +} - StaffLayoutAttributesPtr StaffLayout::getAttributes() const - { - return myAttributes; - } +bool StaffLayout::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &StaffLayout::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void StaffLayout::setAttributes( const StaffLayoutAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &StaffLayout::streamName(std::ostream &os) const +{ + os << "staff-layout"; + return os; +} +bool StaffLayout::hasContents() const +{ + return myHasStaffDistance; +} - StaffDistancePtr StaffLayout::getStaffDistance() const - { - return myStaffDistance; - } +std::ostream &StaffLayout::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasStaffDistance) + { + os << std::endl; + myStaffDistance->toStream(os, indentLevel + 1); + } + isOneLineOnly = !hasContents(); + if (!isOneLineOnly) + { + os << std::endl; + } + return os; +} +StaffLayoutAttributesPtr StaffLayout::getAttributes() const +{ + return myAttributes; +} - void StaffLayout::setStaffDistance( const StaffDistancePtr& value ) - { - if( value ) - { - myStaffDistance = value; - } - } +void StaffLayout::setAttributes(const StaffLayoutAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +StaffDistancePtr StaffLayout::getStaffDistance() const +{ + return myStaffDistance; +} - bool StaffLayout::getHasStaffDistance() const - { - return myHasStaffDistance; - } +void StaffLayout::setStaffDistance(const StaffDistancePtr &value) +{ + if (value) + { + myStaffDistance = value; + } +} +bool StaffLayout::getHasStaffDistance() const +{ + return myHasStaffDistance; +} - void StaffLayout::setHasStaffDistance( const bool value ) - { - myHasStaffDistance = value; - } +void StaffLayout::setHasStaffDistance(const bool value) +{ + myHasStaffDistance = value; +} +bool StaffLayout::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); - bool StaffLayout::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myStaffDistance, myHasStaffDistance)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myStaffDistance, myHasStaffDistance ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffLayout.h b/Sourcecode/private/mx/core/elements/StaffLayout.h index c03995394..1bcfbff4b 100644 --- a/Sourcecode/private/mx/core/elements/StaffLayout.h +++ b/Sourcecode/private/mx/core/elements/StaffLayout.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/StaffLayoutAttributes.h" #include @@ -14,41 +14,44 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StaffLayoutAttributes ) - MX_FORWARD_DECLARE_ELEMENT( StaffDistance ) - MX_FORWARD_DECLARE_ELEMENT( StaffLayout ) - - inline StaffLayoutPtr makeStaffLayout() { return std::make_shared(); } - - class StaffLayout : public ElementInterface - { - public: - StaffLayout(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffLayoutAttributesPtr getAttributes() const; - void setAttributes( const StaffLayoutAttributesPtr& value ); - - /* _________ StaffDistance minOccurs = 0, maxOccurs = 1 _________ */ - StaffDistancePtr getStaffDistance() const; - void setStaffDistance( const StaffDistancePtr& value ); - bool getHasStaffDistance() const; - void setHasStaffDistance( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StaffLayoutAttributesPtr myAttributes; - StaffDistancePtr myStaffDistance; - bool myHasStaffDistance; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(StaffLayoutAttributes) +MX_FORWARD_DECLARE_ELEMENT(StaffDistance) +MX_FORWARD_DECLARE_ELEMENT(StaffLayout) + +inline StaffLayoutPtr makeStaffLayout() +{ + return std::make_shared(); } + +class StaffLayout : public ElementInterface +{ + public: + StaffLayout(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StaffLayoutAttributesPtr getAttributes() const; + void setAttributes(const StaffLayoutAttributesPtr &value); + + /* _________ StaffDistance minOccurs = 0, maxOccurs = 1 _________ */ + StaffDistancePtr getStaffDistance() const; + void setStaffDistance(const StaffDistancePtr &value); + bool getHasStaffDistance() const; + void setHasStaffDistance(const bool value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StaffLayoutAttributesPtr myAttributes; + StaffDistancePtr myStaffDistance; + bool myHasStaffDistance; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp b/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp index 2b40aea8a..41c998201 100644 --- a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - StaffLayoutAttributes::StaffLayoutAttributes() - :number() - ,hasNumber( false ) - {} - +namespace core +{ +StaffLayoutAttributes::StaffLayoutAttributes() : number(), hasNumber(false) +{ +} - bool StaffLayoutAttributes::hasValues() const - { - return hasNumber; - } +bool StaffLayoutAttributes::hasValues() const +{ + return hasNumber; +} +std::ostream &StaffLayoutAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, number, "number", hasNumber); + } + return os; +} - std::ostream& StaffLayoutAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - } - return os; - } +bool StaffLayoutAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "StaffLayoutAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool StaffLayoutAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) { - const char* const className = "StaffLayoutAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - } - - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h b/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h index f291be90f..e68d0a4a7 100644 --- a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h +++ b/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StaffLayoutAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(StaffLayoutAttributes) - struct StaffLayoutAttributes : public AttributesInterface - { - public: - StaffLayoutAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - bool hasNumber; +struct StaffLayoutAttributes : public AttributesInterface +{ + public: + StaffLayoutAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StaffNumber number; + bool hasNumber; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffLines.cpp b/Sourcecode/private/mx/core/elements/StaffLines.cpp index 253276a1d..5377318bd 100644 --- a/Sourcecode/private/mx/core/elements/StaffLines.cpp +++ b/Sourcecode/private/mx/core/elements/StaffLines.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - StaffLines::StaffLines() - :myValue() - {} - - - StaffLines::StaffLines( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool StaffLines::hasAttributes() const - { - return false; - } - - - bool StaffLines::hasContents() const - { - return true; - } - - - std::ostream& StaffLines::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StaffLines::streamName( std::ostream& os ) const - { - os << "staff-lines"; - return os; - } +namespace core +{ +StaffLines::StaffLines() : myValue() +{ +} +StaffLines::StaffLines(const NonNegativeInteger &value) : myValue(value) +{ +} - std::ostream& StaffLines::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool StaffLines::hasAttributes() const +{ + return false; +} +bool StaffLines::hasContents() const +{ + return true; +} - NonNegativeInteger StaffLines::getValue() const - { - return myValue; - } +std::ostream &StaffLines::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &StaffLines::streamName(std::ostream &os) const +{ + os << "staff-lines"; + return os; +} - void StaffLines::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } +std::ostream &StaffLines::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NonNegativeInteger StaffLines::getValue() const +{ + return myValue; +} - bool StaffLines::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void StaffLines::setValue(const NonNegativeInteger &value) +{ + myValue = value; +} - } +bool StaffLines::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffLines.h b/Sourcecode/private/mx/core/elements/StaffLines.h index 611f6b2c8..5c8babb4d 100644 --- a/Sourcecode/private/mx/core/elements/StaffLines.h +++ b/Sourcecode/private/mx/core/elements/StaffLines.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StaffLines ) - - inline StaffLinesPtr makeStaffLines() { return std::make_shared(); } - inline StaffLinesPtr makeStaffLines( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline StaffLinesPtr makeStaffLines( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class StaffLines : public ElementInterface - { - public: - StaffLines(); - StaffLines( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(StaffLines) + +inline StaffLinesPtr makeStaffLines() +{ + return std::make_shared(); +} + +inline StaffLinesPtr makeStaffLines(const NonNegativeInteger &value) +{ + return std::make_shared(value); } + +inline StaffLinesPtr makeStaffLines(NonNegativeInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class StaffLines : public ElementInterface +{ + public: + StaffLines(); + StaffLines(const NonNegativeInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NonNegativeInteger getValue() const; + void setValue(const NonNegativeInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffSize.cpp b/Sourcecode/private/mx/core/elements/StaffSize.cpp index 64e39ca15..a1a58404c 100644 --- a/Sourcecode/private/mx/core/elements/StaffSize.cpp +++ b/Sourcecode/private/mx/core/elements/StaffSize.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - StaffSize::StaffSize() - :myValue() - {} - - - StaffSize::StaffSize( const NonNegativeDecimal& value ) - :myValue( value ) - {} - - - bool StaffSize::hasAttributes() const - { - return false; - } - - - bool StaffSize::hasContents() const - { - return true; - } - - - std::ostream& StaffSize::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StaffSize::streamName( std::ostream& os ) const - { - os << "staff-size"; - return os; - } +namespace core +{ +StaffSize::StaffSize() : myValue() +{ +} +StaffSize::StaffSize(const NonNegativeDecimal &value) : myValue(value) +{ +} - std::ostream& StaffSize::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool StaffSize::hasAttributes() const +{ + return false; +} +bool StaffSize::hasContents() const +{ + return true; +} - NonNegativeDecimal StaffSize::getValue() const - { - return myValue; - } +std::ostream &StaffSize::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &StaffSize::streamName(std::ostream &os) const +{ + os << "staff-size"; + return os; +} - void StaffSize::setValue( const NonNegativeDecimal& value ) - { - myValue = value; - } +std::ostream &StaffSize::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NonNegativeDecimal StaffSize::getValue() const +{ + return myValue; +} - bool StaffSize::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void StaffSize::setValue(const NonNegativeDecimal &value) +{ + myValue = value; +} - } +bool StaffSize::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffSize.h b/Sourcecode/private/mx/core/elements/StaffSize.h index bcb6f9848..ab7c536f1 100644 --- a/Sourcecode/private/mx/core/elements/StaffSize.h +++ b/Sourcecode/private/mx/core/elements/StaffSize.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StaffSize ) - - inline StaffSizePtr makeStaffSize() { return std::make_shared(); } - inline StaffSizePtr makeStaffSize( const NonNegativeDecimal& value ) { return std::make_shared( value ); } - inline StaffSizePtr makeStaffSize( NonNegativeDecimal&& value ) { return std::make_shared( std::move( value ) ); } - - class StaffSize : public ElementInterface - { - public: - StaffSize(); - StaffSize( const NonNegativeDecimal& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeDecimal getValue() const; - void setValue( const NonNegativeDecimal& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeDecimal myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(StaffSize) + +inline StaffSizePtr makeStaffSize() +{ + return std::make_shared(); } + +inline StaffSizePtr makeStaffSize(const NonNegativeDecimal &value) +{ + return std::make_shared(value); +} + +inline StaffSizePtr makeStaffSize(NonNegativeDecimal &&value) +{ + return std::make_shared(std::move(value)); +} + +class StaffSize : public ElementInterface +{ + public: + StaffSize(); + StaffSize(const NonNegativeDecimal &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NonNegativeDecimal getValue() const; + void setValue(const NonNegativeDecimal &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeDecimal myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffTuning.cpp b/Sourcecode/private/mx/core/elements/StaffTuning.cpp index 964eec492..89c7f1aa1 100644 --- a/Sourcecode/private/mx/core/elements/StaffTuning.cpp +++ b/Sourcecode/private/mx/core/elements/StaffTuning.cpp @@ -11,156 +11,148 @@ namespace mx { - namespace core - { - StaffTuning::StaffTuning() - :myAttributes( std::make_shared() ) - ,myTuningStep( makeTuningStep() ) - ,myTuningAlter( makeTuningAlter() ) - ,myHasTuningAlter( false ) - ,myTuningOctave( makeTuningOctave() ) - {} - - - bool StaffTuning::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& StaffTuning::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& StaffTuning::streamName( std::ostream& os ) const - { - os << "staff-tuning"; - return os; - } - - - bool StaffTuning::hasContents() const - { - return true; - } - - - std::ostream& StaffTuning::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myTuningStep->toStream( os, indentLevel+1 ); - if ( myHasTuningAlter ) - { - os << std::endl; - myTuningAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - myTuningOctave->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - +namespace core +{ +StaffTuning::StaffTuning() + : myAttributes(std::make_shared()), myTuningStep(makeTuningStep()), + myTuningAlter(makeTuningAlter()), myHasTuningAlter(false), myTuningOctave(makeTuningOctave()) +{ +} - StaffTuningAttributesPtr StaffTuning::getAttributes() const - { - return myAttributes; - } +bool StaffTuning::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &StaffTuning::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void StaffTuning::setAttributes( const StaffTuningAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &StaffTuning::streamName(std::ostream &os) const +{ + os << "staff-tuning"; + return os; +} +bool StaffTuning::hasContents() const +{ + return true; +} - TuningStepPtr StaffTuning::getTuningStep() const - { - return myTuningStep; - } +std::ostream &StaffTuning::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myTuningStep->toStream(os, indentLevel + 1); + if (myHasTuningAlter) + { + os << std::endl; + myTuningAlter->toStream(os, indentLevel + 1); + } + os << std::endl; + myTuningOctave->toStream(os, indentLevel + 1); + os << std::endl; + return os; +} +StaffTuningAttributesPtr StaffTuning::getAttributes() const +{ + return myAttributes; +} - void StaffTuning::setTuningStep( const TuningStepPtr& value ) - { - if( value ) - { - myTuningStep = value; - } - } +void StaffTuning::setAttributes(const StaffTuningAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +TuningStepPtr StaffTuning::getTuningStep() const +{ + return myTuningStep; +} - TuningAlterPtr StaffTuning::getTuningAlter() const - { - return myTuningAlter; - } +void StaffTuning::setTuningStep(const TuningStepPtr &value) +{ + if (value) + { + myTuningStep = value; + } +} +TuningAlterPtr StaffTuning::getTuningAlter() const +{ + return myTuningAlter; +} - void StaffTuning::setTuningAlter( const TuningAlterPtr& value ) - { - if( value ) - { - myTuningAlter = value; - } - } +void StaffTuning::setTuningAlter(const TuningAlterPtr &value) +{ + if (value) + { + myTuningAlter = value; + } +} +bool StaffTuning::getHasTuningAlter() const +{ + return myHasTuningAlter; +} - bool StaffTuning::getHasTuningAlter() const - { - return myHasTuningAlter; - } +void StaffTuning::setHasTuningAlter(const bool value) +{ + myHasTuningAlter = value; +} +TuningOctavePtr StaffTuning::getTuningOctave() const +{ + return myTuningOctave; +} - void StaffTuning::setHasTuningAlter( const bool value ) - { - myHasTuningAlter = value; - } +void StaffTuning::setTuningOctave(const TuningOctavePtr &value) +{ + if (value) + { + myTuningOctave = value; + } +} +bool StaffTuning::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isTuningStepFound = false; + bool isTuningOctaveFound = false; - TuningOctavePtr StaffTuning::getTuningOctave() const + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myTuningStep, isTuningStepFound)) { - return myTuningOctave; + continue; } - - - void StaffTuning::setTuningOctave( const TuningOctavePtr& value ) + if (importElement(message, *it, isSuccess, *myTuningAlter, myHasTuningAlter)) { - if( value ) - { - myTuningOctave = value; - } + continue; } - - - bool StaffTuning::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myTuningOctave, isTuningOctaveFound)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isTuningStepFound = false; - bool isTuningOctaveFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myTuningStep, isTuningStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTuningAlter, myHasTuningAlter ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTuningOctave, isTuningOctaveFound ) ) { continue; } - } - - if( !isTuningStepFound ) - { - message << "StaffTuning: '" << myTuningStep->getElementName() << "' is required but was not found" << std::endl; - } - if( !isTuningOctaveFound ) - { - message << "StaffTuning: '" << myTuningOctave->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isTuningStepFound) + { + message << "StaffTuning: '" << myTuningStep->getElementName() << "' is required but was not found" << std::endl; } + if (!isTuningOctaveFound) + { + message << "StaffTuning: '" << myTuningOctave->getElementName() << "' is required but was not found" + << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffTuning.h b/Sourcecode/private/mx/core/elements/StaffTuning.h index 509a0bd6f..0f26dfbff 100644 --- a/Sourcecode/private/mx/core/elements/StaffTuning.h +++ b/Sourcecode/private/mx/core/elements/StaffTuning.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/StaffTuningAttributes.h" #include @@ -14,53 +14,56 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StaffTuningAttributes ) - MX_FORWARD_DECLARE_ELEMENT( TuningAlter ) - MX_FORWARD_DECLARE_ELEMENT( TuningOctave ) - MX_FORWARD_DECLARE_ELEMENT( TuningStep ) - MX_FORWARD_DECLARE_ELEMENT( StaffTuning ) +MX_FORWARD_DECLARE_ATTRIBUTES(StaffTuningAttributes) +MX_FORWARD_DECLARE_ELEMENT(TuningAlter) +MX_FORWARD_DECLARE_ELEMENT(TuningOctave) +MX_FORWARD_DECLARE_ELEMENT(TuningStep) +MX_FORWARD_DECLARE_ELEMENT(StaffTuning) - inline StaffTuningPtr makeStaffTuning() { return std::make_shared(); } +inline StaffTuningPtr makeStaffTuning() +{ + return std::make_shared(); +} - class StaffTuning : public ElementInterface - { - public: - StaffTuning(); +class StaffTuning : public ElementInterface +{ + public: + StaffTuning(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffTuningAttributesPtr getAttributes() const; - void setAttributes( const StaffTuningAttributesPtr& value ); + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StaffTuningAttributesPtr getAttributes() const; + void setAttributes(const StaffTuningAttributesPtr &value); - /* _________ TuningStep minOccurs = 1, maxOccurs = 1 _________ */ - TuningStepPtr getTuningStep() const; - void setTuningStep( const TuningStepPtr& value ); + /* _________ TuningStep minOccurs = 1, maxOccurs = 1 _________ */ + TuningStepPtr getTuningStep() const; + void setTuningStep(const TuningStepPtr &value); - /* _________ TuningAlter minOccurs = 0, maxOccurs = 1 _________ */ - TuningAlterPtr getTuningAlter() const; - void setTuningAlter( const TuningAlterPtr& value ); - bool getHasTuningAlter() const; - void setHasTuningAlter( const bool value ); + /* _________ TuningAlter minOccurs = 0, maxOccurs = 1 _________ */ + TuningAlterPtr getTuningAlter() const; + void setTuningAlter(const TuningAlterPtr &value); + bool getHasTuningAlter() const; + void setHasTuningAlter(const bool value); - /* _________ TuningOctave minOccurs = 1, maxOccurs = 1 _________ */ - TuningOctavePtr getTuningOctave() const; - void setTuningOctave( const TuningOctavePtr& value ); + /* _________ TuningOctave minOccurs = 1, maxOccurs = 1 _________ */ + TuningOctavePtr getTuningOctave() const; + void setTuningOctave(const TuningOctavePtr &value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - StaffTuningAttributesPtr myAttributes; - TuningStepPtr myTuningStep; - TuningAlterPtr myTuningAlter; - bool myHasTuningAlter; - TuningOctavePtr myTuningOctave; - }; - } -} + private: + StaffTuningAttributesPtr myAttributes; + TuningStepPtr myTuningStep; + TuningAlterPtr myTuningAlter; + bool myHasTuningAlter; + TuningOctavePtr myTuningOctave; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp b/Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp index eab65f7af..068912a6f 100644 --- a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - StaffTuningAttributes::StaffTuningAttributes() - :line() - ,hasLine( false ) - {} - +namespace core +{ +StaffTuningAttributes::StaffTuningAttributes() : line(), hasLine(false) +{ +} - bool StaffTuningAttributes::hasValues() const - { - return hasLine; - } +bool StaffTuningAttributes::hasValues() const +{ + return hasLine; +} +std::ostream &StaffTuningAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, line, "line", hasLine); + } + return os; +} - std::ostream& StaffTuningAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, line, "line", hasLine ); - } - return os; - } +bool StaffTuningAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "StaffTuningAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool StaffTuningAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, line, hasLine, "line")) { - const char* const className = "StaffTuningAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, line, hasLine, "line" ) ) { continue; } - } - - - return isSuccess; + continue; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.h b/Sourcecode/private/mx/core/elements/StaffTuningAttributes.h index 1225dbea0..722e2cafe 100644 --- a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.h +++ b/Sourcecode/private/mx/core/elements/StaffTuningAttributes.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StaffTuningAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(StaffTuningAttributes) - struct StaffTuningAttributes : public AttributesInterface - { - public: - StaffTuningAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffLine line; - bool hasLine; +struct StaffTuningAttributes : public AttributesInterface +{ + public: + StaffTuningAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StaffLine line; + bool hasLine; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffType.cpp b/Sourcecode/private/mx/core/elements/StaffType.cpp index d01175555..05b572fa8 100644 --- a/Sourcecode/private/mx/core/elements/StaffType.cpp +++ b/Sourcecode/private/mx/core/elements/StaffType.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - StaffType::StaffType() - :myValue( StaffTypeEnum::regular ) - {} - - - StaffType::StaffType( const StaffTypeEnum& value ) - :myValue( value ) - {} - - - bool StaffType::hasAttributes() const - { - return false; - } - - - bool StaffType::hasContents() const - { - return true; - } - - - std::ostream& StaffType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StaffType::streamName( std::ostream& os ) const - { - os << "staff-type"; - return os; - } +namespace core +{ +StaffType::StaffType() : myValue(StaffTypeEnum::regular) +{ +} +StaffType::StaffType(const StaffTypeEnum &value) : myValue(value) +{ +} - std::ostream& StaffType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool StaffType::hasAttributes() const +{ + return false; +} +bool StaffType::hasContents() const +{ + return true; +} - StaffTypeEnum StaffType::getValue() const - { - return myValue; - } +std::ostream &StaffType::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &StaffType::streamName(std::ostream &os) const +{ + os << "staff-type"; + return os; +} - void StaffType::setValue( const StaffTypeEnum& value ) - { - myValue = value; - } +std::ostream &StaffType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StaffTypeEnum StaffType::getValue() const +{ + return myValue; +} - bool StaffType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseStaffTypeEnum( xelement.getValue() ); - return true; - } +void StaffType::setValue(const StaffTypeEnum &value) +{ + myValue = value; +} - } +bool StaffType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue = parseStaffTypeEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StaffType.h b/Sourcecode/private/mx/core/elements/StaffType.h index 3179a478d..0305b8069 100644 --- a/Sourcecode/private/mx/core/elements/StaffType.h +++ b/Sourcecode/private/mx/core/elements/StaffType.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StaffType ) - - inline StaffTypePtr makeStaffType() { return std::make_shared(); } - inline StaffTypePtr makeStaffType( const StaffTypeEnum& value ) { return std::make_shared( value ); } - inline StaffTypePtr makeStaffType( StaffTypeEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class StaffType : public ElementInterface - { - public: - StaffType(); - StaffType( const StaffTypeEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffTypeEnum getValue() const; - void setValue( const StaffTypeEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StaffTypeEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(StaffType) + +inline StaffTypePtr makeStaffType() +{ + return std::make_shared(); +} + +inline StaffTypePtr makeStaffType(const StaffTypeEnum &value) +{ + return std::make_shared(value); } + +inline StaffTypePtr makeStaffType(StaffTypeEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class StaffType : public ElementInterface +{ + public: + StaffType(); + StaffType(const StaffTypeEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StaffTypeEnum getValue() const; + void setValue(const StaffTypeEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StaffTypeEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Staves.cpp b/Sourcecode/private/mx/core/elements/Staves.cpp index b03d79ec8..a773a60b3 100644 --- a/Sourcecode/private/mx/core/elements/Staves.cpp +++ b/Sourcecode/private/mx/core/elements/Staves.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Staves::Staves() - :myValue() - {} - - - Staves::Staves( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool Staves::hasAttributes() const - { - return false; - } - - - bool Staves::hasContents() const - { - return true; - } - - - std::ostream& Staves::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Staves::streamName( std::ostream& os ) const - { - os << "staves"; - return os; - } +namespace core +{ +Staves::Staves() : myValue() +{ +} +Staves::Staves(const NonNegativeInteger &value) : myValue(value) +{ +} - std::ostream& Staves::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Staves::hasAttributes() const +{ + return false; +} +bool Staves::hasContents() const +{ + return true; +} - NonNegativeInteger Staves::getValue() const - { - return myValue; - } +std::ostream &Staves::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Staves::streamName(std::ostream &os) const +{ + os << "staves"; + return os; +} - void Staves::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } +std::ostream &Staves::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +NonNegativeInteger Staves::getValue() const +{ + return myValue; +} - bool Staves::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Staves::setValue(const NonNegativeInteger &value) +{ + myValue = value; +} - } +bool Staves::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Staves.h b/Sourcecode/private/mx/core/elements/Staves.h index 8ede1bbe5..bde2b292c 100644 --- a/Sourcecode/private/mx/core/elements/Staves.h +++ b/Sourcecode/private/mx/core/elements/Staves.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Staves ) - - inline StavesPtr makeStaves() { return std::make_shared(); } - inline StavesPtr makeStaves( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline StavesPtr makeStaves( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Staves : public ElementInterface - { - public: - Staves(); - Staves( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Staves) + +inline StavesPtr makeStaves() +{ + return std::make_shared(); +} + +inline StavesPtr makeStaves(const NonNegativeInteger &value) +{ + return std::make_shared(value); } + +inline StavesPtr makeStaves(NonNegativeInteger &&value) +{ + return std::make_shared(std::move(value)); +} + +class Staves : public ElementInterface +{ + public: + Staves(); + Staves(const NonNegativeInteger &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + NonNegativeInteger getValue() const; + void setValue(const NonNegativeInteger &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + NonNegativeInteger myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Stem.cpp b/Sourcecode/private/mx/core/elements/Stem.cpp index 9722fbf7e..e00211e09 100644 --- a/Sourcecode/private/mx/core/elements/Stem.cpp +++ b/Sourcecode/private/mx/core/elements/Stem.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Stem::Stem() - :myValue( StemValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - Stem::Stem( const StemValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Stem::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Stem::hasContents() const - { - return true; - } - - - std::ostream& Stem::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Stem::streamName( std::ostream& os ) const - { - os << "stem"; - return os; - } - - - std::ostream& Stem::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Stem::Stem() : myValue(StemValue::none), myAttributes(std::make_shared()) +{ +} +Stem::Stem(const StemValue &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - StemAttributesPtr Stem::getAttributes() const - { - return myAttributes; - } +bool Stem::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Stem::hasContents() const +{ + return true; +} - void Stem::setAttributes( const StemAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Stem::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Stem::streamName(std::ostream &os) const +{ + os << "stem"; + return os; +} - StemValue Stem::getValue() const - { - return myValue; - } +std::ostream &Stem::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StemAttributesPtr Stem::getAttributes() const +{ + return myAttributes; +} - void Stem::setValue( const StemValue& value ) - { - myValue = value; - } +void Stem::setAttributes(const StemAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +StemValue Stem::getValue() const +{ + return myValue; +} - bool Stem::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseStemValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Stem::setValue(const StemValue &value) +{ + myValue = value; +} - } +bool Stem::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue = parseStemValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Stem.h b/Sourcecode/private/mx/core/elements/Stem.h index 0dfe17f39..ad4510f12 100644 --- a/Sourcecode/private/mx/core/elements/Stem.h +++ b/Sourcecode/private/mx/core/elements/Stem.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/StemAttributes.h" #include @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StemAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Stem ) - - inline StemPtr makeStem() { return std::make_shared(); } - inline StemPtr makeStem( const StemValue& value ) { return std::make_shared( value ); } - inline StemPtr makeStem( StemValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Stem : public ElementInterface - { - public: - Stem(); - Stem( const StemValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StemAttributesPtr getAttributes() const; - void setAttributes( const StemAttributesPtr& attributes ); - StemValue getValue() const; - void setValue( const StemValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StemValue myValue; - StemAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(StemAttributes) +MX_FORWARD_DECLARE_ELEMENT(Stem) + +inline StemPtr makeStem() +{ + return std::make_shared(); +} + +inline StemPtr makeStem(const StemValue &value) +{ + return std::make_shared(value); } + +inline StemPtr makeStem(StemValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Stem : public ElementInterface +{ + public: + Stem(); + Stem(const StemValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StemAttributesPtr getAttributes() const; + void setAttributes(const StemAttributesPtr &attributes); + StemValue getValue() const; + void setValue(const StemValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StemValue myValue; + StemAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StemAttributes.cpp b/Sourcecode/private/mx/core/elements/StemAttributes.cpp index 4e3df15b1..fb4564e95 100644 --- a/Sourcecode/private/mx/core/elements/StemAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/StemAttributes.cpp @@ -8,61 +8,61 @@ namespace mx { - namespace core +namespace core +{ +StemAttributes::StemAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), + hasRelativeY(false) +{ +} + +bool StemAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY; +} + +std::ostream &StemAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - StemAttributes::StemAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + } + return os; +} + +bool StemAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "StemAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool StemAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; + continue; } - - - std::ostream& StemAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; + continue; } - - - bool StemAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "StemAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StemAttributes.h b/Sourcecode/private/mx/core/elements/StemAttributes.h index 586b89c05..8a439f7b6 100644 --- a/Sourcecode/private/mx/core/elements/StemAttributes.h +++ b/Sourcecode/private/mx/core/elements/StemAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,28 +14,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StemAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(StemAttributes) - struct StemAttributes : public AttributesInterface - { - public: - StemAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; +struct StemAttributes : public AttributesInterface +{ + public: + StemAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Step.cpp b/Sourcecode/private/mx/core/elements/Step.cpp index 5fcadedfd..301586cb5 100644 --- a/Sourcecode/private/mx/core/elements/Step.cpp +++ b/Sourcecode/private/mx/core/elements/Step.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - Step::Step() - :myValue( StepEnum::a ) - {} - - - Step::Step( const StepEnum& value ) - :myValue( value ) - {} - - - bool Step::hasAttributes() const - { - return false; - } - - - bool Step::hasContents() const - { - return true; - } - - - std::ostream& Step::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Step::streamName( std::ostream& os ) const - { - os << "step"; - return os; - } +namespace core +{ +Step::Step() : myValue(StepEnum::a) +{ +} +Step::Step(const StepEnum &value) : myValue(value) +{ +} - std::ostream& Step::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Step::hasAttributes() const +{ + return false; +} +bool Step::hasContents() const +{ + return true; +} - StepEnum Step::getValue() const - { - return myValue; - } +std::ostream &Step::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Step::streamName(std::ostream &os) const +{ + os << "step"; + return os; +} - void Step::setValue( const StepEnum& value ) - { - myValue = value; - } +std::ostream &Step::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StepEnum Step::getValue() const +{ + return myValue; +} - bool Step::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStepEnum( xelement.getValue() ); - return true; - } +void Step::setValue(const StepEnum &value) +{ + myValue = value; +} - } +bool Step::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseStepEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Step.h b/Sourcecode/private/mx/core/elements/Step.h index 1628511f1..a8e6c716e 100644 --- a/Sourcecode/private/mx/core/elements/Step.h +++ b/Sourcecode/private/mx/core/elements/Step.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Step ) - - inline StepPtr makeStep() { return std::make_shared(); } - inline StepPtr makeStep( const StepEnum& value ) { return std::make_shared( value ); } - inline StepPtr makeStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Step : public ElementInterface - { - public: - Step(); - Step( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Step) + +inline StepPtr makeStep() +{ + return std::make_shared(); +} + +inline StepPtr makeStep(const StepEnum &value) +{ + return std::make_shared(value); } + +inline StepPtr makeStep(StepEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class Step : public ElementInterface +{ + public: + Step(); + Step(const StepEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StepEnum getValue() const; + void setValue(const StepEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StepEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Stick.cpp b/Sourcecode/private/mx/core/elements/Stick.cpp index f6c6dc5a2..eaf85b7ac 100644 --- a/Sourcecode/private/mx/core/elements/Stick.cpp +++ b/Sourcecode/private/mx/core/elements/Stick.cpp @@ -10,121 +10,115 @@ namespace mx { - namespace core - { - Stick::Stick() - :myAttributes( std::make_shared() ) - ,myStickType( makeStickType() ) - ,myStickMaterial( makeStickMaterial() ) - {} - - - bool Stick::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Stick::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Stick::streamName( std::ostream& os ) const - { - os << "stick"; - return os; - } - - - bool Stick::hasContents() const - { - return true; - } - +namespace core +{ +Stick::Stick() + : myAttributes(std::make_shared()), myStickType(makeStickType()), + myStickMaterial(makeStickMaterial()) +{ +} - std::ostream& Stick::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myStickType->toStream( os, indentLevel+1 ); - os << std::endl; - myStickMaterial->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } +bool Stick::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &Stick::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - StickAttributesPtr Stick::getAttributes() const - { - return myAttributes; - } +std::ostream &Stick::streamName(std::ostream &os) const +{ + os << "stick"; + return os; +} +bool Stick::hasContents() const +{ + return true; +} - void Stick::setAttributes( const StickAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Stick::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myStickType->toStream(os, indentLevel + 1); + os << std::endl; + myStickMaterial->toStream(os, indentLevel + 1); + os << std::endl; + return os; +} +StickAttributesPtr Stick::getAttributes() const +{ + return myAttributes; +} - StickTypePtr Stick::getStickType() const - { - return myStickType; - } +void Stick::setAttributes(const StickAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +StickTypePtr Stick::getStickType() const +{ + return myStickType; +} - void Stick::setStickType( const StickTypePtr& value ) - { - if( value ) - { - myStickType = value; - } - } +void Stick::setStickType(const StickTypePtr &value) +{ + if (value) + { + myStickType = value; + } +} +StickMaterialPtr Stick::getStickMaterial() const +{ + return myStickMaterial; +} - StickMaterialPtr Stick::getStickMaterial() const - { - return myStickMaterial; - } +void Stick::setStickMaterial(const StickMaterialPtr &value) +{ + if (value) + { + myStickMaterial = value; + } +} +bool Stick::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isStickTypeFound = false; + bool isStickMaterialFound = false; - void Stick::setStickMaterial( const StickMaterialPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myStickType, isStickTypeFound)) { - if( value ) - { - myStickMaterial = value; - } + continue; } - - - bool Stick::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myStickMaterial, isStickMaterialFound)) { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isStickTypeFound = false; - bool isStickMaterialFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myStickType, isStickTypeFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myStickMaterial, isStickMaterialFound ) ) { continue; } - } - - if( !isStickTypeFound ) - { - message << "Stick: '" << myStickType->getElementName() << "' is required but was not found" << std::endl; - } - if( !isStickMaterialFound ) - { - message << "Stick: '" << myStickMaterial->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isStickTypeFound) + { + message << "Stick: '" << myStickType->getElementName() << "' is required but was not found" << std::endl; + } + if (!isStickMaterialFound) + { + message << "Stick: '" << myStickMaterial->getElementName() << "' is required but was not found" << std::endl; } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Stick.h b/Sourcecode/private/mx/core/elements/Stick.h index 2d01441da..16f72e223 100644 --- a/Sourcecode/private/mx/core/elements/Stick.h +++ b/Sourcecode/private/mx/core/elements/Stick.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/StickAttributes.h" #include @@ -14,44 +14,47 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StickAttributes ) - MX_FORWARD_DECLARE_ELEMENT( StickMaterial ) - MX_FORWARD_DECLARE_ELEMENT( StickType ) - MX_FORWARD_DECLARE_ELEMENT( Stick ) - - inline StickPtr makeStick() { return std::make_shared(); } - - class Stick : public ElementInterface - { - public: - Stick(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StickAttributesPtr getAttributes() const; - void setAttributes( const StickAttributesPtr& value ); - - /* _________ StickType minOccurs = 1, maxOccurs = 1 _________ */ - StickTypePtr getStickType() const; - void setStickType( const StickTypePtr& value ); - - /* _________ StickMaterial minOccurs = 1, maxOccurs = 1 _________ */ - StickMaterialPtr getStickMaterial() const; - void setStickMaterial( const StickMaterialPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StickAttributesPtr myAttributes; - StickTypePtr myStickType; - StickMaterialPtr myStickMaterial; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(StickAttributes) +MX_FORWARD_DECLARE_ELEMENT(StickMaterial) +MX_FORWARD_DECLARE_ELEMENT(StickType) +MX_FORWARD_DECLARE_ELEMENT(Stick) + +inline StickPtr makeStick() +{ + return std::make_shared(); } + +class Stick : public ElementInterface +{ + public: + Stick(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StickAttributesPtr getAttributes() const; + void setAttributes(const StickAttributesPtr &value); + + /* _________ StickType minOccurs = 1, maxOccurs = 1 _________ */ + StickTypePtr getStickType() const; + void setStickType(const StickTypePtr &value); + + /* _________ StickMaterial minOccurs = 1, maxOccurs = 1 _________ */ + StickMaterialPtr getStickMaterial() const; + void setStickMaterial(const StickMaterialPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StickAttributesPtr myAttributes; + StickTypePtr myStickType; + StickMaterialPtr myStickMaterial; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StickAttributes.cpp b/Sourcecode/private/mx/core/elements/StickAttributes.cpp index 6361b39bc..e8eb6a350 100644 --- a/Sourcecode/private/mx/core/elements/StickAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/StickAttributes.cpp @@ -8,46 +8,44 @@ namespace mx { - namespace core - { - StickAttributes::StickAttributes() - :tip() - ,hasTip( false ) - {} - +namespace core +{ +StickAttributes::StickAttributes() : tip(), hasTip(false) +{ +} - bool StickAttributes::hasValues() const - { - return hasTip; - } +bool StickAttributes::hasValues() const +{ + return hasTip; +} +std::ostream &StickAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, tip, "tip", hasTip); + } + return os; +} - std::ostream& StickAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, tip, "tip", hasTip ); - } - return os; - } +bool StickAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "StickAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool StickAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, tip, hasTip, "tip", &parseTipDirection)) { - const char* const className = "StickAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, tip, hasTip, "tip", &parseTipDirection ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StickAttributes.h b/Sourcecode/private/mx/core/elements/StickAttributes.h index 4cbc6c34f..3319cd154 100644 --- a/Sourcecode/private/mx/core/elements/StickAttributes.h +++ b/Sourcecode/private/mx/core/elements/StickAttributes.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,22 +14,22 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StickAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(StickAttributes) - struct StickAttributes : public AttributesInterface - { - public: - StickAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TipDirection tip; - bool hasTip; +struct StickAttributes : public AttributesInterface +{ + public: + StickAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TipDirection tip; + bool hasTip; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StickLocation.cpp b/Sourcecode/private/mx/core/elements/StickLocation.cpp index a46c7a26a..b430890d7 100644 --- a/Sourcecode/private/mx/core/elements/StickLocation.cpp +++ b/Sourcecode/private/mx/core/elements/StickLocation.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - StickLocation::StickLocation() - :myValue( StickLocationEnum::center ) - {} - - - StickLocation::StickLocation( const StickLocationEnum& value ) - :myValue( value ) - {} - - - bool StickLocation::hasAttributes() const - { - return false; - } - - - bool StickLocation::hasContents() const - { - return true; - } - - - std::ostream& StickLocation::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StickLocation::streamName( std::ostream& os ) const - { - os << "stick-location"; - return os; - } +namespace core +{ +StickLocation::StickLocation() : myValue(StickLocationEnum::center) +{ +} +StickLocation::StickLocation(const StickLocationEnum &value) : myValue(value) +{ +} - std::ostream& StickLocation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool StickLocation::hasAttributes() const +{ + return false; +} +bool StickLocation::hasContents() const +{ + return true; +} - StickLocationEnum StickLocation::getValue() const - { - return myValue; - } +std::ostream &StickLocation::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &StickLocation::streamName(std::ostream &os) const +{ + os << "stick-location"; + return os; +} - void StickLocation::setValue( const StickLocationEnum& value ) - { - myValue = value; - } +std::ostream &StickLocation::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StickLocationEnum StickLocation::getValue() const +{ + return myValue; +} - bool StickLocation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStickLocationEnum( xelement.getValue() ); - return true; - } +void StickLocation::setValue(const StickLocationEnum &value) +{ + myValue = value; +} - } +bool StickLocation::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseStickLocationEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StickLocation.h b/Sourcecode/private/mx/core/elements/StickLocation.h index 138a493b0..1165a5b6f 100644 --- a/Sourcecode/private/mx/core/elements/StickLocation.h +++ b/Sourcecode/private/mx/core/elements/StickLocation.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StickLocation ) - - inline StickLocationPtr makeStickLocation() { return std::make_shared(); } - inline StickLocationPtr makeStickLocation( const StickLocationEnum& value ) { return std::make_shared( value ); } - inline StickLocationPtr makeStickLocation( StickLocationEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class StickLocation : public ElementInterface - { - public: - StickLocation(); - StickLocation( const StickLocationEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StickLocationEnum getValue() const; - void setValue( const StickLocationEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StickLocationEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(StickLocation) + +inline StickLocationPtr makeStickLocation() +{ + return std::make_shared(); +} + +inline StickLocationPtr makeStickLocation(const StickLocationEnum &value) +{ + return std::make_shared(value); } + +inline StickLocationPtr makeStickLocation(StickLocationEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class StickLocation : public ElementInterface +{ + public: + StickLocation(); + StickLocation(const StickLocationEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StickLocationEnum getValue() const; + void setValue(const StickLocationEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StickLocationEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StickMaterial.cpp b/Sourcecode/private/mx/core/elements/StickMaterial.cpp index bdc48984a..cd0f2a3bd 100644 --- a/Sourcecode/private/mx/core/elements/StickMaterial.cpp +++ b/Sourcecode/private/mx/core/elements/StickMaterial.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - StickMaterial::StickMaterial() - :myValue( StickMaterialEnum::medium ) - {} - - - StickMaterial::StickMaterial( const StickMaterialEnum& value ) - :myValue( value ) - {} - - - bool StickMaterial::hasAttributes() const - { - return false; - } - - - bool StickMaterial::hasContents() const - { - return true; - } - - - std::ostream& StickMaterial::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StickMaterial::streamName( std::ostream& os ) const - { - os << "stick-material"; - return os; - } +namespace core +{ +StickMaterial::StickMaterial() : myValue(StickMaterialEnum::medium) +{ +} +StickMaterial::StickMaterial(const StickMaterialEnum &value) : myValue(value) +{ +} - std::ostream& StickMaterial::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool StickMaterial::hasAttributes() const +{ + return false; +} +bool StickMaterial::hasContents() const +{ + return true; +} - StickMaterialEnum StickMaterial::getValue() const - { - return myValue; - } +std::ostream &StickMaterial::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &StickMaterial::streamName(std::ostream &os) const +{ + os << "stick-material"; + return os; +} - void StickMaterial::setValue( const StickMaterialEnum& value ) - { - myValue = value; - } +std::ostream &StickMaterial::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StickMaterialEnum StickMaterial::getValue() const +{ + return myValue; +} - bool StickMaterial::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStickMaterialEnum( xelement.getValue() ); - return true; - } +void StickMaterial::setValue(const StickMaterialEnum &value) +{ + myValue = value; +} - } +bool StickMaterial::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseStickMaterialEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StickMaterial.h b/Sourcecode/private/mx/core/elements/StickMaterial.h index 35c3acb33..c8dddb1fa 100644 --- a/Sourcecode/private/mx/core/elements/StickMaterial.h +++ b/Sourcecode/private/mx/core/elements/StickMaterial.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StickMaterial ) - - inline StickMaterialPtr makeStickMaterial() { return std::make_shared(); } - inline StickMaterialPtr makeStickMaterial( const StickMaterialEnum& value ) { return std::make_shared( value ); } - inline StickMaterialPtr makeStickMaterial( StickMaterialEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class StickMaterial : public ElementInterface - { - public: - StickMaterial(); - StickMaterial( const StickMaterialEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StickMaterialEnum getValue() const; - void setValue( const StickMaterialEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StickMaterialEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(StickMaterial) + +inline StickMaterialPtr makeStickMaterial() +{ + return std::make_shared(); +} + +inline StickMaterialPtr makeStickMaterial(const StickMaterialEnum &value) +{ + return std::make_shared(value); } + +inline StickMaterialPtr makeStickMaterial(StickMaterialEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class StickMaterial : public ElementInterface +{ + public: + StickMaterial(); + StickMaterial(const StickMaterialEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StickMaterialEnum getValue() const; + void setValue(const StickMaterialEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StickMaterialEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StickType.cpp b/Sourcecode/private/mx/core/elements/StickType.cpp index 4491855dd..eb02b9596 100644 --- a/Sourcecode/private/mx/core/elements/StickType.cpp +++ b/Sourcecode/private/mx/core/elements/StickType.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - StickType::StickType() - :myValue( StickTypeEnum::yarn ) - {} - - - StickType::StickType( const StickTypeEnum& value ) - :myValue( value ) - {} - - - bool StickType::hasAttributes() const - { - return false; - } - - - bool StickType::hasContents() const - { - return true; - } - - - std::ostream& StickType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StickType::streamName( std::ostream& os ) const - { - os << "stick-type"; - return os; - } +namespace core +{ +StickType::StickType() : myValue(StickTypeEnum::yarn) +{ +} +StickType::StickType(const StickTypeEnum &value) : myValue(value) +{ +} - std::ostream& StickType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool StickType::hasAttributes() const +{ + return false; +} +bool StickType::hasContents() const +{ + return true; +} - StickTypeEnum StickType::getValue() const - { - return myValue; - } +std::ostream &StickType::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &StickType::streamName(std::ostream &os) const +{ + os << "stick-type"; + return os; +} - void StickType::setValue( const StickTypeEnum& value ) - { - myValue = value; - } +std::ostream &StickType::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +StickTypeEnum StickType::getValue() const +{ + return myValue; +} - bool StickType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStickTypeEnum( xelement.getValue() ); - return true; - } +void StickType::setValue(const StickTypeEnum &value) +{ + myValue = value; +} - } +bool StickType::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + myValue = parseStickTypeEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StickType.h b/Sourcecode/private/mx/core/elements/StickType.h index ad8c69140..ec5a41a68 100644 --- a/Sourcecode/private/mx/core/elements/StickType.h +++ b/Sourcecode/private/mx/core/elements/StickType.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StickType ) - - inline StickTypePtr makeStickType() { return std::make_shared(); } - inline StickTypePtr makeStickType( const StickTypeEnum& value ) { return std::make_shared( value ); } - inline StickTypePtr makeStickType( StickTypeEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class StickType : public ElementInterface - { - public: - StickType(); - StickType( const StickTypeEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StickTypeEnum getValue() const; - void setValue( const StickTypeEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StickTypeEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(StickType) + +inline StickTypePtr makeStickType() +{ + return std::make_shared(); +} + +inline StickTypePtr makeStickType(const StickTypeEnum &value) +{ + return std::make_shared(value); } + +inline StickTypePtr makeStickType(StickTypeEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class StickType : public ElementInterface +{ + public: + StickType(); + StickType(const StickTypeEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StickTypeEnum getValue() const; + void setValue(const StickTypeEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StickTypeEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Stopped.cpp b/Sourcecode/private/mx/core/elements/Stopped.cpp index 7d755e244..971b89b16 100644 --- a/Sourcecode/private/mx/core/elements/Stopped.cpp +++ b/Sourcecode/private/mx/core/elements/Stopped.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Stopped::Stopped() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Stopped::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Stopped::hasContents() const { return false; } - std::ostream& Stopped::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Stopped::streamName( std::ostream& os ) const { os << "stopped"; return os; } - std::ostream& Stopped::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Stopped::Stopped() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Stopped::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Stopped::getAttributes() const - { - return myAttributes; - } +bool Stopped::hasContents() const +{ + return false; +} +std::ostream &Stopped::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Stopped::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Stopped::streamName(std::ostream &os) const +{ + os << "stopped"; + return os; +} +std::ostream &Stopped::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Stopped::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Stopped::getAttributes() const +{ + return myAttributes; +} +void Stopped::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Stopped::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Stopped.h b/Sourcecode/private/mx/core/elements/Stopped.h index 361f92a39..864bfba70 100644 --- a/Sourcecode/private/mx/core/elements/Stopped.h +++ b/Sourcecode/private/mx/core/elements/Stopped.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Stopped ) - - inline StoppedPtr makeStopped() { return std::make_shared(); } - - class Stopped : public ElementInterface - { - public: - Stopped(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Stopped) + +inline StoppedPtr makeStopped() +{ + return std::make_shared(); } + +class Stopped : public ElementInterface +{ + public: + Stopped(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Stress.cpp b/Sourcecode/private/mx/core/elements/Stress.cpp index 0c813af15..69b129c12 100644 --- a/Sourcecode/private/mx/core/elements/Stress.cpp +++ b/Sourcecode/private/mx/core/elements/Stress.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Stress::Stress() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Stress::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Stress::hasContents() const { return false; } - std::ostream& Stress::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Stress::streamName( std::ostream& os ) const { os << "stress"; return os; } - std::ostream& Stress::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Stress::Stress() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Stress::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Stress::getAttributes() const - { - return myAttributes; - } +bool Stress::hasContents() const +{ + return false; +} +std::ostream &Stress::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Stress::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Stress::streamName(std::ostream &os) const +{ + os << "stress"; + return os; +} +std::ostream &Stress::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Stress::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Stress::getAttributes() const +{ + return myAttributes; +} +void Stress::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Stress::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Stress.h b/Sourcecode/private/mx/core/elements/Stress.h index e8534582e..4685e962e 100644 --- a/Sourcecode/private/mx/core/elements/Stress.h +++ b/Sourcecode/private/mx/core/elements/Stress.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Stress ) - - inline StressPtr makeStress() { return std::make_shared(); } - - class Stress : public ElementInterface - { - public: - Stress(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Stress) + +inline StressPtr makeStress() +{ + return std::make_shared(); } + +class Stress : public ElementInterface +{ + public: + Stress(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/String.cpp b/Sourcecode/private/mx/core/elements/String.cpp index f9c14a04e..e65553e17 100644 --- a/Sourcecode/private/mx/core/elements/String.cpp +++ b/Sourcecode/private/mx/core/elements/String.cpp @@ -8,92 +8,75 @@ namespace mx { - namespace core - { - String::String() - :myAttributes( std::make_shared() ) - ,myValue() - { - - } - - - String::String( const StringNumber& value ) - :myAttributes( std::make_shared() ) - ,myValue( value ) - { - - } - - - bool String::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& String::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& String::streamName( std::ostream& os ) const - { - os << "string"; - return os; - } - - - bool String::hasContents() const - { - return true; - } - - - std::ostream& String::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - core::toStream( os, myValue ); - return os; - } +namespace core +{ +String::String() : myAttributes(std::make_shared()), myValue() +{ +} +String::String(const StringNumber &value) : myAttributes(std::make_shared()), myValue(value) +{ +} - StringAttributesPtr String::getAttributes() const - { - return myAttributes; - } +bool String::hasAttributes() const +{ + return myAttributes->hasValues(); +} +std::ostream &String::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} - void String::setAttributes( const StringAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &String::streamName(std::ostream &os) const +{ + os << "string"; + return os; +} +bool String::hasContents() const +{ + return true; +} - StringNumber String::getValue() const - { - return myValue; - } +std::ostream &String::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + core::toStream(os, myValue); + return os; +} +StringAttributesPtr String::getAttributes() const +{ + return myAttributes; +} - void String::setValue( const StringNumber& value ) - { - myValue = value; - } +void String::setAttributes(const StringAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +StringNumber String::getValue() const +{ + return myValue; +} - bool String::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void String::setValue(const StringNumber &value) +{ + myValue = value; +} - } +bool String::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.parse(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/String.h b/Sourcecode/private/mx/core/elements/String.h index f8be3c7d9..c2f63026f 100644 --- a/Sourcecode/private/mx/core/elements/String.h +++ b/Sourcecode/private/mx/core/elements/String.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/elements/StringAttributes.h" @@ -15,39 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StringAttributes ) - MX_FORWARD_DECLARE_ELEMENT( String ) - - inline StringPtr makeString() { return std::make_shared(); } - inline StringPtr makeString( const StringNumber& value ) { return std::make_shared( value ); } - inline StringPtr makeString( StringNumber&& value ) { return std::make_shared( std::move( value ) ); } - - - class String : public ElementInterface - { - public: - String(); - String( const StringNumber& value ); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StringAttributesPtr getAttributes() const; - void setAttributes( const StringAttributesPtr& value ); - StringNumber getValue() const; - void setValue( const StringNumber& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StringAttributesPtr myAttributes; - StringNumber myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(StringAttributes) +MX_FORWARD_DECLARE_ELEMENT(String) + +inline StringPtr makeString() +{ + return std::make_shared(); +} + +inline StringPtr makeString(const StringNumber &value) +{ + return std::make_shared(value); } + +inline StringPtr makeString(StringNumber &&value) +{ + return std::make_shared(std::move(value)); +} + +class String : public ElementInterface +{ + public: + String(); + String(const StringNumber &value); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StringAttributesPtr getAttributes() const; + void setAttributes(const StringAttributesPtr &value); + StringNumber getValue() const; + void setValue(const StringNumber &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StringAttributesPtr myAttributes; + StringNumber myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StringAttributes.cpp b/Sourcecode/private/mx/core/elements/StringAttributes.cpp index ead8b8bfe..55534e29c 100644 --- a/Sourcecode/private/mx/core/elements/StringAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/StringAttributes.cpp @@ -8,91 +8,95 @@ namespace mx { - namespace core +namespace core +{ +StringAttributes::StringAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), placement(AboveBelow::below), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), hasPlacement(false) +{ +} + +bool StringAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPlacement; +} + +std::ostream &StringAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - StringAttributes::StringAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool StringAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "StringAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool StringAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; + continue; } - - - std::ostream& StringAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool StringAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "StringAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StringAttributes.h b/Sourcecode/private/mx/core/elements/StringAttributes.h index a1e6d0eda..39b69bf86 100644 --- a/Sourcecode/private/mx/core/elements/StringAttributes.h +++ b/Sourcecode/private/mx/core/elements/StringAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,40 +18,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StringAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(StringAttributes) - struct StringAttributes : public AttributesInterface - { - public: - StringAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; +struct StringAttributes : public AttributesInterface +{ + public: + StringAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StringMute.cpp b/Sourcecode/private/mx/core/elements/StringMute.cpp index 0d2e8c716..1fdd2ddf0 100644 --- a/Sourcecode/private/mx/core/elements/StringMute.cpp +++ b/Sourcecode/private/mx/core/elements/StringMute.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - StringMute::StringMute() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool StringMute::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool StringMute::hasContents() const { return false; } - std::ostream& StringMute::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& StringMute::streamName( std::ostream& os ) const { os << "string-mute"; return os; } - std::ostream& StringMute::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +StringMute::StringMute() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool StringMute::hasAttributes() const +{ + return myAttributes->hasValues(); +} - StringMuteAttributesPtr StringMute::getAttributes() const - { - return myAttributes; - } +bool StringMute::hasContents() const +{ + return false; +} +std::ostream &StringMute::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void StringMute::setAttributes( const StringMuteAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &StringMute::streamName(std::ostream &os) const +{ + os << "string-mute"; + return os; +} +std::ostream &StringMute::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool StringMute::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +StringMuteAttributesPtr StringMute::getAttributes() const +{ + return myAttributes; +} +void StringMute::setAttributes(const StringMuteAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool StringMute::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StringMute.h b/Sourcecode/private/mx/core/elements/StringMute.h index f7acec20b..feee3caf3 100644 --- a/Sourcecode/private/mx/core/elements/StringMute.h +++ b/Sourcecode/private/mx/core/elements/StringMute.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/StringMuteAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StringMuteAttributes ) - MX_FORWARD_DECLARE_ELEMENT( StringMute ) - - inline StringMutePtr makeStringMute() { return std::make_shared(); } - - class StringMute : public ElementInterface - { - public: - StringMute(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StringMuteAttributesPtr getAttributes() const; - void setAttributes( const StringMuteAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StringMuteAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(StringMuteAttributes) +MX_FORWARD_DECLARE_ELEMENT(StringMute) + +inline StringMutePtr makeStringMute() +{ + return std::make_shared(); } + +class StringMute : public ElementInterface +{ + public: + StringMute(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StringMuteAttributesPtr getAttributes() const; + void setAttributes(const StringMuteAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StringMuteAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp b/Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp index 33434f8ba..235aa2f42 100644 --- a/Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp @@ -8,97 +8,102 @@ namespace mx { - namespace core +namespace core +{ +StringMuteAttributes::StringMuteAttributes() + : type(OnOff::on), defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), halign(LeftCenterRight::center), hasType(true), + hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), + hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasHalign(false) +{ +} + +bool StringMuteAttributes::hasValues() const +{ + return hasType || hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || + hasFontSize || hasFontWeight || hasHalign; +} + +std::ostream &StringMuteAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - StringMuteAttributes::StringMuteAttributes() - :type( OnOff::on ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,halign( LeftCenterRight::center ) - ,hasType( true ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, halign, "halign", hasHalign); + } + return os; +} + +bool StringMuteAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "StringMuteAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool StringMuteAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseOnOff)) { - return hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; + continue; } - - - std::ostream& StringMuteAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; + continue; } - - - bool StringMuteAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - const char* const className = "StringMuteAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseOnOff ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + continue; } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight)) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StringMuteAttributes.h b/Sourcecode/private/mx/core/elements/StringMuteAttributes.h index a2aa9876b..94f122db3 100644 --- a/Sourcecode/private/mx/core/elements/StringMuteAttributes.h +++ b/Sourcecode/private/mx/core/elements/StringMuteAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,40 +17,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StringMuteAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(StringMuteAttributes) - struct StringMuteAttributes : public AttributesInterface - { - public: - StringMuteAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - OnOff type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - const bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; +struct StringMuteAttributes : public AttributesInterface +{ + public: + StringMuteAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + OnOff type; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + LeftCenterRight halign; + const bool hasType; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasHalign; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StrongAccent.cpp b/Sourcecode/private/mx/core/elements/StrongAccent.cpp index 7c581f891..9cdb5ec6d 100644 --- a/Sourcecode/private/mx/core/elements/StrongAccent.cpp +++ b/Sourcecode/private/mx/core/elements/StrongAccent.cpp @@ -8,65 +8,57 @@ namespace mx { - namespace core - { - StrongAccent::StrongAccent() - :myAttributes( std::make_shared() ) - {} - - - bool StrongAccent::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& StrongAccent::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& StrongAccent::streamName( std::ostream& os ) const - { - os << "strong-accent"; - return os; - } - - - bool StrongAccent::hasContents() const - { - return false; - } - - - std::ostream& StrongAccent::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +StrongAccent::StrongAccent() : myAttributes(std::make_shared()) +{ +} +bool StrongAccent::hasAttributes() const +{ + return myAttributes->hasValues(); +} - StrongAccentAttributesPtr StrongAccent::getAttributes() const - { - return myAttributes; - } +std::ostream &StrongAccent::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &StrongAccent::streamName(std::ostream &os) const +{ + os << "strong-accent"; + return os; +} - void StrongAccent::setAttributes( const StrongAccentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +bool StrongAccent::hasContents() const +{ + return false; +} +std::ostream &StrongAccent::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool StrongAccent::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +StrongAccentAttributesPtr StrongAccent::getAttributes() const +{ + return myAttributes; +} +void StrongAccent::setAttributes(const StrongAccentAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool StrongAccent::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StrongAccent.h b/Sourcecode/private/mx/core/elements/StrongAccent.h index bdf9d0785..3669fbe98 100644 --- a/Sourcecode/private/mx/core/elements/StrongAccent.h +++ b/Sourcecode/private/mx/core/elements/StrongAccent.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/StrongAccentAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StrongAccentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( StrongAccent ) - - inline StrongAccentPtr makeStrongAccent() { return std::make_shared(); } - - class StrongAccent : public ElementInterface - { - public: - StrongAccent(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StrongAccentAttributesPtr getAttributes() const; - void setAttributes( const StrongAccentAttributesPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StrongAccentAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(StrongAccentAttributes) +MX_FORWARD_DECLARE_ELEMENT(StrongAccent) + +inline StrongAccentPtr makeStrongAccent() +{ + return std::make_shared(); } + +class StrongAccent : public ElementInterface +{ + public: + StrongAccent(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + StrongAccentAttributesPtr getAttributes() const; + void setAttributes(const StrongAccentAttributesPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + StrongAccentAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp b/Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp index c6230e564..9178a294f 100644 --- a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp @@ -8,96 +8,101 @@ namespace mx { - namespace core +namespace core +{ +StrongAccentAttributes::StrongAccentAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(CssFontSize::medium), fontWeight(FontWeight::normal), color(), placement(AboveBelow::below), + type(UpDown::up), hasDefaultX(false), hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), + hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), hasColor(false), + hasPlacement(false), hasType(false) +{ +} + +bool StrongAccentAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasColor || hasPlacement || hasType; +} + +std::ostream &StrongAccentAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - StrongAccentAttributes::StrongAccentAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,type( UpDown::up ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - ,hasType( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, color, "color", hasColor); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, type, "type", hasType); + } + return os; +} + +bool StrongAccentAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "StrongAccentAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool StrongAccentAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement || - hasType; + continue; } - - - std::ostream& StrongAccentAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, type, "type", hasType ); - } - return os; + continue; } - - - bool StrongAccentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "StrongAccentAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseUpDown ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, type, hasType, "type", &parseUpDown)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.h b/Sourcecode/private/mx/core/elements/StrongAccentAttributes.h index 0293e8f5d..d2a88e881 100644 --- a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.h +++ b/Sourcecode/private/mx/core/elements/StrongAccentAttributes.h @@ -4,13 +4,13 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/Color.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -18,42 +18,42 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( StrongAccentAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(StrongAccentAttributes) - struct StrongAccentAttributes : public AttributesInterface - { - public: - StrongAccentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - UpDown type; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - bool hasType; +struct StrongAccentAttributes : public AttributesInterface +{ + public: + StrongAccentAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + Color color; + AboveBelow placement; + UpDown type; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasColor; + bool hasPlacement; + bool hasType; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Suffix.cpp b/Sourcecode/private/mx/core/elements/Suffix.cpp index ef16e6a94..ac7b3fced 100644 --- a/Sourcecode/private/mx/core/elements/Suffix.cpp +++ b/Sourcecode/private/mx/core/elements/Suffix.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Suffix::Suffix() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Suffix::Suffix( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Suffix::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Suffix::hasContents() const - { - return true; - } - - - std::ostream& Suffix::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Suffix::streamName( std::ostream& os ) const - { - os << "suffix"; - return os; - } - - - std::ostream& Suffix::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Suffix::Suffix() : myValue(), myAttributes(std::make_shared()) +{ +} +Suffix::Suffix(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - SuffixAttributesPtr Suffix::getAttributes() const - { - return myAttributes; - } +bool Suffix::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Suffix::hasContents() const +{ + return true; +} - void Suffix::setAttributes( const SuffixAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Suffix::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Suffix::streamName(std::ostream &os) const +{ + os << "suffix"; + return os; +} - XsString Suffix::getValue() const - { - return myValue; - } +std::ostream &Suffix::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +SuffixAttributesPtr Suffix::getAttributes() const +{ + return myAttributes; +} - void Suffix::setValue( const XsString& value ) - { - myValue = value; - } +void Suffix::setAttributes(const SuffixAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Suffix::getValue() const +{ + return myValue; +} - bool Suffix::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Suffix::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Suffix::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Suffix.h b/Sourcecode/private/mx/core/elements/Suffix.h index dacc3df3b..135b5242f 100644 --- a/Sourcecode/private/mx/core/elements/Suffix.h +++ b/Sourcecode/private/mx/core/elements/Suffix.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/SuffixAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SuffixAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Suffix ) - - inline SuffixPtr makeSuffix() { return std::make_shared(); } - inline SuffixPtr makeSuffix( const XsString& value ) { return std::make_shared( value ); } - inline SuffixPtr makeSuffix( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Suffix : public ElementInterface - { - public: - Suffix(); - Suffix( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SuffixAttributesPtr getAttributes() const; - void setAttributes( const SuffixAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - SuffixAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(SuffixAttributes) +MX_FORWARD_DECLARE_ELEMENT(Suffix) + +inline SuffixPtr makeSuffix() +{ + return std::make_shared(); +} + +inline SuffixPtr makeSuffix(const XsString &value) +{ + return std::make_shared(value); } + +inline SuffixPtr makeSuffix(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Suffix : public ElementInterface +{ + public: + Suffix(); + Suffix(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + SuffixAttributesPtr getAttributes() const; + void setAttributes(const SuffixAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + SuffixAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SuffixAttributes.cpp b/Sourcecode/private/mx/core/elements/SuffixAttributes.cpp index 02ac2a1e9..6ea127ae1 100644 --- a/Sourcecode/private/mx/core/elements/SuffixAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/SuffixAttributes.cpp @@ -8,81 +8,85 @@ namespace mx { - namespace core +namespace core +{ +SuffixAttributes::SuffixAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), + hasFontWeight(false) +{ +} + +bool SuffixAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight; +} + +std::ostream &SuffixAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - SuffixAttributes::SuffixAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + } + return os; +} + +bool SuffixAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "SuffixAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool SuffixAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; + continue; } - - - std::ostream& SuffixAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; + continue; } - - - bool SuffixAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "SuffixAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SuffixAttributes.h b/Sourcecode/private/mx/core/elements/SuffixAttributes.h index fa460c3ee..d9f3a2fec 100644 --- a/Sourcecode/private/mx/core/elements/SuffixAttributes.h +++ b/Sourcecode/private/mx/core/elements/SuffixAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,36 +17,36 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( SuffixAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(SuffixAttributes) - struct SuffixAttributes : public AttributesInterface - { - public: - SuffixAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; +struct SuffixAttributes : public AttributesInterface +{ + public: + SuffixAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Supports.cpp b/Sourcecode/private/mx/core/elements/Supports.cpp index 86b56b9d7..165d30b48 100644 --- a/Sourcecode/private/mx/core/elements/Supports.cpp +++ b/Sourcecode/private/mx/core/elements/Supports.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Supports::Supports() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Supports::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Supports::hasContents() const { return false; } - std::ostream& Supports::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Supports::streamName( std::ostream& os ) const { os << "supports"; return os; } - std::ostream& Supports::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Supports::Supports() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Supports::hasAttributes() const +{ + return myAttributes->hasValues(); +} - SupportsAttributesPtr Supports::getAttributes() const - { - return myAttributes; - } +bool Supports::hasContents() const +{ + return false; +} +std::ostream &Supports::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Supports::setAttributes( const SupportsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Supports::streamName(std::ostream &os) const +{ + os << "supports"; + return os; +} +std::ostream &Supports::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Supports::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +SupportsAttributesPtr Supports::getAttributes() const +{ + return myAttributes; +} +void Supports::setAttributes(const SupportsAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Supports::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Supports.h b/Sourcecode/private/mx/core/elements/Supports.h index bdacda54c..c3c131f62 100644 --- a/Sourcecode/private/mx/core/elements/Supports.h +++ b/Sourcecode/private/mx/core/elements/Supports.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/SupportsAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SupportsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Supports ) - - inline SupportsPtr makeSupports() { return std::make_shared(); } - - class Supports : public ElementInterface - { - public: - Supports(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SupportsAttributesPtr getAttributes() const; - void setAttributes( const SupportsAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SupportsAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(SupportsAttributes) +MX_FORWARD_DECLARE_ELEMENT(Supports) + +inline SupportsPtr makeSupports() +{ + return std::make_shared(); } + +class Supports : public ElementInterface +{ + public: + Supports(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + SupportsAttributesPtr getAttributes() const; + void setAttributes(const SupportsAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + SupportsAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SupportsAttributes.cpp b/Sourcecode/private/mx/core/elements/SupportsAttributes.cpp index c3b7dbda0..5dc4423c5 100644 --- a/Sourcecode/private/mx/core/elements/SupportsAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/SupportsAttributes.cpp @@ -8,73 +8,74 @@ namespace mx { - namespace core +namespace core +{ +SupportsAttributes::SupportsAttributes() + : type(YesNo::no), element(), attribute(), value(), hasType(true), hasElement(true), hasAttribute(false), + hasValue(false) +{ +} + +bool SupportsAttributes::hasValues() const +{ + return hasType || hasElement || hasAttribute || hasValue; +} + +std::ostream &SupportsAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - SupportsAttributes::SupportsAttributes() - :type( YesNo::no ) - ,element() - ,attribute() - ,value() - ,hasType( true ) - ,hasElement( true ) - ,hasAttribute( false ) - ,hasValue( false ) - {} + streamAttribute(os, type, "type", hasType); + streamAttribute(os, element, "element", hasElement); + streamAttribute(os, attribute, "attribute", hasAttribute); + streamAttribute(os, value, "value", hasValue); + } + return os; +} +bool SupportsAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "SupportsAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + bool isElementFound = false; + + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool SupportsAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseYesNo)) { - return hasType || - hasElement || - hasAttribute || - hasValue; + continue; } - - - std::ostream& SupportsAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, element, isElementFound, "element")) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, element, "element", hasElement ); - streamAttribute( os, attribute, "attribute", hasAttribute ); - streamAttribute( os, value, "value", hasValue ); - } - return os; + continue; } - - - bool SupportsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, attribute, hasAttribute, "attribute")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, value, hasValue, "value")) { - const char* const className = "SupportsAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - bool isElementFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, element, isElementFound, "element" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, attribute, hasAttribute, "attribute" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, value, hasValue, "value" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isElementFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; + } + if (!isElementFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SupportsAttributes.h b/Sourcecode/private/mx/core/elements/SupportsAttributes.h index 6656edd7e..63661f7b2 100644 --- a/Sourcecode/private/mx/core/elements/SupportsAttributes.h +++ b/Sourcecode/private/mx/core/elements/SupportsAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsNMToken.h" #include "mx/core/XsToken.h" @@ -17,28 +17,28 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( SupportsAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(SupportsAttributes) - struct SupportsAttributes : public AttributesInterface - { - public: - SupportsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo type; - XsNMToken element; - XsNMToken attribute; - XsToken value; - const bool hasType; - const bool hasElement; - bool hasAttribute; - bool hasValue; +struct SupportsAttributes : public AttributesInterface +{ + public: + SupportsAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + YesNo type; + XsNMToken element; + XsNMToken attribute; + XsToken value; + const bool hasType; + const bool hasElement; + bool hasAttribute; + bool hasValue; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Syllabic.cpp b/Sourcecode/private/mx/core/elements/Syllabic.cpp index c0cbf2802..d21daec3f 100644 --- a/Sourcecode/private/mx/core/elements/Syllabic.cpp +++ b/Sourcecode/private/mx/core/elements/Syllabic.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Syllabic::Syllabic() - :myValue( SyllabicEnum::begin ) - {} - - - Syllabic::Syllabic( const SyllabicEnum& value ) - :myValue( value ) - {} - - - bool Syllabic::hasAttributes() const - { - return false; - } - - - bool Syllabic::hasContents() const - { - return true; - } - - - std::ostream& Syllabic::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Syllabic::streamName( std::ostream& os ) const - { - os << "syllabic"; - return os; - } +namespace core +{ +Syllabic::Syllabic() : myValue(SyllabicEnum::begin) +{ +} +Syllabic::Syllabic(const SyllabicEnum &value) : myValue(value) +{ +} - std::ostream& Syllabic::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Syllabic::hasAttributes() const +{ + return false; +} +bool Syllabic::hasContents() const +{ + return true; +} - SyllabicEnum Syllabic::getValue() const - { - return myValue; - } +std::ostream &Syllabic::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Syllabic::streamName(std::ostream &os) const +{ + os << "syllabic"; + return os; +} - void Syllabic::setValue( const SyllabicEnum& value ) - { - myValue = value; - } +std::ostream &Syllabic::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +SyllabicEnum Syllabic::getValue() const +{ + return myValue; +} - bool Syllabic::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseSyllabicEnum( xelement.getValue() ); - return true; - } +void Syllabic::setValue(const SyllabicEnum &value) +{ + myValue = value; +} - } +bool Syllabic::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue = parseSyllabicEnum(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Syllabic.h b/Sourcecode/private/mx/core/elements/Syllabic.h index de8846ee8..6e029ebfe 100644 --- a/Sourcecode/private/mx/core/elements/Syllabic.h +++ b/Sourcecode/private/mx/core/elements/Syllabic.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Syllabic ) - - inline SyllabicPtr makeSyllabic() { return std::make_shared(); } - inline SyllabicPtr makeSyllabic( const SyllabicEnum& value ) { return std::make_shared( value ); } - inline SyllabicPtr makeSyllabic( SyllabicEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Syllabic : public ElementInterface - { - public: - Syllabic(); - Syllabic( const SyllabicEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SyllabicEnum getValue() const; - void setValue( const SyllabicEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SyllabicEnum myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Syllabic) + +inline SyllabicPtr makeSyllabic() +{ + return std::make_shared(); +} + +inline SyllabicPtr makeSyllabic(const SyllabicEnum &value) +{ + return std::make_shared(value); } + +inline SyllabicPtr makeSyllabic(SyllabicEnum &&value) +{ + return std::make_shared(std::move(value)); +} + +class Syllabic : public ElementInterface +{ + public: + Syllabic(); + Syllabic(const SyllabicEnum &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + SyllabicEnum getValue() const; + void setValue(const SyllabicEnum &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + SyllabicEnum myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp b/Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp index d684a0f75..0bdc36081 100644 --- a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp +++ b/Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp @@ -12,176 +12,153 @@ namespace mx { - namespace core - { - SyllabicTextGroup::SyllabicTextGroup() - :mySyllabic( makeSyllabic() ) - ,myHasSyllabic( false ) - ,myText( makeText() ) - ,myElisionSyllabicTextGroupSet() - ,myExtend( makeExtend() ) - ,myHasExtend( false ) - {} - - - bool SyllabicTextGroup::hasAttributes() const - { - return false; - } - - - std::ostream& SyllabicTextGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SyllabicTextGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool SyllabicTextGroup::hasContents() const - { - return true; - } - - - std::ostream& SyllabicTextGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = true; - if ( myHasSyllabic ) - { - mySyllabic->toStream( os, indentLevel ); - os << std::endl; - } - myText->toStream( os, indentLevel ); - for ( auto x : myElisionSyllabicTextGroupSet ) - { - os << std::endl; - x->streamContents( os, indentLevel, isOneLineOnly ); - } - if ( myHasExtend ) - { - os << std::endl; - myExtend->toStream( os, indentLevel ); - } - isOneLineOnly = ! ( myHasSyllabic || myElisionSyllabicTextGroupSet.size() > 0 || myHasExtend ); - return os; - } - - - SyllabicPtr SyllabicTextGroup::getSyllabic() const - { - return mySyllabic; - } - - - void SyllabicTextGroup::setSyllabic( const SyllabicPtr& value ) - { - if ( value ) - { - mySyllabic = value; - } - } - - - bool SyllabicTextGroup::getHasSyllabic() const - { - return myHasSyllabic; - } - - - void SyllabicTextGroup::setHasSyllabic( const bool value ) - { - myHasSyllabic = value; - } - - - TextPtr SyllabicTextGroup::getText() const - { - return myText; - } - +namespace core +{ +SyllabicTextGroup::SyllabicTextGroup() + : mySyllabic(makeSyllabic()), myHasSyllabic(false), myText(makeText()), myElisionSyllabicTextGroupSet(), + myExtend(makeExtend()), myHasExtend(false) +{ +} - void SyllabicTextGroup::setText( const TextPtr& value ) - { - if ( value ) - { - myText = value; - } - } +bool SyllabicTextGroup::hasAttributes() const +{ + return false; +} +std::ostream &SyllabicTextGroup::streamAttributes(std::ostream &os) const +{ + return os; +} - const ElisionSyllabicTextGroupSet& SyllabicTextGroup::getElisionSyllabicTextGroupSet() const - { - return myElisionSyllabicTextGroupSet; - } +std::ostream &SyllabicTextGroup::streamName(std::ostream &os) const +{ + return os; +} +bool SyllabicTextGroup::hasContents() const +{ + return true; +} - void SyllabicTextGroup::addElisionSyllabicTextGroup( const ElisionSyllabicTextGroupPtr& value ) - { - if ( value ) - { - myElisionSyllabicTextGroupSet.push_back( value ); - } - } +std::ostream &SyllabicTextGroup::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = true; + if (myHasSyllabic) + { + mySyllabic->toStream(os, indentLevel); + os << std::endl; + } + myText->toStream(os, indentLevel); + for (auto x : myElisionSyllabicTextGroupSet) + { + os << std::endl; + x->streamContents(os, indentLevel, isOneLineOnly); + } + if (myHasExtend) + { + os << std::endl; + myExtend->toStream(os, indentLevel); + } + isOneLineOnly = !(myHasSyllabic || myElisionSyllabicTextGroupSet.size() > 0 || myHasExtend); + return os; +} +SyllabicPtr SyllabicTextGroup::getSyllabic() const +{ + return mySyllabic; +} - void SyllabicTextGroup::removeElisionSyllabicTextGroup( const ElisionSyllabicTextGroupSetIterConst& value ) - { - if ( value != myElisionSyllabicTextGroupSet.cend() ) - { - myElisionSyllabicTextGroupSet.erase( value ); - } - } +void SyllabicTextGroup::setSyllabic(const SyllabicPtr &value) +{ + if (value) + { + mySyllabic = value; + } +} +bool SyllabicTextGroup::getHasSyllabic() const +{ + return myHasSyllabic; +} - void SyllabicTextGroup::clearElisionSyllabicTextGroupSet() - { - myElisionSyllabicTextGroupSet.clear(); - } +void SyllabicTextGroup::setHasSyllabic(const bool value) +{ + myHasSyllabic = value; +} +TextPtr SyllabicTextGroup::getText() const +{ + return myText; +} - ElisionSyllabicTextGroupPtr SyllabicTextGroup::getElisionSyllabicTextGroup( const ElisionSyllabicTextGroupSetIterConst& setIterator ) const - { - if( setIterator != myElisionSyllabicTextGroupSet.cend() ) - { - return *setIterator; - } - return ElisionSyllabicTextGroupPtr(); - } +void SyllabicTextGroup::setText(const TextPtr &value) +{ + if (value) + { + myText = value; + } +} +const ElisionSyllabicTextGroupSet &SyllabicTextGroup::getElisionSyllabicTextGroupSet() const +{ + return myElisionSyllabicTextGroupSet; +} - ExtendPtr SyllabicTextGroup::getExtend() const - { - return myExtend; - } +void SyllabicTextGroup::addElisionSyllabicTextGroup(const ElisionSyllabicTextGroupPtr &value) +{ + if (value) + { + myElisionSyllabicTextGroupSet.push_back(value); + } +} +void SyllabicTextGroup::removeElisionSyllabicTextGroup(const ElisionSyllabicTextGroupSetIterConst &value) +{ + if (value != myElisionSyllabicTextGroupSet.cend()) + { + myElisionSyllabicTextGroupSet.erase(value); + } +} - void SyllabicTextGroup::setExtend( const ExtendPtr& value ) - { - if ( value ) - { - myExtend = value; - } - } +void SyllabicTextGroup::clearElisionSyllabicTextGroupSet() +{ + myElisionSyllabicTextGroupSet.clear(); +} +ElisionSyllabicTextGroupPtr SyllabicTextGroup::getElisionSyllabicTextGroup( + const ElisionSyllabicTextGroupSetIterConst &setIterator) const +{ + if (setIterator != myElisionSyllabicTextGroupSet.cend()) + { + return *setIterator; + } + return ElisionSyllabicTextGroupPtr(); +} - bool SyllabicTextGroup::getHasExtend() const - { - return myHasExtend; - } +ExtendPtr SyllabicTextGroup::getExtend() const +{ + return myExtend; +} +void SyllabicTextGroup::setExtend(const ExtendPtr &value) +{ + if (value) + { + myExtend = value; + } +} - void SyllabicTextGroup::setHasExtend( const bool value ) - { - myHasExtend = value; - } +bool SyllabicTextGroup::getHasExtend() const +{ + return myHasExtend; +} +void SyllabicTextGroup::setHasExtend(const bool value) +{ + myHasExtend = value; +} - MX_FROM_XELEMENT_UNUSED( SyllabicTextGroup ); +MX_FROM_XELEMENT_UNUSED(SyllabicTextGroup); - } -} +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.h b/Sourcecode/private/mx/core/elements/SyllabicTextGroup.h index 0498c151a..3ddc2657b 100644 --- a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.h +++ b/Sourcecode/private/mx/core/elements/SyllabicTextGroup.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,61 +13,65 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( ElisionSyllabicTextGroup ) - MX_FORWARD_DECLARE_ELEMENT( Extend ) - MX_FORWARD_DECLARE_ELEMENT( Syllabic ) - MX_FORWARD_DECLARE_ELEMENT( Text ) - MX_FORWARD_DECLARE_ELEMENT( SyllabicTextGroup ) +MX_FORWARD_DECLARE_ELEMENT(ElisionSyllabicTextGroup) +MX_FORWARD_DECLARE_ELEMENT(Extend) +MX_FORWARD_DECLARE_ELEMENT(Syllabic) +MX_FORWARD_DECLARE_ELEMENT(Text) +MX_FORWARD_DECLARE_ELEMENT(SyllabicTextGroup) - inline SyllabicTextGroupPtr makeSyllabicTextGroup() { return std::make_shared(); } +inline SyllabicTextGroupPtr makeSyllabicTextGroup() +{ + return std::make_shared(); +} - class SyllabicTextGroup : public ElementInterface - { - public: - SyllabicTextGroup(); +class SyllabicTextGroup : public ElementInterface +{ + public: + SyllabicTextGroup(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ Syllabic minOccurs = 0, maxOccurs = 1 _________ */ - SyllabicPtr getSyllabic() const; - void setSyllabic( const SyllabicPtr& value ); - bool getHasSyllabic() const; - void setHasSyllabic( const bool value ); + /* _________ Syllabic minOccurs = 0, maxOccurs = 1 _________ */ + SyllabicPtr getSyllabic() const; + void setSyllabic(const SyllabicPtr &value); + bool getHasSyllabic() const; + void setHasSyllabic(const bool value); - /* _________ Text minOccurs = 1, maxOccurs = 1 _________ */ - TextPtr getText() const; - void setText( const TextPtr& value ); + /* _________ Text minOccurs = 1, maxOccurs = 1 _________ */ + TextPtr getText() const; + void setText(const TextPtr &value); - /* _________ ElisionSyllabicTextGroup minOccurs = 0, maxOccurs = unbounded _________ */ - const ElisionSyllabicTextGroupSet& getElisionSyllabicTextGroupSet() const; - void addElisionSyllabicTextGroup( const ElisionSyllabicTextGroupPtr& value ); - void removeElisionSyllabicTextGroup( const ElisionSyllabicTextGroupSetIterConst& value ); - void clearElisionSyllabicTextGroupSet(); - ElisionSyllabicTextGroupPtr getElisionSyllabicTextGroup( const ElisionSyllabicTextGroupSetIterConst& setIterator ) const; + /* _________ ElisionSyllabicTextGroup minOccurs = 0, maxOccurs = unbounded _________ */ + const ElisionSyllabicTextGroupSet &getElisionSyllabicTextGroupSet() const; + void addElisionSyllabicTextGroup(const ElisionSyllabicTextGroupPtr &value); + void removeElisionSyllabicTextGroup(const ElisionSyllabicTextGroupSetIterConst &value); + void clearElisionSyllabicTextGroupSet(); + ElisionSyllabicTextGroupPtr getElisionSyllabicTextGroup( + const ElisionSyllabicTextGroupSetIterConst &setIterator) const; - /* _________ Extend minOccurs = 0, maxOccurs = 1 _________ */ - ExtendPtr getExtend() const; - void setExtend( const ExtendPtr& value ); - bool getHasExtend() const; - void setHasExtend( const bool value ); + /* _________ Extend minOccurs = 0, maxOccurs = 1 _________ */ + ExtendPtr getExtend() const; + void setExtend(const ExtendPtr &value); + bool getHasExtend() const; + void setHasExtend(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - SyllabicPtr mySyllabic; - bool myHasSyllabic; - TextPtr myText; - ElisionSyllabicTextGroupSet myElisionSyllabicTextGroupSet; - ExtendPtr myExtend; - bool myHasExtend; - }; - } -} + private: + SyllabicPtr mySyllabic; + bool myHasSyllabic; + TextPtr myText; + ElisionSyllabicTextGroupSet myElisionSyllabicTextGroupSet; + ExtendPtr myExtend; + bool myHasExtend; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SystemDistance.cpp b/Sourcecode/private/mx/core/elements/SystemDistance.cpp index c9dffd4bd..1aa3656bc 100644 --- a/Sourcecode/private/mx/core/elements/SystemDistance.cpp +++ b/Sourcecode/private/mx/core/elements/SystemDistance.cpp @@ -8,70 +8,61 @@ namespace mx { - namespace core - { - SystemDistance::SystemDistance() - :myValue() - {} - - - SystemDistance::SystemDistance( const TenthsValue& value ) - :myValue( value ) - {} - - - bool SystemDistance::hasAttributes() const - { - return false; - } - - - bool SystemDistance::hasContents() const - { - return true; - } - - - std::ostream& SystemDistance::streamAttributes( std::ostream& os ) const - { - return os; - } - +namespace core +{ +SystemDistance::SystemDistance() : myValue() +{ +} - std::ostream& SystemDistance::streamName( std::ostream& os ) const - { - os << "system-distance"; - return os; - } +SystemDistance::SystemDistance(const TenthsValue &value) : myValue(value) +{ +} +bool SystemDistance::hasAttributes() const +{ + return false; +} - std::ostream& SystemDistance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool SystemDistance::hasContents() const +{ + return true; +} +std::ostream &SystemDistance::streamAttributes(std::ostream &os) const +{ + return os; +} - TenthsValue SystemDistance::getValue() const - { - return myValue; - } +std::ostream &SystemDistance::streamName(std::ostream &os) const +{ + os << "system-distance"; + return os; +} +std::ostream &SystemDistance::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} - void SystemDistance::setValue( const TenthsValue& value ) - { - myValue = value; - } +TenthsValue SystemDistance::getValue() const +{ + return myValue; +} +void SystemDistance::setValue(const TenthsValue &value) +{ + myValue = value; +} - bool SystemDistance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - } +bool SystemDistance::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SystemDistance.h b/Sourcecode/private/mx/core/elements/SystemDistance.h index 6937b0c8e..4bb0ae52b 100644 --- a/Sourcecode/private/mx/core/elements/SystemDistance.h +++ b/Sourcecode/private/mx/core/elements/SystemDistance.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SystemDistance ) - - inline SystemDistancePtr makeSystemDistance() { return std::make_shared(); } - inline SystemDistancePtr makeSystemDistance( const TenthsValue& value ) { return std::make_shared( value ); } - inline SystemDistancePtr makeSystemDistance( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class SystemDistance : public ElementInterface - { - public: - SystemDistance(); - SystemDistance( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(SystemDistance) + +inline SystemDistancePtr makeSystemDistance() +{ + return std::make_shared(); } + +inline SystemDistancePtr makeSystemDistance(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline SystemDistancePtr makeSystemDistance(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class SystemDistance : public ElementInterface +{ + public: + SystemDistance(); + SystemDistance(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SystemDividers.cpp b/Sourcecode/private/mx/core/elements/SystemDividers.cpp index 1b897443b..0fd1f777b 100644 --- a/Sourcecode/private/mx/core/elements/SystemDividers.cpp +++ b/Sourcecode/private/mx/core/elements/SystemDividers.cpp @@ -10,104 +10,101 @@ namespace mx { - namespace core - { - SystemDividers::SystemDividers() - :myLeftDivider( makeLeftDivider() ) - ,myRightDivider( makeRightDivider() ) - {} - - - bool SystemDividers::hasAttributes() const - { - return false; - } - - - std::ostream& SystemDividers::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SystemDividers::streamName( std::ostream& os ) const - { - os << "system-dividers"; - return os; - } - +namespace core +{ +SystemDividers::SystemDividers() : myLeftDivider(makeLeftDivider()), myRightDivider(makeRightDivider()) +{ +} - bool SystemDividers::hasContents() const - { - return true; - } +bool SystemDividers::hasAttributes() const +{ + return false; +} +std::ostream &SystemDividers::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& SystemDividers::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myLeftDivider->toStream( os, indentLevel+1 ); - os << std::endl; - myRightDivider->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } +std::ostream &SystemDividers::streamName(std::ostream &os) const +{ + os << "system-dividers"; + return os; +} +bool SystemDividers::hasContents() const +{ + return true; +} - LeftDividerPtr SystemDividers::getLeftDivider() const - { - return myLeftDivider; - } +std::ostream &SystemDividers::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myLeftDivider->toStream(os, indentLevel + 1); + os << std::endl; + myRightDivider->toStream(os, indentLevel + 1); + os << std::endl; + return os; +} +LeftDividerPtr SystemDividers::getLeftDivider() const +{ + return myLeftDivider; +} - void SystemDividers::setLeftDivider( const LeftDividerPtr& value ) - { - if( value ) - { - myLeftDivider = value; - } - } +void SystemDividers::setLeftDivider(const LeftDividerPtr &value) +{ + if (value) + { + myLeftDivider = value; + } +} +RightDividerPtr SystemDividers::getRightDivider() const +{ + return myRightDivider; +} - RightDividerPtr SystemDividers::getRightDivider() const - { - return myRightDivider; - } +void SystemDividers::setRightDivider(const RightDividerPtr &value) +{ + if (value) + { + myRightDivider = value; + } +} +bool SystemDividers::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isLeftDividerFound = false; + bool isRightDividerFound = false; - void SystemDividers::setRightDivider( const RightDividerPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myLeftDivider, isLeftDividerFound)) { - if( value ) - { - myRightDivider = value; - } + continue; } - - - bool SystemDividers::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myRightDivider, isRightDividerFound)) { - bool isSuccess = true; - bool isLeftDividerFound = false; - bool isRightDividerFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myLeftDivider, isLeftDividerFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRightDivider, isRightDividerFound ) ) { continue; } - } - - if( !isLeftDividerFound ) - { - message << "SystemDividers: '" << myLeftDivider->getElementName() << "' is required but was not found" << std::endl; - } - if( !isRightDividerFound ) - { - message << "SystemDividers: '" << myRightDivider->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; + continue; } + } + if (!isLeftDividerFound) + { + message << "SystemDividers: '" << myLeftDivider->getElementName() << "' is required but was not found" + << std::endl; } + if (!isRightDividerFound) + { + message << "SystemDividers: '" << myRightDivider->getElementName() << "' is required but was not found" + << std::endl; + } + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SystemDividers.h b/Sourcecode/private/mx/core/elements/SystemDividers.h index f4714b0dc..7c1af9454 100644 --- a/Sourcecode/private/mx/core/elements/SystemDividers.h +++ b/Sourcecode/private/mx/core/elements/SystemDividers.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,40 +13,43 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( LeftDivider ) - MX_FORWARD_DECLARE_ELEMENT( RightDivider ) - MX_FORWARD_DECLARE_ELEMENT( SystemDividers ) - - inline SystemDividersPtr makeSystemDividers() { return std::make_shared(); } - - class SystemDividers : public ElementInterface - { - public: - SystemDividers(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ LeftDivider minOccurs = 1, maxOccurs = 1 _________ */ - LeftDividerPtr getLeftDivider() const; - void setLeftDivider( const LeftDividerPtr& value ); - - /* _________ RightDivider minOccurs = 1, maxOccurs = 1 _________ */ - RightDividerPtr getRightDivider() const; - void setRightDivider( const RightDividerPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LeftDividerPtr myLeftDivider; - RightDividerPtr myRightDivider; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(LeftDivider) +MX_FORWARD_DECLARE_ELEMENT(RightDivider) +MX_FORWARD_DECLARE_ELEMENT(SystemDividers) + +inline SystemDividersPtr makeSystemDividers() +{ + return std::make_shared(); } + +class SystemDividers : public ElementInterface +{ + public: + SystemDividers(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ LeftDivider minOccurs = 1, maxOccurs = 1 _________ */ + LeftDividerPtr getLeftDivider() const; + void setLeftDivider(const LeftDividerPtr &value); + + /* _________ RightDivider minOccurs = 1, maxOccurs = 1 _________ */ + RightDividerPtr getRightDivider() const; + void setRightDivider(const RightDividerPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + LeftDividerPtr myLeftDivider; + RightDividerPtr myRightDivider; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SystemLayout.cpp b/Sourcecode/private/mx/core/elements/SystemLayout.cpp index 4ab47d38e..516dff982 100644 --- a/Sourcecode/private/mx/core/elements/SystemLayout.cpp +++ b/Sourcecode/private/mx/core/elements/SystemLayout.cpp @@ -12,202 +12,185 @@ namespace mx { - namespace core - { - SystemLayout::SystemLayout() - :mySystemMargins( makeSystemMargins() ) - ,myHasSystemMargins( false ) - ,mySystemDistance( makeSystemDistance() ) - ,myHasSystemDistance( false ) - ,myTopSystemDistance( makeTopSystemDistance() ) - ,myHasTopSystemDistance( false ) - ,mySystemDividers( makeSystemDividers() ) - ,myHasSystemDividers( false ) - {} - - - bool SystemLayout::hasAttributes() const - { - return false; - } - - - std::ostream& SystemLayout::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SystemLayout::streamName( std::ostream& os ) const - { - os << "system-layout"; - return os; - } - - - bool SystemLayout::hasContents() const - { - return myHasSystemMargins - || myHasSystemDistance - || myHasTopSystemDistance - || myHasSystemDividers; - } - - - std::ostream& SystemLayout::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasSystemMargins ) - { - os << std::endl; - mySystemMargins->toStream( os, indentLevel+1 ); - } - if ( myHasSystemDistance ) - { - os << std::endl; - mySystemDistance->toStream( os, indentLevel+1 ); - } - if ( myHasTopSystemDistance ) - { - os << std::endl; - myTopSystemDistance->toStream( os, indentLevel+1 ); - } - if ( myHasSystemDividers ) - { - os << std::endl; - mySystemDividers->toStream( os, indentLevel+1 ); - } - isOneLineOnly = ! hasContents(); - if ( ! isOneLineOnly ) - { - os << std::endl; - } - return os; - } - - - SystemMarginsPtr SystemLayout::getSystemMargins() const - { - return mySystemMargins; - } - - - void SystemLayout::setSystemMargins( const SystemMarginsPtr& value ) - { - if( value ) - { - mySystemMargins = value; - } - } - +namespace core +{ +SystemLayout::SystemLayout() + : mySystemMargins(makeSystemMargins()), myHasSystemMargins(false), mySystemDistance(makeSystemDistance()), + myHasSystemDistance(false), myTopSystemDistance(makeTopSystemDistance()), myHasTopSystemDistance(false), + mySystemDividers(makeSystemDividers()), myHasSystemDividers(false) +{ +} - bool SystemLayout::getHasSystemMargins() const - { - return myHasSystemMargins; - } +bool SystemLayout::hasAttributes() const +{ + return false; +} +std::ostream &SystemLayout::streamAttributes(std::ostream &os) const +{ + return os; +} - void SystemLayout::setHasSystemMargins( const bool value ) - { - myHasSystemMargins = value; - } +std::ostream &SystemLayout::streamName(std::ostream &os) const +{ + os << "system-layout"; + return os; +} +bool SystemLayout::hasContents() const +{ + return myHasSystemMargins || myHasSystemDistance || myHasTopSystemDistance || myHasSystemDividers; +} - SystemDistancePtr SystemLayout::getSystemDistance() const - { - return mySystemDistance; - } +std::ostream &SystemLayout::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (myHasSystemMargins) + { + os << std::endl; + mySystemMargins->toStream(os, indentLevel + 1); + } + if (myHasSystemDistance) + { + os << std::endl; + mySystemDistance->toStream(os, indentLevel + 1); + } + if (myHasTopSystemDistance) + { + os << std::endl; + myTopSystemDistance->toStream(os, indentLevel + 1); + } + if (myHasSystemDividers) + { + os << std::endl; + mySystemDividers->toStream(os, indentLevel + 1); + } + isOneLineOnly = !hasContents(); + if (!isOneLineOnly) + { + os << std::endl; + } + return os; +} +SystemMarginsPtr SystemLayout::getSystemMargins() const +{ + return mySystemMargins; +} - void SystemLayout::setSystemDistance( const SystemDistancePtr& value ) - { - if( value ) - { - mySystemDistance = value; - } - } +void SystemLayout::setSystemMargins(const SystemMarginsPtr &value) +{ + if (value) + { + mySystemMargins = value; + } +} +bool SystemLayout::getHasSystemMargins() const +{ + return myHasSystemMargins; +} - bool SystemLayout::getHasSystemDistance() const - { - return myHasSystemDistance; - } +void SystemLayout::setHasSystemMargins(const bool value) +{ + myHasSystemMargins = value; +} +SystemDistancePtr SystemLayout::getSystemDistance() const +{ + return mySystemDistance; +} - void SystemLayout::setHasSystemDistance( const bool value ) - { - myHasSystemDistance = value; - } +void SystemLayout::setSystemDistance(const SystemDistancePtr &value) +{ + if (value) + { + mySystemDistance = value; + } +} +bool SystemLayout::getHasSystemDistance() const +{ + return myHasSystemDistance; +} - TopSystemDistancePtr SystemLayout::getTopSystemDistance() const - { - return myTopSystemDistance; - } +void SystemLayout::setHasSystemDistance(const bool value) +{ + myHasSystemDistance = value; +} +TopSystemDistancePtr SystemLayout::getTopSystemDistance() const +{ + return myTopSystemDistance; +} - void SystemLayout::setTopSystemDistance( const TopSystemDistancePtr& value ) - { - if( value ) - { - myTopSystemDistance = value; - } - } +void SystemLayout::setTopSystemDistance(const TopSystemDistancePtr &value) +{ + if (value) + { + myTopSystemDistance = value; + } +} +bool SystemLayout::getHasTopSystemDistance() const +{ + return myHasTopSystemDistance; +} - bool SystemLayout::getHasTopSystemDistance() const - { - return myHasTopSystemDistance; - } +void SystemLayout::setHasTopSystemDistance(const bool value) +{ + myHasTopSystemDistance = value; +} +SystemDividersPtr SystemLayout::getSystemDividers() const +{ + return mySystemDividers; +} - void SystemLayout::setHasTopSystemDistance( const bool value ) - { - myHasTopSystemDistance = value; - } +void SystemLayout::setSystemDividers(const SystemDividersPtr &value) +{ + if (value) + { + mySystemDividers = value; + } +} +bool SystemLayout::getHasSystemDividers() const +{ + return myHasSystemDividers; +} - SystemDividersPtr SystemLayout::getSystemDividers() const - { - return mySystemDividers; - } +void SystemLayout::setHasSystemDividers(const bool value) +{ + myHasSystemDividers = value; +} +bool SystemLayout::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; - void SystemLayout::setSystemDividers( const SystemDividersPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *mySystemMargins, myHasSystemMargins)) { - if( value ) - { - mySystemDividers = value; - } + continue; } - - - bool SystemLayout::getHasSystemDividers() const + if (importElement(message, *it, isSuccess, *mySystemDistance, myHasSystemDistance)) { - return myHasSystemDividers; + continue; } - - - void SystemLayout::setHasSystemDividers( const bool value ) + if (importElement(message, *it, isSuccess, *myTopSystemDistance, myHasTopSystemDistance)) { - myHasSystemDividers = value; + continue; } - - - bool SystemLayout::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *mySystemDividers, myHasSystemDividers)) { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *mySystemMargins, myHasSystemMargins ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySystemDistance, myHasSystemDistance ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTopSystemDistance, myHasTopSystemDistance ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySystemDividers, myHasSystemDividers ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SystemLayout.h b/Sourcecode/private/mx/core/elements/SystemLayout.h index 03142f35e..3c6c59615 100644 --- a/Sourcecode/private/mx/core/elements/SystemLayout.h +++ b/Sourcecode/private/mx/core/elements/SystemLayout.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,62 +13,65 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( SystemDistance ) - MX_FORWARD_DECLARE_ELEMENT( SystemDividers ) - MX_FORWARD_DECLARE_ELEMENT( SystemMargins ) - MX_FORWARD_DECLARE_ELEMENT( TopSystemDistance ) - MX_FORWARD_DECLARE_ELEMENT( SystemLayout ) +MX_FORWARD_DECLARE_ELEMENT(SystemDistance) +MX_FORWARD_DECLARE_ELEMENT(SystemDividers) +MX_FORWARD_DECLARE_ELEMENT(SystemMargins) +MX_FORWARD_DECLARE_ELEMENT(TopSystemDistance) +MX_FORWARD_DECLARE_ELEMENT(SystemLayout) - inline SystemLayoutPtr makeSystemLayout() { return std::make_shared(); } +inline SystemLayoutPtr makeSystemLayout() +{ + return std::make_shared(); +} - class SystemLayout : public ElementInterface - { - public: - SystemLayout(); +class SystemLayout : public ElementInterface +{ + public: + SystemLayout(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; - /* _________ SystemMargins minOccurs = 0, maxOccurs = 1 _________ */ - SystemMarginsPtr getSystemMargins() const; - void setSystemMargins( const SystemMarginsPtr& value ); - bool getHasSystemMargins() const; - void setHasSystemMargins( const bool value ); - SystemDistancePtr getSystemDistance() const; - void setSystemDistance( const SystemDistancePtr& value ); - bool getHasSystemDistance() const; - void setHasSystemDistance( const bool value ); + /* _________ SystemMargins minOccurs = 0, maxOccurs = 1 _________ */ + SystemMarginsPtr getSystemMargins() const; + void setSystemMargins(const SystemMarginsPtr &value); + bool getHasSystemMargins() const; + void setHasSystemMargins(const bool value); + SystemDistancePtr getSystemDistance() const; + void setSystemDistance(const SystemDistancePtr &value); + bool getHasSystemDistance() const; + void setHasSystemDistance(const bool value); - /* _________ TopSystemDistance minOccurs = 0, maxOccurs = 1 _________ */ - TopSystemDistancePtr getTopSystemDistance() const; - void setTopSystemDistance( const TopSystemDistancePtr& value ); - bool getHasTopSystemDistance() const; - void setHasTopSystemDistance( const bool value ); + /* _________ TopSystemDistance minOccurs = 0, maxOccurs = 1 _________ */ + TopSystemDistancePtr getTopSystemDistance() const; + void setTopSystemDistance(const TopSystemDistancePtr &value); + bool getHasTopSystemDistance() const; + void setHasTopSystemDistance(const bool value); - /* _________ SystemDividers minOccurs = 0, maxOccurs = 1 _________ */ - SystemDividersPtr getSystemDividers() const; - void setSystemDividers( const SystemDividersPtr& value ); - bool getHasSystemDividers() const; - void setHasSystemDividers( const bool value ); + /* _________ SystemDividers minOccurs = 0, maxOccurs = 1 _________ */ + SystemDividersPtr getSystemDividers() const; + void setSystemDividers(const SystemDividersPtr &value); + bool getHasSystemDividers() const; + void setHasSystemDividers(const bool value); - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); - private: - SystemMarginsPtr mySystemMargins; - bool myHasSystemMargins; - SystemDistancePtr mySystemDistance; - bool myHasSystemDistance; - TopSystemDistancePtr myTopSystemDistance; - bool myHasTopSystemDistance; - SystemDividersPtr mySystemDividers; - bool myHasSystemDividers; - }; - } -} + private: + SystemMarginsPtr mySystemMargins; + bool myHasSystemMargins; + SystemDistancePtr mySystemDistance; + bool myHasSystemDistance; + TopSystemDistancePtr myTopSystemDistance; + bool myHasTopSystemDistance; + SystemDividersPtr mySystemDividers; + bool myHasSystemDividers; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SystemMargins.cpp b/Sourcecode/private/mx/core/elements/SystemMargins.cpp index 2bd3c8243..42e0db60e 100644 --- a/Sourcecode/private/mx/core/elements/SystemMargins.cpp +++ b/Sourcecode/private/mx/core/elements/SystemMargins.cpp @@ -10,104 +10,101 @@ namespace mx { - namespace core - { - SystemMargins::SystemMargins() - :myLeftMargin( makeLeftMargin() ) - ,myRightMargin( makeRightMargin() ) - {} - - - bool SystemMargins::hasAttributes() const - { - return false; - } - - - std::ostream& SystemMargins::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SystemMargins::streamName( std::ostream& os ) const - { - os << "system-margins"; - return os; - } - +namespace core +{ +SystemMargins::SystemMargins() : myLeftMargin(makeLeftMargin()), myRightMargin(makeRightMargin()) +{ +} - bool SystemMargins::hasContents() const - { - return true; - } +bool SystemMargins::hasAttributes() const +{ + return false; +} +std::ostream &SystemMargins::streamAttributes(std::ostream &os) const +{ + return os; +} - std::ostream& SystemMargins::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myLeftMargin->toStream( os, indentLevel+1 ); - os << std::endl; - myRightMargin->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } +std::ostream &SystemMargins::streamName(std::ostream &os) const +{ + os << "system-margins"; + return os; +} +bool SystemMargins::hasContents() const +{ + return true; +} - LeftMarginPtr SystemMargins::getLeftMargin() const - { - return myLeftMargin; - } +std::ostream &SystemMargins::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + isOneLineOnly = false; + os << std::endl; + myLeftMargin->toStream(os, indentLevel + 1); + os << std::endl; + myRightMargin->toStream(os, indentLevel + 1); + os << std::endl; + return os; +} +LeftMarginPtr SystemMargins::getLeftMargin() const +{ + return myLeftMargin; +} - void SystemMargins::setLeftMargin( const LeftMarginPtr& value ) - { - if( value ) - { - myLeftMargin = value; - } - } +void SystemMargins::setLeftMargin(const LeftMarginPtr &value) +{ + if (value) + { + myLeftMargin = value; + } +} +RightMarginPtr SystemMargins::getRightMargin() const +{ + return myRightMargin; +} - RightMarginPtr SystemMargins::getRightMargin() const - { - return myRightMargin; - } +void SystemMargins::setRightMargin(const RightMarginPtr &value) +{ + if (value) + { + myRightMargin = value; + } +} +bool SystemMargins::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + bool isLeftMarginFound = false; + bool isRightMarginFound = false; - void SystemMargins::setRightMargin( const RightMarginPtr& value ) + auto endIter = xelement.end(); + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (importElement(message, *it, isSuccess, *myLeftMargin, isLeftMarginFound)) { - if( value ) - { - myRightMargin = value; - } + continue; } - - - bool SystemMargins::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (importElement(message, *it, isSuccess, *myRightMargin, isRightMarginFound)) { - bool isSuccess = true; - bool isLeftMarginFound = false; - bool isRightMarginFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myLeftMargin, isLeftMarginFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRightMargin, isRightMarginFound ) ) { continue; } - } - - if( !isLeftMarginFound ) - { - message << "SystemMargins: '" << myLeftMargin->getElementName() << "' is required but was not found" << std::endl; - } - if( !isRightMarginFound ) - { - message << "SystemMargins: '" << myRightMargin->getElementName() << "' is required but was not found" << std::endl; - } - return isSuccess; + continue; } + } + if (!isLeftMarginFound) + { + message << "SystemMargins: '" << myLeftMargin->getElementName() << "' is required but was not found" + << std::endl; } + if (!isRightMarginFound) + { + message << "SystemMargins: '" << myRightMargin->getElementName() << "' is required but was not found" + << std::endl; + } + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/SystemMargins.h b/Sourcecode/private/mx/core/elements/SystemMargins.h index d84dbbeb8..0f5b55b60 100644 --- a/Sourcecode/private/mx/core/elements/SystemMargins.h +++ b/Sourcecode/private/mx/core/elements/SystemMargins.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,40 +13,43 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( LeftMargin ) - MX_FORWARD_DECLARE_ELEMENT( RightMargin ) - MX_FORWARD_DECLARE_ELEMENT( SystemMargins ) - - inline SystemMarginsPtr makeSystemMargins() { return std::make_shared(); } - - class SystemMargins : public ElementInterface - { - public: - SystemMargins(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ LeftMargin minOccurs = 1, maxOccurs = 1 _________ */ - LeftMarginPtr getLeftMargin() const; - void setLeftMargin( const LeftMarginPtr& value ); - - /* _________ RightMargin minOccurs = 1, maxOccurs = 1 _________ */ - RightMarginPtr getRightMargin() const; - void setRightMargin( const RightMarginPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LeftMarginPtr myLeftMargin; - RightMarginPtr myRightMargin; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(LeftMargin) +MX_FORWARD_DECLARE_ELEMENT(RightMargin) +MX_FORWARD_DECLARE_ELEMENT(SystemMargins) + +inline SystemMarginsPtr makeSystemMargins() +{ + return std::make_shared(); } + +class SystemMargins : public ElementInterface +{ + public: + SystemMargins(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ LeftMargin minOccurs = 1, maxOccurs = 1 _________ */ + LeftMarginPtr getLeftMargin() const; + void setLeftMargin(const LeftMarginPtr &value); + + /* _________ RightMargin minOccurs = 1, maxOccurs = 1 _________ */ + RightMarginPtr getRightMargin() const; + void setRightMargin(const RightMarginPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + LeftMarginPtr myLeftMargin; + RightMarginPtr myRightMargin; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tap.cpp b/Sourcecode/private/mx/core/elements/Tap.cpp index a4dedf9bf..9bfb06d51 100644 --- a/Sourcecode/private/mx/core/elements/Tap.cpp +++ b/Sourcecode/private/mx/core/elements/Tap.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Tap::Tap() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Tap::Tap( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Tap::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Tap::hasContents() const - { - return true; - } - - - std::ostream& Tap::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Tap::streamName( std::ostream& os ) const - { - os << "tap"; - return os; - } - - - std::ostream& Tap::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Tap::Tap() : myValue(), myAttributes(std::make_shared()) +{ +} +Tap::Tap(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - TapAttributesPtr Tap::getAttributes() const - { - return myAttributes; - } +bool Tap::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Tap::hasContents() const +{ + return true; +} - void Tap::setAttributes( const TapAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Tap::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Tap::streamName(std::ostream &os) const +{ + os << "tap"; + return os; +} - XsString Tap::getValue() const - { - return myValue; - } +std::ostream &Tap::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TapAttributesPtr Tap::getAttributes() const +{ + return myAttributes; +} - void Tap::setValue( const XsString& value ) - { - myValue = value; - } +void Tap::setAttributes(const TapAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Tap::getValue() const +{ + return myValue; +} - bool Tap::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Tap::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Tap::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tap.h b/Sourcecode/private/mx/core/elements/Tap.h index b0315b725..c9fa0390f 100644 --- a/Sourcecode/private/mx/core/elements/Tap.h +++ b/Sourcecode/private/mx/core/elements/Tap.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/TapAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TapAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Tap ) - - inline TapPtr makeTap() { return std::make_shared(); } - inline TapPtr makeTap( const XsString& value ) { return std::make_shared( value ); } - inline TapPtr makeTap( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Tap : public ElementInterface - { - public: - Tap(); - Tap( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TapAttributesPtr getAttributes() const; - void setAttributes( const TapAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - TapAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(TapAttributes) +MX_FORWARD_DECLARE_ELEMENT(Tap) + +inline TapPtr makeTap() +{ + return std::make_shared(); +} + +inline TapPtr makeTap(const XsString &value) +{ + return std::make_shared(value); } + +inline TapPtr makeTap(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Tap : public ElementInterface +{ + public: + Tap(); + Tap(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TapAttributesPtr getAttributes() const; + void setAttributes(const TapAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + TapAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TapAttributes.cpp b/Sourcecode/private/mx/core/elements/TapAttributes.cpp index 1ad885e79..55c5da866 100644 --- a/Sourcecode/private/mx/core/elements/TapAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/TapAttributes.cpp @@ -8,86 +8,90 @@ namespace mx { - namespace core +namespace core +{ +TapAttributes::TapAttributes() + : defaultX(), defaultY(), relativeX(), relativeY(), fontFamily(), fontStyle(FontStyle::normal), + fontSize(FontSize{CssFontSize::medium}), fontWeight(FontWeight::normal), placement(), hasDefaultX(false), + hasDefaultY(false), hasRelativeX(false), hasRelativeY(false), hasFontFamily(false), hasFontStyle(false), + hasFontSize(false), hasFontWeight(false), hasPlacement(false) +{ +} + +bool TapAttributes::hasValues() const +{ + return hasDefaultX || hasDefaultY || hasRelativeX || hasRelativeY || hasFontFamily || hasFontStyle || hasFontSize || + hasFontWeight || hasPlacement; +} + +std::ostream &TapAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - TapAttributes::TapAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, placement, "placement", hasPlacement); + } + return os; +} + +bool TapAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "TapAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool TapAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; + continue; } - - - std::ostream& TapAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; + continue; } - - - bool TapAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) { - const char* const className = "TapAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TapAttributes.h b/Sourcecode/private/mx/core/elements/TapAttributes.h index 99ed1b044..36d10b347 100644 --- a/Sourcecode/private/mx/core/elements/TapAttributes.h +++ b/Sourcecode/private/mx/core/elements/TapAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -17,38 +17,38 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( TapAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(TapAttributes) - struct TapAttributes : public AttributesInterface - { - public: - TapAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; +struct TapAttributes : public AttributesInterface +{ + public: + TapAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + AboveBelow placement; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasPlacement; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Technical.cpp b/Sourcecode/private/mx/core/elements/Technical.cpp index beeebb508..02bde2ac1 100644 --- a/Sourcecode/private/mx/core/elements/Technical.cpp +++ b/Sourcecode/private/mx/core/elements/Technical.cpp @@ -4,7 +4,6 @@ #include "mx/core/elements/Technical.h" #include "mx/core/FromXElement.h" -#include "mx/core/elements/TechnicalChoice.h" #include "mx/core/elements/Arrow.h" #include "mx/core/elements/Bend.h" #include "mx/core/elements/DoubleTongue.h" @@ -25,6 +24,7 @@ #include "mx/core/elements/Stopped.h" #include "mx/core/elements/String.h" #include "mx/core/elements/Tap.h" +#include "mx/core/elements/TechnicalChoice.h" #include "mx/core/elements/ThumbPosition.h" #include "mx/core/elements/Toe.h" #include "mx/core/elements/TripleTongue.h" @@ -33,285 +33,273 @@ namespace mx { - namespace core - { - Technical::Technical() - :myTechnicalChoiceSet() - {} +namespace core +{ +Technical::Technical() : myTechnicalChoiceSet() +{ +} +bool Technical::hasAttributes() const +{ + return false; +} - bool Technical::hasAttributes() const - { - return false; - } +std::ostream &Technical::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Technical::streamName(std::ostream &os) const +{ + os << "technical"; + return os; +} + +bool Technical::hasContents() const +{ + return myTechnicalChoiceSet.size() > 0; +} - std::ostream& Technical::streamAttributes( std::ostream& os ) const +std::ostream &Technical::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + if (hasContents()) + { + for (auto x : myTechnicalChoiceSet) { - return os; + os << std::endl; + x->streamContents(os, indentLevel + 1, isOneLineOnly); } + os << std::endl; + } + else + { + isOneLineOnly = false; + } + return os; +} +const TechnicalChoiceSet &Technical::getTechnicalChoiceSet() const +{ + return myTechnicalChoiceSet; +} - std::ostream& Technical::streamName( std::ostream& os ) const - { - os << "technical"; - return os; - } +void Technical::addTechnicalChoice(const TechnicalChoicePtr &value) +{ + if (value) + { + myTechnicalChoiceSet.push_back(value); + } +} +void Technical::removeTechnicalChoice(const TechnicalChoiceSetIterConst &value) +{ + if (value != myTechnicalChoiceSet.cend()) + { + myTechnicalChoiceSet.erase(value); + } +} - bool Technical::hasContents() const - { - return myTechnicalChoiceSet.size() > 0; - } +void Technical::clearTechnicalChoiceSet() +{ + myTechnicalChoiceSet.clear(); +} +TechnicalChoicePtr Technical::getTechnicalChoice(const TechnicalChoiceSetIterConst &setIterator) const +{ + if (setIterator != myTechnicalChoiceSet.cend()) + { + return *setIterator; + } + return TechnicalChoicePtr(); +} - std::ostream& Technical::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myTechnicalChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - } - else - { - isOneLineOnly = false; - } - return os; - } +bool Technical::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + ::ezxml::XElementIterator end = xelement.end(); + for (auto it = xelement.begin(); it != end; ++it) + { + const std::string elementName = it->getName(); + auto choice = makeTechnicalChoice(); - const TechnicalChoiceSet& Technical::getTechnicalChoiceSet() const + if (elementName == "up-bow") { - return myTechnicalChoiceSet; + choice->setChoice(TechnicalChoice::Choice::upBow); + isSuccess &= choice->getUpBow()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; } - - - void Technical::addTechnicalChoice( const TechnicalChoicePtr& value ) + else if (elementName == "down-bow") { - if ( value ) - { - myTechnicalChoiceSet.push_back( value ); - } + choice->setChoice(TechnicalChoice::Choice::downBow); + isSuccess &= choice->getDownBow()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; } - - - void Technical::removeTechnicalChoice( const TechnicalChoiceSetIterConst& value ) + else if (elementName == "harmonic") { - if ( value != myTechnicalChoiceSet.cend() ) - { - myTechnicalChoiceSet.erase( value ); - } + choice->setChoice(TechnicalChoice::Choice::harmonic); + isSuccess &= choice->getHarmonic()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; } - - - void Technical::clearTechnicalChoiceSet() + else if (elementName == "open-string") { - myTechnicalChoiceSet.clear(); + choice->setChoice(TechnicalChoice::Choice::openString); + isSuccess &= choice->getOpenString()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; } - - - TechnicalChoicePtr Technical::getTechnicalChoice( const TechnicalChoiceSetIterConst& setIterator ) const + else if (elementName == "thumb-position") { - if( setIterator != myTechnicalChoiceSet.cend() ) - { - return *setIterator; - } - return TechnicalChoicePtr(); + choice->setChoice(TechnicalChoice::Choice::thumbPosition); + isSuccess &= choice->getThumbPosition()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; } - - - bool Technical::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + else if (elementName == "fingering") { - bool isSuccess = true; - ::ezxml::XElementIterator end = xelement.end(); - - for( auto it = xelement.begin(); it != end; ++it ) - { - const std::string elementName = it->getName(); - auto choice = makeTechnicalChoice(); - - if( elementName == "up-bow" ) - { - choice->setChoice( TechnicalChoice::Choice::upBow ); - isSuccess &= choice->getUpBow()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "down-bow" ) - { - choice->setChoice( TechnicalChoice::Choice::downBow ); - isSuccess &= choice->getDownBow()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "harmonic" ) - { - choice->setChoice( TechnicalChoice::Choice::harmonic ); - isSuccess &= choice->getHarmonic()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "open-string" ) - { - choice->setChoice( TechnicalChoice::Choice::openString ); - isSuccess &= choice->getOpenString()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "thumb-position" ) - { - choice->setChoice( TechnicalChoice::Choice::thumbPosition ); - isSuccess &= choice->getThumbPosition()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "fingering" ) - { - choice->setChoice( TechnicalChoice::Choice::fingering ); - isSuccess &= choice->getFingering()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "pluck" ) - { - choice->setChoice( TechnicalChoice::Choice::pluck ); - isSuccess &= choice->getPluck()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "double-tongue" ) - { - choice->setChoice( TechnicalChoice::Choice::doubleTongue ); - isSuccess &= choice->getDoubleTongue()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "triple-tongue" ) - { - choice->setChoice( TechnicalChoice::Choice::tripleTongue ); - isSuccess &= choice->getTripleTongue()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "stopped" ) - { - choice->setChoice( TechnicalChoice::Choice::stopped ); - isSuccess &= choice->getStopped()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "snap-pizzicato" ) - { - choice->setChoice( TechnicalChoice::Choice::snapPizzicato ); - isSuccess &= choice->getSnapPizzicato()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "fret" ) - { - choice->setChoice( TechnicalChoice::Choice::fret ); - isSuccess &= choice->getFret()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "string" ) - { - choice->setChoice( TechnicalChoice::Choice::string_ ); - isSuccess &= choice->getString()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "hammer-on" ) - { - choice->setChoice( TechnicalChoice::Choice::hammerOn ); - isSuccess &= choice->getHammerOn()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "pull-off" ) - { - choice->setChoice( TechnicalChoice::Choice::pullOff ); - isSuccess &= choice->getPullOff()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "bend" ) - { - choice->setChoice( TechnicalChoice::Choice::bend ); - isSuccess &= choice->getBend()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "tap" ) - { - choice->setChoice( TechnicalChoice::Choice::tap ); - isSuccess &= choice->getTap()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "heel" ) - { - choice->setChoice( TechnicalChoice::Choice::heel ); - isSuccess &= choice->getHeel()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "toe" ) - { - choice->setChoice( TechnicalChoice::Choice::toe ); - isSuccess &= choice->getToe()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "fingernails" ) - { - choice->setChoice( TechnicalChoice::Choice::fingernails ); - isSuccess &= choice->getFingernails()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "hole" ) - { - choice->setChoice( TechnicalChoice::Choice::hole ); - isSuccess &= choice->getHole()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "arrow" ) - { - choice->setChoice( TechnicalChoice::Choice::arrow ); - isSuccess &= choice->getArrow()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "handbell" ) - { - choice->setChoice( TechnicalChoice::Choice::handbell ); - isSuccess &= choice->getHandbell()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "other-technical" ) - { - choice->setChoice( TechnicalChoice::Choice::otherTechnical ); - isSuccess &= choice->getOtherTechnical()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else - { - message << "Technical: unexpected element '" << elementName << "' encountered" << std::endl; - isSuccess = false; - } - - } - - MX_RETURN_IS_SUCCESS; + choice->setChoice(TechnicalChoice::Choice::fingering); + isSuccess &= choice->getFingering()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "pluck") + { + choice->setChoice(TechnicalChoice::Choice::pluck); + isSuccess &= choice->getPluck()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "double-tongue") + { + choice->setChoice(TechnicalChoice::Choice::doubleTongue); + isSuccess &= choice->getDoubleTongue()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "triple-tongue") + { + choice->setChoice(TechnicalChoice::Choice::tripleTongue); + isSuccess &= choice->getTripleTongue()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "stopped") + { + choice->setChoice(TechnicalChoice::Choice::stopped); + isSuccess &= choice->getStopped()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "snap-pizzicato") + { + choice->setChoice(TechnicalChoice::Choice::snapPizzicato); + isSuccess &= choice->getSnapPizzicato()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "fret") + { + choice->setChoice(TechnicalChoice::Choice::fret); + isSuccess &= choice->getFret()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "string") + { + choice->setChoice(TechnicalChoice::Choice::string_); + isSuccess &= choice->getString()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "hammer-on") + { + choice->setChoice(TechnicalChoice::Choice::hammerOn); + isSuccess &= choice->getHammerOn()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "pull-off") + { + choice->setChoice(TechnicalChoice::Choice::pullOff); + isSuccess &= choice->getPullOff()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "bend") + { + choice->setChoice(TechnicalChoice::Choice::bend); + isSuccess &= choice->getBend()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "tap") + { + choice->setChoice(TechnicalChoice::Choice::tap); + isSuccess &= choice->getTap()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "heel") + { + choice->setChoice(TechnicalChoice::Choice::heel); + isSuccess &= choice->getHeel()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "toe") + { + choice->setChoice(TechnicalChoice::Choice::toe); + isSuccess &= choice->getToe()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "fingernails") + { + choice->setChoice(TechnicalChoice::Choice::fingernails); + isSuccess &= choice->getFingernails()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "hole") + { + choice->setChoice(TechnicalChoice::Choice::hole); + isSuccess &= choice->getHole()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "arrow") + { + choice->setChoice(TechnicalChoice::Choice::arrow); + isSuccess &= choice->getArrow()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "handbell") + { + choice->setChoice(TechnicalChoice::Choice::handbell); + isSuccess &= choice->getHandbell()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else if (elementName == "other-technical") + { + choice->setChoice(TechnicalChoice::Choice::otherTechnical); + isSuccess &= choice->getOtherTechnical()->fromXElement(message, *it); + myTechnicalChoiceSet.push_back(choice); + continue; + } + else + { + message << "Technical: unexpected element '" << elementName << "' encountered" << std::endl; + isSuccess = false; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Technical.h b/Sourcecode/private/mx/core/elements/Technical.h index 50e7fa06c..d9f147777 100644 --- a/Sourcecode/private/mx/core/elements/Technical.h +++ b/Sourcecode/private/mx/core/elements/Technical.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,37 +13,40 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( TechnicalChoice ) - MX_FORWARD_DECLARE_ELEMENT( Technical ) - - inline TechnicalPtr makeTechnical() { return std::make_shared(); } - - class Technical : public ElementInterface - { - public: - Technical(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ TechnicalChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const TechnicalChoiceSet& getTechnicalChoiceSet() const; - void addTechnicalChoice( const TechnicalChoicePtr& value ); - void removeTechnicalChoice( const TechnicalChoiceSetIterConst& value ); - void clearTechnicalChoiceSet(); - TechnicalChoicePtr getTechnicalChoice( const TechnicalChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TechnicalChoiceSet myTechnicalChoiceSet; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(TechnicalChoice) +MX_FORWARD_DECLARE_ELEMENT(Technical) + +inline TechnicalPtr makeTechnical() +{ + return std::make_shared(); } + +class Technical : public ElementInterface +{ + public: + Technical(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ TechnicalChoice minOccurs = 0, maxOccurs = unbounded _________ */ + const TechnicalChoiceSet &getTechnicalChoiceSet() const; + void addTechnicalChoice(const TechnicalChoicePtr &value); + void removeTechnicalChoice(const TechnicalChoiceSetIterConst &value); + void clearTechnicalChoiceSet(); + TechnicalChoicePtr getTechnicalChoice(const TechnicalChoiceSetIterConst &setIterator) const; + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TechnicalChoiceSet myTechnicalChoiceSet; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TechnicalChoice.cpp b/Sourcecode/private/mx/core/elements/TechnicalChoice.cpp index 530ed5f36..f370bcde0 100644 --- a/Sourcecode/private/mx/core/elements/TechnicalChoice.cpp +++ b/Sourcecode/private/mx/core/elements/TechnicalChoice.cpp @@ -32,565 +32,469 @@ namespace mx { - namespace core - { - TechnicalChoice::TechnicalChoice() - :myChoice( Choice::upBow ) - ,myUpBow( makeUpBow() ) - ,myDownBow( makeDownBow() ) - ,myHarmonic( makeHarmonic() ) - ,myOpenString( makeOpenString() ) - ,myThumbPosition( makeThumbPosition() ) - ,myFingering( makeFingering() ) - ,myPluck( makePluck() ) - ,myDoubleTongue( makeDoubleTongue() ) - ,myTripleTongue( makeTripleTongue() ) - ,myStopped( makeStopped() ) - ,mySnapPizzicato( makeSnapPizzicato() ) - ,myFret( makeFret() ) - ,myString( makeString() ) - ,myHammerOn( makeHammerOn() ) - ,myPullOff( makePullOff() ) - ,myBend( makeBend() ) - ,myTap( makeTap() ) - ,myHeel( makeHeel() ) - ,myToe( makeToe() ) - ,myFingernails( makeFingernails() ) - ,myHole( makeHole() ) - ,myArrow( makeArrow() ) - ,myHandbell( makeHandbell() ) - ,myOtherTechnical( makeOtherTechnical() ) - {} - - - bool TechnicalChoice::hasAttributes() const - { - return false; - } - - - std::ostream& TechnicalChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& TechnicalChoice::streamName( std::ostream& os ) const - { - os << "technical"; - return os; - } - - - bool TechnicalChoice::hasContents() const - { - return true; - } - - - std::ostream& TechnicalChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::upBow: - { - myUpBow->toStream( os, indentLevel ); - } - break; - case Choice::downBow: - { - myDownBow->toStream( os, indentLevel ); - } - break; - case Choice::harmonic: - { - myHarmonic->toStream( os, indentLevel ); - } - break; - case Choice::openString: - { - myOpenString->toStream( os, indentLevel ); - } - break; - case Choice::thumbPosition: - { - myThumbPosition->toStream( os, indentLevel ); - } - break; - case Choice::fingering: - { - myFingering->toStream( os, indentLevel ); - } - break; - case Choice::pluck: - { - myPluck->toStream( os, indentLevel ); - } - break; - case Choice::doubleTongue: - { - myDoubleTongue->toStream( os, indentLevel ); - } - break; - case Choice::tripleTongue: - { - myTripleTongue->toStream( os, indentLevel ); - } - break; - case Choice::stopped: - { - myStopped->toStream( os, indentLevel ); - } - break; - case Choice::snapPizzicato: - { - mySnapPizzicato->toStream( os, indentLevel ); - } - break; - case Choice::fret: - { - myFret->toStream( os, indentLevel ); - } - break; - case Choice::string_: - { - myString->toStream( os, indentLevel ); - } - break; - case Choice::hammerOn: - { - myHammerOn->toStream( os, indentLevel ); - } - break; - case Choice::pullOff: - { - myPullOff->toStream( os, indentLevel ); - } - break; - case Choice::bend: - { - myBend->toStream( os, indentLevel ); - } - break; - case Choice::tap: - { - myTap->toStream( os, indentLevel ); - } - break; - case Choice::heel: - { - myHeel->toStream( os, indentLevel ); - } - break; - case Choice::toe: - { - myToe->toStream( os, indentLevel ); - } - break; - case Choice::fingernails: - { - myFingernails->toStream( os, indentLevel ); - } - break; - case Choice::hole: - { - myHole->toStream( os, indentLevel ); - } - break; - case Choice::arrow: - { - myArrow->toStream( os, indentLevel ); - } - break; - case Choice::handbell: - { - myHandbell->toStream( os, indentLevel ); - } - break; - case Choice::otherTechnical: - { - myOtherTechnical->toStream( os, indentLevel ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - TechnicalChoice::Choice TechnicalChoice::getChoice() const - { - return myChoice; - } - - - void TechnicalChoice::setChoice( const TechnicalChoice::Choice value ) - { - myChoice = value; - } - - - UpBowPtr TechnicalChoice::getUpBow() const - { - return myUpBow; - } - - - void TechnicalChoice::setUpBow( const UpBowPtr& value ) - { - if( value ) - { - myUpBow = value; - } - } - - - DownBowPtr TechnicalChoice::getDownBow() const - { - return myDownBow; - } - - - void TechnicalChoice::setDownBow( const DownBowPtr& value ) - { - if( value ) - { - myDownBow = value; - } - } - - - HarmonicPtr TechnicalChoice::getHarmonic() const - { - return myHarmonic; - } - - - void TechnicalChoice::setHarmonic( const HarmonicPtr& value ) - { - if( value ) - { - myHarmonic = value; - } - } - - - OpenStringPtr TechnicalChoice::getOpenString() const - { - return myOpenString; - } - - - void TechnicalChoice::setOpenString( const OpenStringPtr& value ) - { - if( value ) - { - myOpenString = value; - } - } - - - ThumbPositionPtr TechnicalChoice::getThumbPosition() const - { - return myThumbPosition; - } - - - void TechnicalChoice::setThumbPosition( const ThumbPositionPtr& value ) - { - if( value ) - { - myThumbPosition = value; - } - } - - - FingeringPtr TechnicalChoice::getFingering() const - { - return myFingering; - } - - - void TechnicalChoice::setFingering( const FingeringPtr& value ) - { - if( value ) - { - myFingering = value; - } - } - - - PluckPtr TechnicalChoice::getPluck() const - { - return myPluck; - } - - - void TechnicalChoice::setPluck( const PluckPtr& value ) - { - if( value ) - { - myPluck = value; - } - } - - - DoubleTonguePtr TechnicalChoice::getDoubleTongue() const - { - return myDoubleTongue; - } - - - void TechnicalChoice::setDoubleTongue( const DoubleTonguePtr& value ) - { - if( value ) - { - myDoubleTongue = value; - } - } - - - TripleTonguePtr TechnicalChoice::getTripleTongue() const - { - return myTripleTongue; - } - - - void TechnicalChoice::setTripleTongue( const TripleTonguePtr& value ) - { - if( value ) - { - myTripleTongue = value; - } - } - - - StoppedPtr TechnicalChoice::getStopped() const - { - return myStopped; - } - - - void TechnicalChoice::setStopped( const StoppedPtr& value ) - { - if( value ) - { - myStopped = value; - } - } - - - SnapPizzicatoPtr TechnicalChoice::getSnapPizzicato() const - { - return mySnapPizzicato; - } +namespace core +{ +TechnicalChoice::TechnicalChoice() + : myChoice(Choice::upBow), myUpBow(makeUpBow()), myDownBow(makeDownBow()), myHarmonic(makeHarmonic()), + myOpenString(makeOpenString()), myThumbPosition(makeThumbPosition()), myFingering(makeFingering()), + myPluck(makePluck()), myDoubleTongue(makeDoubleTongue()), myTripleTongue(makeTripleTongue()), + myStopped(makeStopped()), mySnapPizzicato(makeSnapPizzicato()), myFret(makeFret()), myString(makeString()), + myHammerOn(makeHammerOn()), myPullOff(makePullOff()), myBend(makeBend()), myTap(makeTap()), myHeel(makeHeel()), + myToe(makeToe()), myFingernails(makeFingernails()), myHole(makeHole()), myArrow(makeArrow()), + myHandbell(makeHandbell()), myOtherTechnical(makeOtherTechnical()) +{ +} +bool TechnicalChoice::hasAttributes() const +{ + return false; +} - void TechnicalChoice::setSnapPizzicato( const SnapPizzicatoPtr& value ) - { - if( value ) - { - mySnapPizzicato = value; - } - } +std::ostream &TechnicalChoice::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &TechnicalChoice::streamName(std::ostream &os) const +{ + os << "technical"; + return os; +} - FretPtr TechnicalChoice::getFret() const - { - return myFret; - } +bool TechnicalChoice::hasContents() const +{ + return true; +} +std::ostream &TechnicalChoice::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + switch (myChoice) + { + case Choice::upBow: { + myUpBow->toStream(os, indentLevel); + } + break; + case Choice::downBow: { + myDownBow->toStream(os, indentLevel); + } + break; + case Choice::harmonic: { + myHarmonic->toStream(os, indentLevel); + } + break; + case Choice::openString: { + myOpenString->toStream(os, indentLevel); + } + break; + case Choice::thumbPosition: { + myThumbPosition->toStream(os, indentLevel); + } + break; + case Choice::fingering: { + myFingering->toStream(os, indentLevel); + } + break; + case Choice::pluck: { + myPluck->toStream(os, indentLevel); + } + break; + case Choice::doubleTongue: { + myDoubleTongue->toStream(os, indentLevel); + } + break; + case Choice::tripleTongue: { + myTripleTongue->toStream(os, indentLevel); + } + break; + case Choice::stopped: { + myStopped->toStream(os, indentLevel); + } + break; + case Choice::snapPizzicato: { + mySnapPizzicato->toStream(os, indentLevel); + } + break; + case Choice::fret: { + myFret->toStream(os, indentLevel); + } + break; + case Choice::string_: { + myString->toStream(os, indentLevel); + } + break; + case Choice::hammerOn: { + myHammerOn->toStream(os, indentLevel); + } + break; + case Choice::pullOff: { + myPullOff->toStream(os, indentLevel); + } + break; + case Choice::bend: { + myBend->toStream(os, indentLevel); + } + break; + case Choice::tap: { + myTap->toStream(os, indentLevel); + } + break; + case Choice::heel: { + myHeel->toStream(os, indentLevel); + } + break; + case Choice::toe: { + myToe->toStream(os, indentLevel); + } + break; + case Choice::fingernails: { + myFingernails->toStream(os, indentLevel); + } + break; + case Choice::hole: { + myHole->toStream(os, indentLevel); + } + break; + case Choice::arrow: { + myArrow->toStream(os, indentLevel); + } + break; + case Choice::handbell: { + myHandbell->toStream(os, indentLevel); + } + break; + case Choice::otherTechnical: { + myOtherTechnical->toStream(os, indentLevel); + } + break; + default: + break; + } + isOneLineOnly = false; + return os; +} - void TechnicalChoice::setFret( const FretPtr& value ) - { - if( value ) - { - myFret = value; - } - } +TechnicalChoice::Choice TechnicalChoice::getChoice() const +{ + return myChoice; +} +void TechnicalChoice::setChoice(const TechnicalChoice::Choice value) +{ + myChoice = value; +} - StringPtr TechnicalChoice::getString() const - { - return myString; - } +UpBowPtr TechnicalChoice::getUpBow() const +{ + return myUpBow; +} +void TechnicalChoice::setUpBow(const UpBowPtr &value) +{ + if (value) + { + myUpBow = value; + } +} - void TechnicalChoice::setString( const StringPtr& value ) - { - if( value ) - { - myString = value; - } - } +DownBowPtr TechnicalChoice::getDownBow() const +{ + return myDownBow; +} +void TechnicalChoice::setDownBow(const DownBowPtr &value) +{ + if (value) + { + myDownBow = value; + } +} - HammerOnPtr TechnicalChoice::getHammerOn() const - { - return myHammerOn; - } +HarmonicPtr TechnicalChoice::getHarmonic() const +{ + return myHarmonic; +} +void TechnicalChoice::setHarmonic(const HarmonicPtr &value) +{ + if (value) + { + myHarmonic = value; + } +} - void TechnicalChoice::setHammerOn( const HammerOnPtr& value ) - { - if( value ) - { - myHammerOn = value; - } - } +OpenStringPtr TechnicalChoice::getOpenString() const +{ + return myOpenString; +} +void TechnicalChoice::setOpenString(const OpenStringPtr &value) +{ + if (value) + { + myOpenString = value; + } +} - PullOffPtr TechnicalChoice::getPullOff() const - { - return myPullOff; - } +ThumbPositionPtr TechnicalChoice::getThumbPosition() const +{ + return myThumbPosition; +} +void TechnicalChoice::setThumbPosition(const ThumbPositionPtr &value) +{ + if (value) + { + myThumbPosition = value; + } +} - void TechnicalChoice::setPullOff( const PullOffPtr& value ) - { - if( value ) - { - myPullOff = value; - } - } +FingeringPtr TechnicalChoice::getFingering() const +{ + return myFingering; +} +void TechnicalChoice::setFingering(const FingeringPtr &value) +{ + if (value) + { + myFingering = value; + } +} - BendPtr TechnicalChoice::getBend() const - { - return myBend; - } +PluckPtr TechnicalChoice::getPluck() const +{ + return myPluck; +} +void TechnicalChoice::setPluck(const PluckPtr &value) +{ + if (value) + { + myPluck = value; + } +} - void TechnicalChoice::setBend( const BendPtr& value ) - { - if( value ) - { - myBend = value; - } - } +DoubleTonguePtr TechnicalChoice::getDoubleTongue() const +{ + return myDoubleTongue; +} +void TechnicalChoice::setDoubleTongue(const DoubleTonguePtr &value) +{ + if (value) + { + myDoubleTongue = value; + } +} - TapPtr TechnicalChoice::getTap() const - { - return myTap; - } +TripleTonguePtr TechnicalChoice::getTripleTongue() const +{ + return myTripleTongue; +} +void TechnicalChoice::setTripleTongue(const TripleTonguePtr &value) +{ + if (value) + { + myTripleTongue = value; + } +} - void TechnicalChoice::setTap( const TapPtr& value ) - { - if( value ) - { - myTap = value; - } - } +StoppedPtr TechnicalChoice::getStopped() const +{ + return myStopped; +} +void TechnicalChoice::setStopped(const StoppedPtr &value) +{ + if (value) + { + myStopped = value; + } +} - HeelPtr TechnicalChoice::getHeel() const - { - return myHeel; - } +SnapPizzicatoPtr TechnicalChoice::getSnapPizzicato() const +{ + return mySnapPizzicato; +} +void TechnicalChoice::setSnapPizzicato(const SnapPizzicatoPtr &value) +{ + if (value) + { + mySnapPizzicato = value; + } +} - void TechnicalChoice::setHeel( const HeelPtr& value ) - { - if( value ) - { - myHeel = value; - } - } +FretPtr TechnicalChoice::getFret() const +{ + return myFret; +} +void TechnicalChoice::setFret(const FretPtr &value) +{ + if (value) + { + myFret = value; + } +} - ToePtr TechnicalChoice::getToe() const - { - return myToe; - } +StringPtr TechnicalChoice::getString() const +{ + return myString; +} +void TechnicalChoice::setString(const StringPtr &value) +{ + if (value) + { + myString = value; + } +} - void TechnicalChoice::setToe( const ToePtr& value ) - { - if( value ) - { - myToe = value; - } - } +HammerOnPtr TechnicalChoice::getHammerOn() const +{ + return myHammerOn; +} +void TechnicalChoice::setHammerOn(const HammerOnPtr &value) +{ + if (value) + { + myHammerOn = value; + } +} - FingernailsPtr TechnicalChoice::getFingernails() const - { - return myFingernails; - } +PullOffPtr TechnicalChoice::getPullOff() const +{ + return myPullOff; +} +void TechnicalChoice::setPullOff(const PullOffPtr &value) +{ + if (value) + { + myPullOff = value; + } +} - void TechnicalChoice::setFingernails( const FingernailsPtr& value ) - { - if( value ) - { - myFingernails = value; - } - } +BendPtr TechnicalChoice::getBend() const +{ + return myBend; +} +void TechnicalChoice::setBend(const BendPtr &value) +{ + if (value) + { + myBend = value; + } +} - HolePtr TechnicalChoice::getHole() const - { - return myHole; - } +TapPtr TechnicalChoice::getTap() const +{ + return myTap; +} +void TechnicalChoice::setTap(const TapPtr &value) +{ + if (value) + { + myTap = value; + } +} - void TechnicalChoice::setHole( const HolePtr& value ) - { - if( value ) - { - myHole = value; - } - } +HeelPtr TechnicalChoice::getHeel() const +{ + return myHeel; +} +void TechnicalChoice::setHeel(const HeelPtr &value) +{ + if (value) + { + myHeel = value; + } +} - ArrowPtr TechnicalChoice::getArrow() const - { - return myArrow; - } +ToePtr TechnicalChoice::getToe() const +{ + return myToe; +} +void TechnicalChoice::setToe(const ToePtr &value) +{ + if (value) + { + myToe = value; + } +} - void TechnicalChoice::setArrow( const ArrowPtr& value ) - { - if( value ) - { - myArrow = value; - } - } +FingernailsPtr TechnicalChoice::getFingernails() const +{ + return myFingernails; +} +void TechnicalChoice::setFingernails(const FingernailsPtr &value) +{ + if (value) + { + myFingernails = value; + } +} - HandbellPtr TechnicalChoice::getHandbell() const - { - return myHandbell; - } +HolePtr TechnicalChoice::getHole() const +{ + return myHole; +} +void TechnicalChoice::setHole(const HolePtr &value) +{ + if (value) + { + myHole = value; + } +} - void TechnicalChoice::setHandbell( const HandbellPtr& value ) - { - if( value ) - { - myHandbell = value; - } - } +ArrowPtr TechnicalChoice::getArrow() const +{ + return myArrow; +} +void TechnicalChoice::setArrow(const ArrowPtr &value) +{ + if (value) + { + myArrow = value; + } +} - OtherTechnicalPtr TechnicalChoice::getOtherTechnical() const - { - return myOtherTechnical; - } +HandbellPtr TechnicalChoice::getHandbell() const +{ + return myHandbell; +} +void TechnicalChoice::setHandbell(const HandbellPtr &value) +{ + if (value) + { + myHandbell = value; + } +} - void TechnicalChoice::setOtherTechnical( const OtherTechnicalPtr& value ) - { - if( value ) - { - myOtherTechnical = value; - } - } +OtherTechnicalPtr TechnicalChoice::getOtherTechnical() const +{ + return myOtherTechnical; +} - MX_FROM_XELEMENT_UNUSED( TechnicalChoice ); +void TechnicalChoice::setOtherTechnical(const OtherTechnicalPtr &value) +{ + if (value) + { + myOtherTechnical = value; } } + +MX_FROM_XELEMENT_UNUSED(TechnicalChoice); +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TechnicalChoice.h b/Sourcecode/private/mx/core/elements/TechnicalChoice.h index df45d47cc..1d1b4bad7 100644 --- a/Sourcecode/private/mx/core/elements/TechnicalChoice.h +++ b/Sourcecode/private/mx/core/elements/TechnicalChoice.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -13,204 +13,207 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ELEMENT( Arrow ) - MX_FORWARD_DECLARE_ELEMENT( Bend ) - MX_FORWARD_DECLARE_ELEMENT( DoubleTongue ) - MX_FORWARD_DECLARE_ELEMENT( DownBow ) - MX_FORWARD_DECLARE_ELEMENT( Fingering ) - MX_FORWARD_DECLARE_ELEMENT( Fingernails ) - MX_FORWARD_DECLARE_ELEMENT( Fret ) - MX_FORWARD_DECLARE_ELEMENT( HammerOn ) - MX_FORWARD_DECLARE_ELEMENT( Handbell ) - MX_FORWARD_DECLARE_ELEMENT( Harmonic ) - MX_FORWARD_DECLARE_ELEMENT( Heel ) - MX_FORWARD_DECLARE_ELEMENT( Hole ) - MX_FORWARD_DECLARE_ELEMENT( OpenString ) - MX_FORWARD_DECLARE_ELEMENT( OtherTechnical ) - MX_FORWARD_DECLARE_ELEMENT( Pluck ) - MX_FORWARD_DECLARE_ELEMENT( PullOff ) - MX_FORWARD_DECLARE_ELEMENT( SnapPizzicato ) - MX_FORWARD_DECLARE_ELEMENT( Stopped ) - MX_FORWARD_DECLARE_ELEMENT( String ) - MX_FORWARD_DECLARE_ELEMENT( Tap ) - MX_FORWARD_DECLARE_ELEMENT( ThumbPosition ) - MX_FORWARD_DECLARE_ELEMENT( Toe ) - MX_FORWARD_DECLARE_ELEMENT( TripleTongue ) - MX_FORWARD_DECLARE_ELEMENT( UpBow ) - MX_FORWARD_DECLARE_ELEMENT( TechnicalChoice ) - - inline TechnicalChoicePtr makeTechnicalChoice() { return std::make_shared(); } - - class TechnicalChoice : public ElementInterface - { - public: - enum class Choice - { - upBow = 1, - downBow = 2, - harmonic = 3, - openString = 4, - thumbPosition = 5, - fingering = 6, - pluck = 7, - doubleTongue = 8, - tripleTongue = 9, - stopped = 10, - snapPizzicato = 11, - fret = 12, - string_ = 13, - hammerOn = 14, - pullOff = 15, - bend = 16, - tap = 17, - heel = 18, - toe = 19, - fingernails = 20, - hole = 21, - arrow = 22, - handbell = 23, - otherTechnical = 24 - }; - TechnicalChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - TechnicalChoice::Choice getChoice() const; - void setChoice( const TechnicalChoice::Choice value ); - - /* _________ UpBow minOccurs = 1, maxOccurs = 1 _________ */ - UpBowPtr getUpBow() const; - void setUpBow( const UpBowPtr& value ); - - /* _________ DownBow minOccurs = 1, maxOccurs = 1 _________ */ - DownBowPtr getDownBow() const; - void setDownBow( const DownBowPtr& value ); - - /* _________ Harmonic minOccurs = 1, maxOccurs = 1 _________ */ - HarmonicPtr getHarmonic() const; - void setHarmonic( const HarmonicPtr& value ); - - /* _________ OpenString minOccurs = 1, maxOccurs = 1 _________ */ - OpenStringPtr getOpenString() const; - void setOpenString( const OpenStringPtr& value ); - - /* _________ ThumbPosition minOccurs = 1, maxOccurs = 1 _________ */ - ThumbPositionPtr getThumbPosition() const; - void setThumbPosition( const ThumbPositionPtr& value ); - - /* _________ Fingering minOccurs = 1, maxOccurs = 1 _________ */ - FingeringPtr getFingering() const; - void setFingering( const FingeringPtr& value ); - - /* _________ Pluck minOccurs = 1, maxOccurs = 1 _________ */ - PluckPtr getPluck() const; - void setPluck( const PluckPtr& value ); - - /* _________ DoubleTongue minOccurs = 1, maxOccurs = 1 _________ */ - DoubleTonguePtr getDoubleTongue() const; - void setDoubleTongue( const DoubleTonguePtr& value ); - - /* _________ TripleTongue minOccurs = 1, maxOccurs = 1 _________ */ - TripleTonguePtr getTripleTongue() const; - void setTripleTongue( const TripleTonguePtr& value ); - - /* _________ Stopped minOccurs = 1, maxOccurs = 1 _________ */ - StoppedPtr getStopped() const; - void setStopped( const StoppedPtr& value ); - - /* _________ SnapPizzicato minOccurs = 1, maxOccurs = 1 _________ */ - SnapPizzicatoPtr getSnapPizzicato() const; - void setSnapPizzicato( const SnapPizzicatoPtr& value ); - - /* _________ Fret minOccurs = 1, maxOccurs = 1 _________ */ - FretPtr getFret() const; - void setFret( const FretPtr& value ); - - /* _________ String minOccurs = 1, maxOccurs = 1 _________ */ - StringPtr getString() const; - void setString( const StringPtr& value ); - - /* _________ HammerOn minOccurs = 1, maxOccurs = 1 _________ */ - HammerOnPtr getHammerOn() const; - void setHammerOn( const HammerOnPtr& value ); - - /* _________ PullOff minOccurs = 1, maxOccurs = 1 _________ */ - PullOffPtr getPullOff() const; - void setPullOff( const PullOffPtr& value ); - - /* _________ Bend minOccurs = 1, maxOccurs = 1 _________ */ - BendPtr getBend() const; - void setBend( const BendPtr& value ); - - /* _________ Tap minOccurs = 1, maxOccurs = 1 _________ */ - TapPtr getTap() const; - void setTap( const TapPtr& value ); - - /* _________ Heel minOccurs = 1, maxOccurs = 1 _________ */ - HeelPtr getHeel() const; - void setHeel( const HeelPtr& value ); - - /* _________ Toe minOccurs = 1, maxOccurs = 1 _________ */ - ToePtr getToe() const; - void setToe( const ToePtr& value ); - - /* _________ Fingernails minOccurs = 1, maxOccurs = 1 _________ */ - FingernailsPtr getFingernails() const; - void setFingernails( const FingernailsPtr& value ); - - /* _________ Hole minOccurs = 1, maxOccurs = 1 _________ */ - HolePtr getHole() const; - void setHole( const HolePtr& value ); - - /* _________ Arrow minOccurs = 1, maxOccurs = 1 _________ */ - ArrowPtr getArrow() const; - void setArrow( const ArrowPtr& value ); - - /* _________ Handbell minOccurs = 1, maxOccurs = 1 _________ */ - HandbellPtr getHandbell() const; - void setHandbell( const HandbellPtr& value ); - - /* _________ OtherTechnical minOccurs = 1, maxOccurs = 1 _________ */ - OtherTechnicalPtr getOtherTechnical() const; - void setOtherTechnical( const OtherTechnicalPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - UpBowPtr myUpBow; - DownBowPtr myDownBow; - HarmonicPtr myHarmonic; - OpenStringPtr myOpenString; - ThumbPositionPtr myThumbPosition; - FingeringPtr myFingering; - PluckPtr myPluck; - DoubleTonguePtr myDoubleTongue; - TripleTonguePtr myTripleTongue; - StoppedPtr myStopped; - SnapPizzicatoPtr mySnapPizzicato; - FretPtr myFret; - StringPtr myString; - HammerOnPtr myHammerOn; - PullOffPtr myPullOff; - BendPtr myBend; - TapPtr myTap; - HeelPtr myHeel; - ToePtr myToe; - FingernailsPtr myFingernails; - HolePtr myHole; - ArrowPtr myArrow; - HandbellPtr myHandbell; - OtherTechnicalPtr myOtherTechnical; - }; - } +MX_FORWARD_DECLARE_ELEMENT(Arrow) +MX_FORWARD_DECLARE_ELEMENT(Bend) +MX_FORWARD_DECLARE_ELEMENT(DoubleTongue) +MX_FORWARD_DECLARE_ELEMENT(DownBow) +MX_FORWARD_DECLARE_ELEMENT(Fingering) +MX_FORWARD_DECLARE_ELEMENT(Fingernails) +MX_FORWARD_DECLARE_ELEMENT(Fret) +MX_FORWARD_DECLARE_ELEMENT(HammerOn) +MX_FORWARD_DECLARE_ELEMENT(Handbell) +MX_FORWARD_DECLARE_ELEMENT(Harmonic) +MX_FORWARD_DECLARE_ELEMENT(Heel) +MX_FORWARD_DECLARE_ELEMENT(Hole) +MX_FORWARD_DECLARE_ELEMENT(OpenString) +MX_FORWARD_DECLARE_ELEMENT(OtherTechnical) +MX_FORWARD_DECLARE_ELEMENT(Pluck) +MX_FORWARD_DECLARE_ELEMENT(PullOff) +MX_FORWARD_DECLARE_ELEMENT(SnapPizzicato) +MX_FORWARD_DECLARE_ELEMENT(Stopped) +MX_FORWARD_DECLARE_ELEMENT(String) +MX_FORWARD_DECLARE_ELEMENT(Tap) +MX_FORWARD_DECLARE_ELEMENT(ThumbPosition) +MX_FORWARD_DECLARE_ELEMENT(Toe) +MX_FORWARD_DECLARE_ELEMENT(TripleTongue) +MX_FORWARD_DECLARE_ELEMENT(UpBow) +MX_FORWARD_DECLARE_ELEMENT(TechnicalChoice) + +inline TechnicalChoicePtr makeTechnicalChoice() +{ + return std::make_shared(); } + +class TechnicalChoice : public ElementInterface +{ + public: + enum class Choice + { + upBow = 1, + downBow = 2, + harmonic = 3, + openString = 4, + thumbPosition = 5, + fingering = 6, + pluck = 7, + doubleTongue = 8, + tripleTongue = 9, + stopped = 10, + snapPizzicato = 11, + fret = 12, + string_ = 13, + hammerOn = 14, + pullOff = 15, + bend = 16, + tap = 17, + heel = 18, + toe = 19, + fingernails = 20, + hole = 21, + arrow = 22, + handbell = 23, + otherTechnical = 24 + }; + TechnicalChoice(); + + virtual bool hasAttributes() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual bool hasContents() const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + + /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ + TechnicalChoice::Choice getChoice() const; + void setChoice(const TechnicalChoice::Choice value); + + /* _________ UpBow minOccurs = 1, maxOccurs = 1 _________ */ + UpBowPtr getUpBow() const; + void setUpBow(const UpBowPtr &value); + + /* _________ DownBow minOccurs = 1, maxOccurs = 1 _________ */ + DownBowPtr getDownBow() const; + void setDownBow(const DownBowPtr &value); + + /* _________ Harmonic minOccurs = 1, maxOccurs = 1 _________ */ + HarmonicPtr getHarmonic() const; + void setHarmonic(const HarmonicPtr &value); + + /* _________ OpenString minOccurs = 1, maxOccurs = 1 _________ */ + OpenStringPtr getOpenString() const; + void setOpenString(const OpenStringPtr &value); + + /* _________ ThumbPosition minOccurs = 1, maxOccurs = 1 _________ */ + ThumbPositionPtr getThumbPosition() const; + void setThumbPosition(const ThumbPositionPtr &value); + + /* _________ Fingering minOccurs = 1, maxOccurs = 1 _________ */ + FingeringPtr getFingering() const; + void setFingering(const FingeringPtr &value); + + /* _________ Pluck minOccurs = 1, maxOccurs = 1 _________ */ + PluckPtr getPluck() const; + void setPluck(const PluckPtr &value); + + /* _________ DoubleTongue minOccurs = 1, maxOccurs = 1 _________ */ + DoubleTonguePtr getDoubleTongue() const; + void setDoubleTongue(const DoubleTonguePtr &value); + + /* _________ TripleTongue minOccurs = 1, maxOccurs = 1 _________ */ + TripleTonguePtr getTripleTongue() const; + void setTripleTongue(const TripleTonguePtr &value); + + /* _________ Stopped minOccurs = 1, maxOccurs = 1 _________ */ + StoppedPtr getStopped() const; + void setStopped(const StoppedPtr &value); + + /* _________ SnapPizzicato minOccurs = 1, maxOccurs = 1 _________ */ + SnapPizzicatoPtr getSnapPizzicato() const; + void setSnapPizzicato(const SnapPizzicatoPtr &value); + + /* _________ Fret minOccurs = 1, maxOccurs = 1 _________ */ + FretPtr getFret() const; + void setFret(const FretPtr &value); + + /* _________ String minOccurs = 1, maxOccurs = 1 _________ */ + StringPtr getString() const; + void setString(const StringPtr &value); + + /* _________ HammerOn minOccurs = 1, maxOccurs = 1 _________ */ + HammerOnPtr getHammerOn() const; + void setHammerOn(const HammerOnPtr &value); + + /* _________ PullOff minOccurs = 1, maxOccurs = 1 _________ */ + PullOffPtr getPullOff() const; + void setPullOff(const PullOffPtr &value); + + /* _________ Bend minOccurs = 1, maxOccurs = 1 _________ */ + BendPtr getBend() const; + void setBend(const BendPtr &value); + + /* _________ Tap minOccurs = 1, maxOccurs = 1 _________ */ + TapPtr getTap() const; + void setTap(const TapPtr &value); + + /* _________ Heel minOccurs = 1, maxOccurs = 1 _________ */ + HeelPtr getHeel() const; + void setHeel(const HeelPtr &value); + + /* _________ Toe minOccurs = 1, maxOccurs = 1 _________ */ + ToePtr getToe() const; + void setToe(const ToePtr &value); + + /* _________ Fingernails minOccurs = 1, maxOccurs = 1 _________ */ + FingernailsPtr getFingernails() const; + void setFingernails(const FingernailsPtr &value); + + /* _________ Hole minOccurs = 1, maxOccurs = 1 _________ */ + HolePtr getHole() const; + void setHole(const HolePtr &value); + + /* _________ Arrow minOccurs = 1, maxOccurs = 1 _________ */ + ArrowPtr getArrow() const; + void setArrow(const ArrowPtr &value); + + /* _________ Handbell minOccurs = 1, maxOccurs = 1 _________ */ + HandbellPtr getHandbell() const; + void setHandbell(const HandbellPtr &value); + + /* _________ OtherTechnical minOccurs = 1, maxOccurs = 1 _________ */ + OtherTechnicalPtr getOtherTechnical() const; + void setOtherTechnical(const OtherTechnicalPtr &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + Choice myChoice; + UpBowPtr myUpBow; + DownBowPtr myDownBow; + HarmonicPtr myHarmonic; + OpenStringPtr myOpenString; + ThumbPositionPtr myThumbPosition; + FingeringPtr myFingering; + PluckPtr myPluck; + DoubleTonguePtr myDoubleTongue; + TripleTonguePtr myTripleTongue; + StoppedPtr myStopped; + SnapPizzicatoPtr mySnapPizzicato; + FretPtr myFret; + StringPtr myString; + HammerOnPtr myHammerOn; + PullOffPtr myPullOff; + BendPtr myBend; + TapPtr myTap; + HeelPtr myHeel; + ToePtr myToe; + FingernailsPtr myFingernails; + HolePtr myHole; + ArrowPtr myArrow; + HandbellPtr myHandbell; + OtherTechnicalPtr myOtherTechnical; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tenths.cpp b/Sourcecode/private/mx/core/elements/Tenths.cpp index 3c648e063..7a4a0bd2e 100644 --- a/Sourcecode/private/mx/core/elements/Tenths.cpp +++ b/Sourcecode/private/mx/core/elements/Tenths.cpp @@ -8,71 +8,62 @@ namespace mx { - namespace core - { - Tenths::Tenths() - :myValue() - {} - - - Tenths::Tenths( const TenthsValue& value ) - :myValue( value ) - {} - - - bool Tenths::hasAttributes() const - { - return false; - } - - - bool Tenths::hasContents() const - { - return true; - } - - - std::ostream& Tenths::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Tenths::streamName( std::ostream& os ) const - { - os << "tenths"; - return os; - } +namespace core +{ +Tenths::Tenths() : myValue() +{ +} +Tenths::Tenths(const TenthsValue &value) : myValue(value) +{ +} - std::ostream& Tenths::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +bool Tenths::hasAttributes() const +{ + return false; +} +bool Tenths::hasContents() const +{ + return true; +} - TenthsValue Tenths::getValue() const - { - return myValue; - } +std::ostream &Tenths::streamAttributes(std::ostream &os) const +{ + return os; +} +std::ostream &Tenths::streamName(std::ostream &os) const +{ + os << "tenths"; + return os; +} - void Tenths::setValue( const TenthsValue& value ) - { - myValue = value; - } +std::ostream &Tenths::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TenthsValue Tenths::getValue() const +{ + return myValue; +} - bool Tenths::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } +void Tenths::setValue(const TenthsValue &value) +{ + myValue = value; +} - } +bool Tenths::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + MX_UNUSED(message); + MX_UNUSED(xelement); + myValue.parse(xelement.getValue()); + return true; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tenths.h b/Sourcecode/private/mx/core/elements/Tenths.h index 8fbdba281..d47a19086 100644 --- a/Sourcecode/private/mx/core/elements/Tenths.h +++ b/Sourcecode/private/mx/core/elements/Tenths.h @@ -4,9 +4,9 @@ #pragma once -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" #include "mx/core/Decimals.h" +#include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include #include @@ -14,34 +14,45 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Tenths ) - - inline TenthsPtr makeTenths() { return std::make_shared(); } - inline TenthsPtr makeTenths( const TenthsValue& value ) { return std::make_shared( value ); } - inline TenthsPtr makeTenths( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Tenths : public ElementInterface - { - public: - Tenths(); - Tenths( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ELEMENT(Tenths) + +inline TenthsPtr makeTenths() +{ + return std::make_shared(); } + +inline TenthsPtr makeTenths(const TenthsValue &value) +{ + return std::make_shared(value); +} + +inline TenthsPtr makeTenths(TenthsValue &&value) +{ + return std::make_shared(std::move(value)); +} + +class Tenths : public ElementInterface +{ + public: + Tenths(); + Tenths(const TenthsValue &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TenthsValue getValue() const; + void setValue(const TenthsValue &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TenthsValue myValue; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tenuto.cpp b/Sourcecode/private/mx/core/elements/Tenuto.cpp index e1f281e20..c7b17aca9 100644 --- a/Sourcecode/private/mx/core/elements/Tenuto.cpp +++ b/Sourcecode/private/mx/core/elements/Tenuto.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Tenuto::Tenuto() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Tenuto::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Tenuto::hasContents() const { return false; } - std::ostream& Tenuto::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Tenuto::streamName( std::ostream& os ) const { os << "tenuto"; return os; } - std::ostream& Tenuto::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Tenuto::Tenuto() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Tenuto::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr Tenuto::getAttributes() const - { - return myAttributes; - } +bool Tenuto::hasContents() const +{ + return false; +} +std::ostream &Tenuto::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Tenuto::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Tenuto::streamName(std::ostream &os) const +{ + os << "tenuto"; + return os; +} +std::ostream &Tenuto::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Tenuto::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr Tenuto::getAttributes() const +{ + return myAttributes; +} +void Tenuto::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Tenuto::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tenuto.h b/Sourcecode/private/mx/core/elements/Tenuto.h index bc8481eea..2315842ee 100644 --- a/Sourcecode/private/mx/core/elements/Tenuto.h +++ b/Sourcecode/private/mx/core/elements/Tenuto.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Tenuto ) - - inline TenutoPtr makeTenuto() { return std::make_shared(); } - - class Tenuto : public ElementInterface - { - public: - Tenuto(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(Tenuto) + +inline TenutoPtr makeTenuto() +{ + return std::make_shared(); } + +class Tenuto : public ElementInterface +{ + public: + Tenuto(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Text.cpp b/Sourcecode/private/mx/core/elements/Text.cpp index 40a2f92fb..dd455c68b 100644 --- a/Sourcecode/private/mx/core/elements/Text.cpp +++ b/Sourcecode/private/mx/core/elements/Text.cpp @@ -8,92 +8,79 @@ namespace mx { - namespace core - { - Text::Text() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Text::Text( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Text::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Text::hasContents() const - { - return true; - } - - - std::ostream& Text::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Text::streamName( std::ostream& os ) const - { - os << "text"; - return os; - } - - - std::ostream& Text::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } +namespace core +{ +Text::Text() : myValue(), myAttributes(std::make_shared()) +{ +} +Text::Text(const XsString &value) : myValue(value), myAttributes(std::make_shared()) +{ +} - TextAttributesPtr Text::getAttributes() const - { - return myAttributes; - } +bool Text::hasAttributes() const +{ + return myAttributes->hasValues(); +} +bool Text::hasContents() const +{ + return true; +} - void Text::setAttributes( const TextAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Text::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} +std::ostream &Text::streamName(std::ostream &os) const +{ + os << "text"; + return os; +} - XsString Text::getValue() const - { - return myValue; - } +std::ostream &Text::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + os << myValue; + return os; +} +TextAttributesPtr Text::getAttributes() const +{ + return myAttributes; +} - void Text::setValue( const XsString& value ) - { - myValue = value; - } +void Text::setAttributes(const TextAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} +XsString Text::getValue() const +{ + return myValue; +} - bool Text::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } +void Text::setValue(const XsString &value) +{ + myValue = value; +} - } +bool Text::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + myValue.setValue(xelement.getValue()); + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Text.h b/Sourcecode/private/mx/core/elements/Text.h index bf0cb239a..f209617fc 100644 --- a/Sourcecode/private/mx/core/elements/Text.h +++ b/Sourcecode/private/mx/core/elements/Text.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/XsString.h" #include "mx/core/elements/TextAttributes.h" @@ -15,38 +15,49 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TextAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Text ) - - inline TextPtr makeText() { return std::make_shared(); } - inline TextPtr makeText( const XsString& value ) { return std::make_shared( value ); } - inline TextPtr makeText( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Text : public ElementInterface - { - public: - Text(); - Text( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TextAttributesPtr getAttributes() const; - void setAttributes( const TextAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - TextAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(TextAttributes) +MX_FORWARD_DECLARE_ELEMENT(Text) + +inline TextPtr makeText() +{ + return std::make_shared(); +} + +inline TextPtr makeText(const XsString &value) +{ + return std::make_shared(value); } + +inline TextPtr makeText(XsString &&value) +{ + return std::make_shared(std::move(value)); +} + +class Text : public ElementInterface +{ + public: + Text(); + Text(const XsString &value); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TextAttributesPtr getAttributes() const; + void setAttributes(const TextAttributesPtr &attributes); + XsString getValue() const; + void setValue(const XsString &value); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + XsString myValue; + TextAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TextAttributes.cpp b/Sourcecode/private/mx/core/elements/TextAttributes.cpp index 530da0831..a6505ace2 100644 --- a/Sourcecode/private/mx/core/elements/TextAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/TextAttributes.cpp @@ -8,92 +8,100 @@ namespace mx { - namespace core +namespace core +{ +TextAttributes::TextAttributes() + : fontFamily(), fontStyle(FontStyle::normal), fontSize(FontSize{CssFontSize::medium}), + fontWeight(FontWeight::normal), underline(), overline(), lineThrough(), rotation(), letterSpacing(), + lang(XmlLang{"it"}), hasFontFamily(false), hasFontStyle(false), hasFontSize(false), hasFontWeight(false), + hasUnderline(false), hasOverline(false), hasLineThrough(false), hasRotation(false), hasLetterSpacing(false), + hasLang(false) +{ +} + +bool TextAttributes::hasValues() const +{ + return hasFontFamily || hasFontStyle || hasFontSize || hasFontWeight || hasUnderline || hasOverline || + hasLineThrough || hasRotation || hasLetterSpacing || hasLang; +} + +std::ostream &TextAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) { - TextAttributes::TextAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lang( XmlLang{ "it" } ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLang( false ) - {} + streamAttribute(os, fontFamily, "font-family", hasFontFamily); + streamAttribute(os, fontStyle, "font-style", hasFontStyle); + streamAttribute(os, fontSize, "font-size", hasFontSize); + streamAttribute(os, fontWeight, "font-weight", hasFontWeight); + streamAttribute(os, underline, "underline", hasUnderline); + streamAttribute(os, overline, "overline", hasOverline); + streamAttribute(os, lineThrough, "line-through", hasLineThrough); + streamAttribute(os, rotation, "rotation", hasRotation); + streamAttribute(os, letterSpacing, "letter-spacing", hasLetterSpacing); + streamAttribute(os, lang, "xml:lang", hasLang); + } + return os; +} + +bool TextAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "TextAttributes"; + bool isSuccess = true; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool TextAttributes::hasValues() const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family")) { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLang; + continue; } - - - std::ostream& TextAttributes::toStream( std::ostream& os ) const + if (parseAttribute(message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle)) { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lang, "xml:lang", hasLang ); - } - return os; + continue; } - - - bool TextAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, fontSize, hasFontSize, "font-size")) { - const char* const className = "TextAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; + continue; + } + if (parseAttribute(message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", + &parseFontWeight)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, underline, hasUnderline, "underline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, overline, hasOverline, "overline")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, rotation, hasRotation, "rotation")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "lang")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lang, hasLang, "xml:lang")) + { + continue; } - } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TextAttributes.h b/Sourcecode/private/mx/core/elements/TextAttributes.h index 6187be664..ed9f64f5b 100644 --- a/Sourcecode/private/mx/core/elements/TextAttributes.h +++ b/Sourcecode/private/mx/core/elements/TextAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" #include "mx/core/FontSize.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" #include "mx/core/NumberOrNormal.h" #include "mx/core/XmlLang.h" @@ -20,40 +20,40 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( TextAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(TextAttributes) - struct TextAttributes : public AttributesInterface - { - public: - TextAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - XmlLang lang; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLang; +struct TextAttributes : public AttributesInterface +{ + public: + TextAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + CommaSeparatedText fontFamily; + FontStyle fontStyle; + FontSize fontSize; + FontWeight fontWeight; + NumberOfLines underline; + NumberOfLines overline; + NumberOfLines lineThrough; + RotationDegrees rotation; + NumberOrNormal letterSpacing; + XmlLang lang; + bool hasFontFamily; + bool hasFontStyle; + bool hasFontSize; + bool hasFontWeight; + bool hasUnderline; + bool hasOverline; + bool hasLineThrough; + bool hasRotation; + bool hasLetterSpacing; + bool hasLang; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ThumbPosition.cpp b/Sourcecode/private/mx/core/elements/ThumbPosition.cpp index a6b7886b0..b3f6967a5 100644 --- a/Sourcecode/private/mx/core/elements/ThumbPosition.cpp +++ b/Sourcecode/private/mx/core/elements/ThumbPosition.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - ThumbPosition::ThumbPosition() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool ThumbPosition::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool ThumbPosition::hasContents() const { return false; } - std::ostream& ThumbPosition::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& ThumbPosition::streamName( std::ostream& os ) const { os << "thumb-position"; return os; } - std::ostream& ThumbPosition::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +ThumbPosition::ThumbPosition() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool ThumbPosition::hasAttributes() const +{ + return myAttributes->hasValues(); +} - EmptyPlacementAttributesPtr ThumbPosition::getAttributes() const - { - return myAttributes; - } +bool ThumbPosition::hasContents() const +{ + return false; +} +std::ostream &ThumbPosition::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void ThumbPosition::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &ThumbPosition::streamName(std::ostream &os) const +{ + os << "thumb-position"; + return os; +} +std::ostream &ThumbPosition::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool ThumbPosition::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +EmptyPlacementAttributesPtr ThumbPosition::getAttributes() const +{ + return myAttributes; +} +void ThumbPosition::setAttributes(const EmptyPlacementAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool ThumbPosition::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/ThumbPosition.h b/Sourcecode/private/mx/core/elements/ThumbPosition.h index c1475e3ab..cdd6ff5a7 100644 --- a/Sourcecode/private/mx/core/elements/ThumbPosition.h +++ b/Sourcecode/private/mx/core/elements/ThumbPosition.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/EmptyPlacementAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ThumbPosition ) - - inline ThumbPositionPtr makeThumbPosition() { return std::make_shared(); } - - class ThumbPosition : public ElementInterface - { - public: - ThumbPosition(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(EmptyPlacementAttributes) +MX_FORWARD_DECLARE_ELEMENT(ThumbPosition) + +inline ThumbPositionPtr makeThumbPosition() +{ + return std::make_shared(); } + +class ThumbPosition : public ElementInterface +{ + public: + ThumbPosition(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + EmptyPlacementAttributesPtr getAttributes() const; + void setAttributes(const EmptyPlacementAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + EmptyPlacementAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tie.cpp b/Sourcecode/private/mx/core/elements/Tie.cpp index a1385ace3..a82b216f5 100644 --- a/Sourcecode/private/mx/core/elements/Tie.cpp +++ b/Sourcecode/private/mx/core/elements/Tie.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Tie::Tie() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Tie::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Tie::hasContents() const { return false; } - std::ostream& Tie::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Tie::streamName( std::ostream& os ) const { os << "tie"; return os; } - std::ostream& Tie::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Tie::Tie() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Tie::hasAttributes() const +{ + return myAttributes->hasValues(); +} - TieAttributesPtr Tie::getAttributes() const - { - return myAttributes; - } +bool Tie::hasContents() const +{ + return false; +} +std::ostream &Tie::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Tie::setAttributes( const TieAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Tie::streamName(std::ostream &os) const +{ + os << "tie"; + return os; +} +std::ostream &Tie::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Tie::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +TieAttributesPtr Tie::getAttributes() const +{ + return myAttributes; +} +void Tie::setAttributes(const TieAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Tie::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tie.h b/Sourcecode/private/mx/core/elements/Tie.h index bd649587c..27c16068d 100644 --- a/Sourcecode/private/mx/core/elements/Tie.h +++ b/Sourcecode/private/mx/core/elements/Tie.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/TieAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TieAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Tie ) - - inline TiePtr makeTie() { return std::make_shared(); } - - class Tie : public ElementInterface - { - public: - Tie(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TieAttributesPtr getAttributes() const; - void setAttributes( const TieAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TieAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(TieAttributes) +MX_FORWARD_DECLARE_ELEMENT(Tie) + +inline TiePtr makeTie() +{ + return std::make_shared(); } + +class Tie : public ElementInterface +{ + public: + Tie(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TieAttributesPtr getAttributes() const; + void setAttributes(const TieAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TieAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TieAttributes.cpp b/Sourcecode/private/mx/core/elements/TieAttributes.cpp index faf812469..f25012835 100644 --- a/Sourcecode/private/mx/core/elements/TieAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/TieAttributes.cpp @@ -8,57 +8,56 @@ namespace mx { - namespace core - { - TieAttributes::TieAttributes() - :type( StartStop::start ) - ,timeOnly() - ,hasType( true ) - ,hasTimeOnly( false ) - {} +namespace core +{ +TieAttributes::TieAttributes() : type(StartStop::start), timeOnly(), hasType(true), hasTimeOnly(false) +{ +} +bool TieAttributes::hasValues() const +{ + return hasType || hasTimeOnly; +} - bool TieAttributes::hasValues() const - { - return hasType || - hasTimeOnly; - } +std::ostream &TieAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + streamAttribute(os, timeOnly, "time-only", hasTimeOnly); + } + return os; +} + +bool TieAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "TieAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - std::ostream& TieAttributes::toStream( std::ostream& os ) const + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop)) { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, timeOnly, "time-only", hasTimeOnly ); - } - return os; + continue; } - - - bool TieAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) + if (parseAttribute(message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only")) { - const char* const className = "TieAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; + continue; } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TieAttributes.h b/Sourcecode/private/mx/core/elements/TieAttributes.h index 64abadfc1..efe4b6996 100644 --- a/Sourcecode/private/mx/core/elements/TieAttributes.h +++ b/Sourcecode/private/mx/core/elements/TieAttributes.h @@ -4,10 +4,10 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" #include "mx/core/CommaSeparatedText.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/TimeOnly.h" #include @@ -16,24 +16,24 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( TieAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(TieAttributes) - struct TieAttributes : public AttributesInterface - { - public: - TieAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - TimeOnly timeOnly; - const bool hasType; - bool hasTimeOnly; +struct TieAttributes : public AttributesInterface +{ + public: + TieAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStop type; + TimeOnly timeOnly; + const bool hasType; + bool hasTimeOnly; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tied.cpp b/Sourcecode/private/mx/core/elements/Tied.cpp index dce63994e..801ee50fe 100644 --- a/Sourcecode/private/mx/core/elements/Tied.cpp +++ b/Sourcecode/private/mx/core/elements/Tied.cpp @@ -8,59 +8,61 @@ namespace mx { - namespace core - { - Tied::Tied() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Tied::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Tied::hasContents() const { return false; } - std::ostream& Tied::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Tied::streamName( std::ostream& os ) const { os << "tied"; return os; } - std::ostream& Tied::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } +namespace core +{ +Tied::Tied() : ElementInterface(), myAttributes(std::make_shared()) +{ +} +bool Tied::hasAttributes() const +{ + return myAttributes->hasValues(); +} - TiedAttributesPtr Tied::getAttributes() const - { - return myAttributes; - } +bool Tied::hasContents() const +{ + return false; +} +std::ostream &Tied::streamAttributes(std::ostream &os) const +{ + if (myAttributes) + { + myAttributes->toStream(os); + } + return os; +} - void Tied::setAttributes( const TiedAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } +std::ostream &Tied::streamName(std::ostream &os) const +{ + os << "tied"; + return os; +} +std::ostream &Tied::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + MX_UNUSED(indentLevel); + isOneLineOnly = true; + return os; +} - bool Tied::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } +TiedAttributesPtr Tied::getAttributes() const +{ + return myAttributes; +} +void Tied::setAttributes(const TiedAttributesPtr &value) +{ + if (value) + { + myAttributes = value; } } + +bool Tied::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + return myAttributes->fromXElement(message, xelement); +} + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Tied.h b/Sourcecode/private/mx/core/elements/Tied.h index 9d785c3a0..7780f36e8 100644 --- a/Sourcecode/private/mx/core/elements/Tied.h +++ b/Sourcecode/private/mx/core/elements/Tied.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/TiedAttributes.h" #include @@ -14,32 +14,35 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TiedAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Tied ) - - inline TiedPtr makeTied() { return std::make_shared(); } - - class Tied : public ElementInterface - { - public: - Tied(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TiedAttributesPtr getAttributes() const; - void setAttributes( const TiedAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TiedAttributesPtr myAttributes; - }; - } +namespace core +{ + +MX_FORWARD_DECLARE_ATTRIBUTES(TiedAttributes) +MX_FORWARD_DECLARE_ELEMENT(Tied) + +inline TiedPtr makeTied() +{ + return std::make_shared(); } + +class Tied : public ElementInterface +{ + public: + Tied(); + + virtual bool hasAttributes() const; + virtual bool hasContents() const; + virtual std::ostream &streamAttributes(std::ostream &os) const; + virtual std::ostream &streamName(std::ostream &os) const; + virtual std::ostream &streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const; + TiedAttributesPtr getAttributes() const; + void setAttributes(const TiedAttributesPtr &attributes); + + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); + + private: + TiedAttributesPtr myAttributes; +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TiedAttributes.cpp b/Sourcecode/private/mx/core/elements/TiedAttributes.cpp index abd228bc4..20a4d1093 100644 --- a/Sourcecode/private/mx/core/elements/TiedAttributes.cpp +++ b/Sourcecode/private/mx/core/elements/TiedAttributes.cpp @@ -8,137 +8,146 @@ namespace mx { - namespace core - { - TiedAttributes::TiedAttributes() - :type( StartStopContinue::start ) - ,number() - ,lineType( LineType::solid ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,orientation() - ,bezierOffset() - ,bezierOffset2() - ,bezierX() - ,bezierY() - ,bezierX2() - ,bezierY2() - ,color() - ,hasType( true ) - ,hasNumber( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - ,hasOrientation( false ) - ,hasBezierOffset( false ) - ,hasBezierOffset2( false ) - ,hasBezierX( false ) - ,hasBezierY( false ) - ,hasBezierX2( false ) - ,hasBezierY2( false ) - ,hasColor( false ) - {} - +namespace core +{ +TiedAttributes::TiedAttributes() + : type(StartStopContinue::start), number(), lineType(LineType::solid), dashLength(), spaceLength(), defaultX(), + defaultY(), relativeX(), relativeY(), placement(AboveBelow::below), orientation(), bezierOffset(), + bezierOffset2(), bezierX(), bezierY(), bezierX2(), bezierY2(), color(), hasType(true), hasNumber(false), + hasLineType(false), hasDashLength(false), hasSpaceLength(false), hasDefaultX(false), hasDefaultY(false), + hasRelativeX(false), hasRelativeY(false), hasPlacement(false), hasOrientation(false), hasBezierOffset(false), + hasBezierOffset2(false), hasBezierX(false), hasBezierY(false), hasBezierX2(false), hasBezierY2(false), + hasColor(false) +{ +} - bool TiedAttributes::hasValues() const - { - return hasType || - hasNumber || - hasLineType || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement || - hasOrientation || - hasBezierOffset || - hasBezierOffset2 || - hasBezierX || - hasBezierY || - hasBezierX2 || - hasBezierY2 || - hasColor; - } +bool TiedAttributes::hasValues() const +{ + return hasType || hasNumber || hasLineType || hasDashLength || hasSpaceLength || hasDefaultX || hasDefaultY || + hasRelativeX || hasRelativeY || hasPlacement || hasOrientation || hasBezierOffset || hasBezierOffset2 || + hasBezierX || hasBezierY || hasBezierX2 || hasBezierY2 || hasColor; +} +std::ostream &TiedAttributes::toStream(std::ostream &os) const +{ + if (hasValues()) + { + streamAttribute(os, type, "type", hasType); + streamAttribute(os, number, "number", hasNumber); + streamAttribute(os, lineType, "line-type", hasLineType); + streamAttribute(os, dashLength, "dash-length", hasDashLength); + streamAttribute(os, spaceLength, "space-length", hasSpaceLength); + streamAttribute(os, defaultX, "default-x", hasDefaultX); + streamAttribute(os, defaultY, "default-y", hasDefaultY); + streamAttribute(os, relativeX, "relative-x", hasRelativeX); + streamAttribute(os, relativeY, "relative-y", hasRelativeY); + streamAttribute(os, placement, "placement", hasPlacement); + streamAttribute(os, orientation, "orientation", hasOrientation); + streamAttribute(os, bezierOffset, "bezier-offset", hasBezierOffset); + streamAttribute(os, bezierOffset2, "bezier-offset2", hasBezierOffset2); + streamAttribute(os, bezierX, "bezier-x", hasBezierX); + streamAttribute(os, bezierY, "bezier-y", hasBezierY); + streamAttribute(os, bezierX2, "bezier-x2", hasBezierX2); + streamAttribute(os, bezierY2, "bezier-y2", hasBezierY2); + streamAttribute(os, color, "color", hasColor); + } + return os; +} - std::ostream& TiedAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, orientation, "orientation", hasOrientation ); - streamAttribute( os, bezierOffset, "bezier-offset", hasBezierOffset ); - streamAttribute( os, bezierOffset2, "bezier-offset2", hasBezierOffset2 ); - streamAttribute( os, bezierX, "bezier-x", hasBezierX ); - streamAttribute( os, bezierY, "bezier-y", hasBezierY ); - streamAttribute( os, bezierX2, "bezier-x2", hasBezierX2 ); - streamAttribute( os, bezierY2, "bezier-y2", hasBezierY2 ); - streamAttribute( os, color, "color", hasColor ); - } - return os; - } +bool TiedAttributes::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + const char *const className = "TiedAttributes"; + bool isSuccess = true; + bool isTypeFound = false; + auto it = xelement.attributesBegin(); + auto endIter = xelement.attributesEnd(); - bool TiedAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "TiedAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, orientation, hasOrientation, "orientation", &parseOverUnder ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierOffset, hasBezierOffset, "bezier-offset" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierOffset2, hasBezierOffset2, "bezier-offset-2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierX, hasBezierX, "bezier-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierY, hasBezierY, "bezier-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierX2, hasBezierX2, "bezier-x-2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierY2, hasBezierY2, "bezier-y-2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; + for (; it != endIter; ++it) + { + if (parseAttribute(message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, number, hasNumber, "number")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, dashLength, hasDashLength, "dash-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultX, hasDefaultX, "default-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, defaultY, hasDefaultY, "default-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow)) + { + continue; } + if (parseAttribute(message, it, className, isSuccess, orientation, hasOrientation, "orientation", + &parseOverUnder)) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierOffset, hasBezierOffset, "bezier-offset")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierOffset2, hasBezierOffset2, "bezier-offset-2")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierX, hasBezierX, "bezier-x")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierY, hasBezierY, "bezier-y")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierX2, hasBezierX2, "bezier-x-2")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, bezierY2, hasBezierY2, "bezier-y-2")) + { + continue; + } + if (parseAttribute(message, it, className, isSuccess, color, hasColor, "color")) + { + continue; + } + } + if (!isTypeFound) + { + isSuccess = false; + message << className << ": 'number' is a required attribute but was not found" << std::endl; } + + MX_RETURN_IS_SUCCESS; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/TiedAttributes.h b/Sourcecode/private/mx/core/elements/TiedAttributes.h index e1d31edcc..7945b4820 100644 --- a/Sourcecode/private/mx/core/elements/TiedAttributes.h +++ b/Sourcecode/private/mx/core/elements/TiedAttributes.h @@ -4,12 +4,12 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/AttributesInterface.h" +#include "mx/core/Color.h" #include "mx/core/Decimals.h" #include "mx/core/Enums.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/Integers.h" -#include "mx/core/Color.h" #include #include @@ -17,56 +17,56 @@ namespace mx { - namespace core - { +namespace core +{ - MX_FORWARD_DECLARE_ATTRIBUTES( TiedAttributes ) +MX_FORWARD_DECLARE_ATTRIBUTES(TiedAttributes) - struct TiedAttributes : public AttributesInterface - { - public: - TiedAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopContinue type; - NumberLevel number; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - OverUnder orientation; - DivisionsValue bezierOffset; - DivisionsValue bezierOffset2; - TenthsValue bezierX; - TenthsValue bezierY; - TenthsValue bezierX2; - TenthsValue bezierY2; - Color color; - const bool hasType; - bool hasNumber; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; - bool hasOrientation; - bool hasBezierOffset; - bool hasBezierOffset2; - bool hasBezierX; - bool hasBezierY; - bool hasBezierX2; - bool hasBezierY2; - bool hasColor; +struct TiedAttributes : public AttributesInterface +{ + public: + TiedAttributes(); + virtual bool hasValues() const; + virtual std::ostream &toStream(std::ostream &os) const; + StartStopContinue type; + NumberLevel number; + LineType lineType; + TenthsValue dashLength; + TenthsValue spaceLength; + TenthsValue defaultX; + TenthsValue defaultY; + TenthsValue relativeX; + TenthsValue relativeY; + AboveBelow placement; + OverUnder orientation; + DivisionsValue bezierOffset; + DivisionsValue bezierOffset2; + TenthsValue bezierX; + TenthsValue bezierY; + TenthsValue bezierX2; + TenthsValue bezierY2; + Color color; + const bool hasType; + bool hasNumber; + bool hasLineType; + bool hasDashLength; + bool hasSpaceLength; + bool hasDefaultX; + bool hasDefaultY; + bool hasRelativeX; + bool hasRelativeY; + bool hasPlacement; + bool hasOrientation; + bool hasBezierOffset; + bool hasBezierOffset2; + bool hasBezierX; + bool hasBezierY; + bool hasBezierX2; + bool hasBezierY2; + bool hasColor; - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} + private: + virtual bool fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement); +}; +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Time.cpp b/Sourcecode/private/mx/core/elements/Time.cpp index ebb7e625d..490382851 100644 --- a/Sourcecode/private/mx/core/elements/Time.cpp +++ b/Sourcecode/private/mx/core/elements/Time.cpp @@ -4,120 +4,109 @@ #include "mx/core/elements/Time.h" #include "mx/core/FromXElement.h" -#include "mx/core/elements/TimeChoice.h" #include "mx/core/elements/SenzaMisura.h" +#include "mx/core/elements/TimeChoice.h" #include "mx/core/elements/TimeSignatureGroup.h" #include namespace mx { - namespace core - { - Time::Time() - :myAttributes( std::make_shared() ) - ,myChoice( makeTimeChoice() ) - {} +namespace core +{ +Time::Time() : myAttributes(std::make_shared()), myChoice(makeTimeChoice()) +{ +} +bool Time::hasAttributes() const +{ + return myAttributes->hasValues(); +} - bool Time::hasAttributes() const - { - return myAttributes->hasValues(); - } +std::ostream &Time::streamAttributes(std::ostream &os) const +{ + return myAttributes->toStream(os); +} +std::ostream &Time::streamName(std::ostream &os) const +{ + os << "time"; + return os; +} - std::ostream& Time::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } +bool Time::hasContents() const +{ + return true; +} +std::ostream &Time::streamContents(std::ostream &os, const int indentLevel, bool &isOneLineOnly) const +{ + os << std::endl; + myChoice->streamContents(os, indentLevel + 1, isOneLineOnly); + os << std::endl; + isOneLineOnly = false; + return os; +} - std::ostream& Time::streamName( std::ostream& os ) const - { - os << "time"; - return os; - } +TimeAttributesPtr Time::getAttributes() const +{ + return myAttributes; +} +void Time::setAttributes(const TimeAttributesPtr &value) +{ + if (value) + { + myAttributes = value; + } +} - bool Time::hasContents() const - { - return true; - } +TimeChoicePtr Time::getTimeChoice() const +{ + return myChoice; +} +void Time::setTimeChoice(const TimeChoicePtr &value) +{ + myChoice = value; +} - std::ostream& Time::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - return os; - } +bool Time::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) +{ + bool isSuccess = true; + isSuccess &= myAttributes->fromXElement(message, xelement); + bool isFirstTimeSignatureAdded = false; + auto endIter = xelement.end(); - TimeAttributesPtr Time::getAttributes() const + for (auto it = xelement.begin(); it != endIter; ++it) + { + if (it->getName() == "senza-misura") { - return myAttributes; + myChoice->setChoice(TimeChoice::Choice::senzaMisura); + isSuccess &= myChoice->getSenzaMisura()->fromXElement(message, *it); } - - - void Time::setAttributes( const TimeAttributesPtr& value ) + else { - if ( value ) + myChoice->setChoice(TimeChoice::Choice::timeSignature); + auto timeSignature = makeTimeSignatureGroup(); + importGroup(message, it, endIter, isSuccess, timeSignature); + + if (!isFirstTimeSignatureAdded && myChoice->getTimeSignatureGroupSet().size() == 1) { - myAttributes = value; + myChoice->addTimeSignatureGroup(timeSignature); + myChoice->removeTimeSignatureGroup(myChoice->getTimeSignatureGroupSet().cbegin()); + isFirstTimeSignatureAdded = true; } - } - - - TimeChoicePtr Time::getTimeChoice() const - { - return myChoice; - } - - - void Time::setTimeChoice( const TimeChoicePtr& value ) - { - myChoice = value; - } - - - bool Time::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isFirstTimeSignatureAdded = false; - - auto endIter = xelement.end(); - - for( auto it = xelement.begin(); it != endIter; ++it ) + else { - if( it->getName() == "senza-misura" ) - { - myChoice->setChoice( TimeChoice::Choice::senzaMisura ); - isSuccess &= myChoice->getSenzaMisura()->fromXElement( message, *it ); - } - else - { - myChoice->setChoice( TimeChoice::Choice::timeSignature ); - auto timeSignature = makeTimeSignatureGroup(); - importGroup( message, it, endIter, isSuccess, timeSignature ); - - if( !isFirstTimeSignatureAdded && myChoice->getTimeSignatureGroupSet().size() == 1 ) - { - myChoice->addTimeSignatureGroup( timeSignature ); - myChoice->removeTimeSignatureGroup( myChoice->getTimeSignatureGroupSet().cbegin() ); - isFirstTimeSignatureAdded = true; - } - else - { - myChoice->addTimeSignatureGroup( timeSignature ); - isFirstTimeSignatureAdded = true; - } - } + myChoice->addTimeSignatureGroup(timeSignature); + isFirstTimeSignatureAdded = true; } - - return isSuccess; } - } + + return isSuccess; } + +} // namespace core +} // namespace mx diff --git a/Sourcecode/private/mx/core/elements/Time.h b/Sourcecode/private/mx/core/elements/Time.h index f951f6758..addbe98c6 100644 --- a/Sourcecode/private/mx/core/elements/Time.h +++ b/Sourcecode/private/mx/core/elements/Time.h @@ -4,8 +4,8 @@ #pragma once -#include "mx/core/ForwardDeclare.h" #include "mx/core/ElementInterface.h" +#include "mx/core/ForwardDeclare.h" #include "mx/core/elements/TimeAttributes.h" #include @@ -14,36 +14,39 @@ namespace mx { - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TimeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( TimeChoice ) - MX_FORWARD_DECLARE_ELEMENT( Time ) - - inline TimePtr makeTime() { return std::make_shared - CHECK( pageM0.isUsed() ); - CHECK( Bool::unspecified == pageM0.newPage); - CHECK( pageM0.pageLayoutData.isUsed() ); - CHECK_DOUBLES_EQUAL( 1545.0, pageM0.pageLayoutData.size.value().height, MX_API_EQUALITY_EPSILON ); - CHECK_DOUBLES_EQUAL( 1194.0, pageM0.pageLayoutData.size.value().width, MX_API_EQUALITY_EPSILON ); - CHECK( !pageM0.pageLayoutData.margins.isUsed() ); - CHECK( pageM0.pageNumber ); - CHECK( "1" == *pageM0.pageNumber ); - CHECK( Bool::unspecified == systemM0.newSystem ); - CHECK( systemM0.layout.margins ); - CHECK_DOUBLES_EQUAL( 0.0, systemM0.layout.margins.value().right, MX_API_EQUALITY_EPSILON ); - CHECK_DOUBLES_EQUAL( 70.0, systemM0.layout.margins.value().left, MX_API_EQUALITY_EPSILON ); - CHECK( !systemM0.layout.systemDistance ); - CHECK( systemM0.layout.topSystemDistance ); - CHECK_DOUBLES_EQUAL( 211.0, systemM0.layout.topSystemDistance.value(), MX_API_EQUALITY_EPSILON ); + CHECK(pageM0.isUsed()); + CHECK(Bool::unspecified == pageM0.newPage); + CHECK(pageM0.pageLayoutData.isUsed()); + CHECK_DOUBLES_EQUAL(1545.0, pageM0.pageLayoutData.size.value().height, MX_API_EQUALITY_EPSILON); + CHECK_DOUBLES_EQUAL(1194.0, pageM0.pageLayoutData.size.value().width, MX_API_EQUALITY_EPSILON); + CHECK(!pageM0.pageLayoutData.margins.isUsed()); + CHECK(pageM0.pageNumber); + CHECK("1" == *pageM0.pageNumber); + CHECK(Bool::unspecified == systemM0.newSystem); + CHECK(systemM0.layout.margins); + CHECK_DOUBLES_EQUAL(0.0, systemM0.layout.margins.value().right, MX_API_EQUALITY_EPSILON); + CHECK_DOUBLES_EQUAL(70.0, systemM0.layout.margins.value().left, MX_API_EQUALITY_EPSILON); + CHECK(!systemM0.layout.systemDistance); + CHECK(systemM0.layout.topSystemDistance); + CHECK_DOUBLES_EQUAL(211.0, systemM0.layout.topSystemDistance.value(), MX_API_EQUALITY_EPSILON); // Measure 3 (measure index 2) // @@ -239,20 +239,20 @@ TEST( LoadFinaleExport, PageData ) // 114 // // - CHECK( Bool::yes == systemM2.newSystem ); - CHECK( !systemM2.layout.margins ); - CHECK( systemM2.layout.systemDistance ); - CHECK_DOUBLES_EQUAL( 114.0, systemM2.layout.systemDistance.value(), MX_API_EQUALITY_EPSILON ); - CHECK( !systemM2.layout.topSystemDistance ); + CHECK(Bool::yes == systemM2.newSystem); + CHECK(!systemM2.layout.margins); + CHECK(systemM2.layout.systemDistance); + CHECK_DOUBLES_EQUAL(114.0, systemM2.layout.systemDistance.value(), MX_API_EQUALITY_EPSILON); + CHECK(!systemM2.layout.topSystemDistance); // Measure 5 (measure index 4) // - CHECK( pageM4.isUsed() ); - CHECK( Bool::yes == pageM4.newPage ); - CHECK( !pageM4.pageLayoutData.isUsed() ); - CHECK( !pageM4.pageLayoutData.margins.isUsed() ); - CHECK( pageM4.pageNumber ); - CHECK( "2" == *pageM4.pageNumber ); + CHECK(pageM4.isUsed()); + CHECK(Bool::yes == pageM4.newPage); + CHECK(!pageM4.pageLayoutData.isUsed()); + CHECK(!pageM4.pageLayoutData.margins.isUsed()); + CHECK(pageM4.pageNumber); + CHECK("2" == *pageM4.pageNumber); // Measure 9 (measure index 8) // @@ -260,11 +260,11 @@ TEST( LoadFinaleExport, PageData ) // 114 // // - CHECK( Bool::yes == systemM8.newSystem ); - CHECK( !systemM8.layout.margins ); - CHECK( systemM8.layout.systemDistance ); - CHECK_DOUBLES_EQUAL( 114.0, systemM8.layout.systemDistance.value(), MX_API_EQUALITY_EPSILON ); - CHECK( !systemM8.layout.topSystemDistance ); + CHECK(Bool::yes == systemM8.newSystem); + CHECK(!systemM8.layout.margins); + CHECK(systemM8.layout.systemDistance); + CHECK_DOUBLES_EQUAL(114.0, systemM8.layout.systemDistance.value(), MX_API_EQUALITY_EPSILON); + CHECK(!systemM8.layout.topSystemDistance); // Measure 13 (measure index 12) // @@ -273,13 +273,13 @@ TEST( LoadFinaleExport, PageData ) // 1194 // // - CHECK( Bool::yes == pageM12.newPage); - CHECK( pageM12.pageLayoutData.isUsed() ); - CHECK_DOUBLES_EQUAL( 1599.0, pageM12.pageLayoutData.size.value().height, MX_API_EQUALITY_EPSILON ); - CHECK_DOUBLES_EQUAL( 1203.0, pageM12.pageLayoutData.size.value().width, MX_API_EQUALITY_EPSILON ); - CHECK( !pageM12.pageLayoutData.margins.isUsed() ); - CHECK( pageM12.pageNumber ); - CHECK( "3" == *pageM12.pageNumber ); + CHECK(Bool::yes == pageM12.newPage); + CHECK(pageM12.pageLayoutData.isUsed()); + CHECK_DOUBLES_EQUAL(1599.0, pageM12.pageLayoutData.size.value().height, MX_API_EQUALITY_EPSILON); + CHECK_DOUBLES_EQUAL(1203.0, pageM12.pageLayoutData.size.value().width, MX_API_EQUALITY_EPSILON); + CHECK(!pageM12.pageLayoutData.margins.isUsed()); + CHECK(pageM12.pageNumber); + CHECK("3" == *pageM12.pageNumber); // Measure 22 (measure index 21) // @@ -288,13 +288,13 @@ TEST( LoadFinaleExport, PageData ) // 1194 // // - CHECK( Bool::yes == pageM21.newPage); - CHECK( pageM21.pageLayoutData.isUsed() ); - CHECK_DOUBLES_EQUAL( 1775.0, pageM21.pageLayoutData.size.value().height, MX_API_EQUALITY_EPSILON ); - CHECK_DOUBLES_EQUAL( 1776.0, pageM21.pageLayoutData.size.value().width, MX_API_EQUALITY_EPSILON ); - CHECK( !pageM21.pageLayoutData.margins.isUsed() ); - CHECK( pageM21.pageNumber ); - CHECK( "4" == *pageM21.pageNumber ); + CHECK(Bool::yes == pageM21.newPage); + CHECK(pageM21.pageLayoutData.isUsed()); + CHECK_DOUBLES_EQUAL(1775.0, pageM21.pageLayoutData.size.value().height, MX_API_EQUALITY_EPSILON); + CHECK_DOUBLES_EQUAL(1776.0, pageM21.pageLayoutData.size.value().width, MX_API_EQUALITY_EPSILON); + CHECK(!pageM21.pageLayoutData.margins.isUsed()); + CHECK(pageM21.pageNumber); + CHECK("4" == *pageM21.pageNumber); } #endif diff --git a/Sourcecode/private/mxtest/api/PitchDataTest.cpp b/Sourcecode/private/mxtest/api/PitchDataTest.cpp index 7b975a6c1..d59ef7cf9 100644 --- a/Sourcecode/private/mxtest/api/PitchDataTest.cpp +++ b/Sourcecode/private/mxtest/api/PitchDataTest.cpp @@ -7,27 +7,27 @@ #ifdef MX_COMPILE_API_TESTS #include "cpul/cpulTestHarness.h" +#include "ezxml/ezxml.h" #include "mx/api/DocumentManager.h" #include "mx/core/Document.h" -#include "mx/core/elements/ScorePartwise.h" -#include "mx/core/elements/PartwisePart.h" -#include "mx/core/elements/PartwiseMeasure.h" -#include "mx/core/elements/MusicDataGroup.h" -#include "mx/core/elements/Note.h" -#include "mx/core/elements/NoteChoice.h" -#include "mx/core/elements/NormalNoteGroup.h" +#include "mx/core/elements/Direction.h" +#include "mx/core/elements/DirectionType.h" #include "mx/core/elements/FullNoteGroup.h" #include "mx/core/elements/FullNoteTypeChoice.h" -#include "mx/core/elements/Pitch.h" +#include "mx/core/elements/MusicDataChoice.h" +#include "mx/core/elements/MusicDataGroup.h" +#include "mx/core/elements/NormalNoteGroup.h" #include "mx/core/elements/Notations.h" #include "mx/core/elements/NotationsChoice.h" -#include "mx/core/elements/Tied.h" -#include "mx/core/elements/MusicDataChoice.h" -#include "mx/core/elements/Direction.h" -#include "mx/core/elements/DirectionType.h" +#include "mx/core/elements/Note.h" +#include "mx/core/elements/NoteChoice.h" #include "mx/core/elements/Offset.h" +#include "mx/core/elements/PartwiseMeasure.h" +#include "mx/core/elements/PartwisePart.h" #include "mx/core/elements/Pedal.h" -#include "ezxml/ezxml.h" +#include "mx/core/elements/Pitch.h" +#include "mx/core/elements/ScorePartwise.h" +#include "mx/core/elements/Tied.h" #include @@ -36,118 +36,118 @@ using namespace mx::api; namespace { - ezxml::XElementPtr bruteForceFindFirstElement( const ezxml::XElementPtr root, const std::string& inElementName ) +ezxml::XElementPtr bruteForceFindFirstElement(const ezxml::XElementPtr root, const std::string &inElementName) +{ + if (!root) { - if( !root ) - { - throw std::runtime_error{ "bug in bruteForceFindFirstElement" }; - } + throw std::runtime_error{"bug in bruteForceFindFirstElement"}; + } - if( root->getName() == inElementName ) - { - return root; - } + if (root->getName() == inElementName) + { + return root; + } - auto iter = root->begin(); - const auto end = root->end(); + auto iter = root->begin(); + const auto end = root->end(); - for( ; iter != end; ++iter ) + for (; iter != end; ++iter) + { + const auto possible = bruteForceFindFirstElement(iter->clone(), inElementName); + if (possible && possible->getName() == inElementName) { - const auto possible = bruteForceFindFirstElement( iter->clone(), inElementName ); - if( possible && possible->getName() == inElementName ) - { - return possible; - } + return possible; } - - return nullptr; } - struct Input - { - Step step; - int alter; - double cents; - Accidental accidental; - }; + return nullptr; +} - struct Output - { - Step step; - int alter; - double cents; - Accidental accidental; - std::string alterString; - std::string secondAlterString; - }; +struct Input +{ + Step step; + int alter; + double cents; + Accidental accidental; +}; - Output pitchDataTest( const Input& input ) - { - ScoreData score; - score.parts.emplace_back(); - auto& part = score.parts.back(); - part.measures.emplace_back(); - auto& measure = part.measures.back(); - measure.staves.emplace_back(); - auto& staff = measure.staves.back(); - auto& voice = staff.voices[0]; - voice.notes.emplace_back(); - auto& note = voice.notes.back(); - note.pitchData.step = input.step; - note.pitchData.accidental = input.accidental; - note.pitchData.alter = input.alter; - note.pitchData.cents = input.cents; - - // round trip it through xml - auto& mgr = DocumentManager::getInstance(); - auto docId = mgr.createFromScore( score ); - std::stringstream ss; - mgr.writeToStream( docId, ss ); - mgr.destroyDocument( docId ); - - // check the alter value that was written to xml - const auto xdoc = ezxml::XFactory::makeXDoc(); - xdoc->loadStream( ss ); - auto elem = xdoc->getRoot(); - elem = bruteForceFindFirstElement( elem, "alter" ); - const auto alterString = elem->getValue(); - Output output; - output.alterString = alterString; - -// deserialize back to ScoreData - const std::string xml = ss.str(); - std::istringstream iss{ xml }; - docId = mgr.createFromStream( iss ); - auto oscore = mgr.getData( docId ); - mgr.destroyDocument( docId ); - const auto& opart = oscore.parts.back(); - const auto& omeasure = opart.measures.back(); - const auto& ostaff = omeasure.staves.back(); - const auto& ovoice = ostaff.voices.at( 0 ); - const auto& onote = ovoice.notes.back(); - output.step = onote.pitchData.step; - output.alter = onote.pitchData.alter; - output.cents = onote.pitchData.cents; - output.accidental = onote.pitchData.accidental; - - // serialize a second time and check the alter string again - docId = mgr.createFromScore( score ); - ss.str( "" ); - mgr.writeToStream( docId, ss ); - mgr.destroyDocument( docId ); - - // check the alter value that was written to xml - const auto xdoc2 = ezxml::XFactory::makeXDoc(); - xdoc2->loadStream( ss ); - auto elem2 = xdoc->getRoot(); - elem2 = bruteForceFindFirstElement( elem2, "alter" ); - const auto alterString2 = elem->getValue(); - output.secondAlterString = alterString2; - return output; - } +struct Output +{ + Step step; + int alter; + double cents; + Accidental accidental; + std::string alterString; + std::string secondAlterString; +}; + +Output pitchDataTest(const Input &input) +{ + ScoreData score; + score.parts.emplace_back(); + auto &part = score.parts.back(); + part.measures.emplace_back(); + auto &measure = part.measures.back(); + measure.staves.emplace_back(); + auto &staff = measure.staves.back(); + auto &voice = staff.voices[0]; + voice.notes.emplace_back(); + auto ¬e = voice.notes.back(); + note.pitchData.step = input.step; + note.pitchData.accidental = input.accidental; + note.pitchData.alter = input.alter; + note.pitchData.cents = input.cents; + + // round trip it through xml + auto &mgr = DocumentManager::getInstance(); + auto docId = mgr.createFromScore(score); + std::stringstream ss; + mgr.writeToStream(docId, ss); + mgr.destroyDocument(docId); + + // check the alter value that was written to xml + const auto xdoc = ezxml::XFactory::makeXDoc(); + xdoc->loadStream(ss); + auto elem = xdoc->getRoot(); + elem = bruteForceFindFirstElement(elem, "alter"); + const auto alterString = elem->getValue(); + Output output; + output.alterString = alterString; + + // deserialize back to ScoreData + const std::string xml = ss.str(); + std::istringstream iss{xml}; + docId = mgr.createFromStream(iss); + auto oscore = mgr.getData(docId); + mgr.destroyDocument(docId); + const auto &opart = oscore.parts.back(); + const auto &omeasure = opart.measures.back(); + const auto &ostaff = omeasure.staves.back(); + const auto &ovoice = ostaff.voices.at(0); + const auto &onote = ovoice.notes.back(); + output.step = onote.pitchData.step; + output.alter = onote.pitchData.alter; + output.cents = onote.pitchData.cents; + output.accidental = onote.pitchData.accidental; + + // serialize a second time and check the alter string again + docId = mgr.createFromScore(score); + ss.str(""); + mgr.writeToStream(docId, ss); + mgr.destroyDocument(docId); + + // check the alter value that was written to xml + const auto xdoc2 = ezxml::XFactory::makeXDoc(); + xdoc2->loadStream(ss); + auto elem2 = xdoc->getRoot(); + elem2 = bruteForceFindFirstElement(elem2, "alter"); + const auto alterString2 = elem->getValue(); + output.secondAlterString = alterString2; + return output; } +} // namespace -TEST( ThreeQuarterSharp, PitchData ) +TEST(ThreeQuarterSharp, PitchData) { auto input = Input{}; input.step = Step::f; @@ -158,17 +158,18 @@ TEST( ThreeQuarterSharp, PitchData ) const int expectedAlter = input.alter; const double expectedCents = input.cents; const Accidental expectedAccidental = input.accidental; - const auto output = pitchDataTest( input ); + const auto output = pitchDataTest(input); - CHECK_EQUAL( expectedAlterString, output.alterString ); - CHECK_EQUAL( expectedAlterString, output.secondAlterString ); - CHECK_EQUAL( expectedAlter, output.alter ); - CHECK_DOUBLES_EQUAL( expectedCents, output.cents, MX_API_EQUALITY_EPSILON ); - CHECK( expectedAccidental == output.accidental ); + CHECK_EQUAL(expectedAlterString, output.alterString); + CHECK_EQUAL(expectedAlterString, output.secondAlterString); + CHECK_EQUAL(expectedAlter, output.alter); + CHECK_DOUBLES_EQUAL(expectedCents, output.cents, MX_API_EQUALITY_EPSILON); + CHECK(expectedAccidental == output.accidental); } + T_END; -TEST( ThreeQuarterFlat, PitchData ) +TEST(ThreeQuarterFlat, PitchData) { auto input = Input{}; input.step = Step::b; @@ -179,17 +180,18 @@ TEST( ThreeQuarterFlat, PitchData ) const int expectedAlter = input.alter; const double expectedCents = input.cents; const Accidental expectedAccidental = input.accidental; - const auto output = pitchDataTest( input ); + const auto output = pitchDataTest(input); - CHECK_EQUAL( expectedAlterString, output.alterString ); - CHECK_EQUAL( expectedAlterString, output.secondAlterString ); - CHECK_EQUAL( expectedAlter, output.alter ); - CHECK_DOUBLES_EQUAL( expectedCents, output.cents, MX_API_EQUALITY_EPSILON ); - CHECK( expectedAccidental == output.accidental ); + CHECK_EQUAL(expectedAlterString, output.alterString); + CHECK_EQUAL(expectedAlterString, output.secondAlterString); + CHECK_EQUAL(expectedAlter, output.alter); + CHECK_DOUBLES_EQUAL(expectedCents, output.cents, MX_API_EQUALITY_EPSILON); + CHECK(expectedAccidental == output.accidental); } + T_END; -TEST( AlmostDoubleSharp, PitchData ) +TEST(AlmostDoubleSharp, PitchData) { auto input = Input{}; input.step = Step::g; @@ -200,17 +202,18 @@ TEST( AlmostDoubleSharp, PitchData ) const int expectedAlter = input.alter; const double expectedCents = input.cents; const Accidental expectedAccidental = input.accidental; - const auto output = pitchDataTest( input ); + const auto output = pitchDataTest(input); - CHECK_EQUAL( expectedAlterString, output.alterString ); - CHECK_EQUAL( expectedAlterString, output.secondAlterString ); - CHECK_EQUAL( expectedAlter, output.alter ); - CHECK_DOUBLES_EQUAL( expectedCents, output.cents, MX_API_EQUALITY_EPSILON ); - CHECK( expectedAccidental == output.accidental ); + CHECK_EQUAL(expectedAlterString, output.alterString); + CHECK_EQUAL(expectedAlterString, output.secondAlterString); + CHECK_EQUAL(expectedAlter, output.alter); + CHECK_DOUBLES_EQUAL(expectedCents, output.cents, MX_API_EQUALITY_EPSILON); + CHECK(expectedAccidental == output.accidental); } + T_END; -TEST( AlmostDoubleFlat, PitchData ) +TEST(AlmostDoubleFlat, PitchData) { auto input = Input{}; input.step = Step::a; @@ -221,17 +224,18 @@ TEST( AlmostDoubleFlat, PitchData ) const int expectedAlter = input.alter; const double expectedCents = input.cents; const Accidental expectedAccidental = input.accidental; - const auto output = pitchDataTest( input ); + const auto output = pitchDataTest(input); - CHECK_EQUAL( expectedAlterString, output.alterString ); - CHECK_EQUAL( expectedAlterString, output.secondAlterString ); - CHECK_EQUAL( expectedAlter, output.alter ); - CHECK_DOUBLES_EQUAL( expectedCents, output.cents, MX_API_EQUALITY_EPSILON ); - CHECK( expectedAccidental == output.accidental ); + CHECK_EQUAL(expectedAlterString, output.alterString); + CHECK_EQUAL(expectedAlterString, output.secondAlterString); + CHECK_EQUAL(expectedAlter, output.alter); + CHECK_DOUBLES_EQUAL(expectedCents, output.cents, MX_API_EQUALITY_EPSILON); + CHECK(expectedAccidental == output.accidental); } + T_END; -TEST( CrazyEdgeCase1, PitchData ) +TEST(CrazyEdgeCase1, PitchData) { auto input = Input{}; input.step = Step::g; @@ -242,17 +246,18 @@ TEST( CrazyEdgeCase1, PitchData ) const int expectedAlter = -1234566; const double expectedCents = -89.0; const Accidental expectedAccidental = input.accidental; - const auto output = pitchDataTest( input ); + const auto output = pitchDataTest(input); - CHECK_EQUAL( expectedAlterString, output.alterString ); - CHECK_EQUAL( expectedAlterString, output.secondAlterString ); - CHECK_EQUAL( expectedAlter, output.alter ); - CHECK_DOUBLES_EQUAL( expectedCents, output.cents, MX_API_EQUALITY_EPSILON * 10 ); - CHECK( expectedAccidental == output.accidental ); + CHECK_EQUAL(expectedAlterString, output.alterString); + CHECK_EQUAL(expectedAlterString, output.secondAlterString); + CHECK_EQUAL(expectedAlter, output.alter); + CHECK_DOUBLES_EQUAL(expectedCents, output.cents, MX_API_EQUALITY_EPSILON * 10); + CHECK(expectedAccidental == output.accidental); } + T_END; -TEST( CrazyEdgeCase2, PitchData ) +TEST(CrazyEdgeCase2, PitchData) { auto input = Input{}; input.step = Step::e; @@ -263,42 +268,45 @@ TEST( CrazyEdgeCase2, PitchData ) const int expectedAlter = 22; const double expectedCents = 0.01; const Accidental expectedAccidental = input.accidental; - const auto output = pitchDataTest( input ); + const auto output = pitchDataTest(input); - CHECK_EQUAL( expectedAlterString, output.alterString ); - CHECK_EQUAL( expectedAlterString, output.secondAlterString ); - CHECK_EQUAL( expectedAlter, output.alter ); - CHECK_DOUBLES_EQUAL( expectedCents, output.cents, MX_API_EQUALITY_EPSILON ); - CHECK( expectedAccidental == output.accidental ); + CHECK_EQUAL(expectedAlterString, output.alterString); + CHECK_EQUAL(expectedAlterString, output.secondAlterString); + CHECK_EQUAL(expectedAlter, output.alter); + CHECK_DOUBLES_EQUAL(expectedCents, output.cents, MX_API_EQUALITY_EPSILON); + CHECK(expectedAccidental == output.accidental); } + T_END; namespace { - struct PitchHash +struct PitchHash +{ + constexpr inline size_t operator()(const mx::api::PitchData &p) const { - constexpr inline size_t operator()(const mx::api::PitchData& p) const { - size_t h1 = size_t(p.step) << 32; - size_t h2 = size_t(p.alter); - return h1 ^ h2; - } - }; -} + size_t h1 = size_t(p.step) << 32; + size_t h2 = size_t(p.alter); + return h1 ^ h2; + } +}; +} // namespace -TEST( ConstructorTest, PitchData ) +TEST(ConstructorTest, PitchData) { // duplicate the feature request from https://github.com/webern/mx/issues/69 - std::unordered_map root_to_key_circle { - { PitchData{ Step::f, 0, 4 }, -1 }, - { PitchData{ Step::c, 0, 4 }, 0 }, - { PitchData{ Step::g, 0, 4 }, 1 }, + std::unordered_map root_to_key_circle{ + {PitchData{Step::f, 0, 4}, -1}, + {PitchData{Step::c, 0, 4}, 0}, + {PitchData{Step::g, 0, 4}, 1}, }; - PitchData g{ Step::g }; - const auto find_iter = root_to_key_circle.find( g ); - REQUIRE( find_iter != std::cend( root_to_key_circle ) ); - CHECK_EQUAL( 1, find_iter->second ); + PitchData g{Step::g}; + const auto find_iter = root_to_key_circle.find(g); + REQUIRE(find_iter != std::cend(root_to_key_circle)); + CHECK_EQUAL(1, find_iter->second); } + T_END; #endif diff --git a/Sourcecode/private/mxtest/api/RoundTrip.h b/Sourcecode/private/mxtest/api/RoundTrip.h index c7ee0e631..b7458c636 100644 --- a/Sourcecode/private/mxtest/api/RoundTrip.h +++ b/Sourcecode/private/mxtest/api/RoundTrip.h @@ -4,40 +4,40 @@ #pragma once -#include "mxtest/control/CompileControl.h" #include "mx/api/DocumentManager.h" +#include "mxtest/control/CompileControl.h" #include "mxtest/file/MxFileRepository.h" #include namespace mxtest { - constexpr const char* const roundTripFileName = "k007a_Notations_Dynamics.xml"; +constexpr const char *const roundTripFileName = "k007a_Notations_Dynamics.xml"; - inline void roundTrip() - { - const std::string path{ MxFileRepository::getFullPath( roundTripFileName ) }; - auto& docMgr = mx::api::DocumentManager::getInstance(); - auto docId = docMgr.createFromFile( path ); - auto scoreData = docMgr.getData( docId ); - docMgr.destroyDocument( docId ); - docId = docMgr.createFromScore( scoreData ); - docMgr.writeToFile( docId, "./output.xml" ); - docMgr.destroyDocument( docId ); - } +inline void roundTrip() +{ + const std::string path{MxFileRepository::getFullPath(roundTripFileName)}; + auto &docMgr = mx::api::DocumentManager::getInstance(); + auto docId = docMgr.createFromFile(path); + auto scoreData = docMgr.getData(docId); + docMgr.destroyDocument(docId); + docId = docMgr.createFromScore(scoreData); + docMgr.writeToFile(docId, "./output.xml"); + docMgr.destroyDocument(docId); +} - inline mx::api::ScoreData roundTrip( const mx::api::ScoreData inScoreData ) - { - auto& docMgr = mx::api::DocumentManager::getInstance(); - auto docId = docMgr.createFromScore( inScoreData ); - std::stringstream ss; - docMgr.writeToStream( docId, ss ); - docMgr.destroyDocument( docId ); - auto xmlData = ss.str(); - std::istringstream iss{ xmlData }; - docId = docMgr.createFromStream( iss ); - auto outScoreData = docMgr.getData( docId ); - docMgr.destroyDocument( docId ); - //std::cout << xmlData << std::endl; - return outScoreData; - } +inline mx::api::ScoreData roundTrip(const mx::api::ScoreData inScoreData) +{ + auto &docMgr = mx::api::DocumentManager::getInstance(); + auto docId = docMgr.createFromScore(inScoreData); + std::stringstream ss; + docMgr.writeToStream(docId, ss); + docMgr.destroyDocument(docId); + auto xmlData = ss.str(); + std::istringstream iss{xmlData}; + docId = docMgr.createFromStream(iss); + auto outScoreData = docMgr.getData(docId); + docMgr.destroyDocument(docId); + // std::cout << xmlData << std::endl; + return outScoreData; } +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/api/ScoreDataCreator.h b/Sourcecode/private/mxtest/api/ScoreDataCreator.h index cd5496e50..8b7ba7a56 100644 --- a/Sourcecode/private/mxtest/api/ScoreDataCreator.h +++ b/Sourcecode/private/mxtest/api/ScoreDataCreator.h @@ -9,13 +9,16 @@ namespace mxtest { - class ScoreDataCreator; - using ScoreDataCreatorPtr = std::unique_ptr; - - class ScoreDataCreator +class ScoreDataCreator; +using ScoreDataCreatorPtr = std::unique_ptr; + +class ScoreDataCreator +{ + public: + virtual ~ScoreDataCreator() { - public: - virtual ~ScoreDataCreator() {} - virtual mx::api::ScoreData createScoreData() const = 0; - }; -} + } + + virtual mx::api::ScoreData createScoreData() const = 0; +}; +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/api/SlurTest.cpp b/Sourcecode/private/mxtest/api/SlurTest.cpp index 4ccc5e9b0..93d958e73 100644 --- a/Sourcecode/private/mxtest/api/SlurTest.cpp +++ b/Sourcecode/private/mxtest/api/SlurTest.cpp @@ -6,12 +6,12 @@ #ifdef MX_COMPILE_API_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/file/MxFileRepository.h" -#include "mxtest/api/TestHelpers.h" #include "ezxml/XAttributeIterator.h" #include "ezxml/XElement.h" #include "ezxml/XElementIterator.h" #include "ezxml/XFactory.h" +#include "mxtest/api/TestHelpers.h" +#include "mxtest/file/MxFileRepository.h" using namespace std; using namespace mx::api; @@ -19,70 +19,70 @@ using namespace mxtest; namespace { - constexpr const char* const fileName = "musescore-slur-start-stop.musicxml"; +constexpr const char *const fileName = "musescore-slur-start-stop.musicxml"; } - -TEST( startStop, Slurs ) +TEST(startStop, Slurs) { - const auto scoreData = mxtest::MxFileRepository::loadFile( fileName ); - CHECK_EQUAL( 1, scoreData.parts.size() ); - const auto& part = scoreData.parts.front(); - CHECK_EQUAL( 2, part.measures.size() ) + const auto scoreData = mxtest::MxFileRepository::loadFile(fileName); + CHECK_EQUAL(1, scoreData.parts.size()); + const auto &part = scoreData.parts.front(); + CHECK_EQUAL(2, part.measures.size()) auto measure = part.measures.front(); auto staff = measure.staves.front(); auto voice = staff.voices.at(0); auto note = voice.notes.at(3); auto stop = note.noteAttachmentData.curveStops.at(0); - CHECK_EQUAL( 1, stop.numberLevel ); + CHECK_EQUAL(1, stop.numberLevel); auto start = note.noteAttachmentData.curveStarts.at(0); - CHECK_EQUAL( 1, start.numberLevel ); + CHECK_EQUAL(1, start.numberLevel); // Write to XML and assert that stop happens before start - const auto xml = toXml( scoreData ); + const auto xml = toXml(scoreData); auto xdoc = ::ezxml::XFactory::makeXDoc(); istringstream is(xml); - xdoc->loadStream( is ); + xdoc->loadStream(is); auto root = xdoc->getRoot(); auto iter = root->begin(); std::advance(iter, 5); - CHECK_EQUAL( "part", iter->getName() ); + CHECK_EQUAL("part", iter->getName()); auto measureItemsIter = iter->begin()->begin(); - CHECK_EQUAL( "print", measureItemsIter->getName() ); + CHECK_EQUAL("print", measureItemsIter->getName()); ++measureItemsIter; - CHECK_EQUAL( "attributes", measureItemsIter->getName() ); + CHECK_EQUAL("attributes", measureItemsIter->getName()); ++measureItemsIter; - CHECK_EQUAL( "note", measureItemsIter->getName() ); + CHECK_EQUAL("note", measureItemsIter->getName()); ++measureItemsIter; - CHECK_EQUAL( "note", measureItemsIter->getName() ); + CHECK_EQUAL("note", measureItemsIter->getName()); ++measureItemsIter; - CHECK_EQUAL( "note", measureItemsIter->getName() ); + CHECK_EQUAL("note", measureItemsIter->getName()); ++measureItemsIter; - CHECK_EQUAL( "note", measureItemsIter->getName() ); + CHECK_EQUAL("note", measureItemsIter->getName()); auto noteItemsIter = measureItemsIter->begin(); - CHECK_EQUAL( "pitch", noteItemsIter->getName() ); + CHECK_EQUAL("pitch", noteItemsIter->getName()); ++noteItemsIter; - CHECK_EQUAL( "duration", noteItemsIter->getName() ); + CHECK_EQUAL("duration", noteItemsIter->getName()); ++noteItemsIter; - CHECK_EQUAL( "voice", noteItemsIter->getName() ); + CHECK_EQUAL("voice", noteItemsIter->getName()); ++noteItemsIter; - CHECK_EQUAL( "type", noteItemsIter->getName() ); + CHECK_EQUAL("type", noteItemsIter->getName()); ++noteItemsIter; - CHECK_EQUAL( "stem", noteItemsIter->getName() ); + CHECK_EQUAL("stem", noteItemsIter->getName()); ++noteItemsIter; - CHECK_EQUAL( "notations", noteItemsIter->getName() ); + CHECK_EQUAL("notations", noteItemsIter->getName()); auto notationIter = noteItemsIter->begin(); - CHECK_EQUAL( "slur", notationIter->getName() ); + CHECK_EQUAL("slur", notationIter->getName()); auto stopValue = notationIter->attributesBegin()->getValue(); - CHECK_EQUAL( "stop", stopValue ); - + CHECK_EQUAL("stop", stopValue); + ++notationIter; - CHECK_EQUAL( "slur", notationIter->getName() ); + CHECK_EQUAL("slur", notationIter->getName()); auto startValue = notationIter->attributesBegin()->getValue(); - CHECK_EQUAL( "start", startValue ); + CHECK_EQUAL("start", startValue); } + T_END #endif diff --git a/Sourcecode/private/mxtest/api/TestHelpers.h b/Sourcecode/private/mxtest/api/TestHelpers.h index 34993ce88..f3f71c3f1 100644 --- a/Sourcecode/private/mxtest/api/TestHelpers.h +++ b/Sourcecode/private/mxtest/api/TestHelpers.h @@ -5,32 +5,31 @@ #pragma once #include "mx/api/DocumentManager.h" -#include #include "mx/utility/Throw.h" +#include namespace mxtest { - inline std::string toXml( const mx::api::ScoreData& inScoreData ) - { - using namespace mx::api; - auto& docMgr = DocumentManager::getInstance(); - const auto docId = docMgr.createFromScore( inScoreData ); - std::stringstream ss; - docMgr.writeToStream( docId, ss ); - docMgr.destroyDocument( docId ); - const auto xml = ss.str(); - return xml; - } - +inline std::string toXml(const mx::api::ScoreData &inScoreData) +{ + using namespace mx::api; + auto &docMgr = DocumentManager::getInstance(); + const auto docId = docMgr.createFromScore(inScoreData); + std::stringstream ss; + docMgr.writeToStream(docId, ss); + docMgr.destroyDocument(docId); + const auto xml = ss.str(); + return xml; +} - inline mx::api::ScoreData fromXml( const std::string& inXml ) - { - using namespace mx::api; - auto& docMgr = DocumentManager::getInstance(); - std::istringstream iss{ inXml }; - const auto docId = docMgr.createFromStream( iss ); - const auto score = docMgr.getData( docId ); - docMgr.destroyDocument( docId ); - return score; - } +inline mx::api::ScoreData fromXml(const std::string &inXml) +{ + using namespace mx::api; + auto &docMgr = DocumentManager::getInstance(); + std::istringstream iss{inXml}; + const auto docId = docMgr.createFromStream(iss); + const auto score = docMgr.getData(docId); + docMgr.destroyDocument(docId); + return score; } +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/api/TimeSignatureApiTest.cpp b/Sourcecode/private/mxtest/api/TimeSignatureApiTest.cpp index e69bf2f1b..fdc1eccff 100644 --- a/Sourcecode/private/mxtest/api/TimeSignatureApiTest.cpp +++ b/Sourcecode/private/mxtest/api/TimeSignatureApiTest.cpp @@ -6,8 +6,8 @@ #ifdef MX_COMPILE_API_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/file/MxFileRepository.h" #include "mx/api/DocumentManager.h" +#include "mxtest/file/MxFileRepository.h" using namespace std; using namespace mx::api; @@ -15,31 +15,31 @@ using namespace mxtest; namespace { - constexpr const char* const fileName = "testAccidentals1.xml"; +constexpr const char *const fileName = "testAccidentals1.xml"; } - -TEST( implicitCarryover, TimeSignatureApi ) +TEST(implicitCarryover, TimeSignatureApi) { - const auto scoreData = mxtest::MxFileRepository::loadFile( fileName ); - CHECK_EQUAL( 1, scoreData.parts.size() ); - const auto& part = scoreData.parts.front(); - CHECK_EQUAL( 2, part.measures.size() ) + const auto scoreData = mxtest::MxFileRepository::loadFile(fileName); + CHECK_EQUAL(1, scoreData.parts.size()); + const auto &part = scoreData.parts.front(); + CHECK_EQUAL(2, part.measures.size()) auto measureIter = part.measures.cbegin(); auto t = measureIter->timeSignature; - - CHECK( !t.isImplicit ); - CHECK_EQUAL( 3, t.beats ); - CHECK_EQUAL( 4, t.beatType ); - CHECK( t.symbol == TimeSignatureSymbol::unspecified ); - + + CHECK(!t.isImplicit); + CHECK_EQUAL(3, t.beats); + CHECK_EQUAL(4, t.beatType); + CHECK(t.symbol == TimeSignatureSymbol::unspecified); + ++measureIter; t = measureIter->timeSignature; - CHECK( t.isImplicit ); - CHECK_EQUAL( 3, t.beats ); - CHECK_EQUAL( 4, t.beatType ); - CHECK( t.symbol == TimeSignatureSymbol::unspecified ); + CHECK(t.isImplicit); + CHECK_EQUAL(3, t.beats); + CHECK_EQUAL(4, t.beatType); + CHECK(t.symbol == TimeSignatureSymbol::unspecified); } + T_END #endif diff --git a/Sourcecode/private/mxtest/api/TranspositionTest.cpp b/Sourcecode/private/mxtest/api/TranspositionTest.cpp index 2aeb3ab70..de84caebd 100644 --- a/Sourcecode/private/mxtest/api/TranspositionTest.cpp +++ b/Sourcecode/private/mxtest/api/TranspositionTest.cpp @@ -19,632 +19,629 @@ namespace mxtest { - // There seems to be an existing notion of an API 'round trip' test which requires specifying the - // music data by hand. In this version of an API round trip test, we will load the file into API, - // save the file back to disk, load it back up into the API and assert equality. - inline mx::api::ScoreData roundtrip( const mx::api::ScoreData& inOriginal ) +// There seems to be an existing notion of an API 'round trip' test which requires specifying the +// music data by hand. In this version of an API round trip test, we will load the file into API, +// save the file back to disk, load it back up into the API and assert equality. +inline mx::api::ScoreData roundtrip(const mx::api::ScoreData &inOriginal) +{ + auto &docMgr = mx::api::DocumentManager::getInstance(); + const auto id = docMgr.createFromScore(inOriginal); + std::ostringstream oss; + docMgr.writeToStream(id, oss); + std::istringstream iss{oss.str()}; + const auto id2 = docMgr.createFromStream(iss); + auto result = docMgr.getData(id2); + docMgr.destroyDocument(id); + docMgr.destroyDocument(id2); + return result; +} + +// create a score with one part an any number of measures +inline mx::api::ScoreData makeScore(int measures) +{ + auto score = mx::api::ScoreData{}; + score.parts.emplace_back(mx::api::PartData{}); + auto &part = score.parts.back(); + for (int i = 0; i < measures; ++i) { - auto& docMgr = mx::api::DocumentManager::getInstance(); - const auto id = docMgr.createFromScore( inOriginal ); - std::ostringstream oss; - docMgr.writeToStream( id, oss ); - std::istringstream iss{ oss.str() }; - const auto id2 = docMgr.createFromStream( iss ); - auto result = docMgr.getData( id2 ); - docMgr.destroyDocument( id ); - docMgr.destroyDocument( id2 ); - return result; + part.measures.emplace_back(mx::api::MeasureData{}); } - - // create a score with one part an any number of measures - inline mx::api::ScoreData makeScore( int measures ) + return score; +} + +inline void checkCoreTransposeElement(const mx::api::ScoreData &inScore, int inExpectedChromatic, + std::optional inExpectedDiatonic, std::optional inExpectedOctave) +{ + auto &docMgr = mx::api::DocumentManager::getInstance(); + const auto id = docMgr.createFromScore(inScore); + const auto core = docMgr.getDocument(id); + docMgr.destroyDocument(id); + CHECK(core->getChoice() == mx::core::DocumentChoice::partwise); + const auto &score = core->getScorePartwise(); + REQUIRE(!score->getPartwisePartSet().empty()); + const auto &part = score->getPartwisePartSet().front(); + REQUIRE(!part->getPartwiseMeasureSet().empty()); + const auto &measure = part->getPartwiseMeasureSet().front(); + const auto &choices = measure->getMusicDataGroup()->getMusicDataChoiceSet(); + REQUIRE(!choices.empty()); + mx::core::PropertiesPtr properties; + for (const auto &choice : choices) { - auto score = mx::api::ScoreData{}; - score.parts.emplace_back( mx::api::PartData{} ); - auto& part = score.parts.back(); - for( int i = 0; i < measures; ++ i ) + if (choice->getChoice() == mx::core::MusicDataChoice::Choice::properties) { - part.measures.emplace_back( mx::api::MeasureData{} ); + // there should be only 1 properties element + CHECK(properties == nullptr); + properties = choice->getProperties(); + // continue looping to make sure we don't hit another properties element } - return score; } - - inline void checkCoreTransposeElement( - const mx::api::ScoreData& inScore, - int inExpectedChromatic, - std::optional inExpectedDiatonic, - std::optional inExpectedOctave ) + // we should have found exactly one properties element + CHECK(properties != nullptr); + // assert that the transpose element matches + REQUIRE(properties->getTransposeSet().size() == 1); + const auto &transpose = properties->getTransposeSet().front(); + CHECK_EQUAL(inExpectedChromatic, static_cast(transpose->getChromatic()->getValue().getValue())); + if (inExpectedDiatonic.has_value()) { - auto& docMgr = mx::api::DocumentManager::getInstance(); - const auto id = docMgr.createFromScore( inScore ); - const auto core = docMgr.getDocument( id ); - docMgr.destroyDocument( id ); - CHECK( core->getChoice() == mx::core::DocumentChoice::partwise ); - const auto& score = core->getScorePartwise(); - REQUIRE( !score->getPartwisePartSet().empty() ); - const auto& part = score->getPartwisePartSet().front(); - REQUIRE( !part->getPartwiseMeasureSet().empty() ); - const auto& measure = part->getPartwiseMeasureSet().front(); - const auto& choices = measure->getMusicDataGroup()->getMusicDataChoiceSet(); - REQUIRE( !choices.empty() ); - mx::core::PropertiesPtr properties; - for( const auto& choice : choices ) - { - if( choice->getChoice() == mx::core::MusicDataChoice::Choice::properties ) - { - // there should be only 1 properties element - CHECK( properties == nullptr ); - properties = choice->getProperties(); - // continue looping to make sure we don't hit another properties element - } - } - // we should have found exactly one properties element - CHECK( properties != nullptr ); - // assert that the transpose element matches - REQUIRE( properties->getTransposeSet().size() == 1 ); - const auto& transpose = properties->getTransposeSet().front(); - CHECK_EQUAL( inExpectedChromatic, static_cast( transpose->getChromatic()->getValue().getValue() ) ); - if( inExpectedDiatonic.has_value() ) - { - CHECK( transpose->getHasDiatonic() ); - CHECK_EQUAL( inExpectedDiatonic.value(), static_cast( transpose->getDiatonic()->getValue().getValue() ) ); - } - if( inExpectedOctave.has_value() ) - { - CHECK( transpose->getHasOctaveChange() ); - CHECK_EQUAL( inExpectedOctave.value(), static_cast( transpose->getOctaveChange()->getValue().getValue() ) ); - } + CHECK(transpose->getHasDiatonic()); + CHECK_EQUAL(inExpectedDiatonic.value(), static_cast(transpose->getDiatonic()->getValue().getValue())); + } + if (inExpectedOctave.has_value()) + { + CHECK(transpose->getHasOctaveChange()); + CHECK_EQUAL(inExpectedOctave.value(), static_cast(transpose->getOctaveChange()->getValue().getValue())); } +} - inline mx::core::TransposePtr makeTranspose( int inChromatic, std::optional inDiatonic, std::optional inOctave ) +inline mx::core::TransposePtr makeTranspose(int inChromatic, std::optional inDiatonic, std::optional inOctave) +{ + auto transpose = mx::core::makeTranspose(); + transpose->getChromatic()->setValue(mx::core::Semitones{static_cast(inChromatic)}); + if (inDiatonic.has_value()) { - auto transpose = mx::core::makeTranspose(); - transpose->getChromatic()->setValue( mx::core::Semitones{ static_cast( inChromatic ) } ); - if( inDiatonic.has_value() ) - { - transpose->setHasDiatonic( true ); - transpose->getDiatonic()->setValue( mx::core::Integer{ inDiatonic.value() } ); - } - if( inOctave.has_value() ) - { - transpose->setHasOctaveChange( true ); - transpose->getOctaveChange()->setValue( mx::core::Integer{ inOctave.value() } ); - } - return transpose; + transpose->setHasDiatonic(true); + transpose->getDiatonic()->setValue(mx::core::Integer{inDiatonic.value()}); + } + if (inOctave.has_value()) + { + transpose->setHasOctaveChange(true); + transpose->getOctaveChange()->setValue(mx::core::Integer{inOctave.value()}); } + return transpose; } +} // namespace mxtest -TEST( convertToTransposeData01, Transposition ) +TEST(convertToTransposeData01, Transposition) { // in Db (up) with no diatonic const int expectedChromatic = 1; const int expectedDiatonic = 1; - const auto transpose = mxtest::makeTranspose( 1, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(1, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData02, Transposition ) +TEST(convertToTransposeData02, Transposition) { // in B (down) with no diatonic const int expectedChromatic = -1; const int expectedDiatonic = -1; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData03, Transposition ) +TEST(convertToTransposeData03, Transposition) { // in D with no diatonic const int expectedChromatic = 2; const int expectedDiatonic = 1; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData04, Transposition ) +TEST(convertToTransposeData04, Transposition) { // in Bb with no diatonic const int expectedChromatic = -2; const int expectedDiatonic = -1; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData05, Transposition ) +TEST(convertToTransposeData05, Transposition) { // in Eb (up) with no diatonic const int expectedChromatic = 3; const int expectedDiatonic = 2; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData06, Transposition ) +TEST(convertToTransposeData06, Transposition) { // in A with no diatonic const int expectedChromatic = -3; const int expectedDiatonic = -2; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData07, Transposition ) +TEST(convertToTransposeData07, Transposition) { // in E with no diatonic const int expectedChromatic = 4; const int expectedDiatonic = 2; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData08, Transposition ) +TEST(convertToTransposeData08, Transposition) { // in Ab with no diatonic const int expectedChromatic = -4; const int expectedDiatonic = -2; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData09, Transposition ) +TEST(convertToTransposeData09, Transposition) { // in F with no diatonic const int expectedChromatic = 5; const int expectedDiatonic = 3; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData10, Transposition ) +TEST(convertToTransposeData10, Transposition) { // in G with no diatonic const int expectedChromatic = -5; const int expectedDiatonic = -3; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData11, Transposition ) +TEST(convertToTransposeData11, Transposition) { // in F# with no diatonic const int expectedChromatic = 6; const int expectedDiatonic = 3; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData12, Transposition ) +TEST(convertToTransposeData12, Transposition) { // in Gb with no diatonic const int expectedChromatic = -6; const int expectedDiatonic = -3; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData13, Transposition ) +TEST(convertToTransposeData13, Transposition) { // in G (up) with no diatonic const int expectedChromatic = 7; const int expectedDiatonic = 4; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData14, Transposition ) +TEST(convertToTransposeData14, Transposition) { // in F (down) with no diatonic const int expectedChromatic = -7; const int expectedDiatonic = -4; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData15, Transposition ) +TEST(convertToTransposeData15, Transposition) { // in Ab (up) with no diatonic const int expectedChromatic = 8; const int expectedDiatonic = 5; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData16, Transposition ) +TEST(convertToTransposeData16, Transposition) { // in E (down) with no diatonic const int expectedChromatic = -8; const int expectedDiatonic = -5; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData17, Transposition ) +TEST(convertToTransposeData17, Transposition) { // in A (up) with no diatonic const int expectedChromatic = 9; const int expectedDiatonic = 5; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData18, Transposition ) +TEST(convertToTransposeData18, Transposition) { // in Eb (down) with no diatonic const int expectedChromatic = -9; const int expectedDiatonic = -5; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData19, Transposition ) +TEST(convertToTransposeData19, Transposition) { // in Bb (up) with no diatonic const int expectedChromatic = 10; const int expectedDiatonic = 6; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData20, Transposition ) +TEST(convertToTransposeData20, Transposition) { // in D (down) with no diatonic const int expectedChromatic = -10; const int expectedDiatonic = -6; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData21, Transposition ) +TEST(convertToTransposeData21, Transposition) { // in B (up) with no diatonic const int expectedChromatic = 11; const int expectedDiatonic = 6; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData22, Transposition ) +TEST(convertToTransposeData22, Transposition) { // in Db (down) with no diatonic const int expectedChromatic = -11; const int expectedDiatonic = -6; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData23, Transposition ) +TEST(convertToTransposeData23, Transposition) { // in C (up) with no diatonic and no octave (technically incorrect musicxml) const int expectedChromatic = 12; const int expectedDiatonic = 7; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData24, Transposition ) +TEST(convertToTransposeData24, Transposition) { // in C (down) with no diatonic and no octave (technically incorrect musicxml) const int expectedChromatic = -12; const int expectedDiatonic = -7; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData25, Transposition ) +TEST(convertToTransposeData25, Transposition) { // in Db+1 (up) with no diatonic and no octave (technically incorrect musicxml) const int expectedChromatic = 13; const int expectedDiatonic = 8; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData26, Transposition ) +TEST(convertToTransposeData26, Transposition) { // in B-1 (down) with no diatonic and no octave (technically incorrect musicxml) const int expectedChromatic = -13; const int expectedDiatonic = -8; - const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, std::nullopt, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData27, Transposition ) +TEST(convertToTransposeData27, Transposition) { // crazy numbers, both chromatic and diatonic specified (and technically invalid), octave not specified const int expectedChromatic = -130; const int expectedDiatonic = 147; - const auto transpose = mxtest::makeTranspose( expectedChromatic, expectedDiatonic, std::nullopt ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(expectedChromatic, expectedDiatonic, std::nullopt); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData28, Transposition ) +TEST(convertToTransposeData28, Transposition) { // crazy numbers, both chromatic and diatonic specified (and technically invalid), octave is specified const int expectedChromatic = -138; const int expectedDiatonic = 147; const int octave = 2; - const auto transpose = mxtest::makeTranspose( -162, 133, octave ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(-162, 133, octave); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData29, Transposition ) +TEST(convertToTransposeData29, Transposition) { // normal, correct usage with octave offset, e.g. Tenor Saxophone in Bb const int expectedChromatic = -14; const int expectedDiatonic = -8; const int octave = -1; - const auto transpose = mxtest::makeTranspose( -2, -1, octave ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(-2, -1, octave); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData30, Transposition ) +TEST(convertToTransposeData30, Transposition) { // normal, correct usage with octave offset, e.g. Piccolo Clarinet in Bb const int expectedChromatic = 10; const int expectedDiatonic = 6; const int octave = 1; - const auto transpose = mxtest::makeTranspose( -2, -1, octave ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(-2, -1, octave); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( convertToTransposeData31, Transposition ) +TEST(convertToTransposeData31, Transposition) { // complete nonsense input, chromatic is out of range, diatonic is not specified, octave is specified. // the behaviour is undefined, but this test locks down the behaviour as we have it now. const int expectedChromatic = -1306; const int expectedDiatonic = -762; const int octave = -6; - const auto transpose = mxtest::makeTranspose( -1234, std::nullopt, octave ); - const auto actual = mx::impl::Converter::convertToTransposeData( *transpose ); - CHECK_EQUAL( expectedChromatic, actual.chromatic ); - CHECK_EQUAL( expectedDiatonic, actual.diatonic ); + const auto transpose = mxtest::makeTranspose(-1234, std::nullopt, octave); + const auto actual = mx::impl::Converter::convertToTransposeData(*transpose); + CHECK_EQUAL(expectedChromatic, actual.chromatic); + CHECK_EQUAL(expectedDiatonic, actual.diatonic); } -TEST( Conversion01, Transposition ) +TEST(Conversion01, Transposition) { const auto expectedChromatic = 2; const auto expectedDiatonic = 1; const auto expectedOctave = 0; const auto transposeDataChromatic = 2; const auto transposeDataDiatonic = 1; - const auto original = mx::api::TransposeData{ transposeDataChromatic, transposeDataDiatonic }; - const auto converted = mx::impl::Converter::convertToTranspose( original ); - REQUIRE( converted != nullptr ); - CHECK_EQUAL( expectedChromatic, static_cast( converted->getChromatic()->getValue().getValue() ) ); - CHECK( converted->getHasDiatonic() == ( expectedDiatonic != 0 ) ); - CHECK_EQUAL( expectedDiatonic, static_cast( converted->getDiatonic()->getValue().getValue() ) ); - CHECK( converted->getHasOctaveChange() == ( expectedOctave != 0 ) ); - CHECK_EQUAL( expectedOctave, static_cast( converted->getOctaveChange()->getValue().getValue() ) ); - const auto final = mx::impl::Converter::convertToTransposeData( *converted ); - CHECK_EQUAL( transposeDataChromatic, final.chromatic ); - CHECK_EQUAL( transposeDataDiatonic, final.diatonic ); - CHECK_EQUAL( original, final ); -} - -TEST( Conversion02, Transposition ) + const auto original = mx::api::TransposeData{transposeDataChromatic, transposeDataDiatonic}; + const auto converted = mx::impl::Converter::convertToTranspose(original); + REQUIRE(converted != nullptr); + CHECK_EQUAL(expectedChromatic, static_cast(converted->getChromatic()->getValue().getValue())); + CHECK(converted->getHasDiatonic() == (expectedDiatonic != 0)); + CHECK_EQUAL(expectedDiatonic, static_cast(converted->getDiatonic()->getValue().getValue())); + CHECK(converted->getHasOctaveChange() == (expectedOctave != 0)); + CHECK_EQUAL(expectedOctave, static_cast(converted->getOctaveChange()->getValue().getValue())); + const auto final = mx::impl::Converter::convertToTransposeData(*converted); + CHECK_EQUAL(transposeDataChromatic, final.chromatic); + CHECK_EQUAL(transposeDataDiatonic, final.diatonic); + CHECK_EQUAL(original, final); +} + +TEST(Conversion02, Transposition) { const auto expectedChromatic = 0; const auto expectedDiatonic = 0; const auto expectedOctave = 1; const auto transposeDataChromatic = 12; const auto transposeDataDiatonic = 7; - const auto original = mx::api::TransposeData{ transposeDataChromatic, transposeDataDiatonic }; - const auto converted = mx::impl::Converter::convertToTranspose( original ); - REQUIRE( converted != nullptr ); - CHECK_EQUAL( expectedChromatic, static_cast( converted->getChromatic()->getValue().getValue() ) ); - CHECK( converted->getHasDiatonic() == ( expectedDiatonic != 0 ) ); - CHECK_EQUAL( expectedDiatonic, static_cast( converted->getDiatonic()->getValue().getValue() ) ); - CHECK( converted->getHasOctaveChange() == ( expectedOctave != 0 ) ); - CHECK_EQUAL( expectedOctave, static_cast( converted->getOctaveChange()->getValue().getValue() ) ); - const auto final = mx::impl::Converter::convertToTransposeData( *converted ); - CHECK_EQUAL( transposeDataChromatic, final.chromatic ); - CHECK_EQUAL( transposeDataDiatonic, final.diatonic ); - CHECK_EQUAL( original, final ); -} - -TEST( Conversion03, Transposition ) + const auto original = mx::api::TransposeData{transposeDataChromatic, transposeDataDiatonic}; + const auto converted = mx::impl::Converter::convertToTranspose(original); + REQUIRE(converted != nullptr); + CHECK_EQUAL(expectedChromatic, static_cast(converted->getChromatic()->getValue().getValue())); + CHECK(converted->getHasDiatonic() == (expectedDiatonic != 0)); + CHECK_EQUAL(expectedDiatonic, static_cast(converted->getDiatonic()->getValue().getValue())); + CHECK(converted->getHasOctaveChange() == (expectedOctave != 0)); + CHECK_EQUAL(expectedOctave, static_cast(converted->getOctaveChange()->getValue().getValue())); + const auto final = mx::impl::Converter::convertToTransposeData(*converted); + CHECK_EQUAL(transposeDataChromatic, final.chromatic); + CHECK_EQUAL(transposeDataDiatonic, final.diatonic); + CHECK_EQUAL(original, final); +} + +TEST(Conversion03, Transposition) { const auto expectedChromatic = 4; const auto expectedDiatonic = 2; const auto expectedOctave = 1; const auto transposeDataChromatic = 16; const auto transposeDataDiatonic = 9; - const auto original = mx::api::TransposeData{ transposeDataChromatic, transposeDataDiatonic }; - const auto converted = mx::impl::Converter::convertToTranspose( original ); - REQUIRE( converted != nullptr ); - CHECK_EQUAL( expectedChromatic, static_cast( converted->getChromatic()->getValue().getValue() ) ); - CHECK( converted->getHasDiatonic() == ( expectedDiatonic != 0 ) ); - CHECK_EQUAL( expectedDiatonic, static_cast( converted->getDiatonic()->getValue().getValue() ) ); - CHECK( converted->getHasOctaveChange() == ( expectedOctave != 0 ) ); - CHECK_EQUAL( expectedOctave, static_cast( converted->getOctaveChange()->getValue().getValue() ) ); - const auto final = mx::impl::Converter::convertToTransposeData( *converted ); - CHECK_EQUAL( transposeDataChromatic, final.chromatic ); - CHECK_EQUAL( transposeDataDiatonic, final.diatonic ); - CHECK_EQUAL( original, final ); -} - -TEST( Conversion04, Transposition ) + const auto original = mx::api::TransposeData{transposeDataChromatic, transposeDataDiatonic}; + const auto converted = mx::impl::Converter::convertToTranspose(original); + REQUIRE(converted != nullptr); + CHECK_EQUAL(expectedChromatic, static_cast(converted->getChromatic()->getValue().getValue())); + CHECK(converted->getHasDiatonic() == (expectedDiatonic != 0)); + CHECK_EQUAL(expectedDiatonic, static_cast(converted->getDiatonic()->getValue().getValue())); + CHECK(converted->getHasOctaveChange() == (expectedOctave != 0)); + CHECK_EQUAL(expectedOctave, static_cast(converted->getOctaveChange()->getValue().getValue())); + const auto final = mx::impl::Converter::convertToTransposeData(*converted); + CHECK_EQUAL(transposeDataChromatic, final.chromatic); + CHECK_EQUAL(transposeDataDiatonic, final.diatonic); + CHECK_EQUAL(original, final); +} + +TEST(Conversion04, Transposition) { const auto expectedChromatic = -4; const auto expectedDiatonic = -2; const auto expectedOctave = -1; const auto transposeDataChromatic = -16; const auto transposeDataDiatonic = -9; - const auto original = mx::api::TransposeData{ transposeDataChromatic, transposeDataDiatonic }; - const auto converted = mx::impl::Converter::convertToTranspose( original ); - REQUIRE( converted != nullptr ); - CHECK_EQUAL( expectedChromatic, static_cast( converted->getChromatic()->getValue().getValue() ) ); - CHECK( converted->getHasDiatonic() == ( expectedDiatonic != 0 ) ); - CHECK_EQUAL( expectedDiatonic, static_cast( converted->getDiatonic()->getValue().getValue() ) ); - CHECK( converted->getHasOctaveChange() == ( expectedOctave != 0 ) ); - CHECK_EQUAL( expectedOctave, static_cast( converted->getOctaveChange()->getValue().getValue() ) ); - const auto final = mx::impl::Converter::convertToTransposeData( *converted ); - CHECK_EQUAL( transposeDataChromatic, final.chromatic ); - CHECK_EQUAL( transposeDataDiatonic, final.diatonic ); - CHECK_EQUAL( original, final ); -} - -TEST( Tests01, Transposition ) + const auto original = mx::api::TransposeData{transposeDataChromatic, transposeDataDiatonic}; + const auto converted = mx::impl::Converter::convertToTranspose(original); + REQUIRE(converted != nullptr); + CHECK_EQUAL(expectedChromatic, static_cast(converted->getChromatic()->getValue().getValue())); + CHECK(converted->getHasDiatonic() == (expectedDiatonic != 0)); + CHECK_EQUAL(expectedDiatonic, static_cast(converted->getDiatonic()->getValue().getValue())); + CHECK(converted->getHasOctaveChange() == (expectedOctave != 0)); + CHECK_EQUAL(expectedOctave, static_cast(converted->getOctaveChange()->getValue().getValue())); + const auto final = mx::impl::Converter::convertToTransposeData(*converted); + CHECK_EQUAL(transposeDataChromatic, final.chromatic); + CHECK_EQUAL(transposeDataDiatonic, final.diatonic); + CHECK_EQUAL(original, final); +} + +TEST(Tests01, Transposition) { const int chromatic = 2; const int diatonic = 1; const int expectedXmlChromatic = 2; const int expectedXmlDiatonic = 1; const std::optional expectedXmlOctave = std::nullopt; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests02, Transposition ) +TEST(Tests02, Transposition) { const int chromatic = 11; const int diatonic = 6; const int expectedXmlChromatic = 11; const int expectedXmlDiatonic = 6; const std::optional expectedXmlOctave = std::nullopt; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests03, Transposition ) +TEST(Tests03, Transposition) { const int chromatic = 12; const int diatonic = 7; const int expectedXmlChromatic = 0; const std::optional expectedXmlDiatonic = std::nullopt; const std::optional expectedXmlOctave = std::nullopt; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests04, Transposition ) +TEST(Tests04, Transposition) { const int chromatic = 13; const int diatonic = 8; const int expectedXmlChromatic = 1; const int expectedXmlDiatonic = 1; const std::optional expectedXmlOctave = 1; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests05, Transposition ) +TEST(Tests05, Transposition) { const int chromatic = 14; const int diatonic = 8; const int expectedXmlChromatic = 2; const int expectedXmlDiatonic = 1; const std::optional expectedXmlOctave = 1; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests06, Transposition ) +TEST(Tests06, Transposition) { // super wonky test case, maybe it doesn't matter if it fails const int chromatic = 14; @@ -652,132 +649,132 @@ TEST( Tests06, Transposition ) const int expectedXmlChromatic = 2; const int expectedXmlDiatonic = -15; const std::optional expectedXmlOctave = 1; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests07, Transposition ) +TEST(Tests07, Transposition) { const int chromatic = -1; const int diatonic = -1; const int expectedXmlChromatic = -1; const int expectedXmlDiatonic = -1; const std::optional expectedXmlOctave = std::nullopt; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests08, Transposition ) +TEST(Tests08, Transposition) { const int chromatic = -11; const int diatonic = -6; const int expectedXmlChromatic = -11; const int expectedXmlDiatonic = -6; const std::optional expectedXmlOctave = std::nullopt; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests09, Transposition ) +TEST(Tests09, Transposition) { const int chromatic = -12; const int diatonic = -7; const int expectedXmlChromatic = 0; const std::optional expectedXmlDiatonic = std::nullopt; const std::optional expectedXmlOctave = -1; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( noMeasures, Transposition ) +TEST(noMeasures, Transposition) { const int chromatic = 2; const int diatonic = 1; const int expectedXmlChromatic = 2; const std::optional expectedXmlDiatonic = 1; const std::optional expectedXmlOctave = std::nullopt; - auto score = mxtest::makeScore( 0 ); // NO MEASURES! - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(0); // NO MEASURES! + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( noTransposition, Transposition ) +TEST(noTransposition, Transposition) { const int chromatic = 0; const int diatonic = 0; - auto score = mxtest::makeScore( 0 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( !part.transposition->isUsed() ); - const auto result = mxtest::roundtrip( score ); - CHECK( !result.parts.back().transposition ); + auto score = mxtest::makeScore(0); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(!part.transposition->isUsed()); + const auto result = mxtest::roundtrip(score); + CHECK(!result.parts.back().transposition); } -TEST( Tests10, Transposition ) +TEST(Tests10, Transposition) { const int chromatic = -13; const int diatonic = -8; const int expectedXmlChromatic = -1; const std::optional expectedXmlDiatonic = -1; const std::optional expectedXmlOctave = -1; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); } -TEST( Tests11, Transposition ) +TEST(Tests11, Transposition) { // this is a funky test case. these values are actually nonsense. const int chromatic = -14; @@ -785,80 +782,80 @@ TEST( Tests11, Transposition ) const int expectedXmlChromatic = -2; const std::optional expectedXmlDiatonic = 15; const std::optional expectedXmlOctave = -1; - auto score = mxtest::makeScore( 1 ); - auto& part = score.parts.back(); - part.transposition = mx::api::TransposeData{ chromatic, diatonic }; - CHECK( part.transposition->isUsed() ); - mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave ); - const auto result = mxtest::roundtrip( score ); - REQUIRE( result.parts.back().transposition.has_value() ); - CHECK( result.parts.back().transposition ); - CHECK( result.parts.back().transposition->isUsed() ); - CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic ); - CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic ); -} - -TEST( ApiRoundTrip, Transposition ) -{ - const auto original = mxtest::MxFileRepository::loadFile( "transposition.musicxml" ); - const auto result = mxtest::roundtrip( original ); - REQUIRE( result.parts.size() == 31 ); + auto score = mxtest::makeScore(1); + auto &part = score.parts.back(); + part.transposition = mx::api::TransposeData{chromatic, diatonic}; + CHECK(part.transposition->isUsed()); + mxtest::checkCoreTransposeElement(score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave); + const auto result = mxtest::roundtrip(score); + REQUIRE(result.parts.back().transposition.has_value()); + CHECK(result.parts.back().transposition); + CHECK(result.parts.back().transposition->isUsed()); + CHECK_EQUAL(chromatic, result.parts.back().transposition->chromatic); + CHECK_EQUAL(diatonic, result.parts.back().transposition->diatonic); +} + +TEST(ApiRoundTrip, Transposition) +{ + const auto original = mxtest::MxFileRepository::loadFile("transposition.musicxml"); + const auto result = mxtest::roundtrip(original); + REQUIRE(result.parts.size() == 31); // manually check some of the part transpositions size_t partIndex = 0; - std::string partId = "P" + std::to_string( partIndex + 1 ); - auto part = result.parts.at( partIndex ); - CHECK_EQUAL( partId, part.uniqueId ); - CHECK_WITH_MESSAGE( part.transposition.has_value(), partId + " is missing transposition" ); - CHECK( part.transposition->isUsed() ); - CHECK_EQUAL( 12, part.transposition->chromatic ); - CHECK_EQUAL( 7, part.transposition->diatonic ); + std::string partId = "P" + std::to_string(partIndex + 1); + auto part = result.parts.at(partIndex); + CHECK_EQUAL(partId, part.uniqueId); + CHECK_WITH_MESSAGE(part.transposition.has_value(), partId + " is missing transposition"); + CHECK(part.transposition->isUsed()); + CHECK_EQUAL(12, part.transposition->chromatic); + CHECK_EQUAL(7, part.transposition->diatonic); partIndex = 6; - partId = "P" + std::to_string( partIndex + 1 ); - part = result.parts.at( partIndex ); - CHECK_EQUAL( partId, part.uniqueId ); - CHECK_WITH_MESSAGE( !part.transposition.has_value(), partId + " should have no transposition" ); + partId = "P" + std::to_string(partIndex + 1); + part = result.parts.at(partIndex); + CHECK_EQUAL(partId, part.uniqueId); + CHECK_WITH_MESSAGE(!part.transposition.has_value(), partId + " should have no transposition"); partIndex = 13; - partId = "P" + std::to_string( partIndex + 1 ); - part = result.parts.at( partIndex ); - CHECK_EQUAL( partId, part.uniqueId ); - CHECK_WITH_MESSAGE( part.transposition.has_value(), partId + " is missing transposition" ); - CHECK( part.transposition->isUsed() ); - CHECK_EQUAL( -9, part.transposition->chromatic ); - CHECK_EQUAL( -5, part.transposition->diatonic ); + partId = "P" + std::to_string(partIndex + 1); + part = result.parts.at(partIndex); + CHECK_EQUAL(partId, part.uniqueId); + CHECK_WITH_MESSAGE(part.transposition.has_value(), partId + " is missing transposition"); + CHECK(part.transposition->isUsed()); + CHECK_EQUAL(-9, part.transposition->chromatic); + CHECK_EQUAL(-5, part.transposition->diatonic); partIndex = 14; - partId = "P" + std::to_string( partIndex + 1 ); - part = result.parts.at( partIndex ); - CHECK_EQUAL( partId, part.uniqueId ); - CHECK_WITH_MESSAGE( part.transposition.has_value(), partId + " is missing transposition" ); - CHECK( part.transposition->isUsed() ); - CHECK_EQUAL( -14, part.transposition->chromatic ); - CHECK_EQUAL( -8, part.transposition->diatonic ); + partId = "P" + std::to_string(partIndex + 1); + part = result.parts.at(partIndex); + CHECK_EQUAL(partId, part.uniqueId); + CHECK_WITH_MESSAGE(part.transposition.has_value(), partId + " is missing transposition"); + CHECK(part.transposition->isUsed()); + CHECK_EQUAL(-14, part.transposition->chromatic); + CHECK_EQUAL(-8, part.transposition->diatonic); partIndex = 15; - partId = "P" + std::to_string( partIndex + 1 ); - part = result.parts.at( partIndex ); - CHECK_EQUAL( partId, part.uniqueId ); - CHECK_WITH_MESSAGE( part.transposition.has_value(), partId + " is missing transposition" ); - CHECK( part.transposition->isUsed() ); - CHECK_EQUAL( -21, part.transposition->chromatic ); - CHECK_EQUAL( -12, part.transposition->diatonic ); + partId = "P" + std::to_string(partIndex + 1); + part = result.parts.at(partIndex); + CHECK_EQUAL(partId, part.uniqueId); + CHECK_WITH_MESSAGE(part.transposition.has_value(), partId + " is missing transposition"); + CHECK(part.transposition->isUsed()); + CHECK_EQUAL(-21, part.transposition->chromatic); + CHECK_EQUAL(-12, part.transposition->diatonic); partIndex = 27; - partId = "P" + std::to_string( partIndex + 1 ); - part = result.parts.at( partIndex ); - CHECK_EQUAL( partId, part.uniqueId ); - CHECK_WITH_MESSAGE( !part.transposition.has_value(), partId + " should have no transposition" ); + partId = "P" + std::to_string(partIndex + 1); + part = result.parts.at(partIndex); + CHECK_EQUAL(partId, part.uniqueId); + CHECK_WITH_MESSAGE(!part.transposition.has_value(), partId + " should have no transposition"); partIndex = 30; - partId = "P" + std::to_string( partIndex + 1 ); - part = result.parts.at( partIndex ); - CHECK_EQUAL( partId, part.uniqueId ); - CHECK_WITH_MESSAGE( !part.transposition.has_value(), partId + " should have no transposition" ); + partId = "P" + std::to_string(partIndex + 1); + part = result.parts.at(partIndex); + CHECK_EQUAL(partId, part.uniqueId); + CHECK_WITH_MESSAGE(!part.transposition.has_value(), partId + " should have no transposition"); - CHECK_EQUAL( original, result ); + CHECK_EQUAL(original, result); } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AccentTest.cpp b/Sourcecode/private/mxtest/core/AccentTest.cpp index 549e1a3cd..adbfd9f62 100644 --- a/Sourcecode/private/mxtest/core/AccentTest.cpp +++ b/Sourcecode/private/mxtest/core/AccentTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, Accent ) +TEST(Test01, Accent) { - std::string indentString( INDENT ); - Accent object1; - Accent object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Accent object1; + Accent object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AccidentalMarkTest.cpp b/Sourcecode/private/mxtest/core/AccidentalMarkTest.cpp index b31ef7820..b004b7990 100644 --- a/Sourcecode/private/mxtest/core/AccidentalMarkTest.cpp +++ b/Sourcecode/private/mxtest/core/AccidentalMarkTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, AccidentalMark ) +TEST(Test01, AccidentalMark) { - std::string indentString( INDENT ); - AccidentalValue value1 = AccidentalValue::doubleSharp; - AccidentalValue value2 = AccidentalValue::koron; - AccidentalMark object1; - AccidentalMark object2( value2 ); - AccidentalMarkAttributesPtr attributes1 = std::make_shared(); - AccidentalMarkAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->hasFontWeight = true; + std::string indentString(INDENT); + AccidentalValue value1 = AccidentalValue::doubleSharp; + AccidentalValue value2 = AccidentalValue::koron; + AccidentalMark object1; + AccidentalMark object2(value2); + AccidentalMarkAttributesPtr attributes1 = std::make_shared(); + AccidentalMarkAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->hasFontWeight = true; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); + object2.setAttributes(attributes1); std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(natural)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(koron)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(natural)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(koron)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AccidentalTest.cpp b/Sourcecode/private/mxtest/core/AccidentalTest.cpp index 7d13f13a9..6fe336da2 100644 --- a/Sourcecode/private/mxtest/core/AccidentalTest.cpp +++ b/Sourcecode/private/mxtest/core/AccidentalTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Accidental ) +TEST(Test01, Accidental) { - std::string indentString( INDENT ); - AccidentalValue value1 = AccidentalValue::flat4; - AccidentalValue value2 = AccidentalValue::quarterSharp; - Accidental object1; - Accidental object2( value2 ); - AccidentalAttributesPtr attributes1 = std::make_shared(); - AccidentalAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + AccidentalValue value1 = AccidentalValue::flat4; + AccidentalValue value2 = AccidentalValue::quarterSharp; + Accidental object1; + Accidental object2(value2); + AccidentalAttributesPtr attributes1 = std::make_shared(); + AccidentalAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasBracket = true; attributes1->bracket = YesNo::no; attributes1->hasEditorial = true; attributes1->editorial = YesNo::yes; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(natural)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(quarter-sharp)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(natural)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(quarter-sharp)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AccidentalTextTest.cpp b/Sourcecode/private/mxtest/core/AccidentalTextTest.cpp index 24afb49bf..d283acd7d 100644 --- a/Sourcecode/private/mxtest/core/AccidentalTextTest.cpp +++ b/Sourcecode/private/mxtest/core/AccidentalTextTest.cpp @@ -11,36 +11,39 @@ using namespace mx::core; -TEST( Test01, AccidentalText ) +TEST(Test01, AccidentalText) { - std::string indentString( INDENT ); - AccidentalValue value1; - AccidentalValue value2 = AccidentalValue::sharp; - AccidentalText object1; - AccidentalText object2( value2 ); - AccidentalTextAttributesPtr attributes1 = std::make_shared(); - AccidentalTextAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + AccidentalValue value1; + AccidentalValue value2 = AccidentalValue::sharp; + AccidentalText object1; + AccidentalText object2(value2); + AccidentalTextAttributesPtr attributes1 = std::make_shared(); + AccidentalTextAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasLang = true; attributes1->justify = LeftCenterRight::right; attributes1->hasJustify = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = "natural"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+"sharp"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = "natural"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + "sharp"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AccordTest.cpp b/Sourcecode/private/mxtest/core/AccordTest.cpp index 9a1632465..bf0eb6d55 100644 --- a/Sourcecode/private/mxtest/core/AccordTest.cpp +++ b/Sourcecode/private/mxtest/core/AccordTest.cpp @@ -6,120 +6,118 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/AccordTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Accord ) +TEST(Test01, Accord) { TestMode v = TestMode::one; - AccordPtr object = tgenAccord( v ); - stringstream expected; - tgenAccordExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + AccordPtr object = tgenAccord(v); + stringstream expected; + tgenAccordExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Accord ) + +TEST(Test02, Accord) { TestMode v = TestMode::two; - AccordPtr object = tgenAccord( v ); - stringstream expected; - tgenAccordExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + AccordPtr object = tgenAccord(v); + stringstream expected; + tgenAccordExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Accord ) + +TEST(Test03, Accord) { TestMode v = TestMode::three; - AccordPtr object = tgenAccord( v ); - stringstream expected; - tgenAccordExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + AccordPtr object = tgenAccord(v); + stringstream expected; + tgenAccordExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } + namespace mxtest { - AccordPtr tgenAccord( TestMode v ) +AccordPtr tgenAccord(TestMode v) +{ + AccordPtr o = makeAccord(); + switch (v) { - AccordPtr o = makeAccord(); - switch ( v ) - { - case TestMode::one: - { - ; - } - break; - case TestMode::two: - { - o->getTuningStep()->setValue( StepEnum::c ); - o->setHasTuningAlter( true ); - o->getTuningAlter()->setValue( Semitones( -1 ) ); - o->getTuningOctave()->setValue( OctaveValue( 4 ) ); - } - break; - case TestMode::three: - { - o->getTuningStep()->setValue( StepEnum::f ); - o->setHasTuningAlter( true ); - o->getTuningAlter()->setValue( Semitones( 1 ) ); - o->getTuningOctave()->setValue( OctaveValue( 5 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + ; + } + break; + case TestMode::two: { + o->getTuningStep()->setValue(StepEnum::c); + o->setHasTuningAlter(true); + o->getTuningAlter()->setValue(Semitones(-1)); + o->getTuningOctave()->setValue(OctaveValue(4)); + } + break; + case TestMode::three: { + o->getTuningStep()->setValue(StepEnum::f); + o->setHasTuningAlter(true); + o->getTuningAlter()->setValue(Semitones(1)); + o->getTuningOctave()->setValue(OctaveValue(5)); } - void tgenAccordExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenAccordExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(A)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(C)" ); - streamLine( os, i+1, R"(-1)" ); - streamLine( os, i+1, R"(4)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(F)" ); - streamLine( os, i+1, R"(1)" ); - streamLine( os, i+1, R"(5)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(A)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(C)"); + streamLine(os, i + 1, R"(-1)"); + streamLine(os, i + 1, R"(4)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(F)"); + streamLine(os, i + 1, R"(1)"); + streamLine(os, i + 1, R"(5)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/AccordTest.h b/Sourcecode/private/mxtest/core/AccordTest.h index 962f73bd4..2c50794a3 100644 --- a/Sourcecode/private/mxtest/core/AccordTest.h +++ b/Sourcecode/private/mxtest/core/AccordTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::AccordPtr tgenAccord( TestMode v ); - void tgenAccordExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::AccordPtr tgenAccord(TestMode v); +void tgenAccordExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/AccordionHighTest.cpp b/Sourcecode/private/mxtest/core/AccordionHighTest.cpp index 05c07e3c0..61ef2d7cf 100644 --- a/Sourcecode/private/mxtest/core/AccordionHighTest.cpp +++ b/Sourcecode/private/mxtest/core/AccordionHighTest.cpp @@ -10,27 +10,26 @@ #include using namespace mx::core; - -TEST( Test01, AccordionHigh ) +TEST(Test01, AccordionHigh) { - std::string indentString( INDENT ); - AccordionHigh object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + AccordionHigh object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AccordionLowTest.cpp b/Sourcecode/private/mxtest/core/AccordionLowTest.cpp index cb60e4b85..758661fca 100644 --- a/Sourcecode/private/mxtest/core/AccordionLowTest.cpp +++ b/Sourcecode/private/mxtest/core/AccordionLowTest.cpp @@ -13,32 +13,33 @@ using namespace mx::core; /* 3132 - - The accordion-low element indicates the presence of a dot in the low (16') section of the registration symbol. - + + The accordion-low element indicates the presence of a dot in the low (16') section of the +registration symbol. + */ -TEST( Test01, AccordionLow ) +TEST(Test01, AccordionLow) { - std::string indentString( INDENT ); - AccordionLow object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + AccordionLow object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AccordionMiddleTest.cpp b/Sourcecode/private/mxtest/core/AccordionMiddleTest.cpp index eef54c654..4d6e368e9 100644 --- a/Sourcecode/private/mxtest/core/AccordionMiddleTest.cpp +++ b/Sourcecode/private/mxtest/core/AccordionMiddleTest.cpp @@ -11,29 +11,31 @@ using namespace mx::core; -TEST( Test01, AccordionMiddle ) +TEST(Test01, AccordionMiddle) { - std::string indentString( INDENT ); - AccordionMiddleValue value1{ 2 }; - AccordionMiddleValue value2{ 3 }; - AccordionMiddle object1; - AccordionMiddle object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + AccordionMiddleValue value1{2}; + AccordionMiddleValue value2{3}; + AccordionMiddle object1; + AccordionMiddle object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AccordionRegistrationTest.cpp b/Sourcecode/private/mxtest/core/AccordionRegistrationTest.cpp index a1f54975c..3a741f2ac 100644 --- a/Sourcecode/private/mxtest/core/AccordionRegistrationTest.cpp +++ b/Sourcecode/private/mxtest/core/AccordionRegistrationTest.cpp @@ -6,45 +6,45 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, AccordionRegistration ) +TEST(Test01, AccordionRegistration) { - AccordionRegistration object; - stringstream expected; - streamLine( expected, 1, R"()", false ); - stringstream actual; - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( ! object.hasContents() ) + AccordionRegistration object; + stringstream expected; + streamLine(expected, 1, R"()", false); + stringstream actual; + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(!object.hasContents()) } -TEST( Test02, AccordionRegistration ) +TEST(Test02, AccordionRegistration) { - AccordionRegistration object; + AccordionRegistration object; object.getAttributes()->hasColor = true; object.getAttributes()->hasValign = true; object.getAttributes()->valign = Valign::baseline; - object.setHasAccordionHigh( true ); - object.setHasAccordionMiddle( true ); - object.setHasAccordionLow( true ); - object.getAccordionMiddle()->setValue( AccordionMiddleValue{ 2 } ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"(2)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.setHasAccordionHigh(true); + object.setHasAccordionMiddle(true); + object.setHasAccordionLow(true); + object.getAccordionMiddle()->setValue(AccordionMiddleValue{2}); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"(2)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/ActualNotesTest.cpp b/Sourcecode/private/mxtest/core/ActualNotesTest.cpp index 09b01a8f5..f3898437c 100644 --- a/Sourcecode/private/mxtest/core/ActualNotesTest.cpp +++ b/Sourcecode/private/mxtest/core/ActualNotesTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, ActualNotes ) +TEST(Test01, ActualNotes) { - std::string indentString( INDENT ); - NonNegativeInteger value1{ 2 }; - NonNegativeInteger value2{ 3 }; - ActualNotes object1; - ActualNotes object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NonNegativeInteger value1{2}; + NonNegativeInteger value2{3}; + ActualNotes object1; + ActualNotes object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AlterTest.cpp b/Sourcecode/private/mxtest/core/AlterTest.cpp index 5392ca5d4..517c936f0 100644 --- a/Sourcecode/private/mxtest/core/AlterTest.cpp +++ b/Sourcecode/private/mxtest/core/AlterTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Alter ) +TEST(Test01, Alter) { - std::string indentString( INDENT ); - Semitones value1{ -0.1 }; - Semitones value2{ 2.02 }; - Alter object1; - Alter object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2.02)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Semitones value1{-0.1}; + Semitones value2{2.02}; + Alter object1; + Alter object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2.02)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/AppearanceTest.cpp b/Sourcecode/private/mxtest/core/AppearanceTest.cpp index 804b18fdd..3458793e7 100644 --- a/Sourcecode/private/mxtest/core/AppearanceTest.cpp +++ b/Sourcecode/private/mxtest/core/AppearanceTest.cpp @@ -6,162 +6,157 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/AppearanceTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" /* #include "MidiDeviceTest.cpp" */ - using namespace mx::core; using namespace std; using namespace mxtest; #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -TEST( Test01, Appearance ) +TEST(Test01, Appearance) { TestMode v = TestMode::one; - AppearancePtr object = tgenAppearance( v ); - stringstream expected; - tgenAppearanceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + AppearancePtr object = tgenAppearance(v); + stringstream expected; + tgenAppearanceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Appearance ) + +TEST(Test02, Appearance) { TestMode v = TestMode::two; - AppearancePtr object = tgenAppearance( v ); - stringstream expected; - tgenAppearanceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + AppearancePtr object = tgenAppearance(v); + stringstream expected; + tgenAppearanceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Appearance ) + +TEST(Test03, Appearance) { TestMode v = TestMode::three; - AppearancePtr object = tgenAppearance( v ); - stringstream expected; - tgenAppearanceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + AppearancePtr object = tgenAppearance(v); + stringstream expected; + tgenAppearanceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } #endif namespace mxtest { - AppearancePtr tgenAppearance( TestMode v ) +AppearancePtr tgenAppearance(TestMode v) +{ + AppearancePtr o = makeAppearance(); + switch (v) { - AppearancePtr o = makeAppearance(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - OtherAppearancePtr oa1 = makeOtherAppearance(); - OtherAppearancePtr oa2 = makeOtherAppearance(); - LineWidthPtr lw1 = makeLineWidth(); - LineWidthPtr lw2 = makeLineWidth(); - DistancePtr d1 = makeDistance(); - oa1->setValue( XsString( "oa1" ) ); - oa2->setValue( XsString( "oa2" ) ); - oa1->getAttributes()->type = XsToken( "T1" ); - oa2->getAttributes()->type = XsToken( "T2" ); - lw1->setValue( TenthsValue( 11.1 ) ); - lw2->setValue( TenthsValue( 11.2 ) ); - lw1->getAttributes()->type = LineWidthType( LineWidthTypeEnum::dashes ); - lw2->getAttributes()->type = LineWidthType( LineWidthTypeEnum::slurTip ); - d1->setValue( TenthsValue( 13.3 ) ); - d1->getAttributes()->type = DistanceType( DistanceTypeEnum::hyphen ); - o->addDistance( d1 ); - o->addLineWidth( lw1 ); - o->addLineWidth( lw2 ); - o->addOtherAppearance( oa1 ); - o->addOtherAppearance( oa2 ); - } - break; - case TestMode::three: - { - OtherAppearancePtr oa1 = makeOtherAppearance(); - OtherAppearancePtr oa2 = makeOtherAppearance(); - LineWidthPtr lw1 = makeLineWidth(); - LineWidthPtr lw2 = makeLineWidth(); - DistancePtr d1 = makeDistance(); - oa1->setValue( XsString( "xa1" ) ); - oa2->setValue( XsString( "xa2" ) ); - oa1->getAttributes()->type = XsToken( "T1x" ); - oa2->getAttributes()->type = XsToken( "Tx2" ); - lw1->setValue( TenthsValue( 1.1 ) ); - lw2->setValue( TenthsValue( 1.2 ) ); - lw1->getAttributes()->type = LineWidthType( LineWidthTypeEnum::dashes ); - lw2->getAttributes()->type = LineWidthType( LineWidthTypeEnum::slurTip ); - d1->setValue( TenthsValue( 3.3 ) ); - d1->getAttributes()->type = DistanceType( DistanceTypeEnum::hyphen ); - o->addDistance( d1 ); - o->addLineWidth( lw1 ); - o->addLineWidth( lw2 ); - o->addOtherAppearance( oa1 ); - o->addOtherAppearance( oa2 ); - o->addNoteSize( makeNoteSize( NonNegativeDecimal( 3 ) ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + OtherAppearancePtr oa1 = makeOtherAppearance(); + OtherAppearancePtr oa2 = makeOtherAppearance(); + LineWidthPtr lw1 = makeLineWidth(); + LineWidthPtr lw2 = makeLineWidth(); + DistancePtr d1 = makeDistance(); + oa1->setValue(XsString("oa1")); + oa2->setValue(XsString("oa2")); + oa1->getAttributes()->type = XsToken("T1"); + oa2->getAttributes()->type = XsToken("T2"); + lw1->setValue(TenthsValue(11.1)); + lw2->setValue(TenthsValue(11.2)); + lw1->getAttributes()->type = LineWidthType(LineWidthTypeEnum::dashes); + lw2->getAttributes()->type = LineWidthType(LineWidthTypeEnum::slurTip); + d1->setValue(TenthsValue(13.3)); + d1->getAttributes()->type = DistanceType(DistanceTypeEnum::hyphen); + o->addDistance(d1); + o->addLineWidth(lw1); + o->addLineWidth(lw2); + o->addOtherAppearance(oa1); + o->addOtherAppearance(oa2); + } + break; + case TestMode::three: { + OtherAppearancePtr oa1 = makeOtherAppearance(); + OtherAppearancePtr oa2 = makeOtherAppearance(); + LineWidthPtr lw1 = makeLineWidth(); + LineWidthPtr lw2 = makeLineWidth(); + DistancePtr d1 = makeDistance(); + oa1->setValue(XsString("xa1")); + oa2->setValue(XsString("xa2")); + oa1->getAttributes()->type = XsToken("T1x"); + oa2->getAttributes()->type = XsToken("Tx2"); + lw1->setValue(TenthsValue(1.1)); + lw2->setValue(TenthsValue(1.2)); + lw1->getAttributes()->type = LineWidthType(LineWidthTypeEnum::dashes); + lw2->getAttributes()->type = LineWidthType(LineWidthTypeEnum::slurTip); + d1->setValue(TenthsValue(3.3)); + d1->getAttributes()->type = DistanceType(DistanceTypeEnum::hyphen); + o->addDistance(d1); + o->addLineWidth(lw1); + o->addLineWidth(lw2); + o->addOtherAppearance(oa1); + o->addOtherAppearance(oa2); + o->addNoteSize(makeNoteSize(NonNegativeDecimal(3))); } - void tgenAppearanceExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenAppearanceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(11.1)" ); - streamLine( os, i+1, R"(11.2)" ); - streamLine( os, i+1, R"(13.3)" ); - streamLine( os, i+1, R"(oa1)" ); - streamLine( os, i+1, R"(oa2)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(1.1)" ); - streamLine( os, i+1, R"(1.2)" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i+1, R"(3.3)" ); - streamLine( os, i+1, R"(xa1)" ); - streamLine( os, i+1, R"(xa2)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(11.1)"); + streamLine(os, i + 1, R"(11.2)"); + streamLine(os, i + 1, R"(13.3)"); + streamLine(os, i + 1, R"(oa1)"); + streamLine(os, i + 1, R"(oa2)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(1.1)"); + streamLine(os, i + 1, R"(1.2)"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i + 1, R"(3.3)"); + streamLine(os, i + 1, R"(xa1)"); + streamLine(os, i + 1, R"(xa2)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/AppearanceTest.h b/Sourcecode/private/mxtest/core/AppearanceTest.h index 29dc81788..7021de5ce 100644 --- a/Sourcecode/private/mxtest/core/AppearanceTest.h +++ b/Sourcecode/private/mxtest/core/AppearanceTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::AppearancePtr tgenAppearance( TestMode v ); - void tgenAppearanceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::AppearancePtr tgenAppearance(TestMode v); +void tgenAppearanceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ArpeggiateTest.cpp b/Sourcecode/private/mxtest/core/ArpeggiateTest.cpp index 486a6dc20..4529c3102 100644 --- a/Sourcecode/private/mxtest/core/ArpeggiateTest.cpp +++ b/Sourcecode/private/mxtest/core/ArpeggiateTest.cpp @@ -11,40 +11,42 @@ using namespace mx::core; -TEST( Test01, Arpeggiate ) +TEST(Test01, Arpeggiate) { - std::string indentString( INDENT ); - Arpeggiate object1; - Arpeggiate object2; - ArpeggiateAttributesPtr attributes1 = std::make_shared(); - ArpeggiateAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Arpeggiate object1; + Arpeggiate object2; + ArpeggiateAttributesPtr attributes1 = std::make_shared(); + ArpeggiateAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasDirection = true; attributes1->direction = UpDown::up; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->number = NumberLevel{2}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/ArrowDirectionTest.cpp b/Sourcecode/private/mxtest/core/ArrowDirectionTest.cpp index a796ae837..98194ebca 100644 --- a/Sourcecode/private/mxtest/core/ArrowDirectionTest.cpp +++ b/Sourcecode/private/mxtest/core/ArrowDirectionTest.cpp @@ -11,29 +11,31 @@ using namespace mx::core; -TEST( Test01, ArrowDirection ) +TEST(Test01, ArrowDirection) { - std::string indentString( INDENT ); - ArrowDirectionEnum value1 = ArrowDirectionEnum::northeast; - ArrowDirectionEnum value2 = ArrowDirectionEnum::down; - ArrowDirection object1; - ArrowDirection object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(up)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(down)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + ArrowDirectionEnum value1 = ArrowDirectionEnum::northeast; + ArrowDirectionEnum value2 = ArrowDirectionEnum::down; + ArrowDirection object1; + ArrowDirection object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(up)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(down)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/ArrowStyleTest.cpp b/Sourcecode/private/mxtest/core/ArrowStyleTest.cpp index 5c6d963e5..1247bb735 100644 --- a/Sourcecode/private/mxtest/core/ArrowStyleTest.cpp +++ b/Sourcecode/private/mxtest/core/ArrowStyleTest.cpp @@ -11,29 +11,31 @@ using namespace mx::core; -TEST( Test01, ArrowStyle ) +TEST(Test01, ArrowStyle) { - std::string indentString( INDENT ); - ArrowStyleEnum value1 = ArrowStyleEnum::filled; - ArrowStyleEnum value2 = ArrowStyleEnum::paired; - ArrowStyle object1; - ArrowStyle object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(single)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(paired)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + ArrowStyleEnum value1 = ArrowStyleEnum::filled; + ArrowStyleEnum value2 = ArrowStyleEnum::paired; + ArrowStyle object1; + ArrowStyle object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(single)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(paired)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/ArrowTest.cpp b/Sourcecode/private/mxtest/core/ArrowTest.cpp index f4a29de93..c8e8a5c2a 100644 --- a/Sourcecode/private/mxtest/core/ArrowTest.cpp +++ b/Sourcecode/private/mxtest/core/ArrowTest.cpp @@ -6,8 +6,8 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/ArrowTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; @@ -15,114 +15,110 @@ using namespace mxtest; #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -TEST( Test01, Arrow ) +TEST(Test01, Arrow) { TestMode v = TestMode::one; - ArrowPtr object = tgenArrow( v ); - stringstream expected; - tgenArrowExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ArrowPtr object = tgenArrow(v); + stringstream expected; + tgenArrowExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Arrow ) + +TEST(Test02, Arrow) { TestMode v = TestMode::two; - ArrowPtr object = tgenArrow( v ); - stringstream expected; - tgenArrowExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ArrowPtr object = tgenArrow(v); + stringstream expected; + tgenArrowExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Arrow ) + +TEST(Test03, Arrow) { TestMode v = TestMode::three; - ArrowPtr object = tgenArrow( v ); - stringstream expected; - tgenArrowExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ArrowPtr object = tgenArrow(v); + stringstream expected; + tgenArrowExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } #endif namespace mxtest { - ArrowPtr tgenArrow( TestMode v ) +ArrowPtr tgenArrow(TestMode v) +{ + ArrowPtr o = makeArrow(); + switch (v) { - ArrowPtr o = makeArrow(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( Arrow::Choice::arrowGroup ); - auto ag = makeArrowGroup(); - ag->getArrowDirection()->setValue( ArrowDirectionEnum::leftRight ); - ag->setHasArrowStyle( true ); - ag->getArrowStyle()->setValue( ArrowStyleEnum::hollow ); - o->setArrowGroup( ag ); - o->getAttributes()->hasPlacement = true; - o->getAttributes()->placement = AboveBelow::below; - } - break; - case TestMode::three: - { - o->setChoice( Arrow::Choice::circularArrow ); - o->getCircularArrow()->setValue( CircularArrowEnum::anticlockwise ); - o->getAttributes()->hasRelativeY = true; - o->getAttributes()->relativeY = TenthsValue( 0.1 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(Arrow::Choice::arrowGroup); + auto ag = makeArrowGroup(); + ag->getArrowDirection()->setValue(ArrowDirectionEnum::leftRight); + ag->setHasArrowStyle(true); + ag->getArrowStyle()->setValue(ArrowStyleEnum::hollow); + o->setArrowGroup(ag); + o->getAttributes()->hasPlacement = true; + o->getAttributes()->placement = AboveBelow::below; + } + break; + case TestMode::three: { + o->setChoice(Arrow::Choice::circularArrow); + o->getCircularArrow()->setValue(CircularArrowEnum::anticlockwise); + o->getAttributes()->hasRelativeY = true; + o->getAttributes()->relativeY = TenthsValue(0.1); + } + break; + default: + break; } - void tgenArrowExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenArrowExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(up)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(left right)" ); - streamLine( os, i+1, R"(hollow)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(anticlockwise)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(up)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(left right)"); + streamLine(os, i + 1, R"(hollow)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(anticlockwise)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ArrowTest.h b/Sourcecode/private/mxtest/core/ArrowTest.h index ef410356c..093e97483 100644 --- a/Sourcecode/private/mxtest/core/ArrowTest.h +++ b/Sourcecode/private/mxtest/core/ArrowTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ArrowPtr tgenArrow( TestMode v ); - void tgenArrowExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ArrowPtr tgenArrow(TestMode v); +void tgenArrowExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ArticulationsTest.cpp b/Sourcecode/private/mxtest/core/ArticulationsTest.cpp index aecd9aff1..45d5ff764 100644 --- a/Sourcecode/private/mxtest/core/ArticulationsTest.cpp +++ b/Sourcecode/private/mxtest/core/ArticulationsTest.cpp @@ -6,150 +6,144 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/ArticulationsTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Articulations ) +TEST(Test01, Articulations) { TestMode v = TestMode::one; - ArticulationsPtr object = tgenArticulations( v ); - stringstream expected; - tgenArticulationsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + ArticulationsPtr object = tgenArticulations(v); + stringstream expected; + tgenArticulationsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Articulations ) + +TEST(Test02, Articulations) { TestMode v = TestMode::two; - ArticulationsPtr object = tgenArticulations( v ); - stringstream expected; - tgenArticulationsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ArticulationsPtr object = tgenArticulations(v); + stringstream expected; + tgenArticulationsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Articulations ) + +TEST(Test03, Articulations) { TestMode v = TestMode::three; - ArticulationsPtr object = tgenArticulations( v ); - stringstream expected; - tgenArticulationsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ArticulationsPtr object = tgenArticulations(v); + stringstream expected; + tgenArticulationsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ArticulationsChoicePtr tgenArticulationsChoice( TestMode v ) +ArticulationsChoicePtr tgenArticulationsChoice(TestMode v) +{ + ArticulationsChoicePtr o = makeArticulationsChoice(); + switch (v) { - ArticulationsChoicePtr o = makeArticulationsChoice(); - switch ( v ) - { - case TestMode::one: - { - o->setChoice( ArticulationsChoice::Choice::breathMark ); - o->getBreathMark()->getAttributes()->hasFontStyle = true; - o->getBreathMark()->getAttributes()->fontStyle = FontStyle::italic; - } - break; - case TestMode::two: - { - o->setChoice( ArticulationsChoice::Choice::strongAccent ); - o->getStrongAccent()->getAttributes()->hasColor = true; - o->getStrongAccent()->getAttributes()->color = Color( 56, 90, 12 ); - } - break; - case TestMode::three: - { - o->setChoice( ArticulationsChoice::Choice::tenuto ); - o->getTenuto()->getAttributes()->hasPlacement = true; - o->getTenuto()->getAttributes()->placement = AboveBelow::above; - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setChoice(ArticulationsChoice::Choice::breathMark); + o->getBreathMark()->getAttributes()->hasFontStyle = true; + o->getBreathMark()->getAttributes()->fontStyle = FontStyle::italic; } - ArticulationsPtr tgenArticulations( TestMode v ) + break; + case TestMode::two: { + o->setChoice(ArticulationsChoice::Choice::strongAccent); + o->getStrongAccent()->getAttributes()->hasColor = true; + o->getStrongAccent()->getAttributes()->color = Color(56, 90, 12); + } + break; + case TestMode::three: { + o->setChoice(ArticulationsChoice::Choice::tenuto); + o->getTenuto()->getAttributes()->hasPlacement = true; + o->getTenuto()->getAttributes()->placement = AboveBelow::above; + } + break; + default: + break; + } + return o; +} + +ArticulationsPtr tgenArticulations(TestMode v) +{ + ArticulationsPtr o = makeArticulations(); + switch (v) { - ArticulationsPtr o = makeArticulations(); - switch ( v ) - { - case TestMode::one: - { - ; - } - break; - case TestMode::two: - { - o->addArticulationsChoice( tgenArticulationsChoice( TestMode::one ) ); - o->addArticulationsChoice( tgenArticulationsChoice( TestMode::three ) ); - } - break; - case TestMode::three: - { - o->addArticulationsChoice( tgenArticulationsChoice( TestMode::two ) ); - o->addArticulationsChoice( tgenArticulationsChoice( TestMode::three ) ); - o->addArticulationsChoice( tgenArticulationsChoice( TestMode::one ) ); - o->addArticulationsChoice( tgenArticulationsChoice( TestMode::two ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + ; + } + break; + case TestMode::two: { + o->addArticulationsChoice(tgenArticulationsChoice(TestMode::one)); + o->addArticulationsChoice(tgenArticulationsChoice(TestMode::three)); + } + break; + case TestMode::three: { + o->addArticulationsChoice(tgenArticulationsChoice(TestMode::two)); + o->addArticulationsChoice(tgenArticulationsChoice(TestMode::three)); + o->addArticulationsChoice(tgenArticulationsChoice(TestMode::one)); + o->addArticulationsChoice(tgenArticulationsChoice(TestMode::two)); } - void tgenArticulationsExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenArticulationsExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ArticulationsTest.h b/Sourcecode/private/mxtest/core/ArticulationsTest.h index a23224d80..1563b610d 100644 --- a/Sourcecode/private/mxtest/core/ArticulationsTest.h +++ b/Sourcecode/private/mxtest/core/ArticulationsTest.h @@ -6,14 +6,14 @@ #ifdef MX_COMPILE_CORE_TESTS #pragma once -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ArticulationsChoicePtr tgenArticulationsChoice( TestMode v ); - mx::core::ArticulationsPtr tgenArticulations( TestMode v ); - void tgenArticulationsExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ArticulationsChoicePtr tgenArticulationsChoice(TestMode v); +mx::core::ArticulationsPtr tgenArticulations(TestMode v); +void tgenArticulationsExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ArtificialTest.cpp b/Sourcecode/private/mxtest/core/ArtificialTest.cpp index e9d87a0b0..2bfc241ef 100644 --- a/Sourcecode/private/mxtest/core/ArtificialTest.cpp +++ b/Sourcecode/private/mxtest/core/ArtificialTest.cpp @@ -10,28 +10,27 @@ #include using namespace mx::core; - -TEST( Test01, Artificial ) +TEST(Test01, Artificial) { - std::string indentString( INDENT ); - Artificial object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Artificial object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/BackupTest.cpp b/Sourcecode/private/mxtest/core/BackupTest.cpp index 25ebf8153..714164624 100644 --- a/Sourcecode/private/mxtest/core/BackupTest.cpp +++ b/Sourcecode/private/mxtest/core/BackupTest.cpp @@ -6,114 +6,110 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/BackupTest.h" #include "mxtest/core/EditorialGroupTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Backup ) +TEST(Test01, Backup) { TestMode v = TestMode::one; - BackupPtr object = tgenBackup( v ); - stringstream expected; - tgenBackupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + BackupPtr object = tgenBackup(v); + stringstream expected; + tgenBackupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Backup ) + +TEST(Test02, Backup) { TestMode v = TestMode::two; - BackupPtr object = tgenBackup( v ); - stringstream expected; - tgenBackupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + BackupPtr object = tgenBackup(v); + stringstream expected; + tgenBackupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Backup ) + +TEST(Test03, Backup) { TestMode v = TestMode::three; - BackupPtr object = tgenBackup( v ); - stringstream expected; - tgenBackupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + BackupPtr object = tgenBackup(v); + stringstream expected; + tgenBackupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - BackupPtr tgenBackup( TestMode v ) +BackupPtr tgenBackup(TestMode v) +{ + BackupPtr o = makeBackup(); + switch (v) { - BackupPtr o = makeBackup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getDuration()->setValue( PositiveDivisionsValue( 31 ) ); - } - break; - case TestMode::three: - { - o->getDuration()->setValue( PositiveDivisionsValue( 32 ) ); - o->setEditorialGroup( tgenEditorialGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getDuration()->setValue(PositiveDivisionsValue(31)); + } + break; + case TestMode::three: { + o->getDuration()->setValue(PositiveDivisionsValue(32)); + o->setEditorialGroup(tgenEditorialGroup(v)); + } + break; + default: + break; } - void tgenBackupExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenBackupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(1)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(31)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(32)" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(1)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(31)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(32)"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BackupTest.h b/Sourcecode/private/mxtest/core/BackupTest.h index ed83201ce..d05760bc9 100644 --- a/Sourcecode/private/mxtest/core/BackupTest.h +++ b/Sourcecode/private/mxtest/core/BackupTest.h @@ -6,13 +6,13 @@ #ifdef MX_COMPILE_CORE_TESTS #pragma once -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::BackupPtr tgenBackup( TestMode v ); - void tgenBackupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::BackupPtr tgenBackup(TestMode v); +void tgenBackupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BarStyleTest.cpp b/Sourcecode/private/mxtest/core/BarStyleTest.cpp index 9b1dccfc9..dc27b9277 100644 --- a/Sourcecode/private/mxtest/core/BarStyleTest.cpp +++ b/Sourcecode/private/mxtest/core/BarStyleTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, BarStyle ) +TEST(Test01, BarStyle) { - std::string indentString( INDENT ); - BarStyleEnum value1 = BarStyleEnum::heavy; - BarStyleEnum value2 = BarStyleEnum::lightHeavy; - BarStyle object1; - BarStyle object2( value2 ); - BarStyleAttributesPtr attributes1 = std::make_shared(); - BarStyleAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + BarStyleEnum value1 = BarStyleEnum::heavy; + BarStyleEnum value2 = BarStyleEnum::lightHeavy; + BarStyle object1; + BarStyle object2(value2); + BarStyleAttributesPtr attributes1 = std::make_shared(); + BarStyleAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasColor = true; - attributes1->color = Color{ 100, 101, 102, 103 }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(regular)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(light-heavy)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->color = Color{100, 101, 102, 103}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(regular)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(light-heavy)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/BarlineTest.cpp b/Sourcecode/private/mxtest/core/BarlineTest.cpp index cd7999692..ac5ccaae5 100644 --- a/Sourcecode/private/mxtest/core/BarlineTest.cpp +++ b/Sourcecode/private/mxtest/core/BarlineTest.cpp @@ -6,120 +6,115 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/BarlineTest.h" #include "mxtest/core/EditorialGroupTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Barline ) +TEST(Test01, Barline) { TestMode v = TestMode::one; - BarlinePtr object = tgenBarline( v ); - stringstream expected; - tgenBarlineExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + BarlinePtr object = tgenBarline(v); + stringstream expected; + tgenBarlineExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Barline ) + +TEST(Test02, Barline) { TestMode v = TestMode::two; - BarlinePtr object = tgenBarline( v ); - stringstream expected; - tgenBarlineExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + BarlinePtr object = tgenBarline(v); + stringstream expected; + tgenBarlineExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Barline ) + +TEST(Test03, Barline) { TestMode v = TestMode::three; - BarlinePtr object = tgenBarline( v ); - stringstream expected; - tgenBarlineExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + BarlinePtr object = tgenBarline(v); + stringstream expected; + tgenBarlineExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - BarlinePtr tgenBarline( TestMode v ) +BarlinePtr tgenBarline(TestMode v) +{ + BarlinePtr o = makeBarline(); + switch (v) { - BarlinePtr o = makeBarline(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setEditorialGroup( tgenEditorialGroup( v ) ); - o->setHasCoda( true ); - o->getCoda()->getAttributes()->hasFontFamily = true; - o->getCoda()->getAttributes()->fontFamily = CommaSeparatedText( "bish,and,bones" ); - o->addFermata( makeFermata() ); - o->getAttributes()->hasCoda = true; - o->getAttributes()->coda = XsToken( "Loda" ); - - } - break; - case TestMode::three: - { - o->getAttributes()->hasLocation = true; - o->setHasWavyLine( true ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setEditorialGroup(tgenEditorialGroup(v)); + o->setHasCoda(true); + o->getCoda()->getAttributes()->hasFontFamily = true; + o->getCoda()->getAttributes()->fontFamily = CommaSeparatedText("bish,and,bones"); + o->addFermata(makeFermata()); + o->getAttributes()->hasCoda = true; + o->getAttributes()->coda = XsToken("Loda"); + } + break; + case TestMode::three: { + o->getAttributes()->hasLocation = true; + o->setHasWavyLine(true); + } + break; + default: + break; } - void tgenBarlineExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenBarlineExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(normal)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(normal)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BarlineTest.h b/Sourcecode/private/mxtest/core/BarlineTest.h index 8c209aff5..9b92bd5b4 100644 --- a/Sourcecode/private/mxtest/core/BarlineTest.h +++ b/Sourcecode/private/mxtest/core/BarlineTest.h @@ -6,13 +6,13 @@ #ifdef MX_COMPILE_CORE_TESTS #pragma once -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::BarlinePtr tgenBarline( TestMode v ); - void tgenBarlineExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::BarlinePtr tgenBarline(TestMode v); +void tgenBarlineExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BarreTest.cpp b/Sourcecode/private/mxtest/core/BarreTest.cpp index 76b858738..8b7c6e468 100644 --- a/Sourcecode/private/mxtest/core/BarreTest.cpp +++ b/Sourcecode/private/mxtest/core/BarreTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, Barre ) +TEST(Test01, Barre) { - std::string indentString( INDENT ); - Barre object1; - Barre object2; - BarreAttributesPtr attributes1 = std::make_shared(); - BarreAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Barre object1; + Barre object2; + BarreAttributesPtr attributes1 = std::make_shared(); + BarreAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->type = StartStop::stop; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/BasePitchTest.cpp b/Sourcecode/private/mxtest/core/BasePitchTest.cpp index cad1f8833..ba6febe3e 100644 --- a/Sourcecode/private/mxtest/core/BasePitchTest.cpp +++ b/Sourcecode/private/mxtest/core/BasePitchTest.cpp @@ -10,28 +10,27 @@ #include using namespace mx::core; - -TEST( Test01, BasePitch ) +TEST(Test01, BasePitch) { - std::string indentString( INDENT ); - BasePitch object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + BasePitch object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/BassAlterTest.cpp b/Sourcecode/private/mxtest/core/BassAlterTest.cpp index f7a6bc816..a66fd1cf1 100644 --- a/Sourcecode/private/mxtest/core/BassAlterTest.cpp +++ b/Sourcecode/private/mxtest/core/BassAlterTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, BassAlter ) +TEST(Test01, BassAlter) { - std::string indentString( INDENT ); - Semitones value1{ 1 }; - Semitones value2{ -0.25 }; - BassAlter object1; - BassAlter object2( value2 ); - BassAlterAttributesPtr attributes1 = std::make_shared(); - BassAlterAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + Semitones value1{1}; + Semitones value2{-0.25}; + BassAlter object1; + BassAlter object2(value2); + BassAlterAttributesPtr attributes1 = std::make_shared(); + BassAlterAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasPrintObject = true; attributes1->printObject = YesNo::no; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(-0.25)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(-0.25)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/BassStepTest.cpp b/Sourcecode/private/mxtest/core/BassStepTest.cpp index b0b475437..5821abf43 100644 --- a/Sourcecode/private/mxtest/core/BassStepTest.cpp +++ b/Sourcecode/private/mxtest/core/BassStepTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, BassStep ) +TEST(Test01, BassStep) { - std::string indentString( INDENT ); - StepEnum value1 = StepEnum::g; - StepEnum value2 = StepEnum::b; - BassStep object1; - BassStep object2( value2 ); - BassStepAttributesPtr attributes1 = std::make_shared(); - BassStepAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + StepEnum value1 = StepEnum::g; + StepEnum value2 = StepEnum::b; + BassStep object1; + BassStep object2(value2); + BassStepAttributesPtr attributes1 = std::make_shared(); + BassStepAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasText = true; - attributes1->text = XsToken{ "HelloThere" }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(A)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(B)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->text = XsToken{"HelloThere"}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(A)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(B)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/BassTest.cpp b/Sourcecode/private/mxtest/core/BassTest.cpp index 3dc46e2b7..8717a2210 100644 --- a/Sourcecode/private/mxtest/core/BassTest.cpp +++ b/Sourcecode/private/mxtest/core/BassTest.cpp @@ -6,118 +6,113 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/BassTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Bass ) +TEST(Test01, Bass) { TestMode v = TestMode::one; - BassPtr object = tgenBass( v ); - stringstream expected; - tgenBassExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + BassPtr object = tgenBass(v); + stringstream expected; + tgenBassExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Bass ) + +TEST(Test02, Bass) { TestMode v = TestMode::two; - BassPtr object = tgenBass( v ); - stringstream expected; - tgenBassExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + BassPtr object = tgenBass(v); + stringstream expected; + tgenBassExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Bass ) + +TEST(Test03, Bass) { TestMode v = TestMode::three; - BassPtr object = tgenBass( v ); - stringstream expected; - tgenBassExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + BassPtr object = tgenBass(v); + stringstream expected; + tgenBassExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - BassPtr tgenBass( TestMode v ) +BassPtr tgenBass(TestMode v) +{ + BassPtr o = makeBass(); + switch (v) { - BassPtr o = makeBass(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasBassAlter( true ); - o->getBassAlter()->setValue( Semitones( -2 ) ); - o->getBassStep()->setValue( StepEnum::f ); - } - break; - case TestMode::three: - { - o->setHasBassAlter( true ); - o->getBassAlter()->setValue( Semitones( 1.1 ) ); - o->getBassStep()->setValue( StepEnum::c ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasBassAlter(true); + o->getBassAlter()->setValue(Semitones(-2)); + o->getBassStep()->setValue(StepEnum::f); + } + break; + case TestMode::three: { + o->setHasBassAlter(true); + o->getBassAlter()->setValue(Semitones(1.1)); + o->getBassStep()->setValue(StepEnum::c); } - void tgenBassExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenBassExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(A)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(F)" ); - streamLine( os, i+1, R"(-2)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(C)" ); - streamLine( os, i+1, R"(1.1)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(A)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(F)"); + streamLine(os, i + 1, R"(-2)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(C)"); + streamLine(os, i + 1, R"(1.1)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BassTest.h b/Sourcecode/private/mxtest/core/BassTest.h index 56887f6aa..a9a8f5982 100644 --- a/Sourcecode/private/mxtest/core/BassTest.h +++ b/Sourcecode/private/mxtest/core/BassTest.h @@ -6,13 +6,13 @@ #ifdef MX_COMPILE_CORE_TESTS #pragma once -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::BassPtr tgenBass( TestMode v ); - void tgenBassExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::BassPtr tgenBass(TestMode v); +void tgenBassExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BeamTest.cpp b/Sourcecode/private/mxtest/core/BeamTest.cpp index 57f8fb8ac..6ecb9b22f 100644 --- a/Sourcecode/private/mxtest/core/BeamTest.cpp +++ b/Sourcecode/private/mxtest/core/BeamTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Beam ) +TEST(Test01, Beam) { - std::string indentString( INDENT ); - BeamValue value1 = BeamValue::backwardHook; - BeamValue value2 = BeamValue::end; - Beam object1; - Beam object2( value2 ); - BeamAttributesPtr attributes1 = std::make_shared(); - BeamAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + BeamValue value1 = BeamValue::backwardHook; + BeamValue value2 = BeamValue::end; + Beam object1; + Beam object2(value2); + BeamAttributesPtr attributes1 = std::make_shared(); + BeamAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasNumber = true; - attributes1->number = BeamLevel{ 2 }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(begin)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(end)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->number = BeamLevel{2}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(begin)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(end)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/BeatRepeatTest.cpp b/Sourcecode/private/mxtest/core/BeatRepeatTest.cpp index d6fbafd89..f65dc31f7 100644 --- a/Sourcecode/private/mxtest/core/BeatRepeatTest.cpp +++ b/Sourcecode/private/mxtest/core/BeatRepeatTest.cpp @@ -6,48 +6,49 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, BeatRepeat ) +TEST(Test01, BeatRepeat) { - BeatRepeat object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(eighth)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + BeatRepeat object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(eighth)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, BeatRepeat ) + +TEST(Test02, BeatRepeat) { - BeatRepeat object; + BeatRepeat object; object.getAttributes()->type = StartStop::stop; object.getAttributes()->hasUseDots = true; object.getAttributes()->useDots = YesNo::yes; object.getAttributes()->hasSlashes = true; - object.addSlashDot( makeSlashDot() ); - object.addSlashDot( makeSlashDot() ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(eighth)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.addSlashDot(makeSlashDot()); + object.addSlashDot(makeSlashDot()); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(eighth)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/BeatTypeTest.cpp b/Sourcecode/private/mxtest/core/BeatTypeTest.cpp index 696a19a57..cd73513bd 100644 --- a/Sourcecode/private/mxtest/core/BeatTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/BeatTypeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, BeatType ) +TEST(Test01, BeatType) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - BeatType object1; - BeatType object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + BeatType object1; + BeatType object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/BeatUnitDotTest.cpp b/Sourcecode/private/mxtest/core/BeatUnitDotTest.cpp index d9f1ab911..26cd2fbe5 100644 --- a/Sourcecode/private/mxtest/core/BeatUnitDotTest.cpp +++ b/Sourcecode/private/mxtest/core/BeatUnitDotTest.cpp @@ -10,27 +10,27 @@ #include using namespace mx::core; -TEST( Test01, BeatUnitDot ) +TEST(Test01, BeatUnitDot) { - std::string indentString( INDENT ); - BeatUnitDot object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + BeatUnitDot object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/BeatUnitTest.cpp b/Sourcecode/private/mxtest/core/BeatUnitTest.cpp index 2bfa13176..49c2f9c79 100644 --- a/Sourcecode/private/mxtest/core/BeatUnitTest.cpp +++ b/Sourcecode/private/mxtest/core/BeatUnitTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, BeatUnit ) +TEST(Test01, BeatUnit) { - std::string indentString( INDENT ); - NoteTypeValue value1 = NoteTypeValue::quarter; - NoteTypeValue value2 = NoteTypeValue::whole; - BeatUnit object1; - BeatUnit object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(eighth)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(whole)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NoteTypeValue value1 = NoteTypeValue::quarter; + NoteTypeValue value2 = NoteTypeValue::whole; + BeatUnit object1; + BeatUnit object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(eighth)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(whole)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/BeaterTest.cpp b/Sourcecode/private/mxtest/core/BeaterTest.cpp index 171b7b846..d567e6fdc 100644 --- a/Sourcecode/private/mxtest/core/BeaterTest.cpp +++ b/Sourcecode/private/mxtest/core/BeaterTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Beater ) +TEST(Test01, Beater) { - std::string indentString( INDENT ); - BeaterValue value1 = BeaterValue::spoonMallet; - BeaterValue value2 = BeaterValue::wireBrush; - Beater object1; - Beater object2( value2 ); - BeaterAttributesPtr attributes1 = std::make_shared(); - BeaterAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + BeaterValue value1 = BeaterValue::spoonMallet; + BeaterValue value2 = BeaterValue::wireBrush; + Beater object1; + Beater object2(value2); + BeaterAttributesPtr attributes1 = std::make_shared(); + BeaterAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasTip = true; attributes1->tip = TipDirection::southeast; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(snare stick)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(wire brush)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(snare stick)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(wire brush)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/BeatsTest.cpp b/Sourcecode/private/mxtest/core/BeatsTest.cpp index ea15316a1..d477f621f 100644 --- a/Sourcecode/private/mxtest/core/BeatsTest.cpp +++ b/Sourcecode/private/mxtest/core/BeatsTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Beats ) +TEST(Test01, Beats) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - Beats object1; - Beats object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + Beats object1; + Beats object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/BendAlterTest.cpp b/Sourcecode/private/mxtest/core/BendAlterTest.cpp index 363c8e15d..7f17cafdf 100644 --- a/Sourcecode/private/mxtest/core/BendAlterTest.cpp +++ b/Sourcecode/private/mxtest/core/BendAlterTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, BendAlter ) +TEST(Test01, BendAlter) { - std::string indentString( INDENT ); - Semitones value1{ -0.1 }; - Semitones value2{ 2.02 }; - BendAlter object1; - BendAlter object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2.02)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Semitones value1{-0.1}; + Semitones value2{2.02}; + BendAlter object1; + BendAlter object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2.02)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/BendChoiceTest.cpp b/Sourcecode/private/mxtest/core/BendChoiceTest.cpp index ea3da3c64..478d44bf1 100644 --- a/Sourcecode/private/mxtest/core/BendChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/BendChoiceTest.cpp @@ -6,112 +6,108 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/AppearanceTest.h" #include "mxtest/core/BendChoiceTest.h" -#include "mxtest/core/ScalingTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/LayoutGroupTest.h" -#include "mxtest/core/AppearanceTest.h" +#include "mxtest/core/ScalingTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, BendChoice ) +TEST(Test01, BendChoice) { TestMode v = TestMode::one; - BendChoicePtr object = tgenBendChoice( v ); - stringstream expected; - tgenBendChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + BendChoicePtr object = tgenBendChoice(v); + stringstream expected; + tgenBendChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, BendChoice ) + +TEST(Test02, BendChoice) { TestMode v = TestMode::two; - BendChoicePtr object = tgenBendChoice( v ); - stringstream expected; - tgenBendChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + BendChoicePtr object = tgenBendChoice(v); + stringstream expected; + tgenBendChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, BendChoice ) + +TEST(Test03, BendChoice) { TestMode v = TestMode::three; - BendChoicePtr object = tgenBendChoice( v ); - stringstream expected; - tgenBendChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + BendChoicePtr object = tgenBendChoice(v); + stringstream expected; + tgenBendChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - BendChoicePtr tgenBendChoice( TestMode v ) +BendChoicePtr tgenBendChoice(TestMode v) +{ + BendChoicePtr o = makeBendChoice(); + switch (v) { - BendChoicePtr o = makeBendChoice(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( BendChoice::Choice::release ); - } - break; - case TestMode::three: - { - o->setChoice( BendChoice::Choice::preBend ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(BendChoice::Choice::release); + } + break; + case TestMode::three: { + o->setChoice(BendChoice::Choice::preBend); } - void tgenBendChoiceExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenBendChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BendChoiceTest.h b/Sourcecode/private/mxtest/core/BendChoiceTest.h index df6c4e3aa..e7ad671d2 100644 --- a/Sourcecode/private/mxtest/core/BendChoiceTest.h +++ b/Sourcecode/private/mxtest/core/BendChoiceTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::BendChoicePtr tgenBendChoice( TestMode v ); - void tgenBendChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::BendChoicePtr tgenBendChoice(TestMode v); +void tgenBendChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BendTest.cpp b/Sourcecode/private/mxtest/core/BendTest.cpp index d7f598fe5..bf592ad9f 100644 --- a/Sourcecode/private/mxtest/core/BendTest.cpp +++ b/Sourcecode/private/mxtest/core/BendTest.cpp @@ -6,131 +6,128 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/BendTest.h" #include "mxtest/core/BendChoiceTest.h" +#include "mxtest/core/BendTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Bend ) +TEST(Test01, Bend) { TestMode v = TestMode::one; - BendPtr object = tgenBend( v ); - stringstream expected; - tgenBendExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + BendPtr object = tgenBend(v); + stringstream expected; + tgenBendExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Bend ) + +TEST(Test02, Bend) { TestMode v = TestMode::two; - BendPtr object = tgenBend( v ); - stringstream expected; - tgenBendExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + BendPtr object = tgenBend(v); + stringstream expected; + tgenBendExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Bend ) + +TEST(Test03, Bend) { TestMode v = TestMode::three; - BendPtr object = tgenBend( v ); - stringstream expected; - tgenBendExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + BendPtr object = tgenBend(v); + stringstream expected; + tgenBendExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - BendPtr tgenBend( TestMode v ) +BendPtr tgenBend(TestMode v) +{ + BendPtr o = makeBend(); + switch (v) { - BendPtr o = makeBend(); - switch ( v ) - { - case TestMode::one: - { - o->setBendChoice( tgenBendChoice( v ) ); - } - break; - case TestMode::two: - { - o->setBendChoice( tgenBendChoice( v ) ); - o->getBendAlter()->setValue( Semitones( 2 ) ); - o->getAttributes()->hasAccelerate = true; - o->getAttributes()->hasBeats = true; - o->getAttributes()->beats = TrillBeats( 3 ); - o->setHasBendChoice( true ); - } - break; - case TestMode::three: - { - o->setBendChoice( tgenBendChoice( v ) ); - o->getBendAlter()->setValue( Semitones( -1.1 ) ); - o->getAttributes()->hasColor = true; - o->getAttributes()->color = Color( 43, 90, 123 ); - o->getAttributes()->hasLastBeat = true; - o->getAttributes()->lastBeat = Percent( 0.999 ); - o->setHasWithBar( true ); - o->getWithBar()->setValue( XsString( "FooBar" ) ); - o->setHasBendChoice( true ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setBendChoice(tgenBendChoice(v)); + } + break; + case TestMode::two: { + o->setBendChoice(tgenBendChoice(v)); + o->getBendAlter()->setValue(Semitones(2)); + o->getAttributes()->hasAccelerate = true; + o->getAttributes()->hasBeats = true; + o->getAttributes()->beats = TrillBeats(3); + o->setHasBendChoice(true); + } + break; + case TestMode::three: { + o->setBendChoice(tgenBendChoice(v)); + o->getBendAlter()->setValue(Semitones(-1.1)); + o->getAttributes()->hasColor = true; + o->getAttributes()->color = Color(43, 90, 123); + o->getAttributes()->hasLastBeat = true; + o->getAttributes()->lastBeat = Percent(0.999); + o->setHasWithBar(true); + o->getWithBar()->setValue(XsString("FooBar")); + o->setHasBendChoice(true); } - void tgenBendExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenBendExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(0)" ); - //tgenBendChoiceExpected( os, i+1, v ); - //os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(2)" ); - tgenBendChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(-1.1)" ); - tgenBendChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(FooBar)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(0)"); + // tgenBendChoiceExpected( os, i+1, v ); + // os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(2)"); + tgenBendChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(-1.1)"); + tgenBendChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(FooBar)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BendTest.h b/Sourcecode/private/mxtest/core/BendTest.h index 8995f6c16..5b870314e 100644 --- a/Sourcecode/private/mxtest/core/BendTest.h +++ b/Sourcecode/private/mxtest/core/BendTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::BendPtr tgenBend( TestMode v ); - void tgenBendExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::BendPtr tgenBend(TestMode v); +void tgenBendExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/BookmarkTest.cpp b/Sourcecode/private/mxtest/core/BookmarkTest.cpp index 1ea15c5fc..4cfe21553 100644 --- a/Sourcecode/private/mxtest/core/BookmarkTest.cpp +++ b/Sourcecode/private/mxtest/core/BookmarkTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, Bookmark ) +TEST(Test01, Bookmark) { - std::string indentString( INDENT ); - Bookmark object1; - Bookmark object2; - BookmarkAttributesPtr attributes1 = std::make_shared(); - BookmarkAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->id = XsID{ "X123" }; + std::string indentString(INDENT); + Bookmark object1; + Bookmark object2; + BookmarkAttributesPtr attributes1 = std::make_shared(); + BookmarkAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->id = XsID{"X123"}; attributes1->hasName = true; - attributes1->name = XsToken{ "zoom" }; + attributes1->name = XsToken{"zoom"}; attributes1->hasPosition = true; - attributes1->position = PositiveInteger{ 3 }; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->position = PositiveInteger{3}; + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/BottomMarginTest.cpp b/Sourcecode/private/mxtest/core/BottomMarginTest.cpp index f6300d3ed..a67b86866 100644 --- a/Sourcecode/private/mxtest/core/BottomMarginTest.cpp +++ b/Sourcecode/private/mxtest/core/BottomMarginTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, BottomMargin ) +TEST(Test01, BottomMargin) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - BottomMargin object1; - BottomMargin object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + BottomMargin object1; + BottomMargin object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/BracketTest.cpp b/Sourcecode/private/mxtest/core/BracketTest.cpp index 5587cb899..3bad85a36 100644 --- a/Sourcecode/private/mxtest/core/BracketTest.cpp +++ b/Sourcecode/private/mxtest/core/BracketTest.cpp @@ -11,34 +11,36 @@ using namespace mx::core; -TEST( Test01, Bracket ) +TEST(Test01, Bracket) { - std::string indentString( INDENT ); + std::string indentString(INDENT); Bracket object1; Bracket object2; BracketAttributesPtr attributes1 = std::make_shared(); BracketAttributesPtr attributesNull; /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); + object1.toStream(default_constructed, 0); std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); + object2.toStream(object2_stream, 2); std::string expected = R"()"; std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/BreathMarkTest.cpp b/Sourcecode/private/mxtest/core/BreathMarkTest.cpp index a4b6824b8..3c6292fb7 100644 --- a/Sourcecode/private/mxtest/core/BreathMarkTest.cpp +++ b/Sourcecode/private/mxtest/core/BreathMarkTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, BreathMark ) +TEST(Test01, BreathMark) { - std::string indentString( INDENT ); - BreathMarkValue value1 = BreathMarkValue::comma; - BreathMarkValue value2 = BreathMarkValue::tick; - BreathMark object1; - BreathMark object2( value2 ); - BreathMarkAttributesPtr attributes1 = std::make_shared(); - BreathMarkAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + BreathMarkValue value1 = BreathMarkValue::comma; + BreathMarkValue value2 = BreathMarkValue::tick; + BreathMark object1; + BreathMark object2(value2); + BreathMarkAttributesPtr attributes1 = std::make_shared(); + BreathMarkAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontFamily = true; - attributes1->fontFamily = CommaSeparatedText{ "one,two,three" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(tick)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->fontFamily = CommaSeparatedText{"one,two,three"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(tick)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/CaesuraTest.cpp b/Sourcecode/private/mxtest/core/CaesuraTest.cpp index 620214a83..b01cc3fce 100644 --- a/Sourcecode/private/mxtest/core/CaesuraTest.cpp +++ b/Sourcecode/private/mxtest/core/CaesuraTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Caesura ) +TEST(Test01, Caesura) { - std::string indentString( INDENT ); - Caesura object1; - Caesura object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Caesura object1; + Caesura object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/CancelTest.cpp b/Sourcecode/private/mxtest/core/CancelTest.cpp index 34fe97926..ad36b7a6b 100644 --- a/Sourcecode/private/mxtest/core/CancelTest.cpp +++ b/Sourcecode/private/mxtest/core/CancelTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Cancel ) +TEST(Test01, Cancel) { - std::string indentString( INDENT ); - FifthsValue value1{ 2 }; - FifthsValue value2{ 10 }; - Cancel object1; - Cancel object2( value2 ); - CancelAttributesPtr attributes1 = std::make_shared(); - CancelAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + FifthsValue value1{2}; + FifthsValue value2{10}; + Cancel object1; + Cancel object2(value2); + CancelAttributesPtr attributes1 = std::make_shared(); + CancelAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->location = CancelLocation::beforeBarline; attributes1->hasLocation = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(10)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(10)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/CapoTest.cpp b/Sourcecode/private/mxtest/core/CapoTest.cpp index ac7e81087..0c677b3b3 100644 --- a/Sourcecode/private/mxtest/core/CapoTest.cpp +++ b/Sourcecode/private/mxtest/core/CapoTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Capo ) +TEST(Test01, Capo) { - std::string indentString( INDENT ); - NonNegativeInteger value1{ 2 }; - NonNegativeInteger value2{ 3 }; - Capo object1; - Capo object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NonNegativeInteger value1{2}; + NonNegativeInteger value2{3}; + Capo object1; + Capo object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ChordTest.cpp b/Sourcecode/private/mxtest/core/ChordTest.cpp index 8b45ad9ab..eb06a55ab 100644 --- a/Sourcecode/private/mxtest/core/ChordTest.cpp +++ b/Sourcecode/private/mxtest/core/ChordTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, Chord ) +TEST(Test01, Chord) { - std::string indentString( INDENT ); - Chord object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Chord object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/ChromaticTest.cpp b/Sourcecode/private/mxtest/core/ChromaticTest.cpp index 714669ea0..bf2d51e7e 100644 --- a/Sourcecode/private/mxtest/core/ChromaticTest.cpp +++ b/Sourcecode/private/mxtest/core/ChromaticTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Chromatic ) +TEST(Test01, Chromatic) { - std::string indentString( INDENT ); - Semitones value1{ -0.1 }; - Semitones value2{ 2.02 }; - Chromatic object1; - Chromatic object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2.02)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Semitones value1{-0.1}; + Semitones value2{2.02}; + Chromatic object1; + Chromatic object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2.02)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/CircularArrowTest.cpp b/Sourcecode/private/mxtest/core/CircularArrowTest.cpp index 55603059a..c1c3fc240 100644 --- a/Sourcecode/private/mxtest/core/CircularArrowTest.cpp +++ b/Sourcecode/private/mxtest/core/CircularArrowTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, CircularArrow ) +TEST(Test01, CircularArrow) { - std::string indentString( INDENT ); - CircularArrowEnum value1 = CircularArrowEnum::clockwise; - CircularArrowEnum value2 = CircularArrowEnum::anticlockwise; - CircularArrow object1; - CircularArrow object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(clockwise)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(anticlockwise)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + CircularArrowEnum value1 = CircularArrowEnum::clockwise; + CircularArrowEnum value2 = CircularArrowEnum::anticlockwise; + CircularArrow object1; + CircularArrow object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(clockwise)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(anticlockwise)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ClefOctaveChangeTest.cpp b/Sourcecode/private/mxtest/core/ClefOctaveChangeTest.cpp index 061bd8c61..73f00c242 100644 --- a/Sourcecode/private/mxtest/core/ClefOctaveChangeTest.cpp +++ b/Sourcecode/private/mxtest/core/ClefOctaveChangeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, ClefOctaveChange ) +TEST(Test01, ClefOctaveChange) { - std::string indentString( INDENT ); - Integer value1{ 2 }; - Integer value2{ 3 }; - ClefOctaveChange object1; - ClefOctaveChange object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Integer value1{2}; + Integer value2{3}; + ClefOctaveChange object1; + ClefOctaveChange object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ClefTest.cpp b/Sourcecode/private/mxtest/core/ClefTest.cpp index 319da4e1c..a31d01092 100644 --- a/Sourcecode/private/mxtest/core/ClefTest.cpp +++ b/Sourcecode/private/mxtest/core/ClefTest.cpp @@ -6,51 +6,51 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Clef ) +TEST(Test01, Clef) { - Clef object; + Clef object; stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(G)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(G)"); + streamLine(expected, 1, R"()", false); + stringstream actual; // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Clef ) +TEST(Test02, Clef) { - Clef object; + Clef object; object.getAttributes()->hasAdditional = true; object.getAttributes()->additional = YesNo::yes; object.getAttributes()->hasAfterBarline = true; object.getAttributes()->afterBarline = YesNo::yes; - object.setHasClefOctaveChange( true ); - object.getClefOctaveChange()->setValue( Integer { 1 } ); - object.setHasLine( true ); - object.getLine()->setValue( StaffLine( 3 ) ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(G)" ); - streamLine( expected, 2, R"(3)" ); - streamLine( expected, 2, R"(1)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; + object.setHasClefOctaveChange(true); + object.getClefOctaveChange()->setValue(Integer{1}); + object.setHasLine(true); + object.getLine()->setValue(StaffLine(3)); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(G)"); + streamLine(expected, 2, R"(3)"); + streamLine(expected, 2, R"(1)"); + streamLine(expected, 1, R"()", false); + stringstream actual; // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/CodaTest.cpp b/Sourcecode/private/mxtest/core/CodaTest.cpp index 8613963f1..ed07a2a38 100644 --- a/Sourcecode/private/mxtest/core/CodaTest.cpp +++ b/Sourcecode/private/mxtest/core/CodaTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Coda ) +TEST(Test01, Coda) { - std::string indentString( INDENT ); - Coda object1; - Coda object2; - EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); - EmptyPrintObjectStyleAlignAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Coda object1; + Coda object2; + EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); + EmptyPrintObjectStyleAlignAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/ColorTest.cpp b/Sourcecode/private/mxtest/core/ColorTest.cpp index dabd91912..f959117b4 100644 --- a/Sourcecode/private/mxtest/core/ColorTest.cpp +++ b/Sourcecode/private/mxtest/core/ColorTest.cpp @@ -11,163 +11,168 @@ using namespace mx::core; -TEST( Color01, Strings ) +TEST(Color01, Strings) { Color x; std::string expected = "#FFFFFF"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( Color02, Strings ) + +TEST(Color02, Strings) { - Color x( 1, 2, 3, 4 ); + Color x(1, 2, 3, 4); std::string expected = "#01020304"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( Color03, Strings ) + +TEST(Color03, Strings) { - Color x( 98, 97, 95 ); + Color x(98, 97, 95); std::string expected = "#62615F"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) - CHECK_EQUAL( 255, x.getAlpha() ) - CHECK_EQUAL( 98, x.getRed() ) - CHECK_EQUAL( 97, x.getGreen() ) - CHECK_EQUAL( 95, x.getBlue() ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) + CHECK_EQUAL(255, x.getAlpha()) + CHECK_EQUAL(98, x.getRed()) + CHECK_EQUAL(97, x.getGreen()) + CHECK_EQUAL(95, x.getBlue()) } -TEST( Color04, Strings ) +TEST(Color04, Strings) { - Color x( 98, 97, 200 ); - x.setColorType( Color::ColorType::ARGB ); - x.setRed( 201 ); - x.setGreen( 202 ); - x.setBlue( 212 ); + Color x(98, 97, 200); + x.setColorType(Color::ColorType::ARGB); + x.setRed(201); + x.setGreen(202); + x.setBlue(212); std::string expected = "#FFC9CAD4"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) - CHECK_EQUAL( 255, x.getAlpha() ) - CHECK_EQUAL( 201, x.getRed() ) - CHECK_EQUAL( 202, x.getGreen() ) - CHECK_EQUAL( 212, x.getBlue() ) - x.setAlpha( 0 ); - CHECK_EQUAL( 0, x.getAlpha() ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) + CHECK_EQUAL(255, x.getAlpha()) + CHECK_EQUAL(201, x.getRed()) + CHECK_EQUAL(202, x.getGreen()) + CHECK_EQUAL(212, x.getBlue()) + x.setAlpha(0); + CHECK_EQUAL(0, x.getAlpha()) expected = "#00C9CAD4"; - actual = toString( x ); - CHECK_EQUAL( expected, actual ) - x.setColorType( Color::ColorType::RGB ); + actual = toString(x); + CHECK_EQUAL(expected, actual) + x.setColorType(Color::ColorType::RGB); expected = "#C9CAD4"; - actual = toString( x ); - CHECK_EQUAL( expected, actual ) - x.setColorType( Color::ColorType::ARGB ); + actual = toString(x); + CHECK_EQUAL(expected, actual) + x.setColorType(Color::ColorType::ARGB); expected = "#FFC9CAD4"; - actual = toString( x ); - CHECK_EQUAL( expected, actual ) + actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( Color05, Strings ) + +TEST(Color05, Strings) { Color x; - x.parse( "#AB00CDEF" ); + x.parse("#AB00CDEF"); std::string expected = "#AB00CDEF"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) - CHECK_EQUAL( 171, x.getAlpha() ) - CHECK_EQUAL( 0, x.getRed() ) - CHECK_EQUAL( 205, x.getGreen() ) - CHECK_EQUAL( 239, x.getBlue() ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) + CHECK_EQUAL(171, x.getAlpha()) + CHECK_EQUAL(0, x.getRed()) + CHECK_EQUAL(205, x.getGreen()) + CHECK_EQUAL(239, x.getBlue()) } -TEST( Color06, Strings ) + +TEST(Color06, Strings) { Color x; - x.parse( "#00CDEF11" ); + x.parse("#00CDEF11"); std::string expected = "#00CDEF11"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) - CHECK_EQUAL( 0, x.getAlpha() ) - CHECK_EQUAL( 205, x.getRed() ) - CHECK_EQUAL( 239, x.getGreen() ) - CHECK_EQUAL( 17, x.getBlue() ) - CHECK( Color::ColorType::ARGB == x.getColorType() ); + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) + CHECK_EQUAL(0, x.getAlpha()) + CHECK_EQUAL(205, x.getRed()) + CHECK_EQUAL(239, x.getGreen()) + CHECK_EQUAL(17, x.getBlue()) + CHECK(Color::ColorType::ARGB == x.getColorType()); } -TEST( Color07, Strings ) +TEST(Color07, Strings) { Color x; - x.parse( "#CDEF11" ); + x.parse("#CDEF11"); std::string expected = "#CDEF11"; - std::string actual = toString( x ); - x.setAlpha( 101 ); - CHECK_EQUAL( expected, actual ) - CHECK_EQUAL( 101, x.getAlpha() ) - CHECK_EQUAL( 205, x.getRed() ) - CHECK_EQUAL( 239, x.getGreen() ) - CHECK_EQUAL( 17, x.getBlue() ) - CHECK( Color::ColorType::ARGB == x.getColorType() ); + std::string actual = toString(x); + x.setAlpha(101); + CHECK_EQUAL(expected, actual) + CHECK_EQUAL(101, x.getAlpha()) + CHECK_EQUAL(205, x.getRed()) + CHECK_EQUAL(239, x.getGreen()) + CHECK_EQUAL(17, x.getBlue()) + CHECK(Color::ColorType::ARGB == x.getColorType()); } -TEST( Color08, Strings ) +TEST(Color08, Strings) { Color x; - x.parse( "#00CDEF11" ); + x.parse("#00CDEF11"); std::string expected = "#00CDEF11"; - std::string actual = toString( x ); - x.setAlpha( 300 ); - x.setRed( -1 ); - x.setGreen( 999 ); - x.setBlue( -2 ); - CHECK_EQUAL( expected, actual ) - CHECK_EQUAL( 255, x.getAlpha() ) - CHECK_EQUAL( 0, x.getRed() ) - CHECK_EQUAL( 255, x.getGreen() ) - CHECK_EQUAL( 0, x.getBlue() ) - CHECK( Color::ColorType::ARGB == x.getColorType() ); + std::string actual = toString(x); + x.setAlpha(300); + x.setRed(-1); + x.setGreen(999); + x.setBlue(-2); + CHECK_EQUAL(expected, actual) + CHECK_EQUAL(255, x.getAlpha()) + CHECK_EQUAL(0, x.getRed()) + CHECK_EQUAL(255, x.getGreen()) + CHECK_EQUAL(0, x.getBlue()) + CHECK(Color::ColorType::ARGB == x.getColorType()); } -TEST( Color09, Strings ) + +TEST(Color09, Strings) { Color x; - x.parse( "#ABCDEF" ); + x.parse("#ABCDEF"); std::string expected = "#ABCDEF"; - std::string actual = toString( x ); - x.setAlpha( 300 ); - x.setRed( -1 ); - x.setGreen( 999 ); - x.setBlue( -2 ); - x.parse( "#FF FF ff FF " ); - CHECK_EQUAL( expected, actual ) - CHECK_EQUAL( 255, x.getAlpha() ) - CHECK_EQUAL( 0, x.getRed() ) - CHECK_EQUAL( 255, x.getGreen() ) - CHECK_EQUAL( 0, x.getBlue() ) - CHECK( Color::ColorType::ARGB == x.getColorType() ); + std::string actual = toString(x); + x.setAlpha(300); + x.setRed(-1); + x.setGreen(999); + x.setBlue(-2); + x.parse("#FF FF ff FF "); + CHECK_EQUAL(expected, actual) + CHECK_EQUAL(255, x.getAlpha()) + CHECK_EQUAL(0, x.getRed()) + CHECK_EQUAL(255, x.getGreen()) + CHECK_EQUAL(0, x.getBlue()) + CHECK(Color::ColorType::ARGB == x.getColorType()); } -TEST( Color10, Strings ) +TEST(Color10, Strings) { Color x; - x.parse( "#ABCDEF99" ); + x.parse("#ABCDEF99"); std::string expected = "#ABCDEF99"; - std::string actual = toString( x ); - x.setAlpha( -1 ); - x.setRed( -1 ); - x.setGreen( 999 ); - x.setBlue( -2 ); - x.parse( "#01FF03" ); - CHECK_EQUAL( expected, actual ) - CHECK_EQUAL( 255, x.getAlpha() ) - CHECK_EQUAL( 1, x.getRed() ) - CHECK_EQUAL( 255, x.getGreen() ) - CHECK_EQUAL( 3, x.getBlue() ) - CHECK( Color::ColorType::RGB == x.getColorType() ); + std::string actual = toString(x); + x.setAlpha(-1); + x.setRed(-1); + x.setGreen(999); + x.setBlue(-2); + x.parse("#01FF03"); + CHECK_EQUAL(expected, actual) + CHECK_EQUAL(255, x.getAlpha()) + CHECK_EQUAL(1, x.getRed()) + CHECK_EQUAL(255, x.getGreen()) + CHECK_EQUAL(3, x.getBlue()) + CHECK(Color::ColorType::RGB == x.getColorType()); std::stringstream ss; - toStream( ss, x ); + toStream(ss, x); expected = "#01FF03"; actual = ss.str(); - CHECK_EQUAL( expected, actual ) - ss.str( "" ); + CHECK_EQUAL(expected, actual) + ss.str(""); ss << x; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } #endif diff --git a/Sourcecode/private/mxtest/core/CreatorTest.cpp b/Sourcecode/private/mxtest/core/CreatorTest.cpp index f3af094bd..f6d3ef42b 100644 --- a/Sourcecode/private/mxtest/core/CreatorTest.cpp +++ b/Sourcecode/private/mxtest/core/CreatorTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Creator ) +TEST(Test01, Creator) { - std::string indentString( INDENT ); - XsString value1{ "XYZ" }; - XsString value2{ "PQR" }; - Creator object1; - Creator object2( value2 ); - CreatorAttributesPtr attributes1 = std::make_shared(); - CreatorAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"XYZ"}; + XsString value2{"PQR"}; + Creator object1; + Creator object2(value2); + CreatorAttributesPtr attributes1 = std::make_shared(); + CreatorAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasType = true; - attributes1->type = XsToken{ "berries" }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(PQR)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->type = XsToken{"berries"}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(PQR)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/CreditChoiceTest.cpp b/Sourcecode/private/mxtest/core/CreditChoiceTest.cpp index 914d4f640..88d4f1c5a 100644 --- a/Sourcecode/private/mxtest/core/CreditChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/CreditChoiceTest.cpp @@ -6,117 +6,113 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/CreditChoiceTest.h" #include "mxtest/core/CreditWordsGroupTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, CreditChoice ) +TEST(Test01, CreditChoice) { TestMode v = TestMode::one; - CreditChoicePtr object = tgenCreditChoice( v ); - stringstream expected; - tgenCreditChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CreditChoicePtr object = tgenCreditChoice(v); + stringstream expected; + tgenCreditChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, CreditChoice ) + +TEST(Test02, CreditChoice) { TestMode v = TestMode::two; - CreditChoicePtr object = tgenCreditChoice( v ); - stringstream expected; - tgenCreditChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CreditChoicePtr object = tgenCreditChoice(v); + stringstream expected; + tgenCreditChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, CreditChoice ) + +TEST(Test03, CreditChoice) { TestMode v = TestMode::three; - CreditChoicePtr object = tgenCreditChoice( v ); - stringstream expected; - tgenCreditChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CreditChoicePtr object = tgenCreditChoice(v); + stringstream expected; + tgenCreditChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - CreditChoicePtr tgenCreditChoice( TestMode v ) +CreditChoicePtr tgenCreditChoice(TestMode v) +{ + CreditChoicePtr o = makeCreditChoice(); + switch (v) { - CreditChoicePtr o = makeCreditChoice(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( CreditChoice::Choice::creditImage ); - o->getCreditImage()->getAttributes()->type = XsToken( "SDFGJKH" ); - o->getCreditImage()->getAttributes()->source = XsAnyUri( "someimagesource" ); - } - break; - case TestMode::three: - { - o->setChoice( CreditChoice::Choice::creditWords ); - auto w = makeCreditWords(); - w->getAttributes()->hasUnderline = true; - w->getAttributes()->underline = NumberOfLines( 1 ); - w->setValue( XsString( "this is the string of damocles" ) ); - o->setCreditWords( w ); - o->addCreditWordsGroup( tgenCreditWordsGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(CreditChoice::Choice::creditImage); + o->getCreditImage()->getAttributes()->type = XsToken("SDFGJKH"); + o->getCreditImage()->getAttributes()->source = XsAnyUri("someimagesource"); + } + break; + case TestMode::three: { + o->setChoice(CreditChoice::Choice::creditWords); + auto w = makeCreditWords(); + w->getAttributes()->hasUnderline = true; + w->getAttributes()->underline = NumberOfLines(1); + w->setValue(XsString("this is the string of damocles")); + o->setCreditWords(w); + o->addCreditWordsGroup(tgenCreditWordsGroup(v)); + } + break; + default: + break; } - void tgenCreditChoiceExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenCreditChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenCreditWordsGroupExpected( os, i, v ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"(this is the string of damocles)", true ); - tgenCreditWordsGroupExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenCreditWordsGroupExpected(os, i, v); + } + break; + case TestMode::two: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"(this is the string of damocles)", true); + tgenCreditWordsGroupExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/CreditChoiceTest.h b/Sourcecode/private/mxtest/core/CreditChoiceTest.h index 303af62f4..fc0809c5e 100644 --- a/Sourcecode/private/mxtest/core/CreditChoiceTest.h +++ b/Sourcecode/private/mxtest/core/CreditChoiceTest.h @@ -6,13 +6,13 @@ #ifdef MX_COMPILE_CORE_TESTS #pragma once -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::CreditChoicePtr tgenCreditChoice( TestMode v ); - void tgenCreditChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::CreditChoicePtr tgenCreditChoice(TestMode v); +void tgenCreditChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/CreditImageTest.cpp b/Sourcecode/private/mxtest/core/CreditImageTest.cpp index 63f73b9f8..083287fd9 100644 --- a/Sourcecode/private/mxtest/core/CreditImageTest.cpp +++ b/Sourcecode/private/mxtest/core/CreditImageTest.cpp @@ -2,7 +2,6 @@ // Copyright (c) by Matthew James Briggs // Distributed under the MIT License - #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS @@ -12,38 +11,40 @@ using namespace mx::core; -TEST( Test01, CreditImage ) +TEST(Test01, CreditImage) { - std::string indentString( INDENT ); - CreditImage object1; - CreditImage object2; - CreditImageAttributesPtr attributes1 = std::make_shared(); - CreditImageAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + CreditImage object1; + CreditImage object2; + CreditImageAttributesPtr attributes1 = std::make_shared(); + CreditImageAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; - attributes1->source = XsAnyUri{ "file/blah" }; - attributes1->type = XsToken{ "Hi there" }; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->defaultX = TenthsValue{0.1}; + attributes1->source = XsAnyUri{"file/blah"}; + attributes1->type = XsToken{"Hi there"}; + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/CreditTest.cpp b/Sourcecode/private/mxtest/core/CreditTest.cpp index 091157b58..da5f65fa6 100644 --- a/Sourcecode/private/mxtest/core/CreditTest.cpp +++ b/Sourcecode/private/mxtest/core/CreditTest.cpp @@ -6,153 +6,150 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/CreditTest.h" #include "mxtest/core/CreditChoiceTest.h" +#include "mxtest/core/CreditTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Credit ) +TEST(Test01, Credit) { TestMode v = TestMode::one; - CreditPtr object = tgenCredit( v ); - stringstream expected; - tgenCreditExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + CreditPtr object = tgenCredit(v); + stringstream expected; + tgenCreditExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Credit ) + +TEST(Test02, Credit) { TestMode v = TestMode::two; - CreditPtr object = tgenCredit( v ); - stringstream expected; - tgenCreditExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + CreditPtr object = tgenCredit(v); + stringstream expected; + tgenCreditExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Credit ) + +TEST(Test03, Credit) { TestMode v = TestMode::three; - CreditPtr object = tgenCredit( v ); - stringstream expected; - tgenCreditExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + CreditPtr object = tgenCredit(v); + stringstream expected; + tgenCreditExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - CreditPtr tgenCredit( TestMode v ) +CreditPtr tgenCredit(TestMode v) +{ + CreditPtr o = makeCredit(); + switch (v) { - CreditPtr o = makeCredit(); - switch ( v ) - { - case TestMode::one: - { - o->setCreditChoice( tgenCreditChoice( v ) ); - } - break; - case TestMode::two: - { - o->getAttributes()->hasPage = true; - o->getAttributes()->page = PositiveInteger( 2 ); - o->setCreditChoice( tgenCreditChoice( v ) ); - auto l1 = makeLink(); - l1->getAttributes()->href = XlinkHref("hfrefABC"); - o->addLink( l1 ); - auto l2 = makeLink(); - l2->getAttributes()->href = XlinkHref("hrefDEF"); - o->addLink( l2 ); - auto b1 = makeBookmark(); - b1->getAttributes()->hasElement = true; - b1->getAttributes()->element = XsNMToken( "element1 23" ); - o->addBookmark( b1 ); - auto b2 = makeBookmark(); - b2->getAttributes()->hasElement = true; - b2->getAttributes()->element = XsNMToken( "elemtn673" ); - o->addBookmark( b2 ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasPage = true; - o->getAttributes()->page = PositiveInteger( 3 ); - o->setCreditChoice( tgenCreditChoice( v ) ); - auto l1 = makeLink(); - l1->getAttributes()->href = XlinkHref("sdfljkhsldjfkg"); - o->addLink( l1 ); - auto b1 = makeBookmark(); - b1->getAttributes()->hasElement = true; - b1->getAttributes()->element = XsNMToken( "sdf89g7sd0f67g" ); - o->addBookmark( b1 ); - auto t1 = makeCreditType(); - t1->setValue( XsString( "composer" ) ); - o->addCreditType( t1 ); - t1 = makeCreditType(); - t1->setValue( XsString( "lyricist" ) ); - o->addCreditType( t1 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setCreditChoice(tgenCreditChoice(v)); + } + break; + case TestMode::two: { + o->getAttributes()->hasPage = true; + o->getAttributes()->page = PositiveInteger(2); + o->setCreditChoice(tgenCreditChoice(v)); + auto l1 = makeLink(); + l1->getAttributes()->href = XlinkHref("hfrefABC"); + o->addLink(l1); + auto l2 = makeLink(); + l2->getAttributes()->href = XlinkHref("hrefDEF"); + o->addLink(l2); + auto b1 = makeBookmark(); + b1->getAttributes()->hasElement = true; + b1->getAttributes()->element = XsNMToken("element1 23"); + o->addBookmark(b1); + auto b2 = makeBookmark(); + b2->getAttributes()->hasElement = true; + b2->getAttributes()->element = XsNMToken("elemtn673"); + o->addBookmark(b2); + } + break; + case TestMode::three: { + o->getAttributes()->hasPage = true; + o->getAttributes()->page = PositiveInteger(3); + o->setCreditChoice(tgenCreditChoice(v)); + auto l1 = makeLink(); + l1->getAttributes()->href = XlinkHref("sdfljkhsldjfkg"); + o->addLink(l1); + auto b1 = makeBookmark(); + b1->getAttributes()->hasElement = true; + b1->getAttributes()->element = XsNMToken("sdf89g7sd0f67g"); + o->addBookmark(b1); + auto t1 = makeCreditType(); + t1->setValue(XsString("composer")); + o->addCreditType(t1); + t1 = makeCreditType(); + t1->setValue(XsString("lyricist")); + o->addCreditType(t1); } - void tgenCreditExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenCreditExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenCreditChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - tgenCreditChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(composer)" ); - streamLine( os, i+1, R"(lyricist)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - tgenCreditChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenCreditChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + tgenCreditChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(composer)"); + streamLine(os, i + 1, R"(lyricist)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + tgenCreditChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/CreditTest.h b/Sourcecode/private/mxtest/core/CreditTest.h index 693371f77..d6accbb9c 100644 --- a/Sourcecode/private/mxtest/core/CreditTest.h +++ b/Sourcecode/private/mxtest/core/CreditTest.h @@ -6,13 +6,13 @@ #ifdef MX_COMPILE_CORE_TESTS #pragma once -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::CreditPtr tgenCredit( TestMode v ); - void tgenCreditExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::CreditPtr tgenCredit(TestMode v); +void tgenCreditExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/CreditTypeTest.cpp b/Sourcecode/private/mxtest/core/CreditTypeTest.cpp index 6663899be..4af96b8c8 100644 --- a/Sourcecode/private/mxtest/core/CreditTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/CreditTypeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, CreditType ) +TEST(Test01, CreditType) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - CreditType object1; - CreditType object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + CreditType object1; + CreditType object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/CreditWordsGroupTest.cpp b/Sourcecode/private/mxtest/core/CreditWordsGroupTest.cpp index e20a3120a..8d28245fd 100644 --- a/Sourcecode/private/mxtest/core/CreditWordsGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/CreditWordsGroupTest.cpp @@ -6,134 +6,130 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/CreditWordsGroupTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, CreditWordsGroup ) +TEST(Test01, CreditWordsGroup) { TestMode v = TestMode::one; - CreditWordsGroupPtr object = tgenCreditWordsGroup( v ); - stringstream expected; - tgenCreditWordsGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CreditWordsGroupPtr object = tgenCreditWordsGroup(v); + stringstream expected; + tgenCreditWordsGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, CreditWordsGroup ) + +TEST(Test02, CreditWordsGroup) { TestMode v = TestMode::two; - CreditWordsGroupPtr object = tgenCreditWordsGroup( v ); - stringstream expected; - tgenCreditWordsGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CreditWordsGroupPtr object = tgenCreditWordsGroup(v); + stringstream expected; + tgenCreditWordsGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, CreditWordsGroup ) + +TEST(Test03, CreditWordsGroup) { TestMode v = TestMode::three; - CreditWordsGroupPtr object = tgenCreditWordsGroup( v ); - stringstream expected; - tgenCreditWordsGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CreditWordsGroupPtr object = tgenCreditWordsGroup(v); + stringstream expected; + tgenCreditWordsGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - CreditWordsGroupPtr tgenCreditWordsGroup( TestMode v ) +CreditWordsGroupPtr tgenCreditWordsGroup(TestMode v) +{ + CreditWordsGroupPtr o = makeCreditWordsGroup(); + switch (v) { - CreditWordsGroupPtr o = makeCreditWordsGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getCreditWords()->setValue( XsString( "Matthew James Briggs" ) ); - auto l1 = makeLink(); - l1->getAttributes()->href = XlinkHref("matthewjamesbriggs.com"); - o->addLink( l1 ); - auto b1 = makeBookmark(); - b1->getAttributes()->hasElement = true; - b1->getAttributes()->element = XsNMToken( "NMToken1" ); - o->addBookmark( b1 ); - } - break; - case TestMode::three: - { - o->getCreditWords()->setValue( XsString( ".mjb" ) ); - auto l1 = makeLink(); - l1->getAttributes()->href = XlinkHref("matthewjamesbriggs.com"); - o->addLink( l1 ); - auto l2 = makeLink(); - l2->getAttributes()->href = XlinkHref("somethingelse.com"); - o->addLink( l2 ); - auto b1 = makeBookmark(); - b1->getAttributes()->hasElement = true; - b1->getAttributes()->element = XsNMToken( "NMToken2" ); - o->addBookmark( b1 ); - auto b2 = makeBookmark(); - b2->getAttributes()->hasElement = true; - b2->getAttributes()->element = XsNMToken( "NMToken3" ); - o->addBookmark( b2 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getCreditWords()->setValue(XsString("Matthew James Briggs")); + auto l1 = makeLink(); + l1->getAttributes()->href = XlinkHref("matthewjamesbriggs.com"); + o->addLink(l1); + auto b1 = makeBookmark(); + b1->getAttributes()->hasElement = true; + b1->getAttributes()->element = XsNMToken("NMToken1"); + o->addBookmark(b1); + } + break; + case TestMode::three: { + o->getCreditWords()->setValue(XsString(".mjb")); + auto l1 = makeLink(); + l1->getAttributes()->href = XlinkHref("matthewjamesbriggs.com"); + o->addLink(l1); + auto l2 = makeLink(); + l2->getAttributes()->href = XlinkHref("somethingelse.com"); + o->addLink(l2); + auto b1 = makeBookmark(); + b1->getAttributes()->hasElement = true; + b1->getAttributes()->element = XsNMToken("NMToken2"); + o->addBookmark(b1); + auto b2 = makeBookmark(); + b2->getAttributes()->hasElement = true; + b2->getAttributes()->element = XsNMToken("NMToken3"); + o->addBookmark(b2); + } + break; + default: + break; } - void tgenCreditWordsGroupExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenCreditWordsGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i, R"()" ); - streamLine( os, i, R"(Matthew James Briggs)", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i, R"()" ); - streamLine( os, i, R"()" ); - streamLine( os, i, R"()" ); - streamLine( os, i, R"(.mjb)", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i, R"()"); + streamLine(os, i, R"(Matthew James Briggs)", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i, R"()"); + streamLine(os, i, R"()"); + streamLine(os, i, R"()"); + streamLine(os, i, R"(.mjb)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/CreditWordsGroupTest.h b/Sourcecode/private/mxtest/core/CreditWordsGroupTest.h index 4296e3468..334446e90 100644 --- a/Sourcecode/private/mxtest/core/CreditWordsGroupTest.h +++ b/Sourcecode/private/mxtest/core/CreditWordsGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::CreditWordsGroupPtr tgenCreditWordsGroup( TestMode v ); - void tgenCreditWordsGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::CreditWordsGroupPtr tgenCreditWordsGroup(TestMode v); +void tgenCreditWordsGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/CreditWordsTest.cpp b/Sourcecode/private/mxtest/core/CreditWordsTest.cpp index e5256df70..c24c112c2 100644 --- a/Sourcecode/private/mxtest/core/CreditWordsTest.cpp +++ b/Sourcecode/private/mxtest/core/CreditWordsTest.cpp @@ -10,39 +10,42 @@ using namespace mx::core; -TEST( Test01, CreditWords ) +TEST(Test01, CreditWords) { - std::string indentString( INDENT ); - XsString value1{ "Air" }; - XsString value2{ "Water" }; - CreditWords object1; - CreditWords object2( value2 ); - CreditWordsAttributesPtr attributes1 = std::make_shared(); - CreditWordsAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Air"}; + XsString value2{"Water"}; + CreditWords object1; + CreditWords object2(value2); + CreditWordsAttributesPtr attributes1 = std::make_shared(); + CreditWordsAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasLang = true; attributes1->hasSpace = true; attributes1->hasEnclosure = true; attributes1->space = XmlSpace::preserve; attributes1->enclosure = EnclosureShape::oval; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Water)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + + R"(Water)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/CueNoteGroupTest.cpp b/Sourcecode/private/mxtest/core/CueNoteGroupTest.cpp index 91d05340b..72a975475 100644 --- a/Sourcecode/private/mxtest/core/CueNoteGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/CueNoteGroupTest.cpp @@ -6,121 +6,116 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/CueNoteGroupTest.h" #include "mxtest/core/FullNoteGroupTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, CueNoteGroup ) +TEST(Test01, CueNoteGroup) { TestMode v = TestMode::one; - CueNoteGroupPtr object = tgenCueNoteGroup( v ); - stringstream expected; - tgenCueNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CueNoteGroupPtr object = tgenCueNoteGroup(v); + stringstream expected; + tgenCueNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, CueNoteGroup ) + +TEST(Test02, CueNoteGroup) { TestMode v = TestMode::two; - CueNoteGroupPtr object = tgenCueNoteGroup( v ); - stringstream expected; - tgenCueNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CueNoteGroupPtr object = tgenCueNoteGroup(v); + stringstream expected; + tgenCueNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, CueNoteGroup ) + +TEST(Test03, CueNoteGroup) { TestMode v = TestMode::three; - CueNoteGroupPtr object = tgenCueNoteGroup( v ); - stringstream expected; - tgenCueNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + CueNoteGroupPtr object = tgenCueNoteGroup(v); + stringstream expected; + tgenCueNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - CueNoteGroupPtr tgenCueNoteGroup( TestMode v ) +CueNoteGroupPtr tgenCueNoteGroup(TestMode v) +{ + CueNoteGroupPtr o = makeCueNoteGroup(); + switch (v) { - CueNoteGroupPtr o = makeCueNoteGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setFullNoteGroup( tgenFullNoteGroup( v ) ); - o->setDuration( makeDuration( PositiveDivisionsValue( 123 ) ) ); - - } - break; - case TestMode::three: - { - o->setFullNoteGroup( tgenFullNoteGroup( v ) ); - - o->setDuration( makeDuration( PositiveDivisionsValue( 321 ) ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setFullNoteGroup(tgenFullNoteGroup(v)); + o->setDuration(makeDuration(PositiveDivisionsValue(123))); + } + break; + case TestMode::three: { + o->setFullNoteGroup(tgenFullNoteGroup(v)); + + o->setDuration(makeDuration(PositiveDivisionsValue(321))); } - void tgenCueNoteGroupExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenCueNoteGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenFullNoteGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(1)", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenFullNoteGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(123)", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenFullNoteGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(321)", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenFullNoteGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(1)", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenFullNoteGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(123)", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenFullNoteGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(321)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/CueNoteGroupTest.h b/Sourcecode/private/mxtest/core/CueNoteGroupTest.h index 66f30fc87..6e5b28273 100644 --- a/Sourcecode/private/mxtest/core/CueNoteGroupTest.h +++ b/Sourcecode/private/mxtest/core/CueNoteGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::CueNoteGroupPtr tgenCueNoteGroup( TestMode v ); - void tgenCueNoteGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::CueNoteGroupPtr tgenCueNoteGroup(TestMode v); +void tgenCueNoteGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/CueTest.cpp b/Sourcecode/private/mxtest/core/CueTest.cpp index 848ad2a07..2afb0116b 100644 --- a/Sourcecode/private/mxtest/core/CueTest.cpp +++ b/Sourcecode/private/mxtest/core/CueTest.cpp @@ -10,28 +10,27 @@ #include using namespace mx::core; - -TEST( Test01, Cue ) +TEST(Test01, Cue) { - std::string indentString( INDENT ); - Cue object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Cue object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/DampAllTest.cpp b/Sourcecode/private/mxtest/core/DampAllTest.cpp index 15ca594ac..38113f69c 100644 --- a/Sourcecode/private/mxtest/core/DampAllTest.cpp +++ b/Sourcecode/private/mxtest/core/DampAllTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, DampAll ) +TEST(Test01, DampAll) { - std::string indentString( INDENT ); - DampAll object1; - DampAll object2; - EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); - EmptyPrintObjectStyleAlignAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + DampAll object1; + DampAll object2; + EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); + EmptyPrintObjectStyleAlignAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DampTest.cpp b/Sourcecode/private/mxtest/core/DampTest.cpp index 611870a69..30e0ce2df 100644 --- a/Sourcecode/private/mxtest/core/DampTest.cpp +++ b/Sourcecode/private/mxtest/core/DampTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Damp ) +TEST(Test01, Damp) { - std::string indentString( INDENT ); - Damp object1; - Damp object2; - EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); - EmptyPrintObjectStyleAlignAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Damp object1; + Damp object2; + EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); + EmptyPrintObjectStyleAlignAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DashesTest.cpp b/Sourcecode/private/mxtest/core/DashesTest.cpp index 1a2e1b22e..ad3492abb 100644 --- a/Sourcecode/private/mxtest/core/DashesTest.cpp +++ b/Sourcecode/private/mxtest/core/DashesTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, Dashes ) +TEST(Test01, Dashes) { - std::string indentString( INDENT ); - Dashes object1; - Dashes object2; - DashesAttributesPtr attributes1 = std::make_shared(); - DashesAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Dashes object1; + Dashes object2; + DashesAttributesPtr attributes1 = std::make_shared(); + DashesAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->number = NumberLevel{2}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DateTest.cpp b/Sourcecode/private/mxtest/core/DateTest.cpp index 1ca42cd6d..07bfd88f2 100644 --- a/Sourcecode/private/mxtest/core/DateTest.cpp +++ b/Sourcecode/private/mxtest/core/DateTest.cpp @@ -7,7505 +7,8110 @@ #include "cpul/cpulTestHarness.h" #include "mx/core/Date.h" -#include #include +#include using namespace mx::core; -TEST( toString01, Date ) +TEST(toString01, Date) { Date d; - CHECK_EQUAL( d.getYear(), 1900 ); - CHECK_EQUAL( d.getMonth(), 1 ); - CHECK_EQUAL( d.getDay(), 1 ); + CHECK_EQUAL(d.getYear(), 1900); + CHECK_EQUAL(d.getMonth(), 1); + CHECK_EQUAL(d.getDay(), 1); std::string expected = "1900-01-01"; - std::string actual = toString( d ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d); + CHECK_EQUAL(expected, actual) } -TEST( toString02, Date ) +TEST(toString02, Date) { int year = 300; int month = 8; int day = 1; - Date d ( year, month, day ); - CHECK_EQUAL( d.getYear(), year ); - CHECK_EQUAL( d.getMonth(), month ); - CHECK_EQUAL( d.getDay(), day ); + Date d(year, month, day); + CHECK_EQUAL(d.getYear(), year); + CHECK_EQUAL(d.getMonth(), month); + CHECK_EQUAL(d.getDay(), day); std::string expected = "0300-08-01"; - std::string actual = toString( d ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d); + CHECK_EQUAL(expected, actual) } -TEST( toString03, Date ) +TEST(toString03, Date) { int year = 1500; int month = 12; int day = 10; - Date d ( year, month, day ); - CHECK_EQUAL( d.getYear(), year ); - CHECK_EQUAL( d.getMonth(), month ); - CHECK_EQUAL( d.getDay(), day ); + Date d(year, month, day); + CHECK_EQUAL(d.getYear(), year); + CHECK_EQUAL(d.getMonth(), month); + CHECK_EQUAL(d.getDay(), day); std::string expected = "1500-12-10"; - std::string actual = toString( d ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d); + CHECK_EQUAL(expected, actual) } TEST(dateCompare_equals01, Date) { - Date d1( 2014, 6, 7 ); - Date d2( 2014, 6, 7 ); + Date d1(2014, 6, 7); + Date d2(2014, 6, 7); bool expected = true; bool actual = d1 == d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_equals02, Date) { - Date d1( 1023, 12, 31 ); - Date d2( 1003, 12, 31 ); + Date d1(1023, 12, 31); + Date d2(1003, 12, 31); bool expected = false; bool actual = d1 == d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_equals03, Date) { - Date d1( 3001, 4, 17 ); - Date d2( 3001, 10, 17 ); + Date d1(3001, 4, 17); + Date d2(3001, 10, 17); bool expected = false; bool actual = d1 == d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_equals04, Date) { - Date d1( 1893, 12, 30 ); - Date d2( 1893, 12, 31 ); + Date d1(1893, 12, 30); + Date d2(1893, 12, 31); bool expected = false; bool actual = d1 == d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_equals05, Date) { - Date d1( 9875, 3, 5 ); - Date d2( 9875, 3, 5 ); + Date d1(9875, 3, 5); + Date d2(9875, 3, 5); bool expected = true; bool actual = d1 == d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_notequals01, Date) { - Date d1( 2014, 6, 7 ); - Date d2( 2014, 6, 7 ); + Date d1(2014, 6, 7); + Date d2(2014, 6, 7); bool expected = false; bool actual = d1 != d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_notequals02, Date) { - Date d1( 1023, 12, 31 ); - Date d2( 1003, 12, 31 ); + Date d1(1023, 12, 31); + Date d2(1003, 12, 31); bool expected = true; bool actual = d1 != d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_notequals03, Date) { - Date d1( 3001, 4, 17 ); - Date d2( 3001, 10, 17 ); + Date d1(3001, 4, 17); + Date d2(3001, 10, 17); bool expected = true; bool actual = d1 != d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_notequals04, Date) { - Date d1( 1893, 12, 30 ); - Date d2( 1893, 12, 31 ); + Date d1(1893, 12, 30); + Date d2(1893, 12, 31); bool expected = true; bool actual = d1 != d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_notequals05, Date) { - Date d1( 9875, 3, 5 ); - Date d2( 9875, 3, 5 ); + Date d1(9875, 3, 5); + Date d2(9875, 3, 5); bool expected = false; bool actual = d1 != d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(dateCompare_greater_true_day, Date) { - Date d1( 1111, 1, 2 ); - Date d2( 1111, 1, 1 ); + Date d1(1111, 1, 2); + Date d2(1111, 1, 1); bool expected = true; bool actual = d1 > d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_greater_true_month, Date) { - Date d1( 2222, 4, 10 ); - Date d2( 2222, 3, 10 ); + Date d1(2222, 4, 10); + Date d2(2222, 3, 10); bool expected = true; bool actual = d1 > d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_greater_true_year, Date) { - Date d1( 1753, 12, 31 ); - Date d2( 1752, 12, 31 ); + Date d1(1753, 12, 31); + Date d2(1752, 12, 31); bool expected = true; bool actual = d1 > d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_greater_false_day, Date) { - Date d1( 7382, 2, 1 ); - Date d2( 7382, 2, 31 ); + Date d1(7382, 2, 1); + Date d2(7382, 2, 31); bool expected = false; bool actual = d1 > d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_greater_false_month, Date) { - Date d1( 2014, 1, 13 ); - Date d2( 2014, 12, 13 ); + Date d1(2014, 1, 13); + Date d2(2014, 12, 13); bool expected = false; bool actual = d1 > d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_greater_false_year, Date) { - Date d1( 1492, 12, 31 ); - Date d2( 1493, 1, 1 ); + Date d1(1492, 12, 31); + Date d2(1493, 1, 1); bool expected = false; bool actual = d1 > d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_greater_falseEq_day, Date) { - Date d1( 1320, 2, 29 ); - Date d2( 1320, 2, 29 ); + Date d1(1320, 2, 29); + Date d2(1320, 2, 29); bool expected = false; bool actual = d1 > d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - TEST(dateCompare_less_true_day, Date) { - Date d1( 1111, 1, 2 ); - Date d2( 1111, 1, 1 ); + Date d1(1111, 1, 2); + Date d2(1111, 1, 1); bool expected = false; bool actual = d1 < d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_less_true_month, Date) { - Date d1( 2222, 4, 10 ); - Date d2( 2222, 3, 10 ); + Date d1(2222, 4, 10); + Date d2(2222, 3, 10); bool expected = false; bool actual = d1 < d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_less_true_year, Date) { - Date d1( 1753, 12, 31 ); - Date d2( 1752, 12, 31 ); + Date d1(1753, 12, 31); + Date d2(1752, 12, 31); bool expected = false; bool actual = d1 < d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_less_false_day, Date) { - Date d1( 7382, 2, 1 ); - Date d2( 7382, 2, 31 ); + Date d1(7382, 2, 1); + Date d2(7382, 2, 31); bool expected = true; bool actual = d1 < d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_less_false_month, Date) { - Date d1( 2014, 1, 13 ); - Date d2( 2014, 12, 13 ); + Date d1(2014, 1, 13); + Date d2(2014, 12, 13); bool expected = true; bool actual = d1 < d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_less_false_year, Date) { - Date d1( 1492, 12, 31 ); - Date d2( 1493, 1, 1 ); + Date d1(1492, 12, 31); + Date d2(1493, 1, 1); bool expected = true; bool actual = d1 < d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateCompare_less_falseEq_day, Date) { - Date d1( 1320, 2, 29 ); - Date d2( 1320, 2, 29 ); + Date d1(1320, 2, 29); + Date d2(1320, 2, 29); bool expected = false; bool actual = d1 < d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - TEST(dateComare_EqOr_greater_true_day, Date) { - Date d1( 1111, 1, 2 ); - Date d2( 1111, 1, 1 ); + Date d1(1111, 1, 2); + Date d2(1111, 1, 1); bool expected = true; bool actual = d1 >= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_greater_true_month, Date) { - Date d1( 2222, 4, 10 ); - Date d2( 2222, 3, 10 ); + Date d1(2222, 4, 10); + Date d2(2222, 3, 10); bool expected = true; bool actual = d1 >= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_greater_true_year, Date) { - Date d1( 1753, 12, 31 ); - Date d2( 1752, 12, 31 ); + Date d1(1753, 12, 31); + Date d2(1752, 12, 31); bool expected = true; bool actual = d1 >= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_greater_false_day, Date) { - Date d1( 7382, 2, 1 ); - Date d2( 7382, 2, 31 ); + Date d1(7382, 2, 1); + Date d2(7382, 2, 31); bool expected = false; bool actual = d1 >= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_greater_false_month, Date) { - Date d1( 2014, 1, 13 ); - Date d2( 2014, 12, 13 ); + Date d1(2014, 1, 13); + Date d2(2014, 12, 13); bool expected = false; bool actual = d1 >= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_greater_false_year, Date) { - Date d1( 1492, 12, 31 ); - Date d2( 1493, 1, 1 ); + Date d1(1492, 12, 31); + Date d2(1493, 1, 1); bool expected = false; bool actual = d1 >= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_greater_trueEq_day, Date) { - Date d1( 1320, 2, 29 ); - Date d2( 1320, 2, 29 ); + Date d1(1320, 2, 29); + Date d2(1320, 2, 29); bool expected = true; bool actual = d1 >= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - TEST(dateComare_EqOr_less_true_day, Date) { - Date d1( 1111, 1, 2 ); - Date d2( 1111, 1, 1 ); + Date d1(1111, 1, 2); + Date d2(1111, 1, 1); bool expected = false; bool actual = d1 <= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_less_true_month, Date) { - Date d1( 2222, 4, 10 ); - Date d2( 2222, 3, 10 ); + Date d1(2222, 4, 10); + Date d2(2222, 3, 10); bool expected = false; bool actual = d1 <= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_less_true_year, Date) { - Date d1( 1753, 12, 31 ); - Date d2( 1752, 12, 31 ); + Date d1(1753, 12, 31); + Date d2(1752, 12, 31); bool expected = false; bool actual = d1 <= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_less_false_day, Date) { - Date d1( 7382, 2, 1 ); - Date d2( 7382, 2, 31 ); + Date d1(7382, 2, 1); + Date d2(7382, 2, 31); bool expected = true; bool actual = d1 <= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_less_false_month, Date) { - Date d1( 2014, 1, 13 ); - Date d2( 2014, 12, 13 ); + Date d1(2014, 1, 13); + Date d2(2014, 12, 13); bool expected = true; bool actual = d1 <= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_less_false_year, Date) { - Date d1( 1492, 12, 31 ); - Date d2( 1493, 1, 1 ); + Date d1(1492, 12, 31); + Date d2(1493, 1, 1); bool expected = true; bool actual = d1 <= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(dateComare_EqOr_less_trueEq_day, Date) { - Date d1( 1320, 2, 29 ); - Date d2( 1320, 2, 29 ); + Date d1(1320, 2, 29); + Date d2(1320, 2, 29); bool expected = true; bool actual = d1 <= d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - - TEST(weekday_20140607, Date) { - Date d( 2014, 6, 7 ); + Date d(2014, 6, 7); int expected = 7; int actual = d.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(weekday_22530714, Date) { - Date d1( 2253, 7, 14 ); + Date d1(2253, 7, 14); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(weekday_11740516, Date) { - Date d1( 1174, 5, 16 ); + Date d1(1174, 5, 16); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_58290910, Date) { - Date d1( 5829, 9, 10 ); + Date d1(5829, 9, 10); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_82361023, Date) { - Date d1( 8236, 10, 23 ); + Date d1(8236, 10, 23); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_88730204, Date) { - Date d1( 8873, 2, 4 ); + Date d1(8873, 2, 4); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_72140914, Date) { - Date d1( 7214, 9, 14 ); + Date d1(7214, 9, 14); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_90790927, Date) { - Date d1( 9079, 9, 27 ); + Date d1(9079, 9, 27); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_65730115, Date) { - Date d1( 6573, 1, 15 ); + Date d1(6573, 1, 15); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_84520920, Date) { - Date d1( 8452, 9, 20 ); + Date d1(8452, 9, 20); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_98990217, Date) { - Date d1( 9899, 2, 17 ); + Date d1(9899, 2, 17); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_17720401, Date) { - Date d1( 1772, 4, 1 ); + Date d1(1772, 4, 1); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_38400221, Date) { - Date d1( 3840, 2, 21 ); + Date d1(3840, 2, 21); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_12550615, Date) { - Date d1( 1255, 6, 15 ); + Date d1(1255, 6, 15); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_64750228, Date) { - Date d1( 6475, 2, 28 ); + Date d1(6475, 2, 28); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_05771013, Date) { - Date d1( 577, 10, 13 ); + Date d1(577, 10, 13); int expected = 2; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_92430918, Date) { - Date d1( 9243, 9, 18 ); + Date d1(9243, 9, 18); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_74520911, Date) { - Date d1( 7452, 9, 11 ); + Date d1(7452, 9, 11); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_09360207, Date) { - Date d1( 936, 2, 7 ); + Date d1(936, 2, 7); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_98970309, Date) { - Date d1( 9897, 3, 9 ); + Date d1(9897, 3, 9); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_71290818, Date) { - Date d1( 7129, 8, 18 ); + Date d1(7129, 8, 18); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_95591029, Date) { - Date d1( 9559, 10, 29 ); + Date d1(9559, 10, 29); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_07910904, Date) { - Date d1( 791, 9, 4 ); + Date d1(791, 9, 4); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_08780728, Date) { - Date d1( 878, 7, 28 ); + Date d1(878, 7, 28); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_95381002, Date) { - Date d1( 9538, 10, 2 ); + Date d1(9538, 10, 2); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_36320721, Date) { - Date d1( 3632, 7, 21 ); + Date d1(3632, 7, 21); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_11640419, Date) { - Date d1( 1164, 4, 19 ); + Date d1(1164, 4, 19); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_48281128, Date) { - Date d1( 4828, 11, 28 ); + Date d1(4828, 11, 28); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_53531212, Date) { - Date d1( 5353, 12, 12 ); + Date d1(5353, 12, 12); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_29060210, Date) { - Date d1( 2906, 2, 10 ); + Date d1(2906, 2, 10); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_50210927, Date) { - Date d1( 5021, 9, 27 ); + Date d1(5021, 9, 27); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_90011225, Date) { - Date d1( 9001, 12, 25 ); + Date d1(9001, 12, 25); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_86790220, Date) { - Date d1( 8679, 2, 20 ); + Date d1(8679, 2, 20); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_31790909, Date) { - Date d1( 3179, 9, 9 ); + Date d1(3179, 9, 9); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_85330923, Date) { - Date d1( 8533, 9, 23 ); + Date d1(8533, 9, 23); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_37770109, Date) { - Date d1( 3777, 1, 9 ); + Date d1(3777, 1, 9); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_00701202, Date) { - Date d1( 70, 12, 2 ); + Date d1(70, 12, 2); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_92550605, Date) { - Date d1( 9255, 6, 5 ); + Date d1(9255, 6, 5); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_78840719, Date) { - Date d1( 7884, 7, 19 ); + Date d1(7884, 7, 19); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_48370828, Date) { - Date d1( 4837, 8, 28 ); + Date d1(4837, 8, 28); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_62770906, Date) { - Date d1( 6277, 9, 6 ); + Date d1(6277, 9, 6); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_80220810, Date) { - Date d1( 8022, 8, 10 ); + Date d1(8022, 8, 10); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_60130424, Date) { - Date d1( 6013, 4, 24 ); + Date d1(6013, 4, 24); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_54420904, Date) { - Date d1( 5442, 9, 4 ); + Date d1(5442, 9, 4); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_54781128, Date) { - Date d1( 5478, 11, 28 ); + Date d1(5478, 11, 28); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_24950505, Date) { - Date d1( 2495, 5, 5 ); + Date d1(2495, 5, 5); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_60960325, Date) { - Date d1( 6096, 3, 25 ); + Date d1(6096, 3, 25); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_69910726, Date) { - Date d1( 6991, 7, 26 ); + Date d1(6991, 7, 26); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_28660611, Date) { - Date d1( 2866, 6, 11 ); + Date d1(2866, 6, 11); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_02860713, Date) { - Date d1( 286, 7, 13 ); + Date d1(286, 7, 13); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_14480512, Date) { - Date d1( 1448, 5, 12 ); + Date d1(1448, 5, 12); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_65670407, Date) { - Date d1( 6567, 4, 7 ); + Date d1(6567, 4, 7); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(weekday_19810219, Date) { - Date d1( 1981, 2, 19 ); + Date d1(1981, 2, 19); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19931116, Date) { - Date d1( 1993, 11, 16 ); + Date d1(1993, 11, 16); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20250620, Date) { - Date d1( 2025, 6, 20 ); + Date d1(2025, 6, 20); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20230318, Date) { - Date d1( 2023, 3, 18 ); + Date d1(2023, 3, 18); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20471013, Date) { - Date d1( 2047, 10, 13 ); + Date d1(2047, 10, 13); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20730103, Date) { - Date d1( 2073, 1, 3 ); + Date d1(2073, 1, 3); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20390117, Date) { - Date d1( 2039, 1, 17 ); + Date d1(2039, 1, 17); int expected = 2; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20440513, Date) { - Date d1( 2044, 5, 13 ); + Date d1(2044, 5, 13); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19841123, Date) { - Date d1( 1984, 11, 23 ); + Date d1(1984, 11, 23); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20250912, Date) { - Date d1( 2025, 9, 12 ); + Date d1(2025, 9, 12); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20480924, Date) { - Date d1( 2048, 9, 24 ); + Date d1(2048, 9, 24); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20280603, Date) { - Date d1( 2028, 6, 3 ); + Date d1(2028, 6, 3); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20620514, Date) { - Date d1( 2062, 5, 14 ); + Date d1(2062, 5, 14); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20010206, Date) { - Date d1( 2001, 2, 6 ); + Date d1(2001, 2, 6); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20770114, Date) { - Date d1( 2077, 1, 14 ); + Date d1(2077, 1, 14); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20361004, Date) { - Date d1( 2036, 10, 4 ); + Date d1(2036, 10, 4); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20400304, Date) { - Date d1( 2040, 3, 4 ); + Date d1(2040, 3, 4); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20530805, Date) { - Date d1( 2053, 8, 5 ); + Date d1(2053, 8, 5); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20320530, Date) { - Date d1( 2032, 5, 30 ); + Date d1(2032, 5, 30); int expected = 1; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20660817, Date) { - Date d1( 2066, 8, 17 ); + Date d1(2066, 8, 17); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20220219, Date) { - Date d1( 2022, 2, 19 ); + Date d1(2022, 2, 19); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20320410, Date) { - Date d1( 2032, 4, 10 ); + Date d1(2032, 4, 10); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20390209, Date) { - Date d1( 2039, 2, 9 ); + Date d1(2039, 2, 9); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20320628, Date) { - Date d1( 2032, 6, 28 ); + Date d1(2032, 6, 28); int expected = 2; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19770914, Date) { - Date d1( 1977, 9, 14 ); + Date d1(1977, 9, 14); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20680228, Date) { - Date d1( 2068, 2, 28 ); + Date d1(2068, 2, 28); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19810428, Date) { - Date d1( 1981, 4, 28 ); + Date d1(1981, 4, 28); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20611231, Date) { - Date d1( 2061, 12, 31 ); + Date d1(2061, 12, 31); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20230408, Date) { - Date d1( 2023, 4, 8 ); + Date d1(2023, 4, 8); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20290505, Date) { - Date d1( 2029, 5, 5 ); + Date d1(2029, 5, 5); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20020622, Date) { - Date d1( 2002, 6, 22 ); + Date d1(2002, 6, 22); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20610730, Date) { - Date d1( 2061, 7, 30 ); + Date d1(2061, 7, 30); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20130624, Date) { - Date d1( 2013, 6, 24 ); + Date d1(2013, 6, 24); int expected = 2; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20640811, Date) { - Date d1( 2064, 8, 11 ); + Date d1(2064, 8, 11); int expected = 2; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20691120, Date) { - Date d1( 2069, 11, 20 ); + Date d1(2069, 11, 20); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20220506, Date) { - Date d1( 2022, 5, 6 ); + Date d1(2022, 5, 6); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20080111, Date) { - Date d1( 2008, 1, 11 ); + Date d1(2008, 1, 11); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20371217, Date) { - Date d1( 2037, 12, 17 ); + Date d1(2037, 12, 17); int expected = 5; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20571005, Date) { - Date d1( 2057, 10, 5 ); + Date d1(2057, 10, 5); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20380118, Date) { - Date d1( 2038, 1, 18 ); + Date d1(2038, 1, 18); int expected = 2; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20640321, Date) { - Date d1( 2064, 3, 21 ); + Date d1(2064, 3, 21); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20610404, Date) { - Date d1( 2061, 4, 4 ); + Date d1(2061, 4, 4); int expected = 2; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19930713, Date) { - Date d1( 1993, 7, 13 ); + Date d1(1993, 7, 13); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20010824, Date) { - Date d1( 2001, 8, 24 ); + Date d1(2001, 8, 24); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20040730, Date) { - Date d1( 2004, 7, 30 ); + Date d1(2004, 7, 30); int expected = 6; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_20030913, Date) { - Date d1( 2003, 9, 13 ); + Date d1(2003, 9, 13); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19880518, Date) { - Date d1( 1988, 5, 18 ); + Date d1(1988, 5, 18); int expected = 4; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19980829, Date) { - Date d1( 1998, 8, 29 ); + Date d1(1998, 8, 29); int expected = 7; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19770207, Date) { - Date d1( 1977, 2, 7 ); + Date d1(1977, 2, 7); int expected = 2; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(weekday_19831227, Date) { - Date d1( 1983, 12, 27 ); + Date d1(1983, 12, 27); int expected = 3; int actual = d1.getWeekday(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - - TEST(Ctor_out_of_Range001, Date) { - Date d( -1, 2, 3 ); + Date d(-1, 2, 3); int expected = 1; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 3; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor_out_of_Range002, Date) { - Date d( 2014, 0, 13 ); + Date d(2014, 0, 13); int expected = 2014; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 1; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 13; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor_out_of_Range003, Date) { - Date d( 2018, 6, -15 ); + Date d(2018, 6, -15); int expected = 2018; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 6; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 1; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor_out_of_Range004, Date) { - Date d( 10000, 12, 15 ); + Date d(10000, 12, 15); int expected = 9999; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 12; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 15; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor_out_of_Range005, Date) { - Date d( 1988, 32, 31 ); + Date d(1988, 32, 31); int expected = 1988; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 12; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 31; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor_out_of_Range006, Date) { - Date d( 1812, 2, 64 ); + Date d(1812, 2, 64); int expected = 1812; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; // leap year actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor_out_of_Range007, Date) { - Date d( 1905, 2, 29 ); + Date d(1905, 2, 29); int expected = 1905; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 28; // non leap year actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor_in_Range001, Date) { - Date d( 1, 1, 1 ); + Date d(1, 1, 1); int expected = 1; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 1; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 1; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - TEST(Ctor00680229, Date) { - Date d( 68, 2, 29 ); + Date d(68, 2, 29); int expected = 68; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor00720229, Date) { - Date d( 72, 2, 29 ); + Date d(72, 2, 29); int expected = 72; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor00760229, Date) { - Date d( 76, 2, 29 ); + Date d(76, 2, 29); int expected = 76; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor00800229, Date) { - Date d( 80, 2, 29 ); + Date d(80, 2, 29); int expected = 80; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor00840229, Date) { - Date d( 84, 2, 29 ); + Date d(84, 2, 29); int expected = 84; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor00880229, Date) { - Date d( 88, 2, 29 ); + Date d(88, 2, 29); int expected = 88; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor00920229, Date) { - Date d( 92, 2, 29 ); + Date d(92, 2, 29); int expected = 92; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor00960229, Date) { - Date d( 96, 2, 29 ); + Date d(96, 2, 29); int expected = 96; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - TEST(Ctor54440229, Date) { - Date d( 5444, 2, 29 ); + Date d(5444, 2, 29); int expected = 5444; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor87960229, Date) { - Date d( 8796, 2, 29 ); + Date d(8796, 2, 29); int expected = 8796; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor39760229, Date) { - Date d( 3976, 2, 29 ); + Date d(3976, 2, 29); int expected = 3976; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor51280229, Date) { - Date d( 5128, 2, 29 ); + Date d(5128, 2, 29); int expected = 5128; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor35320229, Date) { - Date d( 3532, 2, 29 ); + Date d(3532, 2, 29); int expected = 3532; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor68440229, Date) { - Date d( 6844, 2, 29 ); + Date d(6844, 2, 29); int expected = 6844; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor93080229, Date) { - Date d( 9308, 2, 29 ); + Date d(9308, 2, 29); int expected = 9308; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor35360229, Date) { - Date d( 3536, 2, 29 ); + Date d(3536, 2, 29); int expected = 3536; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor91720229, Date) { - Date d( 9172, 2, 29 ); + Date d(9172, 2, 29); int expected = 9172; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor28200229, Date) { - Date d( 2820, 2, 29 ); + Date d(2820, 2, 29); int expected = 2820; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor99560229, Date) { - Date d( 9956, 2, 29 ); + Date d(9956, 2, 29); int expected = 9956; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor61920229, Date) { - Date d( 6192, 2, 29 ); + Date d(6192, 2, 29); int expected = 6192; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor82840229, Date) { - Date d( 8284, 2, 29 ); + Date d(8284, 2, 29); int expected = 8284; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor31080229, Date) { - Date d( 3108, 2, 29 ); + Date d(3108, 2, 29); int expected = 3108; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor87840229, Date) { - Date d( 8784, 2, 29 ); + Date d(8784, 2, 29); int expected = 8784; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor88560229, Date) { - Date d( 8856, 2, 29 ); + Date d(8856, 2, 29); int expected = 8856; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor94680229, Date) { - Date d( 9468, 2, 29 ); + Date d(9468, 2, 29); int expected = 9468; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor73080229, Date) { - Date d( 7308, 2, 29 ); + Date d(7308, 2, 29); int expected = 7308; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor21400229, Date) { - Date d( 2140, 2, 29 ); + Date d(2140, 2, 29); int expected = 2140; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor26560229, Date) { - Date d( 2656, 2, 29 ); + Date d(2656, 2, 29); int expected = 2656; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor56800229, Date) { - Date d( 5680, 2, 29 ); + Date d(5680, 2, 29); int expected = 5680; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor37160229, Date) { - Date d( 3716, 2, 29 ); + Date d(3716, 2, 29); int expected = 3716; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor99680229, Date) { - Date d( 9968, 2, 29 ); + Date d(9968, 2, 29); int expected = 9968; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor61120229, Date) { - Date d( 6112, 2, 29 ); + Date d(6112, 2, 29); int expected = 6112; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor53480229, Date) { - Date d( 5348, 2, 29 ); + Date d(5348, 2, 29); int expected = 5348; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor40680229, Date) { - Date d( 4068, 2, 29 ); + Date d(4068, 2, 29); int expected = 4068; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor31920229, Date) { - Date d( 3192, 2, 29 ); + Date d(3192, 2, 29); int expected = 3192; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor88760229, Date) { - Date d( 8876, 2, 29 ); + Date d(8876, 2, 29); int expected = 8876; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor64880229, Date) { - Date d( 6488, 2, 29 ); + Date d(6488, 2, 29); int expected = 6488; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor08480229, Date) { - Date d( 848, 2, 29 ); + Date d(848, 2, 29); int expected = 848; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor66760229, Date) { - Date d( 6676, 2, 29 ); + Date d(6676, 2, 29); int expected = 6676; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor76760229, Date) { - Date d( 7676, 2, 29 ); + Date d(7676, 2, 29); int expected = 7676; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor54920229, Date) { - Date d( 5492, 2, 29 ); + Date d(5492, 2, 29); int expected = 5492; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor67920229, Date) { - Date d( 6792, 2, 29 ); + Date d(6792, 2, 29); int expected = 6792; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor40160229, Date) { - Date d( 4016, 2, 29 ); + Date d(4016, 2, 29); int expected = 4016; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor03160229, Date) { - Date d( 316, 2, 29 ); + Date d(316, 2, 29); int expected = 316; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor58600229, Date) { - Date d( 5860, 2, 29 ); + Date d(5860, 2, 29); int expected = 5860; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor83640229, Date) { - Date d( 8364, 2, 29 ); + Date d(8364, 2, 29); int expected = 8364; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor32400229, Date) { - Date d( 3240, 2, 29 ); + Date d(3240, 2, 29); int expected = 3240; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor11400229, Date) { - Date d( 1140, 2, 29 ); + Date d(1140, 2, 29); int expected = 1140; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor16640229, Date) { - Date d( 1664, 2, 29 ); + Date d(1664, 2, 29); int expected = 1664; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor64080229, Date) { - Date d( 6408, 2, 29 ); + Date d(6408, 2, 29); int expected = 6408; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor13320229, Date) { - Date d( 1332, 2, 29 ); + Date d(1332, 2, 29); int expected = 1332; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor32280229, Date) { - Date d( 3228, 2, 29 ); + Date d(3228, 2, 29); int expected = 3228; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor50440229, Date) { - Date d( 5044, 2, 29 ); + Date d(5044, 2, 29); int expected = 5044; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor59600229, Date) { - Date d( 5960, 2, 29 ); + Date d(5960, 2, 29); int expected = 5960; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor39200229, Date) { - Date d( 3920, 2, 29 ); + Date d(3920, 2, 29); int expected = 3920; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor90800229, Date) { - Date d( 9080, 2, 29 ); + Date d(9080, 2, 29); int expected = 9080; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor88400229, Date) { - Date d( 8840, 2, 29 ); + Date d(8840, 2, 29); int expected = 8840; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor52040229, Date) { - Date d( 5204, 2, 29 ); + Date d(5204, 2, 29); int expected = 5204; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor85520229, Date) { - Date d( 8552, 2, 29 ); + Date d(8552, 2, 29); int expected = 8552; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor82440229, Date) { - Date d( 8244, 2, 29 ); + Date d(8244, 2, 29); int expected = 8244; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor11600229, Date) { - Date d( 1160, 2, 29 ); + Date d(1160, 2, 29); int expected = 1160; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor19920229, Date) { - Date d( 1992, 2, 29 ); + Date d(1992, 2, 29); int expected = 1992; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor56840229, Date) { - Date d( 5684, 2, 29 ); + Date d(5684, 2, 29); int expected = 5684; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor57520229, Date) { - Date d( 5752, 2, 29 ); + Date d(5752, 2, 29); int expected = 5752; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor83120229, Date) { - Date d( 8312, 2, 29 ); + Date d(8312, 2, 29); int expected = 8312; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor28960229, Date) { - Date d( 2896, 2, 29 ); + Date d(2896, 2, 29); int expected = 2896; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor45480229, Date) { - Date d( 4548, 2, 29 ); + Date d(4548, 2, 29); int expected = 4548; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor75080229, Date) { - Date d( 7508, 2, 29 ); + Date d(7508, 2, 29); int expected = 7508; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 2; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - TEST(Ctor15300129, Date) { - Date d( 1530, 1, 29 ); + Date d(1530, 1, 29); int expected = 1530; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 1; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 29; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor44990928, Date) { - Date d( 4499, 9, 28 ); + Date d(4499, 9, 28); int expected = 4499; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 9; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 28; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor22151103, Date) { - Date d( 2215, 11, 3 ); + Date d(2215, 11, 3); int expected = 2215; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 11; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 3; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor32530427, Date) { - Date d( 3253, 4, 27 ); + Date d(3253, 4, 27); int expected = 3253; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 4; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 27; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor30580119, Date) { - Date d( 3058, 1, 19 ); + Date d(3058, 1, 19); int expected = 3058; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 1; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 19; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(Ctor96770614, Date) { - Date d( 9677, 6, 14 ); + Date d(9677, 6, 14); int expected = 9677; int actual = d.getYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 6; actual = d.getMonth(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) expected = 14; actual = d.getDay(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - - TEST(add_day_ceiling, Date) { - Date d1( 9999, 5, 7 ); - Date d2 = d1.addDays( 365 ); - Date expected( 9999, 12, 31 ); + Date d1(9999, 5, 7); + Date d2 = d1.addDays(365); + Date expected(9999, 12, 31); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(add_day_floor, Date) { - Date d1( 1, 5, 7 ); - Date d2 = d1.addDays( -365 ); - Date expected( 1, 1, 1 ); + Date d1(1, 5, 7); + Date d2 = d1.addDays(-365); + Date expected(1, 1, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(add_day_20140606_P00001, Date) { - Date d1( 2014, 6, 6 ); - Date d2 = d1.addDays( 1 ); - Date expected( 2014, 6, 7 ); + Date d1(2014, 6, 6); + Date d2 = d1.addDays(1); + Date expected(2014, 6, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(add_day_20140606_P00002, Date) { - Date d1( 2014, 6, 6 ); - Date d2 = d1.addDays( 2 ); - Date expected( 2014, 6, 8 ); + Date d1(2014, 6, 6); + Date d2 = d1.addDays(2); + Date expected(2014, 6, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(add_day_20081224_neg1, Date) { - Date d1( 2008, 12, 24 ); - Date d2 = d1.addDays( -1 ); - Date expected( 2008, 12, 23 ); + Date d1(2008, 12, 24); + Date d2 = d1.addDays(-1); + Date expected(2008, 12, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } TEST(add_day_55580621_1, Date) { - Date d1( 5558, 6, 21 ); - Date d2 = d1.addDays( 1 ); - Date expected( 5558, 6, 22 ); + Date d1(5558, 6, 21); + Date d2 = d1.addDays(1); + Date expected(5558, 6, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_55140420_neg1, Date) { - Date d1( 5514, 4, 20 ); - Date d2 = d1.addDays( -1 ); - Date expected( 5514, 4, 19 ); + Date d1(5514, 4, 20); + Date d2 = d1.addDays(-1); + Date expected(5514, 4, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_94270310_3, Date) { - Date d1( 9427, 3, 10 ); - Date d2 = d1.addDays( 3 ); - Date expected( 9427, 3, 13 ); + Date d1(9427, 3, 10); + Date d2 = d1.addDays(3); + Date expected(9427, 3, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_92890828_neg3, Date) { - Date d1( 9289, 8, 28 ); - Date d2 = d1.addDays( -3 ); - Date expected( 9289, 8, 25 ); + Date d1(9289, 8, 28); + Date d2 = d1.addDays(-3); + Date expected(9289, 8, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60990319_5, Date) { - Date d1( 6099, 3, 19 ); - Date d2 = d1.addDays( 5 ); - Date expected( 6099, 3, 24 ); + Date d1(6099, 3, 19); + Date d2 = d1.addDays(5); + Date expected(6099, 3, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_90520117_neg5, Date) { - Date d1( 9052, 1, 17 ); - Date d2 = d1.addDays( -5 ); - Date expected( 9052, 1, 12 ); + Date d1(9052, 1, 17); + Date d2 = d1.addDays(-5); + Date expected(9052, 1, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66060714_7, Date) { - Date d1( 6606, 7, 14 ); - Date d2 = d1.addDays( 7 ); - Date expected( 6606, 7, 21 ); + Date d1(6606, 7, 14); + Date d2 = d1.addDays(7); + Date expected(6606, 7, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82020217_neg7, Date) { - Date d1( 8202, 2, 17 ); - Date d2 = d1.addDays( -7 ); - Date expected( 8202, 2, 10 ); + Date d1(8202, 2, 17); + Date d2 = d1.addDays(-7); + Date expected(8202, 2, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_76400318_9, Date) { - Date d1( 7640, 3, 18 ); - Date d2 = d1.addDays( 9 ); - Date expected( 7640, 3, 27 ); + Date d1(7640, 3, 18); + Date d2 = d1.addDays(9); + Date expected(7640, 3, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40800218_neg9, Date) { - Date d1( 4080, 2, 18 ); - Date d2 = d1.addDays( -9 ); - Date expected( 4080, 2, 9 ); + Date d1(4080, 2, 18); + Date d2 = d1.addDays(-9); + Date expected(4080, 2, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_74740617_11, Date) { - Date d1( 7474, 6, 17 ); - Date d2 = d1.addDays( 11 ); - Date expected( 7474, 6, 28 ); + Date d1(7474, 6, 17); + Date d2 = d1.addDays(11); + Date expected(7474, 6, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66200708_neg11, Date) { - Date d1( 6620, 7, 8 ); - Date d2 = d1.addDays( -11 ); - Date expected( 6620, 6, 27 ); + Date d1(6620, 7, 8); + Date d2 = d1.addDays(-11); + Date expected(6620, 6, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_36351105_13, Date) { - Date d1( 3635, 11, 5 ); - Date d2 = d1.addDays( 13 ); - Date expected( 3635, 11, 18 ); + Date d1(3635, 11, 5); + Date d2 = d1.addDays(13); + Date expected(3635, 11, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_50110226_neg13, Date) { - Date d1( 5011, 2, 26 ); - Date d2 = d1.addDays( -13 ); - Date expected( 5011, 2, 13 ); + Date d1(5011, 2, 26); + Date d2 = d1.addDays(-13); + Date expected(5011, 2, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_95090903_15, Date) { - Date d1( 9509, 9, 3 ); - Date d2 = d1.addDays( 15 ); - Date expected( 9509, 9, 18 ); + Date d1(9509, 9, 3); + Date d2 = d1.addDays(15); + Date expected(9509, 9, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_23290914_neg15, Date) { - Date d1( 2329, 9, 14 ); - Date d2 = d1.addDays( -15 ); - Date expected( 2329, 8, 30 ); + Date d1(2329, 9, 14); + Date d2 = d1.addDays(-15); + Date expected(2329, 8, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_92540711_17, Date) { - Date d1( 9254, 7, 11 ); - Date d2 = d1.addDays( 17 ); - Date expected( 9254, 7, 28 ); + Date d1(9254, 7, 11); + Date d2 = d1.addDays(17); + Date expected(9254, 7, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_93140130_neg17, Date) { - Date d1( 9314, 1, 30 ); - Date d2 = d1.addDays( -17 ); - Date expected( 9314, 1, 13 ); + Date d1(9314, 1, 30); + Date d2 = d1.addDays(-17); + Date expected(9314, 1, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_26920707_19, Date) { - Date d1( 2692, 7, 7 ); - Date d2 = d1.addDays( 19 ); - Date expected( 2692, 7, 26 ); + Date d1(2692, 7, 7); + Date d2 = d1.addDays(19); + Date expected(2692, 7, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_57940121_neg19, Date) { - Date d1( 5794, 1, 21 ); - Date d2 = d1.addDays( -19 ); - Date expected( 5794, 1, 2 ); + Date d1(5794, 1, 21); + Date d2 = d1.addDays(-19); + Date expected(5794, 1, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_28591105_21, Date) { - Date d1( 2859, 11, 5 ); - Date d2 = d1.addDays( 21 ); - Date expected( 2859, 11, 26 ); + Date d1(2859, 11, 5); + Date d2 = d1.addDays(21); + Date expected(2859, 11, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60970922_neg21, Date) { - Date d1( 6097, 9, 22 ); - Date d2 = d1.addDays( -21 ); - Date expected( 6097, 9, 1 ); + Date d1(6097, 9, 22); + Date d2 = d1.addDays(-21); + Date expected(6097, 9, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_36571219_23, Date) { - Date d1( 3657, 12, 19 ); - Date d2 = d1.addDays( 23 ); - Date expected( 3658, 1, 11 ); + Date d1(3657, 12, 19); + Date d2 = d1.addDays(23); + Date expected(3658, 1, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_58850716_neg23, Date) { - Date d1( 5885, 7, 16 ); - Date d2 = d1.addDays( -23 ); - Date expected( 5885, 6, 23 ); + Date d1(5885, 7, 16); + Date d2 = d1.addDays(-23); + Date expected(5885, 6, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_56980416_25, Date) { - Date d1( 5698, 4, 16 ); - Date d2 = d1.addDays( 25 ); - Date expected( 5698, 5, 11 ); + Date d1(5698, 4, 16); + Date d2 = d1.addDays(25); + Date expected(5698, 5, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32060324_neg25, Date) { - Date d1( 3206, 3, 24 ); - Date d2 = d1.addDays( -25 ); - Date expected( 3206, 2, 27 ); + Date d1(3206, 3, 24); + Date d2 = d1.addDays(-25); + Date expected(3206, 2, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_29241102_27, Date) { - Date d1( 2924, 11, 2 ); - Date d2 = d1.addDays( 27 ); - Date expected( 2924, 11, 29 ); + Date d1(2924, 11, 2); + Date d2 = d1.addDays(27); + Date expected(2924, 11, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_45010406_neg27, Date) { - Date d1( 4501, 4, 6 ); - Date d2 = d1.addDays( -27 ); - Date expected( 4501, 3, 10 ); + Date d1(4501, 4, 6); + Date d2 = d1.addDays(-27); + Date expected(4501, 3, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21670806_29, Date) { - Date d1( 2167, 8, 6 ); - Date d2 = d1.addDays( 29 ); - Date expected( 2167, 9, 4 ); + Date d1(2167, 8, 6); + Date d2 = d1.addDays(29); + Date expected(2167, 9, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66090214_neg29, Date) { - Date d1( 6609, 2, 14 ); - Date d2 = d1.addDays( -29 ); - Date expected( 6609, 1, 16 ); + Date d1(6609, 2, 14); + Date d2 = d1.addDays(-29); + Date expected(6609, 1, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82870823_31, Date) { - Date d1( 8287, 8, 23 ); - Date d2 = d1.addDays( 31 ); - Date expected( 8287, 9, 23 ); + Date d1(8287, 8, 23); + Date d2 = d1.addDays(31); + Date expected(8287, 9, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_75000820_neg31, Date) { - Date d1( 7500, 8, 20 ); - Date d2 = d1.addDays( -31 ); - Date expected( 7500, 7, 20 ); + Date d1(7500, 8, 20); + Date d2 = d1.addDays(-31); + Date expected(7500, 7, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_33000613_33, Date) { - Date d1( 3300, 6, 13 ); - Date d2 = d1.addDays( 33 ); - Date expected( 3300, 7, 16 ); + Date d1(3300, 6, 13); + Date d2 = d1.addDays(33); + Date expected(3300, 7, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_67540618_neg33, Date) { - Date d1( 6754, 6, 18 ); - Date d2 = d1.addDays( -33 ); - Date expected( 6754, 5, 16 ); + Date d1(6754, 6, 18); + Date d2 = d1.addDays(-33); + Date expected(6754, 5, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_36970915_35, Date) { - Date d1( 3697, 9, 15 ); - Date d2 = d1.addDays( 35 ); - Date expected( 3697, 10, 20 ); + Date d1(3697, 9, 15); + Date d2 = d1.addDays(35); + Date expected(3697, 10, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_65561202_neg35, Date) { - Date d1( 6556, 12, 2 ); - Date d2 = d1.addDays( -35 ); - Date expected( 6556, 10, 28 ); + Date d1(6556, 12, 2); + Date d2 = d1.addDays(-35); + Date expected(6556, 10, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_46960722_37, Date) { - Date d1( 4696, 7, 22 ); - Date d2 = d1.addDays( 37 ); - Date expected( 4696, 8, 28 ); + Date d1(4696, 7, 22); + Date d2 = d1.addDays(37); + Date expected(4696, 8, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_74420105_neg37, Date) { - Date d1( 7442, 1, 5 ); - Date d2 = d1.addDays( -37 ); - Date expected( 7441, 11, 29 ); + Date d1(7442, 1, 5); + Date d2 = d1.addDays(-37); + Date expected(7441, 11, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_93480531_39, Date) { - Date d1( 9348, 5, 31 ); - Date d2 = d1.addDays( 39 ); - Date expected( 9348, 7, 9 ); + Date d1(9348, 5, 31); + Date d2 = d1.addDays(39); + Date expected(9348, 7, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_93091121_neg39, Date) { - Date d1( 9309, 11, 21 ); - Date d2 = d1.addDays( -39 ); - Date expected( 9309, 10, 13 ); + Date d1(9309, 11, 21); + Date d2 = d1.addDays(-39); + Date expected(9309, 10, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_70120413_41, Date) { - Date d1( 7012, 4, 13 ); - Date d2 = d1.addDays( 41 ); - Date expected( 7012, 5, 24 ); + Date d1(7012, 4, 13); + Date d2 = d1.addDays(41); + Date expected(7012, 5, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_34261122_neg41, Date) { - Date d1( 3426, 11, 22 ); - Date d2 = d1.addDays( -41 ); - Date expected( 3426, 10, 12 ); + Date d1(3426, 11, 22); + Date d2 = d1.addDays(-41); + Date expected(3426, 10, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_74310123_43, Date) { - Date d1( 7431, 1, 23 ); - Date d2 = d1.addDays( 43 ); - Date expected( 7431, 3, 7 ); + Date d1(7431, 1, 23); + Date d2 = d1.addDays(43); + Date expected(7431, 3, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_53500209_neg43, Date) { - Date d1( 5350, 2, 9 ); - Date d2 = d1.addDays( -43 ); - Date expected( 5349, 12, 28 ); + Date d1(5350, 2, 9); + Date d2 = d1.addDays(-43); + Date expected(5349, 12, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_56960629_45, Date) { - Date d1( 5696, 6, 29 ); - Date d2 = d1.addDays( 45 ); - Date expected( 5696, 8, 13 ); + Date d1(5696, 6, 29); + Date d2 = d1.addDays(45); + Date expected(5696, 8, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_53330103_neg45, Date) { - Date d1( 5333, 1, 3 ); - Date d2 = d1.addDays( -45 ); - Date expected( 5332, 11, 19 ); + Date d1(5333, 1, 3); + Date d2 = d1.addDays(-45); + Date expected(5332, 11, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_22930103_47, Date) { - Date d1( 2293, 1, 3 ); - Date d2 = d1.addDays( 47 ); - Date expected( 2293, 2, 19 ); + Date d1(2293, 1, 3); + Date d2 = d1.addDays(47); + Date expected(2293, 2, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_74341130_neg47, Date) { - Date d1( 7434, 11, 30 ); - Date d2 = d1.addDays( -47 ); - Date expected( 7434, 10, 14 ); + Date d1(7434, 11, 30); + Date d2 = d1.addDays(-47); + Date expected(7434, 10, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_78651207_49, Date) { - Date d1( 7865, 12, 7 ); - Date d2 = d1.addDays( 49 ); - Date expected( 7866, 1, 25 ); + Date d1(7865, 12, 7); + Date d2 = d1.addDays(49); + Date expected(7866, 1, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_46121030_neg49, Date) { - Date d1( 4612, 10, 30 ); - Date d2 = d1.addDays( -49 ); - Date expected( 4612, 9, 11 ); + Date d1(4612, 10, 30); + Date d2 = d1.addDays(-49); + Date expected(4612, 9, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_39750922_51, Date) { - Date d1( 3975, 9, 22 ); - Date d2 = d1.addDays( 51 ); - Date expected( 3975, 11, 12 ); + Date d1(3975, 9, 22); + Date d2 = d1.addDays(51); + Date expected(3975, 11, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_45910531_neg51, Date) { - Date d1( 4591, 5, 31 ); - Date d2 = d1.addDays( -51 ); - Date expected( 4591, 4, 10 ); + Date d1(4591, 5, 31); + Date d2 = d1.addDays(-51); + Date expected(4591, 4, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_87860402_53, Date) { - Date d1( 8786, 4, 2 ); - Date d2 = d1.addDays( 53 ); - Date expected( 8786, 5, 25 ); + Date d1(8786, 4, 2); + Date d2 = d1.addDays(53); + Date expected(8786, 5, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_52941230_neg53, Date) { - Date d1( 5294, 12, 30 ); - Date d2 = d1.addDays( -53 ); - Date expected( 5294, 11, 7 ); + Date d1(5294, 12, 30); + Date d2 = d1.addDays(-53); + Date expected(5294, 11, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_50420615_55, Date) { - Date d1( 5042, 6, 15 ); - Date d2 = d1.addDays( 55 ); - Date expected( 5042, 8, 9 ); + Date d1(5042, 6, 15); + Date d2 = d1.addDays(55); + Date expected(5042, 8, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96190629_neg55, Date) { - Date d1( 9619, 6, 29 ); - Date d2 = d1.addDays( -55 ); - Date expected( 9619, 5, 5 ); + Date d1(9619, 6, 29); + Date d2 = d1.addDays(-55); + Date expected(9619, 5, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_30290514_57, Date) { - Date d1( 3029, 5, 14 ); - Date d2 = d1.addDays( 57 ); - Date expected( 3029, 7, 10 ); + Date d1(3029, 5, 14); + Date d2 = d1.addDays(57); + Date expected(3029, 7, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_42270712_neg57, Date) { - Date d1( 4227, 7, 12 ); - Date d2 = d1.addDays( -57 ); - Date expected( 4227, 5, 16 ); + Date d1(4227, 7, 12); + Date d2 = d1.addDays(-57); + Date expected(4227, 5, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_34710317_59, Date) { - Date d1( 3471, 3, 17 ); - Date d2 = d1.addDays( 59 ); - Date expected( 3471, 5, 15 ); + Date d1(3471, 3, 17); + Date d2 = d1.addDays(59); + Date expected(3471, 5, 15); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_53920807_neg59, Date) { - Date d1( 5392, 8, 7 ); - Date d2 = d1.addDays( -59 ); - Date expected( 5392, 6, 9 ); + Date d1(5392, 8, 7); + Date d2 = d1.addDays(-59); + Date expected(5392, 6, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_71241012_61, Date) { - Date d1( 7124, 10, 12 ); - Date d2 = d1.addDays( 61 ); - Date expected( 7124, 12, 12 ); + Date d1(7124, 10, 12); + Date d2 = d1.addDays(61); + Date expected(7124, 12, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_58020623_neg61, Date) { - Date d1( 5802, 6, 23 ); - Date d2 = d1.addDays( -61 ); - Date expected( 5802, 4, 23 ); + Date d1(5802, 6, 23); + Date d2 = d1.addDays(-61); + Date expected(5802, 4, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20240311_63, Date) { - Date d1( 2024, 3, 11 ); - Date d2 = d1.addDays( 63 ); - Date expected( 2024, 5, 13 ); + Date d1(2024, 3, 11); + Date d2 = d1.addDays(63); + Date expected(2024, 5, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27730606_neg63, Date) { - Date d1( 2773, 6, 6 ); - Date d2 = d1.addDays( -63 ); - Date expected( 2773, 4, 4 ); + Date d1(2773, 6, 6); + Date d2 = d1.addDays(-63); + Date expected(2773, 4, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_51040218_65, Date) { - Date d1( 5104, 2, 18 ); - Date d2 = d1.addDays( 65 ); - Date expected( 5104, 4, 23 ); + Date d1(5104, 2, 18); + Date d2 = d1.addDays(65); + Date expected(5104, 4, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_98841208_neg65, Date) { - Date d1( 9884, 12, 8 ); - Date d2 = d1.addDays( -65 ); - Date expected( 9884, 10, 4 ); + Date d1(9884, 12, 8); + Date d2 = d1.addDays(-65); + Date expected(9884, 10, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_67970921_67, Date) { - Date d1( 6797, 9, 21 ); - Date d2 = d1.addDays( 67 ); - Date expected( 6797, 11, 27 ); + Date d1(6797, 9, 21); + Date d2 = d1.addDays(67); + Date expected(6797, 11, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_94760401_neg67, Date) { - Date d1( 9476, 4, 1 ); - Date d2 = d1.addDays( -67 ); - Date expected( 9476, 1, 25 ); + Date d1(9476, 4, 1); + Date d2 = d1.addDays(-67); + Date expected(9476, 1, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_51050612_69, Date) { - Date d1( 5105, 6, 12 ); - Date d2 = d1.addDays( 69 ); - Date expected( 5105, 8, 20 ); + Date d1(5105, 6, 12); + Date d2 = d1.addDays(69); + Date expected(5105, 8, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_89070117_neg69, Date) { - Date d1( 8907, 1, 17 ); - Date d2 = d1.addDays( -69 ); - Date expected( 8906, 11, 9 ); + Date d1(8907, 1, 17); + Date d2 = d1.addDays(-69); + Date expected(8906, 11, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_44300304_71, Date) { - Date d1( 4430, 3, 4 ); - Date d2 = d1.addDays( 71 ); - Date expected( 4430, 5, 14 ); + Date d1(4430, 3, 4); + Date d2 = d1.addDays(71); + Date expected(4430, 5, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_36520131_neg71, Date) { - Date d1( 3652, 1, 31 ); - Date d2 = d1.addDays( -71 ); - Date expected( 3651, 11, 21 ); + Date d1(3652, 1, 31); + Date d2 = d1.addDays(-71); + Date expected(3651, 11, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27450317_73, Date) { - Date d1( 2745, 3, 17 ); - Date d2 = d1.addDays( 73 ); - Date expected( 2745, 5, 29 ); + Date d1(2745, 3, 17); + Date d2 = d1.addDays(73); + Date expected(2745, 5, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_47760831_neg73, Date) { - Date d1( 4776, 8, 31 ); - Date d2 = d1.addDays( -73 ); - Date expected( 4776, 6, 19 ); + Date d1(4776, 8, 31); + Date d2 = d1.addDays(-73); + Date expected(4776, 6, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_50100729_75, Date) { - Date d1( 5010, 7, 29 ); - Date d2 = d1.addDays( 75 ); - Date expected( 5010, 10, 12 ); + Date d1(5010, 7, 29); + Date d2 = d1.addDays(75); + Date expected(5010, 10, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_72980316_neg75, Date) { - Date d1( 7298, 3, 16 ); - Date d2 = d1.addDays( -75 ); - Date expected( 7297, 12, 31 ); + Date d1(7298, 3, 16); + Date d2 = d1.addDays(-75); + Date expected(7297, 12, 31); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_91520423_77, Date) { - Date d1( 9152, 4, 23 ); - Date d2 = d1.addDays( 77 ); - Date expected( 9152, 7, 9 ); + Date d1(9152, 4, 23); + Date d2 = d1.addDays(77); + Date expected(9152, 7, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_35280515_neg77, Date) { - Date d1( 3528, 5, 15 ); - Date d2 = d1.addDays( -77 ); - Date expected( 3528, 2, 28 ); + Date d1(3528, 5, 15); + Date d2 = d1.addDays(-77); + Date expected(3528, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_86390619_79, Date) { - Date d1( 8639, 6, 19 ); - Date d2 = d1.addDays( 79 ); - Date expected( 8639, 9, 6 ); + Date d1(8639, 6, 19); + Date d2 = d1.addDays(79); + Date expected(8639, 9, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60660524_neg79, Date) { - Date d1( 6066, 5, 24 ); - Date d2 = d1.addDays( -79 ); - Date expected( 6066, 3, 6 ); + Date d1(6066, 5, 24); + Date d2 = d1.addDays(-79); + Date expected(6066, 3, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_76850911_81, Date) { - Date d1( 7685, 9, 11 ); - Date d2 = d1.addDays( 81 ); - Date expected( 7685, 12, 1 ); + Date d1(7685, 9, 11); + Date d2 = d1.addDays(81); + Date expected(7685, 12, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_86111106_neg81, Date) { - Date d1( 8611, 11, 6 ); - Date d2 = d1.addDays( -81 ); - Date expected( 8611, 8, 17 ); + Date d1(8611, 11, 6); + Date d2 = d1.addDays(-81); + Date expected(8611, 8, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_62480927_83, Date) { - Date d1( 6248, 9, 27 ); - Date d2 = d1.addDays( 83 ); - Date expected( 6248, 12, 19 ); + Date d1(6248, 9, 27); + Date d2 = d1.addDays(83); + Date expected(6248, 12, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40940308_neg83, Date) { - Date d1( 4094, 3, 8 ); - Date d2 = d1.addDays( -83 ); - Date expected( 4093, 12, 15 ); + Date d1(4094, 3, 8); + Date d2 = d1.addDays(-83); + Date expected(4093, 12, 15); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_36780827_85, Date) { - Date d1( 3678, 8, 27 ); - Date d2 = d1.addDays( 85 ); - Date expected( 3678, 11, 20 ); + Date d1(3678, 8, 27); + Date d2 = d1.addDays(85); + Date expected(3678, 11, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32031003_neg85, Date) { - Date d1( 3203, 10, 3 ); - Date d2 = d1.addDays( -85 ); - Date expected( 3203, 7, 10 ); + Date d1(3203, 10, 3); + Date d2 = d1.addDays(-85); + Date expected(3203, 7, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_92760410_87, Date) { - Date d1( 9276, 4, 10 ); - Date d2 = d1.addDays( 87 ); - Date expected( 9276, 7, 6 ); + Date d1(9276, 4, 10); + Date d2 = d1.addDays(87); + Date expected(9276, 7, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_57050315_neg87, Date) { - Date d1( 5705, 3, 15 ); - Date d2 = d1.addDays( -87 ); - Date expected( 5704, 12, 18 ); + Date d1(5705, 3, 15); + Date d2 = d1.addDays(-87); + Date expected(5704, 12, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_59210930_89, Date) { - Date d1( 5921, 9, 30 ); - Date d2 = d1.addDays( 89 ); - Date expected( 5921, 12, 28 ); + Date d1(5921, 9, 30); + Date d2 = d1.addDays(89); + Date expected(5921, 12, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60050307_neg89, Date) { - Date d1( 6005, 3, 7 ); - Date d2 = d1.addDays( -89 ); - Date expected( 6004, 12, 8 ); + Date d1(6005, 3, 7); + Date d2 = d1.addDays(-89); + Date expected(6004, 12, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_71390612_91, Date) { - Date d1( 7139, 6, 12 ); - Date d2 = d1.addDays( 91 ); - Date expected( 7139, 9, 11 ); + Date d1(7139, 6, 12); + Date d2 = d1.addDays(91); + Date expected(7139, 9, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97300219_neg91, Date) { - Date d1( 9730, 2, 19 ); - Date d2 = d1.addDays( -91 ); - Date expected( 9729, 11, 20 ); + Date d1(9730, 2, 19); + Date d2 = d1.addDays(-91); + Date expected(9729, 11, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_84410625_93, Date) { - Date d1( 8441, 6, 25 ); - Date d2 = d1.addDays( 93 ); - Date expected( 8441, 9, 26 ); + Date d1(8441, 6, 25); + Date d2 = d1.addDays(93); + Date expected(8441, 9, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_70460304_neg93, Date) { - Date d1( 7046, 3, 4 ); - Date d2 = d1.addDays( -93 ); - Date expected( 7045, 12, 1 ); + Date d1(7046, 3, 4); + Date d2 = d1.addDays(-93); + Date expected(7045, 12, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_81980504_95, Date) { - Date d1( 8198, 5, 4 ); - Date d2 = d1.addDays( 95 ); - Date expected( 8198, 8, 7 ); + Date d1(8198, 5, 4); + Date d2 = d1.addDays(95); + Date expected(8198, 8, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32351024_neg95, Date) { - Date d1( 3235, 10, 24 ); - Date d2 = d1.addDays( -95 ); - Date expected( 3235, 7, 21 ); + Date d1(3235, 10, 24); + Date d2 = d1.addDays(-95); + Date expected(3235, 7, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_25110804_97, Date) { - Date d1( 2511, 8, 4 ); - Date d2 = d1.addDays( 97 ); - Date expected( 2511, 11, 9 ); + Date d1(2511, 8, 4); + Date d2 = d1.addDays(97); + Date expected(2511, 11, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_75620218_neg97, Date) { - Date d1( 7562, 2, 18 ); - Date d2 = d1.addDays( -97 ); - Date expected( 7561, 11, 13 ); + Date d1(7562, 2, 18); + Date d2 = d1.addDays(-97); + Date expected(7561, 11, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_47180108_99, Date) { - Date d1( 4718, 1, 8 ); - Date d2 = d1.addDays( 99 ); - Date expected( 4718, 4, 17 ); + Date d1(4718, 1, 8); + Date d2 = d1.addDays(99); + Date expected(4718, 4, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_77881021_neg99, Date) { - Date d1( 7788, 10, 21 ); - Date d2 = d1.addDays( -99 ); - Date expected( 7788, 7, 14 ); + Date d1(7788, 10, 21); + Date d2 = d1.addDays(-99); + Date expected(7788, 7, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_57491222_101, Date) { - Date d1( 5749, 12, 22 ); - Date d2 = d1.addDays( 101 ); - Date expected( 5750, 4, 2 ); + Date d1(5749, 12, 22); + Date d2 = d1.addDays(101); + Date expected(5750, 4, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_61330324_neg101, Date) { - Date d1( 6133, 3, 24 ); - Date d2 = d1.addDays( -101 ); - Date expected( 6132, 12, 13 ); + Date d1(6133, 3, 24); + Date d2 = d1.addDays(-101); + Date expected(6132, 12, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } TEST(add_day_29800912_202, Date) { - Date d1( 2980, 9, 12 ); - Date d2 = d1.addDays( 202 ); - Date expected( 2981, 4, 2 ); + Date d1(2980, 9, 12); + Date d2 = d1.addDays(202); + Date expected(2981, 4, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27870929_neg202, Date) { - Date d1( 2787, 9, 29 ); - Date d2 = d1.addDays( -202 ); - Date expected( 2787, 3, 11 ); + Date d1(2787, 9, 29); + Date d2 = d1.addDays(-202); + Date expected(2787, 3, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40630303_403, Date) { - Date d1( 4063, 3, 3 ); - Date d2 = d1.addDays( 403 ); - Date expected( 4064, 4, 9 ); + Date d1(4063, 3, 3); + Date d2 = d1.addDays(403); + Date expected(4064, 4, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40770814_neg403, Date) { - Date d1( 4077, 8, 14 ); - Date d2 = d1.addDays( -403 ); - Date expected( 4076, 7, 7 ); + Date d1(4077, 8, 14); + Date d2 = d1.addDays(-403); + Date expected(4076, 7, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66430123_604, Date) { - Date d1( 6643, 1, 23 ); - Date d2 = d1.addDays( 604 ); - Date expected( 6644, 9, 18 ); + Date d1(6643, 1, 23); + Date d2 = d1.addDays(604); + Date expected(6644, 9, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82990222_neg604, Date) { - Date d1( 8299, 2, 22 ); - Date d2 = d1.addDays( -604 ); - Date expected( 8297, 6, 28 ); + Date d1(8299, 2, 22); + Date d2 = d1.addDays(-604); + Date expected(8297, 6, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_85861110_805, Date) { - Date d1( 8586, 11, 10 ); - Date d2 = d1.addDays( 805 ); - Date expected( 8589, 1, 23 ); + Date d1(8586, 11, 10); + Date d2 = d1.addDays(805); + Date expected(8589, 1, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_38450606_neg805, Date) { - Date d1( 3845, 6, 6 ); - Date d2 = d1.addDays( -805 ); - Date expected( 3843, 3, 24 ); + Date d1(3845, 6, 6); + Date d2 = d1.addDays(-805); + Date expected(3843, 3, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_76550522_1006, Date) { - Date d1( 7655, 5, 22 ); - Date d2 = d1.addDays( 1006 ); - Date expected( 7658, 2, 21 ); + Date d1(7655, 5, 22); + Date d2 = d1.addDays(1006); + Date expected(7658, 2, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_39470114_neg1006, Date) { - Date d1( 3947, 1, 14 ); - Date d2 = d1.addDays( -1006 ); - Date expected( 3944, 4, 13 ); + Date d1(3947, 1, 14); + Date d2 = d1.addDays(-1006); + Date expected(3944, 4, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_87690906_1207, Date) { - Date d1( 8769, 9, 6 ); - Date d2 = d1.addDays( 1207 ); - Date expected( 8772, 12, 26 ); + Date d1(8769, 9, 6); + Date d2 = d1.addDays(1207); + Date expected(8772, 12, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_90280120_neg1207, Date) { - Date d1( 9028, 1, 20 ); - Date d2 = d1.addDays( -1207 ); - Date expected( 9024, 9, 30 ); + Date d1(9028, 1, 20); + Date d2 = d1.addDays(-1207); + Date expected(9024, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_44070430_1408, Date) { - Date d1( 4407, 4, 30 ); - Date d2 = d1.addDays( 1408 ); - Date expected( 4411, 3, 8 ); + Date d1(4407, 4, 30); + Date d2 = d1.addDays(1408); + Date expected(4411, 3, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_55840916_neg1408, Date) { - Date d1( 5584, 9, 16 ); - Date d2 = d1.addDays( -1408 ); - Date expected( 5580, 11, 8 ); + Date d1(5584, 9, 16); + Date d2 = d1.addDays(-1408); + Date expected(5580, 11, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_78400616_1609, Date) { - Date d1( 7840, 6, 16 ); - Date d2 = d1.addDays( 1609 ); - Date expected( 7844, 11, 11 ); + Date d1(7840, 6, 16); + Date d2 = d1.addDays(1609); + Date expected(7844, 11, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97471114_neg1609, Date) { - Date d1( 9747, 11, 14 ); - Date d2 = d1.addDays( -1609 ); - Date expected( 9743, 6, 19 ); + Date d1(9747, 11, 14); + Date d2 = d1.addDays(-1609); + Date expected(9743, 6, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_58791109_1810, Date) { - Date d1( 5879, 11, 9 ); - Date d2 = d1.addDays( 1810 ); - Date expected( 5884, 10, 23 ); + Date d1(5879, 11, 9); + Date d2 = d1.addDays(1810); + Date expected(5884, 10, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96660815_neg1810, Date) { - Date d1( 9666, 8, 15 ); - Date d2 = d1.addDays( -1810 ); - Date expected( 9661, 8, 31 ); + Date d1(9666, 8, 15); + Date d2 = d1.addDays(-1810); + Date expected(9661, 8, 31); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_54981103_2011, Date) { - Date d1( 5498, 11, 3 ); - Date d2 = d1.addDays( 2011 ); - Date expected( 5504, 5, 7 ); + Date d1(5498, 11, 3); + Date d2 = d1.addDays(2011); + Date expected(5504, 5, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_29170625_neg2011, Date) { - Date d1( 2917, 6, 25 ); - Date d2 = d1.addDays( -2011 ); - Date expected( 2911, 12, 23 ); + Date d1(2917, 6, 25); + Date d2 = d1.addDays(-2011); + Date expected(2911, 12, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_73820825_2212, Date) { - Date d1( 7382, 8, 25 ); - Date d2 = d1.addDays( 2212 ); - Date expected( 7388, 9, 14 ); + Date d1(7382, 8, 25); + Date d2 = d1.addDays(2212); + Date expected(7388, 9, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96821106_neg2212, Date) { - Date d1( 9682, 11, 6 ); - Date d2 = d1.addDays( -2212 ); - Date expected( 9676, 10, 16 ); + Date d1(9682, 11, 6); + Date d2 = d1.addDays(-2212); + Date expected(9676, 10, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_38260301_2413, Date) { - Date d1( 3826, 3, 1 ); - Date d2 = d1.addDays( 2413 ); - Date expected( 3832, 10, 8 ); + Date d1(3826, 3, 1); + Date d2 = d1.addDays(2413); + Date expected(3832, 10, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_72960713_neg2413, Date) { - Date d1( 7296, 7, 13 ); - Date d2 = d1.addDays( -2413 ); - Date expected( 7289, 12, 4 ); + Date d1(7296, 7, 13); + Date d2 = d1.addDays(-2413); + Date expected(7289, 12, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66791206_2614, Date) { - Date d1( 6679, 12, 6 ); - Date d2 = d1.addDays( 2614 ); - Date expected( 6687, 2, 1 ); + Date d1(6679, 12, 6); + Date d2 = d1.addDays(2614); + Date expected(6687, 2, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_98440223_neg2614, Date) { - Date d1( 9844, 2, 23 ); - Date d2 = d1.addDays( -2614 ); - Date expected( 9836, 12, 27 ); + Date d1(9844, 2, 23); + Date d2 = d1.addDays(-2614); + Date expected(9836, 12, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_50050227_2815, Date) { - Date d1( 5005, 2, 27 ); - Date d2 = d1.addDays( 2815 ); - Date expected( 5012, 11, 12 ); + Date d1(5005, 2, 27); + Date d2 = d1.addDays(2815); + Date expected(5012, 11, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_68031206_neg2815, Date) { - Date d1( 6803, 12, 6 ); - Date d2 = d1.addDays( -2815 ); - Date expected( 6796, 3, 22 ); + Date d1(6803, 12, 6); + Date d2 = d1.addDays(-2815); + Date expected(6796, 3, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40770421_3016, Date) { - Date d1( 4077, 4, 21 ); - Date d2 = d1.addDays( 3016 ); - Date expected( 4085, 7, 24 ); + Date d1(4077, 4, 21); + Date d2 = d1.addDays(3016); + Date expected(4085, 7, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_52701106_neg3016, Date) { - Date d1( 5270, 11, 6 ); - Date d2 = d1.addDays( -3016 ); - Date expected( 5262, 8, 4 ); + Date d1(5270, 11, 6); + Date d2 = d1.addDays(-3016); + Date expected(5262, 8, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_22910106_3217, Date) { - Date d1( 2291, 1, 6 ); - Date d2 = d1.addDays( 3217 ); - Date expected( 2299, 10, 28 ); + Date d1(2291, 1, 6); + Date d2 = d1.addDays(3217); + Date expected(2299, 10, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_88910816_neg3217, Date) { - Date d1( 8891, 8, 16 ); - Date d2 = d1.addDays( -3217 ); - Date expected( 8882, 10, 25 ); + Date d1(8891, 8, 16); + Date d2 = d1.addDays(-3217); + Date expected(8882, 10, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_47760617_3418, Date) { - Date d1( 4776, 6, 17 ); - Date d2 = d1.addDays( 3418 ); - Date expected( 4785, 10, 26 ); + Date d1(4776, 6, 17); + Date d2 = d1.addDays(3418); + Date expected(4785, 10, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_73261022_neg3418, Date) { - Date d1( 7326, 10, 22 ); - Date d2 = d1.addDays( -3418 ); - Date expected( 7317, 6, 13 ); + Date d1(7326, 10, 22); + Date d2 = d1.addDays(-3418); + Date expected(7317, 6, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_91800428_3619, Date) { - Date d1( 9180, 4, 28 ); - Date d2 = d1.addDays( 3619 ); - Date expected( 9190, 3, 26 ); + Date d1(9180, 4, 28); + Date d2 = d1.addDays(3619); + Date expected(9190, 3, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_74940813_neg3619, Date) { - Date d1( 7494, 8, 13 ); - Date d2 = d1.addDays( -3619 ); - Date expected( 7484, 9, 15 ); + Date d1(7494, 8, 13); + Date d2 = d1.addDays(-3619); + Date expected(7484, 9, 15); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_63010718_3820, Date) { - Date d1( 6301, 7, 18 ); - Date d2 = d1.addDays( 3820 ); - Date expected( 6312, 1, 2 ); + Date d1(6301, 7, 18); + Date d2 = d1.addDays(3820); + Date expected(6312, 1, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_53241124_neg3820, Date) { - Date d1( 5324, 11, 24 ); - Date d2 = d1.addDays( -3820 ); - Date expected( 5314, 6, 10 ); + Date d1(5324, 11, 24); + Date d2 = d1.addDays(-3820); + Date expected(5314, 6, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_43060827_4021, Date) { - Date d1( 4306, 8, 27 ); - Date d2 = d1.addDays( 4021 ); - Date expected( 4317, 8, 30 ); + Date d1(4306, 8, 27); + Date d2 = d1.addDays(4021); + Date expected(4317, 8, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_26380413_neg4021, Date) { - Date d1( 2638, 4, 13 ); - Date d2 = d1.addDays( -4021 ); - Date expected( 2627, 4, 10 ); + Date d1(2638, 4, 13); + Date d2 = d1.addDays(-4021); + Date expected(2627, 4, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_52700731_4222, Date) { - Date d1( 5270, 7, 31 ); - Date d2 = d1.addDays( 4222 ); - Date expected( 5282, 2, 20 ); + Date d1(5270, 7, 31); + Date d2 = d1.addDays(4222); + Date expected(5282, 2, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_26570303_neg4222, Date) { - Date d1( 2657, 3, 3 ); - Date d2 = d1.addDays( -4222 ); - Date expected( 2645, 8, 11 ); + Date d1(2657, 3, 3); + Date d2 = d1.addDays(-4222); + Date expected(2645, 8, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_79560304_4423, Date) { - Date d1( 7956, 3, 4 ); - Date d2 = d1.addDays( 4423 ); - Date expected( 7968, 4, 13 ); + Date d1(7956, 3, 4); + Date d2 = d1.addDays(4423); + Date expected(7968, 4, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_33001207_neg4423, Date) { - Date d1( 3300, 12, 7 ); - Date d2 = d1.addDays( -4423 ); - Date expected( 3288, 10, 27 ); + Date d1(3300, 12, 7); + Date d2 = d1.addDays(-4423); + Date expected(3288, 10, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_92370107_4624, Date) { - Date d1( 9237, 1, 7 ); - Date d2 = d1.addDays( 4624 ); - Date expected( 9249, 9, 5 ); + Date d1(9237, 1, 7); + Date d2 = d1.addDays(4624); + Date expected(9249, 9, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_63621220_neg4624, Date) { - Date d1( 6362, 12, 20 ); - Date d2 = d1.addDays( -4624 ); - Date expected( 6350, 4, 23 ); + Date d1(6362, 12, 20); + Date d2 = d1.addDays(-4624); + Date expected(6350, 4, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_88061021_4825, Date) { - Date d1( 8806, 10, 21 ); - Date d2 = d1.addDays( 4825 ); - Date expected( 8820, 1, 6 ); + Date d1(8806, 10, 21); + Date d2 = d1.addDays(4825); + Date expected(8820, 1, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_25540829_neg4825, Date) { - Date d1( 2554, 8, 29 ); - Date d2 = d1.addDays( -4825 ); - Date expected( 2541, 6, 13 ); + Date d1(2554, 8, 29); + Date d2 = d1.addDays(-4825); + Date expected(2541, 6, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82171223_5026, Date) { - Date d1( 8217, 12, 23 ); - Date d2 = d1.addDays( 5026 ); - Date expected( 8231, 9, 27 ); + Date d1(8217, 12, 23); + Date d2 = d1.addDays(5026); + Date expected(8231, 9, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_78110702_neg5026, Date) { - Date d1( 7811, 7, 2 ); - Date d2 = d1.addDays( -5026 ); - Date expected( 7797, 9, 26 ); + Date d1(7811, 7, 2); + Date d2 = d1.addDays(-5026); + Date expected(7797, 9, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_83940516_5227, Date) { - Date d1( 8394, 5, 16 ); - Date d2 = d1.addDays( 5227 ); - Date expected( 8408, 9, 6 ); + Date d1(8394, 5, 16); + Date d2 = d1.addDays(5227); + Date expected(8408, 9, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_90491114_neg5227, Date) { - Date d1( 9049, 11, 14 ); - Date d2 = d1.addDays( -5227 ); - Date expected( 9035, 7, 24 ); + Date d1(9049, 11, 14); + Date d2 = d1.addDays(-5227); + Date expected(9035, 7, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_71710506_5428, Date) { - Date d1( 7171, 5, 6 ); - Date d2 = d1.addDays( 5428 ); - Date expected( 7186, 3, 16 ); + Date d1(7171, 5, 6); + Date d2 = d1.addDays(5428); + Date expected(7186, 3, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_50640624_neg5428, Date) { - Date d1( 5064, 6, 24 ); - Date d2 = d1.addDays( -5428 ); - Date expected( 5049, 8, 14 ); + Date d1(5064, 6, 24); + Date d2 = d1.addDays(-5428); + Date expected(5049, 8, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_95540206_5629, Date) { - Date d1( 9554, 2, 6 ); - Date d2 = d1.addDays( 5629 ); - Date expected( 9569, 7, 6 ); + Date d1(9554, 2, 6); + Date d2 = d1.addDays(5629); + Date expected(9569, 7, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_49350910_neg5629, Date) { - Date d1( 4935, 9, 10 ); - Date d2 = d1.addDays( -5629 ); - Date expected( 4920, 4, 12 ); + Date d1(4935, 9, 10); + Date d2 = d1.addDays(-5629); + Date expected(4920, 4, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27280215_5830, Date) { - Date d1( 2728, 2, 15 ); - Date d2 = d1.addDays( 5830 ); - Date expected( 2744, 2, 1 ); + Date d1(2728, 2, 15); + Date d2 = d1.addDays(5830); + Date expected(2744, 2, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_52470915_neg5830, Date) { - Date d1( 5247, 9, 15 ); - Date d2 = d1.addDays( -5830 ); - Date expected( 5231, 9, 29 ); + Date d1(5247, 9, 15); + Date d2 = d1.addDays(-5830); + Date expected(5231, 9, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_31160607_6031, Date) { - Date d1( 3116, 6, 7 ); - Date d2 = d1.addDays( 6031 ); - Date expected( 3132, 12, 11 ); + Date d1(3116, 6, 7); + Date d2 = d1.addDays(6031); + Date expected(3132, 12, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_78021007_neg6031, Date) { - Date d1( 7802, 10, 7 ); - Date d2 = d1.addDays( -6031 ); - Date expected( 7786, 4, 2 ); + Date d1(7802, 10, 7); + Date d2 = d1.addDays(-6031); + Date expected(7786, 4, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_91320816_6232, Date) { - Date d1( 9132, 8, 16 ); - Date d2 = d1.addDays( 6232 ); - Date expected( 9149, 9, 8 ); + Date d1(9132, 8, 16); + Date d2 = d1.addDays(6232); + Date expected(9149, 9, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_67240610_neg6232, Date) { - Date d1( 6724, 6, 10 ); - Date d2 = d1.addDays( -6232 ); - Date expected( 6707, 5, 19 ); + Date d1(6724, 6, 10); + Date d2 = d1.addDays(-6232); + Date expected(6707, 5, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_92511204_6433, Date) { - Date d1( 9251, 12, 4 ); - Date d2 = d1.addDays( 6433 ); - Date expected( 9269, 7, 15 ); + Date d1(9251, 12, 4); + Date d2 = d1.addDays(6433); + Date expected(9269, 7, 15); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_22480312_neg6433, Date) { - Date d1( 2248, 3, 12 ); - Date d2 = d1.addDays( -6433 ); - Date expected( 2230, 8, 1 ); + Date d1(2248, 3, 12); + Date d2 = d1.addDays(-6433); + Date expected(2230, 8, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_88251003_6634, Date) { - Date d1( 8825, 10, 3 ); - Date d2 = d1.addDays( 6634 ); - Date expected( 8843, 12, 2 ); + Date d1(8825, 10, 3); + Date d2 = d1.addDays(6634); + Date expected(8843, 12, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97690525_neg6634, Date) { - Date d1( 9769, 5, 25 ); - Date d2 = d1.addDays( -6634 ); - Date expected( 9751, 3, 27 ); + Date d1(9769, 5, 25); + Date d2 = d1.addDays(-6634); + Date expected(9751, 3, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_57810712_6835, Date) { - Date d1( 5781, 7, 12 ); - Date d2 = d1.addDays( 6835 ); - Date expected( 5800, 3, 30 ); + Date d1(5781, 7, 12); + Date d2 = d1.addDays(6835); + Date expected(5800, 3, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_64660306_neg6835, Date) { - Date d1( 6466, 3, 6 ); - Date d2 = d1.addDays( -6835 ); - Date expected( 6447, 6, 19 ); + Date d1(6466, 3, 6); + Date d2 = d1.addDays(-6835); + Date expected(6447, 6, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_35030711_7036, Date) { - Date d1( 3503, 7, 11 ); - Date d2 = d1.addDays( 7036 ); - Date expected( 3522, 10, 15 ); + Date d1(3503, 7, 11); + Date d2 = d1.addDays(7036); + Date expected(3522, 10, 15); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_85800519_neg7036, Date) { - Date d1( 8580, 5, 19 ); - Date d2 = d1.addDays( -7036 ); - Date expected( 8561, 2, 12 ); + Date d1(8580, 5, 19); + Date d2 = d1.addDays(-7036); + Date expected(8561, 2, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_67840417_7237, Date) { - Date d1( 6784, 4, 17 ); - Date d2 = d1.addDays( 7237 ); - Date expected( 6804, 2, 9 ); + Date d1(6784, 4, 17); + Date d2 = d1.addDays(7237); + Date expected(6804, 2, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_35580825_neg7237, Date) { - Date d1( 3558, 8, 25 ); - Date d2 = d1.addDays( -7237 ); - Date expected( 3538, 11, 1 ); + Date d1(3558, 8, 25); + Date d2 = d1.addDays(-7237); + Date expected(3538, 11, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_73170216_7438, Date) { - Date d1( 7317, 2, 16 ); - Date d2 = d1.addDays( 7438 ); - Date expected( 7337, 6, 29 ); + Date d1(7317, 2, 16); + Date d2 = d1.addDays(7438); + Date expected(7337, 6, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_49171212_neg7438, Date) { - Date d1( 4917, 12, 12 ); - Date d2 = d1.addDays( -7438 ); - Date expected( 4897, 7, 31 ); + Date d1(4917, 12, 12); + Date d2 = d1.addDays(-7438); + Date expected(4897, 7, 31); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_28820604_7639, Date) { - Date d1( 2882, 6, 4 ); - Date d2 = d1.addDays( 7639 ); - Date expected( 2903, 5, 5 ); + Date d1(2882, 6, 4); + Date d2 = d1.addDays(7639); + Date expected(2903, 5, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82230404_neg7639, Date) { - Date d1( 8223, 4, 4 ); - Date d2 = d1.addDays( -7639 ); - Date expected( 8202, 5, 5 ); + Date d1(8223, 4, 4); + Date d2 = d1.addDays(-7639); + Date expected(8202, 5, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_22380421_7840, Date) { - Date d1( 2238, 4, 21 ); - Date d2 = d1.addDays( 7840 ); - Date expected( 2259, 10, 8 ); + Date d1(2238, 4, 21); + Date d2 = d1.addDays(7840); + Date expected(2259, 10, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_24001029_neg7840, Date) { - Date d1( 2400, 10, 29 ); - Date d2 = d1.addDays( -7840 ); - Date expected( 2379, 5, 13 ); + Date d1(2400, 10, 29); + Date d2 = d1.addDays(-7840); + Date expected(2379, 5, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_88450530_8041, Date) { - Date d1( 8845, 5, 30 ); - Date d2 = d1.addDays( 8041 ); - Date expected( 8867, 6, 5 ); + Date d1(8845, 5, 30); + Date d2 = d1.addDays(8041); + Date expected(8867, 6, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_26980212_neg8041, Date) { - Date d1( 2698, 2, 12 ); - Date d2 = d1.addDays( -8041 ); - Date expected( 2676, 2, 7 ); + Date d1(2698, 2, 12); + Date d2 = d1.addDays(-8041); + Date expected(2676, 2, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_88350419_8242, Date) { - Date d1( 8835, 4, 19 ); - Date d2 = d1.addDays( 8242 ); - Date expected( 8857, 11, 11 ); + Date d1(8835, 4, 19); + Date d2 = d1.addDays(8242); + Date expected(8857, 11, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_57940927_neg8242, Date) { - Date d1( 5794, 9, 27 ); - Date d2 = d1.addDays( -8242 ); - Date expected( 5772, 3, 4 ); + Date d1(5794, 9, 27); + Date d2 = d1.addDays(-8242); + Date expected(5772, 3, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_72510307_8443, Date) { - Date d1( 7251, 3, 7 ); - Date d2 = d1.addDays( 8443 ); - Date expected( 7274, 4, 18 ); + Date d1(7251, 3, 7); + Date d2 = d1.addDays(8443); + Date expected(7274, 4, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_70040908_neg8443, Date) { - Date d1( 7004, 9, 8 ); - Date d2 = d1.addDays( -8443 ); - Date expected( 6981, 7, 27 ); + Date d1(7004, 9, 8); + Date d2 = d1.addDays(-8443); + Date expected(6981, 7, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32921124_8644, Date) { - Date d1( 3292, 11, 24 ); - Date d2 = d1.addDays( 8644 ); - Date expected( 3316, 7, 26 ); + Date d1(3292, 11, 24); + Date d2 = d1.addDays(8644); + Date expected(3316, 7, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96450729_neg8644, Date) { - Date d1( 9645, 7, 29 ); - Date d2 = d1.addDays( -8644 ); - Date expected( 9621, 11, 28 ); + Date d1(9645, 7, 29); + Date d2 = d1.addDays(-8644); + Date expected(9621, 11, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_35820127_8845, Date) { - Date d1( 3582, 1, 27 ); - Date d2 = d1.addDays( 8845 ); - Date expected( 3606, 4, 16 ); + Date d1(3582, 1, 27); + Date d2 = d1.addDays(8845); + Date expected(3606, 4, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_49810408_neg8845, Date) { - Date d1( 4981, 4, 8 ); - Date d2 = d1.addDays( -8845 ); - Date expected( 4957, 1, 19 ); + Date d1(4981, 4, 8); + Date d2 = d1.addDays(-8845); + Date expected(4957, 1, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_29310523_9046, Date) { - Date d1( 2931, 5, 23 ); - Date d2 = d1.addDays( 9046 ); - Date expected( 2956, 2, 27 ); + Date d1(2931, 5, 23); + Date d2 = d1.addDays(9046); + Date expected(2956, 2, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_52750613_neg9046, Date) { - Date d1( 5275, 6, 13 ); - Date d2 = d1.addDays( -9046 ); - Date expected( 5250, 9, 6 ); + Date d1(5275, 6, 13); + Date d2 = d1.addDays(-9046); + Date expected(5250, 9, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_23641104_9247, Date) { - Date d1( 2364, 11, 4 ); - Date d2 = d1.addDays( 9247 ); - Date expected( 2390, 2, 28 ); + Date d1(2364, 11, 4); + Date d2 = d1.addDays(9247); + Date expected(2390, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_73290524_neg9247, Date) { - Date d1( 7329, 5, 24 ); - Date d2 = d1.addDays( -9247 ); - Date expected( 7304, 1, 29 ); + Date d1(7329, 5, 24); + Date d2 = d1.addDays(-9247); + Date expected(7304, 1, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_46100618_9448, Date) { - Date d1( 4610, 6, 18 ); - Date d2 = d1.addDays( 9448 ); - Date expected( 4636, 4, 30 ); + Date d1(4610, 6, 18); + Date d2 = d1.addDays(9448); + Date expected(4636, 4, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27500102_neg9448, Date) { - Date d1( 2750, 1, 2 ); - Date d2 = d1.addDays( -9448 ); - Date expected( 2724, 2, 20 ); + Date d1(2750, 1, 2); + Date d2 = d1.addDays(-9448); + Date expected(2724, 2, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_71510822_9649, Date) { - Date d1( 7151, 8, 22 ); - Date d2 = d1.addDays( 9649 ); - Date expected( 7178, 1, 21 ); + Date d1(7151, 8, 22); + Date d2 = d1.addDays(9649); + Date expected(7178, 1, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_72910322_neg9649, Date) { - Date d1( 7291, 3, 22 ); - Date d2 = d1.addDays( -9649 ); - Date expected( 7264, 10, 20 ); + Date d1(7291, 3, 22); + Date d2 = d1.addDays(-9649); + Date expected(7264, 10, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21310323_9850, Date) { - Date d1( 2131, 3, 23 ); - Date d2 = d1.addDays( 9850 ); - Date expected( 2158, 3, 11 ); + Date d1(2131, 3, 23); + Date d2 = d1.addDays(9850); + Date expected(2158, 3, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66160518_neg9850, Date) { - Date d1( 6616, 5, 18 ); - Date d2 = d1.addDays( -9850 ); - Date expected( 6589, 5, 29 ); + Date d1(6616, 5, 18); + Date d2 = d1.addDays(-9850); + Date expected(6589, 5, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } TEST(add_month_20140606_P00002, Date) { - Date d1( 2014, 6, 6 ); - Date d2 = d1.addMonths( 2 ); - Date expected( 2014, 8, 6 ); + Date d1(2014, 6, 6); + Date d2 = d1.addMonths(2); + Date expected(2014, 8, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + /* landing on the leap day */ TEST(add_day_93160130_1, Date) { - Date d1( 9316, 1, 30 ); - Date d2 = d1.addMonths( 1 ); - Date expected( 9316, 2, 29 ); + Date d1(9316, 1, 30); + Date d2 = d1.addMonths(1); + Date expected(9316, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_48960330_neg1, Date) { - Date d1( 4896, 3, 30 ); - Date d2 = d1.addMonths( -1 ); - Date expected( 4896, 2, 29 ); + Date d1(4896, 3, 30); + Date d2 = d1.addMonths(-1); + Date expected(4896, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_28191231_2, Date) { - Date d1( 2819, 12, 31 ); - Date d2 = d1.addMonths( 2 ); - Date expected( 2820, 2, 29 ); + Date d1(2819, 12, 31); + Date d2 = d1.addMonths(2); + Date expected(2820, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_84160429_neg2, Date) { - Date d1( 8416, 4, 29 ); - Date d2 = d1.addMonths( -2 ); - Date expected( 8416, 2, 29 ); + Date d1(8416, 4, 29); + Date d2 = d1.addMonths(-2); + Date expected(8416, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_55031129_3, Date) { - - Date d1( 5503, 11, 29 ); - Date d2 = d1.addMonths( 3 ); - Date expected( 5504, 2, 29 ); + + Date d1(5503, 11, 29); + Date d2 = d1.addMonths(3); + Date expected(5504, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_68040530_neg3, Date) { - Date d1( 6804, 5, 30 ); - Date d2 = d1.addMonths( -3 ); - Date expected( 6804, 2, 29 ); + Date d1(6804, 5, 30); + Date d2 = d1.addMonths(-3); + Date expected(6804, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_50351031_4, Date) { - Date d1( 5035, 10, 31 ); - Date d2 = d1.addMonths( 4 ); - Date expected( 5036, 2, 29 ); + Date d1(5035, 10, 31); + Date d2 = d1.addMonths(4); + Date expected(5036, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_95160630_neg4, Date) { - Date d1( 9516, 6, 30 ); - Date d2 = d1.addMonths( -4 ); - Date expected( 9516, 2, 29 ); + Date d1(9516, 6, 30); + Date d2 = d1.addMonths(-4); + Date expected(9516, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_95590930_5, Date) { - Date d1( 9559, 9, 30 ); - Date d2 = d1.addMonths( 5 ); - Date expected( 9560, 2, 29 ); + Date d1(9559, 9, 30); + Date d2 = d1.addMonths(5); + Date expected(9560, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_73280731_neg5, Date) { - Date d1( 7328, 7, 31 ); - Date d2 = d1.addMonths( -5 ); - Date expected( 7328, 2, 29 ); + Date d1(7328, 7, 31); + Date d2 = d1.addMonths(-5); + Date expected(7328, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_56030830_6, Date) { - Date d1( 5603, 8, 30 ); - Date d2 = d1.addMonths( 6 ); - Date expected( 5604, 2, 29 ); + Date d1(5603, 8, 30); + Date d2 = d1.addMonths(6); + Date expected(5604, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_49920830_neg6, Date) { - Date d1( 4992, 8, 30 ); - Date d2 = d1.addMonths( -6 ); - Date expected( 4992, 2, 29 ); + Date d1(4992, 8, 30); + Date d2 = d1.addMonths(-6); + Date expected(4992, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_76390730_7, Date) { - Date d1( 7639, 7, 30 ); - Date d2 = d1.addMonths( 7 ); - Date expected( 7640, 2, 29 ); + Date d1(7639, 7, 30); + Date d2 = d1.addMonths(7); + Date expected(7640, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_95440930_neg7, Date) { - Date d1( 9544, 9, 30 ); - Date d2 = d1.addMonths( -7 ); - Date expected( 9544, 2, 29 ); + Date d1(9544, 9, 30); + Date d2 = d1.addMonths(-7); + Date expected(9544, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_61630630_8, Date) { - Date d1( 6163, 6, 30 ); - Date d2 = d1.addMonths( 8 ); - Date expected( 6164, 2, 29 ); + Date d1(6163, 6, 30); + Date d2 = d1.addMonths(8); + Date expected(6164, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97321029_neg8, Date) { - Date d1( 9732, 10, 29 ); - Date d2 = d1.addMonths( -8 ); - Date expected( 9732, 2, 29 ); + Date d1(9732, 10, 29); + Date d2 = d1.addMonths(-8); + Date expected(9732, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_42430530_9, Date) { - Date d1( 4243, 5, 30 ); - Date d2 = d1.addMonths( 9 ); - Date expected( 4244, 2, 29 ); + Date d1(4243, 5, 30); + Date d2 = d1.addMonths(9); + Date expected(4244, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_50361129_neg9, Date) { - Date d1( 5036, 11, 29 ); - Date d2 = d1.addMonths( -9 ); - Date expected( 5036, 2, 29 ); + Date d1(5036, 11, 29); + Date d2 = d1.addMonths(-9); + Date expected(5036, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32590430_10, Date) { - Date d1( 3259, 4, 30 ); - Date d2 = d1.addMonths( 10 ); - Date expected( 3260, 2, 29 ); + Date d1(3259, 4, 30); + Date d2 = d1.addMonths(10); + Date expected(3260, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40841231_neg10, Date) { - Date d1( 4084, 12, 31 ); - Date d2 = d1.addMonths( -10 ); - Date expected( 4084, 2, 29 ); + Date d1(4084, 12, 31); + Date d2 = d1.addMonths(-10); + Date expected(4084, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32630331_11, Date) { - Date d1( 3263, 3, 31 ); - Date d2 = d1.addMonths( 11 ); - Date expected( 3264, 2, 29 ); + Date d1(3263, 3, 31); + Date d2 = d1.addMonths(11); + Date expected(3264, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_63530129_neg11, Date) { - Date d1( 6353, 1, 29 ); - Date d2 = d1.addMonths( -11 ); - Date expected( 6352, 2, 29 ); + Date d1(6353, 1, 29); + Date d2 = d1.addMonths(-11); + Date expected(6352, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_24470131_13, Date) { - Date d1( 2447, 1, 31 ); - Date d2 = d1.addMonths( 13 ); - Date expected( 2448, 2, 29 ); + Date d1(2447, 1, 31); + Date d2 = d1.addMonths(13); + Date expected(2448, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_37610330_neg13, Date) { - Date d1( 3761, 3, 30 ); - Date d2 = d1.addMonths( -13 ); - Date expected( 3760, 2, 29 ); + Date d1(3761, 3, 30); + Date d2 = d1.addMonths(-13); + Date expected(3760, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + /* landing on Feb 28 NOT in a leap year */ TEST(add_day_47490129_1, Date) { - Date d1( 4749, 1, 29 ); - Date d2 = d1.addMonths( 1 ); - Date expected( 4749, 2, 28 ); + Date d1(4749, 1, 29); + Date d2 = d1.addMonths(1); + Date expected(4749, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_79210331_neg1, Date) { - Date d1( 7921, 3, 31 ); - Date d2 = d1.addMonths( -1 ); - Date expected( 7921, 2, 28 ); + Date d1(7921, 3, 31); + Date d2 = d1.addMonths(-1); + Date expected(7921, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_99531230_2, Date) { - Date d1( 9953, 12, 30 ); - Date d2 = d1.addMonths( 2 ); - Date expected( 9954, 2, 28 ); + Date d1(9953, 12, 30); + Date d2 = d1.addMonths(2); + Date expected(9954, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27980430_neg2, Date) { - Date d1( 2798, 4, 30 ); - Date d2 = d1.addMonths( -2 ); - Date expected( 2798, 2, 28 ); + Date d1(2798, 4, 30); + Date d2 = d1.addMonths(-2); + Date expected(2798, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_50981130_3, Date) { - Date d1( 5098, 11, 30 ); - Date d2 = d1.addMonths( 3 ); - Date expected( 5099, 2, 28 ); + Date d1(5098, 11, 30); + Date d2 = d1.addMonths(3); + Date expected(5099, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_51620529_neg3, Date) { - Date d1( 5162, 5, 29 ); - Date d2 = d1.addMonths( -3 ); - Date expected( 5162, 2, 28 ); + Date d1(5162, 5, 29); + Date d2 = d1.addMonths(-3); + Date expected(5162, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_61331030_4, Date) { - Date d1( 6133, 10, 30 ); - Date d2 = d1.addMonths( 4 ); - Date expected( 6134, 2, 28 ); + Date d1(6133, 10, 30); + Date d2 = d1.addMonths(4); + Date expected(6134, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_81370630_neg4, Date) { - Date d1( 8137, 6, 30 ); - Date d2 = d1.addMonths( -4 ); - Date expected( 8137, 2, 28 ); + Date d1(8137, 6, 30); + Date d2 = d1.addMonths(-4); + Date expected(8137, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_69100930_5, Date) { - Date d1( 6910, 9, 30 ); - Date d2 = d1.addMonths( 5 ); - Date expected( 6911, 2, 28 ); + Date d1(6910, 9, 30); + Date d2 = d1.addMonths(5); + Date expected(6911, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_87230731_neg5, Date) { - Date d1( 8723, 7, 31 ); - Date d2 = d1.addMonths( -5 ); - Date expected( 8723, 2, 28 ); + Date d1(8723, 7, 31); + Date d2 = d1.addMonths(-5); + Date expected(8723, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_80060830_6, Date) { - Date d1( 8006, 8, 30 ); - Date d2 = d1.addMonths( 6 ); - Date expected( 8007, 2, 28 ); + Date d1(8006, 8, 30); + Date d2 = d1.addMonths(6); + Date expected(8007, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_56890829_neg6, Date) { - Date d1( 5689, 8, 29 ); - Date d2 = d1.addMonths( -6 ); - Date expected( 5689, 2, 28 ); + Date d1(5689, 8, 29); + Date d2 = d1.addMonths(-6); + Date expected(5689, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_61440731_7, Date) { - Date d1( 6144, 7, 31 ); - Date d2 = d1.addMonths( 7 ); - Date expected( 6145, 2, 28 ); + Date d1(6144, 7, 31); + Date d2 = d1.addMonths(7); + Date expected(6145, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_48270929_neg7, Date) { - Date d1( 4827, 9, 29 ); - Date d2 = d1.addMonths( -7 ); - Date expected( 4827, 2, 28 ); + Date d1(4827, 9, 29); + Date d2 = d1.addMonths(-7); + Date expected(4827, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_56960630_8, Date) { - Date d1( 5696, 6, 30 ); - Date d2 = d1.addMonths( 8 ); - Date expected( 5697, 2, 28 ); + Date d1(5696, 6, 30); + Date d2 = d1.addMonths(8); + Date expected(5697, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_51971031_neg8, Date) { - Date d1( 5197, 10, 31 ); - Date d2 = d1.addMonths( -8 ); - Date expected( 5197, 2, 28 ); + Date d1(5197, 10, 31); + Date d2 = d1.addMonths(-8); + Date expected(5197, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_31780531_9, Date) { - Date d1( 3178, 5, 31 ); - Date d2 = d1.addMonths( 9 ); - Date expected( 3179, 2, 28 ); + Date d1(3178, 5, 31); + Date d2 = d1.addMonths(9); + Date expected(3179, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_30511129_neg9, Date) { - Date d1( 3051, 11, 29 ); - Date d2 = d1.addMonths( -9 ); - Date expected( 3051, 2, 28 ); + Date d1(3051, 11, 29); + Date d2 = d1.addMonths(-9); + Date expected(3051, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_35890429_10, Date) { - Date d1( 3589, 4, 29 ); - Date d2 = d1.addMonths( 10 ); - Date expected( 3590, 2, 28 ); + Date d1(3589, 4, 29); + Date d2 = d1.addMonths(10); + Date expected(3590, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_29781230_neg10, Date) { - Date d1( 2978, 12, 30 ); - Date d2 = d1.addMonths( -10 ); - Date expected( 2978, 2, 28 ); + Date d1(2978, 12, 30); + Date d2 = d1.addMonths(-10); + Date expected(2978, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_49560330_11, Date) { - Date d1( 4956, 3, 30 ); - Date d2 = d1.addMonths( 11 ); - Date expected( 4957, 2, 28 ); + Date d1(4956, 3, 30); + Date d2 = d1.addMonths(11); + Date expected(4957, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_74540130_neg11, Date) { - Date d1( 7454, 1, 30 ); - Date d2 = d1.addMonths( -11 ); - Date expected( 7453, 2, 28 ); + Date d1(7454, 1, 30); + Date d2 = d1.addMonths(-11); + Date expected(7453, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_81640229_12, Date) { - Date d1( 8164, 2, 29 ); - Date d2 = d1.addMonths( 12 ); - Date expected( 8165, 2, 28 ); + Date d1(8164, 2, 29); + Date d2 = d1.addMonths(12); + Date expected(8165, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_85200229_neg12, Date) { - Date d1( 8520, 2, 29 ); - Date d2 = d1.addMonths( -12 ); - Date expected( 8519, 2, 28 ); + Date d1(8520, 2, 29); + Date d2 = d1.addMonths(-12); + Date expected(8519, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_67840129_13, Date) { - Date d1( 6784, 1, 29 ); - Date d2 = d1.addMonths( 13 ); - Date expected( 6785, 2, 28 ); + Date d1(6784, 1, 29); + Date d2 = d1.addMonths(13); + Date expected(6785, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66960331_neg13, Date) { - Date d1( 6696, 3, 31 ); - Date d2 = d1.addMonths( -13 ); - Date expected( 6695, 2, 28 ); + Date d1(6696, 3, 31); + Date d2 = d1.addMonths(-13); + Date expected(6695, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } /* from the 31st into a month with < 31 days */ TEST(add_day_20360831_1, Date) { - Date d1( 2036, 8, 31 ); - Date d2 = d1.addMonths( 1 ); - Date expected( 2036, 9, 30 ); + Date d1(2036, 8, 31); + Date d2 = d1.addMonths(1); + Date expected(2036, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21080531_neg1, Date) { - Date d1( 2108, 5, 31 ); - Date d2 = d1.addMonths( -1 ); - Date expected( 2108, 4, 30 ); + Date d1(2108, 5, 31); + Date d2 = d1.addMonths(-1); + Date expected(2108, 4, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20830731_2, Date) { - Date d1( 2083, 7, 31 ); - Date d2 = d1.addMonths( 2 ); - Date expected( 2083, 9, 30 ); + Date d1(2083, 7, 31); + Date d2 = d1.addMonths(2); + Date expected(2083, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21620831_neg2, Date) { - Date d1( 2162, 8, 31 ); - Date d2 = d1.addMonths( -2 ); - Date expected( 2162, 6, 30 ); + Date d1(2162, 8, 31); + Date d2 = d1.addMonths(-2); + Date expected(2162, 6, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20130831_3, Date) { - Date d1( 2013, 8, 31 ); - Date d2 = d1.addMonths( 3 ); - Date expected( 2013, 11, 30 ); + Date d1(2013, 8, 31); + Date d2 = d1.addMonths(3); + Date expected(2013, 11, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20401231_neg3, Date) { - Date d1( 2040, 12, 31 ); - Date d2 = d1.addMonths( -3 ); - Date expected( 2040, 9, 30 ); + Date d1(2040, 12, 31); + Date d2 = d1.addMonths(-3); + Date expected(2040, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21510731_4, Date) { - Date d1( 2151, 7, 31 ); - Date d2 = d1.addMonths( 4 ); - Date expected( 2151, 11, 30 ); + Date d1(2151, 7, 31); + Date d2 = d1.addMonths(4); + Date expected(2151, 11, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20300831_neg4, Date) { - Date d1( 2030, 8, 31 ); - Date d2 = d1.addMonths( -4 ); - Date expected( 2030, 4, 30 ); + Date d1(2030, 8, 31); + Date d2 = d1.addMonths(-4); + Date expected(2030, 4, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21140131_5, Date) { - Date d1( 2114, 1, 31 ); - Date d2 = d1.addMonths( 5 ); - Date expected( 2114, 6, 30 ); + Date d1(2114, 1, 31); + Date d2 = d1.addMonths(5); + Date expected(2114, 6, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21960731_neg5, Date) { - Date d1( 2196, 7, 31 ); - Date d2 = d1.addMonths( -5 ); - Date expected( 2196, 2, 29 ); + Date d1(2196, 7, 31); + Date d2 = d1.addMonths(-5); + Date expected(2196, 2, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21920831_6, Date) { - Date d1( 2192, 8, 31 ); - Date d2 = d1.addMonths( 6 ); - Date expected( 2193, 2, 28 ); + Date d1(2192, 8, 31); + Date d2 = d1.addMonths(6); + Date expected(2193, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20070331_neg6, Date) { - Date d1( 2007, 3, 31 ); - Date d2 = d1.addMonths( -6 ); - Date expected( 2006, 9, 30 ); + Date d1(2007, 3, 31); + Date d2 = d1.addMonths(-6); + Date expected(2006, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21600731_7, Date) { - Date d1( 2160, 7, 31 ); - Date d2 = d1.addMonths( 7 ); - Date expected( 2161, 2, 28 ); + Date d1(2160, 7, 31); + Date d2 = d1.addMonths(7); + Date expected(2161, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21900131_neg7, Date) { - Date d1( 2190, 1, 31 ); - Date d2 = d1.addMonths( -7 ); - Date expected( 2189, 6, 30 ); + Date d1(2190, 1, 31); + Date d2 = d1.addMonths(-7); + Date expected(2189, 6, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21981031_8, Date) { - Date d1( 2198, 10, 31 ); - Date d2 = d1.addMonths( 8 ); - Date expected( 2199, 6, 30 ); + Date d1(2198, 10, 31); + Date d2 = d1.addMonths(8); + Date expected(2199, 6, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20501231_neg8, Date) { - Date d1( 2050, 12, 31 ); - Date d2 = d1.addMonths( -8 ); - Date expected( 2050, 4, 30 ); + Date d1(2050, 12, 31); + Date d2 = d1.addMonths(-8); + Date expected(2050, 4, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21741231_9, Date) { - Date d1( 2174, 12, 31 ); - Date d2 = d1.addMonths( 9 ); - Date expected( 2175, 9, 30 ); + Date d1(2174, 12, 31); + Date d2 = d1.addMonths(9); + Date expected(2175, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20050831_neg9, Date) { - Date d1( 2005, 8, 31 ); - Date d2 = d1.addMonths( -9 ); - Date expected( 2004, 11, 30 ); + Date d1(2005, 8, 31); + Date d2 = d1.addMonths(-9); + Date expected(2004, 11, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20640831_10, Date) { - Date d1( 2064, 8, 31 ); - Date d2 = d1.addMonths( 10 ); - Date expected( 2065, 6, 30 ); + Date d1(2064, 8, 31); + Date d2 = d1.addMonths(10); + Date expected(2065, 6, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20620731_neg10, Date) { - Date d1( 2062, 7, 31 ); - Date d2 = d1.addMonths( -10 ); - Date expected( 2061, 9, 30 ); + Date d1(2062, 7, 31); + Date d2 = d1.addMonths(-10); + Date expected(2061, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20070531_11, Date) { - Date d1( 2007, 5, 31 ); - Date d2 = d1.addMonths( 11 ); - Date expected( 2008, 4, 30 ); + Date d1(2007, 5, 31); + Date d2 = d1.addMonths(11); + Date expected(2008, 4, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20150831_neg11, Date) { - Date d1( 2015, 8, 31 ); - Date d2 = d1.addMonths( -11 ); - Date expected( 2014, 9, 30 ); + Date d1(2015, 8, 31); + Date d2 = d1.addMonths(-11); + Date expected(2014, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20140831_13, Date) { - Date d1( 2014, 8, 31 ); - Date d2 = d1.addMonths( 13 ); - Date expected( 2015, 9, 30 ); + Date d1(2014, 8, 31); + Date d2 = d1.addMonths(13); + Date expected(2015, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20950331_neg13, Date) { - Date d1( 2095, 3, 31 ); - Date d2 = d1.addMonths( -13 ); - Date expected( 2094, 2, 28 ); + Date d1(2095, 3, 31); + Date d2 = d1.addMonths(-13); + Date expected(2094, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } /* random between 1700 and 2200 */ TEST(add_day_31400721_1, Date) { - Date d1( 3140, 7, 21 ); - Date d2 = d1.addMonths( 1 ); - Date expected( 3140, 8, 21 ); + Date d1(3140, 7, 21); + Date d2 = d1.addMonths(1); + Date expected(3140, 8, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_41951212_neg1, Date) { - Date d1( 4195, 12, 12 ); - Date d2 = d1.addMonths( -1 ); - Date expected( 4195, 11, 12 ); + Date d1(4195, 12, 12); + Date d2 = d1.addMonths(-1); + Date expected(4195, 11, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_61480628_2, Date) { - Date d1( 6148, 6, 28 ); - Date d2 = d1.addMonths( 2 ); - Date expected( 6148, 8, 28 ); + Date d1(6148, 6, 28); + Date d2 = d1.addMonths(2); + Date expected(6148, 8, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_26000923_neg2, Date) { - Date d1( 2600, 9, 23 ); - Date d2 = d1.addMonths( -2 ); - Date expected( 2600, 7, 23 ); + Date d1(2600, 9, 23); + Date d2 = d1.addMonths(-2); + Date expected(2600, 7, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_53271203_3, Date) { - Date d1( 5327, 12, 3 ); - Date d2 = d1.addMonths( 3 ); - Date expected( 5328, 3, 3 ); + Date d1(5327, 12, 3); + Date d2 = d1.addMonths(3); + Date expected(5328, 3, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_23550908_neg3, Date) { - Date d1( 2355, 9, 8 ); - Date d2 = d1.addMonths( -3 ); - Date expected( 2355, 6, 8 ); + Date d1(2355, 9, 8); + Date d2 = d1.addMonths(-3); + Date expected(2355, 6, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_35850508_4, Date) { - Date d1( 3585, 5, 8 ); - Date d2 = d1.addMonths( 4 ); - Date expected( 3585, 9, 8 ); + Date d1(3585, 5, 8); + Date d2 = d1.addMonths(4); + Date expected(3585, 9, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20391113_neg4, Date) { - Date d1( 2039, 11, 13 ); - Date d2 = d1.addMonths( -4 ); - Date expected( 2039, 7, 13 ); + Date d1(2039, 11, 13); + Date d2 = d1.addMonths(-4); + Date expected(2039, 7, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_93571112_5, Date) { - Date d1( 9357, 11, 12 ); - Date d2 = d1.addMonths( 5 ); - Date expected( 9358, 4, 12 ); + Date d1(9357, 11, 12); + Date d2 = d1.addMonths(5); + Date expected(9358, 4, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_87980806_neg5, Date) { - Date d1( 8798, 8, 6 ); - Date d2 = d1.addMonths( -5 ); - Date expected( 8798, 3, 6 ); + Date d1(8798, 8, 6); + Date d2 = d1.addMonths(-5); + Date expected(8798, 3, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_69980423_6, Date) { - Date d1( 6998, 4, 23 ); - Date d2 = d1.addMonths( 6 ); - Date expected( 6998, 10, 23 ); + Date d1(6998, 4, 23); + Date d2 = d1.addMonths(6); + Date expected(6998, 10, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_87650109_neg6, Date) { - Date d1( 8765, 1, 9 ); - Date d2 = d1.addMonths( -6 ); - Date expected( 8764, 7, 9 ); + Date d1(8765, 1, 9); + Date d2 = d1.addMonths(-6); + Date expected(8764, 7, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_70660627_7, Date) { - Date d1( 7066, 6, 27 ); - Date d2 = d1.addMonths( 7 ); - Date expected( 7067, 1, 27 ); + Date d1(7066, 6, 27); + Date d2 = d1.addMonths(7); + Date expected(7067, 1, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_20870820_neg7, Date) { - Date d1( 2087, 8, 20 ); - Date d2 = d1.addMonths( -7 ); - Date expected( 2087, 1, 20 ); + Date d1(2087, 8, 20); + Date d2 = d1.addMonths(-7); + Date expected(2087, 1, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_58070312_8, Date) { - Date d1( 5807, 3, 12 ); - Date d2 = d1.addMonths( 8 ); - Date expected( 5807, 11, 12 ); + Date d1(5807, 3, 12); + Date d2 = d1.addMonths(8); + Date expected(5807, 11, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_62590317_neg8, Date) { - Date d1( 6259, 3, 17 ); - Date d2 = d1.addMonths( -8 ); - Date expected( 6258, 7, 17 ); + Date d1(6259, 3, 17); + Date d2 = d1.addMonths(-8); + Date expected(6258, 7, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_78021120_9, Date) { - Date d1( 7802, 11, 20 ); - Date d2 = d1.addMonths( 9 ); - Date expected( 7803, 8, 20 ); + Date d1(7802, 11, 20); + Date d2 = d1.addMonths(9); + Date expected(7803, 8, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_39540213_neg9, Date) { - Date d1( 3954, 2, 13 ); - Date d2 = d1.addMonths( -9 ); - Date expected( 3953, 5, 13 ); + Date d1(3954, 2, 13); + Date d2 = d1.addMonths(-9); + Date expected(3953, 5, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66511106_10, Date) { - Date d1( 6651, 11, 6 ); - Date d2 = d1.addMonths( 10 ); - Date expected( 6652, 9, 6 ); + Date d1(6651, 11, 6); + Date d2 = d1.addMonths(10); + Date expected(6652, 9, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_45321208_neg10, Date) { - Date d1( 4532, 12, 8 ); - Date d2 = d1.addMonths( -10 ); - Date expected( 4532, 2, 8 ); + Date d1(4532, 12, 8); + Date d2 = d1.addMonths(-10); + Date expected(4532, 2, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_57930702_11, Date) { - Date d1( 5793, 7, 2 ); - Date d2 = d1.addMonths( 11 ); - Date expected( 5794, 6, 2 ); + Date d1(5793, 7, 2); + Date d2 = d1.addMonths(11); + Date expected(5794, 6, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_28231228_neg11, Date) { - Date d1( 2823, 12, 28 ); - Date d2 = d1.addMonths( -11 ); - Date expected( 2823, 1, 28 ); + Date d1(2823, 12, 28); + Date d2 = d1.addMonths(-11); + Date expected(2823, 1, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_73420117_12, Date) { - Date d1( 7342, 1, 17 ); - Date d2 = d1.addMonths( 12 ); - Date expected( 7343, 1, 17 ); + Date d1(7342, 1, 17); + Date d2 = d1.addMonths(12); + Date expected(7343, 1, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_75330606_neg12, Date) { - Date d1( 7533, 6, 6 ); - Date d2 = d1.addMonths( -12 ); - Date expected( 7532, 6, 6 ); + Date d1(7533, 6, 6); + Date d2 = d1.addMonths(-12); + Date expected(7532, 6, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_80900223_13, Date) { - Date d1( 8090, 2, 23 ); - Date d2 = d1.addMonths( 13 ); - Date expected( 8091, 3, 23 ); + Date d1(8090, 2, 23); + Date d2 = d1.addMonths(13); + Date expected(8091, 3, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_31370717_neg13, Date) { - Date d1( 3137, 7, 17 ); - Date d2 = d1.addMonths( -13 ); - Date expected( 3136, 6, 17 ); + Date d1(3137, 7, 17); + Date d2 = d1.addMonths(-13); + Date expected(3136, 6, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27430816_14, Date) { - Date d1( 2743, 8, 16 ); - Date d2 = d1.addMonths( 14 ); - Date expected( 2744, 10, 16 ); + Date d1(2743, 8, 16); + Date d2 = d1.addMonths(14); + Date expected(2744, 10, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60691011_neg14, Date) { - Date d1( 6069, 10, 11 ); - Date d2 = d1.addMonths( -14 ); - Date expected( 6068, 8, 11 ); + Date d1(6069, 10, 11); + Date d2 = d1.addMonths(-14); + Date expected(6068, 8, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66310424_15, Date) { - Date d1( 6631, 4, 24 ); - Date d2 = d1.addMonths( 15 ); - Date expected( 6632, 7, 24 ); + Date d1(6631, 4, 24); + Date d2 = d1.addMonths(15); + Date expected(6632, 7, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_45730222_neg15, Date) { - Date d1( 4573, 2, 22 ); - Date d2 = d1.addMonths( -15 ); - Date expected( 4571, 11, 22 ); + Date d1(4573, 2, 22); + Date d2 = d1.addMonths(-15); + Date expected(4571, 11, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_95850203_16, Date) { - Date d1( 9585, 2, 3 ); - Date d2 = d1.addMonths( 16 ); - Date expected( 9586, 6, 3 ); + Date d1(9585, 2, 3); + Date d2 = d1.addMonths(16); + Date expected(9586, 6, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_37610508_neg16, Date) { - Date d1( 3761, 5, 8 ); - Date d2 = d1.addMonths( -16 ); - Date expected( 3760, 1, 8 ); + Date d1(3761, 5, 8); + Date d2 = d1.addMonths(-16); + Date expected(3760, 1, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_22670711_17, Date) { - Date d1( 2267, 7, 11 ); - Date d2 = d1.addMonths( 17 ); - Date expected( 2268, 12, 11 ); + Date d1(2267, 7, 11); + Date d2 = d1.addMonths(17); + Date expected(2268, 12, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_84690410_neg17, Date) { - Date d1( 8469, 4, 10 ); - Date d2 = d1.addMonths( -17 ); - Date expected( 8467, 11, 10 ); + Date d1(8469, 4, 10); + Date d2 = d1.addMonths(-17); + Date expected(8467, 11, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_78771219_18, Date) { - Date d1( 7877, 12, 19 ); - Date d2 = d1.addMonths( 18 ); - Date expected( 7879, 6, 19 ); + Date d1(7877, 12, 19); + Date d2 = d1.addMonths(18); + Date expected(7879, 6, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_25100218_neg18, Date) { - Date d1( 2510, 2, 18 ); - Date d2 = d1.addMonths( -18 ); - Date expected( 2508, 8, 18 ); + Date d1(2510, 2, 18); + Date d2 = d1.addMonths(-18); + Date expected(2508, 8, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96190618_19, Date) { - Date d1( 9619, 6, 18 ); - Date d2 = d1.addMonths( 19 ); - Date expected( 9621, 1, 18 ); + Date d1(9619, 6, 18); + Date d2 = d1.addMonths(19); + Date expected(9621, 1, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_46531218_neg19, Date) { - Date d1( 4653, 12, 18 ); - Date d2 = d1.addMonths( -19 ); - Date expected( 4652, 5, 18 ); + Date d1(4653, 12, 18); + Date d2 = d1.addMonths(-19); + Date expected(4652, 5, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_92510226_20, Date) { - Date d1( 9251, 2, 26 ); - Date d2 = d1.addMonths( 20 ); - Date expected( 9252, 10, 26 ); + Date d1(9251, 2, 26); + Date d2 = d1.addMonths(20); + Date expected(9252, 10, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_89910905_neg20, Date) { - Date d1( 8991, 9, 5 ); - Date d2 = d1.addMonths( -20 ); - Date expected( 8990, 1, 5 ); + Date d1(8991, 9, 5); + Date d2 = d1.addMonths(-20); + Date expected(8990, 1, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_24911125_21, Date) { - Date d1( 2491, 11, 25 ); - Date d2 = d1.addMonths( 21 ); - Date expected( 2493, 8, 25 ); + Date d1(2491, 11, 25); + Date d2 = d1.addMonths(21); + Date expected(2493, 8, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_23620611_neg21, Date) { - Date d1( 2362, 6, 11 ); - Date d2 = d1.addMonths( -21 ); - Date expected( 2360, 9, 11 ); + Date d1(2362, 6, 11); + Date d2 = d1.addMonths(-21); + Date expected(2360, 9, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_30240623_22, Date) { - Date d1( 3024, 6, 23 ); - Date d2 = d1.addMonths( 22 ); - Date expected( 3026, 4, 23 ); + Date d1(3024, 6, 23); + Date d2 = d1.addMonths(22); + Date expected(3026, 4, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_45790803_neg22, Date) { - Date d1( 4579, 8, 3 ); - Date d2 = d1.addMonths( -22 ); - Date expected( 4577, 10, 3 ); + Date d1(4579, 8, 3); + Date d2 = d1.addMonths(-22); + Date expected(4577, 10, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_52190320_23, Date) { - Date d1( 5219, 3, 20 ); - Date d2 = d1.addMonths( 23 ); - Date expected( 5221, 2, 20 ); + Date d1(5219, 3, 20); + Date d2 = d1.addMonths(23); + Date expected(5221, 2, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_31630423_neg23, Date) { - Date d1( 3163, 4, 23 ); - Date d2 = d1.addMonths( -23 ); - Date expected( 3161, 5, 23 ); + Date d1(3163, 4, 23); + Date d2 = d1.addMonths(-23); + Date expected(3161, 5, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_71270103_24, Date) { - Date d1( 7127, 1, 3 ); - Date d2 = d1.addMonths( 24 ); - Date expected( 7129, 1, 3 ); + Date d1(7127, 1, 3); + Date d2 = d1.addMonths(24); + Date expected(7129, 1, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_75270313_neg24, Date) { - Date d1( 7527, 3, 13 ); - Date d2 = d1.addMonths( -24 ); - Date expected( 7525, 3, 13 ); + Date d1(7527, 3, 13); + Date d2 = d1.addMonths(-24); + Date expected(7525, 3, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27320802_25, Date) { - Date d1( 2732, 8, 2 ); - Date d2 = d1.addMonths( 25 ); - Date expected( 2734, 9, 2 ); + Date d1(2732, 8, 2); + Date d2 = d1.addMonths(25); + Date expected(2734, 9, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_54991018_neg25, Date) { - Date d1( 5499, 10, 18 ); - Date d2 = d1.addMonths( -25 ); - Date expected( 5497, 9, 18 ); + Date d1(5499, 10, 18); + Date d2 = d1.addMonths(-25); + Date expected(5497, 9, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_33151209_26, Date) { - Date d1( 3315, 12, 9 ); - Date d2 = d1.addMonths( 26 ); - Date expected( 3318, 2, 9 ); + Date d1(3315, 12, 9); + Date d2 = d1.addMonths(26); + Date expected(3318, 2, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60220129_neg26, Date) { - Date d1( 6022, 1, 29 ); - Date d2 = d1.addMonths( -26 ); - Date expected( 6019, 11, 29 ); + Date d1(6022, 1, 29); + Date d2 = d1.addMonths(-26); + Date expected(6019, 11, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_59300103_27, Date) { - Date d1( 5930, 1, 3 ); - Date d2 = d1.addMonths( 27 ); - Date expected( 5932, 4, 3 ); + Date d1(5930, 1, 3); + Date d2 = d1.addMonths(27); + Date expected(5932, 4, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60491119_neg27, Date) { - Date d1( 6049, 11, 19 ); - Date d2 = d1.addMonths( -27 ); - Date expected( 6047, 8, 19 ); + Date d1(6049, 11, 19); + Date d2 = d1.addMonths(-27); + Date expected(6047, 8, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_94570421_28, Date) { - Date d1( 9457, 4, 21 ); - Date d2 = d1.addMonths( 28 ); - Date expected( 9459, 8, 21 ); + Date d1(9457, 4, 21); + Date d2 = d1.addMonths(28); + Date expected(9459, 8, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_23490717_neg28, Date) { - Date d1( 2349, 7, 17 ); - Date d2 = d1.addMonths( -28 ); - Date expected( 2347, 3, 17 ); + Date d1(2349, 7, 17); + Date d2 = d1.addMonths(-28); + Date expected(2347, 3, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96280307_29, Date) { - Date d1( 9628, 3, 7 ); - Date d2 = d1.addMonths( 29 ); - Date expected( 9630, 8, 7 ); + Date d1(9628, 3, 7); + Date d2 = d1.addMonths(29); + Date expected(9630, 8, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_64550722_neg29, Date) { - Date d1( 6455, 7, 22 ); - Date d2 = d1.addMonths( -29 ); - Date expected( 6453, 2, 22 ); + Date d1(6455, 7, 22); + Date d2 = d1.addMonths(-29); + Date expected(6453, 2, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_39930304_30, Date) { - Date d1( 3993, 3, 4 ); - Date d2 = d1.addMonths( 30 ); - Date expected( 3995, 9, 4 ); + Date d1(3993, 3, 4); + Date d2 = d1.addMonths(30); + Date expected(3995, 9, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_89190724_neg30, Date) { - Date d1( 8919, 7, 24 ); - Date d2 = d1.addMonths( -30 ); - Date expected( 8917, 1, 24 ); + Date d1(8919, 7, 24); + Date d2 = d1.addMonths(-30); + Date expected(8917, 1, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_25650223_31, Date) { - Date d1( 2565, 2, 23 ); - Date d2 = d1.addMonths( 31 ); - Date expected( 2567, 9, 23 ); + Date d1(2565, 2, 23); + Date d2 = d1.addMonths(31); + Date expected(2567, 9, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_22310120_neg31, Date) { - Date d1( 2231, 1, 20 ); - Date d2 = d1.addMonths( -31 ); - Date expected( 2228, 6, 20 ); + Date d1(2231, 1, 20); + Date d2 = d1.addMonths(-31); + Date expected(2228, 6, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_49961014_32, Date) { - Date d1( 4996, 10, 14 ); - Date d2 = d1.addMonths( 32 ); - Date expected( 4999, 6, 14 ); + Date d1(4996, 10, 14); + Date d2 = d1.addMonths(32); + Date expected(4999, 6, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_83590419_neg32, Date) { - Date d1( 8359, 4, 19 ); - Date d2 = d1.addMonths( -32 ); - Date expected( 8356, 8, 19 ); + Date d1(8359, 4, 19); + Date d2 = d1.addMonths(-32); + Date expected(8356, 8, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32650512_33, Date) { - Date d1( 3265, 5, 12 ); - Date d2 = d1.addMonths( 33 ); - Date expected( 3268, 2, 12 ); + Date d1(3265, 5, 12); + Date d2 = d1.addMonths(33); + Date expected(3268, 2, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_95410626_neg33, Date) { - Date d1( 9541, 6, 26 ); - Date d2 = d1.addMonths( -33 ); - Date expected( 9538, 9, 26 ); + Date d1(9541, 6, 26); + Date d2 = d1.addMonths(-33); + Date expected(9538, 9, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_75261219_34, Date) { - Date d1( 7526, 12, 19 ); - Date d2 = d1.addMonths( 34 ); - Date expected( 7529, 10, 19 ); + Date d1(7526, 12, 19); + Date d2 = d1.addMonths(34); + Date expected(7529, 10, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_48671114_neg34, Date) { - Date d1( 4867, 11, 14 ); - Date d2 = d1.addMonths( -34 ); - Date expected( 4865, 1, 14 ); + Date d1(4867, 11, 14); + Date d2 = d1.addMonths(-34); + Date expected(4865, 1, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96440207_35, Date) { - Date d1( 9644, 2, 7 ); - Date d2 = d1.addMonths( 35 ); - Date expected( 9647, 1, 7 ); + Date d1(9644, 2, 7); + Date d2 = d1.addMonths(35); + Date expected(9647, 1, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_64691202_neg35, Date) { - Date d1( 6469, 12, 2 ); - Date d2 = d1.addMonths( -35 ); - Date expected( 6467, 1, 2 ); + Date d1(6469, 12, 2); + Date d2 = d1.addMonths(-35); + Date expected(6467, 1, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_23630814_36, Date) { - Date d1( 2363, 8, 14 ); - Date d2 = d1.addMonths( 36 ); - Date expected( 2366, 8, 14 ); + Date d1(2363, 8, 14); + Date d2 = d1.addMonths(36); + Date expected(2366, 8, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_44380502_neg36, Date) { - Date d1( 4438, 5, 2 ); - Date d2 = d1.addMonths( -36 ); - Date expected( 4435, 5, 2 ); + Date d1(4438, 5, 2); + Date d2 = d1.addMonths(-36); + Date expected(4435, 5, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_79850710_37, Date) { - Date d1( 7985, 7, 10 ); - Date d2 = d1.addMonths( 37 ); - Date expected( 7988, 8, 10 ); + Date d1(7985, 7, 10); + Date d2 = d1.addMonths(37); + Date expected(7988, 8, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82700405_neg37, Date) { - Date d1( 8270, 4, 5 ); - Date d2 = d1.addMonths( -37 ); - Date expected( 8267, 3, 5 ); + Date d1(8270, 4, 5); + Date d2 = d1.addMonths(-37); + Date expected(8267, 3, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32590204_38, Date) { - Date d1( 3259, 2, 4 ); - Date d2 = d1.addMonths( 38 ); - Date expected( 3262, 4, 4 ); + Date d1(3259, 2, 4); + Date d2 = d1.addMonths(38); + Date expected(3262, 4, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_76780614_neg38, Date) { - Date d1( 7678, 6, 14 ); - Date d2 = d1.addMonths( -38 ); - Date expected( 7675, 4, 14 ); + Date d1(7678, 6, 14); + Date d2 = d1.addMonths(-38); + Date expected(7675, 4, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_71871021_39, Date) { - Date d1( 7187, 10, 21 ); - Date d2 = d1.addMonths( 39 ); - Date expected( 7191, 1, 21 ); + Date d1(7187, 10, 21); + Date d2 = d1.addMonths(39); + Date expected(7191, 1, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_70450331_neg39, Date) { - Date d1( 7045, 3, 31 ); - Date d2 = d1.addMonths( -39 ); - Date expected( 7041, 12, 31 ); + Date d1(7045, 3, 31); + Date d2 = d1.addMonths(-39); + Date expected(7041, 12, 31); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_79380425_40, Date) { - Date d1( 7938, 4, 25 ); - Date d2 = d1.addMonths( 40 ); - Date expected( 7941, 8, 25 ); + Date d1(7938, 4, 25); + Date d2 = d1.addMonths(40); + Date expected(7941, 8, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_69170919_neg40, Date) { - Date d1( 6917, 9, 19 ); - Date d2 = d1.addMonths( -40 ); - Date expected( 6914, 5, 19 ); + Date d1(6917, 9, 19); + Date d2 = d1.addMonths(-40); + Date expected(6914, 5, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_56290214_41, Date) { - Date d1( 5629, 2, 14 ); - Date d2 = d1.addMonths( 41 ); - Date expected( 5632, 7, 14 ); + Date d1(5629, 2, 14); + Date d2 = d1.addMonths(41); + Date expected(5632, 7, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_34090314_neg41, Date) { - Date d1( 3409, 3, 14 ); - Date d2 = d1.addMonths( -41 ); - Date expected( 3405, 10, 14 ); + Date d1(3409, 3, 14); + Date d2 = d1.addMonths(-41); + Date expected(3405, 10, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_74251126_42, Date) { - Date d1( 7425, 11, 26 ); - Date d2 = d1.addMonths( 42 ); - Date expected( 7429, 5, 26 ); + Date d1(7425, 11, 26); + Date d2 = d1.addMonths(42); + Date expected(7429, 5, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_89360810_neg42, Date) { - Date d1( 8936, 8, 10 ); - Date d2 = d1.addMonths( -42 ); - Date expected( 8933, 2, 10 ); + Date d1(8936, 8, 10); + Date d2 = d1.addMonths(-42); + Date expected(8933, 2, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_78730403_43, Date) { - Date d1( 7873, 4, 3 ); - Date d2 = d1.addMonths( 43 ); - Date expected( 7876, 11, 3 ); + Date d1(7873, 4, 3); + Date d2 = d1.addMonths(43); + Date expected(7876, 11, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_51520205_neg43, Date) { - Date d1( 5152, 2, 5 ); - Date d2 = d1.addMonths( -43 ); - Date expected( 5148, 7, 5 ); + Date d1(5152, 2, 5); + Date d2 = d1.addMonths(-43); + Date expected(5148, 7, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_37990830_44, Date) { - Date d1( 3799, 8, 30 ); - Date d2 = d1.addMonths( 44 ); - Date expected( 3803, 4, 30 ); + Date d1(3799, 8, 30); + Date d2 = d1.addMonths(44); + Date expected(3803, 4, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_76241018_neg44, Date) { - Date d1( 7624, 10, 18 ); - Date d2 = d1.addMonths( -44 ); - Date expected( 7621, 2, 18 ); + Date d1(7624, 10, 18); + Date d2 = d1.addMonths(-44); + Date expected(7621, 2, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_61560124_45, Date) { - Date d1( 6156, 1, 24 ); - Date d2 = d1.addMonths( 45 ); - Date expected( 6159, 10, 24 ); + Date d1(6156, 1, 24); + Date d2 = d1.addMonths(45); + Date expected(6159, 10, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_36870918_neg45, Date) { - Date d1( 3687, 9, 18 ); - Date d2 = d1.addMonths( -45 ); - Date expected( 3683, 12, 18 ); + Date d1(3687, 9, 18); + Date d2 = d1.addMonths(-45); + Date expected(3683, 12, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40160124_46, Date) { - Date d1( 4016, 1, 24 ); - Date d2 = d1.addMonths( 46 ); - Date expected( 4019, 11, 24 ); + Date d1(4016, 1, 24); + Date d2 = d1.addMonths(46); + Date expected(4019, 11, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21920507_neg46, Date) { - Date d1( 2192, 5, 7 ); - Date d2 = d1.addMonths( -46 ); - Date expected( 2188, 7, 7 ); + Date d1(2192, 5, 7); + Date d2 = d1.addMonths(-46); + Date expected(2188, 7, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_43650121_47, Date) { - Date d1( 4365, 1, 21 ); - Date d2 = d1.addMonths( 47 ); - Date expected( 4368, 12, 21 ); + Date d1(4365, 1, 21); + Date d2 = d1.addMonths(47); + Date expected(4368, 12, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_83390331_neg47, Date) { - Date d1( 8339, 3, 31 ); - Date d2 = d1.addMonths( -47 ); - Date expected( 8335, 4, 30 ); + Date d1(8339, 3, 31); + Date d2 = d1.addMonths(-47); + Date expected(8335, 4, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_59911226_48, Date) { - Date d1( 5991, 12, 26 ); - Date d2 = d1.addMonths( 48 ); - Date expected( 5995, 12, 26 ); + Date d1(5991, 12, 26); + Date d2 = d1.addMonths(48); + Date expected(5995, 12, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_72850219_neg48, Date) { - Date d1( 7285, 2, 19 ); - Date d2 = d1.addMonths( -48 ); - Date expected( 7281, 2, 19 ); + Date d1(7285, 2, 19); + Date d2 = d1.addMonths(-48); + Date expected(7281, 2, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_31290422_49, Date) { - Date d1( 3129, 4, 22 ); - Date d2 = d1.addMonths( 49 ); - Date expected( 3133, 5, 22 ); + Date d1(3129, 4, 22); + Date d2 = d1.addMonths(49); + Date expected(3133, 5, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_45330802_neg49, Date) { - Date d1( 4533, 8, 2 ); - Date d2 = d1.addMonths( -49 ); - Date expected( 4529, 7, 2 ); + Date d1(4533, 8, 2); + Date d2 = d1.addMonths(-49); + Date expected(4529, 7, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_23570119_50, Date) { - Date d1( 2357, 1, 19 ); - Date d2 = d1.addMonths( 50 ); - Date expected( 2361, 3, 19 ); + Date d1(2357, 1, 19); + Date d2 = d1.addMonths(50); + Date expected(2361, 3, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_53090111_neg50, Date) { - Date d1( 5309, 1, 11 ); - Date d2 = d1.addMonths( -50 ); - Date expected( 5304, 11, 11 ); + Date d1(5309, 1, 11); + Date d2 = d1.addMonths(-50); + Date expected(5304, 11, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_75210929_51, Date) { - Date d1( 7521, 9, 29 ); - Date d2 = d1.addMonths( 51 ); - Date expected( 7525, 12, 29 ); + Date d1(7521, 9, 29); + Date d2 = d1.addMonths(51); + Date expected(7525, 12, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_98670208_neg51, Date) { - Date d1( 9867, 2, 8 ); - Date d2 = d1.addMonths( -51 ); - Date expected( 9862, 11, 8 ); + Date d1(9867, 2, 8); + Date d2 = d1.addMonths(-51); + Date expected(9862, 11, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_51100402_52, Date) { - Date d1( 5110, 4, 2 ); - Date d2 = d1.addMonths( 52 ); - Date expected( 5114, 8, 2 ); + Date d1(5110, 4, 2); + Date d2 = d1.addMonths(52); + Date expected(5114, 8, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_43620617_neg52, Date) { - Date d1( 4362, 6, 17 ); - Date d2 = d1.addMonths( -52 ); - Date expected( 4358, 2, 17 ); + Date d1(4362, 6, 17); + Date d2 = d1.addMonths(-52); + Date expected(4358, 2, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82550821_53, Date) { - Date d1( 8255, 8, 21 ); - Date d2 = d1.addMonths( 53 ); - Date expected( 8260, 1, 21 ); + Date d1(8255, 8, 21); + Date d2 = d1.addMonths(53); + Date expected(8260, 1, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66150514_neg53, Date) { - Date d1( 6615, 5, 14 ); - Date d2 = d1.addMonths( -53 ); - Date expected( 6610, 12, 14 ); + Date d1(6615, 5, 14); + Date d2 = d1.addMonths(-53); + Date expected(6610, 12, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_29910917_54, Date) { - Date d1( 2991, 9, 17 ); - Date d2 = d1.addMonths( 54 ); - Date expected( 2996, 3, 17 ); + Date d1(2991, 9, 17); + Date d2 = d1.addMonths(54); + Date expected(2996, 3, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96021031_neg54, Date) { - Date d1( 9602, 10, 31 ); - Date d2 = d1.addMonths( -54 ); - Date expected( 9598, 4, 30 ); + Date d1(9602, 10, 31); + Date d2 = d1.addMonths(-54); + Date expected(9598, 4, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_55710820_55, Date) { - Date d1( 5571, 8, 20 ); - Date d2 = d1.addMonths( 55 ); - Date expected( 5576, 3, 20 ); + Date d1(5571, 8, 20); + Date d2 = d1.addMonths(55); + Date expected(5576, 3, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_99220604_neg55, Date) { - Date d1( 9922, 6, 4 ); - Date d2 = d1.addMonths( -55 ); - Date expected( 9917, 11, 4 ); + Date d1(9922, 6, 4); + Date d2 = d1.addMonths(-55); + Date expected(9917, 11, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_84080204_56, Date) { - Date d1( 8408, 2, 4 ); - Date d2 = d1.addMonths( 56 ); - Date expected( 8412, 10, 4 ); + Date d1(8408, 2, 4); + Date d2 = d1.addMonths(56); + Date expected(8412, 10, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_26790414_neg56, Date) { - Date d1( 2679, 4, 14 ); - Date d2 = d1.addMonths( -56 ); - Date expected( 2674, 8, 14 ); + Date d1(2679, 4, 14); + Date d2 = d1.addMonths(-56); + Date expected(2674, 8, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_91950821_57, Date) { - Date d1( 9195, 8, 21 ); - Date d2 = d1.addMonths( 57 ); - Date expected( 9200, 5, 21 ); + Date d1(9195, 8, 21); + Date d2 = d1.addMonths(57); + Date expected(9200, 5, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_22681212_neg57, Date) { - Date d1( 2268, 12, 12 ); - Date d2 = d1.addMonths( -57 ); - Date expected( 2264, 3, 12 ); + Date d1(2268, 12, 12); + Date d2 = d1.addMonths(-57); + Date expected(2264, 3, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_49151229_58, Date) { - Date d1( 4915, 12, 29 ); - Date d2 = d1.addMonths( 58 ); - Date expected( 4920, 10, 29 ); + Date d1(4915, 12, 29); + Date d2 = d1.addMonths(58); + Date expected(4920, 10, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_30750611_neg58, Date) { - Date d1( 3075, 6, 11 ); - Date d2 = d1.addMonths( -58 ); - Date expected( 3070, 8, 11 ); + Date d1(3075, 6, 11); + Date d2 = d1.addMonths(-58); + Date expected(3070, 8, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_81591221_59, Date) { - Date d1( 8159, 12, 21 ); - Date d2 = d1.addMonths( 59 ); - Date expected( 8164, 11, 21 ); + Date d1(8159, 12, 21); + Date d2 = d1.addMonths(59); + Date expected(8164, 11, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_99500222_neg59, Date) { - Date d1( 9950, 2, 22 ); - Date d2 = d1.addMonths( -59 ); - Date expected( 9945, 3, 22 ); + Date d1(9950, 2, 22); + Date d2 = d1.addMonths(-59); + Date expected(9945, 3, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_26191020_60, Date) { - Date d1( 2619, 10, 20 ); - Date d2 = d1.addMonths( 60 ); - Date expected( 2624, 10, 20 ); + Date d1(2619, 10, 20); + Date d2 = d1.addMonths(60); + Date expected(2624, 10, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_24950909_neg60, Date) { - Date d1( 2495, 9, 9 ); - Date d2 = d1.addMonths( -60 ); - Date expected( 2490, 9, 9 ); + Date d1(2495, 9, 9); + Date d2 = d1.addMonths(-60); + Date expected(2490, 9, 9); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_87910327_61, Date) { - Date d1( 8791, 3, 27 ); - Date d2 = d1.addMonths( 61 ); - Date expected( 8796, 4, 27 ); + Date d1(8791, 3, 27); + Date d2 = d1.addMonths(61); + Date expected(8796, 4, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40191120_neg61, Date) { - Date d1( 4019, 11, 20 ); - Date d2 = d1.addMonths( -61 ); - Date expected( 4014, 10, 20 ); + Date d1(4019, 11, 20); + Date d2 = d1.addMonths(-61); + Date expected(4014, 10, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_95420503_62, Date) { - Date d1( 9542, 5, 3 ); - Date d2 = d1.addMonths( 62 ); - Date expected( 9547, 7, 3 ); + Date d1(9542, 5, 3); + Date d2 = d1.addMonths(62); + Date expected(9547, 7, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_48901205_neg62, Date) { - Date d1( 4890, 12, 5 ); - Date d2 = d1.addMonths( -62 ); - Date expected( 4885, 10, 5 ); + Date d1(4890, 12, 5); + Date d2 = d1.addMonths(-62); + Date expected(4885, 10, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82490624_63, Date) { - Date d1( 8249, 6, 24 ); - Date d2 = d1.addMonths( 63 ); - Date expected( 8254, 9, 24 ); + Date d1(8249, 6, 24); + Date d2 = d1.addMonths(63); + Date expected(8254, 9, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_46911118_neg63, Date) { - Date d1( 4691, 11, 18 ); - Date d2 = d1.addMonths( -63 ); - Date expected( 4686, 8, 18 ); + Date d1(4691, 11, 18); + Date d2 = d1.addMonths(-63); + Date expected(4686, 8, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_28440928_64, Date) { - Date d1( 2844, 9, 28 ); - Date d2 = d1.addMonths( 64 ); - Date expected( 2850, 1, 28 ); + Date d1(2844, 9, 28); + Date d2 = d1.addMonths(64); + Date expected(2850, 1, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_21120924_neg64, Date) { - Date d1( 2112, 9, 24 ); - Date d2 = d1.addMonths( -64 ); - Date expected( 2107, 5, 24 ); + Date d1(2112, 9, 24); + Date d2 = d1.addMonths(-64); + Date expected(2107, 5, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_94960406_65, Date) { - Date d1( 9496, 4, 6 ); - Date d2 = d1.addMonths( 65 ); - Date expected( 9501, 9, 6 ); + Date d1(9496, 4, 6); + Date d2 = d1.addMonths(65); + Date expected(9501, 9, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_88460202_neg65, Date) { - Date d1( 8846, 2, 2 ); - Date d2 = d1.addMonths( -65 ); - Date expected( 8840, 9, 2 ); + Date d1(8846, 2, 2); + Date d2 = d1.addMonths(-65); + Date expected(8840, 9, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97060210_66, Date) { - Date d1( 9706, 2, 10 ); - Date d2 = d1.addMonths( 66 ); - Date expected( 9711, 8, 10 ); + Date d1(9706, 2, 10); + Date d2 = d1.addMonths(66); + Date expected(9711, 8, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_91001222_neg66, Date) { - Date d1( 9100, 12, 22 ); - Date d2 = d1.addMonths( -66 ); - Date expected( 9095, 6, 22 ); + Date d1(9100, 12, 22); + Date d2 = d1.addMonths(-66); + Date expected(9095, 6, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_62070119_67, Date) { - Date d1( 6207, 1, 19 ); - Date d2 = d1.addMonths( 67 ); - Date expected( 6212, 8, 19 ); + Date d1(6207, 1, 19); + Date d2 = d1.addMonths(67); + Date expected(6212, 8, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_85330503_neg67, Date) { - Date d1( 8533, 5, 3 ); - Date d2 = d1.addMonths( -67 ); - Date expected( 8527, 10, 3 ); + Date d1(8533, 5, 3); + Date d2 = d1.addMonths(-67); + Date expected(8527, 10, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_53220811_68, Date) { - Date d1( 5322, 8, 11 ); - Date d2 = d1.addMonths( 68 ); - Date expected( 5328, 4, 11 ); + Date d1(5322, 8, 11); + Date d2 = d1.addMonths(68); + Date expected(5328, 4, 11); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_24910406_neg68, Date) { - Date d1( 2491, 4, 6 ); - Date d2 = d1.addMonths( -68 ); - Date expected( 2485, 8, 6 ); + Date d1(2491, 4, 6); + Date d2 = d1.addMonths(-68); + Date expected(2485, 8, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_96111014_69, Date) { - Date d1( 9611, 10, 14 ); - Date d2 = d1.addMonths( 69 ); - Date expected( 9617, 7, 14 ); + Date d1(9611, 10, 14); + Date d2 = d1.addMonths(69); + Date expected(9617, 7, 14); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_90750119_neg69, Date) { - Date d1( 9075, 1, 19 ); - Date d2 = d1.addMonths( -69 ); - Date expected( 9069, 4, 19 ); + Date d1(9075, 1, 19); + Date d2 = d1.addMonths(-69); + Date expected(9069, 4, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_91520227_70, Date) { - Date d1( 9152, 2, 27 ); - Date d2 = d1.addMonths( 70 ); - Date expected( 9157, 12, 27 ); + Date d1(9152, 2, 27); + Date d2 = d1.addMonths(70); + Date expected(9157, 12, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_45360406_neg70, Date) { - Date d1( 4536, 4, 6 ); - Date d2 = d1.addMonths( -70 ); - Date expected( 4530, 6, 6 ); + Date d1(4536, 4, 6); + Date d2 = d1.addMonths(-70); + Date expected(4530, 6, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_52700831_71, Date) { - Date d1( 5270, 8, 31 ); - Date d2 = d1.addMonths( 71 ); - Date expected( 5276, 7, 31 ); + Date d1(5270, 8, 31); + Date d2 = d1.addMonths(71); + Date expected(5276, 7, 31); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60900724_neg71, Date) { - Date d1( 6090, 7, 24 ); - Date d2 = d1.addMonths( -71 ); - Date expected( 6084, 8, 24 ); + Date d1(6090, 7, 24); + Date d2 = d1.addMonths(-71); + Date expected(6084, 8, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_44570616_72, Date) { - Date d1( 4457, 6, 16 ); - Date d2 = d1.addMonths( 72 ); - Date expected( 4463, 6, 16 ); + Date d1(4457, 6, 16); + Date d2 = d1.addMonths(72); + Date expected(4463, 6, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27500827_neg72, Date) { - Date d1( 2750, 8, 27 ); - Date d2 = d1.addMonths( -72 ); - Date expected( 2744, 8, 27 ); + Date d1(2750, 8, 27); + Date d2 = d1.addMonths(-72); + Date expected(2744, 8, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_99191123_73, Date) { - Date d1( 9919, 11, 23 ); - Date d2 = d1.addMonths( 73 ); - Date expected( 9925, 12, 23 ); + Date d1(9919, 11, 23); + Date d2 = d1.addMonths(73); + Date expected(9925, 12, 23); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_34280322_neg73, Date) { - Date d1( 3428, 3, 22 ); - Date d2 = d1.addMonths( -73 ); - Date expected( 3422, 2, 22 ); + Date d1(3428, 3, 22); + Date d2 = d1.addMonths(-73); + Date expected(3422, 2, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_60210116_74, Date) { - Date d1( 6021, 1, 16 ); - Date d2 = d1.addMonths( 74 ); - Date expected( 6027, 3, 16 ); + Date d1(6021, 1, 16); + Date d2 = d1.addMonths(74); + Date expected(6027, 3, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_48000428_neg74, Date) { - Date d1( 4800, 4, 28 ); - Date d2 = d1.addMonths( -74 ); - Date expected( 4794, 2, 28 ); + Date d1(4800, 4, 28); + Date d2 = d1.addMonths(-74); + Date expected(4794, 2, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_27051116_75, Date) { - Date d1( 2705, 11, 16 ); - Date d2 = d1.addMonths( 75 ); - Date expected( 2712, 2, 16 ); + Date d1(2705, 11, 16); + Date d2 = d1.addMonths(75); + Date expected(2712, 2, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_47610510_neg75, Date) { - Date d1( 4761, 5, 10 ); - Date d2 = d1.addMonths( -75 ); - Date expected( 4755, 2, 10 ); + Date d1(4761, 5, 10); + Date d2 = d1.addMonths(-75); + Date expected(4755, 2, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32841113_76, Date) { - Date d1( 3284, 11, 13 ); - Date d2 = d1.addMonths( 76 ); - Date expected( 3291, 3, 13 ); + Date d1(3284, 11, 13); + Date d2 = d1.addMonths(76); + Date expected(3291, 3, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_51271227_neg76, Date) { - Date d1( 5127, 12, 27 ); - Date d2 = d1.addMonths( -76 ); - Date expected( 5121, 8, 27 ); + Date d1(5127, 12, 27); + Date d2 = d1.addMonths(-76); + Date expected(5121, 8, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_24360701_77, Date) { - Date d1( 2436, 7, 1 ); - Date d2 = d1.addMonths( 77 ); - Date expected( 2442, 12, 1 ); + Date d1(2436, 7, 1); + Date d2 = d1.addMonths(77); + Date expected(2442, 12, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_39491017_neg77, Date) { - Date d1( 3949, 10, 17 ); - Date d2 = d1.addMonths( -77 ); - Date expected( 3943, 5, 17 ); + Date d1(3949, 10, 17); + Date d2 = d1.addMonths(-77); + Date expected(3943, 5, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_38450916_78, Date) { - Date d1( 3845, 9, 16 ); - Date d2 = d1.addMonths( 78 ); - Date expected( 3852, 3, 16 ); + Date d1(3845, 9, 16); + Date d2 = d1.addMonths(78); + Date expected(3852, 3, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_83790326_neg78, Date) { - Date d1( 8379, 3, 26 ); - Date d2 = d1.addMonths( -78 ); - Date expected( 8372, 9, 26 ); + Date d1(8379, 3, 26); + Date d2 = d1.addMonths(-78); + Date expected(8372, 9, 26); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_79480908_79, Date) { - Date d1( 7948, 9, 8 ); - Date d2 = d1.addMonths( 79 ); - Date expected( 7955, 4, 8 ); + Date d1(7948, 9, 8); + Date d2 = d1.addMonths(79); + Date expected(7955, 4, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_59301013_neg79, Date) { - Date d1( 5930, 10, 13 ); - Date d2 = d1.addMonths( -79 ); - Date expected( 5924, 3, 13 ); + Date d1(5930, 10, 13); + Date d2 = d1.addMonths(-79); + Date expected(5924, 3, 13); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_90440302_80, Date) { - Date d1( 9044, 3, 2 ); - Date d2 = d1.addMonths( 80 ); - Date expected( 9050, 11, 2 ); + Date d1(9044, 3, 2); + Date d2 = d1.addMonths(80); + Date expected(9050, 11, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_24091024_neg80, Date) { - Date d1( 2409, 10, 24 ); - Date d2 = d1.addMonths( -80 ); - Date expected( 2403, 2, 24 ); + Date d1(2409, 10, 24); + Date d2 = d1.addMonths(-80); + Date expected(2403, 2, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_25391222_81, Date) { - Date d1( 2539, 12, 22 ); - Date d2 = d1.addMonths( 81 ); - Date expected( 2546, 9, 22 ); + Date d1(2539, 12, 22); + Date d2 = d1.addMonths(81); + Date expected(2546, 9, 22); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_52320205_neg81, Date) { - Date d1( 5232, 2, 5 ); - Date d2 = d1.addMonths( -81 ); - Date expected( 5225, 5, 5 ); + Date d1(5232, 2, 5); + Date d2 = d1.addMonths(-81); + Date expected(5225, 5, 5); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_80300928_82, Date) { - Date d1( 8030, 9, 28 ); - Date d2 = d1.addMonths( 82 ); - Date expected( 8037, 7, 28 ); + Date d1(8030, 9, 28); + Date d2 = d1.addMonths(82); + Date expected(8037, 7, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_80730820_neg82, Date) { - Date d1( 8073, 8, 20 ); - Date d2 = d1.addMonths( -82 ); - Date expected( 8066, 10, 20 ); + Date d1(8073, 8, 20); + Date d2 = d1.addMonths(-82); + Date expected(8066, 10, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_28220702_83, Date) { - Date d1( 2822, 7, 2 ); - Date d2 = d1.addMonths( 83 ); - Date expected( 2829, 6, 2 ); + Date d1(2822, 7, 2); + Date d2 = d1.addMonths(83); + Date expected(2829, 6, 2); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97910829_neg83, Date) { - Date d1( 9791, 8, 29 ); - Date d2 = d1.addMonths( -83 ); - Date expected( 9784, 9, 29 ); + Date d1(9791, 8, 29); + Date d2 = d1.addMonths(-83); + Date expected(9784, 9, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_58460801_84, Date) { - Date d1( 5846, 8, 1 ); - Date d2 = d1.addMonths( 84 ); - Date expected( 5853, 8, 1 ); + Date d1(5846, 8, 1); + Date d2 = d1.addMonths(84); + Date expected(5853, 8, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_40120217_neg84, Date) { - Date d1( 4012, 2, 17 ); - Date d2 = d1.addMonths( -84 ); - Date expected( 4005, 2, 17 ); + Date d1(4012, 2, 17); + Date d2 = d1.addMonths(-84); + Date expected(4005, 2, 17); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_73630204_85, Date) { - Date d1( 7363, 2, 4 ); - Date d2 = d1.addMonths( 85 ); - Date expected( 7370, 3, 4 ); + Date d1(7363, 2, 4); + Date d2 = d1.addMonths(85); + Date expected(7370, 3, 4); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_37400507_neg85, Date) { - Date d1( 3740, 5, 7 ); - Date d2 = d1.addMonths( -85 ); - Date expected( 3733, 4, 7 ); + Date d1(3740, 5, 7); + Date d2 = d1.addMonths(-85); + Date expected(3733, 4, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_43830112_86, Date) { - Date d1( 4383, 1, 12 ); - Date d2 = d1.addMonths( 86 ); - Date expected( 4390, 3, 12 ); + Date d1(4383, 1, 12); + Date d2 = d1.addMonths(86); + Date expected(4390, 3, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_44791203_neg86, Date) { - Date d1( 4479, 12, 3 ); - Date d2 = d1.addMonths( -86 ); - Date expected( 4472, 10, 3 ); + Date d1(4479, 12, 3); + Date d2 = d1.addMonths(-86); + Date expected(4472, 10, 3); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_66190721_87, Date) { - Date d1( 6619, 7, 21 ); - Date d2 = d1.addMonths( 87 ); - Date expected( 6626, 10, 21 ); + Date d1(6619, 7, 21); + Date d2 = d1.addMonths(87); + Date expected(6626, 10, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_22000708_neg87, Date) { - Date d1( 2200, 7, 8 ); - Date d2 = d1.addMonths( -87 ); - Date expected( 2193, 4, 8 ); + Date d1(2200, 7, 8); + Date d2 = d1.addMonths(-87); + Date expected(2193, 4, 8); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_47870518_88, Date) { - Date d1( 4787, 5, 18 ); - Date d2 = d1.addMonths( 88 ); - Date expected( 4794, 9, 18 ); + Date d1(4787, 5, 18); + Date d2 = d1.addMonths(88); + Date expected(4794, 9, 18); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_41171127_neg88, Date) { - Date d1( 4117, 11, 27 ); - Date d2 = d1.addMonths( -88 ); - Date expected( 4110, 7, 27 ); + Date d1(4117, 11, 27); + Date d2 = d1.addMonths(-88); + Date expected(4110, 7, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_81740324_89, Date) { - Date d1( 8174, 3, 24 ); - Date d2 = d1.addMonths( 89 ); - Date expected( 8181, 8, 24 ); + Date d1(8174, 3, 24); + Date d2 = d1.addMonths(89); + Date expected(8181, 8, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97991027_neg89, Date) { - Date d1( 9799, 10, 27 ); - Date d2 = d1.addMonths( -89 ); - Date expected( 9792, 5, 27 ); + Date d1(9799, 10, 27); + Date d2 = d1.addMonths(-89); + Date expected(9792, 5, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_38911029_90, Date) { - Date d1( 3891, 10, 29 ); - Date d2 = d1.addMonths( 90 ); - Date expected( 3899, 4, 29 ); + Date d1(3891, 10, 29); + Date d2 = d1.addMonths(90); + Date expected(3899, 4, 29); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_29160228_neg90, Date) { - Date d1( 2916, 2, 28 ); - Date d2 = d1.addMonths( -90 ); - Date expected( 2908, 8, 28 ); + Date d1(2916, 2, 28); + Date d2 = d1.addMonths(-90); + Date expected(2908, 8, 28); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_82960116_91, Date) { - Date d1( 8296, 1, 16 ); - Date d2 = d1.addMonths( 91 ); - Date expected( 8303, 8, 16 ); + Date d1(8296, 1, 16); + Date d2 = d1.addMonths(91); + Date expected(8303, 8, 16); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_90101206_neg91, Date) { - Date d1( 9010, 12, 6 ); - Date d2 = d1.addMonths( -91 ); - Date expected( 9003, 5, 6 ); + Date d1(9010, 12, 6); + Date d2 = d1.addMonths(-91); + Date expected(9003, 5, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_83510125_92, Date) { - Date d1( 8351, 1, 25 ); - Date d2 = d1.addMonths( 92 ); - Date expected( 8358, 9, 25 ); + Date d1(8351, 1, 25); + Date d2 = d1.addMonths(92); + Date expected(8358, 9, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_43440227_neg92, Date) { - Date d1( 4344, 2, 27 ); - Date d2 = d1.addMonths( -92 ); - Date expected( 4336, 6, 27 ); + Date d1(4344, 2, 27); + Date d2 = d1.addMonths(-92); + Date expected(4336, 6, 27); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_98640712_93, Date) { - Date d1( 9864, 7, 12 ); - Date d2 = d1.addMonths( 93 ); - Date expected( 9872, 4, 12 ); + Date d1(9864, 7, 12); + Date d2 = d1.addMonths(93); + Date expected(9872, 4, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97370620_neg93, Date) { - Date d1( 9737, 6, 20 ); - Date d2 = d1.addMonths( -93 ); - Date expected( 9729, 9, 20 ); + Date d1(9737, 6, 20); + Date d2 = d1.addMonths(-93); + Date expected(9729, 9, 20); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_38330615_94, Date) { - Date d1( 3833, 6, 15 ); - Date d2 = d1.addMonths( 94 ); - Date expected( 3841, 4, 15 ); + Date d1(3833, 6, 15); + Date d2 = d1.addMonths(94); + Date expected(3841, 4, 15); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_42911125_neg94, Date) { - Date d1( 4291, 11, 25 ); - Date d2 = d1.addMonths( -94 ); - Date expected( 4284, 1, 25 ); + Date d1(4291, 11, 25); + Date d2 = d1.addMonths(-94); + Date expected(4284, 1, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_76000607_95, Date) { - Date d1( 7600, 6, 7 ); - Date d2 = d1.addMonths( 95 ); - Date expected( 7608, 5, 7 ); + Date d1(7600, 6, 7); + Date d2 = d1.addMonths(95); + Date expected(7608, 5, 7); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_84020221_neg95, Date) { - Date d1( 8402, 2, 21 ); - Date d2 = d1.addMonths( -95 ); - Date expected( 8394, 3, 21 ); + Date d1(8402, 2, 21); + Date d2 = d1.addMonths(-95); + Date expected(8394, 3, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_54361206_96, Date) { - Date d1( 5436, 12, 6 ); - Date d2 = d1.addMonths( 96 ); - Date expected( 5444, 12, 6 ); + Date d1(5436, 12, 6); + Date d2 = d1.addMonths(96); + Date expected(5444, 12, 6); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_68420925_neg96, Date) { - Date d1( 6842, 9, 25 ); - Date d2 = d1.addMonths( -96 ); - Date expected( 6834, 9, 25 ); + Date d1(6842, 9, 25); + Date d2 = d1.addMonths(-96); + Date expected(6834, 9, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_55420519_97, Date) { - Date d1( 5542, 5, 19 ); - Date d2 = d1.addMonths( 97 ); - Date expected( 5550, 6, 19 ); + Date d1(5542, 5, 19); + Date d2 = d1.addMonths(97); + Date expected(5550, 6, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_81640421_neg97, Date) { - Date d1( 8164, 4, 21 ); - Date d2 = d1.addMonths( -97 ); - Date expected( 8156, 3, 21 ); + Date d1(8164, 4, 21); + Date d2 = d1.addMonths(-97); + Date expected(8156, 3, 21); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_32740225_98, Date) { - Date d1( 3274, 2, 25 ); - Date d2 = d1.addMonths( 98 ); - Date expected( 3282, 4, 25 ); + Date d1(3274, 2, 25); + Date d2 = d1.addMonths(98); + Date expected(3282, 4, 25); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_42520401_neg98, Date) { - Date d1( 4252, 4, 1 ); - Date d2 = d1.addMonths( -98 ); - Date expected( 4244, 2, 1 ); + Date d1(4252, 4, 1); + Date d2 = d1.addMonths(-98); + Date expected(4244, 2, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_73750410_99, Date) { - Date d1( 7375, 4, 10 ); - Date d2 = d1.addMonths( 99 ); - Date expected( 7383, 7, 10 ); + Date d1(7375, 4, 10); + Date d2 = d1.addMonths(99); + Date expected(7383, 7, 10); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_97931230_neg99, Date) { - Date d1( 9793, 12, 30 ); - Date d2 = d1.addMonths( -99 ); - Date expected( 9785, 9, 30 ); + Date d1(9793, 12, 30); + Date d2 = d1.addMonths(-99); + Date expected(9785, 9, 30); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_65711024_100, Date) { - Date d1( 6571, 10, 24 ); - Date d2 = d1.addMonths( 100 ); - Date expected( 6580, 2, 24 ); + Date d1(6571, 10, 24); + Date d2 = d1.addMonths(100); + Date expected(6580, 2, 24); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(add_day_65251219_neg100, Date) { - Date d1( 6525, 12, 19 ); - Date d2 = d1.addMonths( -100 ); - Date expected( 6517, 8, 19 ); + Date d1(6525, 12, 19); + Date d2 = d1.addMonths(-100); + Date expected(6517, 8, 19); Date actual = d1; - CHECK_EQUAL( expected, actual ) - actual = d2; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) + actual = d2; + CHECK_EQUAL(expected, actual) } + TEST(isLeapYear_44600910, Date) { - Date d( 4460, 9, 10 ); + Date d(4460, 9, 10); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_48541109, Date) { - Date d( 4854, 11, 9 ); + Date d(4854, 11, 9); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_34570111, Date) { - Date d( 3457, 1, 11 ); + Date d(3457, 1, 11); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_54630605, Date) { - Date d( 5463, 6, 5 ); + Date d(5463, 6, 5); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_03370916, Date) { - Date d( 337, 9, 16 ); + Date d(337, 9, 16); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_98841102, Date) { - Date d( 9884, 11, 2 ); + Date d(9884, 11, 2); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_68450517, Date) { - Date d( 6845, 5, 17 ); + Date d(6845, 5, 17); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_06030729, Date) { - Date d( 603, 7, 29 ); + Date d(603, 7, 29); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_07770419, Date) { - Date d( 777, 4, 19 ); + Date d(777, 4, 19); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_82591205, Date) { - Date d( 8259, 12, 5 ); + Date d(8259, 12, 5); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_72681020, Date) { - Date d( 7268, 10, 20 ); + Date d(7268, 10, 20); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_68970616, Date) { - Date d( 6897, 6, 16 ); + Date d(6897, 6, 16); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_83641008, Date) { - Date d( 8364, 10, 8 ); + Date d(8364, 10, 8); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - TEST(isLeapYear_17560920, Date) { - Date d( 1756, 9, 20 ); + Date d(1756, 9, 20); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_18130224, Date) { - Date d( 1813, 2, 24 ); + Date d(1813, 2, 24); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_18640413, Date) { - Date d( 1864, 4, 13 ); + Date d(1864, 4, 13); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_17750217, Date) { - Date d( 1775, 2, 17 ); + Date d(1775, 2, 17); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_18980519, Date) { - Date d( 1898, 5, 19 ); + Date d(1898, 5, 19); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_17911120, Date) { - Date d( 1791, 11, 20 ); + Date d(1791, 11, 20); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_18850622, Date) { - Date d( 1885, 6, 22 ); + Date d(1885, 6, 22); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_18921221, Date) { - Date d( 1892, 12, 21 ); + Date d(1892, 12, 21); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - TEST(isLeapYear_19800705, Date) { - Date d( 1980, 7, 5 ); + Date d(1980, 7, 5); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_20760716, Date) { - Date d( 2076, 7, 16 ); + Date d(2076, 7, 16); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_20730415, Date) { - Date d( 2073, 4, 15 ); + Date d(2073, 4, 15); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_20070223, Date) { - Date d( 2007, 2, 23 ); + Date d(2007, 2, 23); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_20740407, Date) { - Date d( 2074, 4, 7 ); + Date d(2074, 4, 7); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_20160823, Date) { - Date d( 2016, 8, 23 ); + Date d(2016, 8, 23); bool expected = true; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(isLeapYear_20180901, Date) { - Date d( 2018, 9, 1 ); + Date d(2018, 9, 1); bool expected = false; bool actual = d.isLeapYear(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } + TEST(static_isLeapYear_20050519, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 2005 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2005); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20400216, Date) { bool expected = true; - Date date; bool actual = date.isLeapYear( 2040 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2040); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20220523, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 2022 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2022); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_19850316, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 1985 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(1985); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20691008, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 2069 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2069); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20591221, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 2059 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2059); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20621108, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 2062 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2062); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20600108, Date) { bool expected = true; - Date date; bool actual = date.isLeapYear( 2060 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2060); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20540410, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 2054 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2054); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20201006, Date) { bool expected = true; - Date date; bool actual = date.isLeapYear( 2020 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2020); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20320410, Date) { bool expected = true; - Date date; bool actual = date.isLeapYear( 2032 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2032); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20260418, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 2026 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2026); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_20310220, Date) { bool expected = false; - Date date; bool actual = date.isLeapYear( 2031 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(2031); + CHECK_EQUAL(expected, actual) } TEST(static_isLeapYear_19960509, Date) { bool expected = true; - Date date; bool actual = date.isLeapYear( 1996 ); - CHECK_EQUAL( expected, actual ) + Date date; + bool actual = date.isLeapYear(1996); + CHECK_EQUAL(expected, actual) } -TEST( parse01_failSmallYear, Date ) +TEST(parse01_failSmallYear, Date) { Date d; - CHECK_EQUAL( d.getYear(), 1900 ); - CHECK_EQUAL( d.getMonth(), 1 ); - CHECK_EQUAL( d.getDay(), 1 ); - CHECK( ! d.parse( "200-12-25" ) ); - CHECK_EQUAL( d.getYear(), 1900 ); - CHECK_EQUAL( d.getMonth(), 1 ); - CHECK_EQUAL( d.getDay(), 1 ); -} - -TEST( parse01_okSmallYear, Date ) -{ - Date d( 2001, 2, 27 ); - CHECK_EQUAL( d.getYear(), 2001 ); - CHECK_EQUAL( d.getMonth(), 2 ); - CHECK_EQUAL( d.getDay(), 27 ); - CHECK( d.parse( "0010-12-05" ) ); - CHECK_EQUAL( d.getYear(), 10 ); - CHECK_EQUAL( d.getMonth(), 12 ); - CHECK_EQUAL( d.getDay(), 05 ); -} - -TEST( parse01_failNormalDate, Date ) -{ - Date d( 2005, 3, 15 ); - CHECK_EQUAL( d.getYear(), 2005 ); - CHECK_EQUAL( d.getMonth(), 3 ); - CHECK_EQUAL( d.getDay(), 15 ); - CHECK( ! d.parse( "1996-15-05" ) ); - CHECK_EQUAL( d.getYear(), 2005 ); - CHECK_EQUAL( d.getMonth(), 3 ); - CHECK_EQUAL( d.getDay(), 15 ); -} - -TEST( parse01_okNormalDate, Date ) -{ - Date d( 2013, 12, 1 ); - CHECK_EQUAL( d.getYear(), 2013 ); - CHECK_EQUAL( d.getMonth(), 12 ); - CHECK_EQUAL( d.getDay(), 1 ); - CHECK( d.parse( "2016-02-05" ) ); - CHECK_EQUAL( d.getYear(), 2016 ); - CHECK_EQUAL( d.getMonth(), 02 ); - CHECK_EQUAL( d.getDay(), 05 ); + CHECK_EQUAL(d.getYear(), 1900); + CHECK_EQUAL(d.getMonth(), 1); + CHECK_EQUAL(d.getDay(), 1); + CHECK(!d.parse("200-12-25")); + CHECK_EQUAL(d.getYear(), 1900); + CHECK_EQUAL(d.getMonth(), 1); + CHECK_EQUAL(d.getDay(), 1); +} + +TEST(parse01_okSmallYear, Date) +{ + Date d(2001, 2, 27); + CHECK_EQUAL(d.getYear(), 2001); + CHECK_EQUAL(d.getMonth(), 2); + CHECK_EQUAL(d.getDay(), 27); + CHECK(d.parse("0010-12-05")); + CHECK_EQUAL(d.getYear(), 10); + CHECK_EQUAL(d.getMonth(), 12); + CHECK_EQUAL(d.getDay(), 05); } + +TEST(parse01_failNormalDate, Date) +{ + Date d(2005, 3, 15); + CHECK_EQUAL(d.getYear(), 2005); + CHECK_EQUAL(d.getMonth(), 3); + CHECK_EQUAL(d.getDay(), 15); + CHECK(!d.parse("1996-15-05")); + CHECK_EQUAL(d.getYear(), 2005); + CHECK_EQUAL(d.getMonth(), 3); + CHECK_EQUAL(d.getDay(), 15); +} + +TEST(parse01_okNormalDate, Date) +{ + Date d(2013, 12, 1); + CHECK_EQUAL(d.getYear(), 2013); + CHECK_EQUAL(d.getMonth(), 12); + CHECK_EQUAL(d.getDay(), 1); + CHECK(d.parse("2016-02-05")); + CHECK_EQUAL(d.getYear(), 2016); + CHECK_EQUAL(d.getMonth(), 02); + CHECK_EQUAL(d.getDay(), 05); +} + TEST(addYears01_outofleap, Date) { - Date d1( 2060, 2, 29 ); - Date d2 = d1.addYears( 1 ); - Date expected( 2061, 3, 1 ); + Date d1(2060, 2, 29); + Date d2 = d1.addYears(1); + Date expected(2061, 3, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(addYears02_outofleap, Date) { - Date d1( 2040, 2, 29 ); - Date d2 = d1.addYears( -3 ); - Date expected( 2037, 3, 1 ); + Date d1(2040, 2, 29); + Date d2 = d1.addYears(-3); + Date expected(2037, 3, 1); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(addYears03_outofrange, Date) { - Date d1( 9999, 5, 31 ); - Date d2 = d1.addYears( 1 ); - Date expected( 9999, 5, 31 ); + Date d1(9999, 5, 31); + Date d2 = d1.addYears(1); + Date expected(9999, 5, 31); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(addYears04_outofrange, Date) { - Date d1( 1, 2, 12 ); - Date d2 = d1.addYears( -1 ); - Date expected( 1, 2, 12 ); + Date d1(1, 2, 12); + Date d2 = d1.addYears(-1); + Date expected(1, 2, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(addYears05, Date) { - Date d1( 2014, 8, 12 ); - Date d2 = d1.addYears( 31 ); - Date expected( 2045, 8, 12 ); + Date d1(2014, 8, 12); + Date d2 = d1.addYears(31); + Date expected(2045, 8, 12); Date actual = d1; - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } TEST(addYears06, Date) { - Date d1( 1996, 9, 30 ); - Date d2 = d1.addYears( -11 ); - Date expected( 1985, 9, 30 ); - Date actual = d1; - CHECK_EQUAL( expected, actual ) -} -TEST( stream01, Date ) -{ - Date object( 2014, 8, 22 ); - std::stringstream ss1; - toStream( ss1, object ); - std::string expected = "2014-08-22"; - std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) - object.setValue( 2014, 2, 1 ); - std::stringstream ss2; - toStream( ss2, object ); - toStream( ss2, object ); - expected = "2014-02-012014-02-01"; - actual = ss2.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream ss3; - ss3 << object; - expected = "2014-02-01"; - actual = ss3.str(); - CHECK_EQUAL( expected, actual ) -} - -TEST( stream02, Date ) -{ - Date object( 2001, 03, 25 ); - std::stringstream ss1; - toStream( ss1, object ); - std::string expected = "2001-03-25"; - std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) - object.setValue( 13, 12, 1 ); - std::stringstream ss2; - ss2 << object << object; - expected = "0013-12-010013-12-01"; - actual = ss2.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream ss3; - ss3 << object; - expected = "0013-12-01"; - actual = ss3.str(); - CHECK_EQUAL( expected, actual ) + Date d1(1996, 9, 30); + Date d2 = d1.addYears(-11); + Date expected(1985, 9, 30); + Date actual = d1; + CHECK_EQUAL(expected, actual) +} + +TEST(stream01, Date) +{ + Date object(2014, 8, 22); + std::stringstream ss1; + toStream(ss1, object); + std::string expected = "2014-08-22"; + std::string actual = ss1.str(); + CHECK_EQUAL(expected, actual) + object.setValue(2014, 2, 1); + std::stringstream ss2; + toStream(ss2, object); + toStream(ss2, object); + expected = "2014-02-012014-02-01"; + actual = ss2.str(); + CHECK_EQUAL(expected, actual) + std::stringstream ss3; + ss3 << object; + expected = "2014-02-01"; + actual = ss3.str(); + CHECK_EQUAL(expected, actual) +} + +TEST(stream02, Date) +{ + Date object(2001, 03, 25); + std::stringstream ss1; + toStream(ss1, object); + std::string expected = "2001-03-25"; + std::string actual = ss1.str(); + CHECK_EQUAL(expected, actual) + object.setValue(13, 12, 1); + std::stringstream ss2; + ss2 << object << object; + expected = "0013-12-010013-12-01"; + actual = ss2.str(); + CHECK_EQUAL(expected, actual) + std::stringstream ss3; + ss3 << object; + expected = "0013-12-01"; + actual = ss3.str(); + CHECK_EQUAL(expected, actual) } #endif diff --git a/Sourcecode/private/mxtest/core/DecimalsTest.cpp b/Sourcecode/private/mxtest/core/DecimalsTest.cpp index 246c39b4a..60dc1f9f5 100644 --- a/Sourcecode/private/mxtest/core/DecimalsTest.cpp +++ b/Sourcecode/private/mxtest/core/DecimalsTest.cpp @@ -6,958 +6,956 @@ #ifdef MX_COMPILE_CORE_TESTS - #include "cpul/cpulTestHarness.h" - #include "mx/core/Decimals.h" - #include +#include "cpul/cpulTestHarness.h" +#include "mx/core/Decimals.h" +#include using namespace mx::core; DecimalType kThreshold = 0.00001; // using DecimalType = double; -TEST( DecimalType, Decimals ) +TEST(DecimalType, Decimals) { DecimalType d = 0; - CHECK_DOUBLES_EQUAL( 0, d, kThreshold ) + CHECK_DOUBLES_EQUAL(0, d, kThreshold) } // class Decimal -TEST( Decimal01, Decimals ) +TEST(Decimal01, Decimals) { Decimal d; DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Decimal02, Decimals ) +TEST(Decimal02, Decimals) { - Decimal d( 1.234 ); + Decimal d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Decimal02b, Decimals ) +TEST(Decimal02b, Decimals) { - Decimal d( 123456789012.123456789012 ); + Decimal d(123456789012.123456789012); DecimalType expected = 123456789012.123456789012; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Decimal03, Decimals ) +TEST(Decimal03, Decimals) { - Decimal d( 1.234 ); - d.setValue( 0.00000384 ); + Decimal d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Decimal04, Decimals ) +TEST(Decimal04, Decimals) { - Decimal d( 1.234 ); - d.setValue( 0.00000384109 ); + Decimal d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Decimal05, Decimals ) +TEST(Decimal05, Decimals) { - Decimal d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-435.249" ); + Decimal d(1.234); + d.setValue(0.00000384); + d.parse("-435.249"); DecimalType expected = -435.249; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Decimal06, Decimals ) +TEST(Decimal06, Decimals) { - Decimal d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + Decimal d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -using functype = std::function; +using functype = std::function; using minmax = std::pair; -inline minmax makeFuncs( DecimalType min, DecimalType max ) +inline minmax makeFuncs(DecimalType min, DecimalType max) { - const auto fmin = [min]( DecimalType value ) - { - if( value < min ) + const auto fmin = [min](DecimalType value) { + if (value < min) { return min; } return value; }; - const auto fmax = [max]( DecimalType value ) - { - if( value > max ) + const auto fmax = [max](DecimalType value) { + if (value > max) { return max; } return value; }; - return std::make_pair( functype( fmin ), functype( fmax ) ); + return std::make_pair(functype(fmin), functype(fmax)); } -inline DecimalRange decimalRange( DecimalType min, DecimalType max, DecimalType value ) +inline DecimalRange decimalRange(DecimalType min, DecimalType max, DecimalType value) { - const auto fpair = makeFuncs( min, max ); - return DecimalRange{ fpair.first, fpair.second, value }; + const auto fpair = makeFuncs(min, max); + return DecimalRange{fpair.first, fpair.second, value}; } // class DecimalRange : public Decimal -TEST( DecimalRange01, Decimals ) +TEST(DecimalRange01, Decimals) { - auto d = decimalRange( -1, 1, 0 ); + auto d = decimalRange(-1, 1, 0); DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DecimalRange02, Decimals ) +TEST(DecimalRange02, Decimals) { - auto d = decimalRange( -1, 1, 1.234 ); + auto d = decimalRange(-1, 1, 1.234); DecimalType expected = 1; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DecimalRange02b, Decimals ) +TEST(DecimalRange02b, Decimals) { - auto d = decimalRange( -1, 123456789013, 123456789012.123456789012 ); + auto d = decimalRange(-1, 123456789013, 123456789012.123456789012); DecimalType expected = 123456789012.123456789012; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DecimalRange03, Decimals ) +TEST(DecimalRange03, Decimals) { - auto d = decimalRange( -100, 100, 1.234 ); - d.setValue( 0.00000384 ); + auto d = decimalRange(-100, 100, 1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DecimalRange04, Decimals ) +TEST(DecimalRange04, Decimals) { - auto d = decimalRange( -1, 1, 1.234 ); - d.setValue( 0.00000384109 ); + auto d = decimalRange(-1, 1, 1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( DecimalRange05, Decimals ) +TEST(DecimalRange05, Decimals) { - auto d = decimalRange( -1, 1, 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-0.3164978546312" ); + auto d = decimalRange(-1, 1, 1.234); + d.setValue(0.00000384); + d.parse("-0.3164978546312"); DecimalType expected = -0.3164978546312; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DecimalRange06, Decimals ) +TEST(DecimalRange06, Decimals) { - auto d = decimalRange( -1, 1, 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + auto d = decimalRange(-1, 1, 1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } // class PositiveDecimal: public Decimal -TEST( PositiveDecimal01, Decimals ) +TEST(PositiveDecimal01, Decimals) { PositiveDecimal d; DecimalType expected = 1; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDecimal02, Decimals ) +TEST(PositiveDecimal02, Decimals) { - PositiveDecimal d( 1.234 ); + PositiveDecimal d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDecimal02b, Decimals ) +TEST(PositiveDecimal02b, Decimals) { - PositiveDecimal d( -123456789012.123456789012 ); + PositiveDecimal d(-123456789012.123456789012); DecimalType expected = NON_ZERO_AMOUNT; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDecimal03, Decimals ) +TEST(PositiveDecimal03, Decimals) { - PositiveDecimal d( 1.234 ); - d.setValue( 0.00000384 ); + PositiveDecimal d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDecimal04, Decimals ) +TEST(PositiveDecimal04, Decimals) { - PositiveDecimal d( 1.234 ); - d.setValue( 0.00000384109 ); + PositiveDecimal d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveDecimal05, Decimals ) +TEST(PositiveDecimal05, Decimals) { - PositiveDecimal d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-0.3164978546312" ); + PositiveDecimal d(1.234); + d.setValue(0.00000384); + d.parse("-0.3164978546312"); DecimalType expected = NON_ZERO_AMOUNT; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDecimal06, Decimals ) +TEST(PositiveDecimal06, Decimals) { - PositiveDecimal d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + PositiveDecimal d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } // class NonNegativeDecimal: public Decimal -TEST( NonNegativeDecimal01, Decimals ) +TEST(NonNegativeDecimal01, Decimals) { NonNegativeDecimal d; DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( NonNegativeDecimal02, Decimals ) +TEST(NonNegativeDecimal02, Decimals) { - NonNegativeDecimal d( 1.234 ); + NonNegativeDecimal d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( NonNegativeDecimal02b, Decimals ) +TEST(NonNegativeDecimal02b, Decimals) { - NonNegativeDecimal d( -123456789012.123456789012 ); + NonNegativeDecimal d(-123456789012.123456789012); DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( NonNegativeDecimal03, Decimals ) +TEST(NonNegativeDecimal03, Decimals) { - NonNegativeDecimal d( 1.234 ); - d.setValue( 0.00000384 ); + NonNegativeDecimal d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( NonNegativeDecimal04, Decimals ) +TEST(NonNegativeDecimal04, Decimals) { - NonNegativeDecimal d( 1.234 ); - d.setValue( 0.00000384109 ); + NonNegativeDecimal d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( NonNegativeDecimal05, Decimals ) +TEST(NonNegativeDecimal05, Decimals) { - NonNegativeDecimal d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-0.3164978546312" ); + NonNegativeDecimal d(1.234); + d.setValue(0.00000384); + d.parse("-0.3164978546312"); DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( NonNegativeDecimal06, Decimals ) +TEST(NonNegativeDecimal06, Decimals) { - NonNegativeDecimal d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + NonNegativeDecimal d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } // using DivisionsValue = Decimal; -TEST( DivisionsValue01, Decimals ) +TEST(DivisionsValue01, Decimals) { DivisionsValue d; DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DivisionsValue02, Decimals ) +TEST(DivisionsValue02, Decimals) { - DivisionsValue d( 1.234 ); + DivisionsValue d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DivisionsValue02b, Decimals ) +TEST(DivisionsValue02b, Decimals) { - DivisionsValue d( 123456789012.123456789012 ); + DivisionsValue d(123456789012.123456789012); DecimalType expected = 123456789012.123456789012; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DivisionsValue03, Decimals ) +TEST(DivisionsValue03, Decimals) { - DivisionsValue d( 1.234 ); - d.setValue( 0.00000384 ); + DivisionsValue d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DivisionsValue04, Decimals ) +TEST(DivisionsValue04, Decimals) { - DivisionsValue d( 1.234 ); - d.setValue( 0.00000384109 ); + DivisionsValue d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( DivisionsValue05, Decimals ) +TEST(DivisionsValue05, Decimals) { - DivisionsValue d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-435.249" ); + DivisionsValue d(1.234); + d.setValue(0.00000384); + d.parse("-435.249"); DecimalType expected = -435.249; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( DivisionsValue06, Decimals ) +TEST(DivisionsValue06, Decimals) { - DivisionsValue d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + DivisionsValue d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } // using MillimetersValue = Decimal; -TEST( MillimetersValue01, Decimals ) +TEST(MillimetersValue01, Decimals) { MillimetersValue d; DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( MillimetersValue02, Decimals ) +TEST(MillimetersValue02, Decimals) { - MillimetersValue d( 1.234 ); + MillimetersValue d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( MillimetersValue02b, Decimals ) +TEST(MillimetersValue02b, Decimals) { - MillimetersValue d( 123456789012.123456789012 ); + MillimetersValue d(123456789012.123456789012); DecimalType expected = 123456789012.123456789012; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( MillimetersValue03, Decimals ) +TEST(MillimetersValue03, Decimals) { - MillimetersValue d( 1.234 ); - d.setValue( 0.00000384 ); + MillimetersValue d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( MillimetersValue04, Decimals ) +TEST(MillimetersValue04, Decimals) { - MillimetersValue d( 1.234 ); - d.setValue( 0.00000384109 ); + MillimetersValue d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( MillimetersValue05, Decimals ) +TEST(MillimetersValue05, Decimals) { - MillimetersValue d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-435.249" ); + MillimetersValue d(1.234); + d.setValue(0.00000384); + d.parse("-435.249"); DecimalType expected = -435.249; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( MillimetersValue06, Decimals ) +TEST(MillimetersValue06, Decimals) { - MillimetersValue d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + MillimetersValue d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } /* MIN = 0, MAX = 100, DEFAULT = 0 */ // class Percent : DecimalRange -TEST( Percent01, Decimals ) +TEST(Percent01, Decimals) { Percent d; DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Percent02, Decimals ) +TEST(Percent02, Decimals) { - Percent d( 1.234 ); + Percent d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Percent02b, Decimals ) +TEST(Percent02b, Decimals) { - Percent d( 123456789012.123456789012 ); + Percent d(123456789012.123456789012); DecimalType expected = 100; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Percent03, Decimals ) +TEST(Percent03, Decimals) { - Percent d( 1.234 ); - d.setValue( 0.00000384 ); + Percent d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Percent04, Decimals ) +TEST(Percent04, Decimals) { - Percent d( 1.234 ); - d.setValue( 0.00000384109 ); + Percent d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Percent05, Decimals ) +TEST(Percent05, Decimals) { - Percent d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "4.249" ); + Percent d(1.234); + d.setValue(0.00000384); + d.parse("4.249"); DecimalType expected = 4.249; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Percent05b, Decimals ) +TEST(Percent05b, Decimals) { - Percent d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-4.249" ); + Percent d(1.234); + d.setValue(0.00000384); + d.parse("-4.249"); DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Percent06, Decimals ) +TEST(Percent06, Decimals) { - Percent d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + Percent d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } // using PositiveDivisionsValue = PositiveDecimal; -TEST( PositiveDivisionsValue01, Decimals ) +TEST(PositiveDivisionsValue01, Decimals) { PositiveDivisionsValue d; DecimalType expected = 1; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDivisionsValue02, Decimals ) +TEST(PositiveDivisionsValue02, Decimals) { - PositiveDivisionsValue d( 1.234 ); + PositiveDivisionsValue d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDivisionsValue02b, Decimals ) +TEST(PositiveDivisionsValue02b, Decimals) { - PositiveDivisionsValue d( -123456789012.123456789012 ); + PositiveDivisionsValue d(-123456789012.123456789012); DecimalType expected = NON_ZERO_AMOUNT; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDivisionsValue03, Decimals ) +TEST(PositiveDivisionsValue03, Decimals) { - PositiveDivisionsValue d( 1.234 ); - d.setValue( 0.00000384 ); + PositiveDivisionsValue d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDivisionsValue04, Decimals ) +TEST(PositiveDivisionsValue04, Decimals) { - PositiveDivisionsValue d( 1.234 ); - d.setValue( 0.00000384109 ); + PositiveDivisionsValue d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveDivisionsValue05, Decimals ) +TEST(PositiveDivisionsValue05, Decimals) { - PositiveDivisionsValue d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-0.3164978546312" ); + PositiveDivisionsValue d(1.234); + d.setValue(0.00000384); + d.parse("-0.3164978546312"); DecimalType expected = NON_ZERO_AMOUNT; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( PositiveDivisionsValue06, Decimals ) +TEST(PositiveDivisionsValue06, Decimals) { - PositiveDivisionsValue d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + PositiveDivisionsValue d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } /* MIN = -180, MAX = 180, DEFAULT = 0 */ // class RotationDegrees : DecimalRange -TEST( RotationDegrees01, Decimals ) +TEST(RotationDegrees01, Decimals) { RotationDegrees d; DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( RotationDegrees02, Decimals ) +TEST(RotationDegrees02, Decimals) { - RotationDegrees d( 1.234 ); + RotationDegrees d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( RotationDegrees02b, Decimals ) +TEST(RotationDegrees02b, Decimals) { - RotationDegrees d( 123456789012.123456789012 ); + RotationDegrees d(123456789012.123456789012); DecimalType expected = 180; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( RotationDegrees03, Decimals ) +TEST(RotationDegrees03, Decimals) { - RotationDegrees d( 1.234 ); - d.setValue( 0.00000384 ); + RotationDegrees d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( RotationDegrees04, Decimals ) +TEST(RotationDegrees04, Decimals) { - RotationDegrees d( 1.234 ); - d.setValue( -999 ); + RotationDegrees d(1.234); + d.setValue(-999); std::string expected = "-180"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( RotationDegrees05, Decimals ) +TEST(RotationDegrees05, Decimals) { - RotationDegrees d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "4.249" ); + RotationDegrees d(1.234); + d.setValue(0.00000384); + d.parse("4.249"); DecimalType expected = 4.249; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( RotationDegrees05b, Decimals ) +TEST(RotationDegrees05b, Decimals) { - RotationDegrees d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-466.249" ); + RotationDegrees d(1.234); + d.setValue(0.00000384); + d.parse("-466.249"); DecimalType expected = -180; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( RotationDegrees06, Decimals ) +TEST(RotationDegrees06, Decimals) { - RotationDegrees d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + RotationDegrees d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } // using Semitones = Decimal; -TEST( Semitones01, Decimals ) +TEST(Semitones01, Decimals) { Semitones d; DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Semitones02, Decimals ) +TEST(Semitones02, Decimals) { - Semitones d( 1.234 ); + Semitones d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Semitones02b, Decimals ) +TEST(Semitones02b, Decimals) { - Semitones d( 123456789012.123456789012 ); + Semitones d(123456789012.123456789012); DecimalType expected = 123456789012.123456789012; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Semitones03, Decimals ) +TEST(Semitones03, Decimals) { - Semitones d( 1.234 ); - d.setValue( 0.00000384 ); + Semitones d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Semitones04, Decimals ) +TEST(Semitones04, Decimals) { - Semitones d( 1.234 ); - d.setValue( 0.00000384109 ); + Semitones d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Semitones05, Decimals ) +TEST(Semitones05, Decimals) { - Semitones d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-435.249" ); + Semitones d(1.234); + d.setValue(0.00000384); + d.parse("-435.249"); DecimalType expected = -435.249; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( Semitones06, Decimals ) +TEST(Semitones06, Decimals) { - Semitones d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + Semitones d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } // using TenthsValue = Decimal; -TEST( TenthsValue01, Decimals ) +TEST(TenthsValue01, Decimals) { TenthsValue d; DecimalType expected = 0; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TenthsValue02, Decimals ) +TEST(TenthsValue02, Decimals) { - TenthsValue d( 1.234 ); + TenthsValue d(1.234); DecimalType expected = 1.234; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TenthsValue02b, Decimals ) +TEST(TenthsValue02b, Decimals) { - TenthsValue d( 123456789012.123456789012 ); + TenthsValue d(123456789012.123456789012); DecimalType expected = 123456789012.123456789012; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TenthsValue03, Decimals ) +TEST(TenthsValue03, Decimals) { - TenthsValue d( 1.234 ); - d.setValue( 0.00000384 ); + TenthsValue d(1.234); + d.setValue(0.00000384); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TenthsValue04, Decimals ) +TEST(TenthsValue04, Decimals) { - TenthsValue d( 1.234 ); - d.setValue( 0.00000384109 ); + TenthsValue d(1.234); + d.setValue(0.00000384109); std::string expected = "0.000004"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( TenthsValue05, Decimals ) +TEST(TenthsValue05, Decimals) { - TenthsValue d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-435.249" ); + TenthsValue d(1.234); + d.setValue(0.00000384); + d.parse("-435.249"); DecimalType expected = -435.249; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TenthsValue06, Decimals ) +TEST(TenthsValue06, Decimals) { - TenthsValue d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + TenthsValue d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 0.00000384; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } /* MIN = 2, MAX = N/A, DEFAULT = 2 */ // class TrillBeats: public Decimal -TEST( TrillBeats01, Decimals ) +TEST(TrillBeats01, Decimals) { TrillBeats d; DecimalType expected = 2; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TrillBeats02, Decimals ) +TEST(TrillBeats02, Decimals) { - TrillBeats d( 1.234 ); + TrillBeats d(1.234); DecimalType expected = 2; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TrillBeats02b, Decimals ) +TEST(TrillBeats02b, Decimals) { - TrillBeats d( 123456789012.123456789012 ); + TrillBeats d(123456789012.123456789012); DecimalType expected = 123456789012.123456789012; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TrillBeats03, Decimals ) +TEST(TrillBeats03, Decimals) { - TrillBeats d( 1.234 ); - d.setValue( 0.00000384 ); + TrillBeats d(1.234); + d.setValue(0.00000384); DecimalType expected = 2; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TrillBeats04, Decimals ) +TEST(TrillBeats04, Decimals) { - TrillBeats d( 1.234 ); - d.setValue( -999 ); + TrillBeats d(1.234); + d.setValue(-999); std::string expected = "2"; - std::string actual = toString( d, 11 ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(d, 11); + CHECK_EQUAL(expected, actual) std::stringstream ss; - toStream( ss, d, 11 ); + toStream(ss, d, 11); actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) - ss.str( "" ); + ss.str(""); ss << d; actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( TrillBeats05, Decimals ) +TEST(TrillBeats05, Decimals) { - TrillBeats d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "4.249" ); + TrillBeats d(1.234); + d.setValue(0.00000384); + d.parse("4.249"); DecimalType expected = 4.249; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TrillBeats05b, Decimals ) +TEST(TrillBeats05b, Decimals) { - TrillBeats d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "-466.249" ); + TrillBeats d(1.234); + d.setValue(0.00000384); + d.parse("-466.249"); DecimalType expected = 2; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } -TEST( TrillBeats06, Decimals ) +TEST(TrillBeats06, Decimals) { - TrillBeats d( 1.234 ); - d.setValue( 0.00000384 ); - d.parse( "- 435.249" ); + TrillBeats d(1.234); + d.setValue(0.00000384); + d.parse("- 435.249"); DecimalType expected = 2; DecimalType actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, kThreshold ) + CHECK_DOUBLES_EQUAL(expected, actual, kThreshold) } #endif diff --git a/Sourcecode/private/mxtest/core/DefaultsTest.cpp b/Sourcecode/private/mxtest/core/DefaultsTest.cpp index 77d6a72dd..3fd05f712 100644 --- a/Sourcecode/private/mxtest/core/DefaultsTest.cpp +++ b/Sourcecode/private/mxtest/core/DefaultsTest.cpp @@ -6,156 +6,158 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/AppearanceTest.h" #include "mxtest/core/DefaultsTest.h" -#include "mxtest/core/ScalingTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/LayoutGroupTest.h" -#include "mxtest/core/AppearanceTest.h" +#include "mxtest/core/ScalingTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Defaults ) +TEST(Test01, Defaults) { TestMode v = TestMode::one; - DefaultsPtr object = tgenDefaults( v ); - stringstream expected; - tgenDefaultsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + DefaultsPtr object = tgenDefaults(v); + stringstream expected; + tgenDefaultsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Defaults ) + +TEST(Test02, Defaults) { TestMode v = TestMode::two; - DefaultsPtr object = tgenDefaults( v ); - stringstream expected; - tgenDefaultsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + DefaultsPtr object = tgenDefaults(v); + stringstream expected; + tgenDefaultsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Defaults ) + +TEST(Test03, Defaults) { TestMode v = TestMode::three; - DefaultsPtr object = tgenDefaults( v ); - stringstream expected; - tgenDefaultsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + DefaultsPtr object = tgenDefaults(v); + stringstream expected; + tgenDefaultsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - DefaultsPtr tgenDefaults( TestMode v ) +DefaultsPtr tgenDefaults(TestMode v) +{ + DefaultsPtr o = makeDefaults(); + switch (v) { - DefaultsPtr o = makeDefaults(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasScaling( true ); - o->setScaling( tgenScaling( v ) ); - o->setLayoutGroup( tgenLayoutGroup( v ) ); - o->setHasAppearance( true ); - o->setAppearance( tgenAppearance( v ) ); - o->setHasMusicFont( true ); - o->getMusicFont()->getAttributes()->hasFontFamily = true; - o->getMusicFont()->getAttributes()->fontFamily = CommaSeparatedText( "one,two,three" ); - auto l1 = makeLyricFont(); - l1->getAttributes()->hasFontWeight = true; - l1->getAttributes()->fontWeight = FontWeight::bold; - auto l2 = makeLyricFont(); - l2->getAttributes()->hasFontSize = true; - l2->getAttributes()->fontSize = FontSize( CssFontSize::large ); - o->addLyricFont( l1 ); - o->addLyricFont( l2 ); - } - break; - case TestMode::three: - { - o->setHasScaling( true ); - o->setScaling( tgenScaling( v ) ); - o->setLayoutGroup( tgenLayoutGroup( v ) ); - o->setHasAppearance( true ); - o->setAppearance( tgenAppearance( v ) ); - o->setHasMusicFont( true ); - o->getMusicFont()->getAttributes()->hasFontStyle = true; - o->getMusicFont()->getAttributes()->fontStyle = FontStyle::italic; - auto l1 = makeLyricFont(); - l1->getAttributes()->hasName = true; - l1->getAttributes()->name = XsToken( "Hello Bones" ); - auto l2 = makeLyricFont(); - l2->getAttributes()->hasNumber = true; - l2->getAttributes()->number = XsToken( "Hello Bish" ); - o->addLyricFont( l1 ); - o->addLyricFont( l2 ); - auto lang1 = makeLyricLanguage(); - lang1->getAttributes()->hasName = true; - lang1->getAttributes()->name = XsToken( "lang1" ); - o->addLyricLanguage( lang1 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasScaling(true); + o->setScaling(tgenScaling(v)); + o->setLayoutGroup(tgenLayoutGroup(v)); + o->setHasAppearance(true); + o->setAppearance(tgenAppearance(v)); + o->setHasMusicFont(true); + o->getMusicFont()->getAttributes()->hasFontFamily = true; + o->getMusicFont()->getAttributes()->fontFamily = CommaSeparatedText("one,two,three"); + auto l1 = makeLyricFont(); + l1->getAttributes()->hasFontWeight = true; + l1->getAttributes()->fontWeight = FontWeight::bold; + auto l2 = makeLyricFont(); + l2->getAttributes()->hasFontSize = true; + l2->getAttributes()->fontSize = FontSize(CssFontSize::large); + o->addLyricFont(l1); + o->addLyricFont(l2); } - void tgenDefaultsExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->setHasScaling(true); + o->setScaling(tgenScaling(v)); + o->setLayoutGroup(tgenLayoutGroup(v)); + o->setHasAppearance(true); + o->setAppearance(tgenAppearance(v)); + o->setHasMusicFont(true); + o->getMusicFont()->getAttributes()->hasFontStyle = true; + o->getMusicFont()->getAttributes()->fontStyle = FontStyle::italic; + auto l1 = makeLyricFont(); + l1->getAttributes()->hasName = true; + l1->getAttributes()->name = XsToken("Hello Bones"); + auto l2 = makeLyricFont(); + l2->getAttributes()->hasNumber = true; + l2->getAttributes()->number = XsToken("Hello Bish"); + o->addLyricFont(l1); + o->addLyricFont(l2); + auto lang1 = makeLyricLanguage(); + lang1->getAttributes()->hasName = true; + lang1->getAttributes()->name = XsToken("lang1"); + o->addLyricLanguage(lang1); + } + break; + default: + break; + } + return o; +} + +void tgenDefaultsExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenScalingExpected( os, i+1, v ); os << std::endl; - tgenLayoutGroupExpected( os, i+1, v ); os << std::endl; - tgenAppearanceExpected( os, i+1, v ); os << std::endl; - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenScalingExpected( os, i+1, v ); os << std::endl; - tgenLayoutGroupExpected( os, i+1, v ); os << std::endl; - tgenAppearanceExpected( os, i+1, v ); os << std::endl; - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenScalingExpected(os, i + 1, v); + os << std::endl; + tgenLayoutGroupExpected(os, i + 1, v); + os << std::endl; + tgenAppearanceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenScalingExpected(os, i + 1, v); + os << std::endl; + tgenLayoutGroupExpected(os, i + 1, v); + os << std::endl; + tgenAppearanceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DefaultsTest.h b/Sourcecode/private/mxtest/core/DefaultsTest.h index f33ac5416..356baab07 100644 --- a/Sourcecode/private/mxtest/core/DefaultsTest.h +++ b/Sourcecode/private/mxtest/core/DefaultsTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::DefaultsPtr tgenDefaults( TestMode v ); - void tgenDefaultsExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::DefaultsPtr tgenDefaults(TestMode v); +void tgenDefaultsExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DegreeAlterTest.cpp b/Sourcecode/private/mxtest/core/DegreeAlterTest.cpp index ba410cb1c..29decb431 100644 --- a/Sourcecode/private/mxtest/core/DegreeAlterTest.cpp +++ b/Sourcecode/private/mxtest/core/DegreeAlterTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, DegreeAlter ) +TEST(Test01, DegreeAlter) { - std::string indentString( INDENT ); - Semitones value1 = Semitones{ 1 }; - Semitones value2 = Semitones{ -2 }; - DegreeAlter object1; - DegreeAlter object2( value2 ); - DegreeAlterAttributesPtr attributes1 = std::make_shared(); - DegreeAlterAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Semitones value1 = Semitones{1}; + Semitones value2 = Semitones{-2}; + DegreeAlter object1; + DegreeAlter object2(value2); + DegreeAlterAttributesPtr attributes1 = std::make_shared(); + DegreeAlterAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasPlusMinus = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(-2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(-2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DegreeTest.cpp b/Sourcecode/private/mxtest/core/DegreeTest.cpp index d7b141c4c..7379b81a2 100644 --- a/Sourcecode/private/mxtest/core/DegreeTest.cpp +++ b/Sourcecode/private/mxtest/core/DegreeTest.cpp @@ -6,123 +6,119 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/DegreeTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Degree ) +TEST(Test01, Degree) { TestMode v = TestMode::one; - DegreePtr object = tgenDegree( v ); - stringstream expected; - tgenDegreeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + DegreePtr object = tgenDegree(v); + stringstream expected; + tgenDegreeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Degree ) + +TEST(Test02, Degree) { TestMode v = TestMode::two; - DegreePtr object = tgenDegree( v ); - stringstream expected; - tgenDegreeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + DegreePtr object = tgenDegree(v); + stringstream expected; + tgenDegreeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Degree ) + +TEST(Test03, Degree) { TestMode v = TestMode::three; - DegreePtr object = tgenDegree( v ); - stringstream expected; - tgenDegreeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + DegreePtr object = tgenDegree(v); + stringstream expected; + tgenDegreeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - DegreePtr tgenDegree( TestMode v ) +DegreePtr tgenDegree(TestMode v) +{ + DegreePtr o = makeDegree(); + switch (v) { - DegreePtr o = makeDegree(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getDegreeAlter()->setValue( Semitones( 1.01 ) ); - o->getDegreeType()->setValue( DegreeTypeValue::subtract ); - o->getDegreeValue()->setValue( PositiveInteger( 9 ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::no; - o->getDegreeAlter()->setValue( Semitones( -2.01 ) ); - o->getDegreeType()->setValue( DegreeTypeValue::alter ); - o->getDegreeValue()->setValue( PositiveInteger( 7 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getDegreeAlter()->setValue(Semitones(1.01)); + o->getDegreeType()->setValue(DegreeTypeValue::subtract); + o->getDegreeValue()->setValue(PositiveInteger(9)); + } + break; + case TestMode::three: { + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::no; + o->getDegreeAlter()->setValue(Semitones(-2.01)); + o->getDegreeType()->setValue(DegreeTypeValue::alter); + o->getDegreeValue()->setValue(PositiveInteger(7)); + } + break; + default: + break; } - void tgenDegreeExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenDegreeExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(1)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i+1, R"(add)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(9)" ); - streamLine( os, i+1, R"(1.01)" ); - streamLine( os, i+1, R"(subtract)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(7)" ); - streamLine( os, i+1, R"(-2.01)" ); - streamLine( os, i+1, R"(alter)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(1)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i + 1, R"(add)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(9)"); + streamLine(os, i + 1, R"(1.01)"); + streamLine(os, i + 1, R"(subtract)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(7)"); + streamLine(os, i + 1, R"(-2.01)"); + streamLine(os, i + 1, R"(alter)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DegreeTest.h b/Sourcecode/private/mxtest/core/DegreeTest.h index 96b6e1adb..67c84910b 100644 --- a/Sourcecode/private/mxtest/core/DegreeTest.h +++ b/Sourcecode/private/mxtest/core/DegreeTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::DegreePtr tgenDegree( TestMode v ); - void tgenDegreeExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::DegreePtr tgenDegree(TestMode v); +void tgenDegreeExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DegreeTypeTest.cpp b/Sourcecode/private/mxtest/core/DegreeTypeTest.cpp index 08ed03a45..be28fe67f 100644 --- a/Sourcecode/private/mxtest/core/DegreeTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/DegreeTypeTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, DegreeType ) +TEST(Test01, DegreeType) { - std::string indentString( INDENT ); - DegreeTypeValue value1 = DegreeTypeValue::add; - DegreeTypeValue value2 = DegreeTypeValue::subtract; - DegreeType object1; - DegreeType object2( value2 ); - DegreeTypeAttributesPtr attributes1 = std::make_shared(); - DegreeTypeAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + DegreeTypeValue value1 = DegreeTypeValue::add; + DegreeTypeValue value2 = DegreeTypeValue::subtract; + DegreeType object1; + DegreeType object2(value2); + DegreeTypeAttributesPtr attributes1 = std::make_shared(); + DegreeTypeAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasText = true; - attributes1->text = XsToken{ "Some Text" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(add)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(subtract)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->text = XsToken{"Some Text"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(add)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(subtract)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DegreeValueTest.cpp b/Sourcecode/private/mxtest/core/DegreeValueTest.cpp index 5447d5e63..fa3a120e7 100644 --- a/Sourcecode/private/mxtest/core/DegreeValueTest.cpp +++ b/Sourcecode/private/mxtest/core/DegreeValueTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, DegreeValue ) +TEST(Test01, DegreeValue) { - std::string indentString( INDENT ); - PositiveInteger value1{ 3 }; - PositiveInteger value2{ 4 }; - DegreeValue object1; - DegreeValue object2( value2 ); - DegreeValueAttributesPtr attributes1 = std::make_shared(); - DegreeValueAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + PositiveInteger value1{3}; + PositiveInteger value2{4}; + DegreeValue object1; + DegreeValue object2(value2); + DegreeValueAttributesPtr attributes1 = std::make_shared(); + DegreeValueAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasText = true; - attributes1->text = XsToken{ "sometext" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->text = XsToken{"sometext"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DelayedInvertedTurnTest.cpp b/Sourcecode/private/mxtest/core/DelayedInvertedTurnTest.cpp index 297c8b7f8..855d604ed 100644 --- a/Sourcecode/private/mxtest/core/DelayedInvertedTurnTest.cpp +++ b/Sourcecode/private/mxtest/core/DelayedInvertedTurnTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, DelayedInvertedTurn ) +TEST(Test01, DelayedInvertedTurn) { - std::string indentString( INDENT ); - DelayedInvertedTurn object1; - DelayedInvertedTurn object2; - DelayedInvertedTurnAttributesPtr attributes1 = std::make_shared(); - DelayedInvertedTurnAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + DelayedInvertedTurn object1; + DelayedInvertedTurn object2; + DelayedInvertedTurnAttributesPtr attributes1 = std::make_shared(); + DelayedInvertedTurnAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->defaultX = TenthsValue{0.1}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DelayedTurnTest.cpp b/Sourcecode/private/mxtest/core/DelayedTurnTest.cpp index daa5b10e9..f16a28bc9 100644 --- a/Sourcecode/private/mxtest/core/DelayedTurnTest.cpp +++ b/Sourcecode/private/mxtest/core/DelayedTurnTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, DelayedTurn ) +TEST(Test01, DelayedTurn) { - std::string indentString( INDENT ); - DelayedTurn object1; - DelayedTurn object2; - DelayedTurnAttributesPtr attributes1 = std::make_shared(); - DelayedTurnAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + DelayedTurn object1; + DelayedTurn object2; + DelayedTurnAttributesPtr attributes1 = std::make_shared(); + DelayedTurnAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->defaultX = TenthsValue{0.1}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DetachedLegatoTest.cpp b/Sourcecode/private/mxtest/core/DetachedLegatoTest.cpp index cd2b7f2a9..ab76885eb 100644 --- a/Sourcecode/private/mxtest/core/DetachedLegatoTest.cpp +++ b/Sourcecode/private/mxtest/core/DetachedLegatoTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, DetachedLegato ) +TEST(Test01, DetachedLegato) { - std::string indentString( INDENT ); - DetachedLegato object1; - DetachedLegato object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + DetachedLegato object1; + DetachedLegato object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DiatonicTest.cpp b/Sourcecode/private/mxtest/core/DiatonicTest.cpp index 81cc629fe..93f767076 100644 --- a/Sourcecode/private/mxtest/core/DiatonicTest.cpp +++ b/Sourcecode/private/mxtest/core/DiatonicTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Diatonic ) +TEST(Test01, Diatonic) { - std::string indentString( INDENT ); - Integer value1{ 2 }; - Integer value2{ 3 }; - Diatonic object1; - Diatonic object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Integer value1{2}; + Integer value2{3}; + Diatonic object1; + Diatonic object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DirectionTest.cpp b/Sourcecode/private/mxtest/core/DirectionTest.cpp index 0f3e721ef..29213bab6 100644 --- a/Sourcecode/private/mxtest/core/DirectionTest.cpp +++ b/Sourcecode/private/mxtest/core/DirectionTest.cpp @@ -6,188 +6,182 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/DirectionTest.h" #include "mxtest/core/DirectionTypeTest.h" #include "mxtest/core/EditorialVoiceGroupTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/SoundTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Direction ) +TEST(Test01, Direction) { TestMode v = TestMode::one; - DirectionPtr object = tgenDirection( v ); - stringstream expected; - tgenDirectionExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + DirectionPtr object = tgenDirection(v); + stringstream expected; + tgenDirectionExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Direction ) + +TEST(Test02, Direction) { TestMode v = TestMode::two; - DirectionPtr object = tgenDirection( v ); - stringstream expected; - tgenDirectionExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + DirectionPtr object = tgenDirection(v); + stringstream expected; + tgenDirectionExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Direction ) + +TEST(Test03, Direction) { TestMode v = TestMode::three; - DirectionPtr object = tgenDirection( v ); - stringstream expected; - tgenDirectionExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + DirectionPtr object = tgenDirection(v); + stringstream expected; + tgenDirectionExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - DirectionPtr tgenDirection( TestMode v ) +DirectionPtr tgenDirection(TestMode v) +{ + DirectionPtr o = makeDirection(); + switch (v) { - DirectionPtr o = makeDirection(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasDirective = true; - o->getAttributes()->directive = YesNo::yes; - o->addDirectionType( tgenDirectionType( v ) ); - o->removeDirectionType( o->getDirectionTypeSet().cbegin() ); - auto d = makeDirectionType(); - d->setChoice( DirectionType::Choice::coda ); - o->addDirectionType( d ); - o->setHasOffset( true ); - o->getOffset()->setValue( DivisionsValue( 3.3 ) ); - o->setEditorialVoiceDirectionGroup( tgenEditorialVoiceDirectionGroup( v ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasDirective = true; - o->getAttributes()->directive = YesNo::no; - o->getAttributes()->hasPlacement = true; - o->getAttributes()->placement = AboveBelow::below; - o->addDirectionType( tgenDirectionType( v ) ); - o->removeDirectionType( o->getDirectionTypeSet().cbegin() ); - auto d = makeDirectionType(); - d->setChoice( DirectionType::Choice::dynamics ); - (*d->getDynamicsSet().cbegin())->setValue( DynamicsValue( DynamicsEnum::ffff ) ); - o->addDirectionType( d ); - o->setEditorialVoiceDirectionGroup( tgenEditorialVoiceDirectionGroup( v ) ); - o->setHasStaff( true ); - o->getStaff()->setValue( PositiveInteger( 2 ) ); - o->setHasSound( true ); - o->setSound( tgenSound( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasDirective = true; + o->getAttributes()->directive = YesNo::yes; + o->addDirectionType(tgenDirectionType(v)); + o->removeDirectionType(o->getDirectionTypeSet().cbegin()); + auto d = makeDirectionType(); + d->setChoice(DirectionType::Choice::coda); + o->addDirectionType(d); + o->setHasOffset(true); + o->getOffset()->setValue(DivisionsValue(3.3)); + o->setEditorialVoiceDirectionGroup(tgenEditorialVoiceDirectionGroup(v)); } - EditorialVoiceDirectionGroupPtr tgenEditorialVoiceDirectionGroup( TestMode v ) + break; + case TestMode::three: { + o->getAttributes()->hasDirective = true; + o->getAttributes()->directive = YesNo::no; + o->getAttributes()->hasPlacement = true; + o->getAttributes()->placement = AboveBelow::below; + o->addDirectionType(tgenDirectionType(v)); + o->removeDirectionType(o->getDirectionTypeSet().cbegin()); + auto d = makeDirectionType(); + d->setChoice(DirectionType::Choice::dynamics); + (*d->getDynamicsSet().cbegin())->setValue(DynamicsValue(DynamicsEnum::ffff)); + o->addDirectionType(d); + o->setEditorialVoiceDirectionGroup(tgenEditorialVoiceDirectionGroup(v)); + o->setHasStaff(true); + o->getStaff()->setValue(PositiveInteger(2)); + o->setHasSound(true); + o->setSound(tgenSound(v)); + } + break; + default: + break; + } + return o; +} + +EditorialVoiceDirectionGroupPtr tgenEditorialVoiceDirectionGroup(TestMode v) +{ + EditorialVoiceDirectionGroupPtr o = makeEditorialVoiceDirectionGroup(); + switch (v) { - EditorialVoiceDirectionGroupPtr o = makeEditorialVoiceDirectionGroup(); - switch ( v ) - { - case TestMode::one: - { - } - break; - case TestMode::two: - { - o->setHasLevel( true ); - o->getLevel()->setValue( XsString( "LevelTwo" ) ); - o->setHasFootnote( true ); - o->getFootnote()->setValue( XsString( "FootNoteTwo" ) ); - o->setHasVoice( true ); - o->getVoice()->setValue( XsString( "123" ) ); - } - break; - case TestMode::three: - { - o->setHasFootnote( true ); - o->getFootnote()->setValue( XsString( "FootNoteThree" ) ); - o->setHasVoice( true ); - o->getVoice()->setValue( XsString( "456" ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { } - void tgenDirectionExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::two: { + o->setHasLevel(true); + o->getLevel()->setValue(XsString("LevelTwo")); + o->setHasFootnote(true); + o->getFootnote()->setValue(XsString("FootNoteTwo")); + o->setHasVoice(true); + o->getVoice()->setValue(XsString("123")); + } + break; + case TestMode::three: { + o->setHasFootnote(true); + o->getFootnote()->setValue(XsString("FootNoteThree")); + o->setHasVoice(true); + o->getVoice()->setValue(XsString("456")); + } + break; + default: + break; + } + return o; +} + +void tgenDirectionExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenDirectionTypeExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(3.3)" ); - tgenEditorialVoiceGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenDirectionTypeExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+3, R"()" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+1, R"()" ); - tgenEditorialVoiceGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(2)" ); - tgenSoundExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenDirectionTypeExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(3.3)"); + tgenEditorialVoiceGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenDirectionTypeExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 3, R"()"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 1, R"()"); + tgenEditorialVoiceGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(2)"); + tgenSoundExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DirectionTest.h b/Sourcecode/private/mxtest/core/DirectionTest.h index e263d1785..f8db46026 100644 --- a/Sourcecode/private/mxtest/core/DirectionTest.h +++ b/Sourcecode/private/mxtest/core/DirectionTest.h @@ -6,14 +6,14 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::DirectionPtr tgenDirection( TestMode v ); - mx::core::EditorialVoiceDirectionGroupPtr tgenEditorialVoiceDirectionGroup( TestMode v ); - void tgenDirectionExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::DirectionPtr tgenDirection(TestMode v); +mx::core::EditorialVoiceDirectionGroupPtr tgenEditorialVoiceDirectionGroup(TestMode v); +void tgenDirectionExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DirectionTypeTest.cpp b/Sourcecode/private/mxtest/core/DirectionTypeTest.cpp index 22f077217..c60318955 100644 --- a/Sourcecode/private/mxtest/core/DirectionTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/DirectionTypeTest.cpp @@ -6,122 +6,119 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/DirectionTypeTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PercussionTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, DirectionType ) +TEST(Test01, DirectionType) { TestMode v = TestMode::one; - DirectionTypePtr object = tgenDirectionType( v ); - stringstream expected; - tgenDirectionTypeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + DirectionTypePtr object = tgenDirectionType(v); + stringstream expected; + tgenDirectionTypeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, DirectionType ) + +TEST(Test02, DirectionType) { TestMode v = TestMode::two; - DirectionTypePtr object = tgenDirectionType( v ); - stringstream expected; - tgenDirectionTypeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + DirectionTypePtr object = tgenDirectionType(v); + stringstream expected; + tgenDirectionTypeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, DirectionType ) + +TEST(Test03, DirectionType) { TestMode v = TestMode::three; - DirectionTypePtr object = tgenDirectionType( v ); - stringstream expected; - tgenDirectionTypeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + DirectionTypePtr object = tgenDirectionType(v); + stringstream expected; + tgenDirectionTypeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - DirectionTypePtr tgenDirectionType( TestMode v ) +DirectionTypePtr tgenDirectionType(TestMode v) +{ + DirectionTypePtr o = makeDirectionType(); + switch (v) { - DirectionTypePtr o = makeDirectionType(); - switch ( v ) - { - case TestMode::one: - { - (*o->getRehearsalSet().cbegin())->setValue( XsString( "A" ) ); - } - break; - case TestMode::two: - { - o->setChoice( DirectionType::Choice::pedal ); - o->getPedal()->getAttributes()->hasLine = true; - o->getPedal()->getAttributes()->line = YesNo::yes; - } - break; - case TestMode::three: - { - PercussionPtr p1 = tgenPercussion( TestMode::two ); - PercussionPtr p2 = tgenPercussion( TestMode::three ); - o->setChoice( DirectionType::Choice::percussion ); - o->addPercussion( p1 ); - o->removePercussion( o->getPercussionSet().cbegin() ); - o->addPercussion( p2 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + (*o->getRehearsalSet().cbegin())->setValue(XsString("A")); + } + break; + case TestMode::two: { + o->setChoice(DirectionType::Choice::pedal); + o->getPedal()->getAttributes()->hasLine = true; + o->getPedal()->getAttributes()->line = YesNo::yes; + } + break; + case TestMode::three: { + PercussionPtr p1 = tgenPercussion(TestMode::two); + PercussionPtr p2 = tgenPercussion(TestMode::three); + o->setChoice(DirectionType::Choice::percussion); + o->addPercussion(p1); + o->removePercussion(o->getPercussionSet().cbegin()); + o->addPercussion(p2); + } + break; + default: + break; } - void tgenDirectionTypeExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenDirectionTypeExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(A)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenPercussionExpected(os, i+1, TestMode::two ); - os << std::endl; - tgenPercussionExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(A)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenPercussionExpected(os, i + 1, TestMode::two); + os << std::endl; + tgenPercussionExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DirectionTypeTest.h b/Sourcecode/private/mxtest/core/DirectionTypeTest.h index 2e096503e..e0930b71e 100644 --- a/Sourcecode/private/mxtest/core/DirectionTypeTest.h +++ b/Sourcecode/private/mxtest/core/DirectionTypeTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::DirectionTypePtr tgenDirectionType( TestMode v ); - void tgenDirectionTypeExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::DirectionTypePtr tgenDirectionType(TestMode v); +void tgenDirectionTypeExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DirectiveTest.cpp b/Sourcecode/private/mxtest/core/DirectiveTest.cpp index 43599895d..c160911cd 100644 --- a/Sourcecode/private/mxtest/core/DirectiveTest.cpp +++ b/Sourcecode/private/mxtest/core/DirectiveTest.cpp @@ -6,39 +6,42 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Directive ) +TEST(Test01, Directive) { - Directive object; - stringstream expected; - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + Directive object; + stringstream expected; + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Directive ) + +TEST(Test02, Directive) { - DirectivePtr object = makeDirective( XsString{ "Mork\nde\t\t\n\nbork" } ); + DirectivePtr object = makeDirective(XsString{"Mork\nde\t\t\n\nbork"}); object->getAttributes()->hasLang = true; object->getAttributes()->hasFontFamily = true; - object->getAttributes()->fontFamily = CommaSeparatedText{ "This Font,That Font" }; - stringstream expected; - streamLine( expected, 1, "Mork\nde\t\t\n\nbork", false ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + object->getAttributes()->fontFamily = CommaSeparatedText{"This Font,That Font"}; + stringstream expected; + streamLine(expected, 1, + "Mork\nde\t\t\n\nbork", + false); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/DisplayOctaveTest.cpp b/Sourcecode/private/mxtest/core/DisplayOctaveTest.cpp index 82454872d..439bdc848 100644 --- a/Sourcecode/private/mxtest/core/DisplayOctaveTest.cpp +++ b/Sourcecode/private/mxtest/core/DisplayOctaveTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, DisplayOctave ) +TEST(Test01, DisplayOctave) { - std::string indentString( INDENT ); - OctaveValue value1{ 1 }; - OctaveValue value2{ 2 }; - DisplayOctave object1; - DisplayOctave object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + OctaveValue value1{1}; + OctaveValue value2{2}; + DisplayOctave object1; + DisplayOctave object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.cpp b/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.cpp index 07550e7f5..00cd2d668 100644 --- a/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.cpp @@ -6,114 +6,110 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/DisplayStepOctaveGroupTest.h" -#include "mxtest/core/SystemMarginsTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/SystemDividersTest.h" +#include "mxtest/core/SystemMarginsTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, DisplayStepOctaveGroup ) +TEST(Test01, DisplayStepOctaveGroup) { TestMode v = TestMode::one; - DisplayStepOctaveGroupPtr object = tgenDisplayStepOctaveGroup( v ); - stringstream expected; - tgenDisplayStepOctaveGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + DisplayStepOctaveGroupPtr object = tgenDisplayStepOctaveGroup(v); + stringstream expected; + tgenDisplayStepOctaveGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, DisplayStepOctaveGroup ) + +TEST(Test02, DisplayStepOctaveGroup) { TestMode v = TestMode::two; - DisplayStepOctaveGroupPtr object = tgenDisplayStepOctaveGroup( v ); - stringstream expected; - tgenDisplayStepOctaveGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + DisplayStepOctaveGroupPtr object = tgenDisplayStepOctaveGroup(v); + stringstream expected; + tgenDisplayStepOctaveGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, DisplayStepOctaveGroup ) + +TEST(Test03, DisplayStepOctaveGroup) { TestMode v = TestMode::three; - DisplayStepOctaveGroupPtr object = tgenDisplayStepOctaveGroup( v ); - stringstream expected; - tgenDisplayStepOctaveGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + DisplayStepOctaveGroupPtr object = tgenDisplayStepOctaveGroup(v); + stringstream expected; + tgenDisplayStepOctaveGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - DisplayStepOctaveGroupPtr tgenDisplayStepOctaveGroup( TestMode v ) +DisplayStepOctaveGroupPtr tgenDisplayStepOctaveGroup(TestMode v) +{ + DisplayStepOctaveGroupPtr o = makeDisplayStepOctaveGroup(); + switch (v) { - DisplayStepOctaveGroupPtr o = makeDisplayStepOctaveGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getDisplayOctave()->setValue( OctaveValue( 7 ) ); - o->getDisplayStep()->setValue( StepEnum::g ); - } - break; - case TestMode::three: - { - o->getDisplayOctave()->setValue( OctaveValue( 5 ) ); - o->getDisplayStep()->setValue( StepEnum::b ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getDisplayOctave()->setValue(OctaveValue(7)); + o->getDisplayStep()->setValue(StepEnum::g); + } + break; + case TestMode::three: { + o->getDisplayOctave()->setValue(OctaveValue(5)); + o->getDisplayStep()->setValue(StepEnum::b); } - void tgenDisplayStepOctaveGroupExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenDisplayStepOctaveGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"(A)" ); - streamLine( os, i, R"(0)", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"(G)" ); - streamLine( os, i, R"(7)", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"(B)" ); - streamLine( os, i, R"(5)", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"(A)"); + streamLine(os, i, R"(0)", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"(G)"); + streamLine(os, i, R"(7)", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"(B)"); + streamLine(os, i, R"(5)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.h b/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.h index df23310c7..cf95741f3 100644 --- a/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.h +++ b/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::DisplayStepOctaveGroupPtr tgenDisplayStepOctaveGroup( TestMode v ); - void tgenDisplayStepOctaveGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::DisplayStepOctaveGroupPtr tgenDisplayStepOctaveGroup(TestMode v); +void tgenDisplayStepOctaveGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DisplayStepTest.cpp b/Sourcecode/private/mxtest/core/DisplayStepTest.cpp index 0552ef16e..1cb4a7667 100644 --- a/Sourcecode/private/mxtest/core/DisplayStepTest.cpp +++ b/Sourcecode/private/mxtest/core/DisplayStepTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, DisplayStep ) +TEST(Test01, DisplayStep) { - std::string indentString( INDENT ); - StepEnum value1 = StepEnum::b; - StepEnum value2 = StepEnum::f; - DisplayStep object1; - DisplayStep object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(A)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(F)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StepEnum value1 = StepEnum::b; + StepEnum value2 = StepEnum::f; + DisplayStep object1; + DisplayStep object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(A)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(F)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DisplayTextTest.cpp b/Sourcecode/private/mxtest/core/DisplayTextTest.cpp index 4719a470e..dbee2c0fd 100644 --- a/Sourcecode/private/mxtest/core/DisplayTextTest.cpp +++ b/Sourcecode/private/mxtest/core/DisplayTextTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, DisplayText ) +TEST(Test01, DisplayText) { - std::string indentString( INDENT ); - XsString value1( "Bones" ); - XsString value2( "Bishop" ); - DisplayText object1; - DisplayText object2( value2 ); - DisplayTextAttributesPtr attributes1 = std::make_shared(); - DisplayTextAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->letterSpacing = NumberOrNormal{ "normal" }; + std::string indentString(INDENT); + XsString value1("Bones"); + XsString value2("Bishop"); + DisplayText object1; + DisplayText object2(value2); + DisplayTextAttributesPtr attributes1 = std::make_shared(); + DisplayTextAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->letterSpacing = NumberOrNormal{"normal"}; attributes1->hasLetterSpacing = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+"Bishop"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + "Bishop"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DistanceTest.cpp b/Sourcecode/private/mxtest/core/DistanceTest.cpp index 6987da079..278ddb38e 100644 --- a/Sourcecode/private/mxtest/core/DistanceTest.cpp +++ b/Sourcecode/private/mxtest/core/DistanceTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, Distance ) +TEST(Test01, Distance) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.2 }; - TenthsValue value2{ 9.735271627 }; - Distance object1; - Distance object2( value2 ); - DistanceAttributesPtr attributes1 = std::make_shared(); - DistanceAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->type = DistanceType{ "Berg" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(9.735272)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.2}; + TenthsValue value2{9.735271627}; + Distance object1; + Distance object2(value2); + DistanceAttributesPtr attributes1 = std::make_shared(); + DistanceAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->type = DistanceType{"Berg"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(9.735272)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DivisionsTest.cpp b/Sourcecode/private/mxtest/core/DivisionsTest.cpp index 4513bd796..503fe5024 100644 --- a/Sourcecode/private/mxtest/core/DivisionsTest.cpp +++ b/Sourcecode/private/mxtest/core/DivisionsTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Divisions ) +TEST(Test01, Divisions) { - std::string indentString( INDENT ); - PositiveDivisionsValue value1{ 0.3333 }; - PositiveDivisionsValue value2{ 4.1 }; - Divisions object1; - Divisions object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.1)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + PositiveDivisionsValue value1{0.3333}; + PositiveDivisionsValue value2{4.1}; + Divisions object1; + Divisions object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.1)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DocumentHeaderTest.cpp b/Sourcecode/private/mxtest/core/DocumentHeaderTest.cpp index 8280bb01c..62e537590 100644 --- a/Sourcecode/private/mxtest/core/DocumentHeaderTest.cpp +++ b/Sourcecode/private/mxtest/core/DocumentHeaderTest.cpp @@ -6,126 +6,123 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/DocumentHeaderTest.h" - +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, DocumentHeader ) +TEST(Test01, DocumentHeader) { DocumentType doctype = kDefaultDocumentType; - stringstream expected( "score-partwise" ); - stringstream actual; - stream( actual, doctype ); - CHECK_EQUAL( expected.str(), actual.str() ) - + stringstream expected("score-partwise"); + stringstream actual; + stream(actual, doctype); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test02, DocumentHeader ) + +TEST(Test02, DocumentHeader) { DocumentType doctype = DocumentType::timewise; - stringstream expected( "score-timewise" ); - stringstream actual; - stream( actual, doctype ); - CHECK_EQUAL( expected.str(), actual.str() ) - + stringstream expected("score-timewise"); + stringstream actual; + stream(actual, doctype); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test03, DocumentHeader ) + +TEST(Test03, DocumentHeader) { XmlVersion xmlver = kDefaultXmlVersion; - stringstream expected( "1.0" ); - stringstream actual; - stream( actual, xmlver ); - CHECK_EQUAL( expected.str(), actual.str() ) - + stringstream expected("1.0"); + stringstream actual; + stream(actual, xmlver); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test04, DocumentHeader ) + +TEST(Test04, DocumentHeader) { DocumentEncoding encoding = kDefaultDocumentEncoding; - stringstream expected( "UTF-8" ); - stringstream actual; - stream( actual, encoding ); - CHECK_EQUAL( expected.str(), actual.str() ) - + stringstream expected("UTF-8"); + stringstream actual; + stream(actual, encoding); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test05, DocumentHeader ) + +TEST(Test05, DocumentHeader) { MusicXmlVersion version = kDefaultMusicXmlVersion; - stringstream expected( "3.0" ); - stringstream actual; - stream( actual, version ); - CHECK_EQUAL( expected.str(), actual.str() ) - + stringstream expected("3.0"); + stringstream actual; + stream(actual, version); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test06, DocumentHeader ) + +TEST(Test06, DocumentHeader) { DocumentHeader dochead; - stringstream expected; - tgenDocumentHeaderExpected( expected, DocumentType::partwise ); + stringstream expected; + tgenDocumentHeaderExpected(expected, DocumentType::partwise); stringstream actual; - dochead.toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + dochead.toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test07, DocumentHeader ) + +TEST(Test07, DocumentHeader) { DocumentHeader dochead; - dochead.setDocumentType( DocumentType::timewise ); - stringstream expected; - tgenDocumentHeaderExpected( expected, DocumentType::timewise ); + dochead.setDocumentType(DocumentType::timewise); + stringstream expected; + tgenDocumentHeaderExpected(expected, DocumentType::timewise); stringstream actual; - dochead.toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + dochead.toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test08, DocumentHeader ) +TEST(Test08, DocumentHeader) { DocumentHeaderPtr dochead = makeDocumentHeader(); - stringstream expected; - tgenDocumentHeaderExpected( expected, DocumentType::partwise ); + stringstream expected; + tgenDocumentHeaderExpected(expected, DocumentType::partwise); stringstream actual; - dochead->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + dochead->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test09, DocumentHeader ) + +TEST(Test09, DocumentHeader) { DocumentHeaderPtr dochead = makeDocumentHeader(); - dochead->setDocumentType( DocumentType::timewise ); - stringstream expected; - tgenDocumentHeaderExpected( expected, DocumentType::timewise ); + dochead->setDocumentType(DocumentType::timewise); + stringstream expected; + tgenDocumentHeaderExpected(expected, DocumentType::timewise); stringstream actual; - dochead->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + dochead->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } namespace mxtest { - void tgenDocumentHeaderExpected( std::ostream& os, const mx::core::DocumentType doctype ) +void tgenDocumentHeaderExpected(std::ostream &os, const mx::core::DocumentType doctype) +{ + + switch (doctype) { - - switch ( doctype ) - { - case DocumentType::partwise: - { - os << R"()"; - os << std::endl; - os << R"()"; - - } - break; - case DocumentType::timewise: - { - os << R"()"; - os << std::endl; - os << R"()"; - - } - break; - default: - break; - } + case DocumentType::partwise: { + os << R"()"; + os << std::endl; + os << R"()"; + } + break; + case DocumentType::timewise: { + os << R"()"; + os << std::endl; + os << R"()"; + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DocumentHeaderTest.h b/Sourcecode/private/mxtest/core/DocumentHeaderTest.h index 21ddb4fc5..ecac3d2c9 100644 --- a/Sourcecode/private/mxtest/core/DocumentHeaderTest.h +++ b/Sourcecode/private/mxtest/core/DocumentHeaderTest.h @@ -6,12 +6,12 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/DocumentHeader.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - void tgenDocumentHeaderExpected( std::ostream& os, const mx::core::DocumentType doctype ); +void tgenDocumentHeaderExpected(std::ostream &os, const mx::core::DocumentType doctype); } #endif diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseConvertTest.cpp b/Sourcecode/private/mxtest/core/DocumentPartwiseConvertTest.cpp index a7f4061f4..665f432f7 100644 --- a/Sourcecode/private/mxtest/core/DocumentPartwiseConvertTest.cpp +++ b/Sourcecode/private/mxtest/core/DocumentPartwiseConvertTest.cpp @@ -5,26 +5,26 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS +#include "DocumentPartwiseCreate.h" +#include "DocumentTimewiseCreate.h" #include "cpul/cpulTestHarness.h" #include "mx/core/Document.h" #include "mxtest/core/DocumentHeaderTest.h" -#include "DocumentPartwiseCreate.h" -#include "DocumentTimewiseCreate.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( DocumentPartwiseConvert, DocumentPartwise ) +TEST(DocumentPartwiseConvert, DocumentPartwise) { auto docExpected = mxtest::createDocumentPartwise(); auto docActual = mxtest::createDocumentTimewise(); docActual->convertContents(); stringstream expected; - docExpected->toStream( expected ); + docExpected->toStream(expected); stringstream actual; - docActual->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + docActual->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.cpp b/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.cpp index aa4d30ca1..56e95dcfa 100644 --- a/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.cpp +++ b/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.cpp @@ -14,330 +14,350 @@ using namespace mx::core; namespace mxtest { - mx::core::DocumentPtr createDocumentPartwise() - { - auto doc = makeDocument( DocumentChoice::partwise ); - - /* Set Version Attribute on Score Element */ - auto s = doc->getScorePartwise(); - s->getAttributes()->hasVersion = true; - s->getAttributes()->version = XsToken( "3.0" ); - - /* Create Score Title and Credits */ - auto header = s->getScoreHeaderGroup(); - auto composerCredit = makeCredit(); - composerCredit->getCreditChoice()->setChoice( CreditChoice::Choice::creditWords ); - auto words = makeCreditWordsGroup(); - words->getCreditWords()->setValue( XsString( "Matthew James Briggs" ) ); - composerCredit->getCreditChoice()->addCreditWordsGroup( words ); - auto creditType = makeCreditType(); - creditType->setValue( XsString( "composer" ) ); - composerCredit->addCreditType( creditType ); - header->addCredit( composerCredit ); - header->setHasWork( true ); - header->getWork()->setHasWorkTitle( true ); - header->getWork()->getWorkTitle()->setValue( XsString( "Simple Measures" ) ); - - /* Create Score Header First Part */ - header->getPartList()->getScorePart()->getAttributes()->id = XsID( "PARTONE" ); - header->getPartList()->getScorePart()->getPartName()->setValue( XsString( "Part One" ) ); - - /* Create Score Header Second Part */ - auto p2 = makeScorePart(); - p2->getAttributes()->id = XsID( "A2" ); - p2->getPartName()->setValue( XsString( "Part Two" ) ); - auto p2g = makePartGroupOrScorePart(); - p2g->setChoice( PartGroupOrScorePart::Choice::scorePart ); - p2g->setScorePart( p2 ); - header->getPartList()->addPartGroupOrScorePart( p2g ); - - /* Create Score Header Third Part */ - auto p3 = makeScorePart(); - p3->getAttributes()->id = XsID( "P3" ); - p3->getPartName()->setValue( XsString( "Part Three" ) ); - auto p3g = makePartGroupOrScorePart(); - p3g->setChoice( PartGroupOrScorePart::Choice::scorePart ); - p3g->setScorePart( p3 ); - header->getPartList()->addPartGroupOrScorePart( p3g ); - - /* Create Three Partwise Part Stubs */ - // first part stub already exists - s->addPartwisePart( makePartwisePart() ); // two - s->addPartwisePart( makePartwisePart() ); // three - - auto iter = s->getPartwisePartSet().cbegin(); - auto part1 = *iter; - auto part2 = *( ++iter ); - auto part3 = *( ++iter ); - - part1->getAttributes()->id = XsIDREF( "PARTONE" ); - part2->getAttributes()->id = XsIDREF( "A2" ); - part3->getAttributes()->id = XsIDREF( "P3" ); - - /* Add Three Measures to Part 1 */ - auto p1m1 = *( part1->getPartwiseMeasureSet().cbegin() ); - setPartwiseMeasureProperties( p1m1, // measure pointer - 1, // measure number - 1, // divisions - 4, // beats - 4 ); // beat type - addP1M1Data( p1m1->getMusicDataGroup() ); - - auto p1m2 = makePartwiseMeasure(); - setPartwiseMeasureProperties( p1m2, // measure pointer - 2, // measure number - 1, // divisions - 4, // beats - 4 ); // beat type - addP1M2Data( p1m2->getMusicDataGroup() ); - part1->addPartwiseMeasure( p1m2 ); - - auto p1m3 = makePartwiseMeasure(); - setPartwiseMeasureProperties( p1m3, // measure pointer - 3, // measure number - 1, // divisions - 2, // beats - 4 ); // beat type - addP1M3Data( p1m3->getMusicDataGroup() ); - part1->addPartwiseMeasure( p1m3 ); - - /* Add Three Measures to Part 2 */ - auto p2m1 = *( part2->getPartwiseMeasureSet().cbegin() ); - setPartwiseMeasureProperties( p2m1, // measure pointer - 1, // measure number - 1, // divisions - 4, // beats - 4 ); // beat type - addP2M1Data( p2m1->getMusicDataGroup() ); - - auto p2m2 = makePartwiseMeasure(); - setPartwiseMeasureProperties( p2m2, // measure pointer - 2, // measure number - 1, // divisions - 4, // beats - 4 ); // beat type - addP2M2Data( p2m2->getMusicDataGroup() ); - part2->addPartwiseMeasure( p2m2 ); - - auto p2m3 = makePartwiseMeasure(); - setPartwiseMeasureProperties( p2m3, // measure pointer - 3, // measure number - 1, // divisions - 2, // beats - 4 ); // beat type - addP2M3Data( p2m3->getMusicDataGroup() ); - part2->addPartwiseMeasure( p2m3 ); - - /* Add Three Measures to Part 3 */ - auto p3m1 = *( part3->getPartwiseMeasureSet().cbegin() ); - setPartwiseMeasureProperties( p3m1, // measure pointer - 1, // measure number - 1, // divisions - 4, // beats - 4 ); // beat type - addP3M1Data( p3m1->getMusicDataGroup() ); - - auto p3m2 = makePartwiseMeasure(); - setPartwiseMeasureProperties( p3m2, // measure pointer - 2, // measure number - 1, // divisions - 4, // beats - 4 ); // beat type - addP3M2Data( p3m2->getMusicDataGroup() ); - part3->addPartwiseMeasure( p3m2 ); - - auto p3m3 = makePartwiseMeasure(); - setPartwiseMeasureProperties( p3m3, // measure pointer - 3, // measure number - 1, // divisions - 2, // beats - 4 ); // beat type - addP3M3Data( p3m3->getMusicDataGroup() ); - part3->addPartwiseMeasure( p3m3 ); - - return doc; - } - - void setPartwiseMeasureProperties( PartwiseMeasurePtr& measure, - int measureNumber, - int divisions, - int beats, - int beatType ) - { - std::stringstream measureNumberSstr; - measureNumberSstr << measureNumber; - std::stringstream beatSstr; - beatSstr << beats; - std::stringstream beatTypeSstr; - beatTypeSstr << beatType; - measure->getAttributes()->number = XsToken( measureNumberSstr.str() ); - auto propertiesChoice = makeMusicDataChoice(); - propertiesChoice->setChoice( MusicDataChoice::Choice::properties ); - auto properties = propertiesChoice->getProperties(); - properties->setHasDivisions( true ); - properties->getDivisions()->setValue( PositiveDivisionsValue( divisions ) ); - properties->addKey( makeKey() ); - auto time = makeTime(); - time->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - auto timeSignature = makeTimeSignatureGroup(); - timeSignature->getBeats()->setValue( XsString( beatSstr.str() ) ); - timeSignature->getBeatType()->setValue( XsString( beatTypeSstr.str() ) ); - time->getTimeChoice()->addTimeSignatureGroup( timeSignature ); - time->getTimeChoice()->removeTimeSignatureGroup( time->getTimeChoice()->getTimeSignatureGroupSet().cbegin() ); - properties->addTime( time ); - auto clef = makeClef(); - clef->getSign()->setValue( ClefSign::g ); - clef->setHasLine( true ); - clef->getLine()->setValue( StaffLine( 2 ) ); - properties->addClef( clef ); - measure->getMusicDataGroup()->addMusicDataChoice( propertiesChoice ); - - } - - MusicDataChoicePtr makeNote( - StepEnum step, - int octave, - NoteTypeValue duration, - int divisions ) - { - auto p1m1_noteData = makeMusicDataChoice(); - p1m1_noteData->setChoice( MusicDataChoice::Choice::note ); - p1m1_noteData->getNote()->getNoteChoice()->setChoice( NoteChoice::Choice::normal ); - p1m1_noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); - p1m1_noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getStep()->setValue( step ); - p1m1_noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getOctave()->setValue( OctaveValue( octave ) ); - p1m1_noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( PositiveDivisionsValue( divisions ) ); - p1m1_noteData->getNote()->getType()->setValue( duration ); - return p1m1_noteData; - } - - void addP1M1Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto p1m1_noteData = makeNote( StepEnum::c, // step - 4, // octave - NoteTypeValue::whole, // duration - 4 ); // divisions - musicDataGroup->addMusicDataChoice( p1m1_noteData ); - } - void addP1M2Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto p1m2_noteData = makeNote( StepEnum::d, // step - 4, // octave - NoteTypeValue::whole, // duration - 4 ); // divisions - musicDataGroup->addMusicDataChoice( p1m2_noteData ); - } - void addP1M3Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto p1m3_noteData = makeNote( StepEnum::e, // step - 4, // octave - NoteTypeValue::half, // duration - 2 ); // divisions - musicDataGroup->addMusicDataChoice( p1m3_noteData ); - } - void addP2M1Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto p2m1_noteData = makeNote( StepEnum::c, // step - 5, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( p2m1_noteData ); - p2m1_noteData = makeNote( StepEnum::b, // step - 4, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( p2m1_noteData ); - p2m1_noteData = makeNote( StepEnum::a, // step - 4, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( p2m1_noteData ); - p2m1_noteData = makeNote( StepEnum::g, // step - 4, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( p2m1_noteData ); - } - void addP2M2Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto notedata = makeNote( StepEnum::a, // step - 4, // octave - NoteTypeValue::whole, // duration - 4 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - } - void addP2M3Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto notedata = makeNote( StepEnum::a, // step - 4, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - notedata = makeNote( StepEnum::f, // step - 4, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - } - void addP3M1Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto notedata = makeNote( StepEnum::a, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - notedata = makeNote( StepEnum::f, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - notedata = makeNote( StepEnum::g, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - notedata = makeNote( StepEnum::a, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - } - void addP3M2Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto notedata = makeNote( StepEnum::b, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - notedata = makeNote( StepEnum::c, // step - 4, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - notedata = makeNote( StepEnum::b, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - notedata = makeNote( StepEnum::a, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - } - void addP3M3Data( const MusicDataGroupPtr& musicDataGroup ) - { - auto notedata = makeNote( StepEnum::g, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - notedata = makeNote( StepEnum::f, // step - 3, // octave - NoteTypeValue::quarter, // duration - 1 ); // divisions - musicDataGroup->addMusicDataChoice( notedata ); - } +mx::core::DocumentPtr createDocumentPartwise() +{ + auto doc = makeDocument(DocumentChoice::partwise); + + /* Set Version Attribute on Score Element */ + auto s = doc->getScorePartwise(); + s->getAttributes()->hasVersion = true; + s->getAttributes()->version = XsToken("3.0"); + + /* Create Score Title and Credits */ + auto header = s->getScoreHeaderGroup(); + auto composerCredit = makeCredit(); + composerCredit->getCreditChoice()->setChoice(CreditChoice::Choice::creditWords); + auto words = makeCreditWordsGroup(); + words->getCreditWords()->setValue(XsString("Matthew James Briggs")); + composerCredit->getCreditChoice()->addCreditWordsGroup(words); + auto creditType = makeCreditType(); + creditType->setValue(XsString("composer")); + composerCredit->addCreditType(creditType); + header->addCredit(composerCredit); + header->setHasWork(true); + header->getWork()->setHasWorkTitle(true); + header->getWork()->getWorkTitle()->setValue(XsString("Simple Measures")); + + /* Create Score Header First Part */ + header->getPartList()->getScorePart()->getAttributes()->id = XsID("PARTONE"); + header->getPartList()->getScorePart()->getPartName()->setValue(XsString("Part One")); + + /* Create Score Header Second Part */ + auto p2 = makeScorePart(); + p2->getAttributes()->id = XsID("A2"); + p2->getPartName()->setValue(XsString("Part Two")); + auto p2g = makePartGroupOrScorePart(); + p2g->setChoice(PartGroupOrScorePart::Choice::scorePart); + p2g->setScorePart(p2); + header->getPartList()->addPartGroupOrScorePart(p2g); + + /* Create Score Header Third Part */ + auto p3 = makeScorePart(); + p3->getAttributes()->id = XsID("P3"); + p3->getPartName()->setValue(XsString("Part Three")); + auto p3g = makePartGroupOrScorePart(); + p3g->setChoice(PartGroupOrScorePart::Choice::scorePart); + p3g->setScorePart(p3); + header->getPartList()->addPartGroupOrScorePart(p3g); + + /* Create Three Partwise Part Stubs */ + // first part stub already exists + s->addPartwisePart(makePartwisePart()); // two + s->addPartwisePart(makePartwisePart()); // three + + auto iter = s->getPartwisePartSet().cbegin(); + auto part1 = *iter; + auto part2 = *(++iter); + auto part3 = *(++iter); + + part1->getAttributes()->id = XsIDREF("PARTONE"); + part2->getAttributes()->id = XsIDREF("A2"); + part3->getAttributes()->id = XsIDREF("P3"); + + /* Add Three Measures to Part 1 */ + auto p1m1 = *(part1->getPartwiseMeasureSet().cbegin()); + setPartwiseMeasureProperties(p1m1, // measure pointer + 1, // measure number + 1, // divisions + 4, // beats + 4); // beat type + addP1M1Data(p1m1->getMusicDataGroup()); + + auto p1m2 = makePartwiseMeasure(); + setPartwiseMeasureProperties(p1m2, // measure pointer + 2, // measure number + 1, // divisions + 4, // beats + 4); // beat type + addP1M2Data(p1m2->getMusicDataGroup()); + part1->addPartwiseMeasure(p1m2); + + auto p1m3 = makePartwiseMeasure(); + setPartwiseMeasureProperties(p1m3, // measure pointer + 3, // measure number + 1, // divisions + 2, // beats + 4); // beat type + addP1M3Data(p1m3->getMusicDataGroup()); + part1->addPartwiseMeasure(p1m3); + + /* Add Three Measures to Part 2 */ + auto p2m1 = *(part2->getPartwiseMeasureSet().cbegin()); + setPartwiseMeasureProperties(p2m1, // measure pointer + 1, // measure number + 1, // divisions + 4, // beats + 4); // beat type + addP2M1Data(p2m1->getMusicDataGroup()); + + auto p2m2 = makePartwiseMeasure(); + setPartwiseMeasureProperties(p2m2, // measure pointer + 2, // measure number + 1, // divisions + 4, // beats + 4); // beat type + addP2M2Data(p2m2->getMusicDataGroup()); + part2->addPartwiseMeasure(p2m2); + + auto p2m3 = makePartwiseMeasure(); + setPartwiseMeasureProperties(p2m3, // measure pointer + 3, // measure number + 1, // divisions + 2, // beats + 4); // beat type + addP2M3Data(p2m3->getMusicDataGroup()); + part2->addPartwiseMeasure(p2m3); + + /* Add Three Measures to Part 3 */ + auto p3m1 = *(part3->getPartwiseMeasureSet().cbegin()); + setPartwiseMeasureProperties(p3m1, // measure pointer + 1, // measure number + 1, // divisions + 4, // beats + 4); // beat type + addP3M1Data(p3m1->getMusicDataGroup()); + + auto p3m2 = makePartwiseMeasure(); + setPartwiseMeasureProperties(p3m2, // measure pointer + 2, // measure number + 1, // divisions + 4, // beats + 4); // beat type + addP3M2Data(p3m2->getMusicDataGroup()); + part3->addPartwiseMeasure(p3m2); + + auto p3m3 = makePartwiseMeasure(); + setPartwiseMeasureProperties(p3m3, // measure pointer + 3, // measure number + 1, // divisions + 2, // beats + 4); // beat type + addP3M3Data(p3m3->getMusicDataGroup()); + part3->addPartwiseMeasure(p3m3); + + return doc; +} + +void setPartwiseMeasureProperties(PartwiseMeasurePtr &measure, int measureNumber, int divisions, int beats, + int beatType) +{ + std::stringstream measureNumberSstr; + measureNumberSstr << measureNumber; + std::stringstream beatSstr; + beatSstr << beats; + std::stringstream beatTypeSstr; + beatTypeSstr << beatType; + measure->getAttributes()->number = XsToken(measureNumberSstr.str()); + auto propertiesChoice = makeMusicDataChoice(); + propertiesChoice->setChoice(MusicDataChoice::Choice::properties); + auto properties = propertiesChoice->getProperties(); + properties->setHasDivisions(true); + properties->getDivisions()->setValue(PositiveDivisionsValue(divisions)); + properties->addKey(makeKey()); + auto time = makeTime(); + time->getTimeChoice()->setChoice(TimeChoice::Choice::timeSignature); + auto timeSignature = makeTimeSignatureGroup(); + timeSignature->getBeats()->setValue(XsString(beatSstr.str())); + timeSignature->getBeatType()->setValue(XsString(beatTypeSstr.str())); + time->getTimeChoice()->addTimeSignatureGroup(timeSignature); + time->getTimeChoice()->removeTimeSignatureGroup(time->getTimeChoice()->getTimeSignatureGroupSet().cbegin()); + properties->addTime(time); + auto clef = makeClef(); + clef->getSign()->setValue(ClefSign::g); + clef->setHasLine(true); + clef->getLine()->setValue(StaffLine(2)); + properties->addClef(clef); + measure->getMusicDataGroup()->addMusicDataChoice(propertiesChoice); +} + +MusicDataChoicePtr makeNote(StepEnum step, int octave, NoteTypeValue duration, int divisions) +{ + auto p1m1_noteData = makeMusicDataChoice(); + p1m1_noteData->setChoice(MusicDataChoice::Choice::note); + p1m1_noteData->getNote()->getNoteChoice()->setChoice(NoteChoice::Choice::normal); + p1m1_noteData->getNote() + ->getNoteChoice() + ->getNormalNoteGroup() + ->getFullNoteGroup() + ->getFullNoteTypeChoice() + ->setChoice(FullNoteTypeChoice::Choice::pitch); + p1m1_noteData->getNote() + ->getNoteChoice() + ->getNormalNoteGroup() + ->getFullNoteGroup() + ->getFullNoteTypeChoice() + ->getPitch() + ->getStep() + ->setValue(step); + p1m1_noteData->getNote() + ->getNoteChoice() + ->getNormalNoteGroup() + ->getFullNoteGroup() + ->getFullNoteTypeChoice() + ->getPitch() + ->getOctave() + ->setValue(OctaveValue(octave)); + p1m1_noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( + PositiveDivisionsValue(divisions)); + p1m1_noteData->getNote()->getType()->setValue(duration); + return p1m1_noteData; +} + +void addP1M1Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto p1m1_noteData = makeNote(StepEnum::c, // step + 4, // octave + NoteTypeValue::whole, // duration + 4); // divisions + musicDataGroup->addMusicDataChoice(p1m1_noteData); +} + +void addP1M2Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto p1m2_noteData = makeNote(StepEnum::d, // step + 4, // octave + NoteTypeValue::whole, // duration + 4); // divisions + musicDataGroup->addMusicDataChoice(p1m2_noteData); +} + +void addP1M3Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto p1m3_noteData = makeNote(StepEnum::e, // step + 4, // octave + NoteTypeValue::half, // duration + 2); // divisions + musicDataGroup->addMusicDataChoice(p1m3_noteData); +} + +void addP2M1Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto p2m1_noteData = makeNote(StepEnum::c, // step + 5, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(p2m1_noteData); + p2m1_noteData = makeNote(StepEnum::b, // step + 4, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(p2m1_noteData); + p2m1_noteData = makeNote(StepEnum::a, // step + 4, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(p2m1_noteData); + p2m1_noteData = makeNote(StepEnum::g, // step + 4, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(p2m1_noteData); +} + +void addP2M2Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto notedata = makeNote(StepEnum::a, // step + 4, // octave + NoteTypeValue::whole, // duration + 4); // divisions + musicDataGroup->addMusicDataChoice(notedata); +} + +void addP2M3Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto notedata = makeNote(StepEnum::a, // step + 4, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); + notedata = makeNote(StepEnum::f, // step + 4, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); +} + +void addP3M1Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto notedata = makeNote(StepEnum::a, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); + notedata = makeNote(StepEnum::f, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); + notedata = makeNote(StepEnum::g, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); + notedata = makeNote(StepEnum::a, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); +} + +void addP3M2Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto notedata = makeNote(StepEnum::b, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); + notedata = makeNote(StepEnum::c, // step + 4, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); + notedata = makeNote(StepEnum::b, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); + notedata = makeNote(StepEnum::a, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); +} + +void addP3M3Data(const MusicDataGroupPtr &musicDataGroup) +{ + auto notedata = makeNote(StepEnum::g, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); + notedata = makeNote(StepEnum::f, // step + 3, // octave + NoteTypeValue::quarter, // duration + 1); // divisions + musicDataGroup->addMusicDataChoice(notedata); } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.h b/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.h index 91fecbb5b..4a3aa9205 100644 --- a/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.h +++ b/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.h @@ -5,41 +5,36 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include -#include "mx/core/Enums.h" #include "mx/core/Elements.h" +#include "mx/core/Enums.h" +#include namespace mx { - namespace core - { - class Document; - using DocumentPtr = std::shared_ptr; - } -} +namespace core +{ +class Document; +using DocumentPtr = std::shared_ptr; +} // namespace core +} // namespace mx namespace mxtest { - mx::core::DocumentPtr createDocumentPartwise(); - void setPartwiseMeasureProperties( mx::core::PartwiseMeasurePtr& measure, - int measureNumber, - int divisions, - int beats, - int beatType ); - - mx::core::MusicDataChoicePtr makeNote( mx::core::StepEnum step, - int octave, - mx::core::NoteTypeValue duration, - int divisions ); - void addP1M1Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); - void addP1M2Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); - void addP1M3Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); - void addP2M1Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); - void addP2M2Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); - void addP2M3Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); - void addP3M1Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); - void addP3M2Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); - void addP3M3Data( const mx::core::MusicDataGroupPtr& musicDataGroup ); -} +mx::core::DocumentPtr createDocumentPartwise(); +void setPartwiseMeasureProperties(mx::core::PartwiseMeasurePtr &measure, int measureNumber, int divisions, int beats, + int beatType); + +mx::core::MusicDataChoicePtr makeNote(mx::core::StepEnum step, int octave, mx::core::NoteTypeValue duration, + int divisions); +void addP1M1Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +void addP1M2Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +void addP1M3Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +void addP2M1Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +void addP2M2Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +void addP2M3Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +void addP3M1Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +void addP3M2Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +void addP3M3Data(const mx::core::MusicDataGroupPtr &musicDataGroup); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseTest.cpp b/Sourcecode/private/mxtest/core/DocumentPartwiseTest.cpp index b6d8f8fad..a7e91fd94 100644 --- a/Sourcecode/private/mxtest/core/DocumentPartwiseTest.cpp +++ b/Sourcecode/private/mxtest/core/DocumentPartwiseTest.cpp @@ -6,106 +6,102 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/DocumentHeaderTest.h" #include "mxtest/core/DocumentPartwiseTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/ScorePartwiseTest.h" -#include "mxtest/core/DocumentHeaderTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, DocumentPartwise ) +TEST(Test01, DocumentPartwise) { TestMode v = TestMode::one; - DocumentPtr object = tgenDocumentPartwise( v ); - stringstream expected; - tgenDocumentPartwiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + DocumentPtr object = tgenDocumentPartwise(v); + stringstream expected; + tgenDocumentPartwiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test02, DocumentPartwise ) + +TEST(Test02, DocumentPartwise) { TestMode v = TestMode::two; - DocumentPtr object = tgenDocumentPartwise( v ); - stringstream expected; - tgenDocumentPartwiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + DocumentPtr object = tgenDocumentPartwise(v); + stringstream expected; + tgenDocumentPartwiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test03, DocumentPartwise ) + +TEST(Test03, DocumentPartwise) { TestMode v = TestMode::three; - DocumentPtr object = tgenDocumentPartwise( v ); - stringstream expected; - tgenDocumentPartwiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + DocumentPtr object = tgenDocumentPartwise(v); + stringstream expected; + tgenDocumentPartwiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } namespace mxtest { - DocumentPtr tgenDocumentPartwise( TestMode v ) +DocumentPtr tgenDocumentPartwise(TestMode v) +{ + DocumentPtr o = makeDocument(); + switch (v) { - DocumentPtr o = makeDocument(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setScorePartwise( tgenScorePartwise( v ) ); - } - break; - case TestMode::three: - { - o->setScorePartwise( tgenScorePartwise( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setScorePartwise(tgenScorePartwise(v)); + } + break; + case TestMode::three: { + o->setScorePartwise(tgenScorePartwise(v)); } - void tgenDocumentPartwiseExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenDocumentPartwiseExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenDocumentHeaderExpected( os, DocumentType::partwise ); - os << std::endl; - tgenScorePartwiseExpected( os, 0, v ); - } - break; - case TestMode::two: - { - tgenDocumentHeaderExpected( os, DocumentType::partwise ); - os << std::endl; - tgenScorePartwiseExpected( os, 0, v ); - } - break; - case TestMode::three: - { - tgenDocumentHeaderExpected( os, DocumentType::partwise ); - os << std::endl; - tgenScorePartwiseExpected( os, 0, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenDocumentHeaderExpected(os, DocumentType::partwise); + os << std::endl; + tgenScorePartwiseExpected(os, 0, v); + } + break; + case TestMode::two: { + tgenDocumentHeaderExpected(os, DocumentType::partwise); + os << std::endl; + tgenScorePartwiseExpected(os, 0, v); + } + break; + case TestMode::three: { + tgenDocumentHeaderExpected(os, DocumentType::partwise); + os << std::endl; + tgenScorePartwiseExpected(os, 0, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseTest.h b/Sourcecode/private/mxtest/core/DocumentPartwiseTest.h index d8904c18c..8c67ff5d2 100644 --- a/Sourcecode/private/mxtest/core/DocumentPartwiseTest.h +++ b/Sourcecode/private/mxtest/core/DocumentPartwiseTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Document.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::DocumentPtr tgenDocumentPartwise( TestMode v ); - void tgenDocumentPartwiseExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::DocumentPtr tgenDocumentPartwise(TestMode v); +void tgenDocumentPartwiseExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseConvertTest.cpp b/Sourcecode/private/mxtest/core/DocumentTimewiseConvertTest.cpp index ca44037c7..aff093939 100644 --- a/Sourcecode/private/mxtest/core/DocumentTimewiseConvertTest.cpp +++ b/Sourcecode/private/mxtest/core/DocumentTimewiseConvertTest.cpp @@ -5,26 +5,26 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS +#include "DocumentPartwiseCreate.h" +#include "DocumentTimewiseCreate.h" #include "cpul/cpulTestHarness.h" #include "mx/core/Document.h" #include "mxtest/core/DocumentHeaderTest.h" -#include "DocumentTimewiseCreate.h" -#include "DocumentPartwiseCreate.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( DocumentTimewiseConvert, DocumentTimewise ) +TEST(DocumentTimewiseConvert, DocumentTimewise) { auto docExpected = mxtest::createDocumentTimewise(); auto docActual = mxtest::createDocumentPartwise(); docActual->convertContents(); stringstream expected; - docExpected->toStream( expected ); + docExpected->toStream(expected); stringstream actual; - docActual->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + docActual->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.cpp b/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.cpp index 013419478..9f2e87d07 100644 --- a/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.cpp +++ b/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.cpp @@ -8,186 +8,181 @@ #include "DocumentPartwiseCreate.h" #include "DocumentTimewiseCreate.h" -#include "mx/core/Elements.h" #include "mx/core/Document.h" +#include "mx/core/Elements.h" #include using namespace mx::core; namespace mxtest { - mx::core::DocumentPtr createDocumentTimewise() - { - auto doc = makeDocument( DocumentChoice::timewise ); - - /* Set Version Attribute on Score Element */ - auto s = doc->getScoreTimewise(); - s->getAttributes()->hasVersion = true; - s->getAttributes()->version = XsToken( "3.0" ); - - /* Create Score Title and Credits */ - auto header = s->getScoreHeaderGroup(); - auto composerCredit = makeCredit(); - composerCredit->getCreditChoice()->setChoice( CreditChoice::Choice::creditWords ); - auto wordsGroup = makeCreditWordsGroup(); - wordsGroup->getCreditWords()->setValue( XsString( "Matthew James Briggs" ) ); - composerCredit->getCreditChoice()->addCreditWordsGroup( wordsGroup ); - auto creditType = makeCreditType(); - creditType->setValue( XsString( "composer" ) ); - composerCredit->addCreditType( creditType ); - header->addCredit( composerCredit ); - header->setHasWork( true ); - header->getWork()->setHasWorkTitle( true ); - header->getWork()->getWorkTitle()->setValue( XsString( "Simple Measures" ) ); - - /* Create Score Header First Part */ - header->getPartList()->getScorePart()->getAttributes()->id = XsID( "PARTONE" ); - header->getPartList()->getScorePart()->getPartName()->setValue( XsString( "Part One" ) ); - - /* Create Score Header Second Part */ - auto p2 = makeScorePart(); - p2->getAttributes()->id = XsID( "A2" ); - p2->getPartName()->setValue( XsString( "Part Two" ) ); - auto p2g = makePartGroupOrScorePart(); - p2g->setChoice( PartGroupOrScorePart::Choice::scorePart ); - p2g->setScorePart( p2 ); - header->getPartList()->addPartGroupOrScorePart( p2g ); - - /* Create Score Header Third Part */ - auto p3 = makeScorePart(); - p3->getAttributes()->id = XsID( "P3" ); - p3->getPartName()->setValue( XsString( "Part Three" ) ); - auto p3g = makePartGroupOrScorePart(); - p3g->setChoice( PartGroupOrScorePart::Choice::scorePart ); - p3g->setScorePart( p3 ); - header->getPartList()->addPartGroupOrScorePart( p3g ); - - /* Create Three Timewise Measure Stubs */ - // first measure stub already exists - s->addTimewiseMeasure( makeTimewiseMeasure() ); // two - s->addTimewiseMeasure( makeTimewiseMeasure() ); // three - - auto iter = s->getTimewiseMeasureSet().cbegin(); - auto measure1 = *iter; - auto measure2 = *( ++iter ); - auto measure3 = *( ++iter ); - - measure1->getAttributes()->number = XsToken( "1" ); - setTimewiseMeasureProperties( measure1, // measure pointer - 1, // measure number - 1, // divisions - 4, // beats - 4 ); // beat type - setTimewiseMeasureProperties( measure2, // measure pointer - 2, // measure number - 1, // divisions - 4, // beats - 4 ); // beat type - setTimewiseMeasureProperties( measure3, // measure pointer - 3, // measure number - 1, // divisions - 2, // beats - 4 ); // beat type - - /* Add Three Parts to Measure 1 */ - auto m1p1 = *( measure1->getTimewisePartSet().cbegin() ); - m1p1->getAttributes()->id = XsIDREF( "PARTONE" ); - m1p1->setMusicDataGroup( getConstructedMusicDataGroup( "4" ) ); - addP1M1Data( m1p1->getMusicDataGroup() ); - - auto m1p2 = makeTimewisePart(); - m1p2->getAttributes()->id = XsIDREF( "A2" ); - m1p2->setMusicDataGroup( getConstructedMusicDataGroup( "4" ) ); - addP2M1Data( m1p2->getMusicDataGroup() ); - measure1->addTimewisePart( m1p2 ); - - auto m1p3 = makeTimewisePart(); - m1p3->getAttributes()->id = XsIDREF( "P3" ); - m1p3->setMusicDataGroup( getConstructedMusicDataGroup( "4" ) ); - addP3M1Data( m1p3->getMusicDataGroup() ); - measure1->addTimewisePart( m1p3 ); - - /* Add Three Parts to Measure 2 */ - auto m2p1 = *( measure2->getTimewisePartSet().cbegin() ); - m2p1->getAttributes()->id = XsIDREF( "PARTONE" ); - m2p1->setMusicDataGroup( getConstructedMusicDataGroup( "4" ) ); - addP1M2Data( m2p1->getMusicDataGroup() ); - - auto m2p2 = makeTimewisePart(); - m2p2->getAttributes()->id = XsIDREF( "A2" ); - m2p2->setMusicDataGroup( getConstructedMusicDataGroup( "4" ) ); - addP2M2Data( m2p2->getMusicDataGroup() ); - measure2->addTimewisePart( m2p2 ); - - auto m2p3 = makeTimewisePart(); - m2p3->getAttributes()->id = XsIDREF( "P3" ); - m2p3->setMusicDataGroup( getConstructedMusicDataGroup( "4" ) ); - addP3M2Data( m2p3->getMusicDataGroup() ); - measure2->addTimewisePart( m2p3 ); - - /* Add Three Parts to Measure 3 */ - auto m3p1 = *( measure3->getTimewisePartSet().cbegin() ); - m3p1->getAttributes()->id = XsIDREF( "PARTONE" ); - m3p1->setMusicDataGroup( getConstructedMusicDataGroup( "2" ) ); - addP1M3Data( m3p1->getMusicDataGroup() ); - - auto m3p2 = makeTimewisePart(); - m3p2->getAttributes()->id = XsIDREF( "A2" ); - m3p2->setMusicDataGroup( getConstructedMusicDataGroup( "2" ) ); - addP2M3Data( m3p2->getMusicDataGroup() ); - measure3->addTimewisePart( m3p2 ); - - auto m3p3 = makeTimewisePart(); - m3p3->getAttributes()->id = XsIDREF( "P3" ); - m3p3->setMusicDataGroup( getConstructedMusicDataGroup( "2" ) ); - addP3M3Data( m3p3->getMusicDataGroup() ); - measure3->addTimewisePart( m3p3 ); - - return doc; - } - - void setTimewiseMeasureProperties( TimewiseMeasurePtr& measure, - int measureNumber, - int divisions, - int beats, - int beatType ) - { - std::stringstream measureNumberSstr; - measureNumberSstr << measureNumber; - std::stringstream beatSstr; - beatSstr << beats; - std::stringstream beatTypeSstr; - beatTypeSstr << beatType; - measure->getAttributes()->number = XsToken( measureNumberSstr.str() ); - - - } - - MusicDataGroupPtr getConstructedMusicDataGroup( const std::string& beats ) - { - MusicDataGroupPtr output = makeMusicDataGroup(); - auto propertiesChoice = makeMusicDataChoice(); - propertiesChoice->setChoice( MusicDataChoice::Choice::properties ); - auto properties = propertiesChoice->getProperties(); - properties->setHasDivisions( true ); - properties->getDivisions()->setValue( PositiveDivisionsValue( 1 ) ); - properties->addKey( makeKey() ); - auto time = makeTime(); - time->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - auto timeSignature = makeTimeSignatureGroup(); - timeSignature->getBeats()->setValue( XsString( beats ) ); - timeSignature->getBeatType()->setValue( XsString( "4" ) ); - time->getTimeChoice()->addTimeSignatureGroup( timeSignature ); - time->getTimeChoice()->removeTimeSignatureGroup( time->getTimeChoice()->getTimeSignatureGroupSet().cbegin() ); - properties->addTime( time ); - auto clef = makeClef(); - clef->getSign()->setValue( ClefSign::g ); - clef->setHasLine( true ); - clef->getLine()->setValue( StaffLine( 2 ) ); - properties->addClef( clef ); - output->addMusicDataChoice( propertiesChoice ); - return output; - } - } +mx::core::DocumentPtr createDocumentTimewise() +{ + auto doc = makeDocument(DocumentChoice::timewise); + + /* Set Version Attribute on Score Element */ + auto s = doc->getScoreTimewise(); + s->getAttributes()->hasVersion = true; + s->getAttributes()->version = XsToken("3.0"); + + /* Create Score Title and Credits */ + auto header = s->getScoreHeaderGroup(); + auto composerCredit = makeCredit(); + composerCredit->getCreditChoice()->setChoice(CreditChoice::Choice::creditWords); + auto wordsGroup = makeCreditWordsGroup(); + wordsGroup->getCreditWords()->setValue(XsString("Matthew James Briggs")); + composerCredit->getCreditChoice()->addCreditWordsGroup(wordsGroup); + auto creditType = makeCreditType(); + creditType->setValue(XsString("composer")); + composerCredit->addCreditType(creditType); + header->addCredit(composerCredit); + header->setHasWork(true); + header->getWork()->setHasWorkTitle(true); + header->getWork()->getWorkTitle()->setValue(XsString("Simple Measures")); + + /* Create Score Header First Part */ + header->getPartList()->getScorePart()->getAttributes()->id = XsID("PARTONE"); + header->getPartList()->getScorePart()->getPartName()->setValue(XsString("Part One")); + + /* Create Score Header Second Part */ + auto p2 = makeScorePart(); + p2->getAttributes()->id = XsID("A2"); + p2->getPartName()->setValue(XsString("Part Two")); + auto p2g = makePartGroupOrScorePart(); + p2g->setChoice(PartGroupOrScorePart::Choice::scorePart); + p2g->setScorePart(p2); + header->getPartList()->addPartGroupOrScorePart(p2g); + + /* Create Score Header Third Part */ + auto p3 = makeScorePart(); + p3->getAttributes()->id = XsID("P3"); + p3->getPartName()->setValue(XsString("Part Three")); + auto p3g = makePartGroupOrScorePart(); + p3g->setChoice(PartGroupOrScorePart::Choice::scorePart); + p3g->setScorePart(p3); + header->getPartList()->addPartGroupOrScorePart(p3g); + + /* Create Three Timewise Measure Stubs */ + // first measure stub already exists + s->addTimewiseMeasure(makeTimewiseMeasure()); // two + s->addTimewiseMeasure(makeTimewiseMeasure()); // three + + auto iter = s->getTimewiseMeasureSet().cbegin(); + auto measure1 = *iter; + auto measure2 = *(++iter); + auto measure3 = *(++iter); + + measure1->getAttributes()->number = XsToken("1"); + setTimewiseMeasureProperties(measure1, // measure pointer + 1, // measure number + 1, // divisions + 4, // beats + 4); // beat type + setTimewiseMeasureProperties(measure2, // measure pointer + 2, // measure number + 1, // divisions + 4, // beats + 4); // beat type + setTimewiseMeasureProperties(measure3, // measure pointer + 3, // measure number + 1, // divisions + 2, // beats + 4); // beat type + + /* Add Three Parts to Measure 1 */ + auto m1p1 = *(measure1->getTimewisePartSet().cbegin()); + m1p1->getAttributes()->id = XsIDREF("PARTONE"); + m1p1->setMusicDataGroup(getConstructedMusicDataGroup("4")); + addP1M1Data(m1p1->getMusicDataGroup()); + + auto m1p2 = makeTimewisePart(); + m1p2->getAttributes()->id = XsIDREF("A2"); + m1p2->setMusicDataGroup(getConstructedMusicDataGroup("4")); + addP2M1Data(m1p2->getMusicDataGroup()); + measure1->addTimewisePart(m1p2); + + auto m1p3 = makeTimewisePart(); + m1p3->getAttributes()->id = XsIDREF("P3"); + m1p3->setMusicDataGroup(getConstructedMusicDataGroup("4")); + addP3M1Data(m1p3->getMusicDataGroup()); + measure1->addTimewisePart(m1p3); + + /* Add Three Parts to Measure 2 */ + auto m2p1 = *(measure2->getTimewisePartSet().cbegin()); + m2p1->getAttributes()->id = XsIDREF("PARTONE"); + m2p1->setMusicDataGroup(getConstructedMusicDataGroup("4")); + addP1M2Data(m2p1->getMusicDataGroup()); + + auto m2p2 = makeTimewisePart(); + m2p2->getAttributes()->id = XsIDREF("A2"); + m2p2->setMusicDataGroup(getConstructedMusicDataGroup("4")); + addP2M2Data(m2p2->getMusicDataGroup()); + measure2->addTimewisePart(m2p2); + + auto m2p3 = makeTimewisePart(); + m2p3->getAttributes()->id = XsIDREF("P3"); + m2p3->setMusicDataGroup(getConstructedMusicDataGroup("4")); + addP3M2Data(m2p3->getMusicDataGroup()); + measure2->addTimewisePart(m2p3); + + /* Add Three Parts to Measure 3 */ + auto m3p1 = *(measure3->getTimewisePartSet().cbegin()); + m3p1->getAttributes()->id = XsIDREF("PARTONE"); + m3p1->setMusicDataGroup(getConstructedMusicDataGroup("2")); + addP1M3Data(m3p1->getMusicDataGroup()); + + auto m3p2 = makeTimewisePart(); + m3p2->getAttributes()->id = XsIDREF("A2"); + m3p2->setMusicDataGroup(getConstructedMusicDataGroup("2")); + addP2M3Data(m3p2->getMusicDataGroup()); + measure3->addTimewisePart(m3p2); + + auto m3p3 = makeTimewisePart(); + m3p3->getAttributes()->id = XsIDREF("P3"); + m3p3->setMusicDataGroup(getConstructedMusicDataGroup("2")); + addP3M3Data(m3p3->getMusicDataGroup()); + measure3->addTimewisePart(m3p3); + + return doc; +} + +void setTimewiseMeasureProperties(TimewiseMeasurePtr &measure, int measureNumber, int divisions, int beats, + int beatType) +{ + std::stringstream measureNumberSstr; + measureNumberSstr << measureNumber; + std::stringstream beatSstr; + beatSstr << beats; + std::stringstream beatTypeSstr; + beatTypeSstr << beatType; + measure->getAttributes()->number = XsToken(measureNumberSstr.str()); +} + +MusicDataGroupPtr getConstructedMusicDataGroup(const std::string &beats) +{ + MusicDataGroupPtr output = makeMusicDataGroup(); + auto propertiesChoice = makeMusicDataChoice(); + propertiesChoice->setChoice(MusicDataChoice::Choice::properties); + auto properties = propertiesChoice->getProperties(); + properties->setHasDivisions(true); + properties->getDivisions()->setValue(PositiveDivisionsValue(1)); + properties->addKey(makeKey()); + auto time = makeTime(); + time->getTimeChoice()->setChoice(TimeChoice::Choice::timeSignature); + auto timeSignature = makeTimeSignatureGroup(); + timeSignature->getBeats()->setValue(XsString(beats)); + timeSignature->getBeatType()->setValue(XsString("4")); + time->getTimeChoice()->addTimeSignatureGroup(timeSignature); + time->getTimeChoice()->removeTimeSignatureGroup(time->getTimeChoice()->getTimeSignatureGroupSet().cbegin()); + properties->addTime(time); + auto clef = makeClef(); + clef->getSign()->setValue(ClefSign::g); + clef->setHasLine(true); + clef->getLine()->setValue(StaffLine(2)); + properties->addClef(clef); + output->addMusicDataChoice(propertiesChoice); + return output; +} +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.h b/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.h index ca18cb48c..87d5d2bed 100644 --- a/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.h +++ b/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.h @@ -6,30 +6,27 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include -#include "mx/core/Enums.h" -#include "mx/core/Elements.h" #include "mx/core/Document.h" +#include "mx/core/Elements.h" +#include "mx/core/Enums.h" +#include namespace mx { - namespace core - { - class DocumentTimewise; - using DocumentTimewisePtr = std::shared_ptr; - } -} +namespace core +{ +class DocumentTimewise; +using DocumentTimewisePtr = std::shared_ptr; +} // namespace core +} // namespace mx namespace mxtest { - mx::core::DocumentPtr createDocumentTimewise(); - void setTimewiseMeasureProperties( mx::core::TimewiseMeasurePtr& measure, - int measureNumber, - int divisions, - int beats, - int beatType ); - mx::core::MusicDataGroupPtr getConstructedMusicDataGroup( const std::string& beats ); - +mx::core::DocumentPtr createDocumentTimewise(); +void setTimewiseMeasureProperties(mx::core::TimewiseMeasurePtr &measure, int measureNumber, int divisions, int beats, + int beatType); +mx::core::MusicDataGroupPtr getConstructedMusicDataGroup(const std::string &beats); + // MusicDataChoicePtr makeNote( mx::t::StepEnum step, // int octave, // mx::t::NoteTypeValue duration, @@ -43,6 +40,6 @@ namespace mxtest // void addP3M1Data( const MusicDataGroupPtr& musicDataGroup ); // void addP3M2Data( const MusicDataGroupPtr& musicDataGroup ); // void addP3M3Data( const MusicDataGroupPtr& musicDataGroup ); -} +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseTest.cpp b/Sourcecode/private/mxtest/core/DocumentTimewiseTest.cpp index ab5822fed..a1d73747a 100644 --- a/Sourcecode/private/mxtest/core/DocumentTimewiseTest.cpp +++ b/Sourcecode/private/mxtest/core/DocumentTimewiseTest.cpp @@ -6,108 +6,102 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/DocumentHeaderTest.h" #include "mxtest/core/DocumentTimewiseTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/ScoreTimewiseTest.h" -#include "mxtest/core/DocumentHeaderTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, DocumentTimewise ) +TEST(Test01, DocumentTimewise) { TestMode v = TestMode::one; - auto object = tgenDocumentTimewise( v ); - stringstream expected; - tgenDocumentTimewiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + auto object = tgenDocumentTimewise(v); + stringstream expected; + tgenDocumentTimewiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test02, DocumentTimewise ) + +TEST(Test02, DocumentTimewise) { TestMode v = TestMode::two; - auto object = tgenDocumentTimewise( v ); - stringstream expected; - tgenDocumentTimewiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + auto object = tgenDocumentTimewise(v); + stringstream expected; + tgenDocumentTimewiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test03, DocumentTimewise ) + +TEST(Test03, DocumentTimewise) { TestMode v = TestMode::three; - auto object = tgenDocumentTimewise( v ); - stringstream expected; - tgenDocumentTimewiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual ); - CHECK_EQUAL( expected.str(), actual.str() ) + auto object = tgenDocumentTimewise(v); + stringstream expected; + tgenDocumentTimewiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual); + CHECK_EQUAL(expected.str(), actual.str()) } namespace mxtest { - DocumentPtr tgenDocumentTimewise( TestMode v ) +DocumentPtr tgenDocumentTimewise(TestMode v) +{ + DocumentPtr o = makeDocument(DocumentChoice::timewise); + switch (v) { - DocumentPtr o = makeDocument( DocumentChoice::timewise ); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setScoreTimewise( tgenScoreTimewise( v ) ); - } - break; - case TestMode::three: - { - o->setScoreTimewise( tgenScoreTimewise( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setScoreTimewise(tgenScoreTimewise(v)); + } + break; + case TestMode::three: { + o->setScoreTimewise(tgenScoreTimewise(v)); } - void tgenDocumentTimewiseExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenDocumentTimewiseExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenDocumentHeaderExpected( os, DocumentType::timewise ); - os << std::endl; - tgenScoreTimewiseExpected( os, 0, v ); - } - break; - case TestMode::two: - { - tgenDocumentHeaderExpected( os, DocumentType::timewise ); - os << std::endl; - tgenScoreTimewiseExpected( os, 0, v ); - } - break; - case TestMode::three: - { - tgenDocumentHeaderExpected( os, DocumentType::timewise ); - os << std::endl; - tgenScoreTimewiseExpected( os, 0, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenDocumentHeaderExpected(os, DocumentType::timewise); + os << std::endl; + tgenScoreTimewiseExpected(os, 0, v); + } + break; + case TestMode::two: { + tgenDocumentHeaderExpected(os, DocumentType::timewise); + os << std::endl; + tgenScoreTimewiseExpected(os, 0, v); + } + break; + case TestMode::three: { + tgenDocumentHeaderExpected(os, DocumentType::timewise); + os << std::endl; + tgenScoreTimewiseExpected(os, 0, v); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseTest.h b/Sourcecode/private/mxtest/core/DocumentTimewiseTest.h index d70c79489..30a98897b 100644 --- a/Sourcecode/private/mxtest/core/DocumentTimewiseTest.h +++ b/Sourcecode/private/mxtest/core/DocumentTimewiseTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Document.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::DocumentPtr tgenDocumentTimewise( TestMode v ); - void tgenDocumentTimewiseExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::DocumentPtr tgenDocumentTimewise(TestMode v); +void tgenDocumentTimewiseExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/DoitTest.cpp b/Sourcecode/private/mxtest/core/DoitTest.cpp index 65a5100d8..d1effad8a 100644 --- a/Sourcecode/private/mxtest/core/DoitTest.cpp +++ b/Sourcecode/private/mxtest/core/DoitTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Doit ) +TEST(Test01, Doit) { - std::string indentString( INDENT ); - Doit object1; - Doit object2; - EmptyLineAttributesPtr attributes1 = std::make_shared(); - EmptyLineAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Doit object1; + Doit object2; + EmptyLineAttributesPtr attributes1 = std::make_shared(); + EmptyLineAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DotTest.cpp b/Sourcecode/private/mxtest/core/DotTest.cpp index a9f901903..90c7ac14b 100644 --- a/Sourcecode/private/mxtest/core/DotTest.cpp +++ b/Sourcecode/private/mxtest/core/DotTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Dot ) +TEST(Test01, Dot) { - std::string indentString( INDENT ); - Dot object1; - Dot object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Dot object1; + Dot object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DoubleTest.cpp b/Sourcecode/private/mxtest/core/DoubleTest.cpp index ffaed921c..d8c596887 100644 --- a/Sourcecode/private/mxtest/core/DoubleTest.cpp +++ b/Sourcecode/private/mxtest/core/DoubleTest.cpp @@ -10,27 +10,27 @@ #include using namespace mx::core; -TEST( Test01, Double ) +TEST(Test01, Double) { - std::string indentString( INDENT ); - Double object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Double object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/DoubleTongueTest.cpp b/Sourcecode/private/mxtest/core/DoubleTongueTest.cpp index 01a10bdfb..71cfb7b45 100644 --- a/Sourcecode/private/mxtest/core/DoubleTongueTest.cpp +++ b/Sourcecode/private/mxtest/core/DoubleTongueTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, DoubleTongue ) +TEST(Test01, DoubleTongue) { - std::string indentString( INDENT ); - DoubleTongue object1; - DoubleTongue object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + DoubleTongue object1; + DoubleTongue object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DownBowTest.cpp b/Sourcecode/private/mxtest/core/DownBowTest.cpp index 5e8369e25..ee197fb55 100644 --- a/Sourcecode/private/mxtest/core/DownBowTest.cpp +++ b/Sourcecode/private/mxtest/core/DownBowTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, DownBow ) +TEST(Test01, DownBow) { - std::string indentString( INDENT ); - DownBow object1; - DownBow object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + DownBow object1; + DownBow object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/DurationTest.cpp b/Sourcecode/private/mxtest/core/DurationTest.cpp index 0d0317923..a5acdb763 100644 --- a/Sourcecode/private/mxtest/core/DurationTest.cpp +++ b/Sourcecode/private/mxtest/core/DurationTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Duration ) +TEST(Test01, Duration) { - std::string indentString( INDENT ); - PositiveDivisionsValue value1{ 0.3333 }; - PositiveDivisionsValue value2{ 4.1 }; - Duration object1; - Duration object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.1)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + PositiveDivisionsValue value1{0.3333}; + PositiveDivisionsValue value2{4.1}; + Duration object1; + Duration object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.1)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/DynamicsTest.cpp b/Sourcecode/private/mxtest/core/DynamicsTest.cpp index 0ab46c5dc..e8e0510b9 100644 --- a/Sourcecode/private/mxtest/core/DynamicsTest.cpp +++ b/Sourcecode/private/mxtest/core/DynamicsTest.cpp @@ -11,13 +11,13 @@ using namespace mx::core; -TEST( Test01, Dynamics ) +TEST(Test01, Dynamics) { - Dynamics x( (DynamicsValue( DynamicsEnum::p )) ); + Dynamics x((DynamicsValue(DynamicsEnum::p))); DynamicsAttributesPtr da = x.getAttributes(); - da->defaultX = TenthsValue( 66 ); + da->defaultX = TenthsValue(66); da->hasDefaultX = true; - da->defaultY = TenthsValue( -68 ); + da->defaultY = TenthsValue(-68); da->hasDefaultY = true; da->halign = LeftCenterRight::center; da->hasHalign = true; @@ -27,16 +27,17 @@ TEST( Test01, Dynamics ) expected << INDENT << "

" << std::endl; expected << ""; std::stringstream actual; - x.toStream( actual, 0 ); - CHECK_EQUAL( expected.str(), actual.str() ) + x.toStream(actual, 0); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test02, Dynamics ) + +TEST(Test02, Dynamics) { - Dynamics x( (DynamicsValue( "purple" )) ); + Dynamics x((DynamicsValue("purple"))); DynamicsAttributesPtr da = x.getAttributes(); - da->defaultX = TenthsValue( 66 ); + da->defaultX = TenthsValue(66); da->hasDefaultX = true; - da->defaultY = TenthsValue( -68 ); + da->defaultY = TenthsValue(-68); da->hasDefaultY = true; da->halign = LeftCenterRight::center; da->hasHalign = true; @@ -45,8 +46,8 @@ TEST( Test02, Dynamics ) expected << INDENT << "purple" << std::endl; expected << ""; std::stringstream actual; - x.toStream( actual, 0 ); - CHECK_EQUAL( expected.str(), actual.str() ) + x.toStream(actual, 0); + CHECK_EQUAL(expected.str(), actual.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/EditorialGroupTest.cpp b/Sourcecode/private/mxtest/core/EditorialGroupTest.cpp index c8f047062..d549ba09c 100644 --- a/Sourcecode/private/mxtest/core/EditorialGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/EditorialGroupTest.cpp @@ -6,114 +6,110 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/EditorialGroupTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, EditorialGroup ) +TEST(Test01, EditorialGroup) { TestMode v = TestMode::one; - EditorialGroupPtr object = tgenEditorialGroup( v ); - stringstream expected; - tgenEditorialGroupExpected( expected, 0, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 0, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + EditorialGroupPtr object = tgenEditorialGroup(v); + stringstream expected; + tgenEditorialGroupExpected(expected, 0, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 0, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, EditorialGroup ) + +TEST(Test02, EditorialGroup) { TestMode v = TestMode::two; - EditorialGroupPtr object = tgenEditorialGroup( v ); - stringstream expected; - tgenEditorialGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + EditorialGroupPtr object = tgenEditorialGroup(v); + stringstream expected; + tgenEditorialGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, EditorialGroup ) + +TEST(Test03, EditorialGroup) { TestMode v = TestMode::three; - EditorialGroupPtr object = tgenEditorialGroup( v ); - stringstream expected; - tgenEditorialGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + EditorialGroupPtr object = tgenEditorialGroup(v); + stringstream expected; + tgenEditorialGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - EditorialGroupPtr tgenEditorialGroup( TestMode v ) +EditorialGroupPtr tgenEditorialGroup(TestMode v) +{ + EditorialGroupPtr o = makeEditorialGroup(); + switch (v) { - EditorialGroupPtr o = makeEditorialGroup(); - switch ( v ) - { - case TestMode::one: - { - } - break; - case TestMode::two: - { - o->setHasLevel( true ); - o->getLevel()->setValue( XsString( "LevelTwo" ) ); - o->setHasFootnote( true ); - o->getFootnote()->setValue( XsString( "FootNoteTwo" ) ); - } - break; - case TestMode::three: - { - o->setHasFootnote( true ); - o->getFootnote()->setValue( XsString( "FootNoteThree" ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasLevel(true); + o->getLevel()->setValue(XsString("LevelTwo")); + o->setHasFootnote(true); + o->getFootnote()->setValue(XsString("FootNoteTwo")); } - void tgenEditorialGroupExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->setHasFootnote(true); + o->getFootnote()->setValue(XsString("FootNoteThree")); + } + break; + default: + break; + } + return o; +} + +void tgenEditorialGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"(FootNoteTwo)" ); - streamLine( os, i, R"(LevelTwo)", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"(FootNoteThree)", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"(FootNoteTwo)"); + streamLine(os, i, R"(LevelTwo)", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"(FootNoteThree)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/EditorialGroupTest.h b/Sourcecode/private/mxtest/core/EditorialGroupTest.h index c6882b719..ae0258bdb 100644 --- a/Sourcecode/private/mxtest/core/EditorialGroupTest.h +++ b/Sourcecode/private/mxtest/core/EditorialGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::EditorialGroupPtr tgenEditorialGroup( TestMode v ); - void tgenEditorialGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::EditorialGroupPtr tgenEditorialGroup(TestMode v); +void tgenEditorialGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.cpp b/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.cpp index 5bf403acc..771be0264 100644 --- a/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.cpp @@ -6,120 +6,116 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/EditorialVoiceGroupTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, EditorialVoiceGroup ) +TEST(Test01, EditorialVoiceGroup) { TestMode v = TestMode::one; - EditorialVoiceGroupPtr object = tgenEditorialVoiceGroup( v ); - stringstream expected; - tgenEditorialVoiceGroupExpected( expected, 0, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 0, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + EditorialVoiceGroupPtr object = tgenEditorialVoiceGroup(v); + stringstream expected; + tgenEditorialVoiceGroupExpected(expected, 0, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 0, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, EditorialVoiceGroup ) + +TEST(Test02, EditorialVoiceGroup) { TestMode v = TestMode::two; - EditorialVoiceGroupPtr object = tgenEditorialVoiceGroup( v ); - stringstream expected; - tgenEditorialVoiceGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + EditorialVoiceGroupPtr object = tgenEditorialVoiceGroup(v); + stringstream expected; + tgenEditorialVoiceGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, EditorialVoiceGroup ) + +TEST(Test03, EditorialVoiceGroup) { TestMode v = TestMode::three; - EditorialVoiceGroupPtr object = tgenEditorialVoiceGroup( v ); - stringstream expected; - tgenEditorialVoiceGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + EditorialVoiceGroupPtr object = tgenEditorialVoiceGroup(v); + stringstream expected; + tgenEditorialVoiceGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - EditorialVoiceGroupPtr tgenEditorialVoiceGroup( TestMode v ) +EditorialVoiceGroupPtr tgenEditorialVoiceGroup(TestMode v) +{ + EditorialVoiceGroupPtr o = makeEditorialVoiceGroup(); + switch (v) { - EditorialVoiceGroupPtr o = makeEditorialVoiceGroup(); - switch ( v ) - { - case TestMode::one: - { - } - break; - case TestMode::two: - { - o->setHasLevel( true ); - o->getLevel()->setValue( XsString( "LevelTwo" ) ); - o->setHasFootnote( true ); - o->getFootnote()->setValue( XsString( "FootNoteTwo" ) ); - o->setHasVoice( true ); - o->getVoice()->setValue( XsString( "123" ) ); - } - break; - case TestMode::three: - { - o->setHasFootnote( true ); - o->getFootnote()->setValue( XsString( "FootNoteThree" ) ); - o->setHasVoice( true ); - o->getVoice()->setValue( XsString( "456" ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasLevel(true); + o->getLevel()->setValue(XsString("LevelTwo")); + o->setHasFootnote(true); + o->getFootnote()->setValue(XsString("FootNoteTwo")); + o->setHasVoice(true); + o->getVoice()->setValue(XsString("123")); } - void tgenEditorialVoiceGroupExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->setHasFootnote(true); + o->getFootnote()->setValue(XsString("FootNoteThree")); + o->setHasVoice(true); + o->getVoice()->setValue(XsString("456")); + } + break; + default: + break; + } + return o; +} + +void tgenEditorialVoiceGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"(FootNoteTwo)" ); - streamLine( os, i, R"(LevelTwo)" ); - streamLine( os, i, R"(123)", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"(FootNoteThree)" ); - streamLine( os, i, R"(456)", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"(FootNoteTwo)"); + streamLine(os, i, R"(LevelTwo)"); + streamLine(os, i, R"(123)", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"(FootNoteThree)"); + streamLine(os, i, R"(456)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.h b/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.h index 59b39116e..2aaa4fa22 100644 --- a/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.h +++ b/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::EditorialVoiceGroupPtr tgenEditorialVoiceGroup( TestMode v ); - void tgenEditorialVoiceGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::EditorialVoiceGroupPtr tgenEditorialVoiceGroup(TestMode v); +void tgenEditorialVoiceGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/EffectTest.cpp b/Sourcecode/private/mxtest/core/EffectTest.cpp index 3a0e45ab1..ac5a3c380 100644 --- a/Sourcecode/private/mxtest/core/EffectTest.cpp +++ b/Sourcecode/private/mxtest/core/EffectTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Effect ) +TEST(Test01, Effect) { - std::string indentString( INDENT ); - EffectEnum value1 = EffectEnum::autoHorn; - EffectEnum value2 = EffectEnum::cannon; - Effect object1; - Effect object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(anvil)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(cannon)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + EffectEnum value1 = EffectEnum::autoHorn; + EffectEnum value2 = EffectEnum::cannon; + Effect object1; + Effect object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(anvil)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(cannon)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ElevationTest.cpp b/Sourcecode/private/mxtest/core/ElevationTest.cpp index 80e8284fa..d7dd52406 100644 --- a/Sourcecode/private/mxtest/core/ElevationTest.cpp +++ b/Sourcecode/private/mxtest/core/ElevationTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Elevation ) +TEST(Test01, Elevation) { - std::string indentString( INDENT ); - RotationDegrees value1{ 89.999 }; - RotationDegrees value2{ -90.001 }; - Elevation object1; - Elevation object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(-90.001)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + RotationDegrees value1{89.999}; + RotationDegrees value2{-90.001}; + Elevation object1; + Elevation object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(-90.001)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.cpp b/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.cpp index 339e794f3..f0435c0aa 100644 --- a/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.cpp @@ -6,117 +6,113 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/ElisionSyllabicGroupTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, ElisionSyllabicGroup ) +TEST(Test01, ElisionSyllabicGroup) { TestMode v = TestMode::one; - ElisionSyllabicGroupPtr object = tgenElisionSyllabicGroup( v ); - stringstream expected; - tgenElisionSyllabicGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ElisionSyllabicGroupPtr object = tgenElisionSyllabicGroup(v); + stringstream expected; + tgenElisionSyllabicGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, ElisionSyllabicGroup ) + +TEST(Test02, ElisionSyllabicGroup) { TestMode v = TestMode::two; - ElisionSyllabicGroupPtr object = tgenElisionSyllabicGroup( v ); - stringstream expected; - tgenElisionSyllabicGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ElisionSyllabicGroupPtr object = tgenElisionSyllabicGroup(v); + stringstream expected; + tgenElisionSyllabicGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, ElisionSyllabicGroup ) + +TEST(Test03, ElisionSyllabicGroup) { TestMode v = TestMode::three; - ElisionSyllabicGroupPtr object = tgenElisionSyllabicGroup( v ); - stringstream expected; - tgenElisionSyllabicGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + ElisionSyllabicGroupPtr object = tgenElisionSyllabicGroup(v); + stringstream expected; + tgenElisionSyllabicGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ElisionSyllabicGroupPtr tgenElisionSyllabicGroup( TestMode v ) +ElisionSyllabicGroupPtr tgenElisionSyllabicGroup(TestMode v) +{ + ElisionSyllabicGroupPtr o = makeElisionSyllabicGroup(); + switch (v) { - ElisionSyllabicGroupPtr o = makeElisionSyllabicGroup(); - switch ( v ) - { - case TestMode::one: - { - o->getElision()->setValue( XsString( "A" ) ); - } - break; - case TestMode::two: - { - o->getElision()->setValue( XsString( "B" ) ); - o->setHasSyllabic( true ); - o->getSyllabic()->setValue( SyllabicEnum::single ); - } - break; - case TestMode::three: - { - o->getElision()->setValue( XsString( "C" ) ); - o->setHasSyllabic( true ); - o->getSyllabic()->setValue( SyllabicEnum::middle ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->getElision()->setValue(XsString("A")); + } + break; + case TestMode::two: { + o->getElision()->setValue(XsString("B")); + o->setHasSyllabic(true); + o->getSyllabic()->setValue(SyllabicEnum::single); } - void tgenElisionSyllabicGroupExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->getElision()->setValue(XsString("C")); + o->setHasSyllabic(true); + o->getSyllabic()->setValue(SyllabicEnum::middle); + } + break; + default: + break; + } + return o; +} + +void tgenElisionSyllabicGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { + case TestMode::one: { - streamLine( os, i, R"(A)", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"(B)" ); - streamLine( os, i, R"(single)", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"(C)" ); - streamLine( os, i, R"(middle)", false ); - } - break; - default: - break; - } + streamLine(os, i, R"(A)", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"(B)"); + streamLine(os, i, R"(single)", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"(C)"); + streamLine(os, i, R"(middle)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.h b/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.h index 2d5874927..be4e516b4 100644 --- a/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.h +++ b/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.h @@ -6,13 +6,13 @@ #ifdef MX_COMPILE_CORE_TESTS #pragma once -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ElisionSyllabicGroupPtr tgenElisionSyllabicGroup( TestMode v ); - void tgenElisionSyllabicGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ElisionSyllabicGroupPtr tgenElisionSyllabicGroup(TestMode v); +void tgenElisionSyllabicGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp b/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp index 15c831b4a..894d05aef 100644 --- a/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp @@ -6,121 +6,117 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/ElisionSyllabicGroupTest.h" #include "mxtest/core/ElisionSyllabicTextGroupTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, ElisionSyllabicTextGroup ) +TEST(Test01, ElisionSyllabicTextGroup) { TestMode v = TestMode::one; - ElisionSyllabicTextGroupPtr object = tgenElisionSyllabicTextGroup( v ); - stringstream expected; - tgenElisionSyllabicTextGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ElisionSyllabicTextGroupPtr object = tgenElisionSyllabicTextGroup(v); + stringstream expected; + tgenElisionSyllabicTextGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, ElisionSyllabicTextGroup ) + +TEST(Test02, ElisionSyllabicTextGroup) { TestMode v = TestMode::two; - ElisionSyllabicTextGroupPtr object = tgenElisionSyllabicTextGroup( v ); - stringstream expected; - tgenElisionSyllabicTextGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ElisionSyllabicTextGroupPtr object = tgenElisionSyllabicTextGroup(v); + stringstream expected; + tgenElisionSyllabicTextGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, ElisionSyllabicTextGroup ) + +TEST(Test03, ElisionSyllabicTextGroup) { TestMode v = TestMode::three; - ElisionSyllabicTextGroupPtr object = tgenElisionSyllabicTextGroup( v ); - stringstream expected; - tgenElisionSyllabicTextGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + ElisionSyllabicTextGroupPtr object = tgenElisionSyllabicTextGroup(v); + stringstream expected; + tgenElisionSyllabicTextGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ElisionSyllabicTextGroupPtr tgenElisionSyllabicTextGroup( TestMode v ) +ElisionSyllabicTextGroupPtr tgenElisionSyllabicTextGroup(TestMode v) +{ + ElisionSyllabicTextGroupPtr o = makeElisionSyllabicTextGroup(); + switch (v) { - ElisionSyllabicTextGroupPtr o = makeElisionSyllabicTextGroup(); - switch ( v ) - { - case TestMode::one: - { - o->setElisionSyllabicGroup( tgenElisionSyllabicGroup( v ) ); - o->getText()->setValue( XsString( "Brahms" ) ); - } - break; - case TestMode::two: - { - o->setElisionSyllabicGroup( tgenElisionSyllabicGroup( v ) ); - o->setHasElisionSyllabicGroup( true ); - o->getText()->setValue( XsString( "Beethoven" ) ); - } - break; - case TestMode::three: - { - o->setElisionSyllabicGroup( tgenElisionSyllabicGroup( v ) ); - o->setHasElisionSyllabicGroup( true ); - o->getText()->setValue( XsString( "Berlioz" ) ); - - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setElisionSyllabicGroup(tgenElisionSyllabicGroup(v)); + o->getText()->setValue(XsString("Brahms")); + } + break; + case TestMode::two: { + o->setElisionSyllabicGroup(tgenElisionSyllabicGroup(v)); + o->setHasElisionSyllabicGroup(true); + o->getText()->setValue(XsString("Beethoven")); + } + break; + case TestMode::three: { + o->setElisionSyllabicGroup(tgenElisionSyllabicGroup(v)); + o->setHasElisionSyllabicGroup(true); + o->getText()->setValue(XsString("Berlioz")); } - void tgenElisionSyllabicTextGroupExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenElisionSyllabicTextGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - - streamLine( os, i, R"(Brahms)", false ); - } - break; - case TestMode::two: - { - tgenElisionSyllabicGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(Beethoven)", false ); - } - break; - case TestMode::three: - { - tgenElisionSyllabicGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(Berlioz)", false ); - } - break; - default: - break; - } + case TestMode::one: { + + streamLine(os, i, R"(Brahms)", false); + } + break; + case TestMode::two: { + tgenElisionSyllabicGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(Beethoven)", false); + } + break; + case TestMode::three: { + tgenElisionSyllabicGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(Berlioz)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.h b/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.h index 36e3e2ef2..4fa02422e 100644 --- a/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.h +++ b/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ElisionSyllabicTextGroupPtr tgenElisionSyllabicTextGroup( TestMode v ); - void tgenElisionSyllabicTextGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ElisionSyllabicTextGroupPtr tgenElisionSyllabicTextGroup(TestMode v); +void tgenElisionSyllabicTextGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ElisionTest.cpp b/Sourcecode/private/mxtest/core/ElisionTest.cpp index cbd0eb0e8..ef5b1c2e4 100644 --- a/Sourcecode/private/mxtest/core/ElisionTest.cpp +++ b/Sourcecode/private/mxtest/core/ElisionTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Elision ) +TEST(Test01, Elision) { - std::string indentString( INDENT ); - XsString value1{ "down" }; - XsString value2{ "up" }; - Elision object1; - Elision object2( value2 ); - ElisionAttributesPtr attributes1 = std::make_shared(); - ElisionAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"down"}; + XsString value2{"up"}; + Elision object1; + Elision object2(value2); + ElisionAttributesPtr attributes1 = std::make_shared(); + ElisionAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasOverline = true; - attributes1->overline = NumberOfLines{ 4 }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(up)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->overline = NumberOfLines{4}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(up)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/EncoderTest.cpp b/Sourcecode/private/mxtest/core/EncoderTest.cpp index f161e5a0a..29922f1dc 100644 --- a/Sourcecode/private/mxtest/core/EncoderTest.cpp +++ b/Sourcecode/private/mxtest/core/EncoderTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Encoder ) +TEST(Test01, Encoder) { - std::string indentString( INDENT ); - XsString value1{ "Berlioz" }; - XsString value2{ "Bach" }; - Encoder object1; - Encoder object2( value2 ); - EncoderAttributesPtr attributes1 = std::make_shared(); - EncoderAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Berlioz"}; + XsString value2{"Bach"}; + Encoder object1; + Encoder object2(value2); + EncoderAttributesPtr attributes1 = std::make_shared(); + EncoderAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasType = true; - attributes1->type = XsToken{ " Briggs " }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Bach)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->type = XsToken{" Briggs "}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Bach)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/EncodingDateTest.cpp b/Sourcecode/private/mxtest/core/EncodingDateTest.cpp index 9524d979c..f0dd15929 100644 --- a/Sourcecode/private/mxtest/core/EncodingDateTest.cpp +++ b/Sourcecode/private/mxtest/core/EncodingDateTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, EncodingDate ) +TEST(Test01, EncodingDate) { - std::string indentString( INDENT ); - Date value1{ 2015, 3, 12 }; - Date value2{ 2015, 4, 27 }; - EncodingDate object1; - EncodingDate object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1900-01-01)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2015-04-27)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Date value1{2015, 3, 12}; + Date value2{2015, 4, 27}; + EncodingDate object1; + EncodingDate object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1900-01-01)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2015-04-27)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/EncodingDescriptionTest.cpp b/Sourcecode/private/mxtest/core/EncodingDescriptionTest.cpp index 18714dd73..9e8828247 100644 --- a/Sourcecode/private/mxtest/core/EncodingDescriptionTest.cpp +++ b/Sourcecode/private/mxtest/core/EncodingDescriptionTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, EncodingDescription ) +TEST(Test01, EncodingDescription) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - EncodingDescription object1; - EncodingDescription object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + EncodingDescription object1; + EncodingDescription object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/EncodingTest.cpp b/Sourcecode/private/mxtest/core/EncodingTest.cpp index 394b627b0..fd98949a0 100644 --- a/Sourcecode/private/mxtest/core/EncodingTest.cpp +++ b/Sourcecode/private/mxtest/core/EncodingTest.cpp @@ -6,123 +6,119 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/EncodingTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Encoding ) +TEST(Test01, Encoding) { TestMode v = TestMode::one; - EncodingPtr object = tgenEncoding( v ); - stringstream expected; - tgenEncodingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + EncodingPtr object = tgenEncoding(v); + stringstream expected; + tgenEncodingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Encoding ) + +TEST(Test02, Encoding) { TestMode v = TestMode::two; - EncodingPtr object = tgenEncoding( v ); - stringstream expected; - tgenEncodingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + EncodingPtr object = tgenEncoding(v); + stringstream expected; + tgenEncodingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Encoding ) + +TEST(Test03, Encoding) { TestMode v = TestMode::three; - EncodingPtr object = tgenEncoding( v ); - stringstream expected; - tgenEncodingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + EncodingPtr object = tgenEncoding(v); + stringstream expected; + tgenEncodingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - EncodingPtr tgenEncoding( TestMode v ) +EncodingPtr tgenEncoding(TestMode v) +{ + EncodingPtr o = makeEncoding(); + switch (v) { - EncodingPtr o = makeEncoding(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - auto encodingChoice = makeEncodingChoice(); - encodingChoice->setChoice( EncodingChoice::Choice::software ); - encodingChoice->getSoftware()->setValue( XsString( "My Software!" ) ); - o->addEncodingChoice( encodingChoice ); - } - break; - case TestMode::three: - { - auto encodingChoice = makeEncodingChoice(); - encodingChoice->setChoice( EncodingChoice::Choice::software ); - encodingChoice->getSoftware()->setValue( XsString( "Described" ) ); - o->addEncodingChoice( encodingChoice ); + case TestMode::one: { + } + break; + case TestMode::two: { + auto encodingChoice = makeEncodingChoice(); + encodingChoice->setChoice(EncodingChoice::Choice::software); + encodingChoice->getSoftware()->setValue(XsString("My Software!")); + o->addEncodingChoice(encodingChoice); + } + break; + case TestMode::three: { + auto encodingChoice = makeEncodingChoice(); + encodingChoice->setChoice(EncodingChoice::Choice::software); + encodingChoice->getSoftware()->setValue(XsString("Described")); + o->addEncodingChoice(encodingChoice); - auto anotherChoice = makeEncodingChoice(); - anotherChoice->setChoice( EncodingChoice::Choice::supports ); - o->addEncodingChoice( anotherChoice ); - anotherChoice->getSupports()->getAttributes()->element = XsNMToken( "stupid" ); - anotherChoice->getSupports()->getAttributes()->hasValue = true; - anotherChoice->getSupports()->getAttributes()->value = XsToken( "TOKEN" ); - } - break; - default: - break; - } - return o; + auto anotherChoice = makeEncodingChoice(); + anotherChoice->setChoice(EncodingChoice::Choice::supports); + o->addEncodingChoice(anotherChoice); + anotherChoice->getSupports()->getAttributes()->element = XsNMToken("stupid"); + anotherChoice->getSupports()->getAttributes()->hasValue = true; + anotherChoice->getSupports()->getAttributes()->value = XsToken("TOKEN"); + } + break; + default: + break; } - void tgenEncodingExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenEncodingExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(My Software!)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Described)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(My Software!)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Described)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/EncodingTest.h b/Sourcecode/private/mxtest/core/EncodingTest.h index c789cfb82..417f42b28 100644 --- a/Sourcecode/private/mxtest/core/EncodingTest.h +++ b/Sourcecode/private/mxtest/core/EncodingTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::EncodingPtr tgenEncoding( TestMode v ); - void tgenEncodingExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::EncodingPtr tgenEncoding(TestMode v); +void tgenEncodingExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/EndLineTest.cpp b/Sourcecode/private/mxtest/core/EndLineTest.cpp index 484dd2cfc..8be2dfe3f 100644 --- a/Sourcecode/private/mxtest/core/EndLineTest.cpp +++ b/Sourcecode/private/mxtest/core/EndLineTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, EndLine ) +TEST(Test01, EndLine) { - std::string indentString( INDENT ); - EndLine object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + EndLine object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/EndParagraphTest.cpp b/Sourcecode/private/mxtest/core/EndParagraphTest.cpp index 6e5f7120f..8c88d32b6 100644 --- a/Sourcecode/private/mxtest/core/EndParagraphTest.cpp +++ b/Sourcecode/private/mxtest/core/EndParagraphTest.cpp @@ -11,28 +11,27 @@ using namespace mx::core; - -TEST( Test01, EndParagraph ) +TEST(Test01, EndParagraph) { - std::string indentString( INDENT ); - EndParagraph object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + EndParagraph object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/EndingTest.cpp b/Sourcecode/private/mxtest/core/EndingTest.cpp index f189b79be..3c22ad597 100644 --- a/Sourcecode/private/mxtest/core/EndingTest.cpp +++ b/Sourcecode/private/mxtest/core/EndingTest.cpp @@ -11,34 +11,36 @@ using namespace mx::core; -TEST( Test01, Ending ) +TEST(Test01, Ending) { - std::string indentString( INDENT ); - XsString value1 { "Josh" }; - XsString value2 { "Andrea" }; - Ending object1; - Ending object2( value2 ); - EndingAttributesPtr attributes1 = std::make_shared(); - EndingAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Andrea)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"Josh"}; + XsString value2{"Andrea"}; + Ending object1; + Ending object2(value2); + EndingAttributesPtr attributes1 = std::make_shared(); + EndingAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Andrea)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/EnsembleTest.cpp b/Sourcecode/private/mxtest/core/EnsembleTest.cpp index 5d9f0f489..ca242cfda 100644 --- a/Sourcecode/private/mxtest/core/EnsembleTest.cpp +++ b/Sourcecode/private/mxtest/core/EnsembleTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Ensemble ) +TEST(Test01, Ensemble) { - std::string indentString( INDENT ); - PositiveIntegerOrEmpty value1{ PositiveInteger{ 1 } }; - PositiveIntegerOrEmpty value2{ PositiveInteger{ 3 } }; - Ensemble object1; - Ensemble object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + PositiveIntegerOrEmpty value1{PositiveInteger{1}}; + PositiveIntegerOrEmpty value2{PositiveInteger{3}}; + Ensemble object1; + Ensemble object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/EnumsTest.cpp b/Sourcecode/private/mxtest/core/EnumsTest.cpp index 078f382c1..91a4f3d91 100644 --- a/Sourcecode/private/mxtest/core/EnumsTest.cpp +++ b/Sourcecode/private/mxtest/core/EnumsTest.cpp @@ -11,12811 +11,12827 @@ using namespace mx::core; -TEST( AboveBelow_BadParse, Enums ) +TEST(AboveBelow_BadParse, Enums) { - AboveBelow actual = parseAboveBelow( "above" ); - AboveBelow expected = AboveBelow::above; - CHECK_EQUAL( expected, actual ) + AboveBelow actual = parseAboveBelow("above"); + AboveBelow expected = AboveBelow::above; + CHECK_EQUAL(expected, actual) } -TEST( AboveBelow_above, Enums ) +TEST(AboveBelow_above, Enums) { - AboveBelow e = AboveBelow::above; - std::string expected = "above"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AboveBelow e = AboveBelow::above; + std::string expected = "above"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AboveBelow e2 = parseAboveBelow( expected ); - CHECK_EQUAL( e, e2 ) + AboveBelow e2 = parseAboveBelow(expected); + CHECK_EQUAL(e, e2) } -TEST( AboveBelow_below, Enums ) +TEST(AboveBelow_below, Enums) { - AboveBelow e = AboveBelow::below; - std::string expected = "below"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AboveBelow e = AboveBelow::below; + std::string expected = "below"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AboveBelow e2 = parseAboveBelow( expected ); - CHECK_EQUAL( e, e2 ) + AboveBelow e2 = parseAboveBelow(expected); + CHECK_EQUAL(e, e2) } -TEST( CssFontSize_BadParse, Enums ) +TEST(CssFontSize_BadParse, Enums) { - CssFontSize actual = parseCssFontSize( "xx-small" ); - CssFontSize expected = CssFontSize::xxSmall; - CHECK_EQUAL( expected, actual ) + CssFontSize actual = parseCssFontSize("xx-small"); + CssFontSize expected = CssFontSize::xxSmall; + CHECK_EQUAL(expected, actual) } -TEST( CssFontSize_xxSmall, Enums ) +TEST(CssFontSize_xxSmall, Enums) { - CssFontSize e = CssFontSize::xxSmall; - std::string expected = "xx-small"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CssFontSize e = CssFontSize::xxSmall; + std::string expected = "xx-small"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CssFontSize e2 = parseCssFontSize( expected ); - CHECK_EQUAL( e, e2 ) + CssFontSize e2 = parseCssFontSize(expected); + CHECK_EQUAL(e, e2) } -TEST( CssFontSize_xSmall, Enums ) +TEST(CssFontSize_xSmall, Enums) { - CssFontSize e = CssFontSize::xSmall; - std::string expected = "x-small"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CssFontSize e = CssFontSize::xSmall; + std::string expected = "x-small"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CssFontSize e2 = parseCssFontSize( expected ); - CHECK_EQUAL( e, e2 ) + CssFontSize e2 = parseCssFontSize(expected); + CHECK_EQUAL(e, e2) } -TEST( CssFontSize_small, Enums ) +TEST(CssFontSize_small, Enums) { - CssFontSize e = CssFontSize::small; - std::string expected = "small"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CssFontSize e = CssFontSize::small; + std::string expected = "small"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CssFontSize e2 = parseCssFontSize( expected ); - CHECK_EQUAL( e, e2 ) + CssFontSize e2 = parseCssFontSize(expected); + CHECK_EQUAL(e, e2) } -TEST( CssFontSize_medium, Enums ) +TEST(CssFontSize_medium, Enums) { - CssFontSize e = CssFontSize::medium; - std::string expected = "medium"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CssFontSize e = CssFontSize::medium; + std::string expected = "medium"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CssFontSize e2 = parseCssFontSize( expected ); - CHECK_EQUAL( e, e2 ) + CssFontSize e2 = parseCssFontSize(expected); + CHECK_EQUAL(e, e2) } -TEST( CssFontSize_large, Enums ) +TEST(CssFontSize_large, Enums) { - CssFontSize e = CssFontSize::large; - std::string expected = "large"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CssFontSize e = CssFontSize::large; + std::string expected = "large"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CssFontSize e2 = parseCssFontSize( expected ); - CHECK_EQUAL( e, e2 ) + CssFontSize e2 = parseCssFontSize(expected); + CHECK_EQUAL(e, e2) } -TEST( CssFontSize_xLarge, Enums ) +TEST(CssFontSize_xLarge, Enums) { - CssFontSize e = CssFontSize::xLarge; - std::string expected = "x-large"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CssFontSize e = CssFontSize::xLarge; + std::string expected = "x-large"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CssFontSize e2 = parseCssFontSize( expected ); - CHECK_EQUAL( e, e2 ) + CssFontSize e2 = parseCssFontSize(expected); + CHECK_EQUAL(e, e2) } -TEST( CssFontSize_xxLarge, Enums ) +TEST(CssFontSize_xxLarge, Enums) { - CssFontSize e = CssFontSize::xxLarge; - std::string expected = "xx-large"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CssFontSize e = CssFontSize::xxLarge; + std::string expected = "xx-large"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CssFontSize e2 = parseCssFontSize( expected ); - CHECK_EQUAL( e, e2 ) + CssFontSize e2 = parseCssFontSize(expected); + CHECK_EQUAL(e, e2) } -TEST( EnclosureShape_BadParse, Enums ) +TEST(EnclosureShape_BadParse, Enums) { - EnclosureShape actual = parseEnclosureShape( "rectangle" ); - EnclosureShape expected = EnclosureShape::rectangle; - CHECK_EQUAL( expected, actual ) + EnclosureShape actual = parseEnclosureShape("rectangle"); + EnclosureShape expected = EnclosureShape::rectangle; + CHECK_EQUAL(expected, actual) } -TEST( EnclosureShape_rectangle, Enums ) +TEST(EnclosureShape_rectangle, Enums) { - EnclosureShape e = EnclosureShape::rectangle; - std::string expected = "rectangle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EnclosureShape e = EnclosureShape::rectangle; + std::string expected = "rectangle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EnclosureShape e2 = parseEnclosureShape( expected ); - CHECK_EQUAL( e, e2 ) + EnclosureShape e2 = parseEnclosureShape(expected); + CHECK_EQUAL(e, e2) } -TEST( EnclosureShape_square, Enums ) +TEST(EnclosureShape_square, Enums) { - EnclosureShape e = EnclosureShape::square; - std::string expected = "square"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EnclosureShape e = EnclosureShape::square; + std::string expected = "square"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EnclosureShape e2 = parseEnclosureShape( expected ); - CHECK_EQUAL( e, e2 ) + EnclosureShape e2 = parseEnclosureShape(expected); + CHECK_EQUAL(e, e2) } -TEST( EnclosureShape_oval, Enums ) +TEST(EnclosureShape_oval, Enums) { - EnclosureShape e = EnclosureShape::oval; - std::string expected = "oval"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EnclosureShape e = EnclosureShape::oval; + std::string expected = "oval"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EnclosureShape e2 = parseEnclosureShape( expected ); - CHECK_EQUAL( e, e2 ) + EnclosureShape e2 = parseEnclosureShape(expected); + CHECK_EQUAL(e, e2) } -TEST( EnclosureShape_circle, Enums ) +TEST(EnclosureShape_circle, Enums) { - EnclosureShape e = EnclosureShape::circle; - std::string expected = "circle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EnclosureShape e = EnclosureShape::circle; + std::string expected = "circle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EnclosureShape e2 = parseEnclosureShape( expected ); - CHECK_EQUAL( e, e2 ) + EnclosureShape e2 = parseEnclosureShape(expected); + CHECK_EQUAL(e, e2) } -TEST( EnclosureShape_bracket, Enums ) +TEST(EnclosureShape_bracket, Enums) { - EnclosureShape e = EnclosureShape::bracket; - std::string expected = "bracket"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EnclosureShape e = EnclosureShape::bracket; + std::string expected = "bracket"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EnclosureShape e2 = parseEnclosureShape( expected ); - CHECK_EQUAL( e, e2 ) + EnclosureShape e2 = parseEnclosureShape(expected); + CHECK_EQUAL(e, e2) } -TEST( EnclosureShape_triangle, Enums ) +TEST(EnclosureShape_triangle, Enums) { - EnclosureShape e = EnclosureShape::triangle; - std::string expected = "triangle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EnclosureShape e = EnclosureShape::triangle; + std::string expected = "triangle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EnclosureShape e2 = parseEnclosureShape( expected ); - CHECK_EQUAL( e, e2 ) + EnclosureShape e2 = parseEnclosureShape(expected); + CHECK_EQUAL(e, e2) } -TEST( EnclosureShape_diamond, Enums ) +TEST(EnclosureShape_diamond, Enums) { - EnclosureShape e = EnclosureShape::diamond; - std::string expected = "diamond"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EnclosureShape e = EnclosureShape::diamond; + std::string expected = "diamond"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EnclosureShape e2 = parseEnclosureShape( expected ); - CHECK_EQUAL( e, e2 ) + EnclosureShape e2 = parseEnclosureShape(expected); + CHECK_EQUAL(e, e2) } -TEST( EnclosureShape_none, Enums ) +TEST(EnclosureShape_none, Enums) { - EnclosureShape e = EnclosureShape::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EnclosureShape e = EnclosureShape::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EnclosureShape e2 = parseEnclosureShape( expected ); - CHECK_EQUAL( e, e2 ) + EnclosureShape e2 = parseEnclosureShape(expected); + CHECK_EQUAL(e, e2) } -TEST( FermataShape_BadParse, Enums ) +TEST(FermataShape_BadParse, Enums) { - FermataShape actual = parseFermataShape( "normal" ); - FermataShape expected = FermataShape::normal; - CHECK_EQUAL( expected, actual ) + FermataShape actual = parseFermataShape("normal"); + FermataShape expected = FermataShape::normal; + CHECK_EQUAL(expected, actual) } -TEST( FermataShape_normal, Enums ) +TEST(FermataShape_normal, Enums) { - FermataShape e = FermataShape::normal; - std::string expected = "normal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + FermataShape e = FermataShape::normal; + std::string expected = "normal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - FermataShape e2 = parseFermataShape( expected ); - CHECK_EQUAL( e, e2 ) + FermataShape e2 = parseFermataShape(expected); + CHECK_EQUAL(e, e2) } -TEST( FermataShape_angled, Enums ) +TEST(FermataShape_angled, Enums) { - FermataShape e = FermataShape::angled; - std::string expected = "angled"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + FermataShape e = FermataShape::angled; + std::string expected = "angled"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - FermataShape e2 = parseFermataShape( expected ); - CHECK_EQUAL( e, e2 ) + FermataShape e2 = parseFermataShape(expected); + CHECK_EQUAL(e, e2) } -TEST( FermataShape_square, Enums ) +TEST(FermataShape_square, Enums) { - FermataShape e = FermataShape::square; - std::string expected = "square"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + FermataShape e = FermataShape::square; + std::string expected = "square"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - FermataShape e2 = parseFermataShape( expected ); - CHECK_EQUAL( e, e2 ) + FermataShape e2 = parseFermataShape(expected); + CHECK_EQUAL(e, e2) } -TEST( FermataShape_emptystring, Enums ) +TEST(FermataShape_emptystring, Enums) { - FermataShape e = FermataShape::emptystring; - std::string expected = ""; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + FermataShape e = FermataShape::emptystring; + std::string expected = ""; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - FermataShape e2 = parseFermataShape( expected ); - CHECK_EQUAL( e, e2 ) + FermataShape e2 = parseFermataShape(expected); + CHECK_EQUAL(e, e2) } -TEST( FontStyle_BadParse, Enums ) +TEST(FontStyle_BadParse, Enums) { - FontStyle actual = parseFontStyle( "normal" ); - FontStyle expected = FontStyle::normal; - CHECK_EQUAL( expected, actual ) + FontStyle actual = parseFontStyle("normal"); + FontStyle expected = FontStyle::normal; + CHECK_EQUAL(expected, actual) } -TEST( FontStyle_normal, Enums ) +TEST(FontStyle_normal, Enums) { - FontStyle e = FontStyle::normal; - std::string expected = "normal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + FontStyle e = FontStyle::normal; + std::string expected = "normal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - FontStyle e2 = parseFontStyle( expected ); - CHECK_EQUAL( e, e2 ) + FontStyle e2 = parseFontStyle(expected); + CHECK_EQUAL(e, e2) } -TEST( FontStyle_italic, Enums ) +TEST(FontStyle_italic, Enums) { - FontStyle e = FontStyle::italic; - std::string expected = "italic"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + FontStyle e = FontStyle::italic; + std::string expected = "italic"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - FontStyle e2 = parseFontStyle( expected ); - CHECK_EQUAL( e, e2 ) + FontStyle e2 = parseFontStyle(expected); + CHECK_EQUAL(e, e2) } -TEST( FontWeight_BadParse, Enums ) +TEST(FontWeight_BadParse, Enums) { - FontWeight actual = parseFontWeight( "normal" ); - FontWeight expected = FontWeight::normal; - CHECK_EQUAL( expected, actual ) + FontWeight actual = parseFontWeight("normal"); + FontWeight expected = FontWeight::normal; + CHECK_EQUAL(expected, actual) } -TEST( FontWeight_normal, Enums ) +TEST(FontWeight_normal, Enums) { - FontWeight e = FontWeight::normal; - std::string expected = "normal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + FontWeight e = FontWeight::normal; + std::string expected = "normal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - FontWeight e2 = parseFontWeight( expected ); - CHECK_EQUAL( e, e2 ) + FontWeight e2 = parseFontWeight(expected); + CHECK_EQUAL(e, e2) } -TEST( FontWeight_bold, Enums ) +TEST(FontWeight_bold, Enums) { - FontWeight e = FontWeight::bold; - std::string expected = "bold"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + FontWeight e = FontWeight::bold; + std::string expected = "bold"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - FontWeight e2 = parseFontWeight( expected ); - CHECK_EQUAL( e, e2 ) + FontWeight e2 = parseFontWeight(expected); + CHECK_EQUAL(e, e2) } -TEST( LeftCenterRight_BadParse, Enums ) +TEST(LeftCenterRight_BadParse, Enums) { - LeftCenterRight actual = parseLeftCenterRight( "left" ); - LeftCenterRight expected = LeftCenterRight::left; - CHECK_EQUAL( expected, actual ) + LeftCenterRight actual = parseLeftCenterRight("left"); + LeftCenterRight expected = LeftCenterRight::left; + CHECK_EQUAL(expected, actual) } -TEST( LeftCenterRight_left, Enums ) +TEST(LeftCenterRight_left, Enums) { - LeftCenterRight e = LeftCenterRight::left; - std::string expected = "left"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LeftCenterRight e = LeftCenterRight::left; + std::string expected = "left"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LeftCenterRight e2 = parseLeftCenterRight( expected ); - CHECK_EQUAL( e, e2 ) + LeftCenterRight e2 = parseLeftCenterRight(expected); + CHECK_EQUAL(e, e2) } -TEST( LeftCenterRight_center, Enums ) +TEST(LeftCenterRight_center, Enums) { - LeftCenterRight e = LeftCenterRight::center; - std::string expected = "center"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LeftCenterRight e = LeftCenterRight::center; + std::string expected = "center"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LeftCenterRight e2 = parseLeftCenterRight( expected ); - CHECK_EQUAL( e, e2 ) + LeftCenterRight e2 = parseLeftCenterRight(expected); + CHECK_EQUAL(e, e2) } -TEST( LeftCenterRight_right, Enums ) +TEST(LeftCenterRight_right, Enums) { - LeftCenterRight e = LeftCenterRight::right; - std::string expected = "right"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LeftCenterRight e = LeftCenterRight::right; + std::string expected = "right"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LeftCenterRight e2 = parseLeftCenterRight( expected ); - CHECK_EQUAL( e, e2 ) + LeftCenterRight e2 = parseLeftCenterRight(expected); + CHECK_EQUAL(e, e2) } -TEST( LeftRight_BadParse, Enums ) +TEST(LeftRight_BadParse, Enums) { - LeftRight actual = parseLeftRight( "left" ); - LeftRight expected = LeftRight::left; - CHECK_EQUAL( expected, actual ) + LeftRight actual = parseLeftRight("left"); + LeftRight expected = LeftRight::left; + CHECK_EQUAL(expected, actual) } -TEST( LeftRight_left, Enums ) +TEST(LeftRight_left, Enums) { - LeftRight e = LeftRight::left; - std::string expected = "left"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LeftRight e = LeftRight::left; + std::string expected = "left"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LeftRight e2 = parseLeftRight( expected ); - CHECK_EQUAL( e, e2 ) + LeftRight e2 = parseLeftRight(expected); + CHECK_EQUAL(e, e2) } -TEST( LeftRight_right, Enums ) +TEST(LeftRight_right, Enums) { - LeftRight e = LeftRight::right; - std::string expected = "right"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LeftRight e = LeftRight::right; + std::string expected = "right"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LeftRight e2 = parseLeftRight( expected ); - CHECK_EQUAL( e, e2 ) + LeftRight e2 = parseLeftRight(expected); + CHECK_EQUAL(e, e2) } -TEST( LineShape_BadParse, Enums ) +TEST(LineShape_BadParse, Enums) { - LineShape actual = parseLineShape( "straight" ); - LineShape expected = LineShape::straight; - CHECK_EQUAL( expected, actual ) + LineShape actual = parseLineShape("straight"); + LineShape expected = LineShape::straight; + CHECK_EQUAL(expected, actual) } -TEST( LineShape_straight, Enums ) +TEST(LineShape_straight, Enums) { - LineShape e = LineShape::straight; - std::string expected = "straight"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineShape e = LineShape::straight; + std::string expected = "straight"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineShape e2 = parseLineShape( expected ); - CHECK_EQUAL( e, e2 ) + LineShape e2 = parseLineShape(expected); + CHECK_EQUAL(e, e2) } -TEST( LineShape_curved, Enums ) +TEST(LineShape_curved, Enums) { - LineShape e = LineShape::curved; - std::string expected = "curved"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineShape e = LineShape::curved; + std::string expected = "curved"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineShape e2 = parseLineShape( expected ); - CHECK_EQUAL( e, e2 ) + LineShape e2 = parseLineShape(expected); + CHECK_EQUAL(e, e2) } -TEST( LineType_BadParse, Enums ) +TEST(LineType_BadParse, Enums) { - LineType actual = parseLineType( "solid" ); - LineType expected = LineType::solid; - CHECK_EQUAL( expected, actual ) + LineType actual = parseLineType("solid"); + LineType expected = LineType::solid; + CHECK_EQUAL(expected, actual) } -TEST( LineType_solid, Enums ) +TEST(LineType_solid, Enums) { - LineType e = LineType::solid; - std::string expected = "solid"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineType e = LineType::solid; + std::string expected = "solid"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineType e2 = parseLineType( expected ); - CHECK_EQUAL( e, e2 ) + LineType e2 = parseLineType(expected); + CHECK_EQUAL(e, e2) } -TEST( LineType_dashed, Enums ) +TEST(LineType_dashed, Enums) { - LineType e = LineType::dashed; - std::string expected = "dashed"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineType e = LineType::dashed; + std::string expected = "dashed"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineType e2 = parseLineType( expected ); - CHECK_EQUAL( e, e2 ) + LineType e2 = parseLineType(expected); + CHECK_EQUAL(e, e2) } -TEST( LineType_dotted, Enums ) +TEST(LineType_dotted, Enums) { - LineType e = LineType::dotted; - std::string expected = "dotted"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineType e = LineType::dotted; + std::string expected = "dotted"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineType e2 = parseLineType( expected ); - CHECK_EQUAL( e, e2 ) + LineType e2 = parseLineType(expected); + CHECK_EQUAL(e, e2) } -TEST( LineType_wavy, Enums ) +TEST(LineType_wavy, Enums) { - LineType e = LineType::wavy; - std::string expected = "wavy"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineType e = LineType::wavy; + std::string expected = "wavy"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineType e2 = parseLineType( expected ); - CHECK_EQUAL( e, e2 ) + LineType e2 = parseLineType(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_BadParse, Enums ) +TEST(Mute_BadParse, Enums) { - MuteEnum actual = parseMuteEnum( "on" ); - MuteEnum expected = MuteEnum::on; - CHECK_EQUAL( expected, actual ) + MuteEnum actual = parseMuteEnum("on"); + MuteEnum expected = MuteEnum::on; + CHECK_EQUAL(expected, actual) } -TEST( Mute_on, Enums ) +TEST(Mute_on, Enums) { - MuteEnum e = MuteEnum::on; - std::string expected = "on"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::on; + std::string expected = "on"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_off, Enums ) +TEST(Mute_off, Enums) { - MuteEnum e = MuteEnum::off; - std::string expected = "off"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::off; + std::string expected = "off"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_straight, Enums ) +TEST(Mute_straight, Enums) { - MuteEnum e = MuteEnum::straight; - std::string expected = "straight"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::straight; + std::string expected = "straight"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_cup, Enums ) +TEST(Mute_cup, Enums) { - MuteEnum e = MuteEnum::cup; - std::string expected = "cup"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::cup; + std::string expected = "cup"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_harmonNoStem, Enums ) +TEST(Mute_harmonNoStem, Enums) { - MuteEnum e = MuteEnum::harmonNoStem; - std::string expected = "harmon-no-stem"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::harmonNoStem; + std::string expected = "harmon-no-stem"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_harmonStem, Enums ) +TEST(Mute_harmonStem, Enums) { - MuteEnum e = MuteEnum::harmonStem; - std::string expected = "harmon-stem"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::harmonStem; + std::string expected = "harmon-stem"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_bucket, Enums ) +TEST(Mute_bucket, Enums) { - MuteEnum e = MuteEnum::bucket; - std::string expected = "bucket"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::bucket; + std::string expected = "bucket"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_plunger, Enums ) +TEST(Mute_plunger, Enums) { - MuteEnum e = MuteEnum::plunger; - std::string expected = "plunger"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::plunger; + std::string expected = "plunger"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_hat, Enums ) +TEST(Mute_hat, Enums) { - MuteEnum e = MuteEnum::hat; - std::string expected = "hat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::hat; + std::string expected = "hat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_solotone, Enums ) +TEST(Mute_solotone, Enums) { - MuteEnum e = MuteEnum::solotone; - std::string expected = "solotone"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::solotone; + std::string expected = "solotone"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_practice, Enums ) +TEST(Mute_practice, Enums) { - MuteEnum e = MuteEnum::practice; - std::string expected = "practice"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::practice; + std::string expected = "practice"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_stopMute, Enums ) +TEST(Mute_stopMute, Enums) { - MuteEnum e = MuteEnum::stopMute; - std::string expected = "stop-mute"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::stopMute; + std::string expected = "stop-mute"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_stopHand, Enums ) +TEST(Mute_stopHand, Enums) { - MuteEnum e = MuteEnum::stopHand; - std::string expected = "stop-hand"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::stopHand; + std::string expected = "stop-hand"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_echo, Enums ) +TEST(Mute_echo, Enums) { - MuteEnum e = MuteEnum::echo; - std::string expected = "echo"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::echo; + std::string expected = "echo"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Mute_palm, Enums ) +TEST(Mute_palm, Enums) { - MuteEnum e = MuteEnum::palm; - std::string expected = "palm"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MuteEnum e = MuteEnum::palm; + std::string expected = "palm"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MuteEnum e2 = parseMuteEnum( expected ); - CHECK_EQUAL( e, e2 ) + MuteEnum e2 = parseMuteEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( OverUnder_BadParse, Enums ) +TEST(OverUnder_BadParse, Enums) { - OverUnder actual = parseOverUnder( "over" ); - OverUnder expected = OverUnder::over; - CHECK_EQUAL( expected, actual ) + OverUnder actual = parseOverUnder("over"); + OverUnder expected = OverUnder::over; + CHECK_EQUAL(expected, actual) } -TEST( OverUnder_over, Enums ) +TEST(OverUnder_over, Enums) { - OverUnder e = OverUnder::over; - std::string expected = "over"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + OverUnder e = OverUnder::over; + std::string expected = "over"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - OverUnder e2 = parseOverUnder( expected ); - CHECK_EQUAL( e, e2 ) + OverUnder e2 = parseOverUnder(expected); + CHECK_EQUAL(e, e2) } -TEST( OverUnder_under, Enums ) +TEST(OverUnder_under, Enums) { - OverUnder e = OverUnder::under; - std::string expected = "under"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + OverUnder e = OverUnder::under; + std::string expected = "under"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - OverUnder e2 = parseOverUnder( expected ); - CHECK_EQUAL( e, e2 ) + OverUnder e2 = parseOverUnder(expected); + CHECK_EQUAL(e, e2) } -TEST( SemiPitchedEnum_BadParse, Enums ) +TEST(SemiPitchedEnum_BadParse, Enums) { - SemiPitchedEnum actual = parseSemiPitchedEnum( "high" ); - SemiPitchedEnum expected = SemiPitchedEnum::high; - CHECK_EQUAL( expected, actual ) + SemiPitchedEnum actual = parseSemiPitchedEnum("high"); + SemiPitchedEnum expected = SemiPitchedEnum::high; + CHECK_EQUAL(expected, actual) } -TEST( SemiPitchedEnum_high, Enums ) +TEST(SemiPitchedEnum_high, Enums) { - SemiPitchedEnum e = SemiPitchedEnum::high; - std::string expected = "high"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SemiPitchedEnum e = SemiPitchedEnum::high; + std::string expected = "high"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SemiPitchedEnum e2 = parseSemiPitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + SemiPitchedEnum e2 = parseSemiPitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( SemiPitchedEnum_mediumHigh, Enums ) +TEST(SemiPitchedEnum_mediumHigh, Enums) { - SemiPitchedEnum e = SemiPitchedEnum::mediumHigh; - std::string expected = "medium-high"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SemiPitchedEnum e = SemiPitchedEnum::mediumHigh; + std::string expected = "medium-high"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SemiPitchedEnum e2 = parseSemiPitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + SemiPitchedEnum e2 = parseSemiPitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( SemiPitchedEnum_medium, Enums ) +TEST(SemiPitchedEnum_medium, Enums) { - SemiPitchedEnum e = SemiPitchedEnum::medium; - std::string expected = "medium"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SemiPitchedEnum e = SemiPitchedEnum::medium; + std::string expected = "medium"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SemiPitchedEnum e2 = parseSemiPitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + SemiPitchedEnum e2 = parseSemiPitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( SemiPitchedEnum_mediumLow, Enums ) +TEST(SemiPitchedEnum_mediumLow, Enums) { - SemiPitchedEnum e = SemiPitchedEnum::mediumLow; - std::string expected = "medium-low"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SemiPitchedEnum e = SemiPitchedEnum::mediumLow; + std::string expected = "medium-low"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SemiPitchedEnum e2 = parseSemiPitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + SemiPitchedEnum e2 = parseSemiPitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( SemiPitchedEnum_low, Enums ) +TEST(SemiPitchedEnum_low, Enums) { - SemiPitchedEnum e = SemiPitchedEnum::low; - std::string expected = "low"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SemiPitchedEnum e = SemiPitchedEnum::low; + std::string expected = "low"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SemiPitchedEnum e2 = parseSemiPitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + SemiPitchedEnum e2 = parseSemiPitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( SemiPitchedEnum_veryLow, Enums ) +TEST(SemiPitchedEnum_veryLow, Enums) { - SemiPitchedEnum e = SemiPitchedEnum::veryLow; - std::string expected = "very-low"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SemiPitchedEnum e = SemiPitchedEnum::veryLow; + std::string expected = "very-low"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SemiPitchedEnum e2 = parseSemiPitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + SemiPitchedEnum e2 = parseSemiPitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StartNote_BadParse, Enums ) +TEST(StartNote_BadParse, Enums) { - StartNote actual = parseStartNote( "upper" ); - StartNote expected = StartNote::upper; - CHECK_EQUAL( expected, actual ) + StartNote actual = parseStartNote("upper"); + StartNote expected = StartNote::upper; + CHECK_EQUAL(expected, actual) } -TEST( StartNote_upper, Enums ) +TEST(StartNote_upper, Enums) { - StartNote e = StartNote::upper; - std::string expected = "upper"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartNote e = StartNote::upper; + std::string expected = "upper"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartNote e2 = parseStartNote( expected ); - CHECK_EQUAL( e, e2 ) + StartNote e2 = parseStartNote(expected); + CHECK_EQUAL(e, e2) } -TEST( StartNote_main, Enums ) +TEST(StartNote_main, Enums) { - StartNote e = StartNote::main; - std::string expected = "main"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartNote e = StartNote::main; + std::string expected = "main"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartNote e2 = parseStartNote( expected ); - CHECK_EQUAL( e, e2 ) + StartNote e2 = parseStartNote(expected); + CHECK_EQUAL(e, e2) } -TEST( StartNote_below, Enums ) +TEST(StartNote_below, Enums) { - StartNote e = StartNote::below; - std::string expected = "below"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartNote e = StartNote::below; + std::string expected = "below"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartNote e2 = parseStartNote( expected ); - CHECK_EQUAL( e, e2 ) + StartNote e2 = parseStartNote(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStop_BadParse, Enums ) +TEST(StartStop_BadParse, Enums) { - StartStop actual = parseStartStop( "start" ); - StartStop expected = StartStop::start; - CHECK_EQUAL( expected, actual ) + StartStop actual = parseStartStop("start"); + StartStop expected = StartStop::start; + CHECK_EQUAL(expected, actual) } -TEST( StartStop_start, Enums ) +TEST(StartStop_start, Enums) { - StartStop e = StartStop::start; - std::string expected = "start"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStop e = StartStop::start; + std::string expected = "start"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStop e2 = parseStartStop( expected ); - CHECK_EQUAL( e, e2 ) + StartStop e2 = parseStartStop(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStop_stop, Enums ) +TEST(StartStop_stop, Enums) { - StartStop e = StartStop::stop; - std::string expected = "stop"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStop e = StartStop::stop; + std::string expected = "stop"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStop e2 = parseStartStop( expected ); - CHECK_EQUAL( e, e2 ) + StartStop e2 = parseStartStop(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopContinue_BadParse, Enums ) +TEST(StartStopContinue_BadParse, Enums) { - StartStopContinue actual = parseStartStopContinue( "start" ); - StartStopContinue expected = StartStopContinue::start; - CHECK_EQUAL( expected, actual ) + StartStopContinue actual = parseStartStopContinue("start"); + StartStopContinue expected = StartStopContinue::start; + CHECK_EQUAL(expected, actual) } -TEST( StartStopContinue_start, Enums ) +TEST(StartStopContinue_start, Enums) { - StartStopContinue e = StartStopContinue::start; - std::string expected = "start"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopContinue e = StartStopContinue::start; + std::string expected = "start"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopContinue e2 = parseStartStopContinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopContinue e2 = parseStartStopContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopContinue_stop, Enums ) +TEST(StartStopContinue_stop, Enums) { - StartStopContinue e = StartStopContinue::stop; - std::string expected = "stop"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopContinue e = StartStopContinue::stop; + std::string expected = "stop"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopContinue e2 = parseStartStopContinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopContinue e2 = parseStartStopContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopContinue_continue_, Enums ) +TEST(StartStopContinue_continue_, Enums) { - StartStopContinue e = StartStopContinue::continue_; - std::string expected = "continue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopContinue e = StartStopContinue::continue_; + std::string expected = "continue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopContinue e2 = parseStartStopContinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopContinue e2 = parseStartStopContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopSingle_BadParse, Enums ) +TEST(StartStopSingle_BadParse, Enums) { - StartStopSingle actual = parseStartStopSingle( "start" ); - StartStopSingle expected = StartStopSingle::start; - CHECK_EQUAL( expected, actual ) + StartStopSingle actual = parseStartStopSingle("start"); + StartStopSingle expected = StartStopSingle::start; + CHECK_EQUAL(expected, actual) } -TEST( StartStopSingle_start, Enums ) +TEST(StartStopSingle_start, Enums) { - StartStopSingle e = StartStopSingle::start; - std::string expected = "start"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopSingle e = StartStopSingle::start; + std::string expected = "start"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopSingle e2 = parseStartStopSingle( expected ); - CHECK_EQUAL( e, e2 ) + StartStopSingle e2 = parseStartStopSingle(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopSingle_stop, Enums ) +TEST(StartStopSingle_stop, Enums) { - StartStopSingle e = StartStopSingle::stop; - std::string expected = "stop"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopSingle e = StartStopSingle::stop; + std::string expected = "stop"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopSingle e2 = parseStartStopSingle( expected ); - CHECK_EQUAL( e, e2 ) + StartStopSingle e2 = parseStartStopSingle(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopSingle_single, Enums ) +TEST(StartStopSingle_single, Enums) { - StartStopSingle e = StartStopSingle::single; - std::string expected = "single"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopSingle e = StartStopSingle::single; + std::string expected = "single"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopSingle e2 = parseStartStopSingle( expected ); - CHECK_EQUAL( e, e2 ) + StartStopSingle e2 = parseStartStopSingle(expected); + CHECK_EQUAL(e, e2) } -TEST( SymbolSize_BadParse, Enums ) +TEST(SymbolSize_BadParse, Enums) { - SymbolSize actual = parseSymbolSize( "full" ); - SymbolSize expected = SymbolSize::full; - CHECK_EQUAL( expected, actual ) + SymbolSize actual = parseSymbolSize("full"); + SymbolSize expected = SymbolSize::full; + CHECK_EQUAL(expected, actual) } -TEST( SymbolSize_full, Enums ) +TEST(SymbolSize_full, Enums) { - SymbolSize e = SymbolSize::full; - std::string expected = "full"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SymbolSize e = SymbolSize::full; + std::string expected = "full"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SymbolSize e2 = parseSymbolSize( expected ); - CHECK_EQUAL( e, e2 ) + SymbolSize e2 = parseSymbolSize(expected); + CHECK_EQUAL(e, e2) } -TEST( SymbolSize_cue, Enums ) +TEST(SymbolSize_cue, Enums) { - SymbolSize e = SymbolSize::cue; - std::string expected = "cue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SymbolSize e = SymbolSize::cue; + std::string expected = "cue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SymbolSize e2 = parseSymbolSize( expected ); - CHECK_EQUAL( e, e2 ) + SymbolSize e2 = parseSymbolSize(expected); + CHECK_EQUAL(e, e2) } -TEST( SymbolSize_large, Enums ) +TEST(SymbolSize_large, Enums) { - SymbolSize e = SymbolSize::large; - std::string expected = "large"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SymbolSize e = SymbolSize::large; + std::string expected = "large"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SymbolSize e2 = parseSymbolSize( expected ); - CHECK_EQUAL( e, e2 ) + SymbolSize e2 = parseSymbolSize(expected); + CHECK_EQUAL(e, e2) } -TEST( TextDirection_BadParse, Enums ) +TEST(TextDirection_BadParse, Enums) { - TextDirection actual = parseTextDirection( "ltr" ); - TextDirection expected = TextDirection::ltr; - CHECK_EQUAL( expected, actual ) + TextDirection actual = parseTextDirection("ltr"); + TextDirection expected = TextDirection::ltr; + CHECK_EQUAL(expected, actual) } -TEST( TextDirection_ltr, Enums ) +TEST(TextDirection_ltr, Enums) { - TextDirection e = TextDirection::ltr; - std::string expected = "ltr"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TextDirection e = TextDirection::ltr; + std::string expected = "ltr"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TextDirection e2 = parseTextDirection( expected ); - CHECK_EQUAL( e, e2 ) + TextDirection e2 = parseTextDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TextDirection_rtl, Enums ) +TEST(TextDirection_rtl, Enums) { - TextDirection e = TextDirection::rtl; - std::string expected = "rtl"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TextDirection e = TextDirection::rtl; + std::string expected = "rtl"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TextDirection e2 = parseTextDirection( expected ); - CHECK_EQUAL( e, e2 ) + TextDirection e2 = parseTextDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TextDirection_lro, Enums ) +TEST(TextDirection_lro, Enums) { - TextDirection e = TextDirection::lro; - std::string expected = "lro"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TextDirection e = TextDirection::lro; + std::string expected = "lro"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TextDirection e2 = parseTextDirection( expected ); - CHECK_EQUAL( e, e2 ) + TextDirection e2 = parseTextDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TextDirection_rlo, Enums ) +TEST(TextDirection_rlo, Enums) { - TextDirection e = TextDirection::rlo; - std::string expected = "rlo"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TextDirection e = TextDirection::rlo; + std::string expected = "rlo"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TextDirection e2 = parseTextDirection( expected ); - CHECK_EQUAL( e, e2 ) + TextDirection e2 = parseTextDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TopBottom_BadParse, Enums ) +TEST(TopBottom_BadParse, Enums) { - TopBottom actual = parseTopBottom( "top" ); - TopBottom expected = TopBottom::top; - CHECK_EQUAL( expected, actual ) + TopBottom actual = parseTopBottom("top"); + TopBottom expected = TopBottom::top; + CHECK_EQUAL(expected, actual) } -TEST( TopBottom_top, Enums ) +TEST(TopBottom_top, Enums) { - TopBottom e = TopBottom::top; - std::string expected = "top"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TopBottom e = TopBottom::top; + std::string expected = "top"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TopBottom e2 = parseTopBottom( expected ); - CHECK_EQUAL( e, e2 ) + TopBottom e2 = parseTopBottom(expected); + CHECK_EQUAL(e, e2) } -TEST( TopBottom_bottom, Enums ) +TEST(TopBottom_bottom, Enums) { - TopBottom e = TopBottom::bottom; - std::string expected = "bottom"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TopBottom e = TopBottom::bottom; + std::string expected = "bottom"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TopBottom e2 = parseTopBottom( expected ); - CHECK_EQUAL( e, e2 ) + TopBottom e2 = parseTopBottom(expected); + CHECK_EQUAL(e, e2) } -TEST( TrillStep_BadParse, Enums ) +TEST(TrillStep_BadParse, Enums) { - TrillStep actual = parseTrillStep( "whole" ); - TrillStep expected = TrillStep::whole; - CHECK_EQUAL( expected, actual ) + TrillStep actual = parseTrillStep("whole"); + TrillStep expected = TrillStep::whole; + CHECK_EQUAL(expected, actual) } -TEST( TrillStep_whole, Enums ) +TEST(TrillStep_whole, Enums) { - TrillStep e = TrillStep::whole; - std::string expected = "whole"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TrillStep e = TrillStep::whole; + std::string expected = "whole"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TrillStep e2 = parseTrillStep( expected ); - CHECK_EQUAL( e, e2 ) + TrillStep e2 = parseTrillStep(expected); + CHECK_EQUAL(e, e2) } -TEST( TrillStep_half, Enums ) +TEST(TrillStep_half, Enums) { - TrillStep e = TrillStep::half; - std::string expected = "half"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TrillStep e = TrillStep::half; + std::string expected = "half"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TrillStep e2 = parseTrillStep( expected ); - CHECK_EQUAL( e, e2 ) + TrillStep e2 = parseTrillStep(expected); + CHECK_EQUAL(e, e2) } -TEST( TrillStep_unison, Enums ) +TEST(TrillStep_unison, Enums) { - TrillStep e = TrillStep::unison; - std::string expected = "unison"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TrillStep e = TrillStep::unison; + std::string expected = "unison"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TrillStep e2 = parseTrillStep( expected ); - CHECK_EQUAL( e, e2 ) + TrillStep e2 = parseTrillStep(expected); + CHECK_EQUAL(e, e2) } -TEST( TwoNoteTurn_BadParse, Enums ) +TEST(TwoNoteTurn_BadParse, Enums) { - TwoNoteTurn actual = parseTwoNoteTurn( "whole" ); - TwoNoteTurn expected = TwoNoteTurn::whole; - CHECK_EQUAL( expected, actual ) + TwoNoteTurn actual = parseTwoNoteTurn("whole"); + TwoNoteTurn expected = TwoNoteTurn::whole; + CHECK_EQUAL(expected, actual) } -TEST( TwoNoteTurn_whole, Enums ) +TEST(TwoNoteTurn_whole, Enums) { - TwoNoteTurn e = TwoNoteTurn::whole; - std::string expected = "whole"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TwoNoteTurn e = TwoNoteTurn::whole; + std::string expected = "whole"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TwoNoteTurn e2 = parseTwoNoteTurn( expected ); - CHECK_EQUAL( e, e2 ) + TwoNoteTurn e2 = parseTwoNoteTurn(expected); + CHECK_EQUAL(e, e2) } -TEST( TwoNoteTurn_half, Enums ) +TEST(TwoNoteTurn_half, Enums) { - TwoNoteTurn e = TwoNoteTurn::half; - std::string expected = "half"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TwoNoteTurn e = TwoNoteTurn::half; + std::string expected = "half"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TwoNoteTurn e2 = parseTwoNoteTurn( expected ); - CHECK_EQUAL( e, e2 ) + TwoNoteTurn e2 = parseTwoNoteTurn(expected); + CHECK_EQUAL(e, e2) } -TEST( TwoNoteTurn_none, Enums ) +TEST(TwoNoteTurn_none, Enums) { - TwoNoteTurn e = TwoNoteTurn::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TwoNoteTurn e = TwoNoteTurn::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TwoNoteTurn e2 = parseTwoNoteTurn( expected ); - CHECK_EQUAL( e, e2 ) + TwoNoteTurn e2 = parseTwoNoteTurn(expected); + CHECK_EQUAL(e, e2) } -TEST( UpDown_BadParse, Enums ) +TEST(UpDown_BadParse, Enums) { - UpDown actual = parseUpDown( "up" ); - UpDown expected = UpDown::up; - CHECK_EQUAL( expected, actual ) + UpDown actual = parseUpDown("up"); + UpDown expected = UpDown::up; + CHECK_EQUAL(expected, actual) } -TEST( UpDown_up, Enums ) +TEST(UpDown_up, Enums) { - UpDown e = UpDown::up; - std::string expected = "up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + UpDown e = UpDown::up; + std::string expected = "up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - UpDown e2 = parseUpDown( expected ); - CHECK_EQUAL( e, e2 ) + UpDown e2 = parseUpDown(expected); + CHECK_EQUAL(e, e2) } -TEST( UpDown_down, Enums ) +TEST(UpDown_down, Enums) { - UpDown e = UpDown::down; - std::string expected = "down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + UpDown e = UpDown::down; + std::string expected = "down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - UpDown e2 = parseUpDown( expected ); - CHECK_EQUAL( e, e2 ) + UpDown e2 = parseUpDown(expected); + CHECK_EQUAL(e, e2) } -TEST( UprightInverted_BadParse, Enums ) +TEST(UprightInverted_BadParse, Enums) { - UprightInverted actual = parseUprightInverted( "upright" ); - UprightInverted expected = UprightInverted::upright; - CHECK_EQUAL( expected, actual ) + UprightInverted actual = parseUprightInverted("upright"); + UprightInverted expected = UprightInverted::upright; + CHECK_EQUAL(expected, actual) } -TEST( UprightInverted_upright, Enums ) +TEST(UprightInverted_upright, Enums) { - UprightInverted e = UprightInverted::upright; - std::string expected = "upright"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + UprightInverted e = UprightInverted::upright; + std::string expected = "upright"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - UprightInverted e2 = parseUprightInverted( expected ); - CHECK_EQUAL( e, e2 ) + UprightInverted e2 = parseUprightInverted(expected); + CHECK_EQUAL(e, e2) } -TEST( UprightInverted_inverted, Enums ) +TEST(UprightInverted_inverted, Enums) { - UprightInverted e = UprightInverted::inverted; - std::string expected = "inverted"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + UprightInverted e = UprightInverted::inverted; + std::string expected = "inverted"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - UprightInverted e2 = parseUprightInverted( expected ); - CHECK_EQUAL( e, e2 ) + UprightInverted e2 = parseUprightInverted(expected); + CHECK_EQUAL(e, e2) } -TEST( Valign_BadParse, Enums ) +TEST(Valign_BadParse, Enums) { - Valign actual = parseValign( "top" ); - Valign expected = Valign::top; - CHECK_EQUAL( expected, actual ) + Valign actual = parseValign("top"); + Valign expected = Valign::top; + CHECK_EQUAL(expected, actual) } -TEST( Valign_top, Enums ) +TEST(Valign_top, Enums) { - Valign e = Valign::top; - std::string expected = "top"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Valign e = Valign::top; + std::string expected = "top"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Valign e2 = parseValign( expected ); - CHECK_EQUAL( e, e2 ) + Valign e2 = parseValign(expected); + CHECK_EQUAL(e, e2) } -TEST( Valign_middle, Enums ) +TEST(Valign_middle, Enums) { - Valign e = Valign::middle; - std::string expected = "middle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Valign e = Valign::middle; + std::string expected = "middle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Valign e2 = parseValign( expected ); - CHECK_EQUAL( e, e2 ) + Valign e2 = parseValign(expected); + CHECK_EQUAL(e, e2) } -TEST( Valign_bottom, Enums ) +TEST(Valign_bottom, Enums) { - Valign e = Valign::bottom; - std::string expected = "bottom"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Valign e = Valign::bottom; + std::string expected = "bottom"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Valign e2 = parseValign( expected ); - CHECK_EQUAL( e, e2 ) + Valign e2 = parseValign(expected); + CHECK_EQUAL(e, e2) } -TEST( Valign_baseline, Enums ) +TEST(Valign_baseline, Enums) { - Valign e = Valign::baseline; - std::string expected = "baseline"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Valign e = Valign::baseline; + std::string expected = "baseline"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Valign e2 = parseValign( expected ); - CHECK_EQUAL( e, e2 ) + Valign e2 = parseValign(expected); + CHECK_EQUAL(e, e2) } -TEST( ValignImage_BadParse, Enums ) +TEST(ValignImage_BadParse, Enums) { - ValignImage actual = parseValignImage( "top" ); - ValignImage expected = ValignImage::top; - CHECK_EQUAL( expected, actual ) + ValignImage actual = parseValignImage("top"); + ValignImage expected = ValignImage::top; + CHECK_EQUAL(expected, actual) } -TEST( ValignImage_top, Enums ) +TEST(ValignImage_top, Enums) { - ValignImage e = ValignImage::top; - std::string expected = "top"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ValignImage e = ValignImage::top; + std::string expected = "top"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ValignImage e2 = parseValignImage( expected ); - CHECK_EQUAL( e, e2 ) + ValignImage e2 = parseValignImage(expected); + CHECK_EQUAL(e, e2) } -TEST( ValignImage_middle, Enums ) +TEST(ValignImage_middle, Enums) { - ValignImage e = ValignImage::middle; - std::string expected = "middle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ValignImage e = ValignImage::middle; + std::string expected = "middle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ValignImage e2 = parseValignImage( expected ); - CHECK_EQUAL( e, e2 ) + ValignImage e2 = parseValignImage(expected); + CHECK_EQUAL(e, e2) } -TEST( ValignImage_bottom, Enums ) +TEST(ValignImage_bottom, Enums) { - ValignImage e = ValignImage::bottom; - std::string expected = "bottom"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ValignImage e = ValignImage::bottom; + std::string expected = "bottom"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ValignImage e2 = parseValignImage( expected ); - CHECK_EQUAL( e, e2 ) + ValignImage e2 = parseValignImage(expected); + CHECK_EQUAL(e, e2) } -TEST( YesNo_BadParse, Enums ) +TEST(YesNo_BadParse, Enums) { - YesNo actual = parseYesNo( "yes" ); - YesNo expected = YesNo::yes; - CHECK_EQUAL( expected, actual ) + YesNo actual = parseYesNo("yes"); + YesNo expected = YesNo::yes; + CHECK_EQUAL(expected, actual) } -TEST( YesNo_yes, Enums ) +TEST(YesNo_yes, Enums) { - YesNo e = YesNo::yes; - std::string expected = "yes"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + YesNo e = YesNo::yes; + std::string expected = "yes"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - YesNo e2 = parseYesNo( expected ); - CHECK_EQUAL( e, e2 ) + YesNo e2 = parseYesNo(expected); + CHECK_EQUAL(e, e2) } -TEST( YesNo_no, Enums ) +TEST(YesNo_no, Enums) { - YesNo e = YesNo::no; - std::string expected = "no"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + YesNo e = YesNo::no; + std::string expected = "no"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - YesNo e2 = parseYesNo( expected ); - CHECK_EQUAL( e, e2 ) + YesNo e2 = parseYesNo(expected); + CHECK_EQUAL(e, e2) } -TEST( CancelLocation_BadParse, Enums ) +TEST(CancelLocation_BadParse, Enums) { - CancelLocation actual = parseCancelLocation( "left" ); - CancelLocation expected = CancelLocation::left; - CHECK_EQUAL( expected, actual ) + CancelLocation actual = parseCancelLocation("left"); + CancelLocation expected = CancelLocation::left; + CHECK_EQUAL(expected, actual) } -TEST( CancelLocation_left, Enums ) +TEST(CancelLocation_left, Enums) { - CancelLocation e = CancelLocation::left; - std::string expected = "left"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CancelLocation e = CancelLocation::left; + std::string expected = "left"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CancelLocation e2 = parseCancelLocation( expected ); - CHECK_EQUAL( e, e2 ) + CancelLocation e2 = parseCancelLocation(expected); + CHECK_EQUAL(e, e2) } -TEST( CancelLocation_right, Enums ) +TEST(CancelLocation_right, Enums) { - CancelLocation e = CancelLocation::right; - std::string expected = "right"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CancelLocation e = CancelLocation::right; + std::string expected = "right"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CancelLocation e2 = parseCancelLocation( expected ); - CHECK_EQUAL( e, e2 ) + CancelLocation e2 = parseCancelLocation(expected); + CHECK_EQUAL(e, e2) } -TEST( CancelLocation_beforeBarline, Enums ) +TEST(CancelLocation_beforeBarline, Enums) { - CancelLocation e = CancelLocation::beforeBarline; - std::string expected = "before-barline"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CancelLocation e = CancelLocation::beforeBarline; + std::string expected = "before-barline"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CancelLocation e2 = parseCancelLocation( expected ); - CHECK_EQUAL( e, e2 ) + CancelLocation e2 = parseCancelLocation(expected); + CHECK_EQUAL(e, e2) } -TEST( ClefSign_BadParse, Enums ) +TEST(ClefSign_BadParse, Enums) { - ClefSign actual = parseClefSign( "G" ); - ClefSign expected = ClefSign::g; - CHECK_EQUAL( expected, actual ) + ClefSign actual = parseClefSign("G"); + ClefSign expected = ClefSign::g; + CHECK_EQUAL(expected, actual) } -TEST( ClefSign_g, Enums ) +TEST(ClefSign_g, Enums) { - ClefSign e = ClefSign::g; - std::string expected = "G"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ClefSign e = ClefSign::g; + std::string expected = "G"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ClefSign e2 = parseClefSign( expected ); - CHECK_EQUAL( e, e2 ) + ClefSign e2 = parseClefSign(expected); + CHECK_EQUAL(e, e2) } -TEST( ClefSign_f, Enums ) +TEST(ClefSign_f, Enums) { - ClefSign e = ClefSign::f; - std::string expected = "F"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ClefSign e = ClefSign::f; + std::string expected = "F"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ClefSign e2 = parseClefSign( expected ); - CHECK_EQUAL( e, e2 ) + ClefSign e2 = parseClefSign(expected); + CHECK_EQUAL(e, e2) } -TEST( ClefSign_c, Enums ) +TEST(ClefSign_c, Enums) { - ClefSign e = ClefSign::c; - std::string expected = "C"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ClefSign e = ClefSign::c; + std::string expected = "C"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ClefSign e2 = parseClefSign( expected ); - CHECK_EQUAL( e, e2 ) + ClefSign e2 = parseClefSign(expected); + CHECK_EQUAL(e, e2) } -TEST( ClefSign_percussion, Enums ) +TEST(ClefSign_percussion, Enums) { - ClefSign e = ClefSign::percussion; - std::string expected = "percussion"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ClefSign e = ClefSign::percussion; + std::string expected = "percussion"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ClefSign e2 = parseClefSign( expected ); - CHECK_EQUAL( e, e2 ) + ClefSign e2 = parseClefSign(expected); + CHECK_EQUAL(e, e2) } -TEST( ClefSign_tab, Enums ) +TEST(ClefSign_tab, Enums) { - ClefSign e = ClefSign::tab; - std::string expected = "TAB"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ClefSign e = ClefSign::tab; + std::string expected = "TAB"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ClefSign e2 = parseClefSign( expected ); - CHECK_EQUAL( e, e2 ) + ClefSign e2 = parseClefSign(expected); + CHECK_EQUAL(e, e2) } -TEST( ClefSign_jianpu, Enums ) +TEST(ClefSign_jianpu, Enums) { - ClefSign e = ClefSign::jianpu; - std::string expected = "jianpu"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ClefSign e = ClefSign::jianpu; + std::string expected = "jianpu"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ClefSign e2 = parseClefSign( expected ); - CHECK_EQUAL( e, e2 ) + ClefSign e2 = parseClefSign(expected); + CHECK_EQUAL(e, e2) } -TEST( ClefSign_none, Enums ) +TEST(ClefSign_none, Enums) { - ClefSign e = ClefSign::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ClefSign e = ClefSign::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ClefSign e2 = parseClefSign( expected ); - CHECK_EQUAL( e, e2 ) + ClefSign e2 = parseClefSign(expected); + CHECK_EQUAL(e, e2) } -TEST( ShowFrets_BadParse, Enums ) +TEST(ShowFrets_BadParse, Enums) { - ShowFrets actual = parseShowFrets( "numbers" ); - ShowFrets expected = ShowFrets::numbers; - CHECK_EQUAL( expected, actual ) + ShowFrets actual = parseShowFrets("numbers"); + ShowFrets expected = ShowFrets::numbers; + CHECK_EQUAL(expected, actual) } -TEST( ShowFrets_numbers, Enums ) +TEST(ShowFrets_numbers, Enums) { - ShowFrets e = ShowFrets::numbers; - std::string expected = "numbers"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ShowFrets e = ShowFrets::numbers; + std::string expected = "numbers"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ShowFrets e2 = parseShowFrets( expected ); - CHECK_EQUAL( e, e2 ) + ShowFrets e2 = parseShowFrets(expected); + CHECK_EQUAL(e, e2) } -TEST( ShowFrets_letters, Enums ) +TEST(ShowFrets_letters, Enums) { - ShowFrets e = ShowFrets::letters; - std::string expected = "letters"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ShowFrets e = ShowFrets::letters; + std::string expected = "letters"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ShowFrets e2 = parseShowFrets( expected ); - CHECK_EQUAL( e, e2 ) + ShowFrets e2 = parseShowFrets(expected); + CHECK_EQUAL(e, e2) } -TEST( StaffType_BadParse, Enums ) +TEST(StaffType_BadParse, Enums) { - StaffTypeEnum actual = parseStaffTypeEnum ( "ossia" ); - StaffTypeEnum expected = StaffTypeEnum::ossia; - CHECK_EQUAL( expected, actual ) + StaffTypeEnum actual = parseStaffTypeEnum("ossia"); + StaffTypeEnum expected = StaffTypeEnum::ossia; + CHECK_EQUAL(expected, actual) } -TEST( StaffType_ossia, Enums ) +TEST(StaffType_ossia, Enums) { - StaffTypeEnum e = StaffTypeEnum::ossia; - std::string expected = "ossia"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StaffTypeEnum e = StaffTypeEnum::ossia; + std::string expected = "ossia"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StaffTypeEnum e2 = parseStaffTypeEnum ( expected ); - CHECK_EQUAL( e, e2 ) + StaffTypeEnum e2 = parseStaffTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StaffType_cue, Enums ) +TEST(StaffType_cue, Enums) { - StaffTypeEnum e = StaffTypeEnum::cue; - std::string expected = "cue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StaffTypeEnum e = StaffTypeEnum::cue; + std::string expected = "cue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StaffTypeEnum e2 = parseStaffTypeEnum ( expected ); - CHECK_EQUAL( e, e2 ) + StaffTypeEnum e2 = parseStaffTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StaffType_editorial, Enums ) +TEST(StaffType_editorial, Enums) { - StaffTypeEnum e = StaffTypeEnum::editorial; - std::string expected = "editorial"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StaffTypeEnum e = StaffTypeEnum::editorial; + std::string expected = "editorial"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StaffTypeEnum e2 = parseStaffTypeEnum ( expected ); - CHECK_EQUAL( e, e2 ) + StaffTypeEnum e2 = parseStaffTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StaffType_regular, Enums ) +TEST(StaffType_regular, Enums) { - StaffTypeEnum e = StaffTypeEnum::regular; - std::string expected = "regular"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StaffTypeEnum e = StaffTypeEnum::regular; + std::string expected = "regular"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StaffTypeEnum e2 = parseStaffTypeEnum ( expected ); - CHECK_EQUAL( e, e2 ) + StaffTypeEnum e2 = parseStaffTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StaffType_alternate, Enums ) +TEST(StaffType_alternate, Enums) { - StaffTypeEnum e = StaffTypeEnum::alternate; - std::string expected = "alternate"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StaffTypeEnum e = StaffTypeEnum::alternate; + std::string expected = "alternate"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StaffTypeEnum e2 = parseStaffTypeEnum ( expected ); - CHECK_EQUAL( e, e2 ) + StaffTypeEnum e2 = parseStaffTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeRelation_BadParse, Enums ) +TEST(TimeRelation_BadParse, Enums) { - TimeRelationEnum actual = parseTimeRelationEnum( "parentheses" ); - TimeRelationEnum expected = TimeRelationEnum::parentheses; - CHECK_EQUAL( expected, actual ) + TimeRelationEnum actual = parseTimeRelationEnum("parentheses"); + TimeRelationEnum expected = TimeRelationEnum::parentheses; + CHECK_EQUAL(expected, actual) } -TEST( TimeRelation_parentheses, Enums ) +TEST(TimeRelation_parentheses, Enums) { - TimeRelationEnum e = TimeRelationEnum::parentheses; - std::string expected = "parentheses"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeRelationEnum e = TimeRelationEnum::parentheses; + std::string expected = "parentheses"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeRelationEnum e2 = parseTimeRelationEnum( expected ); - CHECK_EQUAL( e, e2 ) + TimeRelationEnum e2 = parseTimeRelationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeRelation_bracket, Enums ) +TEST(TimeRelation_bracket, Enums) { - TimeRelationEnum e = TimeRelationEnum::bracket; - std::string expected = "bracket"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeRelationEnum e = TimeRelationEnum::bracket; + std::string expected = "bracket"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeRelationEnum e2 = parseTimeRelationEnum( expected ); - CHECK_EQUAL( e, e2 ) + TimeRelationEnum e2 = parseTimeRelationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeRelation_equals, Enums ) +TEST(TimeRelation_equals, Enums) { - TimeRelationEnum e = TimeRelationEnum::equals; - std::string expected = "equals"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeRelationEnum e = TimeRelationEnum::equals; + std::string expected = "equals"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeRelationEnum e2 = parseTimeRelationEnum( expected ); - CHECK_EQUAL( e, e2 ) + TimeRelationEnum e2 = parseTimeRelationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeRelation_slash, Enums ) +TEST(TimeRelation_slash, Enums) { - TimeRelationEnum e = TimeRelationEnum::slash; - std::string expected = "slash"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeRelationEnum e = TimeRelationEnum::slash; + std::string expected = "slash"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeRelationEnum e2 = parseTimeRelationEnum( expected ); - CHECK_EQUAL( e, e2 ) + TimeRelationEnum e2 = parseTimeRelationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeRelation_space, Enums ) +TEST(TimeRelation_space, Enums) { - TimeRelationEnum e = TimeRelationEnum::space; - std::string expected = "space"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeRelationEnum e = TimeRelationEnum::space; + std::string expected = "space"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeRelationEnum e2 = parseTimeRelationEnum( expected ); - CHECK_EQUAL( e, e2 ) + TimeRelationEnum e2 = parseTimeRelationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeRelation_hyphen, Enums ) +TEST(TimeRelation_hyphen, Enums) { - TimeRelationEnum e = TimeRelationEnum::hyphen; - std::string expected = "hyphen"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeRelationEnum e = TimeRelationEnum::hyphen; + std::string expected = "hyphen"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeRelationEnum e2 = parseTimeRelationEnum( expected ); - CHECK_EQUAL( e, e2 ) + TimeRelationEnum e2 = parseTimeRelationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSeparator_BadParse, Enums ) +TEST(TimeSeparator_BadParse, Enums) { - TimeSeparator actual = parseTimeSeparator( "none" ); - TimeSeparator expected = TimeSeparator::none; - CHECK_EQUAL( expected, actual ) + TimeSeparator actual = parseTimeSeparator("none"); + TimeSeparator expected = TimeSeparator::none; + CHECK_EQUAL(expected, actual) } -TEST( TimeSeparator_none, Enums ) +TEST(TimeSeparator_none, Enums) { - TimeSeparator e = TimeSeparator::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSeparator e = TimeSeparator::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSeparator e2 = parseTimeSeparator( expected ); - CHECK_EQUAL( e, e2 ) + TimeSeparator e2 = parseTimeSeparator(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSeparator_horizontal, Enums ) +TEST(TimeSeparator_horizontal, Enums) { - TimeSeparator e = TimeSeparator::horizontal; - std::string expected = "horizontal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSeparator e = TimeSeparator::horizontal; + std::string expected = "horizontal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSeparator e2 = parseTimeSeparator( expected ); - CHECK_EQUAL( e, e2 ) + TimeSeparator e2 = parseTimeSeparator(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSeparator_diagonal, Enums ) +TEST(TimeSeparator_diagonal, Enums) { - TimeSeparator e = TimeSeparator::diagonal; - std::string expected = "diagonal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSeparator e = TimeSeparator::diagonal; + std::string expected = "diagonal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSeparator e2 = parseTimeSeparator( expected ); - CHECK_EQUAL( e, e2 ) + TimeSeparator e2 = parseTimeSeparator(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSeparator_vertical, Enums ) +TEST(TimeSeparator_vertical, Enums) { - TimeSeparator e = TimeSeparator::vertical; - std::string expected = "vertical"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSeparator e = TimeSeparator::vertical; + std::string expected = "vertical"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSeparator e2 = parseTimeSeparator( expected ); - CHECK_EQUAL( e, e2 ) + TimeSeparator e2 = parseTimeSeparator(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSeparator_adjacent, Enums ) +TEST(TimeSeparator_adjacent, Enums) { - TimeSeparator e = TimeSeparator::adjacent; - std::string expected = "adjacent"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSeparator e = TimeSeparator::adjacent; + std::string expected = "adjacent"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSeparator e2 = parseTimeSeparator( expected ); - CHECK_EQUAL( e, e2 ) + TimeSeparator e2 = parseTimeSeparator(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSymbol_BadParse, Enums ) +TEST(TimeSymbol_BadParse, Enums) { - TimeSymbol actual = parseTimeSymbol( "common" ); - TimeSymbol expected = TimeSymbol::common; - CHECK_EQUAL( expected, actual ) + TimeSymbol actual = parseTimeSymbol("common"); + TimeSymbol expected = TimeSymbol::common; + CHECK_EQUAL(expected, actual) } -TEST( TimeSymbol_common, Enums ) +TEST(TimeSymbol_common, Enums) { - TimeSymbol e = TimeSymbol::common; - std::string expected = "common"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSymbol e = TimeSymbol::common; + std::string expected = "common"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSymbol e2 = parseTimeSymbol( expected ); - CHECK_EQUAL( e, e2 ) + TimeSymbol e2 = parseTimeSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSymbol_cut, Enums ) +TEST(TimeSymbol_cut, Enums) { - TimeSymbol e = TimeSymbol::cut; - std::string expected = "cut"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSymbol e = TimeSymbol::cut; + std::string expected = "cut"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSymbol e2 = parseTimeSymbol( expected ); - CHECK_EQUAL( e, e2 ) + TimeSymbol e2 = parseTimeSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSymbol_singleNumber, Enums ) +TEST(TimeSymbol_singleNumber, Enums) { - TimeSymbol e = TimeSymbol::singleNumber; - std::string expected = "single-number"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSymbol e = TimeSymbol::singleNumber; + std::string expected = "single-number"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSymbol e2 = parseTimeSymbol( expected ); - CHECK_EQUAL( e, e2 ) + TimeSymbol e2 = parseTimeSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSymbol_note, Enums ) +TEST(TimeSymbol_note, Enums) { - TimeSymbol e = TimeSymbol::note; - std::string expected = "note"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSymbol e = TimeSymbol::note; + std::string expected = "note"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSymbol e2 = parseTimeSymbol( expected ); - CHECK_EQUAL( e, e2 ) + TimeSymbol e2 = parseTimeSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSymbol_dottedNote, Enums ) +TEST(TimeSymbol_dottedNote, Enums) { - TimeSymbol e = TimeSymbol::dottedNote; - std::string expected = "dotted-note"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSymbol e = TimeSymbol::dottedNote; + std::string expected = "dotted-note"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSymbol e2 = parseTimeSymbol( expected ); - CHECK_EQUAL( e, e2 ) + TimeSymbol e2 = parseTimeSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( TimeSymbol_normal, Enums ) +TEST(TimeSymbol_normal, Enums) { - TimeSymbol e = TimeSymbol::normal; - std::string expected = "normal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TimeSymbol e = TimeSymbol::normal; + std::string expected = "normal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TimeSymbol e2 = parseTimeSymbol( expected ); - CHECK_EQUAL( e, e2 ) + TimeSymbol e2 = parseTimeSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( BackwardForward_BadParse, Enums ) +TEST(BackwardForward_BadParse, Enums) { - BackwardForward actual = parseBackwardForward( "backward" ); - BackwardForward expected = BackwardForward::backward; - CHECK_EQUAL( expected, actual ) + BackwardForward actual = parseBackwardForward("backward"); + BackwardForward expected = BackwardForward::backward; + CHECK_EQUAL(expected, actual) } -TEST( BackwardForward_backward, Enums ) +TEST(BackwardForward_backward, Enums) { - BackwardForward e = BackwardForward::backward; - std::string expected = "backward"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BackwardForward e = BackwardForward::backward; + std::string expected = "backward"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BackwardForward e2 = parseBackwardForward( expected ); - CHECK_EQUAL( e, e2 ) + BackwardForward e2 = parseBackwardForward(expected); + CHECK_EQUAL(e, e2) } -TEST( BackwardForward_forward, Enums ) +TEST(BackwardForward_forward, Enums) { - BackwardForward e = BackwardForward::forward; - std::string expected = "forward"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BackwardForward e = BackwardForward::forward; + std::string expected = "forward"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BackwardForward e2 = parseBackwardForward( expected ); - CHECK_EQUAL( e, e2 ) + BackwardForward e2 = parseBackwardForward(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_BadParse, Enums ) +TEST(BarStyleEnum_BadParse, Enums) { - BarStyleEnum actual = parseBarStyleEnum( "regular" ); - BarStyleEnum expected = BarStyleEnum::regular; - CHECK_EQUAL( expected, actual ) + BarStyleEnum actual = parseBarStyleEnum("regular"); + BarStyleEnum expected = BarStyleEnum::regular; + CHECK_EQUAL(expected, actual) } -TEST( BarStyleEnum_regular, Enums ) +TEST(BarStyleEnum_regular, Enums) { - BarStyleEnum e = BarStyleEnum::regular; - std::string expected = "regular"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::regular; + std::string expected = "regular"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_dotted, Enums ) +TEST(BarStyleEnum_dotted, Enums) { - BarStyleEnum e = BarStyleEnum::dotted; - std::string expected = "dotted"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::dotted; + std::string expected = "dotted"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_dashed, Enums ) +TEST(BarStyleEnum_dashed, Enums) { - BarStyleEnum e = BarStyleEnum::dashed; - std::string expected = "dashed"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::dashed; + std::string expected = "dashed"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_heavy, Enums ) +TEST(BarStyleEnum_heavy, Enums) { - BarStyleEnum e = BarStyleEnum::heavy; - std::string expected = "heavy"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::heavy; + std::string expected = "heavy"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_lightLight, Enums ) +TEST(BarStyleEnum_lightLight, Enums) { - BarStyleEnum e = BarStyleEnum::lightLight; - std::string expected = "light-light"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::lightLight; + std::string expected = "light-light"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_lightHeavy, Enums ) +TEST(BarStyleEnum_lightHeavy, Enums) { - BarStyleEnum e = BarStyleEnum::lightHeavy; - std::string expected = "light-heavy"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::lightHeavy; + std::string expected = "light-heavy"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_heavyLight, Enums ) +TEST(BarStyleEnum_heavyLight, Enums) { - BarStyleEnum e = BarStyleEnum::heavyLight; - std::string expected = "heavy-light"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::heavyLight; + std::string expected = "heavy-light"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_heavyHeavy, Enums ) +TEST(BarStyleEnum_heavyHeavy, Enums) { - BarStyleEnum e = BarStyleEnum::heavyHeavy; - std::string expected = "heavy-heavy"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::heavyHeavy; + std::string expected = "heavy-heavy"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_tick, Enums ) +TEST(BarStyleEnum_tick, Enums) { - BarStyleEnum e = BarStyleEnum::tick; - std::string expected = "tick"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::tick; + std::string expected = "tick"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_short_, Enums ) +TEST(BarStyleEnum_short_, Enums) { - BarStyleEnum e = BarStyleEnum::short_; - std::string expected = "short"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::short_; + std::string expected = "short"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BarStyleEnum_none, Enums ) +TEST(BarStyleEnum_none, Enums) { - BarStyleEnum e = BarStyleEnum::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BarStyleEnum e = BarStyleEnum::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BarStyleEnum e2 = parseBarStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + BarStyleEnum e2 = parseBarStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( RightLeftMiddle_BadParse, Enums ) +TEST(RightLeftMiddle_BadParse, Enums) { - RightLeftMiddle actual = parseRightLeftMiddle( "right" ); - RightLeftMiddle expected = RightLeftMiddle::right; - CHECK_EQUAL( expected, actual ) + RightLeftMiddle actual = parseRightLeftMiddle("right"); + RightLeftMiddle expected = RightLeftMiddle::right; + CHECK_EQUAL(expected, actual) } -TEST( RightLeftMiddle_right, Enums ) +TEST(RightLeftMiddle_right, Enums) { - RightLeftMiddle e = RightLeftMiddle::right; - std::string expected = "right"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + RightLeftMiddle e = RightLeftMiddle::right; + std::string expected = "right"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - RightLeftMiddle e2 = parseRightLeftMiddle( expected ); - CHECK_EQUAL( e, e2 ) + RightLeftMiddle e2 = parseRightLeftMiddle(expected); + CHECK_EQUAL(e, e2) } -TEST( RightLeftMiddle_left, Enums ) +TEST(RightLeftMiddle_left, Enums) { - RightLeftMiddle e = RightLeftMiddle::left; - std::string expected = "left"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + RightLeftMiddle e = RightLeftMiddle::left; + std::string expected = "left"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - RightLeftMiddle e2 = parseRightLeftMiddle( expected ); - CHECK_EQUAL( e, e2 ) + RightLeftMiddle e2 = parseRightLeftMiddle(expected); + CHECK_EQUAL(e, e2) } -TEST( RightLeftMiddle_middle, Enums ) +TEST(RightLeftMiddle_middle, Enums) { - RightLeftMiddle e = RightLeftMiddle::middle; - std::string expected = "middle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + RightLeftMiddle e = RightLeftMiddle::middle; + std::string expected = "middle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - RightLeftMiddle e2 = parseRightLeftMiddle( expected ); - CHECK_EQUAL( e, e2 ) + RightLeftMiddle e2 = parseRightLeftMiddle(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopDiscontinue_BadParse, Enums ) +TEST(StartStopDiscontinue_BadParse, Enums) { - StartStopDiscontinue actual = parseStartStopDiscontinue( "start" ); - StartStopDiscontinue expected = StartStopDiscontinue::start; - CHECK_EQUAL( expected, actual ) + StartStopDiscontinue actual = parseStartStopDiscontinue("start"); + StartStopDiscontinue expected = StartStopDiscontinue::start; + CHECK_EQUAL(expected, actual) } -TEST( StartStopDiscontinue_start, Enums ) +TEST(StartStopDiscontinue_start, Enums) { - StartStopDiscontinue e = StartStopDiscontinue::start; - std::string expected = "start"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopDiscontinue e = StartStopDiscontinue::start; + std::string expected = "start"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopDiscontinue e2 = parseStartStopDiscontinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopDiscontinue e2 = parseStartStopDiscontinue(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopDiscontinue_stop, Enums ) +TEST(StartStopDiscontinue_stop, Enums) { - StartStopDiscontinue e = StartStopDiscontinue::stop; - std::string expected = "stop"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopDiscontinue e = StartStopDiscontinue::stop; + std::string expected = "stop"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopDiscontinue e2 = parseStartStopDiscontinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopDiscontinue e2 = parseStartStopDiscontinue(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopDiscontinue_discontinue, Enums ) +TEST(StartStopDiscontinue_discontinue, Enums) { - StartStopDiscontinue e = StartStopDiscontinue::discontinue; - std::string expected = "discontinue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopDiscontinue e = StartStopDiscontinue::discontinue; + std::string expected = "discontinue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopDiscontinue e2 = parseStartStopDiscontinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopDiscontinue e2 = parseStartStopDiscontinue(expected); + CHECK_EQUAL(e, e2) } -TEST( Winged_BadParse, Enums ) +TEST(Winged_BadParse, Enums) { - Winged actual = parseWinged( "none" ); - Winged expected = Winged::none; - CHECK_EQUAL( expected, actual ) + Winged actual = parseWinged("none"); + Winged expected = Winged::none; + CHECK_EQUAL(expected, actual) } -TEST( Winged_none, Enums ) +TEST(Winged_none, Enums) { - Winged e = Winged::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Winged e = Winged::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Winged e2 = parseWinged( expected ); - CHECK_EQUAL( e, e2 ) + Winged e2 = parseWinged(expected); + CHECK_EQUAL(e, e2) } -TEST( Winged_straight, Enums ) +TEST(Winged_straight, Enums) { - Winged e = Winged::straight; - std::string expected = "straight"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Winged e = Winged::straight; + std::string expected = "straight"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Winged e2 = parseWinged( expected ); - CHECK_EQUAL( e, e2 ) + Winged e2 = parseWinged(expected); + CHECK_EQUAL(e, e2) } -TEST( Winged_curved, Enums ) +TEST(Winged_curved, Enums) { - Winged e = Winged::curved; - std::string expected = "curved"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Winged e = Winged::curved; + std::string expected = "curved"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Winged e2 = parseWinged( expected ); - CHECK_EQUAL( e, e2 ) + Winged e2 = parseWinged(expected); + CHECK_EQUAL(e, e2) } -TEST( Winged_doubleStraight, Enums ) +TEST(Winged_doubleStraight, Enums) { - Winged e = Winged::doubleStraight; - std::string expected = "double-straight"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Winged e = Winged::doubleStraight; + std::string expected = "double-straight"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Winged e2 = parseWinged( expected ); - CHECK_EQUAL( e, e2 ) + Winged e2 = parseWinged(expected); + CHECK_EQUAL(e, e2) } -TEST( Winged_doubleCurved, Enums ) +TEST(Winged_doubleCurved, Enums) { - Winged e = Winged::doubleCurved; - std::string expected = "double-curved"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Winged e = Winged::doubleCurved; + std::string expected = "double-curved"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Winged e2 = parseWinged( expected ); - CHECK_EQUAL( e, e2 ) + Winged e2 = parseWinged(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_BadParse, Enums ) +TEST(BeaterValue_BadParse, Enums) { - BeaterValue actual = parseBeaterValue( "bow" ); - BeaterValue expected = BeaterValue::bow; - CHECK_EQUAL( expected, actual ) + BeaterValue actual = parseBeaterValue("bow"); + BeaterValue expected = BeaterValue::bow; + CHECK_EQUAL(expected, actual) } -TEST( BeaterValue_bow, Enums ) +TEST(BeaterValue_bow, Enums) { - BeaterValue e = BeaterValue::bow; - std::string expected = "bow"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::bow; + std::string expected = "bow"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_chimeHammer, Enums ) +TEST(BeaterValue_chimeHammer, Enums) { - BeaterValue e = BeaterValue::chimeHammer; - std::string expected = "chime hammer"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::chimeHammer; + std::string expected = "chime hammer"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_coin, Enums ) +TEST(BeaterValue_coin, Enums) { - BeaterValue e = BeaterValue::coin; - std::string expected = "coin"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::coin; + std::string expected = "coin"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_finger, Enums ) +TEST(BeaterValue_finger, Enums) { - BeaterValue e = BeaterValue::finger; - std::string expected = "finger"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::finger; + std::string expected = "finger"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_fingernail, Enums ) +TEST(BeaterValue_fingernail, Enums) { - BeaterValue e = BeaterValue::fingernail; - std::string expected = "fingernail"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::fingernail; + std::string expected = "fingernail"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_fist, Enums ) +TEST(BeaterValue_fist, Enums) { - BeaterValue e = BeaterValue::fist; - std::string expected = "fist"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::fist; + std::string expected = "fist"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_guiroScraper, Enums ) +TEST(BeaterValue_guiroScraper, Enums) { - BeaterValue e = BeaterValue::guiroScraper; - std::string expected = "guiro scraper"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::guiroScraper; + std::string expected = "guiro scraper"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_hammer, Enums ) +TEST(BeaterValue_hammer, Enums) { - BeaterValue e = BeaterValue::hammer; - std::string expected = "hammer"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::hammer; + std::string expected = "hammer"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_hand, Enums ) +TEST(BeaterValue_hand, Enums) { - BeaterValue e = BeaterValue::hand; - std::string expected = "hand"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::hand; + std::string expected = "hand"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_jazzStick, Enums ) +TEST(BeaterValue_jazzStick, Enums) { - BeaterValue e = BeaterValue::jazzStick; - std::string expected = "jazz stick"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::jazzStick; + std::string expected = "jazz stick"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_knittingNeedle, Enums ) +TEST(BeaterValue_knittingNeedle, Enums) { - BeaterValue e = BeaterValue::knittingNeedle; - std::string expected = "knitting needle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::knittingNeedle; + std::string expected = "knitting needle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_metalHammer, Enums ) +TEST(BeaterValue_metalHammer, Enums) { - BeaterValue e = BeaterValue::metalHammer; - std::string expected = "metal hammer"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::metalHammer; + std::string expected = "metal hammer"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_snareStick, Enums ) +TEST(BeaterValue_snareStick, Enums) { - BeaterValue e = BeaterValue::snareStick; - std::string expected = "snare stick"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::snareStick; + std::string expected = "snare stick"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_spoonMallet, Enums ) +TEST(BeaterValue_spoonMallet, Enums) { - BeaterValue e = BeaterValue::spoonMallet; - std::string expected = "spoon mallet"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::spoonMallet; + std::string expected = "spoon mallet"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_triangleBeater, Enums ) +TEST(BeaterValue_triangleBeater, Enums) { - BeaterValue e = BeaterValue::triangleBeater; - std::string expected = "triangle beater"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::triangleBeater; + std::string expected = "triangle beater"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_triangleBeaterPlain, Enums ) +TEST(BeaterValue_triangleBeaterPlain, Enums) { - BeaterValue e = BeaterValue::triangleBeaterPlain; - std::string expected = "triangle beater plain"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::triangleBeaterPlain; + std::string expected = "triangle beater plain"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeaterValue_wireBrush, Enums ) +TEST(BeaterValue_wireBrush, Enums) { - BeaterValue e = BeaterValue::wireBrush; - std::string expected = "wire brush"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeaterValue e = BeaterValue::wireBrush; + std::string expected = "wire brush"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeaterValue e2 = parseBeaterValue( expected ); - CHECK_EQUAL( e, e2 ) + BeaterValue e2 = parseBeaterValue(expected); + CHECK_EQUAL(e, e2) } -TEST( DegreeSymbolValue_BadParse, Enums ) +TEST(DegreeSymbolValue_BadParse, Enums) { - DegreeSymbolValue actual = parseDegreeSymbolValue( "major" ); - DegreeSymbolValue expected = DegreeSymbolValue::major; - CHECK_EQUAL( expected, actual ) + DegreeSymbolValue actual = parseDegreeSymbolValue("major"); + DegreeSymbolValue expected = DegreeSymbolValue::major; + CHECK_EQUAL(expected, actual) } -TEST( DegreeSymbolValue_major, Enums ) +TEST(DegreeSymbolValue_major, Enums) { - DegreeSymbolValue e = DegreeSymbolValue::major; - std::string expected = "major"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + DegreeSymbolValue e = DegreeSymbolValue::major; + std::string expected = "major"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - DegreeSymbolValue e2 = parseDegreeSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) + DegreeSymbolValue e2 = parseDegreeSymbolValue(expected); + CHECK_EQUAL(e, e2) } -TEST( DegreeSymbolValue_minor, Enums ) +TEST(DegreeSymbolValue_minor, Enums) { - DegreeSymbolValue e = DegreeSymbolValue::minor; - std::string expected = "minor"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + DegreeSymbolValue e = DegreeSymbolValue::minor; + std::string expected = "minor"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - DegreeSymbolValue e2 = parseDegreeSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) + DegreeSymbolValue e2 = parseDegreeSymbolValue(expected); + CHECK_EQUAL(e, e2) } -TEST( DegreeSymbolValue_augmented, Enums ) +TEST(DegreeSymbolValue_augmented, Enums) { - DegreeSymbolValue e = DegreeSymbolValue::augmented; - std::string expected = "augmented"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + DegreeSymbolValue e = DegreeSymbolValue::augmented; + std::string expected = "augmented"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - DegreeSymbolValue e2 = parseDegreeSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) + DegreeSymbolValue e2 = parseDegreeSymbolValue(expected); + CHECK_EQUAL(e, e2) } -TEST( DegreeSymbolValue_diminished, Enums ) +TEST(DegreeSymbolValue_diminished, Enums) { - DegreeSymbolValue e = DegreeSymbolValue::diminished; - std::string expected = "diminished"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + DegreeSymbolValue e = DegreeSymbolValue::diminished; + std::string expected = "diminished"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - DegreeSymbolValue e2 = parseDegreeSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) + DegreeSymbolValue e2 = parseDegreeSymbolValue(expected); + CHECK_EQUAL(e, e2) } -TEST( DegreeSymbolValue_halfDiminished, Enums ) +TEST(DegreeSymbolValue_halfDiminished, Enums) { - DegreeSymbolValue e = DegreeSymbolValue::halfDiminished; - std::string expected = "half-diminished"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + DegreeSymbolValue e = DegreeSymbolValue::halfDiminished; + std::string expected = "half-diminished"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - DegreeSymbolValue e2 = parseDegreeSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) + DegreeSymbolValue e2 = parseDegreeSymbolValue(expected); + CHECK_EQUAL(e, e2) } -TEST( DegreeTypeValue_BadParse, Enums ) +TEST(DegreeTypeValue_BadParse, Enums) { - DegreeTypeValue actual = parseDegreeTypeValue( "add" ); - DegreeTypeValue expected = DegreeTypeValue::add; - CHECK_EQUAL( expected, actual ) + DegreeTypeValue actual = parseDegreeTypeValue("add"); + DegreeTypeValue expected = DegreeTypeValue::add; + CHECK_EQUAL(expected, actual) } -TEST( DegreeTypeValue_add, Enums ) +TEST(DegreeTypeValue_add, Enums) { - DegreeTypeValue e = DegreeTypeValue::add; - std::string expected = "add"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + DegreeTypeValue e = DegreeTypeValue::add; + std::string expected = "add"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - DegreeTypeValue e2 = parseDegreeTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + DegreeTypeValue e2 = parseDegreeTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( DegreeTypeValue_alter, Enums ) +TEST(DegreeTypeValue_alter, Enums) { - DegreeTypeValue e = DegreeTypeValue::alter; - std::string expected = "alter"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + DegreeTypeValue e = DegreeTypeValue::alter; + std::string expected = "alter"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - DegreeTypeValue e2 = parseDegreeTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + DegreeTypeValue e2 = parseDegreeTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( DegreeTypeValue_subtract, Enums ) +TEST(DegreeTypeValue_subtract, Enums) { - DegreeTypeValue e = DegreeTypeValue::subtract; - std::string expected = "subtract"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + DegreeTypeValue e = DegreeTypeValue::subtract; + std::string expected = "subtract"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - DegreeTypeValue e2 = parseDegreeTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + DegreeTypeValue e2 = parseDegreeTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_BadParse, Enums ) +TEST(Effect_BadParse, Enums) { - EffectEnum actual = parseEffectEnum( "anvil" ); - EffectEnum expected = EffectEnum::anvil; - CHECK_EQUAL( expected, actual ) + EffectEnum actual = parseEffectEnum("anvil"); + EffectEnum expected = EffectEnum::anvil; + CHECK_EQUAL(expected, actual) } -TEST( Effect_anvil, Enums ) +TEST(Effect_anvil, Enums) { - EffectEnum e = EffectEnum::anvil; - std::string expected = "anvil"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::anvil; + std::string expected = "anvil"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_autoHorn, Enums ) +TEST(Effect_autoHorn, Enums) { - EffectEnum e = EffectEnum::autoHorn; - std::string expected = "auto horn"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::autoHorn; + std::string expected = "auto horn"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_birdWhistle, Enums ) +TEST(Effect_birdWhistle, Enums) { - EffectEnum e = EffectEnum::birdWhistle; - std::string expected = "bird whistle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::birdWhistle; + std::string expected = "bird whistle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_cannon, Enums ) +TEST(Effect_cannon, Enums) { - EffectEnum e = EffectEnum::cannon; - std::string expected = "cannon"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::cannon; + std::string expected = "cannon"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_duckCall, Enums ) +TEST(Effect_duckCall, Enums) { - EffectEnum e = EffectEnum::duckCall; - std::string expected = "duck call"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::duckCall; + std::string expected = "duck call"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_gunShot, Enums ) +TEST(Effect_gunShot, Enums) { - EffectEnum e = EffectEnum::gunShot; - std::string expected = "gun shot"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::gunShot; + std::string expected = "gun shot"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_klaxonHorn, Enums ) +TEST(Effect_klaxonHorn, Enums) { - EffectEnum e = EffectEnum::klaxonHorn; - std::string expected = "klaxon horn"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::klaxonHorn; + std::string expected = "klaxon horn"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_lionsRoar, Enums ) +TEST(Effect_lionsRoar, Enums) { - EffectEnum e = EffectEnum::lionsRoar; - std::string expected = "lions roar"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::lionsRoar; + std::string expected = "lions roar"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_policeWhistle, Enums ) +TEST(Effect_policeWhistle, Enums) { - EffectEnum e = EffectEnum::policeWhistle; - std::string expected = "police whistle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::policeWhistle; + std::string expected = "police whistle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_siren, Enums ) +TEST(Effect_siren, Enums) { - EffectEnum e = EffectEnum::siren; - std::string expected = "siren"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::siren; + std::string expected = "siren"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_slideWhistle, Enums ) +TEST(Effect_slideWhistle, Enums) { - EffectEnum e = EffectEnum::slideWhistle; - std::string expected = "slide whistle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::slideWhistle; + std::string expected = "slide whistle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_thunderSheet, Enums ) +TEST(Effect_thunderSheet, Enums) { - EffectEnum e = EffectEnum::thunderSheet; - std::string expected = "thunder sheet"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::thunderSheet; + std::string expected = "thunder sheet"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_windMachine, Enums ) +TEST(Effect_windMachine, Enums) { - EffectEnum e = EffectEnum::windMachine; - std::string expected = "wind machine"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::windMachine; + std::string expected = "wind machine"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Effect_windWhistle, Enums ) +TEST(Effect_windWhistle, Enums) { - EffectEnum e = EffectEnum::windWhistle; - std::string expected = "wind whistle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + EffectEnum e = EffectEnum::windWhistle; + std::string expected = "wind whistle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - EffectEnum e2 = parseEffectEnum( expected ); - CHECK_EQUAL( e, e2 ) + EffectEnum e2 = parseEffectEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Glass_BadParse, Enums ) +TEST(Glass_BadParse, Enums) { - GlassEnum actual = parseGlassEnum( "wind chimes" ); - GlassEnum expected = GlassEnum::windChimes; - CHECK_EQUAL( expected, actual ) + GlassEnum actual = parseGlassEnum("wind chimes"); + GlassEnum expected = GlassEnum::windChimes; + CHECK_EQUAL(expected, actual) } -TEST( Glass_windChimes, Enums ) +TEST(Glass_windChimes, Enums) { - GlassEnum e = GlassEnum::windChimes; - std::string expected = "wind chimes"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + GlassEnum e = GlassEnum::windChimes; + std::string expected = "wind chimes"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - GlassEnum e2 = parseGlassEnum( expected ); - CHECK_EQUAL( e, e2 ) + GlassEnum e2 = parseGlassEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( HarmonyType_BadParse, Enums ) +TEST(HarmonyType_BadParse, Enums) { - HarmonyType actual = parseHarmonyType( "explicit" ); - HarmonyType expected = HarmonyType::explicit_; - CHECK_EQUAL( expected, actual ) + HarmonyType actual = parseHarmonyType("explicit"); + HarmonyType expected = HarmonyType::explicit_; + CHECK_EQUAL(expected, actual) } -TEST( HarmonyType_explicit_, Enums ) +TEST(HarmonyType_explicit_, Enums) { - HarmonyType e = HarmonyType::explicit_; - std::string expected = "explicit"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HarmonyType e = HarmonyType::explicit_; + std::string expected = "explicit"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HarmonyType e2 = parseHarmonyType( expected ); - CHECK_EQUAL( e, e2 ) + HarmonyType e2 = parseHarmonyType(expected); + CHECK_EQUAL(e, e2) } -TEST( HarmonyType_implied, Enums ) +TEST(HarmonyType_implied, Enums) { - HarmonyType e = HarmonyType::implied; - std::string expected = "implied"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HarmonyType e = HarmonyType::implied; + std::string expected = "implied"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HarmonyType e2 = parseHarmonyType( expected ); - CHECK_EQUAL( e, e2 ) + HarmonyType e2 = parseHarmonyType(expected); + CHECK_EQUAL(e, e2) } -TEST( HarmonyType_alternate, Enums ) +TEST(HarmonyType_alternate, Enums) { - HarmonyType e = HarmonyType::alternate; - std::string expected = "alternate"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HarmonyType e = HarmonyType::alternate; + std::string expected = "alternate"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HarmonyType e2 = parseHarmonyType( expected ); - CHECK_EQUAL( e, e2 ) + HarmonyType e2 = parseHarmonyType(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_BadParse, Enums ) +TEST(KindValue_BadParse, Enums) { - KindValue actual = parseKindValue( "major" ); - KindValue expected = KindValue::major; - CHECK_EQUAL( expected, actual ) + KindValue actual = parseKindValue("major"); + KindValue expected = KindValue::major; + CHECK_EQUAL(expected, actual) } -TEST( KindValue_major, Enums ) +TEST(KindValue_major, Enums) { - KindValue e = KindValue::major; - std::string expected = "major"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::major; + std::string expected = "major"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_minor, Enums ) +TEST(KindValue_minor, Enums) { - KindValue e = KindValue::minor; - std::string expected = "minor"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::minor; + std::string expected = "minor"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_augmented, Enums ) +TEST(KindValue_augmented, Enums) { - KindValue e = KindValue::augmented; - std::string expected = "augmented"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::augmented; + std::string expected = "augmented"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_diminished, Enums ) +TEST(KindValue_diminished, Enums) { - KindValue e = KindValue::diminished; - std::string expected = "diminished"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::diminished; + std::string expected = "diminished"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_dominant, Enums ) +TEST(KindValue_dominant, Enums) { - KindValue e = KindValue::dominant; - std::string expected = "dominant"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::dominant; + std::string expected = "dominant"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_majorSeventh, Enums ) +TEST(KindValue_majorSeventh, Enums) { - KindValue e = KindValue::majorSeventh; - std::string expected = "major-seventh"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::majorSeventh; + std::string expected = "major-seventh"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_minorSeventh, Enums ) +TEST(KindValue_minorSeventh, Enums) { - KindValue e = KindValue::minorSeventh; - std::string expected = "minor-seventh"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::minorSeventh; + std::string expected = "minor-seventh"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_diminishedSeventh, Enums ) +TEST(KindValue_diminishedSeventh, Enums) { - KindValue e = KindValue::diminishedSeventh; - std::string expected = "diminished-seventh"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::diminishedSeventh; + std::string expected = "diminished-seventh"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_augmentedSeventh, Enums ) +TEST(KindValue_augmentedSeventh, Enums) { - KindValue e = KindValue::augmentedSeventh; - std::string expected = "augmented-seventh"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::augmentedSeventh; + std::string expected = "augmented-seventh"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_halfDiminished, Enums ) +TEST(KindValue_halfDiminished, Enums) { - KindValue e = KindValue::halfDiminished; - std::string expected = "half-diminished"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::halfDiminished; + std::string expected = "half-diminished"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_majorMinor, Enums ) +TEST(KindValue_majorMinor, Enums) { - KindValue e = KindValue::majorMinor; - std::string expected = "major-minor"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::majorMinor; + std::string expected = "major-minor"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_majorSixth, Enums ) +TEST(KindValue_majorSixth, Enums) { - KindValue e = KindValue::majorSixth; - std::string expected = "major-sixth"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::majorSixth; + std::string expected = "major-sixth"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_minorSixth, Enums ) +TEST(KindValue_minorSixth, Enums) { - KindValue e = KindValue::minorSixth; - std::string expected = "minor-sixth"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::minorSixth; + std::string expected = "minor-sixth"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_dominantNinth, Enums ) +TEST(KindValue_dominantNinth, Enums) { - KindValue e = KindValue::dominantNinth; - std::string expected = "dominant-ninth"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::dominantNinth; + std::string expected = "dominant-ninth"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_majorNinth, Enums ) +TEST(KindValue_majorNinth, Enums) { - KindValue e = KindValue::majorNinth; - std::string expected = "major-ninth"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::majorNinth; + std::string expected = "major-ninth"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_minorNinth, Enums ) +TEST(KindValue_minorNinth, Enums) { - KindValue e = KindValue::minorNinth; - std::string expected = "minor-ninth"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::minorNinth; + std::string expected = "minor-ninth"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_dominant11Th, Enums ) +TEST(KindValue_dominant11Th, Enums) { - KindValue e = KindValue::dominant11th; - std::string expected = "dominant-11th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::dominant11th; + std::string expected = "dominant-11th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_major11Th, Enums ) +TEST(KindValue_major11Th, Enums) { - KindValue e = KindValue::major11th; - std::string expected = "major-11th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::major11th; + std::string expected = "major-11th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_minor11Th, Enums ) +TEST(KindValue_minor11Th, Enums) { - KindValue e = KindValue::minor11th; - std::string expected = "minor-11th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::minor11th; + std::string expected = "minor-11th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_dominant13Th, Enums ) +TEST(KindValue_dominant13Th, Enums) { - KindValue e = KindValue::dominant13th; - std::string expected = "dominant-13th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::dominant13th; + std::string expected = "dominant-13th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_major13Th, Enums ) +TEST(KindValue_major13Th, Enums) { - KindValue e = KindValue::major13th; - std::string expected = "major-13th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::major13th; + std::string expected = "major-13th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_minor13Th, Enums ) +TEST(KindValue_minor13Th, Enums) { - KindValue e = KindValue::minor13th; - std::string expected = "minor-13th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::minor13th; + std::string expected = "minor-13th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_suspendedSecond, Enums ) +TEST(KindValue_suspendedSecond, Enums) { - KindValue e = KindValue::suspendedSecond; - std::string expected = "suspended-second"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::suspendedSecond; + std::string expected = "suspended-second"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_suspendedFourth, Enums ) +TEST(KindValue_suspendedFourth, Enums) { - KindValue e = KindValue::suspendedFourth; - std::string expected = "suspended-fourth"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::suspendedFourth; + std::string expected = "suspended-fourth"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_neapolitan, Enums ) +TEST(KindValue_neapolitan, Enums) { - KindValue e = KindValue::neapolitan; - std::string expected = "Neapolitan"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::neapolitan; + std::string expected = "Neapolitan"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_italian, Enums ) +TEST(KindValue_italian, Enums) { - KindValue e = KindValue::italian; - std::string expected = "Italian"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::italian; + std::string expected = "Italian"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_french, Enums ) +TEST(KindValue_french, Enums) { - KindValue e = KindValue::french; - std::string expected = "French"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::french; + std::string expected = "French"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_german, Enums ) +TEST(KindValue_german, Enums) { - KindValue e = KindValue::german; - std::string expected = "German"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::german; + std::string expected = "German"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_pedal, Enums ) +TEST(KindValue_pedal, Enums) { - KindValue e = KindValue::pedal; - std::string expected = "pedal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::pedal; + std::string expected = "pedal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_power, Enums ) +TEST(KindValue_power, Enums) { - KindValue e = KindValue::power; - std::string expected = "power"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::power; + std::string expected = "power"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_tristan, Enums ) +TEST(KindValue_tristan, Enums) { - KindValue e = KindValue::tristan; - std::string expected = "Tristan"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::tristan; + std::string expected = "Tristan"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_other, Enums ) +TEST(KindValue_other, Enums) { - KindValue e = KindValue::other; - std::string expected = "other"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::other; + std::string expected = "other"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( KindValue_none, Enums ) +TEST(KindValue_none, Enums) { - KindValue e = KindValue::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + KindValue e = KindValue::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - KindValue e2 = parseKindValue( expected ); - CHECK_EQUAL( e, e2 ) + KindValue e2 = parseKindValue(expected); + CHECK_EQUAL(e, e2) } -TEST( LineEnd_BadParse, Enums ) +TEST(LineEnd_BadParse, Enums) { - LineEnd actual = parseLineEnd( "up" ); - LineEnd expected = LineEnd::up; - CHECK_EQUAL( expected, actual ) + LineEnd actual = parseLineEnd("up"); + LineEnd expected = LineEnd::up; + CHECK_EQUAL(expected, actual) } -TEST( LineEnd_up, Enums ) +TEST(LineEnd_up, Enums) { - LineEnd e = LineEnd::up; - std::string expected = "up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineEnd e = LineEnd::up; + std::string expected = "up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineEnd e2 = parseLineEnd( expected ); - CHECK_EQUAL( e, e2 ) + LineEnd e2 = parseLineEnd(expected); + CHECK_EQUAL(e, e2) } -TEST( LineEnd_down, Enums ) +TEST(LineEnd_down, Enums) { - LineEnd e = LineEnd::down; - std::string expected = "down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineEnd e = LineEnd::down; + std::string expected = "down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineEnd e2 = parseLineEnd( expected ); - CHECK_EQUAL( e, e2 ) + LineEnd e2 = parseLineEnd(expected); + CHECK_EQUAL(e, e2) } -TEST( LineEnd_both, Enums ) +TEST(LineEnd_both, Enums) { - LineEnd e = LineEnd::both; - std::string expected = "both"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineEnd e = LineEnd::both; + std::string expected = "both"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineEnd e2 = parseLineEnd( expected ); - CHECK_EQUAL( e, e2 ) + LineEnd e2 = parseLineEnd(expected); + CHECK_EQUAL(e, e2) } -TEST( LineEnd_arrow, Enums ) +TEST(LineEnd_arrow, Enums) { - LineEnd e = LineEnd::arrow; - std::string expected = "arrow"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineEnd e = LineEnd::arrow; + std::string expected = "arrow"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineEnd e2 = parseLineEnd( expected ); - CHECK_EQUAL( e, e2 ) + LineEnd e2 = parseLineEnd(expected); + CHECK_EQUAL(e, e2) } -TEST( LineEnd_none, Enums ) +TEST(LineEnd_none, Enums) { - LineEnd e = LineEnd::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + LineEnd e = LineEnd::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - LineEnd e2 = parseLineEnd( expected ); - CHECK_EQUAL( e, e2 ) + LineEnd e2 = parseLineEnd(expected); + CHECK_EQUAL(e, e2) } -TEST( MeasureNumberingValue_BadParse, Enums ) +TEST(MeasureNumberingValue_BadParse, Enums) { - MeasureNumberingValue actual = parseMeasureNumberingValue( "none" ); - MeasureNumberingValue expected = MeasureNumberingValue::none; - CHECK_EQUAL( expected, actual ) + MeasureNumberingValue actual = parseMeasureNumberingValue("none"); + MeasureNumberingValue expected = MeasureNumberingValue::none; + CHECK_EQUAL(expected, actual) } -TEST( MeasureNumberingValue_none, Enums ) +TEST(MeasureNumberingValue_none, Enums) { - MeasureNumberingValue e = MeasureNumberingValue::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MeasureNumberingValue e = MeasureNumberingValue::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MeasureNumberingValue e2 = parseMeasureNumberingValue( expected ); - CHECK_EQUAL( e, e2 ) + MeasureNumberingValue e2 = parseMeasureNumberingValue(expected); + CHECK_EQUAL(e, e2) } -TEST( MeasureNumberingValue_measure, Enums ) +TEST(MeasureNumberingValue_measure, Enums) { - MeasureNumberingValue e = MeasureNumberingValue::measure; - std::string expected = "measure"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MeasureNumberingValue e = MeasureNumberingValue::measure; + std::string expected = "measure"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MeasureNumberingValue e2 = parseMeasureNumberingValue( expected ); - CHECK_EQUAL( e, e2 ) + MeasureNumberingValue e2 = parseMeasureNumberingValue(expected); + CHECK_EQUAL(e, e2) } -TEST( MeasureNumberingValue_system, Enums ) +TEST(MeasureNumberingValue_system, Enums) { - MeasureNumberingValue e = MeasureNumberingValue::system; - std::string expected = "system"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MeasureNumberingValue e = MeasureNumberingValue::system; + std::string expected = "system"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MeasureNumberingValue e2 = parseMeasureNumberingValue( expected ); - CHECK_EQUAL( e, e2 ) + MeasureNumberingValue e2 = parseMeasureNumberingValue(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_BadParse, Enums ) +TEST(Membrane_BadParse, Enums) { - MembraneEnum actual = parseMembraneEnum( "bass drum" ); - MembraneEnum expected = MembraneEnum::bassDrum; - CHECK_EQUAL( expected, actual ) + MembraneEnum actual = parseMembraneEnum("bass drum"); + MembraneEnum expected = MembraneEnum::bassDrum; + CHECK_EQUAL(expected, actual) } -TEST( Membrane_bassDrum, Enums ) +TEST(Membrane_bassDrum, Enums) { - MembraneEnum e = MembraneEnum::bassDrum; - std::string expected = "bass drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::bassDrum; + std::string expected = "bass drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_bassDrumOnSide, Enums ) +TEST(Membrane_bassDrumOnSide, Enums) { - MembraneEnum e = MembraneEnum::bassDrumOnSide; - std::string expected = "bass drum on side"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::bassDrumOnSide; + std::string expected = "bass drum on side"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_bongos, Enums ) +TEST(Membrane_bongos, Enums) { - MembraneEnum e = MembraneEnum::bongos; - std::string expected = "bongos"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::bongos; + std::string expected = "bongos"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_congaDrum, Enums ) +TEST(Membrane_congaDrum, Enums) { - MembraneEnum e = MembraneEnum::congaDrum; - std::string expected = "conga drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::congaDrum; + std::string expected = "conga drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_gobletDrum, Enums ) +TEST(Membrane_gobletDrum, Enums) { - MembraneEnum e = MembraneEnum::gobletDrum; - std::string expected = "goblet drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::gobletDrum; + std::string expected = "goblet drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_militaryDrum, Enums ) +TEST(Membrane_militaryDrum, Enums) { - MembraneEnum e = MembraneEnum::militaryDrum; - std::string expected = "military drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::militaryDrum; + std::string expected = "military drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_snareDrum, Enums ) +TEST(Membrane_snareDrum, Enums) { - MembraneEnum e = MembraneEnum::snareDrum; - std::string expected = "snare drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::snareDrum; + std::string expected = "snare drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_snareDrumSnaresOff, Enums ) +TEST(Membrane_snareDrumSnaresOff, Enums) { - MembraneEnum e = MembraneEnum::snareDrumSnaresOff; - std::string expected = "snare drum snares off"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::snareDrumSnaresOff; + std::string expected = "snare drum snares off"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_tambourine, Enums ) +TEST(Membrane_tambourine, Enums) { - MembraneEnum e = MembraneEnum::tambourine; - std::string expected = "tambourine"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::tambourine; + std::string expected = "tambourine"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_tenorDrum, Enums ) +TEST(Membrane_tenorDrum, Enums) { - MembraneEnum e = MembraneEnum::tenorDrum; - std::string expected = "tenor drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::tenorDrum; + std::string expected = "tenor drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_timbales, Enums ) +TEST(Membrane_timbales, Enums) { - MembraneEnum e = MembraneEnum::timbales; - std::string expected = "timbales"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::timbales; + std::string expected = "timbales"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Membrane_tomtom, Enums ) +TEST(Membrane_tomtom, Enums) { - MembraneEnum e = MembraneEnum::tomtom; - std::string expected = "tomtom"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MembraneEnum e = MembraneEnum::tomtom; + std::string expected = "tomtom"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MembraneEnum e2 = parseMembraneEnum( expected ); - CHECK_EQUAL( e, e2 ) + MembraneEnum e2 = parseMembraneEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_BadParse, Enums ) +TEST(Metal_BadParse, Enums) { - MetalEnum actual = parseMetalEnum( "almglocken" ); - MetalEnum expected = MetalEnum::almglocken; - CHECK_EQUAL( expected, actual ) + MetalEnum actual = parseMetalEnum("almglocken"); + MetalEnum expected = MetalEnum::almglocken; + CHECK_EQUAL(expected, actual) } -TEST( Metal_almglocken, Enums ) +TEST(Metal_almglocken, Enums) { - MetalEnum e = MetalEnum::almglocken; - std::string expected = "almglocken"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::almglocken; + std::string expected = "almglocken"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_bell, Enums ) +TEST(Metal_bell, Enums) { - MetalEnum e = MetalEnum::bell; - std::string expected = "bell"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::bell; + std::string expected = "bell"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_bellPlate, Enums ) +TEST(Metal_bellPlate, Enums) { - MetalEnum e = MetalEnum::bellPlate; - std::string expected = "bell plate"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::bellPlate; + std::string expected = "bell plate"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_brakeDrum, Enums ) +TEST(Metal_brakeDrum, Enums) { - MetalEnum e = MetalEnum::brakeDrum; - std::string expected = "brake drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::brakeDrum; + std::string expected = "brake drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_chineseCymbal, Enums ) +TEST(Metal_chineseCymbal, Enums) { - MetalEnum e = MetalEnum::chineseCymbal; - std::string expected = "Chinese cymbal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::chineseCymbal; + std::string expected = "Chinese cymbal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_cowbell, Enums ) +TEST(Metal_cowbell, Enums) { - MetalEnum e = MetalEnum::cowbell; - std::string expected = "cowbell"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::cowbell; + std::string expected = "cowbell"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_crashCymbals, Enums ) +TEST(Metal_crashCymbals, Enums) { - MetalEnum e = MetalEnum::crashCymbals; - std::string expected = "crash cymbals"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::crashCymbals; + std::string expected = "crash cymbals"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_crotale, Enums ) +TEST(Metal_crotale, Enums) { - MetalEnum e = MetalEnum::crotale; - std::string expected = "crotale"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::crotale; + std::string expected = "crotale"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_cymbalTongs, Enums ) +TEST(Metal_cymbalTongs, Enums) { - MetalEnum e = MetalEnum::cymbalTongs; - std::string expected = "cymbal tongs"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::cymbalTongs; + std::string expected = "cymbal tongs"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_domedGong, Enums ) +TEST(Metal_domedGong, Enums) { - MetalEnum e = MetalEnum::domedGong; - std::string expected = "domed gong"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::domedGong; + std::string expected = "domed gong"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_fingerCymbals, Enums ) +TEST(Metal_fingerCymbals, Enums) { - MetalEnum e = MetalEnum::fingerCymbals; - std::string expected = "finger cymbals"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::fingerCymbals; + std::string expected = "finger cymbals"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_flexatone, Enums ) +TEST(Metal_flexatone, Enums) { - MetalEnum e = MetalEnum::flexatone; - std::string expected = "flexatone"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::flexatone; + std::string expected = "flexatone"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_gong, Enums ) +TEST(Metal_gong, Enums) { - MetalEnum e = MetalEnum::gong; - std::string expected = "gong"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::gong; + std::string expected = "gong"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_hiHat, Enums ) +TEST(Metal_hiHat, Enums) { - MetalEnum e = MetalEnum::hiHat; - std::string expected = "hi-hat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::hiHat; + std::string expected = "hi-hat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_highHatCymbals, Enums ) +TEST(Metal_highHatCymbals, Enums) { - MetalEnum e = MetalEnum::highHatCymbals; - std::string expected = "high-hat cymbals"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::highHatCymbals; + std::string expected = "high-hat cymbals"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_handbell, Enums ) +TEST(Metal_handbell, Enums) { - MetalEnum e = MetalEnum::handbell; - std::string expected = "handbell"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::handbell; + std::string expected = "handbell"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_sistrum, Enums ) +TEST(Metal_sistrum, Enums) { - MetalEnum e = MetalEnum::sistrum; - std::string expected = "sistrum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::sistrum; + std::string expected = "sistrum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_sizzleCymbal, Enums ) +TEST(Metal_sizzleCymbal, Enums) { - MetalEnum e = MetalEnum::sizzleCymbal; - std::string expected = "sizzle cymbal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::sizzleCymbal; + std::string expected = "sizzle cymbal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_sleighBells, Enums ) +TEST(Metal_sleighBells, Enums) { - MetalEnum e = MetalEnum::sleighBells; - std::string expected = "sleigh bells"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::sleighBells; + std::string expected = "sleigh bells"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_suspendedCymbal, Enums ) +TEST(Metal_suspendedCymbal, Enums) { - MetalEnum e = MetalEnum::suspendedCymbal; - std::string expected = "suspended cymbal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::suspendedCymbal; + std::string expected = "suspended cymbal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_tamTam, Enums ) +TEST(Metal_tamTam, Enums) { - MetalEnum e = MetalEnum::tamTam; - std::string expected = "tam tam"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::tamTam; + std::string expected = "tam tam"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_triangle, Enums ) +TEST(Metal_triangle, Enums) { - MetalEnum e = MetalEnum::triangle; - std::string expected = "triangle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::triangle; + std::string expected = "triangle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Metal_vietnameseHat, Enums ) +TEST(Metal_vietnameseHat, Enums) { - MetalEnum e = MetalEnum::vietnameseHat; - std::string expected = "Vietnamese hat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MetalEnum e = MetalEnum::vietnameseHat; + std::string expected = "Vietnamese hat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MetalEnum e2 = parseMetalEnum( expected ); - CHECK_EQUAL( e, e2 ) + MetalEnum e2 = parseMetalEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( OnOff_BadParse, Enums ) +TEST(OnOff_BadParse, Enums) { - OnOff actual = parseOnOff( "on" ); - OnOff expected = OnOff::on; - CHECK_EQUAL( expected, actual ) + OnOff actual = parseOnOff("on"); + OnOff expected = OnOff::on; + CHECK_EQUAL(expected, actual) } -TEST( OnOff_on, Enums ) +TEST(OnOff_on, Enums) { - OnOff e = OnOff::on; - std::string expected = "on"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + OnOff e = OnOff::on; + std::string expected = "on"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - OnOff e2 = parseOnOff( expected ); - CHECK_EQUAL( e, e2 ) + OnOff e2 = parseOnOff(expected); + CHECK_EQUAL(e, e2) } -TEST( OnOff_off, Enums ) +TEST(OnOff_off, Enums) { - OnOff e = OnOff::off; - std::string expected = "off"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + OnOff e = OnOff::off; + std::string expected = "off"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - OnOff e2 = parseOnOff( expected ); - CHECK_EQUAL( e, e2 ) + OnOff e2 = parseOnOff(expected); + CHECK_EQUAL(e, e2) } -TEST( Pitched_BadParse, Enums ) +TEST(Pitched_BadParse, Enums) { - PitchedEnum actual = parsePitchedEnum( "chimes" ); - PitchedEnum expected = PitchedEnum::chimes; - CHECK_EQUAL( expected, actual ) + PitchedEnum actual = parsePitchedEnum("chimes"); + PitchedEnum expected = PitchedEnum::chimes; + CHECK_EQUAL(expected, actual) } -TEST( Pitched_chimes, Enums ) +TEST(Pitched_chimes, Enums) { - PitchedEnum e = PitchedEnum::chimes; - std::string expected = "chimes"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PitchedEnum e = PitchedEnum::chimes; + std::string expected = "chimes"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PitchedEnum e2 = parsePitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + PitchedEnum e2 = parsePitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Pitched_glockenspiel, Enums ) +TEST(Pitched_glockenspiel, Enums) { - PitchedEnum e = PitchedEnum::glockenspiel; - std::string expected = "glockenspiel"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PitchedEnum e = PitchedEnum::glockenspiel; + std::string expected = "glockenspiel"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PitchedEnum e2 = parsePitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + PitchedEnum e2 = parsePitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Pitched_mallet, Enums ) +TEST(Pitched_mallet, Enums) { - PitchedEnum e = PitchedEnum::mallet; - std::string expected = "mallet"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PitchedEnum e = PitchedEnum::mallet; + std::string expected = "mallet"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PitchedEnum e2 = parsePitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + PitchedEnum e2 = parsePitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Pitched_marimba, Enums ) +TEST(Pitched_marimba, Enums) { - PitchedEnum e = PitchedEnum::marimba; - std::string expected = "marimba"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PitchedEnum e = PitchedEnum::marimba; + std::string expected = "marimba"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PitchedEnum e2 = parsePitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + PitchedEnum e2 = parsePitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Pitched_tubularChimes, Enums ) +TEST(Pitched_tubularChimes, Enums) { - PitchedEnum e = PitchedEnum::tubularChimes; - std::string expected = "tubular chimes"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PitchedEnum e = PitchedEnum::tubularChimes; + std::string expected = "tubular chimes"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PitchedEnum e2 = parsePitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + PitchedEnum e2 = parsePitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Pitched_vibraphone, Enums ) +TEST(Pitched_vibraphone, Enums) { - PitchedEnum e = PitchedEnum::vibraphone; - std::string expected = "vibraphone"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PitchedEnum e = PitchedEnum::vibraphone; + std::string expected = "vibraphone"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PitchedEnum e2 = parsePitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + PitchedEnum e2 = parsePitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Pitched_xylophone, Enums ) +TEST(Pitched_xylophone, Enums) { - PitchedEnum e = PitchedEnum::xylophone; - std::string expected = "xylophone"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PitchedEnum e = PitchedEnum::xylophone; + std::string expected = "xylophone"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PitchedEnum e2 = parsePitchedEnum( expected ); - CHECK_EQUAL( e, e2 ) + PitchedEnum e2 = parsePitchedEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( PrincipalVoiceSymbol_BadParse, Enums ) +TEST(PrincipalVoiceSymbol_BadParse, Enums) { - PrincipalVoiceSymbol actual = parsePrincipalVoiceSymbol( "Hauptstimme" ); - PrincipalVoiceSymbol expected = PrincipalVoiceSymbol::hauptstimme; - CHECK_EQUAL( expected, actual ) + PrincipalVoiceSymbol actual = parsePrincipalVoiceSymbol("Hauptstimme"); + PrincipalVoiceSymbol expected = PrincipalVoiceSymbol::hauptstimme; + CHECK_EQUAL(expected, actual) } -TEST( PrincipalVoiceSymbol_hauptstimme, Enums ) +TEST(PrincipalVoiceSymbol_hauptstimme, Enums) { - PrincipalVoiceSymbol e = PrincipalVoiceSymbol::hauptstimme; - std::string expected = "Hauptstimme"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PrincipalVoiceSymbol e = PrincipalVoiceSymbol::hauptstimme; + std::string expected = "Hauptstimme"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PrincipalVoiceSymbol e2 = parsePrincipalVoiceSymbol( expected ); - CHECK_EQUAL( e, e2 ) + PrincipalVoiceSymbol e2 = parsePrincipalVoiceSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( PrincipalVoiceSymbol_nebenstimme, Enums ) +TEST(PrincipalVoiceSymbol_nebenstimme, Enums) { - PrincipalVoiceSymbol e = PrincipalVoiceSymbol::nebenstimme; - std::string expected = "Nebenstimme"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PrincipalVoiceSymbol e = PrincipalVoiceSymbol::nebenstimme; + std::string expected = "Nebenstimme"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PrincipalVoiceSymbol e2 = parsePrincipalVoiceSymbol( expected ); - CHECK_EQUAL( e, e2 ) + PrincipalVoiceSymbol e2 = parsePrincipalVoiceSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( PrincipalVoiceSymbol_plain, Enums ) +TEST(PrincipalVoiceSymbol_plain, Enums) { - PrincipalVoiceSymbol e = PrincipalVoiceSymbol::plain; - std::string expected = "plain"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PrincipalVoiceSymbol e = PrincipalVoiceSymbol::plain; + std::string expected = "plain"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PrincipalVoiceSymbol e2 = parsePrincipalVoiceSymbol( expected ); - CHECK_EQUAL( e, e2 ) + PrincipalVoiceSymbol e2 = parsePrincipalVoiceSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( PrincipalVoiceSymbol_none, Enums ) +TEST(PrincipalVoiceSymbol_none, Enums) { - PrincipalVoiceSymbol e = PrincipalVoiceSymbol::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + PrincipalVoiceSymbol e = PrincipalVoiceSymbol::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - PrincipalVoiceSymbol e2 = parsePrincipalVoiceSymbol( expected ); - CHECK_EQUAL( e, e2 ) + PrincipalVoiceSymbol e2 = parsePrincipalVoiceSymbol(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopChangeContinue_BadParse, Enums ) +TEST(StartStopChangeContinue_BadParse, Enums) { - StartStopChangeContinue actual = parseStartStopChangeContinue( "start" ); - StartStopChangeContinue expected = StartStopChangeContinue::start; - CHECK_EQUAL( expected, actual ) + StartStopChangeContinue actual = parseStartStopChangeContinue("start"); + StartStopChangeContinue expected = StartStopChangeContinue::start; + CHECK_EQUAL(expected, actual) } -TEST( StartStopChangeContinue_start, Enums ) +TEST(StartStopChangeContinue_start, Enums) { - StartStopChangeContinue e = StartStopChangeContinue::start; - std::string expected = "start"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopChangeContinue e = StartStopChangeContinue::start; + std::string expected = "start"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopChangeContinue e2 = parseStartStopChangeContinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopChangeContinue e2 = parseStartStopChangeContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopChangeContinue_stop, Enums ) +TEST(StartStopChangeContinue_stop, Enums) { - StartStopChangeContinue e = StartStopChangeContinue::stop; - std::string expected = "stop"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopChangeContinue e = StartStopChangeContinue::stop; + std::string expected = "stop"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopChangeContinue e2 = parseStartStopChangeContinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopChangeContinue e2 = parseStartStopChangeContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopChangeContinue_change, Enums ) +TEST(StartStopChangeContinue_change, Enums) { - StartStopChangeContinue e = StartStopChangeContinue::change; - std::string expected = "change"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopChangeContinue e = StartStopChangeContinue::change; + std::string expected = "change"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopChangeContinue e2 = parseStartStopChangeContinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopChangeContinue e2 = parseStartStopChangeContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( StartStopChangeContinue_continue_, Enums ) +TEST(StartStopChangeContinue_continue_, Enums) { - StartStopChangeContinue e = StartStopChangeContinue::continue_; - std::string expected = "continue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StartStopChangeContinue e = StartStopChangeContinue::continue_; + std::string expected = "continue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StartStopChangeContinue e2 = parseStartStopChangeContinue( expected ); - CHECK_EQUAL( e, e2 ) + StartStopChangeContinue e2 = parseStartStopChangeContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( TipDirection_BadParse, Enums ) +TEST(TipDirection_BadParse, Enums) { - TipDirection actual = parseTipDirection( "up" ); - TipDirection expected = TipDirection::up; - CHECK_EQUAL( expected, actual ) + TipDirection actual = parseTipDirection("up"); + TipDirection expected = TipDirection::up; + CHECK_EQUAL(expected, actual) } -TEST( TipDirection_up, Enums ) +TEST(TipDirection_up, Enums) { - TipDirection e = TipDirection::up; - std::string expected = "up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TipDirection e = TipDirection::up; + std::string expected = "up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TipDirection e2 = parseTipDirection( expected ); - CHECK_EQUAL( e, e2 ) + TipDirection e2 = parseTipDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TipDirection_down, Enums ) +TEST(TipDirection_down, Enums) { - TipDirection e = TipDirection::down; - std::string expected = "down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TipDirection e = TipDirection::down; + std::string expected = "down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TipDirection e2 = parseTipDirection( expected ); - CHECK_EQUAL( e, e2 ) + TipDirection e2 = parseTipDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TipDirection_left, Enums ) +TEST(TipDirection_left, Enums) { - TipDirection e = TipDirection::left; - std::string expected = "left"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TipDirection e = TipDirection::left; + std::string expected = "left"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TipDirection e2 = parseTipDirection( expected ); - CHECK_EQUAL( e, e2 ) + TipDirection e2 = parseTipDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TipDirection_right, Enums ) +TEST(TipDirection_right, Enums) { - TipDirection e = TipDirection::right; - std::string expected = "right"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TipDirection e = TipDirection::right; + std::string expected = "right"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TipDirection e2 = parseTipDirection( expected ); - CHECK_EQUAL( e, e2 ) + TipDirection e2 = parseTipDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TipDirection_northwest, Enums ) +TEST(TipDirection_northwest, Enums) { - TipDirection e = TipDirection::northwest; - std::string expected = "northwest"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TipDirection e = TipDirection::northwest; + std::string expected = "northwest"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TipDirection e2 = parseTipDirection( expected ); - CHECK_EQUAL( e, e2 ) + TipDirection e2 = parseTipDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TipDirection_northeast, Enums ) +TEST(TipDirection_northeast, Enums) { - TipDirection e = TipDirection::northeast; - std::string expected = "northeast"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TipDirection e = TipDirection::northeast; + std::string expected = "northeast"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TipDirection e2 = parseTipDirection( expected ); - CHECK_EQUAL( e, e2 ) + TipDirection e2 = parseTipDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TipDirection_southeast, Enums ) +TEST(TipDirection_southeast, Enums) { - TipDirection e = TipDirection::southeast; - std::string expected = "southeast"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TipDirection e = TipDirection::southeast; + std::string expected = "southeast"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TipDirection e2 = parseTipDirection( expected ); - CHECK_EQUAL( e, e2 ) + TipDirection e2 = parseTipDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( TipDirection_southwest, Enums ) +TEST(TipDirection_southwest, Enums) { - TipDirection e = TipDirection::southwest; - std::string expected = "southwest"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + TipDirection e = TipDirection::southwest; + std::string expected = "southwest"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - TipDirection e2 = parseTipDirection( expected ); - CHECK_EQUAL( e, e2 ) + TipDirection e2 = parseTipDirection(expected); + CHECK_EQUAL(e, e2) } -TEST( StickLocation_BadParse, Enums ) +TEST(StickLocation_BadParse, Enums) { - StickLocationEnum actual = parseStickLocationEnum( "center" ); - StickLocationEnum expected = StickLocationEnum::center; - CHECK_EQUAL( expected, actual ) + StickLocationEnum actual = parseStickLocationEnum("center"); + StickLocationEnum expected = StickLocationEnum::center; + CHECK_EQUAL(expected, actual) } -TEST( StickLocation_center, Enums ) +TEST(StickLocation_center, Enums) { - StickLocationEnum e = StickLocationEnum::center; - std::string expected = "center"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickLocationEnum e = StickLocationEnum::center; + std::string expected = "center"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickLocationEnum e2 = parseStickLocationEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickLocationEnum e2 = parseStickLocationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickLocation_rim, Enums ) +TEST(StickLocation_rim, Enums) { - StickLocationEnum e = StickLocationEnum::rim; - std::string expected = "rim"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickLocationEnum e = StickLocationEnum::rim; + std::string expected = "rim"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickLocationEnum e2 = parseStickLocationEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickLocationEnum e2 = parseStickLocationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickLocation_cymbalBell, Enums ) +TEST(StickLocation_cymbalBell, Enums) { - StickLocationEnum e = StickLocationEnum::cymbalBell; - std::string expected = "cymbal bell"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickLocationEnum e = StickLocationEnum::cymbalBell; + std::string expected = "cymbal bell"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickLocationEnum e2 = parseStickLocationEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickLocationEnum e2 = parseStickLocationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickLocation_cymbalEdge, Enums ) +TEST(StickLocation_cymbalEdge, Enums) { - StickLocationEnum e = StickLocationEnum::cymbalEdge; - std::string expected = "cymbal edge"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickLocationEnum e = StickLocationEnum::cymbalEdge; + std::string expected = "cymbal edge"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickLocationEnum e2 = parseStickLocationEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickLocationEnum e2 = parseStickLocationEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickMaterial_BadParse, Enums ) +TEST(StickMaterial_BadParse, Enums) { - StickMaterialEnum actual = parseStickMaterialEnum( "soft" ); - StickMaterialEnum expected = StickMaterialEnum::soft; - CHECK_EQUAL( expected, actual ) + StickMaterialEnum actual = parseStickMaterialEnum("soft"); + StickMaterialEnum expected = StickMaterialEnum::soft; + CHECK_EQUAL(expected, actual) } -TEST( StickMaterial_soft, Enums ) +TEST(StickMaterial_soft, Enums) { - StickMaterialEnum e = StickMaterialEnum::soft; - std::string expected = "soft"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickMaterialEnum e = StickMaterialEnum::soft; + std::string expected = "soft"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickMaterialEnum e2 = parseStickMaterialEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickMaterialEnum e2 = parseStickMaterialEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickMaterial_medium, Enums ) +TEST(StickMaterial_medium, Enums) { - StickMaterialEnum e = StickMaterialEnum::medium; - std::string expected = "medium"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickMaterialEnum e = StickMaterialEnum::medium; + std::string expected = "medium"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickMaterialEnum e2 = parseStickMaterialEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickMaterialEnum e2 = parseStickMaterialEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickMaterial_hard, Enums ) +TEST(StickMaterial_hard, Enums) { - StickMaterialEnum e = StickMaterialEnum::hard; - std::string expected = "hard"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickMaterialEnum e = StickMaterialEnum::hard; + std::string expected = "hard"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickMaterialEnum e2 = parseStickMaterialEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickMaterialEnum e2 = parseStickMaterialEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickMaterial_shaded, Enums ) +TEST(StickMaterial_shaded, Enums) { - StickMaterialEnum e = StickMaterialEnum::shaded; - std::string expected = "shaded"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickMaterialEnum e = StickMaterialEnum::shaded; + std::string expected = "shaded"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickMaterialEnum e2 = parseStickMaterialEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickMaterialEnum e2 = parseStickMaterialEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickMaterial_x, Enums ) +TEST(StickMaterial_x, Enums) { - StickMaterialEnum e = StickMaterialEnum::x; - std::string expected = "x"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickMaterialEnum e = StickMaterialEnum::x; + std::string expected = "x"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickMaterialEnum e2 = parseStickMaterialEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickMaterialEnum e2 = parseStickMaterialEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickType_BadParse, Enums ) +TEST(StickType_BadParse, Enums) { - StickTypeEnum actual = parseStickTypeEnum( "bass drum" ); - StickTypeEnum expected = StickTypeEnum::bassDrum; - CHECK_EQUAL( expected, actual ) + StickTypeEnum actual = parseStickTypeEnum("bass drum"); + StickTypeEnum expected = StickTypeEnum::bassDrum; + CHECK_EQUAL(expected, actual) } -TEST( StickType_bassDrum, Enums ) +TEST(StickType_bassDrum, Enums) { - StickTypeEnum e = StickTypeEnum::bassDrum; - std::string expected = "bass drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickTypeEnum e = StickTypeEnum::bassDrum; + std::string expected = "bass drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickTypeEnum e2 = parseStickTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickTypeEnum e2 = parseStickTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickType_doubleBassDrum, Enums ) +TEST(StickType_doubleBassDrum, Enums) { - StickTypeEnum e = StickTypeEnum::doubleBassDrum; - std::string expected = "double bass drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickTypeEnum e = StickTypeEnum::doubleBassDrum; + std::string expected = "double bass drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickTypeEnum e2 = parseStickTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickTypeEnum e2 = parseStickTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickType_timpani, Enums ) +TEST(StickType_timpani, Enums) { - StickTypeEnum e = StickTypeEnum::timpani; - std::string expected = "timpani"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickTypeEnum e = StickTypeEnum::timpani; + std::string expected = "timpani"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickTypeEnum e2 = parseStickTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickTypeEnum e2 = parseStickTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickType_xylophone, Enums ) +TEST(StickType_xylophone, Enums) { - StickTypeEnum e = StickTypeEnum::xylophone; - std::string expected = "xylophone"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickTypeEnum e = StickTypeEnum::xylophone; + std::string expected = "xylophone"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickTypeEnum e2 = parseStickTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickTypeEnum e2 = parseStickTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( StickType_yarn, Enums ) +TEST(StickType_yarn, Enums) { - StickTypeEnum e = StickTypeEnum::yarn; - std::string expected = "yarn"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StickTypeEnum e = StickTypeEnum::yarn; + std::string expected = "yarn"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StickTypeEnum e2 = parseStickTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) + StickTypeEnum e2 = parseStickTypeEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( UpDownStopContinue_BadParse, Enums ) +TEST(UpDownStopContinue_BadParse, Enums) { - UpDownStopContinue actual = parseUpDownStopContinue( "up" ); - UpDownStopContinue expected = UpDownStopContinue::up; - CHECK_EQUAL( expected, actual ) + UpDownStopContinue actual = parseUpDownStopContinue("up"); + UpDownStopContinue expected = UpDownStopContinue::up; + CHECK_EQUAL(expected, actual) } -TEST( UpDownStopContinue_up, Enums ) +TEST(UpDownStopContinue_up, Enums) { - UpDownStopContinue e = UpDownStopContinue::up; - std::string expected = "up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + UpDownStopContinue e = UpDownStopContinue::up; + std::string expected = "up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - UpDownStopContinue e2 = parseUpDownStopContinue( expected ); - CHECK_EQUAL( e, e2 ) + UpDownStopContinue e2 = parseUpDownStopContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( UpDownStopContinue_down, Enums ) +TEST(UpDownStopContinue_down, Enums) { - UpDownStopContinue e = UpDownStopContinue::down; - std::string expected = "down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + UpDownStopContinue e = UpDownStopContinue::down; + std::string expected = "down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - UpDownStopContinue e2 = parseUpDownStopContinue( expected ); - CHECK_EQUAL( e, e2 ) + UpDownStopContinue e2 = parseUpDownStopContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( UpDownStopContinue_stop, Enums ) +TEST(UpDownStopContinue_stop, Enums) { - UpDownStopContinue e = UpDownStopContinue::stop; - std::string expected = "stop"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + UpDownStopContinue e = UpDownStopContinue::stop; + std::string expected = "stop"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - UpDownStopContinue e2 = parseUpDownStopContinue( expected ); - CHECK_EQUAL( e, e2 ) + UpDownStopContinue e2 = parseUpDownStopContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( UpDownStopContinue_continue_, Enums ) +TEST(UpDownStopContinue_continue_, Enums) { - UpDownStopContinue e = UpDownStopContinue::continue_; - std::string expected = "continue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + UpDownStopContinue e = UpDownStopContinue::continue_; + std::string expected = "continue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - UpDownStopContinue e2 = parseUpDownStopContinue( expected ); - CHECK_EQUAL( e, e2 ) + UpDownStopContinue e2 = parseUpDownStopContinue(expected); + CHECK_EQUAL(e, e2) } -TEST( WedgeType_BadParse, Enums ) +TEST(WedgeType_BadParse, Enums) { - WedgeType actual = parseWedgeType( "crescendo" ); - WedgeType expected = WedgeType::crescendo; - CHECK_EQUAL( expected, actual ) + WedgeType actual = parseWedgeType("crescendo"); + WedgeType expected = WedgeType::crescendo; + CHECK_EQUAL(expected, actual) } -TEST( WedgeType_crescendo, Enums ) +TEST(WedgeType_crescendo, Enums) { - WedgeType e = WedgeType::crescendo; - std::string expected = "crescendo"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WedgeType e = WedgeType::crescendo; + std::string expected = "crescendo"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WedgeType e2 = parseWedgeType( expected ); - CHECK_EQUAL( e, e2 ) + WedgeType e2 = parseWedgeType(expected); + CHECK_EQUAL(e, e2) } -TEST( WedgeType_diminuendo, Enums ) +TEST(WedgeType_diminuendo, Enums) { - WedgeType e = WedgeType::diminuendo; - std::string expected = "diminuendo"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WedgeType e = WedgeType::diminuendo; + std::string expected = "diminuendo"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WedgeType e2 = parseWedgeType( expected ); - CHECK_EQUAL( e, e2 ) + WedgeType e2 = parseWedgeType(expected); + CHECK_EQUAL(e, e2) } -TEST( WedgeType_stop, Enums ) +TEST(WedgeType_stop, Enums) { - WedgeType e = WedgeType::stop; - std::string expected = "stop"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WedgeType e = WedgeType::stop; + std::string expected = "stop"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WedgeType e2 = parseWedgeType( expected ); - CHECK_EQUAL( e, e2 ) + WedgeType e2 = parseWedgeType(expected); + CHECK_EQUAL(e, e2) } -TEST( WedgeType_continue_, Enums ) +TEST(WedgeType_continue_, Enums) { - WedgeType e = WedgeType::continue_; - std::string expected = "continue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WedgeType e = WedgeType::continue_; + std::string expected = "continue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WedgeType e2 = parseWedgeType( expected ); - CHECK_EQUAL( e, e2 ) + WedgeType e2 = parseWedgeType(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_BadParse, Enums ) +TEST(Wood_BadParse, Enums) { - WoodEnum actual = parseWoodEnum( "board clapper" ); - WoodEnum expected = WoodEnum::boardClapper; - CHECK_EQUAL( expected, actual ) + WoodEnum actual = parseWoodEnum("board clapper"); + WoodEnum expected = WoodEnum::boardClapper; + CHECK_EQUAL(expected, actual) } -TEST( Wood_boardClapper, Enums ) +TEST(Wood_boardClapper, Enums) { - WoodEnum e = WoodEnum::boardClapper; - std::string expected = "board clapper"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::boardClapper; + std::string expected = "board clapper"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_cabasa, Enums ) +TEST(Wood_cabasa, Enums) { - WoodEnum e = WoodEnum::cabasa; - std::string expected = "cabasa"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::cabasa; + std::string expected = "cabasa"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_castanets, Enums ) +TEST(Wood_castanets, Enums) { - WoodEnum e = WoodEnum::castanets; - std::string expected = "castanets"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::castanets; + std::string expected = "castanets"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_claves, Enums ) +TEST(Wood_claves, Enums) { - WoodEnum e = WoodEnum::claves; - std::string expected = "claves"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::claves; + std::string expected = "claves"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_guiro, Enums ) +TEST(Wood_guiro, Enums) { - WoodEnum e = WoodEnum::guiro; - std::string expected = "guiro"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::guiro; + std::string expected = "guiro"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_logDrum, Enums ) +TEST(Wood_logDrum, Enums) { - WoodEnum e = WoodEnum::logDrum; - std::string expected = "log drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::logDrum; + std::string expected = "log drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_maraca, Enums ) +TEST(Wood_maraca, Enums) { - WoodEnum e = WoodEnum::maraca; - std::string expected = "maraca"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::maraca; + std::string expected = "maraca"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_maracas, Enums ) +TEST(Wood_maracas, Enums) { - WoodEnum e = WoodEnum::maracas; - std::string expected = "maracas"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::maracas; + std::string expected = "maracas"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_ratchet, Enums ) +TEST(Wood_ratchet, Enums) { - WoodEnum e = WoodEnum::ratchet; - std::string expected = "ratchet"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::ratchet; + std::string expected = "ratchet"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_sandpaperBlocks, Enums ) +TEST(Wood_sandpaperBlocks, Enums) { - WoodEnum e = WoodEnum::sandpaperBlocks; - std::string expected = "sandpaper blocks"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::sandpaperBlocks; + std::string expected = "sandpaper blocks"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_slitDrum, Enums ) +TEST(Wood_slitDrum, Enums) { - WoodEnum e = WoodEnum::slitDrum; - std::string expected = "slit drum"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::slitDrum; + std::string expected = "slit drum"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_templeBlock, Enums ) +TEST(Wood_templeBlock, Enums) { - WoodEnum e = WoodEnum::templeBlock; - std::string expected = "temple block"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::templeBlock; + std::string expected = "temple block"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_vibraslap, Enums ) +TEST(Wood_vibraslap, Enums) { - WoodEnum e = WoodEnum::vibraslap; - std::string expected = "vibraslap"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::vibraslap; + std::string expected = "vibraslap"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Wood_woodBlock, Enums ) +TEST(Wood_woodBlock, Enums) { - WoodEnum e = WoodEnum::woodBlock; - std::string expected = "wood block"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + WoodEnum e = WoodEnum::woodBlock; + std::string expected = "wood block"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - WoodEnum e2 = parseWoodEnum( expected ); - CHECK_EQUAL( e, e2 ) + WoodEnum e2 = parseWoodEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( MarginType_BadParse, Enums ) +TEST(MarginType_BadParse, Enums) { - MarginType actual = parseMarginType( "odd" ); - MarginType expected = MarginType::odd; - CHECK_EQUAL( expected, actual ) + MarginType actual = parseMarginType("odd"); + MarginType expected = MarginType::odd; + CHECK_EQUAL(expected, actual) } -TEST( MarginType_odd, Enums ) +TEST(MarginType_odd, Enums) { - MarginType e = MarginType::odd; - std::string expected = "odd"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MarginType e = MarginType::odd; + std::string expected = "odd"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MarginType e2 = parseMarginType( expected ); - CHECK_EQUAL( e, e2 ) + MarginType e2 = parseMarginType(expected); + CHECK_EQUAL(e, e2) } -TEST( MarginType_even, Enums ) +TEST(MarginType_even, Enums) { - MarginType e = MarginType::even; - std::string expected = "even"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MarginType e = MarginType::even; + std::string expected = "even"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MarginType e2 = parseMarginType( expected ); - CHECK_EQUAL( e, e2 ) + MarginType e2 = parseMarginType(expected); + CHECK_EQUAL(e, e2) } -TEST( MarginType_both, Enums ) +TEST(MarginType_both, Enums) { - MarginType e = MarginType::both; - std::string expected = "both"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + MarginType e = MarginType::both; + std::string expected = "both"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - MarginType e2 = parseMarginType( expected ); - CHECK_EQUAL( e, e2 ) + MarginType e2 = parseMarginType(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteSizeType_BadParse, Enums ) +TEST(NoteSizeType_BadParse, Enums) { - NoteSizeType actual = parseNoteSizeType( "cue" ); - NoteSizeType expected = NoteSizeType::cue; - CHECK_EQUAL( expected, actual ) + NoteSizeType actual = parseNoteSizeType("cue"); + NoteSizeType expected = NoteSizeType::cue; + CHECK_EQUAL(expected, actual) } -TEST( NoteSizeType_cue, Enums ) +TEST(NoteSizeType_cue, Enums) { - NoteSizeType e = NoteSizeType::cue; - std::string expected = "cue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteSizeType e = NoteSizeType::cue; + std::string expected = "cue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteSizeType e2 = parseNoteSizeType( expected ); - CHECK_EQUAL( e, e2 ) + NoteSizeType e2 = parseNoteSizeType(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteSizeType_grace, Enums ) +TEST(NoteSizeType_grace, Enums) { - NoteSizeType e = NoteSizeType::grace; - std::string expected = "grace"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteSizeType e = NoteSizeType::grace; + std::string expected = "grace"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteSizeType e2 = parseNoteSizeType( expected ); - CHECK_EQUAL( e, e2 ) + NoteSizeType e2 = parseNoteSizeType(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteSizeType_large, Enums ) +TEST(NoteSizeType_large, Enums) { - NoteSizeType e = NoteSizeType::large; - std::string expected = "large"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteSizeType e = NoteSizeType::large; + std::string expected = "large"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteSizeType e2 = parseNoteSizeType( expected ); - CHECK_EQUAL( e, e2 ) + NoteSizeType e2 = parseNoteSizeType(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_BadParse, Enums ) +TEST(AccidentalValue_BadParse, Enums) { - AccidentalValue actual = parseAccidentalValue( "sharp" ); - AccidentalValue expected = AccidentalValue::sharp; - CHECK_EQUAL( expected, actual ) + AccidentalValue actual = parseAccidentalValue("sharp"); + AccidentalValue expected = AccidentalValue::sharp; + CHECK_EQUAL(expected, actual) } -TEST( AccidentalValue_sharp, Enums ) +TEST(AccidentalValue_sharp, Enums) { - AccidentalValue e = AccidentalValue::sharp; - std::string expected = "sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sharp; + std::string expected = "sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_natural, Enums ) +TEST(AccidentalValue_natural, Enums) { - AccidentalValue e = AccidentalValue::natural; - std::string expected = "natural"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::natural; + std::string expected = "natural"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_flat, Enums ) +TEST(AccidentalValue_flat, Enums) { - AccidentalValue e = AccidentalValue::flat; - std::string expected = "flat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::flat; + std::string expected = "flat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_doubleSharp, Enums ) +TEST(AccidentalValue_doubleSharp, Enums) { - AccidentalValue e = AccidentalValue::doubleSharp; - std::string expected = "double-sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::doubleSharp; + std::string expected = "double-sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_sharpSharp, Enums ) +TEST(AccidentalValue_sharpSharp, Enums) { - AccidentalValue e = AccidentalValue::sharpSharp; - std::string expected = "sharp-sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sharpSharp; + std::string expected = "sharp-sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_flatFlat, Enums ) +TEST(AccidentalValue_flatFlat, Enums) { - AccidentalValue e = AccidentalValue::flatFlat; - std::string expected = "flat-flat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::flatFlat; + std::string expected = "flat-flat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_naturalSharp, Enums ) +TEST(AccidentalValue_naturalSharp, Enums) { - AccidentalValue e = AccidentalValue::naturalSharp; - std::string expected = "natural-sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::naturalSharp; + std::string expected = "natural-sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_naturalFlat, Enums ) +TEST(AccidentalValue_naturalFlat, Enums) { - AccidentalValue e = AccidentalValue::naturalFlat; - std::string expected = "natural-flat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::naturalFlat; + std::string expected = "natural-flat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_quarterFlat, Enums ) +TEST(AccidentalValue_quarterFlat, Enums) { - AccidentalValue e = AccidentalValue::quarterFlat; - std::string expected = "quarter-flat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::quarterFlat; + std::string expected = "quarter-flat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_quarterSharp, Enums ) +TEST(AccidentalValue_quarterSharp, Enums) { - AccidentalValue e = AccidentalValue::quarterSharp; - std::string expected = "quarter-sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::quarterSharp; + std::string expected = "quarter-sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_threeQuartersFlat, Enums ) +TEST(AccidentalValue_threeQuartersFlat, Enums) { - AccidentalValue e = AccidentalValue::threeQuartersFlat; - std::string expected = "three-quarters-flat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::threeQuartersFlat; + std::string expected = "three-quarters-flat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_threeQuartersSharp, Enums ) +TEST(AccidentalValue_threeQuartersSharp, Enums) { - AccidentalValue e = AccidentalValue::threeQuartersSharp; - std::string expected = "three-quarters-sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::threeQuartersSharp; + std::string expected = "three-quarters-sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_sharpDown, Enums ) +TEST(AccidentalValue_sharpDown, Enums) { - AccidentalValue e = AccidentalValue::sharpDown; - std::string expected = "sharp-down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sharpDown; + std::string expected = "sharp-down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_sharpUp, Enums ) +TEST(AccidentalValue_sharpUp, Enums) { - AccidentalValue e = AccidentalValue::sharpUp; - std::string expected = "sharp-up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sharpUp; + std::string expected = "sharp-up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_naturalDown, Enums ) +TEST(AccidentalValue_naturalDown, Enums) { - AccidentalValue e = AccidentalValue::naturalDown; - std::string expected = "natural-down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::naturalDown; + std::string expected = "natural-down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_naturalUp, Enums ) +TEST(AccidentalValue_naturalUp, Enums) { - AccidentalValue e = AccidentalValue::naturalUp; - std::string expected = "natural-up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::naturalUp; + std::string expected = "natural-up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_flatDown, Enums ) +TEST(AccidentalValue_flatDown, Enums) { - AccidentalValue e = AccidentalValue::flatDown; - std::string expected = "flat-down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::flatDown; + std::string expected = "flat-down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_flatUp, Enums ) +TEST(AccidentalValue_flatUp, Enums) { - AccidentalValue e = AccidentalValue::flatUp; - std::string expected = "flat-up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::flatUp; + std::string expected = "flat-up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_tripleSharp, Enums ) +TEST(AccidentalValue_tripleSharp, Enums) { - AccidentalValue e = AccidentalValue::tripleSharp; - std::string expected = "triple-sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::tripleSharp; + std::string expected = "triple-sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_tripleFlat, Enums ) +TEST(AccidentalValue_tripleFlat, Enums) { - AccidentalValue e = AccidentalValue::tripleFlat; - std::string expected = "triple-flat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::tripleFlat; + std::string expected = "triple-flat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_slashQuarterSharp, Enums ) +TEST(AccidentalValue_slashQuarterSharp, Enums) { - AccidentalValue e = AccidentalValue::slashQuarterSharp; - std::string expected = "slash-quarter-sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::slashQuarterSharp; + std::string expected = "slash-quarter-sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_slashSharp, Enums ) +TEST(AccidentalValue_slashSharp, Enums) { - AccidentalValue e = AccidentalValue::slashSharp; - std::string expected = "slash-sharp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::slashSharp; + std::string expected = "slash-sharp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_slashFlat, Enums ) +TEST(AccidentalValue_slashFlat, Enums) { - AccidentalValue e = AccidentalValue::slashFlat; - std::string expected = "slash-flat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::slashFlat; + std::string expected = "slash-flat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_doubleSlashFlat, Enums ) +TEST(AccidentalValue_doubleSlashFlat, Enums) { - AccidentalValue e = AccidentalValue::doubleSlashFlat; - std::string expected = "double-slash-flat"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::doubleSlashFlat; + std::string expected = "double-slash-flat"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_sharp1, Enums ) +TEST(AccidentalValue_sharp1, Enums) { - AccidentalValue e = AccidentalValue::sharp1; - std::string expected = "sharp-1"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sharp1; + std::string expected = "sharp-1"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_sharp2, Enums ) +TEST(AccidentalValue_sharp2, Enums) { - AccidentalValue e = AccidentalValue::sharp2; - std::string expected = "sharp-2"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sharp2; + std::string expected = "sharp-2"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_sharp3, Enums ) +TEST(AccidentalValue_sharp3, Enums) { - AccidentalValue e = AccidentalValue::sharp3; - std::string expected = "sharp-3"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sharp3; + std::string expected = "sharp-3"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_sharp5, Enums ) +TEST(AccidentalValue_sharp5, Enums) { - AccidentalValue e = AccidentalValue::sharp5; - std::string expected = "sharp-5"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sharp5; + std::string expected = "sharp-5"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_flat1, Enums ) +TEST(AccidentalValue_flat1, Enums) { - AccidentalValue e = AccidentalValue::flat1; - std::string expected = "flat-1"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::flat1; + std::string expected = "flat-1"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_flat2, Enums ) +TEST(AccidentalValue_flat2, Enums) { - AccidentalValue e = AccidentalValue::flat2; - std::string expected = "flat-2"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::flat2; + std::string expected = "flat-2"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_flat3, Enums ) +TEST(AccidentalValue_flat3, Enums) { - AccidentalValue e = AccidentalValue::flat3; - std::string expected = "flat-3"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::flat3; + std::string expected = "flat-3"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_flat4, Enums ) +TEST(AccidentalValue_flat4, Enums) { - AccidentalValue e = AccidentalValue::flat4; - std::string expected = "flat-4"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::flat4; + std::string expected = "flat-4"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_sori, Enums ) +TEST(AccidentalValue_sori, Enums) { - AccidentalValue e = AccidentalValue::sori; - std::string expected = "sori"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::sori; + std::string expected = "sori"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( AccidentalValue_koron, Enums ) +TEST(AccidentalValue_koron, Enums) { - AccidentalValue e = AccidentalValue::koron; - std::string expected = "koron"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + AccidentalValue e = AccidentalValue::koron; + std::string expected = "koron"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - AccidentalValue e2 = parseAccidentalValue( expected ); - CHECK_EQUAL( e, e2 ) + AccidentalValue e2 = parseAccidentalValue(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_BadParse, Enums ) +TEST(ArrowDirectionEnum_BadParse, Enums) { - ArrowDirectionEnum actual = parseArrowDirectionEnum( "left" ); - ArrowDirectionEnum expected = ArrowDirectionEnum::left; - CHECK_EQUAL( expected, actual ) + ArrowDirectionEnum actual = parseArrowDirectionEnum("left"); + ArrowDirectionEnum expected = ArrowDirectionEnum::left; + CHECK_EQUAL(expected, actual) } -TEST( ArrowDirectionEnum_left, Enums ) +TEST(ArrowDirectionEnum_left, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::left; - std::string expected = "left"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::left; + std::string expected = "left"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_up, Enums ) +TEST(ArrowDirectionEnum_up, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::up; - std::string expected = "up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::up; + std::string expected = "up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_right, Enums ) +TEST(ArrowDirectionEnum_right, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::right; - std::string expected = "right"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::right; + std::string expected = "right"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_down, Enums ) +TEST(ArrowDirectionEnum_down, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::down; - std::string expected = "down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::down; + std::string expected = "down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_northwest, Enums ) +TEST(ArrowDirectionEnum_northwest, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::northwest; - std::string expected = "northwest"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::northwest; + std::string expected = "northwest"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_northeast, Enums ) +TEST(ArrowDirectionEnum_northeast, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::northeast; - std::string expected = "northeast"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::northeast; + std::string expected = "northeast"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_southeast, Enums ) +TEST(ArrowDirectionEnum_southeast, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::southeast; - std::string expected = "southeast"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::southeast; + std::string expected = "southeast"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_southwest, Enums ) +TEST(ArrowDirectionEnum_southwest, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::southwest; - std::string expected = "southwest"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::southwest; + std::string expected = "southwest"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_leftRight, Enums ) +TEST(ArrowDirectionEnum_leftRight, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::leftRight; - std::string expected = "left right"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::leftRight; + std::string expected = "left right"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_upDown, Enums ) +TEST(ArrowDirectionEnum_upDown, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::upDown; - std::string expected = "up down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::upDown; + std::string expected = "up down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_northwestSoutheast, Enums ) +TEST(ArrowDirectionEnum_northwestSoutheast, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::northwestSoutheast; - std::string expected = "northwest southeast"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::northwestSoutheast; + std::string expected = "northwest southeast"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_northeastSouthwest, Enums ) +TEST(ArrowDirectionEnum_northeastSouthwest, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::northeastSouthwest; - std::string expected = "northeast southwest"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::northeastSouthwest; + std::string expected = "northeast southwest"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowDirectionEnum_other, Enums ) +TEST(ArrowDirectionEnum_other, Enums) { - ArrowDirectionEnum e = ArrowDirectionEnum::other; - std::string expected = "other"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowDirectionEnum e = ArrowDirectionEnum::other; + std::string expected = "other"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowDirectionEnum e2 = parseArrowDirectionEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowDirectionEnum e2 = parseArrowDirectionEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowStyle_BadParse, Enums ) +TEST(ArrowStyle_BadParse, Enums) { - ArrowStyleEnum actual = parseArrowStyleEnum( "single" ); - ArrowStyleEnum expected = ArrowStyleEnum::single; - CHECK_EQUAL( expected, actual ) + ArrowStyleEnum actual = parseArrowStyleEnum("single"); + ArrowStyleEnum expected = ArrowStyleEnum::single; + CHECK_EQUAL(expected, actual) } -TEST( ArrowStyle_single, Enums ) +TEST(ArrowStyle_single, Enums) { - ArrowStyleEnum e = ArrowStyleEnum::single; - std::string expected = "single"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowStyleEnum e = ArrowStyleEnum::single; + std::string expected = "single"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowStyleEnum e2 = parseArrowStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowStyleEnum e2 = parseArrowStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowStyle_double_, Enums ) +TEST(ArrowStyle_double_, Enums) { - ArrowStyleEnum e = ArrowStyleEnum::double_; - std::string expected = "double"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowStyleEnum e = ArrowStyleEnum::double_; + std::string expected = "double"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowStyleEnum e2 = parseArrowStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowStyleEnum e2 = parseArrowStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowStyle_filled, Enums ) +TEST(ArrowStyle_filled, Enums) { - ArrowStyleEnum e = ArrowStyleEnum::filled; - std::string expected = "filled"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowStyleEnum e = ArrowStyleEnum::filled; + std::string expected = "filled"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowStyleEnum e2 = parseArrowStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowStyleEnum e2 = parseArrowStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowStyle_hollow, Enums ) +TEST(ArrowStyle_hollow, Enums) { - ArrowStyleEnum e = ArrowStyleEnum::hollow; - std::string expected = "hollow"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowStyleEnum e = ArrowStyleEnum::hollow; + std::string expected = "hollow"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowStyleEnum e2 = parseArrowStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowStyleEnum e2 = parseArrowStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowStyle_paired, Enums ) +TEST(ArrowStyle_paired, Enums) { - ArrowStyleEnum e = ArrowStyleEnum::paired; - std::string expected = "paired"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowStyleEnum e = ArrowStyleEnum::paired; + std::string expected = "paired"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowStyleEnum e2 = parseArrowStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowStyleEnum e2 = parseArrowStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowStyle_combined, Enums ) +TEST(ArrowStyle_combined, Enums) { - ArrowStyleEnum e = ArrowStyleEnum::combined; - std::string expected = "combined"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowStyleEnum e = ArrowStyleEnum::combined; + std::string expected = "combined"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowStyleEnum e2 = parseArrowStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowStyleEnum e2 = parseArrowStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( ArrowStyle_other, Enums ) +TEST(ArrowStyle_other, Enums) { - ArrowStyleEnum e = ArrowStyleEnum::other; - std::string expected = "other"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ArrowStyleEnum e = ArrowStyleEnum::other; + std::string expected = "other"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ArrowStyleEnum e2 = parseArrowStyleEnum( expected ); - CHECK_EQUAL( e, e2 ) + ArrowStyleEnum e2 = parseArrowStyleEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( BeamValue_BadParse, Enums ) +TEST(BeamValue_BadParse, Enums) { - BeamValue actual = parseBeamValue( "begin" ); - BeamValue expected = BeamValue::begin; - CHECK_EQUAL( expected, actual ) + BeamValue actual = parseBeamValue("begin"); + BeamValue expected = BeamValue::begin; + CHECK_EQUAL(expected, actual) } -TEST( BeamValue_begin, Enums ) +TEST(BeamValue_begin, Enums) { - BeamValue e = BeamValue::begin; - std::string expected = "begin"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeamValue e = BeamValue::begin; + std::string expected = "begin"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeamValue e2 = parseBeamValue( expected ); - CHECK_EQUAL( e, e2 ) + BeamValue e2 = parseBeamValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeamValue_continue_, Enums ) +TEST(BeamValue_continue_, Enums) { - BeamValue e = BeamValue::continue_; - std::string expected = "continue"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeamValue e = BeamValue::continue_; + std::string expected = "continue"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeamValue e2 = parseBeamValue( expected ); - CHECK_EQUAL( e, e2 ) + BeamValue e2 = parseBeamValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeamValue_end, Enums ) +TEST(BeamValue_end, Enums) { - BeamValue e = BeamValue::end; - std::string expected = "end"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeamValue e = BeamValue::end; + std::string expected = "end"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeamValue e2 = parseBeamValue( expected ); - CHECK_EQUAL( e, e2 ) + BeamValue e2 = parseBeamValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeamValue_forwardHook, Enums ) +TEST(BeamValue_forwardHook, Enums) { - BeamValue e = BeamValue::forwardHook; - std::string expected = "forward hook"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeamValue e = BeamValue::forwardHook; + std::string expected = "forward hook"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeamValue e2 = parseBeamValue( expected ); - CHECK_EQUAL( e, e2 ) + BeamValue e2 = parseBeamValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BeamValue_backwardHook, Enums ) +TEST(BeamValue_backwardHook, Enums) { - BeamValue e = BeamValue::backwardHook; - std::string expected = "backward hook"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BeamValue e = BeamValue::backwardHook; + std::string expected = "backward hook"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BeamValue e2 = parseBeamValue( expected ); - CHECK_EQUAL( e, e2 ) + BeamValue e2 = parseBeamValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BreathMarkValue_BadParse, Enums ) +TEST(BreathMarkValue_BadParse, Enums) { - BreathMarkValue actual = parseBreathMarkValue( "" ); - BreathMarkValue expected = BreathMarkValue::emptystring; - CHECK_EQUAL( expected, actual ) + BreathMarkValue actual = parseBreathMarkValue(""); + BreathMarkValue expected = BreathMarkValue::emptystring; + CHECK_EQUAL(expected, actual) } -TEST( BreathMarkValue_emptystring, Enums ) +TEST(BreathMarkValue_emptystring, Enums) { - BreathMarkValue e = BreathMarkValue::emptystring; - std::string expected = ""; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BreathMarkValue e = BreathMarkValue::emptystring; + std::string expected = ""; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BreathMarkValue e2 = parseBreathMarkValue( expected ); - CHECK_EQUAL( e, e2 ) + BreathMarkValue e2 = parseBreathMarkValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BreathMarkValue_comma, Enums ) +TEST(BreathMarkValue_comma, Enums) { - BreathMarkValue e = BreathMarkValue::comma; - std::string expected = "comma"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BreathMarkValue e = BreathMarkValue::comma; + std::string expected = "comma"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BreathMarkValue e2 = parseBreathMarkValue( expected ); - CHECK_EQUAL( e, e2 ) + BreathMarkValue e2 = parseBreathMarkValue(expected); + CHECK_EQUAL(e, e2) } -TEST( BreathMarkValue_tick, Enums ) +TEST(BreathMarkValue_tick, Enums) { - BreathMarkValue e = BreathMarkValue::tick; - std::string expected = "tick"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + BreathMarkValue e = BreathMarkValue::tick; + std::string expected = "tick"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - BreathMarkValue e2 = parseBreathMarkValue( expected ); - CHECK_EQUAL( e, e2 ) + BreathMarkValue e2 = parseBreathMarkValue(expected); + CHECK_EQUAL(e, e2) } -TEST( CircularArrow_BadParse, Enums ) +TEST(CircularArrow_BadParse, Enums) { - CircularArrowEnum actual = parseCircularArrowEnum( "clockwise" ); - CircularArrowEnum expected = CircularArrowEnum::clockwise; - CHECK_EQUAL( expected, actual ) + CircularArrowEnum actual = parseCircularArrowEnum("clockwise"); + CircularArrowEnum expected = CircularArrowEnum::clockwise; + CHECK_EQUAL(expected, actual) } -TEST( CircularArrow_clockwise, Enums ) +TEST(CircularArrow_clockwise, Enums) { - CircularArrowEnum e = CircularArrowEnum::clockwise; - std::string expected = "clockwise"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CircularArrowEnum e = CircularArrowEnum::clockwise; + std::string expected = "clockwise"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CircularArrowEnum e2 = parseCircularArrowEnum( expected ); - CHECK_EQUAL( e, e2 ) + CircularArrowEnum e2 = parseCircularArrowEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( CircularArrow_anticlockwise, Enums ) +TEST(CircularArrow_anticlockwise, Enums) { - CircularArrowEnum e = CircularArrowEnum::anticlockwise; - std::string expected = "anticlockwise"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + CircularArrowEnum e = CircularArrowEnum::anticlockwise; + std::string expected = "anticlockwise"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - CircularArrowEnum e2 = parseCircularArrowEnum( expected ); - CHECK_EQUAL( e, e2 ) + CircularArrowEnum e2 = parseCircularArrowEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Fan_BadParse, Enums ) +TEST(Fan_BadParse, Enums) { - Fan actual = parseFan( "accel" ); - Fan expected = Fan::accel; - CHECK_EQUAL( expected, actual ) + Fan actual = parseFan("accel"); + Fan expected = Fan::accel; + CHECK_EQUAL(expected, actual) } -TEST( Fan_accel, Enums ) +TEST(Fan_accel, Enums) { - Fan e = Fan::accel; - std::string expected = "accel"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Fan e = Fan::accel; + std::string expected = "accel"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Fan e2 = parseFan( expected ); - CHECK_EQUAL( e, e2 ) + Fan e2 = parseFan(expected); + CHECK_EQUAL(e, e2) } -TEST( Fan_rit, Enums ) +TEST(Fan_rit, Enums) { - Fan e = Fan::rit; - std::string expected = "rit"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Fan e = Fan::rit; + std::string expected = "rit"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Fan e2 = parseFan( expected ); - CHECK_EQUAL( e, e2 ) + Fan e2 = parseFan(expected); + CHECK_EQUAL(e, e2) } -TEST( Fan_none, Enums ) +TEST(Fan_none, Enums) { - Fan e = Fan::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + Fan e = Fan::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - Fan e2 = parseFan( expected ); - CHECK_EQUAL( e, e2 ) + Fan e2 = parseFan(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_BadParse, Enums ) +TEST(HandbellValue_BadParse, Enums) { - HandbellValue actual = parseHandbellValue( "damp" ); - HandbellValue expected = HandbellValue::damp; - CHECK_EQUAL( expected, actual ) + HandbellValue actual = parseHandbellValue("damp"); + HandbellValue expected = HandbellValue::damp; + CHECK_EQUAL(expected, actual) } -TEST( HandbellValue_damp, Enums ) +TEST(HandbellValue_damp, Enums) { - HandbellValue e = HandbellValue::damp; - std::string expected = "damp"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::damp; + std::string expected = "damp"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_echo, Enums ) +TEST(HandbellValue_echo, Enums) { - HandbellValue e = HandbellValue::echo; - std::string expected = "echo"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::echo; + std::string expected = "echo"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_gyro, Enums ) +TEST(HandbellValue_gyro, Enums) { - HandbellValue e = HandbellValue::gyro; - std::string expected = "gyro"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::gyro; + std::string expected = "gyro"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_handMartellato, Enums ) +TEST(HandbellValue_handMartellato, Enums) { - HandbellValue e = HandbellValue::handMartellato; - std::string expected = "hand martellato"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::handMartellato; + std::string expected = "hand martellato"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_malletLift, Enums ) +TEST(HandbellValue_malletLift, Enums) { - HandbellValue e = HandbellValue::malletLift; - std::string expected = "mallet lift"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::malletLift; + std::string expected = "mallet lift"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_malletTable, Enums ) +TEST(HandbellValue_malletTable, Enums) { - HandbellValue e = HandbellValue::malletTable; - std::string expected = "mallet table"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::malletTable; + std::string expected = "mallet table"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_martellato, Enums ) +TEST(HandbellValue_martellato, Enums) { - HandbellValue e = HandbellValue::martellato; - std::string expected = "martellato"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::martellato; + std::string expected = "martellato"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_martellatoLift, Enums ) +TEST(HandbellValue_martellatoLift, Enums) { - HandbellValue e = HandbellValue::martellatoLift; - std::string expected = "martellato lift"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::martellatoLift; + std::string expected = "martellato lift"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_mutedMartellato, Enums ) +TEST(HandbellValue_mutedMartellato, Enums) { - HandbellValue e = HandbellValue::mutedMartellato; - std::string expected = "muted martellato"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::mutedMartellato; + std::string expected = "muted martellato"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_pluckLift, Enums ) +TEST(HandbellValue_pluckLift, Enums) { - HandbellValue e = HandbellValue::pluckLift; - std::string expected = "pluck lift"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::pluckLift; + std::string expected = "pluck lift"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HandbellValue_swing, Enums ) +TEST(HandbellValue_swing, Enums) { - HandbellValue e = HandbellValue::swing; - std::string expected = "swing"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HandbellValue e = HandbellValue::swing; + std::string expected = "swing"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HandbellValue e2 = parseHandbellValue( expected ); - CHECK_EQUAL( e, e2 ) + HandbellValue e2 = parseHandbellValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HoleClosedLocation_BadParse, Enums ) +TEST(HoleClosedLocation_BadParse, Enums) { - HoleClosedLocation actual = parseHoleClosedLocation( "right" ); - HoleClosedLocation expected = HoleClosedLocation::right; - CHECK_EQUAL( expected, actual ) + HoleClosedLocation actual = parseHoleClosedLocation("right"); + HoleClosedLocation expected = HoleClosedLocation::right; + CHECK_EQUAL(expected, actual) } -TEST( HoleClosedLocation_right, Enums ) +TEST(HoleClosedLocation_right, Enums) { - HoleClosedLocation e = HoleClosedLocation::right; - std::string expected = "right"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HoleClosedLocation e = HoleClosedLocation::right; + std::string expected = "right"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HoleClosedLocation e2 = parseHoleClosedLocation( expected ); - CHECK_EQUAL( e, e2 ) + HoleClosedLocation e2 = parseHoleClosedLocation(expected); + CHECK_EQUAL(e, e2) } -TEST( HoleClosedLocation_bottom, Enums ) +TEST(HoleClosedLocation_bottom, Enums) { - HoleClosedLocation e = HoleClosedLocation::bottom; - std::string expected = "bottom"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HoleClosedLocation e = HoleClosedLocation::bottom; + std::string expected = "bottom"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HoleClosedLocation e2 = parseHoleClosedLocation( expected ); - CHECK_EQUAL( e, e2 ) + HoleClosedLocation e2 = parseHoleClosedLocation(expected); + CHECK_EQUAL(e, e2) } -TEST( HoleClosedLocation_left, Enums ) +TEST(HoleClosedLocation_left, Enums) { - HoleClosedLocation e = HoleClosedLocation::left; - std::string expected = "left"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HoleClosedLocation e = HoleClosedLocation::left; + std::string expected = "left"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HoleClosedLocation e2 = parseHoleClosedLocation( expected ); - CHECK_EQUAL( e, e2 ) + HoleClosedLocation e2 = parseHoleClosedLocation(expected); + CHECK_EQUAL(e, e2) } -TEST( HoleClosedLocation_top, Enums ) +TEST(HoleClosedLocation_top, Enums) { - HoleClosedLocation e = HoleClosedLocation::top; - std::string expected = "top"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HoleClosedLocation e = HoleClosedLocation::top; + std::string expected = "top"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HoleClosedLocation e2 = parseHoleClosedLocation( expected ); - CHECK_EQUAL( e, e2 ) + HoleClosedLocation e2 = parseHoleClosedLocation(expected); + CHECK_EQUAL(e, e2) } -TEST( HoleClosedValue_BadParse, Enums ) +TEST(HoleClosedValue_BadParse, Enums) { - HoleClosedValue actual = parseHoleClosedValue( "yes" ); - HoleClosedValue expected = HoleClosedValue::yes; - CHECK_EQUAL( expected, actual ) + HoleClosedValue actual = parseHoleClosedValue("yes"); + HoleClosedValue expected = HoleClosedValue::yes; + CHECK_EQUAL(expected, actual) } -TEST( HoleClosedValue_yes, Enums ) +TEST(HoleClosedValue_yes, Enums) { - HoleClosedValue e = HoleClosedValue::yes; - std::string expected = "yes"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HoleClosedValue e = HoleClosedValue::yes; + std::string expected = "yes"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HoleClosedValue e2 = parseHoleClosedValue( expected ); - CHECK_EQUAL( e, e2 ) + HoleClosedValue e2 = parseHoleClosedValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HoleClosedValue_no, Enums ) +TEST(HoleClosedValue_no, Enums) { - HoleClosedValue e = HoleClosedValue::no; - std::string expected = "no"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HoleClosedValue e = HoleClosedValue::no; + std::string expected = "no"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HoleClosedValue e2 = parseHoleClosedValue( expected ); - CHECK_EQUAL( e, e2 ) + HoleClosedValue e2 = parseHoleClosedValue(expected); + CHECK_EQUAL(e, e2) } -TEST( HoleClosedValue_half, Enums ) +TEST(HoleClosedValue_half, Enums) { - HoleClosedValue e = HoleClosedValue::half; - std::string expected = "half"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + HoleClosedValue e = HoleClosedValue::half; + std::string expected = "half"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - HoleClosedValue e2 = parseHoleClosedValue( expected ); - CHECK_EQUAL( e, e2 ) + HoleClosedValue e2 = parseHoleClosedValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_BadParse, Enums ) +TEST(NoteTypeValue_BadParse, Enums) { - NoteTypeValue actual = parseNoteTypeValue( "1024th" ); - NoteTypeValue expected = NoteTypeValue::oneThousandTwentyFourth; - CHECK_EQUAL( expected, actual ) + NoteTypeValue actual = parseNoteTypeValue("1024th"); + NoteTypeValue expected = NoteTypeValue::oneThousandTwentyFourth; + CHECK_EQUAL(expected, actual) } -TEST( NoteTypeValue_oneThousandTwentyFourth, Enums ) +TEST(NoteTypeValue_oneThousandTwentyFourth, Enums) { - NoteTypeValue e = NoteTypeValue::oneThousandTwentyFourth; - std::string expected = "1024th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::oneThousandTwentyFourth; + std::string expected = "1024th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_fiveHundredTwelfth, Enums ) +TEST(NoteTypeValue_fiveHundredTwelfth, Enums) { - NoteTypeValue e = NoteTypeValue::fiveHundredTwelfth; - std::string expected = "512th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::fiveHundredTwelfth; + std::string expected = "512th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_twoHundredFifthySixth, Enums ) +TEST(NoteTypeValue_twoHundredFifthySixth, Enums) { - NoteTypeValue e = NoteTypeValue::twoHundredFifthySixth; - std::string expected = "256th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::twoHundredFifthySixth; + std::string expected = "256th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_oneHundredTwentyEighth, Enums ) +TEST(NoteTypeValue_oneHundredTwentyEighth, Enums) { - NoteTypeValue e = NoteTypeValue::oneHundredTwentyEighth; - std::string expected = "128th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::oneHundredTwentyEighth; + std::string expected = "128th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_sixtyFourth, Enums ) +TEST(NoteTypeValue_sixtyFourth, Enums) { - NoteTypeValue e = NoteTypeValue::sixtyFourth; - std::string expected = "64th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::sixtyFourth; + std::string expected = "64th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_thirtySecond, Enums ) +TEST(NoteTypeValue_thirtySecond, Enums) { - NoteTypeValue e = NoteTypeValue::thirtySecond; - std::string expected = "32nd"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::thirtySecond; + std::string expected = "32nd"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_sixteenth, Enums ) +TEST(NoteTypeValue_sixteenth, Enums) { - NoteTypeValue e = NoteTypeValue::sixteenth; - std::string expected = "16th"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::sixteenth; + std::string expected = "16th"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_eighth, Enums ) +TEST(NoteTypeValue_eighth, Enums) { - NoteTypeValue e = NoteTypeValue::eighth; - std::string expected = "eighth"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::eighth; + std::string expected = "eighth"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_quarter, Enums ) +TEST(NoteTypeValue_quarter, Enums) { - NoteTypeValue e = NoteTypeValue::quarter; - std::string expected = "quarter"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::quarter; + std::string expected = "quarter"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_half, Enums ) +TEST(NoteTypeValue_half, Enums) { - NoteTypeValue e = NoteTypeValue::half; - std::string expected = "half"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::half; + std::string expected = "half"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_whole, Enums ) +TEST(NoteTypeValue_whole, Enums) { - NoteTypeValue e = NoteTypeValue::whole; - std::string expected = "whole"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::whole; + std::string expected = "whole"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_breve, Enums ) +TEST(NoteTypeValue_breve, Enums) { - NoteTypeValue e = NoteTypeValue::breve; - std::string expected = "breve"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::breve; + std::string expected = "breve"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_long_, Enums ) +TEST(NoteTypeValue_long_, Enums) { - NoteTypeValue e = NoteTypeValue::long_; - std::string expected = "long"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::long_; + std::string expected = "long"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteTypeValue_maxima, Enums ) +TEST(NoteTypeValue_maxima, Enums) { - NoteTypeValue e = NoteTypeValue::maxima; - std::string expected = "maxima"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteTypeValue e = NoteTypeValue::maxima; + std::string expected = "maxima"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteTypeValue e2 = parseNoteTypeValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteTypeValue e2 = parseNoteTypeValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_BadParse, Enums ) +TEST(NoteheadValue_BadParse, Enums) { - NoteheadValue actual = parseNoteheadValue( "slash" ); - NoteheadValue expected = NoteheadValue::slash; - CHECK_EQUAL( expected, actual ) + NoteheadValue actual = parseNoteheadValue("slash"); + NoteheadValue expected = NoteheadValue::slash; + CHECK_EQUAL(expected, actual) } -TEST( NoteheadValue_slash, Enums ) +TEST(NoteheadValue_slash, Enums) { - NoteheadValue e = NoteheadValue::slash; - std::string expected = "slash"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::slash; + std::string expected = "slash"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_triangle, Enums ) +TEST(NoteheadValue_triangle, Enums) { - NoteheadValue e = NoteheadValue::triangle; - std::string expected = "triangle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::triangle; + std::string expected = "triangle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_diamond, Enums ) +TEST(NoteheadValue_diamond, Enums) { - NoteheadValue e = NoteheadValue::diamond; - std::string expected = "diamond"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::diamond; + std::string expected = "diamond"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_square, Enums ) +TEST(NoteheadValue_square, Enums) { - NoteheadValue e = NoteheadValue::square; - std::string expected = "square"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::square; + std::string expected = "square"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_cross, Enums ) +TEST(NoteheadValue_cross, Enums) { - NoteheadValue e = NoteheadValue::cross; - std::string expected = "cross"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::cross; + std::string expected = "cross"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_x, Enums ) +TEST(NoteheadValue_x, Enums) { - NoteheadValue e = NoteheadValue::x; - std::string expected = "x"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::x; + std::string expected = "x"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_circleX, Enums ) +TEST(NoteheadValue_circleX, Enums) { - NoteheadValue e = NoteheadValue::circleX; - std::string expected = "circle-x"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::circleX; + std::string expected = "circle-x"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_invertedTriangle, Enums ) +TEST(NoteheadValue_invertedTriangle, Enums) { - NoteheadValue e = NoteheadValue::invertedTriangle; - std::string expected = "inverted triangle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::invertedTriangle; + std::string expected = "inverted triangle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_arrowDown, Enums ) +TEST(NoteheadValue_arrowDown, Enums) { - NoteheadValue e = NoteheadValue::arrowDown; - std::string expected = "arrow down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::arrowDown; + std::string expected = "arrow down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_arrowUp, Enums ) +TEST(NoteheadValue_arrowUp, Enums) { - NoteheadValue e = NoteheadValue::arrowUp; - std::string expected = "arrow up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::arrowUp; + std::string expected = "arrow up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_slashed, Enums ) +TEST(NoteheadValue_slashed, Enums) { - NoteheadValue e = NoteheadValue::slashed; - std::string expected = "slashed"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::slashed; + std::string expected = "slashed"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_backSlashed, Enums ) +TEST(NoteheadValue_backSlashed, Enums) { - NoteheadValue e = NoteheadValue::backSlashed; - std::string expected = "back slashed"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::backSlashed; + std::string expected = "back slashed"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_normal, Enums ) +TEST(NoteheadValue_normal, Enums) { - NoteheadValue e = NoteheadValue::normal; - std::string expected = "normal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::normal; + std::string expected = "normal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_cluster, Enums ) +TEST(NoteheadValue_cluster, Enums) { - NoteheadValue e = NoteheadValue::cluster; - std::string expected = "cluster"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::cluster; + std::string expected = "cluster"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_circleDot, Enums ) +TEST(NoteheadValue_circleDot, Enums) { - NoteheadValue e = NoteheadValue::circleDot; - std::string expected = "circle dot"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::circleDot; + std::string expected = "circle dot"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_leftTriangle, Enums ) +TEST(NoteheadValue_leftTriangle, Enums) { - NoteheadValue e = NoteheadValue::leftTriangle; - std::string expected = "left triangle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::leftTriangle; + std::string expected = "left triangle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_rectangle, Enums ) +TEST(NoteheadValue_rectangle, Enums) { - NoteheadValue e = NoteheadValue::rectangle; - std::string expected = "rectangle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::rectangle; + std::string expected = "rectangle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_none, Enums ) +TEST(NoteheadValue_none, Enums) { - NoteheadValue e = NoteheadValue::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_do_, Enums ) +TEST(NoteheadValue_do_, Enums) { - NoteheadValue e = NoteheadValue::do_; - std::string expected = "do"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::do_; + std::string expected = "do"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_re, Enums ) +TEST(NoteheadValue_re, Enums) { - NoteheadValue e = NoteheadValue::re; - std::string expected = "re"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::re; + std::string expected = "re"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_mi, Enums ) +TEST(NoteheadValue_mi, Enums) { - NoteheadValue e = NoteheadValue::mi; - std::string expected = "mi"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::mi; + std::string expected = "mi"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_fa, Enums ) +TEST(NoteheadValue_fa, Enums) { - NoteheadValue e = NoteheadValue::fa; - std::string expected = "fa"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::fa; + std::string expected = "fa"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_faUp, Enums ) +TEST(NoteheadValue_faUp, Enums) { - NoteheadValue e = NoteheadValue::faUp; - std::string expected = "fa up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::faUp; + std::string expected = "fa up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_so, Enums ) +TEST(NoteheadValue_so, Enums) { - NoteheadValue e = NoteheadValue::so; - std::string expected = "so"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::so; + std::string expected = "so"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_la, Enums ) +TEST(NoteheadValue_la, Enums) { - NoteheadValue e = NoteheadValue::la; - std::string expected = "la"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::la; + std::string expected = "la"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( NoteheadValue_ti, Enums ) +TEST(NoteheadValue_ti, Enums) { - NoteheadValue e = NoteheadValue::ti; - std::string expected = "ti"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + NoteheadValue e = NoteheadValue::ti; + std::string expected = "ti"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - NoteheadValue e2 = parseNoteheadValue( expected ); - CHECK_EQUAL( e, e2 ) + NoteheadValue e2 = parseNoteheadValue(expected); + CHECK_EQUAL(e, e2) } -TEST( ShowTuplet_BadParse, Enums ) +TEST(ShowTuplet_BadParse, Enums) { - ShowTuplet actual = parseShowTuplet( "actual" ); - ShowTuplet expected = ShowTuplet::actual; - CHECK_EQUAL( expected, actual ) + ShowTuplet actual = parseShowTuplet("actual"); + ShowTuplet expected = ShowTuplet::actual; + CHECK_EQUAL(expected, actual) } -TEST( ShowTuplet_actual, Enums ) +TEST(ShowTuplet_actual, Enums) { - ShowTuplet e = ShowTuplet::actual; - std::string expected = "actual"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ShowTuplet e = ShowTuplet::actual; + std::string expected = "actual"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ShowTuplet e2 = parseShowTuplet( expected ); - CHECK_EQUAL( e, e2 ) + ShowTuplet e2 = parseShowTuplet(expected); + CHECK_EQUAL(e, e2) } -TEST( ShowTuplet_both, Enums ) +TEST(ShowTuplet_both, Enums) { - ShowTuplet e = ShowTuplet::both; - std::string expected = "both"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ShowTuplet e = ShowTuplet::both; + std::string expected = "both"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ShowTuplet e2 = parseShowTuplet( expected ); - CHECK_EQUAL( e, e2 ) + ShowTuplet e2 = parseShowTuplet(expected); + CHECK_EQUAL(e, e2) } -TEST( ShowTuplet_none, Enums ) +TEST(ShowTuplet_none, Enums) { - ShowTuplet e = ShowTuplet::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + ShowTuplet e = ShowTuplet::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - ShowTuplet e2 = parseShowTuplet( expected ); - CHECK_EQUAL( e, e2 ) + ShowTuplet e2 = parseShowTuplet(expected); + CHECK_EQUAL(e, e2) } -TEST( StemValue_BadParse, Enums ) +TEST(StemValue_BadParse, Enums) { - StemValue actual = parseStemValue( "down" ); - StemValue expected = StemValue::down; - CHECK_EQUAL( expected, actual ) + StemValue actual = parseStemValue("down"); + StemValue expected = StemValue::down; + CHECK_EQUAL(expected, actual) } -TEST( StemValue_down, Enums ) +TEST(StemValue_down, Enums) { - StemValue e = StemValue::down; - std::string expected = "down"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StemValue e = StemValue::down; + std::string expected = "down"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StemValue e2 = parseStemValue( expected ); - CHECK_EQUAL( e, e2 ) + StemValue e2 = parseStemValue(expected); + CHECK_EQUAL(e, e2) } -TEST( StemValue_up, Enums ) +TEST(StemValue_up, Enums) { - StemValue e = StemValue::up; - std::string expected = "up"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StemValue e = StemValue::up; + std::string expected = "up"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StemValue e2 = parseStemValue( expected ); - CHECK_EQUAL( e, e2 ) + StemValue e2 = parseStemValue(expected); + CHECK_EQUAL(e, e2) } -TEST( StemValue_double_, Enums ) +TEST(StemValue_double_, Enums) { - StemValue e = StemValue::double_; - std::string expected = "double"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StemValue e = StemValue::double_; + std::string expected = "double"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StemValue e2 = parseStemValue( expected ); - CHECK_EQUAL( e, e2 ) + StemValue e2 = parseStemValue(expected); + CHECK_EQUAL(e, e2) } -TEST( StemValue_none, Enums ) +TEST(StemValue_none, Enums) { - StemValue e = StemValue::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StemValue e = StemValue::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StemValue e2 = parseStemValue( expected ); - CHECK_EQUAL( e, e2 ) + StemValue e2 = parseStemValue(expected); + CHECK_EQUAL(e, e2) } -TEST( Step_BadParse, Enums ) +TEST(Step_BadParse, Enums) { - StepEnum actual = parseStepEnum( "A" ); - StepEnum expected = StepEnum::a; - CHECK_EQUAL( expected, actual ) + StepEnum actual = parseStepEnum("A"); + StepEnum expected = StepEnum::a; + CHECK_EQUAL(expected, actual) } -TEST( Step_a, Enums ) +TEST(Step_a, Enums) { - StepEnum e = StepEnum::a; - std::string expected = "A"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StepEnum e = StepEnum::a; + std::string expected = "A"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StepEnum e2 = parseStepEnum( expected ); - CHECK_EQUAL( e, e2 ) + StepEnum e2 = parseStepEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Step_b, Enums ) +TEST(Step_b, Enums) { - StepEnum e = StepEnum::b; - std::string expected = "B"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StepEnum e = StepEnum::b; + std::string expected = "B"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StepEnum e2 = parseStepEnum( expected ); - CHECK_EQUAL( e, e2 ) + StepEnum e2 = parseStepEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Step_c, Enums ) +TEST(Step_c, Enums) { - StepEnum e = StepEnum::c; - std::string expected = "C"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StepEnum e = StepEnum::c; + std::string expected = "C"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StepEnum e2 = parseStepEnum( expected ); - CHECK_EQUAL( e, e2 ) + StepEnum e2 = parseStepEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Step_d, Enums ) +TEST(Step_d, Enums) { - StepEnum e = StepEnum::d; - std::string expected = "D"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StepEnum e = StepEnum::d; + std::string expected = "D"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StepEnum e2 = parseStepEnum( expected ); - CHECK_EQUAL( e, e2 ) + StepEnum e2 = parseStepEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Step_e, Enums ) +TEST(Step_e, Enums) { - StepEnum e = StepEnum::e; - std::string expected = "E"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StepEnum e = StepEnum::e; + std::string expected = "E"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StepEnum e2 = parseStepEnum( expected ); - CHECK_EQUAL( e, e2 ) + StepEnum e2 = parseStepEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Step_f, Enums ) +TEST(Step_f, Enums) { - StepEnum e = StepEnum::f; - std::string expected = "F"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StepEnum e = StepEnum::f; + std::string expected = "F"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StepEnum e2 = parseStepEnum( expected ); - CHECK_EQUAL( e, e2 ) + StepEnum e2 = parseStepEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Step_g, Enums ) +TEST(Step_g, Enums) { - StepEnum e = StepEnum::g; - std::string expected = "G"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + StepEnum e = StepEnum::g; + std::string expected = "G"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - StepEnum e2 = parseStepEnum( expected ); - CHECK_EQUAL( e, e2 ) + StepEnum e2 = parseStepEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Syllabic_BadParse, Enums ) +TEST(Syllabic_BadParse, Enums) { - SyllabicEnum actual = parseSyllabicEnum( "single" ); - SyllabicEnum expected = SyllabicEnum::single; - CHECK_EQUAL( expected, actual ) + SyllabicEnum actual = parseSyllabicEnum("single"); + SyllabicEnum expected = SyllabicEnum::single; + CHECK_EQUAL(expected, actual) } -TEST( Syllabic_single, Enums ) +TEST(Syllabic_single, Enums) { - SyllabicEnum e = SyllabicEnum::single; - std::string expected = "single"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SyllabicEnum e = SyllabicEnum::single; + std::string expected = "single"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SyllabicEnum e2 = parseSyllabicEnum( expected ); - CHECK_EQUAL( e, e2 ) + SyllabicEnum e2 = parseSyllabicEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Syllabic_begin, Enums ) +TEST(Syllabic_begin, Enums) { - SyllabicEnum e = SyllabicEnum::begin; - std::string expected = "begin"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SyllabicEnum e = SyllabicEnum::begin; + std::string expected = "begin"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SyllabicEnum e2 = parseSyllabicEnum( expected ); - CHECK_EQUAL( e, e2 ) + SyllabicEnum e2 = parseSyllabicEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Syllabic_end, Enums ) +TEST(Syllabic_end, Enums) { - SyllabicEnum e = SyllabicEnum::end; - std::string expected = "end"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SyllabicEnum e = SyllabicEnum::end; + std::string expected = "end"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SyllabicEnum e2 = parseSyllabicEnum( expected ); - CHECK_EQUAL( e, e2 ) + SyllabicEnum e2 = parseSyllabicEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( Syllabic_middle, Enums ) +TEST(Syllabic_middle, Enums) { - SyllabicEnum e = SyllabicEnum::middle; - std::string expected = "middle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + SyllabicEnum e = SyllabicEnum::middle; + std::string expected = "middle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - SyllabicEnum e2 = parseSyllabicEnum( expected ); - CHECK_EQUAL( e, e2 ) + SyllabicEnum e2 = parseSyllabicEnum(expected); + CHECK_EQUAL(e, e2) } -TEST( GroupBarlineValue_BadParse, Enums ) +TEST(GroupBarlineValue_BadParse, Enums) { - GroupBarlineValue actual = parseGroupBarlineValue( "yes" ); - GroupBarlineValue expected = GroupBarlineValue::yes; - CHECK_EQUAL( expected, actual ) + GroupBarlineValue actual = parseGroupBarlineValue("yes"); + GroupBarlineValue expected = GroupBarlineValue::yes; + CHECK_EQUAL(expected, actual) } -TEST( GroupBarlineValue_yes, Enums ) +TEST(GroupBarlineValue_yes, Enums) { - GroupBarlineValue e = GroupBarlineValue::yes; - std::string expected = "yes"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + GroupBarlineValue e = GroupBarlineValue::yes; + std::string expected = "yes"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - GroupBarlineValue e2 = parseGroupBarlineValue( expected ); - CHECK_EQUAL( e, e2 ) + GroupBarlineValue e2 = parseGroupBarlineValue(expected); + CHECK_EQUAL(e, e2) } -TEST( GroupBarlineValue_no, Enums ) +TEST(GroupBarlineValue_no, Enums) { - GroupBarlineValue e = GroupBarlineValue::no; - std::string expected = "no"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + GroupBarlineValue e = GroupBarlineValue::no; + std::string expected = "no"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - GroupBarlineValue e2 = parseGroupBarlineValue( expected ); - CHECK_EQUAL( e, e2 ) + GroupBarlineValue e2 = parseGroupBarlineValue(expected); + CHECK_EQUAL(e, e2) } -TEST( GroupBarlineValue_mensurstrich, Enums ) +TEST(GroupBarlineValue_mensurstrich, Enums) { - GroupBarlineValue e = GroupBarlineValue::mensurstrich; - std::string expected = "Mensurstrich"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + GroupBarlineValue e = GroupBarlineValue::mensurstrich; + std::string expected = "Mensurstrich"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - GroupBarlineValue e2 = parseGroupBarlineValue( expected ); - CHECK_EQUAL( e, e2 ) + GroupBarlineValue e2 = parseGroupBarlineValue(expected); + CHECK_EQUAL(e, e2) } -TEST( GroupSymbolValue_BadParse, Enums ) +TEST(GroupSymbolValue_BadParse, Enums) { - GroupSymbolValue actual = parseGroupSymbolValue( "none" ); - GroupSymbolValue expected = GroupSymbolValue::none; - CHECK_EQUAL( expected, actual ) + GroupSymbolValue actual = parseGroupSymbolValue("none"); + GroupSymbolValue expected = GroupSymbolValue::none; + CHECK_EQUAL(expected, actual) } -TEST( GroupSymbolValue_none, Enums ) +TEST(GroupSymbolValue_none, Enums) { - GroupSymbolValue e = GroupSymbolValue::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + GroupSymbolValue e = GroupSymbolValue::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - GroupSymbolValue e2 = parseGroupSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) + GroupSymbolValue e2 = parseGroupSymbolValue(expected); + CHECK_EQUAL(e, e2) } -TEST( GroupSymbolValue_brace, Enums ) +TEST(GroupSymbolValue_brace, Enums) { - GroupSymbolValue e = GroupSymbolValue::brace; - std::string expected = "brace"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + GroupSymbolValue e = GroupSymbolValue::brace; + std::string expected = "brace"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - GroupSymbolValue e2 = parseGroupSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) + GroupSymbolValue e2 = parseGroupSymbolValue(expected); + CHECK_EQUAL(e, e2) } -TEST( GroupSymbolValue_line, Enums ) +TEST(GroupSymbolValue_line, Enums) { - GroupSymbolValue e = GroupSymbolValue::line; - std::string expected = "line"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); + GroupSymbolValue e = GroupSymbolValue::line; + std::string expected = "line"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - GroupSymbolValue e2 = parseGroupSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) + GroupSymbolValue e2 = parseGroupSymbolValue(expected); + CHECK_EQUAL(e, e2) } -TEST( GroupSymbolValue_bracket, Enums ) -{ - GroupSymbolValue e = GroupSymbolValue::bracket; - std::string expected = "bracket"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); +TEST(GroupSymbolValue_bracket, Enums) +{ + GroupSymbolValue e = GroupSymbolValue::bracket; + std::string expected = "bracket"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + GroupSymbolValue e2 = parseGroupSymbolValue(expected); + CHECK_EQUAL(e, e2) +} + +TEST(GroupSymbolValue_square, Enums) +{ + GroupSymbolValue e = GroupSymbolValue::square; + std::string expected = "square"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + GroupSymbolValue e2 = parseGroupSymbolValue(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_major, Enums) +{ + ModeEnum e = ModeEnum::major; + std::string expected = "major"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_minor, Enums) +{ + ModeEnum e = ModeEnum::minor; + std::string expected = "minor"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_dorian, Enums) +{ + ModeEnum e = ModeEnum::dorian; + std::string expected = "dorian"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_phrygian, Enums) +{ + ModeEnum e = ModeEnum::phrygian; + std::string expected = "phrygian"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_lydian, Enums) +{ + ModeEnum e = ModeEnum::lydian; + std::string expected = "lydian"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_mixolydian, Enums) +{ + ModeEnum e = ModeEnum::mixolydian; + std::string expected = "mixolydian"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_aeolian, Enums) +{ + ModeEnum e = ModeEnum::aeolian; + std::string expected = "aeolian"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_ionian, Enums) +{ + ModeEnum e = ModeEnum::ionian; + std::string expected = "ionian"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - GroupSymbolValue e2 = parseGroupSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( GroupSymbolValue_square, Enums ) -{ - GroupSymbolValue e = GroupSymbolValue::square; - std::string expected = "square"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - GroupSymbolValue e2 = parseGroupSymbolValue( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_major, Enums ) -{ - ModeEnum e = ModeEnum::major; - std::string expected = "major"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_minor, Enums ) -{ - ModeEnum e = ModeEnum::minor; - std::string expected = "minor"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_dorian, Enums ) -{ - ModeEnum e = ModeEnum::dorian; - std::string expected = "dorian"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_phrygian, Enums ) -{ - ModeEnum e = ModeEnum::phrygian; - std::string expected = "phrygian"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_lydian, Enums ) -{ - ModeEnum e = ModeEnum::lydian; - std::string expected = "lydian"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_mixolydian, Enums ) -{ - ModeEnum e = ModeEnum::mixolydian; - std::string expected = "mixolydian"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_aeolian, Enums ) -{ - ModeEnum e = ModeEnum::aeolian; - std::string expected = "aeolian"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_ionian, Enums ) -{ - ModeEnum e = ModeEnum::ionian; - std::string expected = "ionian"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_locrian, Enums ) -{ - ModeEnum e = ModeEnum::locrian; - std::string expected = "locrian"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_none, Enums ) -{ - ModeEnum e = ModeEnum::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( ModeEnum_other, Enums ) -{ - ModeEnum e = ModeEnum::other; - std::string expected = "other"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - ModeEnum e2 = parseModeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( Mode_default, Enums ) -{ - ModeValue object; + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_locrian, Enums) +{ + ModeEnum e = ModeEnum::locrian; + std::string expected = "locrian"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_none, Enums) +{ + ModeEnum e = ModeEnum::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(ModeEnum_other, Enums) +{ + ModeEnum e = ModeEnum::other; + std::string expected = "other"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + ModeEnum e2 = parseModeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(Mode_default, Enums) +{ + ModeValue object; ModeEnum expected = ModeEnum::major; ModeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Mode_major, Enums ) + +TEST(Mode_major, Enums) { ModeEnum enumval = ModeEnum::major; ModeEnum diffval = ModeEnum::other; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "none"; std::string badstr = "EORIUT"; - ModeValue object( enumval ); + ModeValue object(enumval); ModeEnum expected = enumval; ModeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object2( diffval ); + CHECK_EQUAL(expected, actual) + + ModeValue object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object3( diffval ); - object3 = parseModeValue( strval ); + CHECK_EQUAL(expected, actual) + + ModeValue object3(diffval); + object3 = parseModeValue(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object4( strval ); + CHECK_EQUAL(expected, actual) + + ModeValue object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object5( badstr ); + CHECK_EQUAL(expected, actual) + + ModeValue object5(badstr); expected = ModeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object6( enumval ); + CHECK_EQUAL(expected, actual) + + ModeValue object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseModeValue( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseModeValue(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } -TEST( Mode_lydian, Enums ) +TEST(Mode_lydian, Enums) { ModeEnum enumval = ModeEnum::lydian; ModeEnum diffval = ModeEnum::locrian; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "locrian"; std::string badstr = "Lydian"; - ModeValue object( enumval ); + ModeValue object(enumval); ModeEnum expected = enumval; ModeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object2( diffval ); + CHECK_EQUAL(expected, actual) + + ModeValue object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object3( diffval ); - object3 = parseModeValue( strval ); + CHECK_EQUAL(expected, actual) + + ModeValue object3(diffval); + object3 = parseModeValue(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object4( strval ); + CHECK_EQUAL(expected, actual) + + ModeValue object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object5( badstr ); + CHECK_EQUAL(expected, actual) + + ModeValue object5(badstr); expected = ModeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object6( enumval ); + CHECK_EQUAL(expected, actual) + + ModeValue object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseModeValue( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseModeValue(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } -TEST( Mode_locrian, Enums ) +TEST(Mode_locrian, Enums) { ModeEnum enumval = ModeEnum::locrian; ModeEnum diffval = ModeEnum::aeolian; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "aeolian"; std::string badstr = "pelog"; - ModeValue object( enumval ); + ModeValue object(enumval); ModeEnum expected = enumval; ModeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object2( diffval ); + CHECK_EQUAL(expected, actual) + + ModeValue object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object3( diffval ); - object3 = parseModeValue( strval ); + CHECK_EQUAL(expected, actual) + + ModeValue object3(diffval); + object3 = parseModeValue(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object4( strval ); + CHECK_EQUAL(expected, actual) + + ModeValue object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object5( badstr ); + CHECK_EQUAL(expected, actual) + + ModeValue object5(badstr); expected = ModeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object6( enumval ); + CHECK_EQUAL(expected, actual) + + ModeValue object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseModeValue( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseModeValue(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } -TEST( Mode_other, Enums ) +TEST(Mode_other, Enums) { ModeEnum enumval = ModeEnum::other; ModeEnum diffval = ModeEnum::aeolian; std::string strval = ""; // toString( enumval ); std::string difval = "aeolian"; std::string badstr = "pelog"; - ModeValue object( enumval ); + ModeValue object(enumval); ModeEnum expected = enumval; ModeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object2( diffval ); + CHECK_EQUAL(expected, actual) + + ModeValue object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object3( diffval ); - object3 = parseModeValue( strval ); + CHECK_EQUAL(expected, actual) + + ModeValue object3(diffval); + object3 = parseModeValue(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object4( strval ); + CHECK_EQUAL(expected, actual) + + ModeValue object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object5( badstr ); + CHECK_EQUAL(expected, actual) + + ModeValue object5(badstr); expected = ModeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - ModeValue object6( enumval ); + CHECK_EQUAL(expected, actual) + + ModeValue object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseModeValue( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseModeValue(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) -} - -TEST( DistanceTypeEnum_beam, Enums ) -{ - DistanceTypeEnum e = DistanceTypeEnum::beam; - std::string expected = "beam"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - DistanceTypeEnum e2 = parseDistanceTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( DistanceTypeEnum_hyphen, Enums ) -{ - DistanceTypeEnum e = DistanceTypeEnum::hyphen; - std::string expected = "hyphen"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - DistanceTypeEnum e2 = parseDistanceTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( DistanceTypeEnum_other, Enums ) -{ - DistanceTypeEnum e = DistanceTypeEnum::other; - std::string expected = "other"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - DistanceTypeEnum e2 = parseDistanceTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( DistanceType_beam, Enums ) + CHECK_EQUAL(expected_str, actual_str) +} + +TEST(DistanceTypeEnum_beam, Enums) +{ + DistanceTypeEnum e = DistanceTypeEnum::beam; + std::string expected = "beam"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + DistanceTypeEnum e2 = parseDistanceTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(DistanceTypeEnum_hyphen, Enums) +{ + DistanceTypeEnum e = DistanceTypeEnum::hyphen; + std::string expected = "hyphen"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + DistanceTypeEnum e2 = parseDistanceTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(DistanceTypeEnum_other, Enums) +{ + DistanceTypeEnum e = DistanceTypeEnum::other; + std::string expected = "other"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + DistanceTypeEnum e2 = parseDistanceTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(DistanceType_beam, Enums) { DistanceTypeEnum enumval = DistanceTypeEnum::beam; DistanceTypeEnum diffval = DistanceTypeEnum::hyphen; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "hyphen"; std::string badstr = "someothertype"; - DistanceType object( enumval ); + DistanceType object(enumval); DistanceTypeEnum expected = enumval; DistanceTypeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object2( diffval ); + CHECK_EQUAL(expected, actual) + + DistanceType object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object3( diffval ); - object3 = parseDistanceType( strval ); + CHECK_EQUAL(expected, actual) + + DistanceType object3(diffval); + object3 = parseDistanceType(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object4( strval ); + CHECK_EQUAL(expected, actual) + + DistanceType object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object5( badstr ); + CHECK_EQUAL(expected, actual) + + DistanceType object5(badstr); expected = DistanceTypeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object6( enumval ); + CHECK_EQUAL(expected, actual) + + DistanceType object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseDistanceType( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseDistanceType(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } -TEST( DistanceType_hyphen, Enums ) +TEST(DistanceType_hyphen, Enums) { DistanceTypeEnum enumval = DistanceTypeEnum::hyphen; DistanceTypeEnum diffval = DistanceTypeEnum::beam; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "beam"; std::string badstr = "someothertype"; - DistanceType object( enumval ); + DistanceType object(enumval); DistanceTypeEnum expected = enumval; DistanceTypeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object2( diffval ); + CHECK_EQUAL(expected, actual) + + DistanceType object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object3( diffval ); - object3 = parseDistanceType( strval ); + CHECK_EQUAL(expected, actual) + + DistanceType object3(diffval); + object3 = parseDistanceType(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object4( strval ); + CHECK_EQUAL(expected, actual) + + DistanceType object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object5( badstr ); + CHECK_EQUAL(expected, actual) + + DistanceType object5(badstr); expected = DistanceTypeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object6( enumval ); + CHECK_EQUAL(expected, actual) + + DistanceType object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseDistanceType( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseDistanceType(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } - -TEST( DistanceType_other, Enums ) +TEST(DistanceType_other, Enums) { DistanceTypeEnum enumval = DistanceTypeEnum::other; DistanceTypeEnum diffval = DistanceTypeEnum::beam; std::string strval = ""; // toString( enumval ); std::string difval = "beam"; std::string badstr = "someothertype"; - DistanceType object( enumval ); + DistanceType object(enumval); DistanceTypeEnum expected = enumval; DistanceTypeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object2( diffval ); + CHECK_EQUAL(expected, actual) + + DistanceType object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object3( diffval ); - object3 = parseDistanceType( strval ); + CHECK_EQUAL(expected, actual) + + DistanceType object3(diffval); + object3 = parseDistanceType(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object4( strval ); + CHECK_EQUAL(expected, actual) + + DistanceType object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object5( badstr ); + CHECK_EQUAL(expected, actual) + + DistanceType object5(badstr); expected = DistanceTypeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - DistanceType object6( enumval ); + CHECK_EQUAL(expected, actual) + + DistanceType object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseDistanceType( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseDistanceType(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) -} - -TEST( LineWidthTypeEnum_beam, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::beam; - std::string expected = "beam"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_bracket, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::bracket; - std::string expected = "bracket"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_dashes, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::dashes; - std::string expected = "dashes"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_enclosure, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::enclosure; - std::string expected = "enclosure"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_ending, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::ending; - std::string expected = "ending"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_extend, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::extend; - std::string expected = "extend"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_heavyBarline, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::heavyBarline; - std::string expected = "heavy barline"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_leger, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::leger; - std::string expected = "leger"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_lightBarline, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::lightBarline; - std::string expected = "light barline"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_octaveShift, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::octaveShift; - std::string expected = "octave shift"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_pedal, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::pedal; - std::string expected = "pedal"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_slurMiddle, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::slurMiddle; - std::string expected = "slur middle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_hyphen, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::beam; - std::string expected = "beam"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_slurTip, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::slurTip; - std::string expected = "slur tip"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_staff, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::staff; - std::string expected = "staff"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_stem, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::stem; - std::string expected = "stem"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_tieMiddle, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::tieMiddle; - std::string expected = "tie middle"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_tieTip, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::tieTip; - std::string expected = "tie tip"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_tupletBracket, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::tupletBracket; - std::string expected = "tuplet bracket"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_wedge, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::wedge; - std::string expected = "wedge"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthTypeEnum_other, Enums ) -{ - LineWidthTypeEnum e = LineWidthTypeEnum::other; - std::string expected = "other"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - LineWidthTypeEnum e2 = parseLineWidthTypeEnum( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( LineWidthType_beam, Enums ) + CHECK_EQUAL(expected_str, actual_str) +} + +TEST(LineWidthTypeEnum_beam, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::beam; + std::string expected = "beam"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_bracket, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::bracket; + std::string expected = "bracket"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_dashes, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::dashes; + std::string expected = "dashes"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_enclosure, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::enclosure; + std::string expected = "enclosure"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_ending, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::ending; + std::string expected = "ending"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_extend, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::extend; + std::string expected = "extend"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_heavyBarline, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::heavyBarline; + std::string expected = "heavy barline"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_leger, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::leger; + std::string expected = "leger"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_lightBarline, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::lightBarline; + std::string expected = "light barline"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_octaveShift, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::octaveShift; + std::string expected = "octave shift"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_pedal, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::pedal; + std::string expected = "pedal"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_slurMiddle, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::slurMiddle; + std::string expected = "slur middle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_hyphen, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::beam; + std::string expected = "beam"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_slurTip, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::slurTip; + std::string expected = "slur tip"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_staff, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::staff; + std::string expected = "staff"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_stem, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::stem; + std::string expected = "stem"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_tieMiddle, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::tieMiddle; + std::string expected = "tie middle"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_tieTip, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::tieTip; + std::string expected = "tie tip"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_tupletBracket, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::tupletBracket; + std::string expected = "tuplet bracket"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_wedge, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::wedge; + std::string expected = "wedge"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthTypeEnum_other, Enums) +{ + LineWidthTypeEnum e = LineWidthTypeEnum::other; + std::string expected = "other"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + LineWidthTypeEnum e2 = parseLineWidthTypeEnum(expected); + CHECK_EQUAL(e, e2) +} + +TEST(LineWidthType_beam, Enums) { LineWidthTypeEnum enumval = LineWidthTypeEnum::beam; LineWidthTypeEnum diffval = LineWidthTypeEnum::enclosure; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "enclosure"; std::string badstr = "someothertype"; - LineWidthType object( enumval ); + LineWidthType object(enumval); LineWidthTypeEnum expected = enumval; LineWidthTypeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object2( diffval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object3( diffval ); - object3 = parseLineWidthType( strval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object3(diffval); + object3 = parseLineWidthType(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object4( strval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object5( badstr ); + CHECK_EQUAL(expected, actual) + + LineWidthType object5(badstr); expected = LineWidthTypeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object6( enumval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseLineWidthType( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseLineWidthType(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } -TEST( LineWidthType_tieTip, Enums ) +TEST(LineWidthType_tieTip, Enums) { LineWidthTypeEnum enumval = LineWidthTypeEnum::tieTip; LineWidthTypeEnum diffval = LineWidthTypeEnum::leger; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "leger"; std::string badstr = "someothertype"; - LineWidthType object( enumval ); + LineWidthType object(enumval); LineWidthTypeEnum expected = enumval; LineWidthTypeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object2( diffval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object3( diffval ); - object3 = parseLineWidthType( strval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object3(diffval); + object3 = parseLineWidthType(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object4( strval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object5( badstr ); + CHECK_EQUAL(expected, actual) + + LineWidthType object5(badstr); expected = LineWidthTypeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object6( enumval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseLineWidthType( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseLineWidthType(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } -TEST( LineWidthType_other, Enums ) +TEST(LineWidthType_other, Enums) { LineWidthTypeEnum enumval = LineWidthTypeEnum::other; LineWidthTypeEnum diffval = LineWidthTypeEnum::wedge; std::string strval = ""; // toString( enumval ); std::string difval = "enclosure"; std::string badstr = "someothertype"; - LineWidthType object( enumval ); + LineWidthType object(enumval); LineWidthTypeEnum expected = enumval; LineWidthTypeEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object2( diffval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object3( diffval ); - object3 = parseLineWidthType( strval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object3(diffval); + object3 = parseLineWidthType(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object4( strval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object5( badstr ); + CHECK_EQUAL(expected, actual) + + LineWidthType object5(badstr); expected = LineWidthTypeEnum::other; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - LineWidthType object6( enumval ); + CHECK_EQUAL(expected, actual) + + LineWidthType object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseLineWidthType( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseLineWidthType(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) -} - -TEST( XlinkActuate_BadParse, Enums ) -{ - XlinkActuate actual = parseXlinkActuate( "onrequest" ); - XlinkActuate expected = XlinkActuate::onLoad; - CHECK_EQUAL( expected, actual ) -} - -TEST( XlinkActuate_onLoad, Enums ) -{ - XlinkActuate e = XlinkActuate::onLoad; - std::string expected = "onLoad"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkActuate e2 = parseXlinkActuate( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkActuate_onRequest, Enums ) -{ - XlinkActuate e = XlinkActuate::onRequest; - std::string expected = "onRequest"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkActuate e2 = parseXlinkActuate( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkActuate_other, Enums ) -{ - XlinkActuate e = XlinkActuate::other; - std::string expected = "other"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkActuate e2 = parseXlinkActuate( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkActuate_none, Enums ) -{ - XlinkActuate e = XlinkActuate::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkActuate e2 = parseXlinkActuate( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( XlinkShow_BadParse, Enums ) -{ - XlinkShow actual = parseXlinkShow( "xyz" ); - XlinkShow expected = XlinkShow::new_; - CHECK_EQUAL( expected, actual ) -} -TEST( XlinkShow_new_, Enums ) -{ - XlinkShow e = XlinkShow::new_; - std::string expected = "new"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkShow e2 = parseXlinkShow( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkShow_replace, Enums ) -{ - XlinkShow e = XlinkShow::replace; - std::string expected = "replace"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkShow e2 = parseXlinkShow( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkShow_, Enums ) -{ - XlinkShow e = XlinkShow::new_; - std::string expected = "new"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkShow e2 = parseXlinkShow( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkShow_embed, Enums ) -{ - XlinkShow e = XlinkShow::embed; - std::string expected = "embed"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkShow e2 = parseXlinkShow( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkShow_other, Enums ) -{ - XlinkShow e = XlinkShow::other; - std::string expected = "other"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkShow e2 = parseXlinkShow( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkShow_none, Enums ) -{ - XlinkShow e = XlinkShow::none; - std::string expected = "none"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkShow e2 = parseXlinkShow( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( XlinkType_BadParse, Enums ) -{ - XlinkType actual = parseXlinkType( "xyz" ); - XlinkType expected = XlinkType::simple; - CHECK_EQUAL( expected, actual ) -} -TEST( XlinkType_simple, Enums ) -{ - XlinkType e = XlinkType::simple; - std::string expected = "simple"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkType e2 = parseXlinkType( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkType_extended, Enums ) -{ - XlinkType e = XlinkType::extended; - std::string expected = "extended"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkType e2 = parseXlinkType( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkType_title, Enums ) -{ - XlinkType e = XlinkType::title; - std::string expected = "title"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkType e2 = parseXlinkType( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkType_resource, Enums ) -{ - XlinkType e = XlinkType::resource; - std::string expected = "resource"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkType e2 = parseXlinkType( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkType_locator, Enums ) -{ - XlinkType e = XlinkType::locator; - std::string expected = "locator"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkType e2 = parseXlinkType( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XlinkType_arc, Enums ) -{ - XlinkType e = XlinkType::arc; - std::string expected = "arc"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XlinkType e2 = parseXlinkType( expected ); - CHECK_EQUAL( e, e2 ) -} - -TEST( XmlSpace_BadParse, Enums ) -{ - XmlSpace actual = parseXmlSpace( "xyz" ); - XmlSpace expected = XmlSpace::default_; - CHECK_EQUAL( expected, actual ) -} -TEST( XmlSpace_default_, Enums ) -{ - XmlSpace e = XmlSpace::default_; - std::string expected = "default"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XmlSpace e2 = parseXmlSpace( expected ); - CHECK_EQUAL( e, e2 ) -} -TEST( XmlSpace_preserve, Enums ) -{ - XmlSpace e = XmlSpace::preserve; - std::string expected = "preserve"; - std::string actual = toString( e ); - CHECK_EQUAL( expected, actual ); - - std::stringstream sstr; - toStream( sstr, e ); - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - sstr.str( "" ); - sstr << e; - actual = sstr.str(); - CHECK_EQUAL( expected, actual ); - - XmlSpace e2 = parseXmlSpace( expected ); - CHECK_EQUAL( e, e2 ) -} - - -TEST( DynamicsValue_beam, Enums ) + CHECK_EQUAL(expected_str, actual_str) +} + +TEST(XlinkActuate_BadParse, Enums) +{ + XlinkActuate actual = parseXlinkActuate("onrequest"); + XlinkActuate expected = XlinkActuate::onLoad; + CHECK_EQUAL(expected, actual) +} + +TEST(XlinkActuate_onLoad, Enums) +{ + XlinkActuate e = XlinkActuate::onLoad; + std::string expected = "onLoad"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkActuate e2 = parseXlinkActuate(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkActuate_onRequest, Enums) +{ + XlinkActuate e = XlinkActuate::onRequest; + std::string expected = "onRequest"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkActuate e2 = parseXlinkActuate(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkActuate_other, Enums) +{ + XlinkActuate e = XlinkActuate::other; + std::string expected = "other"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkActuate e2 = parseXlinkActuate(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkActuate_none, Enums) +{ + XlinkActuate e = XlinkActuate::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkActuate e2 = parseXlinkActuate(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkShow_BadParse, Enums) +{ + XlinkShow actual = parseXlinkShow("xyz"); + XlinkShow expected = XlinkShow::new_; + CHECK_EQUAL(expected, actual) +} + +TEST(XlinkShow_new_, Enums) +{ + XlinkShow e = XlinkShow::new_; + std::string expected = "new"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkShow e2 = parseXlinkShow(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkShow_replace, Enums) +{ + XlinkShow e = XlinkShow::replace; + std::string expected = "replace"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkShow e2 = parseXlinkShow(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkShow_, Enums) +{ + XlinkShow e = XlinkShow::new_; + std::string expected = "new"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkShow e2 = parseXlinkShow(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkShow_embed, Enums) +{ + XlinkShow e = XlinkShow::embed; + std::string expected = "embed"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkShow e2 = parseXlinkShow(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkShow_other, Enums) +{ + XlinkShow e = XlinkShow::other; + std::string expected = "other"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkShow e2 = parseXlinkShow(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkShow_none, Enums) +{ + XlinkShow e = XlinkShow::none; + std::string expected = "none"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkShow e2 = parseXlinkShow(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkType_BadParse, Enums) +{ + XlinkType actual = parseXlinkType("xyz"); + XlinkType expected = XlinkType::simple; + CHECK_EQUAL(expected, actual) +} + +TEST(XlinkType_simple, Enums) +{ + XlinkType e = XlinkType::simple; + std::string expected = "simple"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkType e2 = parseXlinkType(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkType_extended, Enums) +{ + XlinkType e = XlinkType::extended; + std::string expected = "extended"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkType e2 = parseXlinkType(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkType_title, Enums) +{ + XlinkType e = XlinkType::title; + std::string expected = "title"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkType e2 = parseXlinkType(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkType_resource, Enums) +{ + XlinkType e = XlinkType::resource; + std::string expected = "resource"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkType e2 = parseXlinkType(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkType_locator, Enums) +{ + XlinkType e = XlinkType::locator; + std::string expected = "locator"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkType e2 = parseXlinkType(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XlinkType_arc, Enums) +{ + XlinkType e = XlinkType::arc; + std::string expected = "arc"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XlinkType e2 = parseXlinkType(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XmlSpace_BadParse, Enums) +{ + XmlSpace actual = parseXmlSpace("xyz"); + XmlSpace expected = XmlSpace::default_; + CHECK_EQUAL(expected, actual) +} + +TEST(XmlSpace_default_, Enums) +{ + XmlSpace e = XmlSpace::default_; + std::string expected = "default"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XmlSpace e2 = parseXmlSpace(expected); + CHECK_EQUAL(e, e2) +} + +TEST(XmlSpace_preserve, Enums) +{ + XmlSpace e = XmlSpace::preserve; + std::string expected = "preserve"; + std::string actual = toString(e); + CHECK_EQUAL(expected, actual); + + std::stringstream sstr; + toStream(sstr, e); + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + sstr.str(""); + sstr << e; + actual = sstr.str(); + CHECK_EQUAL(expected, actual); + + XmlSpace e2 = parseXmlSpace(expected); + CHECK_EQUAL(e, e2) +} + +TEST(DynamicsValue_beam, Enums) { DynamicsEnum enumval = DynamicsEnum::ppppp; DynamicsEnum diffval = DynamicsEnum::pp; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "enclosure"; std::string badstr = "someothertype"; - DynamicsValue object( enumval ); + DynamicsValue object(enumval); DynamicsEnum expected = enumval; DynamicsEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object2( diffval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object3( diffval ); - object3 = parseDynamicsValue( strval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object3(diffval); + object3 = parseDynamicsValue(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object4( strval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object5( badstr ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object5(badstr); expected = DynamicsEnum::otherDynamics; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object6( enumval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseDynamicsValue( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseDynamicsValue(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } -TEST( DynamicsValue_tieTip, Enums ) +TEST(DynamicsValue_tieTip, Enums) { DynamicsEnum enumval = DynamicsEnum::ff; DynamicsEnum diffval = DynamicsEnum::sffz; - std::string strval = toString( enumval ); + std::string strval = toString(enumval); std::string difval = "leger"; std::string badstr = "someothertype"; - DynamicsValue object( enumval ); + DynamicsValue object(enumval); DynamicsEnum expected = enumval; DynamicsEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object2( diffval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object3( diffval ); - object3 = parseDynamicsValue( strval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object3(diffval); + object3 = parseDynamicsValue(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object4( strval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object5( badstr ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object5(badstr); expected = DynamicsEnum::otherDynamics; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object6( enumval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseDynamicsValue( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseDynamicsValue(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } -TEST( DynamicsValue_other, Enums ) +TEST(DynamicsValue_other, Enums) { DynamicsEnum enumval = DynamicsEnum::otherDynamics; DynamicsEnum diffval = DynamicsEnum::rfz; std::string strval = ""; // toString( enumval ); std::string difval = "enclosure"; std::string badstr = "someothertype"; - DynamicsValue object( enumval ); + DynamicsValue object(enumval); DynamicsEnum expected = enumval; DynamicsEnum actual = object.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object2( diffval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object2(diffval); expected = diffval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - object2.setValue( enumval ); + CHECK_EQUAL(expected, actual) + object2.setValue(enumval); expected = enumval; actual = object2.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object3( diffval ); - object3 = parseDynamicsValue( strval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object3(diffval); + object3 = parseDynamicsValue(strval); expected = enumval; actual = object3.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object4( strval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object4(strval); expected = enumval; actual = object4.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object5( badstr ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object5(badstr); expected = DynamicsEnum::otherDynamics; actual = object5.getValue(); - CHECK_EQUAL( expected, actual ) - - DynamicsValue object6( enumval ); + CHECK_EQUAL(expected, actual) + + DynamicsValue object6(enumval); std::string expected_str = strval; - std::string actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - + std::string actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + std::stringstream ss; - toStream( ss, object6 ); + toStream(ss, object6); expected_str = strval; actual_str = ss.str(); - CHECK_EQUAL( expected_str, actual_str ) - - object6 = parseDynamicsValue( badstr ); + CHECK_EQUAL(expected_str, actual_str) + + object6 = parseDynamicsValue(badstr); expected_str = badstr; - actual_str = toString( object6 ); - CHECK_EQUAL( expected_str, actual_str ) - - ss.str( "" ); + actual_str = toString(object6); + CHECK_EQUAL(expected_str, actual_str) + + ss.str(""); ss << object6; - CHECK_EQUAL( expected_str, actual_str ) + CHECK_EQUAL(expected_str, actual_str) } #endif diff --git a/Sourcecode/private/mxtest/core/ExtendTest.cpp b/Sourcecode/private/mxtest/core/ExtendTest.cpp index 85d5b1a0d..fc2a2f0c7 100644 --- a/Sourcecode/private/mxtest/core/ExtendTest.cpp +++ b/Sourcecode/private/mxtest/core/ExtendTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Extend ) +TEST(Test01, Extend) { - std::string indentString( INDENT ); - Extend object1; - Extend object2; - ExtendAttributesPtr attributes1 = std::make_shared(); - ExtendAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Extend object1; + Extend object2; + ExtendAttributesPtr attributes1 = std::make_shared(); + ExtendAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->defaultX = TenthsValue{0.1}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/EyeglassesTest.cpp b/Sourcecode/private/mxtest/core/EyeglassesTest.cpp index 3bfcd7869..162cb5658 100644 --- a/Sourcecode/private/mxtest/core/EyeglassesTest.cpp +++ b/Sourcecode/private/mxtest/core/EyeglassesTest.cpp @@ -2,7 +2,6 @@ // Copyright (c) by Matthew James Briggs // Distributed under the MIT License - #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS @@ -12,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Eyeglasses ) +TEST(Test01, Eyeglasses) { - std::string indentString( INDENT ); - Eyeglasses object1; - Eyeglasses object2; - EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); - EmptyPrintObjectStyleAlignAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Eyeglasses object1; + Eyeglasses object2; + EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); + EmptyPrintObjectStyleAlignAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/FalloffTest.cpp b/Sourcecode/private/mxtest/core/FalloffTest.cpp index a482d9c45..c261dfecd 100644 --- a/Sourcecode/private/mxtest/core/FalloffTest.cpp +++ b/Sourcecode/private/mxtest/core/FalloffTest.cpp @@ -11,42 +11,43 @@ using namespace mx::core; -TEST( Test01, Falloff ) +TEST(Test01, Falloff) { - std::string indentString( INDENT ); - Falloff object1; - Falloff object2; - EmptyLineAttributesPtr attributes1 = std::make_shared(); - EmptyLineAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Falloff object1; + Falloff object2; + EmptyLineAttributesPtr attributes1 = std::make_shared(); + EmptyLineAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif - diff --git a/Sourcecode/private/mxtest/core/FeatureTest.cpp b/Sourcecode/private/mxtest/core/FeatureTest.cpp index d022faa93..02ca89b97 100644 --- a/Sourcecode/private/mxtest/core/FeatureTest.cpp +++ b/Sourcecode/private/mxtest/core/FeatureTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Feature ) +TEST(Test01, Feature) { - std::string indentString( INDENT ); - XsString value1{ "Hoshi" }; - XsString value2{ "Tu'pal" }; - Feature object1; - Feature object2( value2 ); - FeatureAttributesPtr attributes1 = std::make_shared(); - FeatureAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Hoshi"}; + XsString value2{"Tu'pal"}; + Feature object1; + Feature object2(value2); + FeatureAttributesPtr attributes1 = std::make_shared(); + FeatureAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasType = true; - attributes1->type = XsToken{ "bones" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Tu'pal)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->type = XsToken{"bones"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Tu'pal)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FermataTest.cpp b/Sourcecode/private/mxtest/core/FermataTest.cpp index 164298e65..ad22f6692 100644 --- a/Sourcecode/private/mxtest/core/FermataTest.cpp +++ b/Sourcecode/private/mxtest/core/FermataTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Fermata ) +TEST(Test01, Fermata) { - std::string indentString( INDENT ); - FermataShape value1 = FermataShape::angled; - FermataShape value2 = FermataShape::square; - Fermata object1; - Fermata object2( value2 ); - FermataAttributesPtr attributes1 = std::make_shared(); - FermataAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + FermataShape value1 = FermataShape::angled; + FermataShape value2 = FermataShape::square; + Fermata object1; + Fermata object2(value2); + FermataAttributesPtr attributes1 = std::make_shared(); + FermataAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasType = true; attributes1->type = UprightInverted::upright; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(normal)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(square)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(normal)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(square)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FifthsTest.cpp b/Sourcecode/private/mxtest/core/FifthsTest.cpp index 46516c389..a83c4dbad 100644 --- a/Sourcecode/private/mxtest/core/FifthsTest.cpp +++ b/Sourcecode/private/mxtest/core/FifthsTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Fifths ) +TEST(Test01, Fifths) { - std::string indentString( INDENT ); - FifthsValue value1{ 2 }; - FifthsValue value2{ 3 }; - Fifths object1; - Fifths object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + FifthsValue value1{2}; + FifthsValue value2{3}; + Fifths object1; + Fifths object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FigureNumberTest.cpp b/Sourcecode/private/mxtest/core/FigureNumberTest.cpp index f58fe0cdb..4c3eeb3a0 100644 --- a/Sourcecode/private/mxtest/core/FigureNumberTest.cpp +++ b/Sourcecode/private/mxtest/core/FigureNumberTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, FigureNumber ) +TEST(Test01, FigureNumber) { - std::string indentString( INDENT ); - XsString value1{ "Figure 1" }; - XsString value2{ "Figure 2" }; - FigureNumber object1; - FigureNumber object2( value2 ); - FigureNumberAttributesPtr attributes1 = std::make_shared(); - FigureNumberAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Figure 1"}; + XsString value2{"Figure 2"}; + FigureNumber object1; + FigureNumber object2(value2); + FigureNumberAttributesPtr attributes1 = std::make_shared(); + FigureNumberAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontWeight = true; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Figure 2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Figure 2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FigureTest.cpp b/Sourcecode/private/mxtest/core/FigureTest.cpp index 188cad418..2a2e0862b 100644 --- a/Sourcecode/private/mxtest/core/FigureTest.cpp +++ b/Sourcecode/private/mxtest/core/FigureTest.cpp @@ -6,124 +6,120 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/FigureTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Figure ) +TEST(Test01, Figure) { TestMode v = TestMode::one; - FigurePtr object = tgenFigure( v ); - stringstream expected; - tgenFigureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + FigurePtr object = tgenFigure(v); + stringstream expected; + tgenFigureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Figure ) + +TEST(Test02, Figure) { TestMode v = TestMode::two; - FigurePtr object = tgenFigure( v ); - stringstream expected; - tgenFigureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + FigurePtr object = tgenFigure(v); + stringstream expected; + tgenFigureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Figure ) + +TEST(Test03, Figure) { TestMode v = TestMode::three; - FigurePtr object = tgenFigure( v ); - stringstream expected; - tgenFigureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + FigurePtr object = tgenFigure(v); + stringstream expected; + tgenFigureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - FigurePtr tgenFigure( TestMode v ) +FigurePtr tgenFigure(TestMode v) +{ + FigurePtr o = makeFigure(); + switch (v) { - FigurePtr o = makeFigure(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasExtend( true ); - o->setHasPrefix( true ); - o->getExtend()->getAttributes()->hasType = true; - o->getPrefix()->setValue( XsString( "-" ) ); - } - break; - case TestMode::three: - { - o->setHasExtend( true ); - o->setHasPrefix( true ); - o->setHasSuffix( true ); - o->setHasFigureNumber( true ); - o->getFigureNumber()->setValue( XsString( "xx" ) ); - o->getExtend()->getAttributes()->hasType = true; - o->getPrefix()->setValue( XsString( "-" ) ); - o->getSuffix()->setValue( XsString( "post" ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasExtend(true); + o->setHasPrefix(true); + o->getExtend()->getAttributes()->hasType = true; + o->getPrefix()->setValue(XsString("-")); + } + break; + case TestMode::three: { + o->setHasExtend(true); + o->setHasPrefix(true); + o->setHasSuffix(true); + o->setHasFigureNumber(true); + o->getFigureNumber()->setValue(XsString("xx")); + o->getExtend()->getAttributes()->hasType = true; + o->getPrefix()->setValue(XsString("-")); + o->getSuffix()->setValue(XsString("post")); + } + break; + default: + break; } - void tgenFigureExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenFigureExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"(

)", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"(
)" ); - streamLine( os, i+1, R"(-)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"(
)", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"(
)" ); - streamLine( os, i+1, R"(-)" ); - streamLine( os, i+1, R"(xx)" ); - streamLine( os, i+1, R"(post)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"(
)", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"(
)", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"(
)"); + streamLine(os, i + 1, R"(-)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"(
)", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"(
)"); + streamLine(os, i + 1, R"(-)"); + streamLine(os, i + 1, R"(xx)"); + streamLine(os, i + 1, R"(post)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"(
)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FigureTest.h b/Sourcecode/private/mxtest/core/FigureTest.h index 969765773..f20716946 100644 --- a/Sourcecode/private/mxtest/core/FigureTest.h +++ b/Sourcecode/private/mxtest/core/FigureTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::FigurePtr tgenFigure( TestMode v ); - void tgenFigureExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::FigurePtr tgenFigure(TestMode v); +void tgenFigureExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FiguredBassTest.cpp b/Sourcecode/private/mxtest/core/FiguredBassTest.cpp index 33131e7f0..ec852f2c1 100644 --- a/Sourcecode/private/mxtest/core/FiguredBassTest.cpp +++ b/Sourcecode/private/mxtest/core/FiguredBassTest.cpp @@ -6,137 +6,133 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/FiguredBassTest.h" #include "mxtest/core/EditorialGroupTest.h" #include "mxtest/core/FigureTest.h" +#include "mxtest/core/FiguredBassTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, FiguredBass ) +TEST(Test01, FiguredBass) { TestMode v = TestMode::one; - FiguredBassPtr object = tgenFiguredBass( v ); - stringstream expected; - tgenFiguredBassExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + FiguredBassPtr object = tgenFiguredBass(v); + stringstream expected; + tgenFiguredBassExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, FiguredBass ) + +TEST(Test02, FiguredBass) { TestMode v = TestMode::two; - FiguredBassPtr object = tgenFiguredBass( v ); - stringstream expected; - tgenFiguredBassExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + FiguredBassPtr object = tgenFiguredBass(v); + stringstream expected; + tgenFiguredBassExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, FiguredBass ) + +TEST(Test03, FiguredBass) { TestMode v = TestMode::three; - FiguredBassPtr object = tgenFiguredBass( v ); - stringstream expected; - tgenFiguredBassExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + FiguredBassPtr object = tgenFiguredBass(v); + stringstream expected; + tgenFiguredBassExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - FiguredBassPtr tgenFiguredBass( TestMode v ) +FiguredBassPtr tgenFiguredBass(TestMode v) +{ + FiguredBassPtr o = makeFiguredBass(); + switch (v) { - FiguredBassPtr o = makeFiguredBass(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasDuration( true ); - o->getDuration()->setValue( PositiveDivisionsValue( 29 ) ); - o->addFigure( tgenFigure( TestMode::three ) ); - o->addFigure( tgenFigure( v ) ); - o->removeFigure( o->getFigureSet().cbegin() ); - o->setEditorialGroup( tgenEditorialGroup( v ) ); - o->getAttributes()->hasParentheses = true; - o->getAttributes()->parentheses = YesNo::yes; - } - break; - case TestMode::three: - { - o->addFigure( tgenFigure( TestMode::one ) ); - o->addFigure( tgenFigure( v ) ); - o->removeFigure( o->getFigureSet().cbegin() ); - o->setEditorialGroup( tgenEditorialGroup( v ) ); - o->getAttributes()->hasParentheses = true; - o->getAttributes()->parentheses = YesNo::yes; - o->getAttributes()->hasPrintDot = true; - o->getAttributes()->printDot = YesNo::no; - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasDuration(true); + o->getDuration()->setValue(PositiveDivisionsValue(29)); + o->addFigure(tgenFigure(TestMode::three)); + o->addFigure(tgenFigure(v)); + o->removeFigure(o->getFigureSet().cbegin()); + o->setEditorialGroup(tgenEditorialGroup(v)); + o->getAttributes()->hasParentheses = true; + o->getAttributes()->parentheses = YesNo::yes; + } + break; + case TestMode::three: { + o->addFigure(tgenFigure(TestMode::one)); + o->addFigure(tgenFigure(v)); + o->removeFigure(o->getFigureSet().cbegin()); + o->setEditorialGroup(tgenEditorialGroup(v)); + o->getAttributes()->hasParentheses = true; + o->getAttributes()->parentheses = YesNo::yes; + o->getAttributes()->hasPrintDot = true; + o->getAttributes()->printDot = YesNo::no; } - void tgenFiguredBassExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenFiguredBassExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(
)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenFigureExpected(os, i+1, TestMode::three ); - os << std::endl; - tgenFigureExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(29)" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenFigureExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenFigureExpected( os, i+1, v ); - os << std::endl; - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(
)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenFigureExpected(os, i + 1, TestMode::three); + os << std::endl; + tgenFigureExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(29)"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenFigureExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenFigureExpected(os, i + 1, v); + os << std::endl; + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FiguredBassTest.h b/Sourcecode/private/mxtest/core/FiguredBassTest.h index e479aa493..587a71074 100644 --- a/Sourcecode/private/mxtest/core/FiguredBassTest.h +++ b/Sourcecode/private/mxtest/core/FiguredBassTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::FiguredBassPtr tgenFiguredBass( TestMode v ); - void tgenFiguredBassExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::FiguredBassPtr tgenFiguredBass(TestMode v); +void tgenFiguredBassExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FingeringTest.cpp b/Sourcecode/private/mxtest/core/FingeringTest.cpp index 3394ad31f..be51397e7 100644 --- a/Sourcecode/private/mxtest/core/FingeringTest.cpp +++ b/Sourcecode/private/mxtest/core/FingeringTest.cpp @@ -11,38 +11,41 @@ using namespace mx::core; -TEST( Test01, Fingering ) +TEST(Test01, Fingering) { - std::string indentString( INDENT ); - XsString value1{ "useyourfingers" }; - XsString value2{ "useyourtoes" }; - Fingering object1; - Fingering object2( value2 ); - FingeringAttributesPtr attributes1 = std::make_shared(); - FingeringAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"useyourfingers"}; + XsString value2{"useyourtoes"}; + Fingering object1; + Fingering object2(value2); + FingeringAttributesPtr attributes1 = std::make_shared(); + FingeringAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasAlternate = true; attributes1->alternate = YesNo::yes; attributes1->hasFontFamily = true; - attributes1->fontFamily = CommaSeparatedText{ "Who, put, the bomp, in the bomp" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(useyourtoes)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->fontFamily = CommaSeparatedText{"Who, put, the bomp, in the bomp"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + + R"(useyourtoes)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FingernailsTest.cpp b/Sourcecode/private/mxtest/core/FingernailsTest.cpp index a06552de4..1b6801279 100644 --- a/Sourcecode/private/mxtest/core/FingernailsTest.cpp +++ b/Sourcecode/private/mxtest/core/FingernailsTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Fingernails ) +TEST(Test01, Fingernails) { - std::string indentString( INDENT ); - Fingernails object1; - Fingernails object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Fingernails object1; + Fingernails object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/FirstFretTest.cpp b/Sourcecode/private/mxtest/core/FirstFretTest.cpp index 30bdd1602..c662fdd6d 100644 --- a/Sourcecode/private/mxtest/core/FirstFretTest.cpp +++ b/Sourcecode/private/mxtest/core/FirstFretTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, FirstFret ) +TEST(Test01, FirstFret) { - std::string indentString( INDENT ); - PositiveInteger value1{ 2 }; - PositiveInteger value2{ 33 }; - FirstFret object1; - FirstFret object2( value2 ); - FirstFretAttributesPtr attributes1 = std::make_shared(); - FirstFretAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + PositiveInteger value1{2}; + PositiveInteger value2{33}; + FirstFret object1; + FirstFret object2(value2); + FirstFretAttributesPtr attributes1 = std::make_shared(); + FirstFretAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasText = true; - attributes1->text = XsToken{ "sometext" }; + attributes1->text = XsToken{"sometext"}; attributes1->hasLocation = true; attributes1->location = LeftRight::right; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(33)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(33)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FontSizeTest.cpp b/Sourcecode/private/mxtest/core/FontSizeTest.cpp index d68a6c23b..60e8c6048 100644 --- a/Sourcecode/private/mxtest/core/FontSizeTest.cpp +++ b/Sourcecode/private/mxtest/core/FontSizeTest.cpp @@ -11,75 +11,80 @@ using namespace mx::core; -TEST( FontSize01, FontSize ) +TEST(FontSize01, FontSize) { FontSize x; std::string expected = "0"; - CHECK( !x.getIsCssFontSize() ) - CHECK( x.getIsDecimal() ) - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + CHECK(!x.getIsCssFontSize()) + CHECK(x.getIsDecimal()) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( FontSize02, FontSize ) + +TEST(FontSize02, FontSize) { - FontSize x( Decimal( 31.2 ) ); - CHECK( !x.getIsCssFontSize() ) - CHECK( x.getIsDecimal() ) + FontSize x(Decimal(31.2)); + CHECK(!x.getIsCssFontSize()) + CHECK(x.getIsDecimal()) std::string expected = "31.2"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( FontSize03, FontSize ) + +TEST(FontSize03, FontSize) { - FontSize x( CssFontSize::xSmall ); - CHECK( x.getIsCssFontSize() ) - CHECK( !x.getIsDecimal() ) + FontSize x(CssFontSize::xSmall); + CHECK(x.getIsCssFontSize()) + CHECK(!x.getIsDecimal()) std::string expected = "x-small"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( FontSize04, FontSize ) + +TEST(FontSize04, FontSize) { - FontSize x( "x-large" ); - CHECK( x.getIsCssFontSize() ) - CHECK( !x.getIsDecimal() ) + FontSize x("x-large"); + CHECK(x.getIsCssFontSize()) + CHECK(!x.getIsDecimal()) CssFontSize expected = CssFontSize::xLarge; CssFontSize actual = x.getValueCssFontSize(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( FontSize05, FontSize ) + +TEST(FontSize05, FontSize) { - FontSize x( "24.0" ); - CHECK( ! x.getIsCssFontSize() ) - CHECK( x.getIsDecimal() ) + FontSize x("24.0"); + CHECK(!x.getIsCssFontSize()) + CHECK(x.getIsDecimal()) DecimalType expected = 24; DecimalType actual = x.getValueDecimal().getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, DEFAULT_PRECISION ) + CHECK_DOUBLES_EQUAL(expected, actual, DEFAULT_PRECISION) } -TEST( FontSize06, FontSize ) + +TEST(FontSize06, FontSize) { - FontSize x( "24.0" ); - x.setCssFontSize( CssFontSize::xxLarge ); - CHECK( x.getIsCssFontSize() ) - CHECK( ! x.getIsDecimal() ) + FontSize x("24.0"); + x.setCssFontSize(CssFontSize::xxLarge); + CHECK(x.getIsCssFontSize()) + CHECK(!x.getIsDecimal()) std::string expected = "xx-large"; std::stringstream ss; ss << x; std::string actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( FontSize07, FontSize ) +TEST(FontSize07, FontSize) { - FontSize x( "xx-small" ); - x.setDecimal( Decimal( 30.9 ) ); - CHECK( ! x.getIsCssFontSize() ) - CHECK( x.getIsDecimal() ) + FontSize x("xx-small"); + x.setDecimal(Decimal(30.9)); + CHECK(!x.getIsCssFontSize()) + CHECK(x.getIsDecimal()) std::string expected = "30.9"; std::stringstream ss; - toStream( ss, x ); + toStream(ss, x); std::string actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } #endif diff --git a/Sourcecode/private/mxtest/core/FootnoteTest.cpp b/Sourcecode/private/mxtest/core/FootnoteTest.cpp index 6940f7e39..6e84355b7 100644 --- a/Sourcecode/private/mxtest/core/FootnoteTest.cpp +++ b/Sourcecode/private/mxtest/core/FootnoteTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Footnote ) +TEST(Test01, Footnote) { - std::string indentString( INDENT ); - XsString value1{ "internal" }; - XsString value2{ "external" }; - Footnote object1; - Footnote object2( value2 ); - FootnoteAttributesPtr attributes1 = std::make_shared(); - FootnoteAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"internal"}; + XsString value2{"external"}; + Footnote object1; + Footnote object2(value2); + FootnoteAttributesPtr attributes1 = std::make_shared(); + FootnoteAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasEnclosure = true; attributes1->enclosure = EnclosureShape::diamond; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(external)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(external)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ForwardTest.cpp b/Sourcecode/private/mxtest/core/ForwardTest.cpp index bd4502a4d..812b9c25c 100644 --- a/Sourcecode/private/mxtest/core/ForwardTest.cpp +++ b/Sourcecode/private/mxtest/core/ForwardTest.cpp @@ -6,117 +6,113 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/ForwardTest.h" #include "mxtest/core/EditorialVoiceGroupTest.h" +#include "mxtest/core/ForwardTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Forward ) +TEST(Test01, Forward) { TestMode v = TestMode::one; - ForwardPtr object = tgenForward( v ); - stringstream expected; - tgenForwardExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ForwardPtr object = tgenForward(v); + stringstream expected; + tgenForwardExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Forward ) + +TEST(Test02, Forward) { TestMode v = TestMode::two; - ForwardPtr object = tgenForward( v ); - stringstream expected; - tgenForwardExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ForwardPtr object = tgenForward(v); + stringstream expected; + tgenForwardExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Forward ) + +TEST(Test03, Forward) { TestMode v = TestMode::three; - ForwardPtr object = tgenForward( v ); - stringstream expected; - tgenForwardExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ForwardPtr object = tgenForward(v); + stringstream expected; + tgenForwardExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ForwardPtr tgenForward( TestMode v ) +ForwardPtr tgenForward(TestMode v) +{ + ForwardPtr o = makeForward(); + switch (v) { - ForwardPtr o = makeForward(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getDuration()->setValue( PositiveDivisionsValue( 31 ) ); - o->setEditorialVoiceGroup( tgenEditorialVoiceGroup( v ) ); - } - break; - case TestMode::three: - { - o->getDuration()->setValue( PositiveDivisionsValue( 32 ) ); - o->setEditorialVoiceGroup( tgenEditorialVoiceGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getDuration()->setValue(PositiveDivisionsValue(31)); + o->setEditorialVoiceGroup(tgenEditorialVoiceGroup(v)); + } + break; + case TestMode::three: { + o->getDuration()->setValue(PositiveDivisionsValue(32)); + o->setEditorialVoiceGroup(tgenEditorialVoiceGroup(v)); } - void tgenForwardExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenForwardExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(1)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(31)" ); - tgenEditorialVoiceGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(32)" ); - tgenEditorialVoiceGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(1)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(31)"); + tgenEditorialVoiceGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(32)"); + tgenEditorialVoiceGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ForwardTest.h b/Sourcecode/private/mxtest/core/ForwardTest.h index e761fe6f8..1aaac1a10 100644 --- a/Sourcecode/private/mxtest/core/ForwardTest.h +++ b/Sourcecode/private/mxtest/core/ForwardTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ForwardPtr tgenForward( TestMode v ); - void tgenForwardExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ForwardPtr tgenForward(TestMode v); +void tgenForwardExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FrameFretsTest.cpp b/Sourcecode/private/mxtest/core/FrameFretsTest.cpp index 761260d77..fb7fa66f4 100644 --- a/Sourcecode/private/mxtest/core/FrameFretsTest.cpp +++ b/Sourcecode/private/mxtest/core/FrameFretsTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, FrameFrets ) +TEST(Test01, FrameFrets) { - std::string indentString( INDENT ); - PositiveInteger value1{ 2 }; - PositiveInteger value2{ 3 }; - FrameFrets object1; - FrameFrets object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + PositiveInteger value1{2}; + PositiveInteger value2{3}; + FrameFrets object1; + FrameFrets object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FrameNoteTest.cpp b/Sourcecode/private/mxtest/core/FrameNoteTest.cpp index fb99040a2..e6307a5ab 100644 --- a/Sourcecode/private/mxtest/core/FrameNoteTest.cpp +++ b/Sourcecode/private/mxtest/core/FrameNoteTest.cpp @@ -6,51 +6,52 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, FrameNote ) +TEST(Test01, FrameNote) { - FrameNote object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(1)" ); - streamLine( expected, 2, R"(0)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + FrameNote object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(1)"); + streamLine(expected, 2, R"(0)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, FrameNote ) + +TEST(Test02, FrameNote) { - FrameNote object; - object.setHasBarre( true ); - object.setHasFingering( true ); - object.getFingering()->setValue( XsString( "t" ) ); + FrameNote object; + object.setHasBarre(true); + object.setHasFingering(true); + object.getFingering()->setValue(XsString("t")); object.getFingering()->getAttributes()->hasAlternate = true; object.getFingering()->getAttributes()->alternate = YesNo::yes; - object.getString()->setValue( StringNumber( 5 ) ); - object.getFret()->setValue( NonNegativeInteger( 2 ) ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(5)" ); - streamLine( expected, 2, R"(2)" ); - streamLine( expected, 2, R"(t)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + object.getString()->setValue(StringNumber(5)); + object.getFret()->setValue(NonNegativeInteger(2)); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(5)"); + streamLine(expected, 2, R"(2)"); + streamLine(expected, 2, R"(t)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/FrameStringsTest.cpp b/Sourcecode/private/mxtest/core/FrameStringsTest.cpp index b397a550b..ae008ec41 100644 --- a/Sourcecode/private/mxtest/core/FrameStringsTest.cpp +++ b/Sourcecode/private/mxtest/core/FrameStringsTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, FrameStrings ) +TEST(Test01, FrameStrings) { - std::string indentString( INDENT ); - PositiveInteger value1{ 2 }; - PositiveInteger value2{ 3 }; - FrameStrings object1; - FrameStrings object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + PositiveInteger value1{2}; + PositiveInteger value2{3}; + FrameStrings object1; + FrameStrings object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FrameTest.cpp b/Sourcecode/private/mxtest/core/FrameTest.cpp index 049551d31..e66f17408 100644 --- a/Sourcecode/private/mxtest/core/FrameTest.cpp +++ b/Sourcecode/private/mxtest/core/FrameTest.cpp @@ -6,68 +6,69 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Frame ) +TEST(Test01, Frame) { - Frame object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(1)" ); - streamLine( expected, 2, R"(1)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(1)" ); - streamLine( expected, 3, R"(0)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + Frame object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(1)"); + streamLine(expected, 2, R"(1)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(1)"); + streamLine(expected, 3, R"(0)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Frame ) + +TEST(Test02, Frame) { - Frame object; + Frame object; object.getAttributes()->hasHeight = true; - object.getAttributes()->height = TenthsValue{ 2.3 }; - object.setHasFirstFret( true ); + object.getAttributes()->height = TenthsValue{2.3}; + object.setHasFirstFret(true); auto f = makeFrameNote(); - f->setHasBarre( true ); - f->setHasFingering( true ); - f->getFingering()->setValue( XsString( "Bish" ) ); - f->getString()->setValue( StringNumber( 8 ) ); - f->getFret()->setValue( NonNegativeInteger( 3 ) ); - object.addFrameNote( f ); - (*object.getFrameNoteSet().cbegin())->getString()->setValue( StringNumber( 2 ) ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(1)" ); - streamLine( expected, 2, R"(1)" ); - streamLine( expected, 2, R"(1)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(2)" ); - streamLine( expected, 3, R"(0)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(8)" ); - streamLine( expected, 3, R"(3)" ); - streamLine( expected, 3, R"(Bish)" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + f->setHasBarre(true); + f->setHasFingering(true); + f->getFingering()->setValue(XsString("Bish")); + f->getString()->setValue(StringNumber(8)); + f->getFret()->setValue(NonNegativeInteger(3)); + object.addFrameNote(f); + (*object.getFrameNoteSet().cbegin())->getString()->setValue(StringNumber(2)); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(1)"); + streamLine(expected, 2, R"(1)"); + streamLine(expected, 2, R"(1)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(2)"); + streamLine(expected, 3, R"(0)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(8)"); + streamLine(expected, 3, R"(3)"); + streamLine(expected, 3, R"(Bish)"); + streamLine(expected, 3, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/FretTest.cpp b/Sourcecode/private/mxtest/core/FretTest.cpp index 538daade0..3ad11256b 100644 --- a/Sourcecode/private/mxtest/core/FretTest.cpp +++ b/Sourcecode/private/mxtest/core/FretTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Fret ) +TEST(Test01, Fret) { - std::string indentString( INDENT ); - NonNegativeInteger value1{ 0 }; - NonNegativeInteger value2{ 2 }; - Fret object1; - Fret object2( value2 ); - FretAttributesPtr attributes1 = std::make_shared(); - FretAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + NonNegativeInteger value1{0}; + NonNegativeInteger value2{2}; + Fret object1; + Fret object2(value2); + FretAttributesPtr attributes1 = std::make_shared(); + FretAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontWeight = true; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/FullNoteGroupTest.cpp b/Sourcecode/private/mxtest/core/FullNoteGroupTest.cpp index beb7d37da..98e1ceed2 100644 --- a/Sourcecode/private/mxtest/core/FullNoteGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/FullNoteGroupTest.cpp @@ -6,110 +6,106 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/FullNoteGroupTest.h" #include "mxtest/core/FullNoteTypeChoiceTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, FullNoteGroup ) +TEST(Test01, FullNoteGroup) { TestMode v = TestMode::one; - FullNoteGroupPtr object = tgenFullNoteGroup( v ); - stringstream expected; - tgenFullNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + FullNoteGroupPtr object = tgenFullNoteGroup(v); + stringstream expected; + tgenFullNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, FullNoteGroup ) + +TEST(Test02, FullNoteGroup) { TestMode v = TestMode::two; - FullNoteGroupPtr object = tgenFullNoteGroup( v ); - stringstream expected; - tgenFullNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + FullNoteGroupPtr object = tgenFullNoteGroup(v); + stringstream expected; + tgenFullNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, FullNoteGroup ) + +TEST(Test03, FullNoteGroup) { TestMode v = TestMode::three; - FullNoteGroupPtr object = tgenFullNoteGroup( v ); - stringstream expected; - tgenFullNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + FullNoteGroupPtr object = tgenFullNoteGroup(v); + stringstream expected; + tgenFullNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - FullNoteGroupPtr tgenFullNoteGroup( TestMode v ) +FullNoteGroupPtr tgenFullNoteGroup(TestMode v) +{ + FullNoteGroupPtr o = makeFullNoteGroup(); + switch (v) { - FullNoteGroupPtr o = makeFullNoteGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setFullNoteTypeChoice( tgenFullNoteTypeChoice( v ) ); - } - break; - case TestMode::three: - { - o->setHasChord( true ); - o->setFullNoteTypeChoice( tgenFullNoteTypeChoice( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setFullNoteTypeChoice(tgenFullNoteTypeChoice(v)); + } + break; + case TestMode::three: { + o->setHasChord(true); + o->setFullNoteTypeChoice(tgenFullNoteTypeChoice(v)); + } + break; + default: + break; } - void tgenFullNoteGroupExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenFullNoteGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenFullNoteTypeChoiceExpected( os, i, v ); - } - break; - case TestMode::two: - { - tgenFullNoteTypeChoiceExpected( os, i, v ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenFullNoteTypeChoiceExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenFullNoteTypeChoiceExpected(os, i, v); + } + break; + case TestMode::two: { + tgenFullNoteTypeChoiceExpected(os, i, v); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenFullNoteTypeChoiceExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FullNoteGroupTest.h b/Sourcecode/private/mxtest/core/FullNoteGroupTest.h index 2234c3c66..87b53e88e 100644 --- a/Sourcecode/private/mxtest/core/FullNoteGroupTest.h +++ b/Sourcecode/private/mxtest/core/FullNoteGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::FullNoteGroupPtr tgenFullNoteGroup( TestMode v ); - void tgenFullNoteGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::FullNoteGroupPtr tgenFullNoteGroup(TestMode v); +void tgenFullNoteGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.cpp b/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.cpp index 5b7159774..5a030cb85 100644 --- a/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.cpp @@ -6,8 +6,8 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/FullNoteTypeChoiceTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PitchTest.h" #include "mxtest/core/RestTest.h" #include "mxtest/core/UnpitchedTest.h" @@ -16,102 +16,98 @@ using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, FullNoteTypeChoice ) +TEST(Test01, FullNoteTypeChoice) { TestMode v = TestMode::one; - FullNoteTypeChoicePtr object = tgenFullNoteTypeChoice( v ); - stringstream expected; - tgenFullNoteTypeChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + FullNoteTypeChoicePtr object = tgenFullNoteTypeChoice(v); + stringstream expected; + tgenFullNoteTypeChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, FullNoteTypeChoice ) + +TEST(Test02, FullNoteTypeChoice) { TestMode v = TestMode::two; - FullNoteTypeChoicePtr object = tgenFullNoteTypeChoice( v ); - stringstream expected; - tgenFullNoteTypeChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + FullNoteTypeChoicePtr object = tgenFullNoteTypeChoice(v); + stringstream expected; + tgenFullNoteTypeChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, FullNoteTypeChoice ) + +TEST(Test03, FullNoteTypeChoice) { TestMode v = TestMode::three; - FullNoteTypeChoicePtr object = tgenFullNoteTypeChoice( v ); - stringstream expected; - tgenFullNoteTypeChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + FullNoteTypeChoicePtr object = tgenFullNoteTypeChoice(v); + stringstream expected; + tgenFullNoteTypeChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - FullNoteTypeChoicePtr tgenFullNoteTypeChoice( TestMode v ) +FullNoteTypeChoicePtr tgenFullNoteTypeChoice(TestMode v) +{ + FullNoteTypeChoicePtr o = makeFullNoteTypeChoice(); + switch (v) { - FullNoteTypeChoicePtr o = makeFullNoteTypeChoice(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( FullNoteTypeChoice::Choice::unpitched ); - o->setUnpitched( tgenUnpitched( v ) ); - } - break; - case TestMode::three: - { - o->setChoice( FullNoteTypeChoice::Choice::rest ); - o->setRest( tgenRest( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(FullNoteTypeChoice::Choice::unpitched); + o->setUnpitched(tgenUnpitched(v)); + } + break; + case TestMode::three: { + o->setChoice(FullNoteTypeChoice::Choice::rest); + o->setRest(tgenRest(v)); + } + break; + default: + break; } - void tgenFullNoteTypeChoiceExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenFullNoteTypeChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenPitchExpected( os, i, v ); - } - break; - case TestMode::two: - { - tgenUnpitchedExpected( os, i, v ); - } - break; - case TestMode::three: - { - tgenRestExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenPitchExpected(os, i, v); + } + break; + case TestMode::two: { + tgenUnpitchedExpected(os, i, v); + } + break; + case TestMode::three: { + tgenRestExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.h b/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.h index e39cd72f9..1242bc730 100644 --- a/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.h +++ b/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::FullNoteTypeChoicePtr tgenFullNoteTypeChoice( TestMode v ); - void tgenFullNoteTypeChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::FullNoteTypeChoicePtr tgenFullNoteTypeChoice(TestMode v); +void tgenFullNoteTypeChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/FunctionTest.cpp b/Sourcecode/private/mxtest/core/FunctionTest.cpp index 81adec1ed..338114427 100644 --- a/Sourcecode/private/mxtest/core/FunctionTest.cpp +++ b/Sourcecode/private/mxtest/core/FunctionTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Function ) +TEST(Test01, Function) { - std::string indentString( INDENT ); - XsString value1 { "String1" }; - XsString value2{ "Thing2" }; - Function object1; - Function object2( value2 ); - FunctionAttributesPtr attributes1 = std::make_shared(); - FunctionAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->defaultY = TenthsValue{ 2.1 }; + std::string indentString(INDENT); + XsString value1{"String1"}; + XsString value2{"Thing2"}; + Function object1; + Function object2(value2); + FunctionAttributesPtr attributes1 = std::make_shared(); + FunctionAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->defaultY = TenthsValue{2.1}; attributes1->hasDefaultY = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Thing2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Thing2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/GlassTest.cpp b/Sourcecode/private/mxtest/core/GlassTest.cpp index dadb86f6a..4771a17fb 100644 --- a/Sourcecode/private/mxtest/core/GlassTest.cpp +++ b/Sourcecode/private/mxtest/core/GlassTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Glass ) +TEST(Test01, Glass) { - std::string indentString( INDENT ); - GlassEnum value1 = GlassEnum::windChimes; - GlassEnum value2 = GlassEnum::windChimes; - Glass object1; - Glass object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(wind chimes)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(wind chimes)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + GlassEnum value1 = GlassEnum::windChimes; + GlassEnum value2 = GlassEnum::windChimes; + Glass object1; + Glass object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(wind chimes)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(wind chimes)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/GlissandoTest.cpp b/Sourcecode/private/mxtest/core/GlissandoTest.cpp index 50001d496..27aeeb8fd 100644 --- a/Sourcecode/private/mxtest/core/GlissandoTest.cpp +++ b/Sourcecode/private/mxtest/core/GlissandoTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Glissando ) +TEST(Test01, Glissando) { - std::string indentString( INDENT ); - XsString value1{ "glass" }; - XsString value2{ "brass" }; - Glissando object1; - Glissando object2( value2 ); - GlissandoAttributesPtr attributes1 = std::make_shared(); - GlissandoAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"glass"}; + XsString value2{"brass"}; + Glissando object1; + Glissando object2(value2); + GlissandoAttributesPtr attributes1 = std::make_shared(); + GlissandoAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasDashLength = true; - attributes1->dashLength = TenthsValue{ 2.1 }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(brass)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->dashLength = TenthsValue{2.1}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(brass)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/GraceNoteGroupTest.cpp b/Sourcecode/private/mxtest/core/GraceNoteGroupTest.cpp index 8ca3a77a1..e6a15ba45 100644 --- a/Sourcecode/private/mxtest/core/GraceNoteGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/GraceNoteGroupTest.cpp @@ -6,121 +6,116 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/GraceNoteGroupTest.h" #include "mxtest/core/FullNoteGroupTest.h" +#include "mxtest/core/GraceNoteGroupTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, GraceNoteGroup ) +TEST(Test01, GraceNoteGroup) { TestMode v = TestMode::one; - GraceNoteGroupPtr object = tgenGraceNoteGroup( v ); - stringstream expected; - tgenGraceNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + GraceNoteGroupPtr object = tgenGraceNoteGroup(v); + stringstream expected; + tgenGraceNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, GraceNoteGroup ) + +TEST(Test02, GraceNoteGroup) { TestMode v = TestMode::two; - GraceNoteGroupPtr object = tgenGraceNoteGroup( v ); - stringstream expected; - tgenGraceNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + GraceNoteGroupPtr object = tgenGraceNoteGroup(v); + stringstream expected; + tgenGraceNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, GraceNoteGroup ) + +TEST(Test03, GraceNoteGroup) { TestMode v = TestMode::three; - GraceNoteGroupPtr object = tgenGraceNoteGroup( v ); - stringstream expected; - tgenGraceNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + GraceNoteGroupPtr object = tgenGraceNoteGroup(v); + stringstream expected; + tgenGraceNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - GraceNoteGroupPtr tgenGraceNoteGroup( TestMode v ) +GraceNoteGroupPtr tgenGraceNoteGroup(TestMode v) +{ + GraceNoteGroupPtr o = makeGraceNoteGroup(); + switch (v) { - GraceNoteGroupPtr o = makeGraceNoteGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setFullNoteGroup( tgenFullNoteGroup( v ) ); - auto start = makeTie(); - start->getAttributes()->type = StartStop::start; - auto stop = makeTie(); - stop->getAttributes()->type = StartStop::stop; - o->addTie( start ); - o->addTie( stop ); - - } - break; - case TestMode::three: - { - o->setFullNoteGroup( tgenFullNoteGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setFullNoteGroup(tgenFullNoteGroup(v)); + auto start = makeTie(); + start->getAttributes()->type = StartStop::start; + auto stop = makeTie(); + stop->getAttributes()->type = StartStop::stop; + o->addTie(start); + o->addTie(stop); + } + break; + case TestMode::three: { + o->setFullNoteGroup(tgenFullNoteGroup(v)); } - void tgenGraceNoteGroupExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenGraceNoteGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenFullNoteGroupExpected( os, i, v ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenFullNoteGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenFullNoteGroupExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenFullNoteGroupExpected(os, i, v); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenFullNoteGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenFullNoteGroupExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/GraceNoteGroupTest.h b/Sourcecode/private/mxtest/core/GraceNoteGroupTest.h index 9d75f96f5..897bc5902 100644 --- a/Sourcecode/private/mxtest/core/GraceNoteGroupTest.h +++ b/Sourcecode/private/mxtest/core/GraceNoteGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::GraceNoteGroupPtr tgenGraceNoteGroup( TestMode v ); - void tgenGraceNoteGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::GraceNoteGroupPtr tgenGraceNoteGroup(TestMode v); +void tgenGraceNoteGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/GraceTest.cpp b/Sourcecode/private/mxtest/core/GraceTest.cpp index 77568c4da..f6aeb6f83 100644 --- a/Sourcecode/private/mxtest/core/GraceTest.cpp +++ b/Sourcecode/private/mxtest/core/GraceTest.cpp @@ -11,42 +11,45 @@ using namespace mx::core; -TEST( Test01, Grace ) +TEST(Test01, Grace) { - std::string indentString( INDENT ); - Grace object1; - Grace object2; - GraceAttributesPtr attributes1 = std::make_shared(); - GraceAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Grace object1; + Grace object2; + GraceAttributesPtr attributes1 = std::make_shared(); + GraceAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasMakeTime = true; - attributes1->makeTime = DivisionsValue{ 0.111 }; + attributes1->makeTime = DivisionsValue{0.111}; attributes1->hasSlash = true; attributes1->slash = YesNo::no; attributes1->hasStealTimeFollowing = true; - attributes1->stealTimeFollowing = Percent{ 0.345 }; + attributes1->stealTimeFollowing = Percent{0.345}; attributes1->hasStealTimePrevious = true; - attributes1->stealTimePrevious = Percent{ 0.453214 }; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->stealTimePrevious = Percent{0.453214}; + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.cpp b/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.cpp index fe1496d53..afc13812b 100644 --- a/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.cpp @@ -6,118 +6,114 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/GroupAbbreviationDisplayTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, GroupAbbreviationDisplay ) +TEST(Test01, GroupAbbreviationDisplay) { TestMode v = TestMode::one; - GroupAbbreviationDisplayPtr object = tgenGroupAbbreviationDisplay( v ); - stringstream expected; - tgenGroupAbbreviationDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + GroupAbbreviationDisplayPtr object = tgenGroupAbbreviationDisplay(v); + stringstream expected; + tgenGroupAbbreviationDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, GroupAbbreviationDisplay ) + +TEST(Test02, GroupAbbreviationDisplay) { TestMode v = TestMode::two; - GroupAbbreviationDisplayPtr object = tgenGroupAbbreviationDisplay( v ); - stringstream expected; - tgenGroupAbbreviationDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + GroupAbbreviationDisplayPtr object = tgenGroupAbbreviationDisplay(v); + stringstream expected; + tgenGroupAbbreviationDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, GroupAbbreviationDisplay ) + +TEST(Test03, GroupAbbreviationDisplay) { TestMode v = TestMode::three; - GroupAbbreviationDisplayPtr object = tgenGroupAbbreviationDisplay( v ); - stringstream expected; - tgenGroupAbbreviationDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + GroupAbbreviationDisplayPtr object = tgenGroupAbbreviationDisplay(v); + stringstream expected; + tgenGroupAbbreviationDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - GroupAbbreviationDisplayPtr tgenGroupAbbreviationDisplay( TestMode v ) +GroupAbbreviationDisplayPtr tgenGroupAbbreviationDisplay(TestMode v) +{ + GroupAbbreviationDisplayPtr o = makeGroupAbbreviationDisplay(); + switch (v) { - GroupAbbreviationDisplayPtr o = makeGroupAbbreviationDisplay(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - auto ch = makeDisplayTextOrAccidentalText(); - ch->setChoice( DisplayTextOrAccidentalText::Choice::accidentalText ); - ch->getAccidentalText()->setValue( AccidentalValue::doubleSharp ); - o->addDisplayTextOrAccidentalText( ch ); - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::no; - } - break; - case TestMode::three: - { - auto ch = makeDisplayTextOrAccidentalText(); - ch->setChoice( DisplayTextOrAccidentalText::Choice::displayText ); - ch->getDisplayText()->setValue( XsString( "My Display String!" ) ); - ch->getDisplayText()->getAttributes()->hasSpace = true; - ch->getDisplayText()->getAttributes()->space = XmlSpace::preserve; - o->addDisplayTextOrAccidentalText( ch ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + auto ch = makeDisplayTextOrAccidentalText(); + ch->setChoice(DisplayTextOrAccidentalText::Choice::accidentalText); + ch->getAccidentalText()->setValue(AccidentalValue::doubleSharp); + o->addDisplayTextOrAccidentalText(ch); + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::no; + } + break; + case TestMode::three: { + auto ch = makeDisplayTextOrAccidentalText(); + ch->setChoice(DisplayTextOrAccidentalText::Choice::displayText); + ch->getDisplayText()->setValue(XsString("My Display String!")); + ch->getDisplayText()->getAttributes()->hasSpace = true; + ch->getDisplayText()->getAttributes()->space = XmlSpace::preserve; + o->addDisplayTextOrAccidentalText(ch); + } + break; + default: + break; } - void tgenGroupAbbreviationDisplayExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenGroupAbbreviationDisplayExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(double-sharp)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(My Display String!)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(double-sharp)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(My Display String!)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.h b/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.h index bd9dcdd3f..5f467b4a2 100644 --- a/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.h +++ b/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::GroupAbbreviationDisplayPtr tgenGroupAbbreviationDisplay( TestMode v ); - void tgenGroupAbbreviationDisplayExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::GroupAbbreviationDisplayPtr tgenGroupAbbreviationDisplay(TestMode v); +void tgenGroupAbbreviationDisplayExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/GroupAbbreviationTest.cpp b/Sourcecode/private/mxtest/core/GroupAbbreviationTest.cpp index 6ebb762c5..d1ba1686d 100644 --- a/Sourcecode/private/mxtest/core/GroupAbbreviationTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupAbbreviationTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, GroupAbbreviation ) +TEST(Test01, GroupAbbreviation) { - std::string indentString( INDENT ); - XsString value1{ "Pno." }; - XsString value2{ "Trb." }; - GroupAbbreviation object1; - GroupAbbreviation object2( value2 ); - GroupAbbreviationAttributesPtr attributes1 = std::make_shared(); - GroupAbbreviationAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"Pno."}; + XsString value2{"Trb."}; + GroupAbbreviation object1; + GroupAbbreviation object2(value2); + GroupAbbreviationAttributesPtr attributes1 = std::make_shared(); + GroupAbbreviationAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasJustify = true; attributes1->justify = LeftCenterRight::center; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Trb.)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Trb.)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/GroupBarlineTest.cpp b/Sourcecode/private/mxtest/core/GroupBarlineTest.cpp index 5b846c64c..379560b62 100644 --- a/Sourcecode/private/mxtest/core/GroupBarlineTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupBarlineTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, GroupBarline ) +TEST(Test01, GroupBarline) { - std::string indentString( INDENT ); - GroupBarlineValue value1 = GroupBarlineValue::mensurstrich; - GroupBarlineValue value2 = GroupBarlineValue::no; - GroupBarline object1; - GroupBarline object2( value2 ); - GroupBarlineAttributesPtr attributes1 = std::make_shared(); - GroupBarlineAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + GroupBarlineValue value1 = GroupBarlineValue::mensurstrich; + GroupBarlineValue value2 = GroupBarlineValue::no; + GroupBarline object1; + GroupBarline object2(value2); + GroupBarlineAttributesPtr attributes1 = std::make_shared(); + GroupBarlineAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasColor = true; - Color c{ 31, 88, 255 }; + Color c{31, 88, 255}; attributes1->color = c; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(yes)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(no)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(yes)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(no)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/GroupNameDisplayTest.cpp b/Sourcecode/private/mxtest/core/GroupNameDisplayTest.cpp index ced9a33af..c55dfbdd2 100644 --- a/Sourcecode/private/mxtest/core/GroupNameDisplayTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupNameDisplayTest.cpp @@ -6,119 +6,114 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/GroupNameDisplayTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, GroupNameDisplay ) +TEST(Test01, GroupNameDisplay) { TestMode v = TestMode::one; - GroupNameDisplayPtr object = tgenGroupNameDisplay( v ); - stringstream expected; - tgenGroupNameDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + GroupNameDisplayPtr object = tgenGroupNameDisplay(v); + stringstream expected; + tgenGroupNameDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, GroupNameDisplay ) + +TEST(Test02, GroupNameDisplay) { TestMode v = TestMode::two; - GroupNameDisplayPtr object = tgenGroupNameDisplay( v ); - stringstream expected; - tgenGroupNameDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + GroupNameDisplayPtr object = tgenGroupNameDisplay(v); + stringstream expected; + tgenGroupNameDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, GroupNameDisplay ) + +TEST(Test03, GroupNameDisplay) { TestMode v = TestMode::three; - GroupNameDisplayPtr object = tgenGroupNameDisplay( v ); - stringstream expected; - tgenGroupNameDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + GroupNameDisplayPtr object = tgenGroupNameDisplay(v); + stringstream expected; + tgenGroupNameDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - GroupNameDisplayPtr tgenGroupNameDisplay( TestMode v ) +GroupNameDisplayPtr tgenGroupNameDisplay(TestMode v) +{ + GroupNameDisplayPtr o = makeGroupNameDisplay(); + switch (v) { - GroupNameDisplayPtr o = makeGroupNameDisplay(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - auto ch = makeDisplayTextOrAccidentalText(); - ch->setChoice( DisplayTextOrAccidentalText::Choice::accidentalText ); - ch->getAccidentalText()->setValue( AccidentalValue::doubleSharp ); - o->addDisplayTextOrAccidentalText( ch ); - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::no; - } - break; - case TestMode::three: - { - auto ch = makeDisplayTextOrAccidentalText(); - ch->setChoice( DisplayTextOrAccidentalText::Choice::displayText ); - ch->getDisplayText()->setValue( XsString( "My Display String!" ) ); - ch->getDisplayText()->getAttributes()->hasSpace = true; - ch->getDisplayText()->getAttributes()->space = XmlSpace::preserve; - o->addDisplayTextOrAccidentalText( ch ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + auto ch = makeDisplayTextOrAccidentalText(); + ch->setChoice(DisplayTextOrAccidentalText::Choice::accidentalText); + ch->getAccidentalText()->setValue(AccidentalValue::doubleSharp); + o->addDisplayTextOrAccidentalText(ch); + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::no; + } + break; + case TestMode::three: { + auto ch = makeDisplayTextOrAccidentalText(); + ch->setChoice(DisplayTextOrAccidentalText::Choice::displayText); + ch->getDisplayText()->setValue(XsString("My Display String!")); + ch->getDisplayText()->getAttributes()->hasSpace = true; + ch->getDisplayText()->getAttributes()->space = XmlSpace::preserve; + o->addDisplayTextOrAccidentalText(ch); + } + break; + default: + break; } - void tgenGroupNameDisplayExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenGroupNameDisplayExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(double-sharp)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(My Display String!)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(double-sharp)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(My Display String!)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/GroupNameDisplayTest.h b/Sourcecode/private/mxtest/core/GroupNameDisplayTest.h index 59cc7159d..fd51e7a7d 100644 --- a/Sourcecode/private/mxtest/core/GroupNameDisplayTest.h +++ b/Sourcecode/private/mxtest/core/GroupNameDisplayTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::GroupNameDisplayPtr tgenGroupNameDisplay( TestMode v ); - void tgenGroupNameDisplayExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::GroupNameDisplayPtr tgenGroupNameDisplay(TestMode v); +void tgenGroupNameDisplayExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/GroupNameTest.cpp b/Sourcecode/private/mxtest/core/GroupNameTest.cpp index 771087155..8ea7d8758 100644 --- a/Sourcecode/private/mxtest/core/GroupNameTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupNameTest.cpp @@ -14,39 +14,41 @@ using namespace mx::core; -TEST( Test01, GroupName ) +TEST(Test01, GroupName) { - std::string indentString( INDENT ); - XsString value1{ "Piano" }; - XsString value2{ "Strings" }; - GroupName object1; - GroupName object2( value2 ); - GroupNameAttributesPtr attributes1 = std::make_shared(); - GroupNameAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Piano"}; + XsString value2{"Strings"}; + GroupName object1; + GroupName object2(value2); + GroupNameAttributesPtr attributes1 = std::make_shared(); + GroupNameAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontSize = true; - attributes1->fontSize = FontSize{ Decimal{ 12.1 } }; - attributes1->defaultY = TenthsValue{ 8.1 }; + attributes1->fontSize = FontSize{Decimal{12.1}}; + attributes1->defaultY = TenthsValue{8.1}; attributes1->hasDefaultY = true; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Strings)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Strings)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/GroupSymbolTest.cpp b/Sourcecode/private/mxtest/core/GroupSymbolTest.cpp index 52fda6be9..d13a733e5 100644 --- a/Sourcecode/private/mxtest/core/GroupSymbolTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupSymbolTest.cpp @@ -11,39 +11,42 @@ using namespace mx::core; -TEST( Test01, GroupSymbol ) +TEST(Test01, GroupSymbol) { - std::string indentString( INDENT ); - GroupSymbolValue value1 = GroupSymbolValue::brace; - GroupSymbolValue value2 = GroupSymbolValue::bracket; - GroupSymbol object1; - GroupSymbol object2( value2 ); - GroupSymbolAttributesPtr attributes1 = std::make_shared(); - GroupSymbolAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + GroupSymbolValue value1 = GroupSymbolValue::brace; + GroupSymbolValue value2 = GroupSymbolValue::bracket; + GroupSymbol object1; + GroupSymbol object2(value2); + GroupSymbolAttributesPtr attributes1 = std::make_shared(); + GroupSymbolAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasRelativeX = true; - attributes1->relativeX = TenthsValue( 2.3 ); + attributes1->relativeX = TenthsValue(2.3); attributes1->hasDefaultY = true; - attributes1->defaultY = TenthsValue( -9.9 ); - - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(none)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(bracket)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->defaultY = TenthsValue(-9.9); + + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(none)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"(bracket)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/GroupTest.cpp b/Sourcecode/private/mxtest/core/GroupTest.cpp index 0b3d95c4c..64e707d88 100644 --- a/Sourcecode/private/mxtest/core/GroupTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Group ) +TEST(Test01, Group) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - Group object1; - Group object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + Group object1; + Group object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/GroupTimeTest.cpp b/Sourcecode/private/mxtest/core/GroupTimeTest.cpp index 081c0beca..37422d55d 100644 --- a/Sourcecode/private/mxtest/core/GroupTimeTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupTimeTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, GroupTime ) +TEST(Test01, GroupTime) { - std::string indentString( INDENT ); - GroupTime object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + GroupTime object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/GroupingTest.cpp b/Sourcecode/private/mxtest/core/GroupingTest.cpp index 0a6f4e502..c843eeece 100644 --- a/Sourcecode/private/mxtest/core/GroupingTest.cpp +++ b/Sourcecode/private/mxtest/core/GroupingTest.cpp @@ -6,124 +6,120 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/GroupingTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Grouping ) +TEST(Test01, Grouping) { TestMode v = TestMode::one; - GroupingPtr object = tgenGrouping( v ); - stringstream expected; - tgenGroupingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + GroupingPtr object = tgenGrouping(v); + stringstream expected; + tgenGroupingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Grouping ) + +TEST(Test02, Grouping) { TestMode v = TestMode::two; - GroupingPtr object = tgenGrouping( v ); - stringstream expected; - tgenGroupingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + GroupingPtr object = tgenGrouping(v); + stringstream expected; + tgenGroupingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Grouping ) + +TEST(Test03, Grouping) { TestMode v = TestMode::three; - GroupingPtr object = tgenGrouping( v ); - stringstream expected; - tgenGroupingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + GroupingPtr object = tgenGrouping(v); + stringstream expected; + tgenGroupingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - GroupingPtr tgenGrouping( TestMode v ) +GroupingPtr tgenGrouping(TestMode v) +{ + GroupingPtr o = makeGrouping(); + switch (v) { - GroupingPtr o = makeGrouping(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasNumber = true; - auto f1 = makeFeature(); - f1->setValue( XsString( "Schenker" ) ); - f1->getAttributes()->hasType = true; - f1->getAttributes()->type = XsToken( "Type Two" ); - o->addFeature( f1 ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasMemberOf = true; - o->getAttributes()->type = StartStopSingle::stop; - o->getAttributes()->memberOf = XsToken( "Some Member" ); - auto f1 = makeFeature(); - f1->setValue( XsString( "Strauss" ) ); - f1->getAttributes()->hasType = true; - f1->getAttributes()->type = XsToken( "Type Three" ); - o->addFeature( f1 ); - auto f2 = makeFeature(); - f2->setValue( XsString( "Bones" ) ); - o->addFeature( f2 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasNumber = true; + auto f1 = makeFeature(); + f1->setValue(XsString("Schenker")); + f1->getAttributes()->hasType = true; + f1->getAttributes()->type = XsToken("Type Two"); + o->addFeature(f1); + } + break; + case TestMode::three: { + o->getAttributes()->hasMemberOf = true; + o->getAttributes()->type = StartStopSingle::stop; + o->getAttributes()->memberOf = XsToken("Some Member"); + auto f1 = makeFeature(); + f1->setValue(XsString("Strauss")); + f1->getAttributes()->hasType = true; + f1->getAttributes()->type = XsToken("Type Three"); + o->addFeature(f1); + auto f2 = makeFeature(); + f2->setValue(XsString("Bones")); + o->addFeature(f2); + } + break; + default: + break; } - void tgenGroupingExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenGroupingExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Schenker)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Strauss)" ); - streamLine( os, i+1, R"(Bones)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Schenker)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Strauss)"); + streamLine(os, i + 1, R"(Bones)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/GroupingTest.h b/Sourcecode/private/mxtest/core/GroupingTest.h index 9cf20b301..c29fe67df 100644 --- a/Sourcecode/private/mxtest/core/GroupingTest.h +++ b/Sourcecode/private/mxtest/core/GroupingTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::GroupingPtr tgenGrouping( TestMode v ); - void tgenGroupingExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::GroupingPtr tgenGrouping(TestMode v); +void tgenGroupingExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HammerOnTest.cpp b/Sourcecode/private/mxtest/core/HammerOnTest.cpp index 543a5e670..e0e2e60c2 100644 --- a/Sourcecode/private/mxtest/core/HammerOnTest.cpp +++ b/Sourcecode/private/mxtest/core/HammerOnTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, HammerOn ) +TEST(Test01, HammerOn) { - std::string indentString( INDENT ); - XsString value1{ "Van Halen" }; - XsString value2{ "Metallica" }; - HammerOn object1; - HammerOn object2( value2 ); - HammerOnAttributesPtr attributes1 = std::make_shared(); - HammerOnAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"Van Halen"}; + XsString value2{"Metallica"}; + HammerOn object1; + HammerOn object2(value2); + HammerOnAttributesPtr attributes1 = std::make_shared(); + HammerOnAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->type = StartStop::stop; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Metallica)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Metallica)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/HandbellTest.cpp b/Sourcecode/private/mxtest/core/HandbellTest.cpp index bd70ebfb7..b12cdac1b 100644 --- a/Sourcecode/private/mxtest/core/HandbellTest.cpp +++ b/Sourcecode/private/mxtest/core/HandbellTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, Handbell ) +TEST(Test01, Handbell) { - std::string indentString( INDENT ); - HandbellValue value1 = HandbellValue::malletLift; - HandbellValue value2 = HandbellValue::gyro; - Handbell object1; - Handbell object2( value2 ); - HandbellAttributesPtr attributes1 = std::make_shared(); - HandbellAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + HandbellValue value1 = HandbellValue::malletLift; + HandbellValue value2 = HandbellValue::gyro; + Handbell object1; + Handbell object2(value2); + HandbellAttributesPtr attributes1 = std::make_shared(); + HandbellAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontStyle = true; attributes1->fontStyle = FontStyle::italic; attributes1->hasRelativeX = true; - attributes1->relativeX = TenthsValue{ -0.0001 }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(damp)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(gyro)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->relativeX = TenthsValue{-0.0001}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(damp)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(gyro)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.cpp b/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.cpp index d55eb3489..0dc21b4b1 100644 --- a/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.cpp @@ -6,107 +6,103 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/HarmonicInfoChoiceTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, HarmonicInfoChoice ) +TEST(Test01, HarmonicInfoChoice) { TestMode v = TestMode::one; - HarmonicInfoChoicePtr object = tgenHarmonicInfoChoice( v ); - stringstream expected; - tgenHarmonicInfoChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonicInfoChoicePtr object = tgenHarmonicInfoChoice(v); + stringstream expected; + tgenHarmonicInfoChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, HarmonicInfoChoice ) + +TEST(Test02, HarmonicInfoChoice) { TestMode v = TestMode::two; - HarmonicInfoChoicePtr object = tgenHarmonicInfoChoice( v ); - stringstream expected; - tgenHarmonicInfoChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonicInfoChoicePtr object = tgenHarmonicInfoChoice(v); + stringstream expected; + tgenHarmonicInfoChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, HarmonicInfoChoice ) + +TEST(Test03, HarmonicInfoChoice) { TestMode v = TestMode::three; - HarmonicInfoChoicePtr object = tgenHarmonicInfoChoice( v ); - stringstream expected; - tgenHarmonicInfoChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonicInfoChoicePtr object = tgenHarmonicInfoChoice(v); + stringstream expected; + tgenHarmonicInfoChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - HarmonicInfoChoicePtr tgenHarmonicInfoChoice( TestMode v ) +HarmonicInfoChoicePtr tgenHarmonicInfoChoice(TestMode v) +{ + HarmonicInfoChoicePtr o = makeHarmonicInfoChoice(); + switch (v) { - HarmonicInfoChoicePtr o = makeHarmonicInfoChoice(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( HarmonicInfoChoice::Choice::touchingPitch ); - } - break; - case TestMode::three: - { - o->setChoice( HarmonicInfoChoice::Choice::soundingPitch ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(HarmonicInfoChoice::Choice::touchingPitch); + } + break; + case TestMode::three: { + o->setChoice(HarmonicInfoChoice::Choice::soundingPitch); + } + break; + default: + break; } - void tgenHarmonicInfoChoiceExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenHarmonicInfoChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.h b/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.h index 05256d468..9b390ff01 100644 --- a/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.h +++ b/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::HarmonicInfoChoicePtr tgenHarmonicInfoChoice( TestMode v ); - void tgenHarmonicInfoChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::HarmonicInfoChoicePtr tgenHarmonicInfoChoice(TestMode v); +void tgenHarmonicInfoChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarmonicTest.cpp b/Sourcecode/private/mxtest/core/HarmonicTest.cpp index fb7c7df48..7de6b7ce2 100644 --- a/Sourcecode/private/mxtest/core/HarmonicTest.cpp +++ b/Sourcecode/private/mxtest/core/HarmonicTest.cpp @@ -6,127 +6,123 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/HarmonicInfoChoiceTest.h" #include "mxtest/core/HarmonicTest.h" #include "mxtest/core/HarmonicTypeChoiceTest.h" -#include "mxtest/core/HarmonicInfoChoiceTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Harmonic ) +TEST(Test01, Harmonic) { TestMode v = TestMode::one; - HarmonicPtr object = tgenHarmonic( v ); - stringstream expected; - tgenHarmonicExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + HarmonicPtr object = tgenHarmonic(v); + stringstream expected; + tgenHarmonicExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Harmonic ) + +TEST(Test02, Harmonic) { TestMode v = TestMode::two; - HarmonicPtr object = tgenHarmonic( v ); - stringstream expected; - tgenHarmonicExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + HarmonicPtr object = tgenHarmonic(v); + stringstream expected; + tgenHarmonicExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Harmonic ) + +TEST(Test03, Harmonic) { TestMode v = TestMode::three; - HarmonicPtr object = tgenHarmonic( v ); - stringstream expected; - tgenHarmonicExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + HarmonicPtr object = tgenHarmonic(v); + stringstream expected; + tgenHarmonicExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - HarmonicPtr tgenHarmonic( TestMode v ) +HarmonicPtr tgenHarmonic(TestMode v) +{ + HarmonicPtr o = makeHarmonic(); + switch (v) { - HarmonicPtr o = makeHarmonic(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasHarmonicTypeChoice( true ); - o->setHarmonicTypeChoice( tgenHarmonicTypeChoice( v ) ); - o->setHasHarmonicInfoChoice( true ); - o->setHarmonicInfoChoice( tgenHarmonicInfoChoice( v ) ); - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::no; - o->getAttributes()->hasFontWeight = true; - o->getAttributes()->fontWeight = FontWeight::bold; - } - break; - case TestMode::three: - { - o->setHasHarmonicTypeChoice( true ); - o->setHarmonicTypeChoice( tgenHarmonicTypeChoice( v ) ); - o->setHasHarmonicInfoChoice( true ); - o->setHarmonicInfoChoice( tgenHarmonicInfoChoice( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasHarmonicTypeChoice(true); + o->setHarmonicTypeChoice(tgenHarmonicTypeChoice(v)); + o->setHasHarmonicInfoChoice(true); + o->setHarmonicInfoChoice(tgenHarmonicInfoChoice(v)); + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::no; + o->getAttributes()->hasFontWeight = true; + o->getAttributes()->fontWeight = FontWeight::bold; } - void tgenHarmonicExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->setHasHarmonicTypeChoice(true); + o->setHarmonicTypeChoice(tgenHarmonicTypeChoice(v)); + o->setHasHarmonicInfoChoice(true); + o->setHarmonicInfoChoice(tgenHarmonicInfoChoice(v)); + } + break; + default: + break; + } + return o; +} + +void tgenHarmonicExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { + case TestMode::one: { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenHarmonicTypeChoiceExpected( os, i+1, v ); - os << std::endl; - tgenHarmonicInfoChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenHarmonicTypeChoiceExpected( os, i+1, v ); - os << std::endl; - tgenHarmonicInfoChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenHarmonicTypeChoiceExpected(os, i + 1, v); + os << std::endl; + tgenHarmonicInfoChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenHarmonicTypeChoiceExpected(os, i + 1, v); + os << std::endl; + tgenHarmonicInfoChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarmonicTest.h b/Sourcecode/private/mxtest/core/HarmonicTest.h index 18dc03c0e..7ed646e43 100644 --- a/Sourcecode/private/mxtest/core/HarmonicTest.h +++ b/Sourcecode/private/mxtest/core/HarmonicTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::HarmonicPtr tgenHarmonic( TestMode v ); - void tgenHarmonicExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::HarmonicPtr tgenHarmonic(TestMode v); +void tgenHarmonicExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.cpp b/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.cpp index f0cbc31aa..81c423bce 100644 --- a/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.cpp @@ -6,107 +6,103 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/HarmonicTypeChoiceTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, HarmonicTypeChoice ) +TEST(Test01, HarmonicTypeChoice) { TestMode v = TestMode::one; - HarmonicTypeChoicePtr object = tgenHarmonicTypeChoice( v ); - stringstream expected; - tgenHarmonicTypeChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonicTypeChoicePtr object = tgenHarmonicTypeChoice(v); + stringstream expected; + tgenHarmonicTypeChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, HarmonicTypeChoice ) + +TEST(Test02, HarmonicTypeChoice) { TestMode v = TestMode::two; - HarmonicTypeChoicePtr object = tgenHarmonicTypeChoice( v ); - stringstream expected; - tgenHarmonicTypeChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonicTypeChoicePtr object = tgenHarmonicTypeChoice(v); + stringstream expected; + tgenHarmonicTypeChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, HarmonicTypeChoice ) + +TEST(Test03, HarmonicTypeChoice) { TestMode v = TestMode::three; - HarmonicTypeChoicePtr object = tgenHarmonicTypeChoice( v ); - stringstream expected; - tgenHarmonicTypeChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonicTypeChoicePtr object = tgenHarmonicTypeChoice(v); + stringstream expected; + tgenHarmonicTypeChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - HarmonicTypeChoicePtr tgenHarmonicTypeChoice( TestMode v ) +HarmonicTypeChoicePtr tgenHarmonicTypeChoice(TestMode v) +{ + HarmonicTypeChoicePtr o = makeHarmonicTypeChoice(); + switch (v) { - HarmonicTypeChoicePtr o = makeHarmonicTypeChoice(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( HarmonicTypeChoice::Choice::artificial ); - } - break; - case TestMode::three: - { - o->setChoice( HarmonicTypeChoice::Choice::natural ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(HarmonicTypeChoice::Choice::artificial); + } + break; + case TestMode::three: { + o->setChoice(HarmonicTypeChoice::Choice::natural); + } + break; + default: + break; } - void tgenHarmonicTypeChoiceExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenHarmonicTypeChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.h b/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.h index 9940e1432..42903acb3 100644 --- a/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.h +++ b/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::HarmonicTypeChoicePtr tgenHarmonicTypeChoice( TestMode v ); - void tgenHarmonicTypeChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::HarmonicTypeChoicePtr tgenHarmonicTypeChoice(TestMode v); +void tgenHarmonicTypeChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.cpp b/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.cpp index cdb76a2e5..73d7070d9 100644 --- a/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.cpp @@ -6,137 +6,133 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/HarmonyChordGroupTest.h" -#include "mxtest/core/VirtualInstrumentTest.h" -#include "mxtest/core/EncodingTest.h" -#include "mxtest/core/RootTest.h" #include "mxtest/core/BassTest.h" #include "mxtest/core/DegreeTest.h" +#include "mxtest/core/EncodingTest.h" +#include "mxtest/core/HarmonyChordGroupTest.h" +#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/RootTest.h" +#include "mxtest/core/VirtualInstrumentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, HarmonyChordGroup ) +TEST(Test01, HarmonyChordGroup) { TestMode v = TestMode::one; - HarmonyChordGroupPtr object = tgenHarmonyChordGroup( v ); - stringstream expected; - tgenHarmonyChordGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonyChordGroupPtr object = tgenHarmonyChordGroup(v); + stringstream expected; + tgenHarmonyChordGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, HarmonyChordGroup ) + +TEST(Test02, HarmonyChordGroup) { TestMode v = TestMode::two; - HarmonyChordGroupPtr object = tgenHarmonyChordGroup( v ); - stringstream expected; - tgenHarmonyChordGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonyChordGroupPtr object = tgenHarmonyChordGroup(v); + stringstream expected; + tgenHarmonyChordGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, HarmonyChordGroup ) + +TEST(Test03, HarmonyChordGroup) { TestMode v = TestMode::three; - HarmonyChordGroupPtr object = tgenHarmonyChordGroup( v ); - stringstream expected; - tgenHarmonyChordGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + HarmonyChordGroupPtr object = tgenHarmonyChordGroup(v); + stringstream expected; + tgenHarmonyChordGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - HarmonyChordGroupPtr tgenHarmonyChordGroup( TestMode v ) +HarmonyChordGroupPtr tgenHarmonyChordGroup(TestMode v) +{ + HarmonyChordGroupPtr o = makeHarmonyChordGroup(); + switch (v) { - HarmonyChordGroupPtr o = makeHarmonyChordGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setRoot( tgenRoot( v ) ); - o->setChoice( HarmonyChordGroup::Choice::function ); - o->getFunction()->setValue( XsString("II" ) ); - o->getKind()->setValue( KindValue::diminished ); - o->setHasBass( true ); - o->setBass( tgenBass( v ) ); - o->addDegree( tgenDegree( v ) ); - } - break; - case TestMode::three: - { - o->setRoot( tgenRoot( v ) ); - o->setChoice( HarmonyChordGroup::Choice::root ); - o->getKind()->setValue( KindValue::dominant13th ); - o->setHasBass( true ); - o->setBass( tgenBass( v ) ); - o->addDegree( tgenDegree( TestMode::one ) ); - o->addDegree( tgenDegree( TestMode::three ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setRoot(tgenRoot(v)); + o->setChoice(HarmonyChordGroup::Choice::function); + o->getFunction()->setValue(XsString("II")); + o->getKind()->setValue(KindValue::diminished); + o->setHasBass(true); + o->setBass(tgenBass(v)); + o->addDegree(tgenDegree(v)); + } + break; + case TestMode::three: { + o->setRoot(tgenRoot(v)); + o->setChoice(HarmonyChordGroup::Choice::root); + o->getKind()->setValue(KindValue::dominant13th); + o->setHasBass(true); + o->setBass(tgenBass(v)); + o->addDegree(tgenDegree(TestMode::one)); + o->addDegree(tgenDegree(TestMode::three)); } - void tgenHarmonyChordGroupExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenHarmonyChordGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenRootExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(none)", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"(II)" ); - streamLine( os, i, R"(diminished)" ); - tgenBassExpected( os, i, v ); - os << std::endl; - tgenDegreeExpected( os, i, v ); - } - break; - case TestMode::three: - { - tgenRootExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(dominant-13th)" ); - tgenBassExpected( os, i, v ); - os << std::endl; - tgenDegreeExpected(os, i, TestMode::one ); - os << std::endl; - tgenDegreeExpected(os, i, TestMode::three ); - } - break; - default: - break; - } + case TestMode::one: { + tgenRootExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(none)", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"(II)"); + streamLine(os, i, R"(diminished)"); + tgenBassExpected(os, i, v); + os << std::endl; + tgenDegreeExpected(os, i, v); + } + break; + case TestMode::three: { + tgenRootExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(dominant-13th)"); + tgenBassExpected(os, i, v); + os << std::endl; + tgenDegreeExpected(os, i, TestMode::one); + os << std::endl; + tgenDegreeExpected(os, i, TestMode::three); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.h b/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.h index 0b6600d81..ce7af7ea2 100644 --- a/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.h +++ b/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::HarmonyChordGroupPtr tgenHarmonyChordGroup( TestMode v ); - void tgenHarmonyChordGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::HarmonyChordGroupPtr tgenHarmonyChordGroup(TestMode v); +void tgenHarmonyChordGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarmonyTest.cpp b/Sourcecode/private/mxtest/core/HarmonyTest.cpp index 952573f07..7ec04deda 100644 --- a/Sourcecode/private/mxtest/core/HarmonyTest.cpp +++ b/Sourcecode/private/mxtest/core/HarmonyTest.cpp @@ -6,151 +6,147 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/HarmonyTest.h" #include "mxtest/core/EditorialGroupTest.h" #include "mxtest/core/HarmonyChordGroupTest.h" +#include "mxtest/core/HarmonyTest.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Harmony ) +TEST(Test01, Harmony) { TestMode v = TestMode::one; - HarmonyPtr object = tgenHarmony( v ); - stringstream expected; - tgenHarmonyExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + HarmonyPtr object = tgenHarmony(v); + stringstream expected; + tgenHarmonyExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Harmony ) + +TEST(Test02, Harmony) { TestMode v = TestMode::two; - HarmonyPtr object = tgenHarmony( v ); - stringstream expected; - tgenHarmonyExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + HarmonyPtr object = tgenHarmony(v); + stringstream expected; + tgenHarmonyExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Harmony ) + +TEST(Test03, Harmony) { TestMode v = TestMode::three; - HarmonyPtr object = tgenHarmony( v ); - stringstream expected; - tgenHarmonyExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + HarmonyPtr object = tgenHarmony(v); + stringstream expected; + tgenHarmonyExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - HarmonyPtr tgenHarmony( TestMode v ) +HarmonyPtr tgenHarmony(TestMode v) +{ + HarmonyPtr o = makeHarmony(); + switch (v) { - HarmonyPtr o = makeHarmony(); - switch ( v ) - { - case TestMode::one: - { - o->addHarmonyChordGroup( tgenHarmonyChordGroup( TestMode::one ) ); - o->removeHarmonyChordGroup( o->getHarmonyChordGroupSet().cbegin() ); - } - break; - case TestMode::two: - { - o->getAttributes()->hasPlacement = true; - o->getAttributes()->placement = AboveBelow::below; - o->addHarmonyChordGroup( tgenHarmonyChordGroup( TestMode::one ) ); - o->removeHarmonyChordGroup( o->getHarmonyChordGroupSet().cbegin() ); - o->addHarmonyChordGroup( tgenHarmonyChordGroup( TestMode::two ) ); - o->setHasFrame( true ); - o->getFrame()->getFrameStrings()->setValue( PositiveInteger( 3 ) ); - o->setHasStaff( true ); - o->getStaff()->setValue( PositiveInteger( 2 ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasDefaultX = true; - o->getAttributes()->defaultX = TenthsValue( 5 ); - o->addHarmonyChordGroup( tgenHarmonyChordGroup( TestMode::one ) ); - o->removeHarmonyChordGroup( o->getHarmonyChordGroupSet().cbegin() ); - o->addHarmonyChordGroup( tgenHarmonyChordGroup( TestMode::two ) ); - o->addHarmonyChordGroup( tgenHarmonyChordGroup( TestMode::three ) ); - o->setHasOffset( true ); - o->getOffset()->setValue( DivisionsValue( 1.1 ) ); - o->setEditorialGroup( tgenEditorialGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->addHarmonyChordGroup(tgenHarmonyChordGroup(TestMode::one)); + o->removeHarmonyChordGroup(o->getHarmonyChordGroupSet().cbegin()); + } + break; + case TestMode::two: { + o->getAttributes()->hasPlacement = true; + o->getAttributes()->placement = AboveBelow::below; + o->addHarmonyChordGroup(tgenHarmonyChordGroup(TestMode::one)); + o->removeHarmonyChordGroup(o->getHarmonyChordGroupSet().cbegin()); + o->addHarmonyChordGroup(tgenHarmonyChordGroup(TestMode::two)); + o->setHasFrame(true); + o->getFrame()->getFrameStrings()->setValue(PositiveInteger(3)); + o->setHasStaff(true); + o->getStaff()->setValue(PositiveInteger(2)); + } + break; + case TestMode::three: { + o->getAttributes()->hasDefaultX = true; + o->getAttributes()->defaultX = TenthsValue(5); + o->addHarmonyChordGroup(tgenHarmonyChordGroup(TestMode::one)); + o->removeHarmonyChordGroup(o->getHarmonyChordGroupSet().cbegin()); + o->addHarmonyChordGroup(tgenHarmonyChordGroup(TestMode::two)); + o->addHarmonyChordGroup(tgenHarmonyChordGroup(TestMode::three)); + o->setHasOffset(true); + o->getOffset()->setValue(DivisionsValue(1.1)); + o->setEditorialGroup(tgenEditorialGroup(v)); } - void tgenHarmonyExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenHarmonyExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenHarmonyChordGroupExpected(os, i+1, TestMode::one ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenHarmonyChordGroupExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenHarmonyChordGroupExpected(os, i+1, TestMode::two ); - os << std::endl; - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(3)" ); - streamLine( os, i+2, R"(1)" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+3, R"(1)" ); - streamLine( os, i+3, R"(0)" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(2)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenHarmonyChordGroupExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenHarmonyChordGroupExpected(os, i+1, TestMode::two ); - os << std::endl; - tgenHarmonyChordGroupExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i+1, R"(1.1)" ); - tgenEditorialGroupExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenHarmonyChordGroupExpected(os, i + 1, TestMode::one); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenHarmonyChordGroupExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenHarmonyChordGroupExpected(os, i + 1, TestMode::two); + os << std::endl; + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(3)"); + streamLine(os, i + 2, R"(1)"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 3, R"(1)"); + streamLine(os, i + 3, R"(0)"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(2)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenHarmonyChordGroupExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenHarmonyChordGroupExpected(os, i + 1, TestMode::two); + os << std::endl; + tgenHarmonyChordGroupExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i + 1, R"(1.1)"); + tgenEditorialGroupExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/HarmonyTest.h b/Sourcecode/private/mxtest/core/HarmonyTest.h index baac27350..68cb84d45 100644 --- a/Sourcecode/private/mxtest/core/HarmonyTest.h +++ b/Sourcecode/private/mxtest/core/HarmonyTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::HarmonyPtr tgenHarmony( TestMode v ); - void tgenHarmonyExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::HarmonyPtr tgenHarmony(TestMode v); +void tgenHarmonyExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HarpPedalsTest.cpp b/Sourcecode/private/mxtest/core/HarpPedalsTest.cpp index 0060930b3..002e2d82d 100644 --- a/Sourcecode/private/mxtest/core/HarpPedalsTest.cpp +++ b/Sourcecode/private/mxtest/core/HarpPedalsTest.cpp @@ -6,82 +6,84 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, HarpPedals ) +TEST(Test01, HarpPedals) { - HarpPedals object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(A)" ); - streamLine( expected, 3, R"(0)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + HarpPedals object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(A)"); + streamLine(expected, 3, R"(0)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, HarpPedals ) + +TEST(Test02, HarpPedals) { - HarpPedals object; - object.removePedalTuning( object.getPedalTuningSet().cbegin() ); // does nothing becuase minOccurs = 1 - object.getPedalTuning( object.getPedalTuningSet().cbegin() )->getPedalStep()->setValue( StepEnum::b ); - object.getPedalTuning( object.getPedalTuningSet().cbegin() )->getPedalAlter()->setValue( Semitones( -1 ) ); + HarpPedals object; + object.removePedalTuning(object.getPedalTuningSet().cbegin()); // does nothing becuase minOccurs = 1 + object.getPedalTuning(object.getPedalTuningSet().cbegin())->getPedalStep()->setValue(StepEnum::b); + object.getPedalTuning(object.getPedalTuningSet().cbegin())->getPedalAlter()->setValue(Semitones(-1)); auto pt1 = makePedalTuning(); - pt1->getPedalStep()->setValue( StepEnum::f ); - pt1->getPedalAlter()->setValue( Semitones( 1 ) ); - object.addPedalTuning( pt1 ); + pt1->getPedalStep()->setValue(StepEnum::f); + pt1->getPedalAlter()->setValue(Semitones(1)); + object.addPedalTuning(pt1); stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(B)" ); - streamLine( expected, 3, R"(-1)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(F)" ); - streamLine( expected, 3, R"(1)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(B)"); + streamLine(expected, 3, R"(-1)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(F)"); + streamLine(expected, 3, R"(1)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test03, HarpPedals ) + +TEST(Test03, HarpPedals) { - HarpPedals object; - object.removePedalTuning( object.getPedalTuningSet().cbegin() ); // does nothing becuase minOccurs = 1 - object.getPedalTuning( object.getPedalTuningSet().cbegin() )->getPedalStep()->setValue( StepEnum::b ); - object.getPedalTuning( object.getPedalTuningSet().cbegin() )->getPedalAlter()->setValue( Semitones( -1 ) ); + HarpPedals object; + object.removePedalTuning(object.getPedalTuningSet().cbegin()); // does nothing becuase minOccurs = 1 + object.getPedalTuning(object.getPedalTuningSet().cbegin())->getPedalStep()->setValue(StepEnum::b); + object.getPedalTuning(object.getPedalTuningSet().cbegin())->getPedalAlter()->setValue(Semitones(-1)); auto pt1 = makePedalTuning(); - pt1->getPedalStep()->setValue( StepEnum::f ); - pt1->getPedalAlter()->setValue( Semitones( 1 ) ); - object.addPedalTuning( pt1 ); + pt1->getPedalStep()->setValue(StepEnum::f); + pt1->getPedalAlter()->setValue(Semitones(1)); + object.addPedalTuning(pt1); object.clearPedalTuningSet(); stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(A)" ); - streamLine( expected, 3, R"(0)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(A)"); + streamLine(expected, 3, R"(0)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/HeelTest.cpp b/Sourcecode/private/mxtest/core/HeelTest.cpp index 8bbef5770..7bb79a340 100644 --- a/Sourcecode/private/mxtest/core/HeelTest.cpp +++ b/Sourcecode/private/mxtest/core/HeelTest.cpp @@ -6,114 +6,109 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/HeelTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" /* #include "MidiDeviceTest.cpp" */ - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Heel ) +TEST(Test01, Heel) { TestMode v = TestMode::one; - HeelPtr object = tgenHeel( v ); - stringstream expected; - tgenHeelExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + HeelPtr object = tgenHeel(v); + stringstream expected; + tgenHeelExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Heel ) + +TEST(Test02, Heel) { TestMode v = TestMode::two; - HeelPtr object = tgenHeel( v ); - stringstream expected; - tgenHeelExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + HeelPtr object = tgenHeel(v); + stringstream expected; + tgenHeelExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test03, Heel ) + +TEST(Test03, Heel) { TestMode v = TestMode::three; - HeelPtr object = tgenHeel( v ); - stringstream expected; - tgenHeelExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + HeelPtr object = tgenHeel(v); + stringstream expected; + tgenHeelExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } namespace mxtest { - HeelPtr tgenHeel( TestMode v ) +HeelPtr tgenHeel(TestMode v) +{ + HeelPtr o = makeHeel(); + switch (v) { - HeelPtr o = makeHeel(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasSubstitution = true; - o->getAttributes()->substitution = YesNo::yes; - o->getAttributes()->hasFontStyle = true; - o->getAttributes()->fontStyle = FontStyle::italic; - o->getAttributes()->hasColor = true; - o->getAttributes()->color = Color( 83, 102, 30, 22 ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasFontFamily = true; - o->getAttributes()->fontFamily = CommaSeparatedText( "Bish,and,Bones" ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasSubstitution = true; + o->getAttributes()->substitution = YesNo::yes; + o->getAttributes()->hasFontStyle = true; + o->getAttributes()->fontStyle = FontStyle::italic; + o->getAttributes()->hasColor = true; + o->getAttributes()->color = Color(83, 102, 30, 22); + } + break; + case TestMode::three: { + o->getAttributes()->hasFontFamily = true; + o->getAttributes()->fontFamily = CommaSeparatedText("Bish,and,Bones"); } - void tgenHeelExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenHeelExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HeelTest.h b/Sourcecode/private/mxtest/core/HeelTest.h index f4915f9ee..d74b9f27a 100644 --- a/Sourcecode/private/mxtest/core/HeelTest.h +++ b/Sourcecode/private/mxtest/core/HeelTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::HeelPtr tgenHeel( TestMode v ); - void tgenHeelExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::HeelPtr tgenHeel(TestMode v); +void tgenHeelExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HelloWorldExpected.h b/Sourcecode/private/mxtest/core/HelloWorldExpected.h index 088c19eb6..977c67b18 100644 --- a/Sourcecode/private/mxtest/core/HelloWorldExpected.h +++ b/Sourcecode/private/mxtest/core/HelloWorldExpected.h @@ -6,49 +6,50 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include #include +#include inline std::string helloWorldExpected() { -std::stringstream ss; + std::stringstream ss; -ss << R"()" << std::endl; -ss << R"()" << std::endl; -ss << R"()" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( Music)" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( 1)" << std::endl; -ss << R"( )" << std::endl; -ss << R"( 0)" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( G)" << std::endl; -ss << R"( 2)" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( C)" << std::endl; -ss << R"( 4)" << std::endl; -ss << R"( )" << std::endl; -ss << R"( 4)" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"( )" << std::endl; -ss << R"()"; + ss << R"()" << std::endl; + ss << R"()" + << std::endl; + ss << R"()" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( Music)" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( 1)" << std::endl; + ss << R"( )" << std::endl; + ss << R"( 0)" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( G)" << std::endl; + ss << R"( 2)" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( C)" << std::endl; + ss << R"( 4)" << std::endl; + ss << R"( )" << std::endl; + ss << R"( 4)" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"( )" << std::endl; + ss << R"()"; -return ss.str(); + return ss.str(); } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/HelloWorldTest.cpp b/Sourcecode/private/mxtest/core/HelloWorldTest.cpp index 7e64b241e..261a0cc15 100644 --- a/Sourcecode/private/mxtest/core/HelloWorldTest.cpp +++ b/Sourcecode/private/mxtest/core/HelloWorldTest.cpp @@ -5,17 +5,17 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "HelloWorldTest.h" #include "HelloWorldExpected.h" +#include "HelloWorldTest.h" #include "cpul/cpulTestHarness.h" using namespace mx::core; -TEST( Test, HelloWorld ) +TEST(Test, HelloWorld) { std::string expected = helloWorldExpected(); std::string actual = mxtest::helloMusicXml(); - CHECK_EQUAL( expected, actual ); + CHECK_EQUAL(expected, actual); } #endif diff --git a/Sourcecode/private/mxtest/core/HelloWorldTest.h b/Sourcecode/private/mxtest/core/HelloWorldTest.h index 49a1ee9a3..e705d6ac0 100644 --- a/Sourcecode/private/mxtest/core/HelloWorldTest.h +++ b/Sourcecode/private/mxtest/core/HelloWorldTest.h @@ -8,174 +8,197 @@ #include "mx/core/Document.h" #include "mx/core/Elements.h" -#include "mxtest/core/DocumentPartwiseCreate.h" -#include "mxtest/core/DocumentTimewiseCreate.h" #include "mx/core/elements/Encoding.h" #include "mx/core/elements/EncodingChoice.h" - +#include "mxtest/core/DocumentPartwiseCreate.h" +#include "mxtest/core/DocumentTimewiseCreate.h" #include -#include #include +#include using namespace mx::core; using namespace std; namespace mxtest { - inline MusicDataChoicePtr makeSixteenthNote( const StepEnum step, int octave, BeamValue beamval ) - { - auto noteData = makeMusicDataChoice(); - noteData->setChoice( MusicDataChoice::Choice::note ); - noteData->getNote()->getNoteChoice()->setChoice( NoteChoice::Choice::normal ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getStep()->setValue( step ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getOctave()->setValue( OctaveValue( octave ) ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( PositiveDivisionsValue( 1 ) ); - noteData->getNote()->getType()->setValue( NoteTypeValue::sixteenth ); - noteData->getNote()->setHasType( true ); - auto beam = makeBeam(); - beam->setValue( beamval ); - noteData->getNote()->addBeam( beam ); - noteData->getNote()->addBeam( beam ); - return noteData; - } - - - inline ClefPtr makeTrebleClef() - { - auto clef = makeClef(); - clef->getSign()->setValue( ClefSign::g ); - clef->setHasLine( true ); - clef->getLine()->setValue( StaffLine( 2 ) ); - return clef; - } - - - inline ClefPtr makeBassClef() - { - auto clef = makeClef(); - clef->getSign()->setValue( ClefSign::f ); - clef->setHasLine( true ); - clef->getLine()->setValue( StaffLine( 4 ) ); - return clef; - } - - - inline TimePtr makeFourFourTime() - { - auto t = makeTime(); - t->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - auto timeSignature = makeTimeSignatureGroup(); - timeSignature->getBeats()->setValue( XsString( "4" ) ); - timeSignature->getBeatType()->setValue( XsString( "4" ) ); - t->getTimeChoice()->addTimeSignatureGroup( timeSignature ); - t->getTimeChoice()->removeTimeSignatureGroup( t->getTimeChoice()->getTimeSignatureGroupSet().cbegin() ); - return t; - } - - - inline MusicDataChoicePtr makeMeasureProperties() - { - auto propertiesChoice = makeMusicDataChoice(); - propertiesChoice->setChoice( MusicDataChoice::Choice::properties ); - auto properties = propertiesChoice->getProperties(); - properties->setHasDivisions( true ); - properties->getDivisions()->setValue( PositiveDivisionsValue( 4 ) ); - properties->addKey( makeKey() ); - properties->addTime( makeFourFourTime() ); - properties->addClef( makeTrebleClef() ); - return propertiesChoice; - } - - - DocumentPtr makeDocStub() - { - auto doc = makeDocument( DocumentChoice::partwise ); - auto s = doc->getScorePartwise(); - s->getAttributes()->hasVersion = true; - s->getAttributes()->version = XsToken( "3.0" ); - auto header = s->getScoreHeaderGroup(); - header->getPartList()->getScorePart()->getAttributes()->id = XsID( "P1" ); - header->getPartList()->getScorePart()->getPartName()->setValue( XsString( "Music" ) ); - IdentificationPtr ident = makeIdentification(); - auto composer = makeCreator(); - composer->getAttributes()->hasType = true; - composer->getAttributes()->type = XsToken( "composer" ); - composer->setValue( XsString( "Matthew James Briggs" ) ); - ident->addCreator( composer ); - header->setHasIdentification( true ); - header->setIdentification( ident ); - - auto encodingChoice = makeEncodingChoice(); - encodingChoice->setChoice( EncodingChoice::Choice::software ); - encodingChoice->getSoftware()->setValue( XsString( "MxSample" ) ); - ident->setHasEncoding( true ); - ident->getEncoding()->addEncodingChoice( encodingChoice ); - header->setHasWork( true ); - header->getWork()->setHasWorkTitle( true ); - header->getWork()->getWorkTitle()->setValue( XsString( "In the Beginning" ) ); - auto part = *( s->getPartwisePartSet().cbegin() ); - part->getAttributes()->id = XsIDREF( "P1" ); - auto measure = *( part->getPartwiseMeasureSet().cbegin() ); - measure->getAttributes()->number = XsToken( "1" ); - return doc; - } - - - inline std::string helloMusicXml() - { - auto doc = makeDocument( DocumentChoice::partwise ); - auto s = doc->getScorePartwise(); - s->getAttributes()->hasVersion = true; - s->getAttributes()->version = XsToken( "3.0" ); - auto header = s->getScoreHeaderGroup(); - header->getPartList()->getScorePart()->getAttributes()->id = XsID( "P1" ); - header->getPartList()->getScorePart()->getPartName()->setValue( XsString( "Music" ) ); - auto part = *( s->getPartwisePartSet().cbegin() ); - part->getAttributes()->id = XsIDREF( "P1" ); - auto measure = *( part->getPartwiseMeasureSet().cbegin() ); - measure->getAttributes()->number = XsToken( "1" ); - auto propertiesChoice = makeMusicDataChoice(); - propertiesChoice->setChoice( MusicDataChoice::Choice::properties ); - auto properties = propertiesChoice->getProperties(); - properties->setHasDivisions( true ); - properties->getDivisions()->setValue( PositiveDivisionsValue( 1 ) ); - properties->addKey( makeKey() ); - - auto time = makeTime(); - time->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - auto timeSignature = makeTimeSignatureGroup(); - timeSignature->getBeats()->setValue( XsString("4") ); - timeSignature->getBeatType()->setValue( XsString("4") ); - time->getTimeChoice()->addTimeSignatureGroup( timeSignature ); - time->getTimeChoice()->removeTimeSignatureGroup( time->getTimeChoice()->getTimeSignatureGroupSet().cbegin() ); - properties->addTime( time ); - - auto clef = makeClef(); - clef->getSign()->setValue( ClefSign::g ); - clef->setHasLine( true ); - clef->getLine()->setValue( StaffLine( 2 ) ); - properties->addClef( clef ); - measure->getMusicDataGroup()->addMusicDataChoice( propertiesChoice ); - auto noteData = makeMusicDataChoice(); - noteData->setChoice( MusicDataChoice::Choice::note ); - noteData->getNote()->getNoteChoice()->setChoice( NoteChoice::Choice::normal ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getStep()->setValue( StepEnum::c ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getOctave()->setValue( OctaveValue( 4 ) ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( PositiveDivisionsValue( 4 ) ); - noteData->getNote()->getType()->setValue( NoteTypeValue::whole ); - measure->getMusicDataGroup()->addMusicDataChoice( noteData ); - doc->convertContents(); - auto twDoc = doc; - doc->convertContents(); - auto pwDoc = doc; - std::stringstream output; - pwDoc->toStream( output ); - return output.str(); - } - +inline MusicDataChoicePtr makeSixteenthNote(const StepEnum step, int octave, BeamValue beamval) +{ + auto noteData = makeMusicDataChoice(); + noteData->setChoice(MusicDataChoice::Choice::note); + noteData->getNote()->getNoteChoice()->setChoice(NoteChoice::Choice::normal); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( + FullNoteTypeChoice::Choice::pitch); + noteData->getNote() + ->getNoteChoice() + ->getNormalNoteGroup() + ->getFullNoteGroup() + ->getFullNoteTypeChoice() + ->getPitch() + ->getStep() + ->setValue(step); + noteData->getNote() + ->getNoteChoice() + ->getNormalNoteGroup() + ->getFullNoteGroup() + ->getFullNoteTypeChoice() + ->getPitch() + ->getOctave() + ->setValue(OctaveValue(octave)); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue(PositiveDivisionsValue(1)); + noteData->getNote()->getType()->setValue(NoteTypeValue::sixteenth); + noteData->getNote()->setHasType(true); + auto beam = makeBeam(); + beam->setValue(beamval); + noteData->getNote()->addBeam(beam); + noteData->getNote()->addBeam(beam); + return noteData; +} + +inline ClefPtr makeTrebleClef() +{ + auto clef = makeClef(); + clef->getSign()->setValue(ClefSign::g); + clef->setHasLine(true); + clef->getLine()->setValue(StaffLine(2)); + return clef; +} + +inline ClefPtr makeBassClef() +{ + auto clef = makeClef(); + clef->getSign()->setValue(ClefSign::f); + clef->setHasLine(true); + clef->getLine()->setValue(StaffLine(4)); + return clef; +} + +inline TimePtr makeFourFourTime() +{ + auto t = makeTime(); + t->getTimeChoice()->setChoice(TimeChoice::Choice::timeSignature); + auto timeSignature = makeTimeSignatureGroup(); + timeSignature->getBeats()->setValue(XsString("4")); + timeSignature->getBeatType()->setValue(XsString("4")); + t->getTimeChoice()->addTimeSignatureGroup(timeSignature); + t->getTimeChoice()->removeTimeSignatureGroup(t->getTimeChoice()->getTimeSignatureGroupSet().cbegin()); + return t; +} + +inline MusicDataChoicePtr makeMeasureProperties() +{ + auto propertiesChoice = makeMusicDataChoice(); + propertiesChoice->setChoice(MusicDataChoice::Choice::properties); + auto properties = propertiesChoice->getProperties(); + properties->setHasDivisions(true); + properties->getDivisions()->setValue(PositiveDivisionsValue(4)); + properties->addKey(makeKey()); + properties->addTime(makeFourFourTime()); + properties->addClef(makeTrebleClef()); + return propertiesChoice; } +DocumentPtr makeDocStub() +{ + auto doc = makeDocument(DocumentChoice::partwise); + auto s = doc->getScorePartwise(); + s->getAttributes()->hasVersion = true; + s->getAttributes()->version = XsToken("3.0"); + auto header = s->getScoreHeaderGroup(); + header->getPartList()->getScorePart()->getAttributes()->id = XsID("P1"); + header->getPartList()->getScorePart()->getPartName()->setValue(XsString("Music")); + IdentificationPtr ident = makeIdentification(); + auto composer = makeCreator(); + composer->getAttributes()->hasType = true; + composer->getAttributes()->type = XsToken("composer"); + composer->setValue(XsString("Matthew James Briggs")); + ident->addCreator(composer); + header->setHasIdentification(true); + header->setIdentification(ident); + + auto encodingChoice = makeEncodingChoice(); + encodingChoice->setChoice(EncodingChoice::Choice::software); + encodingChoice->getSoftware()->setValue(XsString("MxSample")); + ident->setHasEncoding(true); + ident->getEncoding()->addEncodingChoice(encodingChoice); + header->setHasWork(true); + header->getWork()->setHasWorkTitle(true); + header->getWork()->getWorkTitle()->setValue(XsString("In the Beginning")); + auto part = *(s->getPartwisePartSet().cbegin()); + part->getAttributes()->id = XsIDREF("P1"); + auto measure = *(part->getPartwiseMeasureSet().cbegin()); + measure->getAttributes()->number = XsToken("1"); + return doc; +} + +inline std::string helloMusicXml() +{ + auto doc = makeDocument(DocumentChoice::partwise); + auto s = doc->getScorePartwise(); + s->getAttributes()->hasVersion = true; + s->getAttributes()->version = XsToken("3.0"); + auto header = s->getScoreHeaderGroup(); + header->getPartList()->getScorePart()->getAttributes()->id = XsID("P1"); + header->getPartList()->getScorePart()->getPartName()->setValue(XsString("Music")); + auto part = *(s->getPartwisePartSet().cbegin()); + part->getAttributes()->id = XsIDREF("P1"); + auto measure = *(part->getPartwiseMeasureSet().cbegin()); + measure->getAttributes()->number = XsToken("1"); + auto propertiesChoice = makeMusicDataChoice(); + propertiesChoice->setChoice(MusicDataChoice::Choice::properties); + auto properties = propertiesChoice->getProperties(); + properties->setHasDivisions(true); + properties->getDivisions()->setValue(PositiveDivisionsValue(1)); + properties->addKey(makeKey()); + + auto time = makeTime(); + time->getTimeChoice()->setChoice(TimeChoice::Choice::timeSignature); + auto timeSignature = makeTimeSignatureGroup(); + timeSignature->getBeats()->setValue(XsString("4")); + timeSignature->getBeatType()->setValue(XsString("4")); + time->getTimeChoice()->addTimeSignatureGroup(timeSignature); + time->getTimeChoice()->removeTimeSignatureGroup(time->getTimeChoice()->getTimeSignatureGroupSet().cbegin()); + properties->addTime(time); + + auto clef = makeClef(); + clef->getSign()->setValue(ClefSign::g); + clef->setHasLine(true); + clef->getLine()->setValue(StaffLine(2)); + properties->addClef(clef); + measure->getMusicDataGroup()->addMusicDataChoice(propertiesChoice); + auto noteData = makeMusicDataChoice(); + noteData->setChoice(MusicDataChoice::Choice::note); + noteData->getNote()->getNoteChoice()->setChoice(NoteChoice::Choice::normal); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( + FullNoteTypeChoice::Choice::pitch); + noteData->getNote() + ->getNoteChoice() + ->getNormalNoteGroup() + ->getFullNoteGroup() + ->getFullNoteTypeChoice() + ->getPitch() + ->getStep() + ->setValue(StepEnum::c); + noteData->getNote() + ->getNoteChoice() + ->getNormalNoteGroup() + ->getFullNoteGroup() + ->getFullNoteTypeChoice() + ->getPitch() + ->getOctave() + ->setValue(OctaveValue(4)); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue(PositiveDivisionsValue(4)); + noteData->getNote()->getType()->setValue(NoteTypeValue::whole); + measure->getMusicDataGroup()->addMusicDataChoice(noteData); + doc->convertContents(); + auto twDoc = doc; + doc->convertContents(); + auto pwDoc = doc; + std::stringstream output; + pwDoc->toStream(output); + return output.str(); +} + +} // namespace mxtest + #endif diff --git a/Sourcecode/private/mxtest/core/HelperFunctions.h b/Sourcecode/private/mxtest/core/HelperFunctions.h index bbfe640aa..c2e7f5516 100644 --- a/Sourcecode/private/mxtest/core/HelperFunctions.h +++ b/Sourcecode/private/mxtest/core/HelperFunctions.h @@ -6,51 +6,47 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS +#include "mx/core/ElementInterface.h" #include -#include #include -#include "mx/core/ElementInterface.h" +#include namespace mxtest { - - enum class TestMode - { - one = 1, - two = 2, - three = 3 - }; - - - inline std::string indent( int times ) - { - std::stringstream output; - for ( int i = 0; i < times; ++i ) - { - output << mx::core::INDENT; - } - return output.str(); - } - - - inline std::ostream& streamLine( std::ostream& os, int indents, const std::string& line, bool newline ) + +enum class TestMode +{ + one = 1, + two = 2, + three = 3 +}; + +inline std::string indent(int times) +{ + std::stringstream output; + for (int i = 0; i < times; ++i) { - os << indent( indents ); - os << line; - if ( newline ) - { - os << std::endl; - } - return os; + output << mx::core::INDENT; } - - - inline std::ostream& streamLine( std::ostream& os, int indents, const std::string& line ) + return output.str(); +} + +inline std::ostream &streamLine(std::ostream &os, int indents, const std::string &line, bool newline) +{ + os << indent(indents); + os << line; + if (newline) { - return streamLine( os, indents, line, true ); + os << std::endl; } - + return os; } -#endif +inline std::ostream &streamLine(std::ostream &os, int indents, const std::string &line) +{ + return streamLine(os, indents, line, true); +} +} // namespace mxtest + +#endif diff --git a/Sourcecode/private/mxtest/core/HoleClosedTest.cpp b/Sourcecode/private/mxtest/core/HoleClosedTest.cpp index 14fe9b524..2712d6a14 100644 --- a/Sourcecode/private/mxtest/core/HoleClosedTest.cpp +++ b/Sourcecode/private/mxtest/core/HoleClosedTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, HoleClosed ) +TEST(Test01, HoleClosed) { - std::string indentString( INDENT ); - HoleClosedValue value1 = HoleClosedValue::half; - HoleClosedValue value2 = HoleClosedValue::yes; - HoleClosed object1; - HoleClosed object2( value2 ); - HoleClosedAttributesPtr attributes1 = std::make_shared(); - HoleClosedAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + HoleClosedValue value1 = HoleClosedValue::half; + HoleClosedValue value2 = HoleClosedValue::yes; + HoleClosed object1; + HoleClosed object2(value2); + HoleClosedAttributesPtr attributes1 = std::make_shared(); + HoleClosedAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasLocation = true; attributes1->location = HoleClosedLocation::bottom; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(no)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(yes)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(no)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(yes)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/HoleShapeTest.cpp b/Sourcecode/private/mxtest/core/HoleShapeTest.cpp index c22e9087e..b41522097 100644 --- a/Sourcecode/private/mxtest/core/HoleShapeTest.cpp +++ b/Sourcecode/private/mxtest/core/HoleShapeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, HoleShape ) +TEST(Test01, HoleShape) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - HoleShape object1; - HoleShape object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + HoleShape object1; + HoleShape object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/HoleTest.cpp b/Sourcecode/private/mxtest/core/HoleTest.cpp index 8ef42fcec..e7c67612a 100644 --- a/Sourcecode/private/mxtest/core/HoleTest.cpp +++ b/Sourcecode/private/mxtest/core/HoleTest.cpp @@ -6,129 +6,124 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/HoleTest.h" #include "mxtest/core/MidiInstrumentTest.h" /* #include "MidiDeviceTest.cpp" */ - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Hole ) +TEST(Test01, Hole) { TestMode v = TestMode::one; - HolePtr object = tgenHole( v ); - stringstream expected; - tgenHoleExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + HolePtr object = tgenHole(v); + stringstream expected; + tgenHoleExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Hole ) + +TEST(Test02, Hole) { TestMode v = TestMode::two; - HolePtr object = tgenHole( v ); - stringstream expected; - tgenHoleExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + HolePtr object = tgenHole(v); + stringstream expected; + tgenHoleExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Hole ) + +TEST(Test03, Hole) { TestMode v = TestMode::three; - HolePtr object = tgenHole( v ); - stringstream expected; - tgenHoleExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + HolePtr object = tgenHole(v); + stringstream expected; + tgenHoleExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - HolePtr tgenHole( TestMode v ) +HolePtr tgenHole(TestMode v) +{ + HolePtr o = makeHole(); + switch (v) { - HolePtr o = makeHole(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getHoleClosed()->setValue( HoleClosedValue::half ); - o->setHasHoleShape( true ); - o->getHoleShape()->setValue( XsString( "torus" ) ); - o->getAttributes()->hasColor = true; - o->getAttributes()->color = Color( 1, 2, 3 ); - } - break; - case TestMode::three: - { - o->getHoleClosed()->setValue( HoleClosedValue::yes ); - o->setHasHoleShape( true ); - o->getHoleShape()->setValue( XsString( "smokes" ) ); - o->setHasHoleType( true ); - o->getHoleType()->setValue( XsString( "foobar" ) ); - o->getAttributes()->hasPlacement = true; - o->getAttributes()->placement = AboveBelow::above; - o->getAttributes()->hasDefaultY = true; - o->getAttributes()->defaultY = TenthsValue( -1.1 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getHoleClosed()->setValue(HoleClosedValue::half); + o->setHasHoleShape(true); + o->getHoleShape()->setValue(XsString("torus")); + o->getAttributes()->hasColor = true; + o->getAttributes()->color = Color(1, 2, 3); + } + break; + case TestMode::three: { + o->getHoleClosed()->setValue(HoleClosedValue::yes); + o->setHasHoleShape(true); + o->getHoleShape()->setValue(XsString("smokes")); + o->setHasHoleType(true); + o->getHoleType()->setValue(XsString("foobar")); + o->getAttributes()->hasPlacement = true; + o->getAttributes()->placement = AboveBelow::above; + o->getAttributes()->hasDefaultY = true; + o->getAttributes()->defaultY = TenthsValue(-1.1); } - void tgenHoleExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenHoleExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(no)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(half)" ); - streamLine( os, i+1, R"(torus)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(foobar)" ); - streamLine( os, i+1, R"(yes)" ); - streamLine( os, i+1, R"(smokes)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(no)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(half)"); + streamLine(os, i + 1, R"(torus)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(foobar)"); + streamLine(os, i + 1, R"(yes)"); + streamLine(os, i + 1, R"(smokes)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HoleTest.h b/Sourcecode/private/mxtest/core/HoleTest.h index c0675ad9c..7c4ada73b 100644 --- a/Sourcecode/private/mxtest/core/HoleTest.h +++ b/Sourcecode/private/mxtest/core/HoleTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::HolePtr tgenHole( TestMode v ); - void tgenHoleExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::HolePtr tgenHole(TestMode v); +void tgenHoleExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/HoleTypeTest.cpp b/Sourcecode/private/mxtest/core/HoleTypeTest.cpp index a9f7a5f6f..323df9e15 100644 --- a/Sourcecode/private/mxtest/core/HoleTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/HoleTypeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, HoleType ) +TEST(Test01, HoleType) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - HoleType object1; - HoleType object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + HoleType object1; + HoleType object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/HummingTest.cpp b/Sourcecode/private/mxtest/core/HummingTest.cpp index 90718ea59..08b466216 100644 --- a/Sourcecode/private/mxtest/core/HummingTest.cpp +++ b/Sourcecode/private/mxtest/core/HummingTest.cpp @@ -11,28 +11,27 @@ using namespace mx::core; - -TEST( Test01, Humming ) +TEST(Test01, Humming) { - std::string indentString( INDENT ); - Humming object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Humming object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/IdentificationTest.cpp b/Sourcecode/private/mxtest/core/IdentificationTest.cpp index dcd1eeedf..31cb77d88 100644 --- a/Sourcecode/private/mxtest/core/IdentificationTest.cpp +++ b/Sourcecode/private/mxtest/core/IdentificationTest.cpp @@ -6,163 +6,159 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/EncodingTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/IdentificationTest.h" #include "mxtest/core/MiscellaneousTest.h" -#include "mxtest/core/EncodingTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Identification ) +TEST(Test01, Identification) { TestMode v = TestMode::one; - IdentificationPtr object = tgenIdentification( v ); - stringstream expected; - tgenIdentificationExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + IdentificationPtr object = tgenIdentification(v); + stringstream expected; + tgenIdentificationExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Identification ) + +TEST(Test02, Identification) { TestMode v = TestMode::two; - IdentificationPtr object = tgenIdentification( v ); - stringstream expected; - tgenIdentificationExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + IdentificationPtr object = tgenIdentification(v); + stringstream expected; + tgenIdentificationExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Identification ) + +TEST(Test03, Identification) { TestMode v = TestMode::three; - IdentificationPtr object = tgenIdentification( v ); - stringstream expected; - tgenIdentificationExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + IdentificationPtr object = tgenIdentification(v); + stringstream expected; + tgenIdentificationExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - IdentificationPtr tgenIdentification( TestMode v ) +IdentificationPtr tgenIdentification(TestMode v) +{ + IdentificationPtr o = makeIdentification(); + switch (v) { - IdentificationPtr o = makeIdentification(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - auto creator1 = makeCreator( XsString( "Matthew James Briggs" ) ); - creator1->getAttributes()->hasType = true; - creator1->getAttributes()->type = XsToken( "composer" ); - o->addCreator( creator1 ); - auto creator2 = makeCreator( XsString( "Bones" ) ); - creator2->getAttributes()->hasType = true; - creator2->getAttributes()->type = XsToken( "cat" ); - o->addCreator( creator2 ); - o->setHasMiscellaneous( true ); - o->setMiscellaneous( tgenMiscellaneous( v ) ); - o->setHasEncoding( true ); - o->setEncoding( tgenEncoding( v ) ); - auto rights1 = makeRights( XsString( "© 2015" ) ); - rights1->getAttributes()->hasType = true; - rights1->getAttributes()->type = XsToken( "copyright" ); - o->addRights( rights1 ); - o->setHasSource( true ); - o->getSource()->setValue( XsString( "My Brain" ) ); - } - break; - case TestMode::three: - { - auto creator1 = makeCreator( XsString( "world" ) ); - creator1->getAttributes()->hasType = true; - creator1->getAttributes()->type = XsToken( "hello" ); - o->addCreator( creator1 ); - auto creator2 = makeCreator( XsString( "Bishop" ) ); - creator2->getAttributes()->hasType = true; - creator2->getAttributes()->type = XsToken( "othercat" ); - o->addCreator( creator2 ); - o->setHasMiscellaneous( true ); - o->setMiscellaneous( tgenMiscellaneous( v ) ); - o->setHasEncoding( true ); - o->setEncoding( tgenEncoding( v ) ); - auto rights1 = makeRights( XsString( "unalienable" ) ); - rights1->getAttributes()->hasType = true; - rights1->getAttributes()->type = XsToken( "human" ); - o->addRights( rights1 ); - auto rights2 = makeRights( XsString( "yes" ) ); - rights2->getAttributes()->hasType = true; - rights2->getAttributes()->type = XsToken( "animal" ); - o->addRights( rights2 ); - o->setHasSource( true ); - o->getSource()->setValue( XsString( "Manuscript" ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + auto creator1 = makeCreator(XsString("Matthew James Briggs")); + creator1->getAttributes()->hasType = true; + creator1->getAttributes()->type = XsToken("composer"); + o->addCreator(creator1); + auto creator2 = makeCreator(XsString("Bones")); + creator2->getAttributes()->hasType = true; + creator2->getAttributes()->type = XsToken("cat"); + o->addCreator(creator2); + o->setHasMiscellaneous(true); + o->setMiscellaneous(tgenMiscellaneous(v)); + o->setHasEncoding(true); + o->setEncoding(tgenEncoding(v)); + auto rights1 = makeRights(XsString("© 2015")); + rights1->getAttributes()->hasType = true; + rights1->getAttributes()->type = XsToken("copyright"); + o->addRights(rights1); + o->setHasSource(true); + o->getSource()->setValue(XsString("My Brain")); + } + break; + case TestMode::three: { + auto creator1 = makeCreator(XsString("world")); + creator1->getAttributes()->hasType = true; + creator1->getAttributes()->type = XsToken("hello"); + o->addCreator(creator1); + auto creator2 = makeCreator(XsString("Bishop")); + creator2->getAttributes()->hasType = true; + creator2->getAttributes()->type = XsToken("othercat"); + o->addCreator(creator2); + o->setHasMiscellaneous(true); + o->setMiscellaneous(tgenMiscellaneous(v)); + o->setHasEncoding(true); + o->setEncoding(tgenEncoding(v)); + auto rights1 = makeRights(XsString("unalienable")); + rights1->getAttributes()->hasType = true; + rights1->getAttributes()->type = XsToken("human"); + o->addRights(rights1); + auto rights2 = makeRights(XsString("yes")); + rights2->getAttributes()->hasType = true; + rights2->getAttributes()->type = XsToken("animal"); + o->addRights(rights2); + o->setHasSource(true); + o->getSource()->setValue(XsString("Manuscript")); + } + break; + default: + break; } - void tgenIdentificationExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenIdentificationExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Matthew James Briggs)" ); - streamLine( os, i+1, R"(Bones)" ); - streamLine( os, i+1, R"(© 2015)" ); - tgenEncodingExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(My Brain)" ); - tgenMiscellaneousExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(world)" ); - streamLine( os, i+1, R"(Bishop)" ); - streamLine( os, i+1, R"(unalienable)" ); - streamLine( os, i+1, R"(yes)" ); - tgenEncodingExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(Manuscript)" ); - tgenMiscellaneousExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Matthew James Briggs)"); + streamLine(os, i + 1, R"(Bones)"); + streamLine(os, i + 1, R"(© 2015)"); + tgenEncodingExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(My Brain)"); + tgenMiscellaneousExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(world)"); + streamLine(os, i + 1, R"(Bishop)"); + streamLine(os, i + 1, R"(unalienable)"); + streamLine(os, i + 1, R"(yes)"); + tgenEncodingExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(Manuscript)"); + tgenMiscellaneousExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/IdentificationTest.h b/Sourcecode/private/mxtest/core/IdentificationTest.h index c03e36e9a..85b7b9d5e 100644 --- a/Sourcecode/private/mxtest/core/IdentificationTest.h +++ b/Sourcecode/private/mxtest/core/IdentificationTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::IdentificationPtr tgenIdentification( TestMode v ); - void tgenIdentificationExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::IdentificationPtr tgenIdentification(TestMode v); +void tgenIdentificationExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ImageTest.cpp b/Sourcecode/private/mxtest/core/ImageTest.cpp index eeaab904a..f184a83f2 100644 --- a/Sourcecode/private/mxtest/core/ImageTest.cpp +++ b/Sourcecode/private/mxtest/core/ImageTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Image ) +TEST(Test01, Image) { - std::string indentString( INDENT ); - Image object1; - Image object2; - ImageAttributesPtr attributes1 = std::make_shared(); - ImageAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Image object1; + Image object2; + ImageAttributesPtr attributes1 = std::make_shared(); + ImageAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->defaultX = TenthsValue{0.1}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/InstrumentAbbreviationTest.cpp b/Sourcecode/private/mxtest/core/InstrumentAbbreviationTest.cpp index b121abef4..7ac8ca403 100644 --- a/Sourcecode/private/mxtest/core/InstrumentAbbreviationTest.cpp +++ b/Sourcecode/private/mxtest/core/InstrumentAbbreviationTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, InstrumentAbbreviation ) +TEST(Test01, InstrumentAbbreviation) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - InstrumentAbbreviation object1; - InstrumentAbbreviation object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + InstrumentAbbreviation object1; + InstrumentAbbreviation object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/InstrumentNameTest.cpp b/Sourcecode/private/mxtest/core/InstrumentNameTest.cpp index 3773e93ab..95db1e79e 100644 --- a/Sourcecode/private/mxtest/core/InstrumentNameTest.cpp +++ b/Sourcecode/private/mxtest/core/InstrumentNameTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, InstrumentName ) +TEST(Test01, InstrumentName) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - InstrumentName object1; - InstrumentName object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + InstrumentName object1; + InstrumentName object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/InstrumentSoundTest.cpp b/Sourcecode/private/mxtest/core/InstrumentSoundTest.cpp index fd05399b1..ae5045e99 100644 --- a/Sourcecode/private/mxtest/core/InstrumentSoundTest.cpp +++ b/Sourcecode/private/mxtest/core/InstrumentSoundTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, InstrumentSound ) +TEST(Test01, InstrumentSound) { - std::string indentString( INDENT ); - PlaybackSound value1{ PlaybackSound::keyboardHarpsichord }; - PlaybackSound value2{ PlaybackSound::stringsViolin }; + std::string indentString(INDENT); + PlaybackSound value1{PlaybackSound::keyboardHarpsichord}; + PlaybackSound value2{PlaybackSound::stringsViolin}; InstrumentSound object1; - InstrumentSound object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(keyboard.piano)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(strings.violin)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + InstrumentSound object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(keyboard.piano)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(strings.violin)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/InstrumentTest.cpp b/Sourcecode/private/mxtest/core/InstrumentTest.cpp index e814a1b7c..22b5bf090 100644 --- a/Sourcecode/private/mxtest/core/InstrumentTest.cpp +++ b/Sourcecode/private/mxtest/core/InstrumentTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, Instrument ) +TEST(Test01, Instrument) { - std::string indentString( INDENT ); - Instrument object1; - Instrument object2; - InstrumentAttributesPtr attributes1 = std::make_shared(); - InstrumentAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->id = XsID{ "ID0023" }; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + std::string indentString(INDENT); + Instrument object1; + Instrument object2; + InstrumentAttributesPtr attributes1 = std::make_shared(); + InstrumentAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->id = XsID{"ID0023"}; + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/InstrumentsTest.cpp b/Sourcecode/private/mxtest/core/InstrumentsTest.cpp index c9d7565b1..eeef49d3a 100644 --- a/Sourcecode/private/mxtest/core/InstrumentsTest.cpp +++ b/Sourcecode/private/mxtest/core/InstrumentsTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Instruments ) +TEST(Test01, Instruments) { - std::string indentString( INDENT ); - NonNegativeInteger value1{ 2 }; - NonNegativeInteger value2{ 3 }; - Instruments object1; - Instruments object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NonNegativeInteger value1{2}; + NonNegativeInteger value2{3}; + Instruments object1; + Instruments object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/IntegersTest.cpp b/Sourcecode/private/mxtest/core/IntegersTest.cpp index e8d41bf82..f12945674 100644 --- a/Sourcecode/private/mxtest/core/IntegersTest.cpp +++ b/Sourcecode/private/mxtest/core/IntegersTest.cpp @@ -11,602 +11,630 @@ using namespace mx::core; -TEST( Int01, Integers ) +TEST(Int01, Integers) { - Integer i( 5 ); + Integer i(5); IntType expected = 5; IntType actual = i.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Int02, Integers ) + +TEST(Int02, Integers) { Integer i; IntType expected = 0; IntType actual = i.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Int03, Integers ) + +TEST(Int03, Integers) { Integer i; - i.setValue( 51 ); + i.setValue(51); IntType expected = 51; IntType actual = i.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Int04, Integers ) + +TEST(Int04, Integers) { - Integer i( 1 ); - i.parse( "32" ); + Integer i(1); + i.parse("32"); IntType expected = 32; IntType actual = i.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Int05, Integers ) + +TEST(Int05, Integers) { - Integer i( 72 ); - i.parse( "xxx" ); + Integer i(72); + i.parse("xxx"); IntType expected = 72; IntType actual = i.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Int06, Integers ) + +TEST(Int06, Integers) { - Integer i( 124 ); + Integer i(124); std::stringstream ss1; ss1 << i; std::string expected = "124"; std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Int07, Integers ) + +TEST(Int07, Integers) { - Integer i( 124 ); + Integer i(124); std::stringstream ss1; - toStream( ss1, i ); + toStream(ss1, i); std::string expected = "124"; std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( Int08, Integers ) + +TEST(Int08, Integers) { - Integer i( 124 ); + Integer i(124); std::stringstream ss1; std::string expected = "124"; - std::string actual = toString( i ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(i); + CHECK_EQUAL(expected, actual) } -TEST( IntRange01, Integers ) + +TEST(IntRange01, Integers) { - IntRange x( 1, 6, 0 ); + IntRange x(1, 6, 0); IntType expected = 1; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( IntRange02, Integers ) + +TEST(IntRange02, Integers) { - IntRange x( 21, 25, 100 ); + IntRange x(21, 25, 100); IntType expected = 25; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( IntRange03, Integers ) + +TEST(IntRange03, Integers) { - IntRange x( -100, -50, 100 ); - x.parse( "-90" ); + IntRange x(-100, -50, 100); + x.parse("-90"); IntType expected = -90; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( IntRange04, Integers ) + +TEST(IntRange04, Integers) { - IntRange x( -1, -3, 100 ); - x.parse( "-2" ); + IntRange x(-1, -3, 100); + x.parse("-2"); IntType expected = -1; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( IntRange05, Integers ) + +TEST(IntRange05, Integers) { - IntRange x( -15, 15, 10 ); - x.parse( "-%sf" ); + IntRange x(-15, 15, 10); + x.parse("-%sf"); IntType expected = 10; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( IntRange06, Integers ) + +TEST(IntRange06, Integers) { - IntRange x( -15, 15, 10 ); + IntRange x(-15, 15, 10); std::stringstream ss1; ss1 << x; std::string expected = "10"; std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( IntRange07, Integers ) + +TEST(IntRange07, Integers) { - IntRange x( -105, -15, 10 ); + IntRange x(-105, -15, 10); std::stringstream ss1; - toStream( ss1, x ); + toStream(ss1, x); std::string expected = "-15"; std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( IntRange08, Integers ) + +TEST(IntRange08, Integers) { - IntRange x( -105, -15, 10 ); + IntRange x(-105, -15, 10); std::stringstream ss1; std::string expected = "-15"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( PositiveInteger01, Integers ) + +TEST(PositiveInteger01, Integers) { - PositiveInteger x( 10 ); + PositiveInteger x(10); IntType expected = 10; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveInteger02, Integers ) + +TEST(PositiveInteger02, Integers) { - PositiveInteger x( 0 ); + PositiveInteger x(0); IntType expected = 1; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveInteger03, Integers ) + +TEST(PositiveInteger03, Integers) { - PositiveInteger x( 0 ); - x.parse( "21" ); + PositiveInteger x(0); + x.parse("21"); IntType expected = 21; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveInteger04, Integers ) + +TEST(PositiveInteger04, Integers) { - PositiveInteger x( 33 ); - x.parse( "2 2" ); + PositiveInteger x(33); + x.parse("2 2"); IntType expected = 33; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveInteger05, Integers ) + +TEST(PositiveInteger05, Integers) { - PositiveInteger x( 10 ); + PositiveInteger x(10); std::stringstream ss1; ss1 << x; std::string expected = "10"; std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveInteger06, Integers ) + +TEST(PositiveInteger06, Integers) { - PositiveInteger x( 12 ); + PositiveInteger x(12); std::stringstream ss1; - toStream( ss1, x ); + toStream(ss1, x); std::string expected = "12"; std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveInteger07, Integers ) + +TEST(PositiveInteger07, Integers) { - PositiveInteger x( 16385000 ); + PositiveInteger x(16385000); std::stringstream ss1; std::string expected = "16385000"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( NonNegativeInteger01, Integers ) + +TEST(NonNegativeInteger01, Integers) { - NonNegativeInteger x( 10 ); + NonNegativeInteger x(10); IntType expected = 10; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( NonNegativeInteger02, Integers ) + +TEST(NonNegativeInteger02, Integers) { - NonNegativeInteger x( -1 ); + NonNegativeInteger x(-1); IntType expected = 0; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( NonNegativeInteger03, Integers ) + +TEST(NonNegativeInteger03, Integers) { - NonNegativeInteger x( 0 ); - x.parse( "21" ); + NonNegativeInteger x(0); + x.parse("21"); IntType expected = 21; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( NonNegativeInteger04, Integers ) + +TEST(NonNegativeInteger04, Integers) { - NonNegativeInteger x( 33 ); - x.parse( "2 2" ); + NonNegativeInteger x(33); + x.parse("2 2"); IntType expected = 33; IntType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( NonNegativeInteger05, Integers ) + +TEST(NonNegativeInteger05, Integers) { - NonNegativeInteger x( 10 ); + NonNegativeInteger x(10); std::stringstream ss1; ss1 << x; std::string expected = "10"; std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( NonNegativeInteger06, Integers ) + +TEST(NonNegativeInteger06, Integers) { - NonNegativeInteger x( 12 ); + NonNegativeInteger x(12); std::stringstream ss1; - toStream( ss1, x ); + toStream(ss1, x); std::string expected = "12"; std::string actual = ss1.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( NonNegativeInteger07, Integers ) + +TEST(NonNegativeInteger07, Integers) { - NonNegativeInteger x( 16385000 ); + NonNegativeInteger x(16385000); std::stringstream ss1; std::string expected = "16385000"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } /* MIN = 1, MAX = 3, DEFAULT = 1 */ -//class AccordionMiddleValue : public IntRange -TEST( AccordionMiddleValue, Integers ) +// class AccordionMiddleValue : public IntRange +TEST(AccordionMiddleValue, Integers) { IntType expected = 0; IntType actual = 0; AccordionMiddleValue x; expected = 0; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - AccordionMiddleValue y( 1 ); + CHECK_EQUAL(expected, actual) + AccordionMiddleValue y(1); expected = 1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - AccordionMiddleValue z( 4 ); + CHECK_EQUAL(expected, actual) + AccordionMiddleValue z(4); expected = 3; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "3"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } - /* MIN = 1, MAX = 8, DEFAULT = 1 */ -//class BeamLevel : public IntRange -TEST( BeamLevel, Integers ) +// class BeamLevel : public IntRange +TEST(BeamLevel, Integers) { IntType expected = 0; IntType actual = 0; BeamLevel x; expected = 1; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - BeamLevel y( 0 ); + CHECK_EQUAL(expected, actual) + BeamLevel y(0); expected = 1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - BeamLevel z( 9 ); + CHECK_EQUAL(expected, actual) + BeamLevel z(9); expected = 8; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "8"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = N/A, MAX = N/A, DEFAULT = 0 */ -//class FifthsValue : public Int -TEST( FifthsValue, Integers ) +// class FifthsValue : public Int +TEST(FifthsValue, Integers) { IntType expected = 0; IntType actual = 0; FifthsValue x; expected = 0; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - FifthsValue y( -1 ); + CHECK_EQUAL(expected, actual) + FifthsValue y(-1); expected = -1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - FifthsValue z( 9 ); + CHECK_EQUAL(expected, actual) + FifthsValue z(9); expected = 9; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "9"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 1, MAX = 16, DEFAULT = 1 */ -//class Midi16 : public IntRange -TEST( Midi16, Integers ) +// class Midi16 : public IntRange +TEST(Midi16, Integers) { IntType expected = 0; IntType actual = 0; Midi16 x; expected = 1; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - Midi16 y( -1 ); + CHECK_EQUAL(expected, actual) + Midi16 y(-1); expected = 1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - Midi16 z( 17 ); + CHECK_EQUAL(expected, actual) + Midi16 z(17); expected = 16; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "16"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 1, MAX = 128, DEFAULT = 1 */ -//class Midi128 : public IntRange -TEST( Midi128, Integers ) +// class Midi128 : public IntRange +TEST(Midi128, Integers) { IntType expected = 0; IntType actual = 0; Midi128 x; expected = 1; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - Midi128 y( -1 ); + CHECK_EQUAL(expected, actual) + Midi128 y(-1); expected = 1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - Midi128 z( 129 ); + CHECK_EQUAL(expected, actual) + Midi128 z(129); expected = 128; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "128"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 1, MAX = 16384, DEFAULT = 1 */ -//class Midi16384 : public IntRange -TEST( Midi16384, Integers ) +// class Midi16384 : public IntRange +TEST(Midi16384, Integers) { IntType expected = 0; IntType actual = 0; Midi16384 x; expected = 1; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - Midi16384 y( -1 ); + CHECK_EQUAL(expected, actual) + Midi16384 y(-1); expected = 1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - Midi16384 z( 16385 ); + CHECK_EQUAL(expected, actual) + Midi16384 z(16385); expected = 16384; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "16384"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 1, MAX = 6, DEFAULT = 1 */ -//class NumberLevel : public IntRange -TEST( NumberLevel, Integers ) +// class NumberLevel : public IntRange +TEST(NumberLevel, Integers) { IntType expected = 0; IntType actual = 0; NumberLevel x; expected = 1; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - NumberLevel y( -1 ); + CHECK_EQUAL(expected, actual) + NumberLevel y(-1); expected = 1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - NumberLevel z( 16385 ); + CHECK_EQUAL(expected, actual) + NumberLevel z(16385); expected = 6; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "6"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 0, MAX = 3, DEFAULT = 0 */ -//class NumberOfLines : public IntRange -TEST( NumberOfLines, Integers ) +// class NumberOfLines : public IntRange +TEST(NumberOfLines, Integers) { IntType expected = 0; IntType actual = 0; NumberOfLines x; expected = 0; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - NumberOfLines y( -1 ); + CHECK_EQUAL(expected, actual) + NumberOfLines y(-1); expected = 0; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - NumberOfLines z( 16385 ); + CHECK_EQUAL(expected, actual) + NumberOfLines z(16385); expected = 3; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "3"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 0, MAX = 9, DEFAULT = 0 */ -//class OctaveValue : public IntRange -TEST( OctaveValue, Integers ) +// class OctaveValue : public IntRange +TEST(OctaveValue, Integers) { IntType expected = 0; IntType actual = 0; OctaveValue x; expected = 0; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - OctaveValue y( -1 ); + CHECK_EQUAL(expected, actual) + OctaveValue y(-1); expected = 0; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - OctaveValue z( 16385 ); + CHECK_EQUAL(expected, actual) + OctaveValue z(16385); expected = 9; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "9"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = N/A, MAX = N/A, DEFAULT = 0 */ -//class StaffLine : public Int -TEST( StaffLine, Integers ) +// class StaffLine : public Int +TEST(StaffLine, Integers) { IntType expected = 0; IntType actual = 0; StaffLine x; expected = 0; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - StaffLine y( -1 ); + CHECK_EQUAL(expected, actual) + StaffLine y(-1); expected = -1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - StaffLine z( 16385000 ); + CHECK_EQUAL(expected, actual) + StaffLine z(16385000); expected = 16385000; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "16385000"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 1, MAX = N/A, DEFAULT = 1 */ -//using StaffNumber = PositiveInteger; -TEST( StaffNumber, Integers ) +// using StaffNumber = PositiveInteger; +TEST(StaffNumber, Integers) { IntType expected = 0; IntType actual = 0; StaffNumber x; expected = 1; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - StaffNumber y( -1 ); + CHECK_EQUAL(expected, actual) + StaffNumber y(-1); expected = 1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - StaffNumber z( 16385000 ); + CHECK_EQUAL(expected, actual) + StaffNumber z(16385000); expected = 16385000; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "16385000"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 1, MAX = N/A, DEFAULT = 1 */ -//using StringNumber = PositiveInteger; -TEST( StringNumber, Integers ) +// using StringNumber = PositiveInteger; +TEST(StringNumber, Integers) { IntType expected = 0; IntType actual = 0; StringNumber x; expected = 1; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - StringNumber y( -1 ); + CHECK_EQUAL(expected, actual) + StringNumber y(-1); expected = 1; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - StringNumber z( 16385000 ); + CHECK_EQUAL(expected, actual) + StringNumber z(16385000); expected = 16385000; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) std::string expected_str = "16385000"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } /* MIN = 0, MAX = 8, DEFAULT = 0 */ -//class TremoloMarks : public IntRange -TEST( TremoloMarks, Integers ) +// class TremoloMarks : public IntRange +TEST(TremoloMarks, Integers) { IntType expected = 0; IntType actual = 0; - + TremoloMarks x; expected = 0; actual = x.getValue(); - CHECK_EQUAL( expected, actual ) - - TremoloMarks y( -1 ); + CHECK_EQUAL(expected, actual) + + TremoloMarks y(-1); expected = 0; actual = y.getValue(); - CHECK_EQUAL( expected, actual ) - - TremoloMarks z( 16385000 ); + CHECK_EQUAL(expected, actual) + + TremoloMarks z(16385000); expected = 8; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) - + CHECK_EQUAL(expected, actual) + std::string expected_str = "8"; - std::string actual_str = toString( z ); - CHECK_EQUAL( expected_str, actual_str ) - - z.parse( "2" ); + std::string actual_str = toString(z); + CHECK_EQUAL(expected_str, actual_str) + + z.parse("2"); expected = 2; actual = z.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } #endif diff --git a/Sourcecode/private/mxtest/core/InterchangeableTest.cpp b/Sourcecode/private/mxtest/core/InterchangeableTest.cpp index c343324e7..b18aba0c4 100644 --- a/Sourcecode/private/mxtest/core/InterchangeableTest.cpp +++ b/Sourcecode/private/mxtest/core/InterchangeableTest.cpp @@ -6,51 +6,52 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Interchangeable ) +TEST(Test01, Interchangeable) { - Interchangeable object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + Interchangeable object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Interchangeable ) + +TEST(Test02, Interchangeable) { - Interchangeable object; + Interchangeable object; object.getAttributes()->hasSeparator = true; object.getAttributes()->separator = TimeSeparator::horizontal; object.getAttributes()->hasSymbol = true; object.getAttributes()->symbol = TimeSymbol::cut; - object.getBeats()->setValue( XsString{ "Weird" } ); - object.getBeatType()->setValue( XsString{ "to be a string" } ); - object.setHasTimeRelation( true ); - object.getTimeRelation()->setValue( TimeRelationEnum::hyphen ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(hyphen)" ); - streamLine( expected, 2, R"(Weird)" ); - streamLine( expected, 2, R"(to be a string)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.getBeats()->setValue(XsString{"Weird"}); + object.getBeatType()->setValue(XsString{"to be a string"}); + object.setHasTimeRelation(true); + object.getTimeRelation()->setValue(TimeRelationEnum::hyphen); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(hyphen)"); + streamLine(expected, 2, R"(Weird)"); + streamLine(expected, 2, R"(to be a string)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/InversionTest.cpp b/Sourcecode/private/mxtest/core/InversionTest.cpp index c09f0213e..727b15f7c 100644 --- a/Sourcecode/private/mxtest/core/InversionTest.cpp +++ b/Sourcecode/private/mxtest/core/InversionTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Inversion ) +TEST(Test01, Inversion) { - std::string indentString( INDENT ); - NonNegativeInteger value1{ 2 }; - NonNegativeInteger value2{ 3 }; - Inversion object1; - Inversion object2( value2 ); - InversionAttributesPtr attributes1 = std::make_shared(); - InversionAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + NonNegativeInteger value1{2}; + NonNegativeInteger value2{3}; + Inversion object1; + Inversion object2(value2); + InversionAttributesPtr attributes1 = std::make_shared(); + InversionAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontStyle = true; attributes1->fontStyle = FontStyle::italic; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/InvertedMordentTest.cpp b/Sourcecode/private/mxtest/core/InvertedMordentTest.cpp index d5745a64c..4472f59a6 100644 --- a/Sourcecode/private/mxtest/core/InvertedMordentTest.cpp +++ b/Sourcecode/private/mxtest/core/InvertedMordentTest.cpp @@ -6,114 +6,109 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/InvertedMordentTest.h" #include "mxtest/core/MidiInstrumentTest.h" /* #include "MidiDeviceTest.cpp" */ - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, InvertedMordent ) +TEST(Test01, InvertedMordent) { TestMode v = TestMode::one; - InvertedMordentPtr object = tgenInvertedMordent( v ); - stringstream expected; - tgenInvertedMordentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + InvertedMordentPtr object = tgenInvertedMordent(v); + stringstream expected; + tgenInvertedMordentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, InvertedMordent ) + +TEST(Test02, InvertedMordent) { TestMode v = TestMode::two; - InvertedMordentPtr object = tgenInvertedMordent( v ); - stringstream expected; - tgenInvertedMordentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + InvertedMordentPtr object = tgenInvertedMordent(v); + stringstream expected; + tgenInvertedMordentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test03, InvertedMordent ) + +TEST(Test03, InvertedMordent) { TestMode v = TestMode::three; - InvertedMordentPtr object = tgenInvertedMordent( v ); - stringstream expected; - tgenInvertedMordentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + InvertedMordentPtr object = tgenInvertedMordent(v); + stringstream expected; + tgenInvertedMordentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } namespace mxtest { - InvertedMordentPtr tgenInvertedMordent( TestMode v ) +InvertedMordentPtr tgenInvertedMordent(TestMode v) +{ + InvertedMordentPtr o = makeInvertedMordent(); + switch (v) { - InvertedMordentPtr o = makeInvertedMordent(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasBeats = true; - o->getAttributes()->beats = TrillBeats( 1.2 ); - o->getAttributes()->hasApproach = true; - o->getAttributes()->approach = AboveBelow::above; - o->getAttributes()->hasAccelerate = true; - o->getAttributes()->accelerate = YesNo::yes; - } - break; - case TestMode::three: - { - o->getAttributes()->hasDeparture = true; - o->getAttributes()->departure = AboveBelow::below; - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasBeats = true; + o->getAttributes()->beats = TrillBeats(1.2); + o->getAttributes()->hasApproach = true; + o->getAttributes()->approach = AboveBelow::above; + o->getAttributes()->hasAccelerate = true; + o->getAttributes()->accelerate = YesNo::yes; + } + break; + case TestMode::three: { + o->getAttributes()->hasDeparture = true; + o->getAttributes()->departure = AboveBelow::below; } - void tgenInvertedMordentExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenInvertedMordentExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/InvertedMordentTest.h b/Sourcecode/private/mxtest/core/InvertedMordentTest.h index 638aacdd8..db3fec997 100644 --- a/Sourcecode/private/mxtest/core/InvertedMordentTest.h +++ b/Sourcecode/private/mxtest/core/InvertedMordentTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::InvertedMordentPtr tgenInvertedMordent( TestMode v ); - void tgenInvertedMordentExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::InvertedMordentPtr tgenInvertedMordent(TestMode v); +void tgenInvertedMordentExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/InvertedTurnTest.cpp b/Sourcecode/private/mxtest/core/InvertedTurnTest.cpp index 08ebe52af..ded512541 100644 --- a/Sourcecode/private/mxtest/core/InvertedTurnTest.cpp +++ b/Sourcecode/private/mxtest/core/InvertedTurnTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, InvertedTurn ) +TEST(Test01, InvertedTurn) { - std::string indentString( INDENT ); - InvertedTurn object1; - InvertedTurn object2; - InvertedTurnAttributesPtr attributes1 = std::make_shared(); - InvertedTurnAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + InvertedTurn object1; + InvertedTurn object2; + InvertedTurnAttributesPtr attributes1 = std::make_shared(); + InvertedTurnAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->defaultX = TenthsValue{0.1}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/IpaTest.cpp b/Sourcecode/private/mxtest/core/IpaTest.cpp index b5e7d968b..f50b70209 100644 --- a/Sourcecode/private/mxtest/core/IpaTest.cpp +++ b/Sourcecode/private/mxtest/core/IpaTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Ipa ) +TEST(Test01, Ipa) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - Ipa object1; - Ipa object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + Ipa object1; + Ipa object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/KeyAccidentalTest.cpp b/Sourcecode/private/mxtest/core/KeyAccidentalTest.cpp index a46381ff3..abc63532c 100644 --- a/Sourcecode/private/mxtest/core/KeyAccidentalTest.cpp +++ b/Sourcecode/private/mxtest/core/KeyAccidentalTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, KeyAccidental ) +TEST(Test01, KeyAccidental) { - std::string indentString( INDENT ); - AccidentalValue value1 = AccidentalValue::quarterFlat; - AccidentalValue value2 = AccidentalValue::sori; - KeyAccidental object1; - KeyAccidental object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(natural)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(sori)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + AccidentalValue value1 = AccidentalValue::quarterFlat; + AccidentalValue value2 = AccidentalValue::sori; + KeyAccidental object1; + KeyAccidental object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(natural)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(sori)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/KeyAlterTest.cpp b/Sourcecode/private/mxtest/core/KeyAlterTest.cpp index 008c7ec75..63b0defd4 100644 --- a/Sourcecode/private/mxtest/core/KeyAlterTest.cpp +++ b/Sourcecode/private/mxtest/core/KeyAlterTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, KeyAlter ) +TEST(Test01, KeyAlter) { - std::string indentString( INDENT ); - Semitones value1{ -0.1 }; - Semitones value2{ 2.02 }; - KeyAlter object1; - KeyAlter object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2.02)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Semitones value1{-0.1}; + Semitones value2{2.02}; + KeyAlter object1; + KeyAlter object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2.02)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/KeyOctaveTest.cpp b/Sourcecode/private/mxtest/core/KeyOctaveTest.cpp index 55d8c98fe..3f237a5f8 100644 --- a/Sourcecode/private/mxtest/core/KeyOctaveTest.cpp +++ b/Sourcecode/private/mxtest/core/KeyOctaveTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, KeyOctave ) +TEST(Test01, KeyOctave) { - std::string indentString( INDENT ); - OctaveValue value1{ 2 }; - OctaveValue value2{ 4 }; - KeyOctave object1; - KeyOctave object2( value2 ); - KeyOctaveAttributesPtr attributes1 = std::make_shared(); - KeyOctaveAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + OctaveValue value1{2}; + OctaveValue value2{4}; + KeyOctave object1; + KeyOctave object2(value2); + KeyOctaveAttributesPtr attributes1 = std::make_shared(); + KeyOctaveAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasCancel = true; attributes1->cancel = YesNo::yes; - attributes1->number = PositiveInteger{ 5 }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->number = PositiveInteger{5}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/KeyStepTest.cpp b/Sourcecode/private/mxtest/core/KeyStepTest.cpp index f865b2645..9518f555c 100644 --- a/Sourcecode/private/mxtest/core/KeyStepTest.cpp +++ b/Sourcecode/private/mxtest/core/KeyStepTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, KeyStep ) +TEST(Test01, KeyStep) { - std::string indentString( INDENT ); - StepEnum value1 = StepEnum::b; - StepEnum value2 = StepEnum::f; - KeyStep object1; - KeyStep object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(A)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(F)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StepEnum value1 = StepEnum::b; + StepEnum value2 = StepEnum::f; + KeyStep object1; + KeyStep object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(A)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(F)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/KeyTest.cpp b/Sourcecode/private/mxtest/core/KeyTest.cpp index 9bab09edf..7d580b88e 100644 --- a/Sourcecode/private/mxtest/core/KeyTest.cpp +++ b/Sourcecode/private/mxtest/core/KeyTest.cpp @@ -6,64 +6,64 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Key ) +TEST(Test01, Key) { Key object; - object.getKeyChoice()->getTraditionalKey()->getFifths()->setValue( FifthsValue{ 3 } ); - object.getKeyChoice()->getTraditionalKey()->setHasCancel( true ); - object.getKeyChoice()->getTraditionalKey()->getCancel()->setValue( FifthsValue{ 5 } ); - object.getKeyChoice()->getTraditionalKey()->setHasMode( true ); - object.getKeyChoice()->getTraditionalKey()->getMode()->setValue( ModeValue{ ModeEnum::dorian } ); + object.getKeyChoice()->getTraditionalKey()->getFifths()->setValue(FifthsValue{3}); + object.getKeyChoice()->getTraditionalKey()->setHasCancel(true); + object.getKeyChoice()->getTraditionalKey()->getCancel()->setValue(FifthsValue{5}); + object.getKeyChoice()->getTraditionalKey()->setHasMode(true); + object.getKeyChoice()->getTraditionalKey()->getMode()->setValue(ModeValue{ModeEnum::dorian}); object.getAttributes()->hasPrintObject = true; object.getAttributes()->printObject = YesNo::yes; object.getAttributes()->hasFontWeight = true; object.getAttributes()->fontWeight = FontWeight::bold; stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(5)" ); - streamLine( expected, 2, R"(3)" ); - streamLine( expected, 2, R"(dorian)" ); - streamLine( expected, 1, R"()", false ); + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(5)"); + streamLine(expected, 2, R"(3)"); + streamLine(expected, 2, R"(dorian)"); + streamLine(expected, 1, R"()", false); stringstream actual; - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) } -TEST( Test02, TraditionalKey ) +TEST(Test02, TraditionalKey) { Key object; object.getAttributes()->hasNumber = true; - object.getAttributes()->number = StaffNumber{ 2 }; - object.getKeyChoice()->setChoice( KeyChoice::Choice::nonTraditionalKey ); + object.getAttributes()->number = StaffNumber{2}; + object.getKeyChoice()->setChoice(KeyChoice::Choice::nonTraditionalKey); NonTraditionalKeyPtr ntk1 = makeNonTraditionalKey(); - ntk1->setHasKeyAccidental( true ); - ntk1->setKeyAccidental( std::make_shared( AccidentalValue::flat ) ); - ntk1->setKeyAlter( std::make_shared( Semitones{ -0.2 } ) ); - object.getKeyChoice()->addNonTraditionalKey( ntk1 ); + ntk1->setHasKeyAccidental(true); + ntk1->setKeyAccidental(std::make_shared(AccidentalValue::flat)); + ntk1->setKeyAlter(std::make_shared(Semitones{-0.2})); + object.getKeyChoice()->addNonTraditionalKey(ntk1); NonTraditionalKeyPtr ntk2 = makeNonTraditionalKey(); - ntk2->setHasKeyAccidental( true ); - ntk2->setKeyAccidental( std::make_shared( AccidentalValue::sharp ) ); - ntk2->setKeyAlter( std::make_shared( Semitones{ 2 } ) ); - object.getKeyChoice()->addNonTraditionalKey( ntk2 ); + ntk2->setHasKeyAccidental(true); + ntk2->setKeyAccidental(std::make_shared(AccidentalValue::sharp)); + ntk2->setKeyAlter(std::make_shared(Semitones{2})); + object.getKeyChoice()->addNonTraditionalKey(ntk2); stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(A)" ); - streamLine( expected, 2, R"(-0.2)" ); - streamLine( expected, 2, R"(flat)" ); - streamLine( expected, 2, R"(A)" ); - streamLine( expected, 2, R"(2)" ); - streamLine( expected, 2, R"(sharp)" ); - streamLine( expected, 1, R"()", false ); + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(A)"); + streamLine(expected, 2, R"(-0.2)"); + streamLine(expected, 2, R"(flat)"); + streamLine(expected, 2, R"(A)"); + streamLine(expected, 2, R"(2)"); + streamLine(expected, 2, R"(sharp)"); + streamLine(expected, 1, R"()", false); stringstream actual; - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/KindTest.cpp b/Sourcecode/private/mxtest/core/KindTest.cpp index 552cb6767..9c6550b83 100644 --- a/Sourcecode/private/mxtest/core/KindTest.cpp +++ b/Sourcecode/private/mxtest/core/KindTest.cpp @@ -11,40 +11,43 @@ using namespace mx::core; -TEST( Test01, Kind ) +TEST(Test01, Kind) { - std::string indentString( INDENT ); - KindValue value1 = KindValue::augmented; - KindValue value2 = KindValue::minorSeventh; - Kind object1; - Kind object2( value2 ); - KindAttributesPtr attributes1 = std::make_shared(); - KindAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + KindValue value1 = KindValue::augmented; + KindValue value2 = KindValue::minorSeventh; + Kind object1; + Kind object2(value2); + KindAttributesPtr attributes1 = std::make_shared(); + KindAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasStackDegrees = true; attributes1->stackDegrees = YesNo::yes; attributes1->hasFontFamily = true; - attributes1->fontFamily = CommaSeparatedText( " Hello , World" ); - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); - CHECK( object2.getAttributes() ) - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = "none"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+"minor-seventh"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->fontFamily = CommaSeparatedText(" Hello , World"); + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); + CHECK(object2.getAttributes()) + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = "none"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + "minor-seventh"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/LaughingTest.cpp b/Sourcecode/private/mxtest/core/LaughingTest.cpp index 3888e0a69..445f7ea48 100644 --- a/Sourcecode/private/mxtest/core/LaughingTest.cpp +++ b/Sourcecode/private/mxtest/core/LaughingTest.cpp @@ -11,28 +11,27 @@ using namespace mx::core; - -TEST( Test01, Laughing ) +TEST(Test01, Laughing) { - std::string indentString( INDENT ); - Laughing object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Laughing object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/LayoutGroupTest.cpp b/Sourcecode/private/mxtest/core/LayoutGroupTest.cpp index 8abfa4f48..25842bbcd 100644 --- a/Sourcecode/private/mxtest/core/LayoutGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/LayoutGroupTest.cpp @@ -8,120 +8,115 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/LayoutGroupTest.h" -#include "mxtest/core/SystemLayoutTest.h" -#include "mxtest/core/StaffLayoutTest.h" #include "mxtest/core/PageLayoutTest.h" +#include "mxtest/core/StaffLayoutTest.h" +#include "mxtest/core/SystemLayoutTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, LayoutGroup ) +TEST(Test01, LayoutGroup) { TestMode v = TestMode::one; - LayoutGroupPtr object = tgenLayoutGroup( v ); - stringstream expected; - tgenLayoutGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + LayoutGroupPtr object = tgenLayoutGroup(v); + stringstream expected; + tgenLayoutGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) - CHECK( isOneLineOnly ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) + CHECK(isOneLineOnly) } -TEST( Test02, LayoutGroup ) + +TEST(Test02, LayoutGroup) { TestMode v = TestMode::two; - LayoutGroupPtr object = tgenLayoutGroup( v ); - stringstream expected; - tgenLayoutGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + LayoutGroupPtr object = tgenLayoutGroup(v); + stringstream expected; + tgenLayoutGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, LayoutGroup ) + +TEST(Test03, LayoutGroup) { TestMode v = TestMode::three; - LayoutGroupPtr object = tgenLayoutGroup( v ); - stringstream expected; - tgenLayoutGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + LayoutGroupPtr object = tgenLayoutGroup(v); + stringstream expected; + tgenLayoutGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - LayoutGroupPtr tgenLayoutGroup( TestMode v ) +LayoutGroupPtr tgenLayoutGroup(TestMode v) +{ + LayoutGroupPtr o = makeLayoutGroup(); + switch (v) { - LayoutGroupPtr o = makeLayoutGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasPageLayout( true ); - o->setPageLayout( tgenPageLayout( v ) ); - o->setHasSystemLayout( true ); - o->setSystemLayout( tgenSystemLayout( v ) ); - } - break; - case TestMode::three: - { - o->addStaffLayout( tgenStaffLayout( TestMode::one ) ); - o->addStaffLayout( tgenStaffLayout( TestMode::two ) ); - o->addStaffLayout( tgenStaffLayout( TestMode::three ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasPageLayout(true); + o->setPageLayout(tgenPageLayout(v)); + o->setHasSystemLayout(true); + o->setSystemLayout(tgenSystemLayout(v)); + } + break; + case TestMode::three: { + o->addStaffLayout(tgenStaffLayout(TestMode::one)); + o->addStaffLayout(tgenStaffLayout(TestMode::two)); + o->addStaffLayout(tgenStaffLayout(TestMode::three)); } - void tgenLayoutGroupExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenLayoutGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - tgenPageLayoutExpected( os, i, v ); - os << std::endl; - tgenSystemLayoutExpected( os, i, v ); - } - break; - case TestMode::three: - { - tgenStaffLayoutExpected(os, i, TestMode::one ); - os << std::endl; - tgenStaffLayoutExpected(os, i, TestMode::two ); - os << std::endl; - tgenStaffLayoutExpected(os, i, TestMode::three ); - } - break; - default: - break; - } + case TestMode::one: { + } + break; + case TestMode::two: { + tgenPageLayoutExpected(os, i, v); + os << std::endl; + tgenSystemLayoutExpected(os, i, v); + } + break; + case TestMode::three: { + tgenStaffLayoutExpected(os, i, TestMode::one); + os << std::endl; + tgenStaffLayoutExpected(os, i, TestMode::two); + os << std::endl; + tgenStaffLayoutExpected(os, i, TestMode::three); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/LayoutGroupTest.h b/Sourcecode/private/mxtest/core/LayoutGroupTest.h index c185dddcc..7234dbe2f 100644 --- a/Sourcecode/private/mxtest/core/LayoutGroupTest.h +++ b/Sourcecode/private/mxtest/core/LayoutGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::LayoutGroupPtr tgenLayoutGroup( TestMode v ); - void tgenLayoutGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::LayoutGroupPtr tgenLayoutGroup(TestMode v); +void tgenLayoutGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/LeftDividerTest.cpp b/Sourcecode/private/mxtest/core/LeftDividerTest.cpp index 3627a5cab..ed93b5f2e 100644 --- a/Sourcecode/private/mxtest/core/LeftDividerTest.cpp +++ b/Sourcecode/private/mxtest/core/LeftDividerTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, LeftDivider ) +TEST(Test01, LeftDivider) { - std::string indentString( INDENT ); - LeftDivider object1; - LeftDivider object2; - EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); - EmptyPrintObjectStyleAlignAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + LeftDivider object1; + LeftDivider object2; + EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); + EmptyPrintObjectStyleAlignAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/LeftMarginTest.cpp b/Sourcecode/private/mxtest/core/LeftMarginTest.cpp index 22dbfa44f..ad30dda38 100644 --- a/Sourcecode/private/mxtest/core/LeftMarginTest.cpp +++ b/Sourcecode/private/mxtest/core/LeftMarginTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, LeftMargin ) +TEST(Test01, LeftMargin) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - LeftMargin object1; - LeftMargin object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + LeftMargin object1; + LeftMargin object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/LevelTest.cpp b/Sourcecode/private/mxtest/core/LevelTest.cpp index 1db4a092c..ef37b7416 100644 --- a/Sourcecode/private/mxtest/core/LevelTest.cpp +++ b/Sourcecode/private/mxtest/core/LevelTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, Level ) +TEST(Test01, Level) { - std::string indentString( INDENT ); - XsString value1{ "Bed" }; - XsString value2{ "Time" }; - Level object1; - Level object2( value2 ); - LevelAttributesPtr attributes1 = std::make_shared(); - LevelAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"Bed"}; + XsString value2{"Time"}; + Level object1; + Level object2(value2); + LevelAttributesPtr attributes1 = std::make_shared(); + LevelAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasParentheses = true; attributes1->parentheses = YesNo::no; attributes1->hasReference = true; attributes1->reference = YesNo::yes; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Time)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Time)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/LineTest.cpp b/Sourcecode/private/mxtest/core/LineTest.cpp index dcaa6759b..1056c6ef5 100644 --- a/Sourcecode/private/mxtest/core/LineTest.cpp +++ b/Sourcecode/private/mxtest/core/LineTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Line ) +TEST(Test01, Line) { - std::string indentString( INDENT ); - StaffLine value1{ 2 }; - StaffLine value2{ 5 }; - Line object1; - Line object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(5)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StaffLine value1{2}; + StaffLine value2{5}; + Line object1; + Line object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(5)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/LineWidthTest.cpp b/Sourcecode/private/mxtest/core/LineWidthTest.cpp index 9abc81ff0..5f55d81e1 100644 --- a/Sourcecode/private/mxtest/core/LineWidthTest.cpp +++ b/Sourcecode/private/mxtest/core/LineWidthTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, LineWidth ) +TEST(Test01, LineWidth) { - std::string indentString( INDENT ); - TenthsValue value1( -0.1 ); - TenthsValue value2( 1.091236 ); - LineWidth object1; - LineWidth object2( value2 ); - LineWidthAttributesPtr attributes1 = std::make_shared(); - LineWidthAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->type = LineWidthType( LineWidthTypeEnum::enclosure ); - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(1.091236)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1(-0.1); + TenthsValue value2(1.091236); + LineWidth object1; + LineWidth object2(value2); + LineWidthAttributesPtr attributes1 = std::make_shared(); + LineWidthAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->type = LineWidthType(LineWidthTypeEnum::enclosure); + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(1.091236)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/LinkTest.cpp b/Sourcecode/private/mxtest/core/LinkTest.cpp index 2cc7b400a..eee979efd 100644 --- a/Sourcecode/private/mxtest/core/LinkTest.cpp +++ b/Sourcecode/private/mxtest/core/LinkTest.cpp @@ -11,39 +11,42 @@ using namespace mx::core; -TEST( Test01, Link ) +TEST(Test01, Link) { - std::string indentString( INDENT ); - Link object1; - Link object2; - LinkAttributesPtr attributes1 = std::make_shared(); - LinkAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Link object1; + Link object2; + LinkAttributesPtr attributes1 = std::make_shared(); + LinkAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasShow = true; attributes1->hasTitle = true; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/LyricFontTest.cpp b/Sourcecode/private/mxtest/core/LyricFontTest.cpp index db7936537..cc7ef290b 100644 --- a/Sourcecode/private/mxtest/core/LyricFontTest.cpp +++ b/Sourcecode/private/mxtest/core/LyricFontTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, LyricFont ) +TEST(Test01, LyricFont) { - std::string indentString( INDENT ); - LyricFont object1; - LyricFont object2; - LyricFontAttributesPtr attributes1 = std::make_shared(); - LyricFontAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + LyricFont object1; + LyricFont object2; + LyricFontAttributesPtr attributes1 = std::make_shared(); + LyricFontAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasName = true; - attributes1->name = { "ABC" }; + attributes1->name = {"ABC"}; attributes1->hasFontWeight = true; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/LyricLanguageTest.cpp b/Sourcecode/private/mxtest/core/LyricLanguageTest.cpp index ce0773483..638253528 100644 --- a/Sourcecode/private/mxtest/core/LyricLanguageTest.cpp +++ b/Sourcecode/private/mxtest/core/LyricLanguageTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, LyricLanguage ) +TEST(Test01, LyricLanguage) { - std::string indentString( INDENT ); - LyricLanguage object1; - LyricLanguage object2; - LyricLanguageAttributesPtr attributes1 = std::make_shared(); - LyricLanguageAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + LyricLanguage object1; + LyricLanguage object2; + LyricLanguageAttributesPtr attributes1 = std::make_shared(); + LyricLanguageAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasNumber = true; - attributes1->number = XsNMToken{ "ABC" }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->number = XsNMToken{"ABC"}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/LyricTest.cpp b/Sourcecode/private/mxtest/core/LyricTest.cpp index d3c6bb6c9..95b0b88bf 100644 --- a/Sourcecode/private/mxtest/core/LyricTest.cpp +++ b/Sourcecode/private/mxtest/core/LyricTest.cpp @@ -6,137 +6,133 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/EditorialGroupTest.h" #include "mxtest/core/ElisionSyllabicGroupTest.h" #include "mxtest/core/ElisionSyllabicTextGroupTest.h" -#include "mxtest/core/SyllabicTextGroupTest.h" -#include "mxtest/core/LyricTextChoiceTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/LyricTest.h" -#include "mxtest/core/EditorialGroupTest.h" +#include "mxtest/core/LyricTextChoiceTest.h" #include "mxtest/core/MidiInstrumentTest.h" - +#include "mxtest/core/SyllabicTextGroupTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Lyric ) +TEST(Test01, Lyric) { TestMode v = TestMode::one; - LyricPtr object = tgenLyric( v ); - stringstream expected; - tgenLyricExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + LyricPtr object = tgenLyric(v); + stringstream expected; + tgenLyricExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Lyric ) + +TEST(Test02, Lyric) { TestMode v = TestMode::two; - LyricPtr object = tgenLyric( v ); - stringstream expected; - tgenLyricExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + LyricPtr object = tgenLyric(v); + stringstream expected; + tgenLyricExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Lyric ) + +TEST(Test03, Lyric) { TestMode v = TestMode::three; - LyricPtr object = tgenLyric( v ); - stringstream expected; - tgenLyricExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + LyricPtr object = tgenLyric(v); + stringstream expected; + tgenLyricExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - LyricPtr tgenLyric( TestMode v ) +LyricPtr tgenLyric(TestMode v) +{ + LyricPtr o = makeLyric(); + switch (v) { - LyricPtr o = makeLyric(); - switch ( v ) - { - case TestMode::one: - { - o->setLyricTextChoice( tgenLyricTextChoice( v ) ); - } - break; - case TestMode::two: - { - o->getAttributes()->hasName = true; - o->getAttributes()->name = XsToken( "Toker" ); - o->setLyricTextChoice( tgenLyricTextChoice( v ) ); - o->setEditorialGroup( tgenEditorialGroup( v ) ); - o->setHasEndLine( true ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasName = true; - o->getAttributes()->name = XsToken( "YOLO" ); - o->getAttributes()->hasNumber = true; - o->getAttributes()->number = XsNMToken( "Looser" ); - o->setLyricTextChoice( tgenLyricTextChoice( v ) ); - o->setEditorialGroup( tgenEditorialGroup( v ) ); - o->setHasEndParagraph( true ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setLyricTextChoice(tgenLyricTextChoice(v)); + } + break; + case TestMode::two: { + o->getAttributes()->hasName = true; + o->getAttributes()->name = XsToken("Toker"); + o->setLyricTextChoice(tgenLyricTextChoice(v)); + o->setEditorialGroup(tgenEditorialGroup(v)); + o->setHasEndLine(true); + } + break; + case TestMode::three: { + o->getAttributes()->hasName = true; + o->getAttributes()->name = XsToken("YOLO"); + o->getAttributes()->hasNumber = true; + o->getAttributes()->number = XsNMToken("Looser"); + o->setLyricTextChoice(tgenLyricTextChoice(v)); + o->setEditorialGroup(tgenEditorialGroup(v)); + o->setHasEndParagraph(true); } - void tgenLyricExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenLyricExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenLyricTextChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenLyricTextChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"()" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenLyricTextChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"()" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenLyricTextChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenLyricTextChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenLyricTextChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/LyricTest.h b/Sourcecode/private/mxtest/core/LyricTest.h index 95a26cbcf..939abd206 100644 --- a/Sourcecode/private/mxtest/core/LyricTest.h +++ b/Sourcecode/private/mxtest/core/LyricTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::LyricPtr tgenLyric( TestMode v ); - void tgenLyricExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::LyricPtr tgenLyric(TestMode v); +void tgenLyricExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/LyricTextChoiceTest.h b/Sourcecode/private/mxtest/core/LyricTextChoiceTest.h index 8cd23f6a1..76a0ee47c 100644 --- a/Sourcecode/private/mxtest/core/LyricTextChoiceTest.h +++ b/Sourcecode/private/mxtest/core/LyricTextChoiceTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::LyricTextChoicePtr tgenLyricTextChoice( TestMode v ); - void tgenLyricTextChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::LyricTextChoicePtr tgenLyricTextChoice(TestMode v); +void tgenLyricTextChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/LyricTextCoiceTest.cpp b/Sourcecode/private/mxtest/core/LyricTextCoiceTest.cpp index cfa1055f9..b57504099 100644 --- a/Sourcecode/private/mxtest/core/LyricTextCoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/LyricTextCoiceTest.cpp @@ -6,143 +6,142 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/ElisionSyllabicGroupTest.h" #include "mxtest/core/ElisionSyllabicTextGroupTest.h" -#include "mxtest/core/SyllabicTextGroupTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/LyricTextChoiceTest.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/SyllabicTextGroupTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, LyricTextChoice ) +TEST(Test01, LyricTextChoice) { TestMode v = TestMode::one; - LyricTextChoicePtr object = tgenLyricTextChoice( v ); - stringstream expected; - tgenLyricTextChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + LyricTextChoicePtr object = tgenLyricTextChoice(v); + stringstream expected; + tgenLyricTextChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, LyricTextChoice ) + +TEST(Test02, LyricTextChoice) { TestMode v = TestMode::two; - LyricTextChoicePtr object = tgenLyricTextChoice( v ); - stringstream expected; - tgenLyricTextChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + LyricTextChoicePtr object = tgenLyricTextChoice(v); + stringstream expected; + tgenLyricTextChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, LyricTextChoice ) + +TEST(Test03, LyricTextChoice) { TestMode v = TestMode::three; - LyricTextChoicePtr object = tgenLyricTextChoice( v ); - stringstream expected; - tgenLyricTextChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + LyricTextChoicePtr object = tgenLyricTextChoice(v); + stringstream expected; + tgenLyricTextChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test04, LyricTextChoice ) + +TEST(Test04, LyricTextChoice) { TestMode v = TestMode::three; - LyricTextChoicePtr object = tgenLyricTextChoice( v ); - object->setChoice( LyricTextChoice::Choice::extend ); - stringstream expected( R"()" ); - stringstream actual; - // object->toStream( std::cout, 1 ); + LyricTextChoicePtr object = tgenLyricTextChoice(v); + object->setChoice(LyricTextChoice::Choice::extend); + stringstream expected(R"()"); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 0, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + object->streamContents(actual, 0, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test05, LyricTextChoice ) + +TEST(Test05, LyricTextChoice) { TestMode v = TestMode::three; - LyricTextChoicePtr object = tgenLyricTextChoice( v ); - object->setChoice( LyricTextChoice::Choice::humming ); - stringstream expected( R"()" ); - stringstream actual; - // object->toStream( std::cout, 1 ); + LyricTextChoicePtr object = tgenLyricTextChoice(v); + object->setChoice(LyricTextChoice::Choice::humming); + stringstream expected(R"()"); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 0, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + object->streamContents(actual, 0, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } namespace mxtest { - LyricTextChoicePtr tgenLyricTextChoice( TestMode v ) +LyricTextChoicePtr tgenLyricTextChoice(TestMode v) +{ + LyricTextChoicePtr o = makeLyricTextChoice(); + switch (v) { - LyricTextChoicePtr o = makeLyricTextChoice(); - switch ( v ) - { - case TestMode::one: - { - o->setChoice( LyricTextChoice::Choice::laughing ); - } - break; - case TestMode::two: - { - o->setChoice( LyricTextChoice::Choice::syllabicTextGroup ); - o->setSyllabicTextGroup( tgenSyllabicTextGroup( v ) ); - } - break; - case TestMode::three: - { - o->setChoice( LyricTextChoice::Choice::syllabicTextGroup ); - o->setSyllabicTextGroup( tgenSyllabicTextGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setChoice(LyricTextChoice::Choice::laughing); } - void tgenLyricTextChoiceExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::two: { + o->setChoice(LyricTextChoice::Choice::syllabicTextGroup); + o->setSyllabicTextGroup(tgenSyllabicTextGroup(v)); + } + break; + case TestMode::three: { + o->setChoice(LyricTextChoice::Choice::syllabicTextGroup); + o->setSyllabicTextGroup(tgenSyllabicTextGroup(v)); + } + break; + default: + break; + } + return o; +} + +void tgenLyricTextChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - tgenSyllabicTextGroupExpected( os, i, v ); - } - break; - case TestMode::three: - { - tgenSyllabicTextGroupExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + tgenSyllabicTextGroupExpected(os, i, v); + } + break; + case TestMode::three: { + tgenSyllabicTextGroupExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MakeFunctionsTest.cpp b/Sourcecode/private/mxtest/core/MakeFunctionsTest.cpp index 18dfabb16..83a789803 100644 --- a/Sourcecode/private/mxtest/core/MakeFunctionsTest.cpp +++ b/Sourcecode/private/mxtest/core/MakeFunctionsTest.cpp @@ -6,2564 +6,2745 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test0, ConvenienceMakeFunctions ) -{ - auto val = DynamicsValue{ DynamicsEnum::ffffff }; - auto a = makeDynamics( val ); - auto b = makeDynamics( val ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) +TEST(Test0, ConvenienceMakeFunctions) +{ + auto val = DynamicsValue{DynamicsEnum::ffffff}; + auto a = makeDynamics(val); + auto b = makeDynamics(val); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) } -TEST( Test1, ConvenienceMakeFunctions ) + +TEST(Test1, ConvenienceMakeFunctions) { auto val = AccidentalValue::flatDown; - auto a = makeAccidentalText( val ); - auto b = makeAccidentalText( val ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test2, ConvenienceMakeFunctions ) -{ - auto a = makeDisplayText( XsString { "something" } ); - auto b = makeDisplayText( XsString { "something" } ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test3, ConvenienceMakeFunctions ) -{ - auto a = makeOtherPlay( ); - auto b = makeOtherPlay( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test4, ConvenienceMakeFunctions ) -{ - auto a = makePartSymbol( GroupSymbolValue::square ); - auto b = makePartSymbol( GroupSymbolValue::square ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test5, ConvenienceMakeFunctions ) -{ - auto a = makeKeyOctave( ); - auto b = makeKeyOctave( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test6, ConvenienceMakeFunctions ) -{ - auto a = makeMultipleRest( ); - auto b = makeMultipleRest( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test7, ConvenienceMakeFunctions ) -{ - auto a = makeMeasureRepeat( ); - auto b = makeMeasureRepeat( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test8, ConvenienceMakeFunctions ) -{ - auto a = makeBarStyle( ); - auto b = makeBarStyle( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test9, ConvenienceMakeFunctions ) -{ - auto a = makeFermata( ); - auto b = makeFermata( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test10, ConvenienceMakeFunctions ) -{ - auto a = makeEnding( ); - auto b = makeEnding( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test11, ConvenienceMakeFunctions ) -{ - auto a = makeBassStep( ); - auto b = makeBassStep( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test12, ConvenienceMakeFunctions ) -{ - auto a = makeBassAlter( ); - auto b = makeBassAlter( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test13, ConvenienceMakeFunctions ) -{ - auto a = makeDegreeValue( ); - auto b = makeDegreeValue( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test14, ConvenienceMakeFunctions ) -{ - auto a = makeDegreeAlter( ); - auto b = makeDegreeAlter( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test15, ConvenienceMakeFunctions ) -{ - auto a = makeDegreeType( ); - auto b = makeDegreeType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test16, ConvenienceMakeFunctions ) -{ - auto a = makeOffset( ); - auto b = makeOffset( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test17, ConvenienceMakeFunctions ) -{ - auto a = makeRehearsal( ); - auto b = makeRehearsal( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test18, ConvenienceMakeFunctions ) -{ - auto a = makeWords( ); - auto b = makeWords( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test19, ConvenienceMakeFunctions ) -{ - auto a = makePrincipalVoice( ); - auto b = makePrincipalVoice( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test20, ConvenienceMakeFunctions ) -{ - auto a = makeOtherDirection( ); - auto b = makeOtherDirection( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test21, ConvenienceMakeFunctions ) -{ - auto a = makeFirstFret( ); - auto b = makeFirstFret( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test22, ConvenienceMakeFunctions ) -{ - auto a = makeFret( ); - auto b = makeFret( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test23, ConvenienceMakeFunctions ) -{ - auto a = makeFingering( ); - auto b = makeFingering( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test24, ConvenienceMakeFunctions ) -{ - auto a = makeFeature( ); - auto b = makeFeature( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test25, ConvenienceMakeFunctions ) -{ - auto a = makePerMinute( ); - auto b = makePerMinute( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test26, ConvenienceMakeFunctions ) -{ - auto a = makeMetronomeBeam( ); - auto b = makeMetronomeBeam( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test27, ConvenienceMakeFunctions ) -{ - auto a = makeBeater( ); - auto b = makeBeater( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test28, ConvenienceMakeFunctions ) -{ - auto a = makeMeasureNumbering( ); - auto b = makeMeasureNumbering( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test29, ConvenienceMakeFunctions ) -{ - auto a = makeRootStep( ); - auto b = makeRootStep( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test30, ConvenienceMakeFunctions ) -{ - auto a = makeRootAlter( ); - auto b = makeRootAlter( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test31, ConvenienceMakeFunctions ) -{ - auto a = makeMidiDevice( ); - auto b = makeMidiDevice( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test32, ConvenienceMakeFunctions ) -{ - auto a = makeEncoder( ); - auto b = makeEncoder( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test33, ConvenienceMakeFunctions ) -{ - auto a = makeCreator( ); - auto b = makeCreator( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test34, ConvenienceMakeFunctions ) -{ - auto a = makeRights( ); - auto b = makeRights( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test35, ConvenienceMakeFunctions ) -{ - auto a = makeRelation( ); - auto b = makeRelation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test36, ConvenienceMakeFunctions ) -{ - auto a = makeMiscellaneousField( ); - auto b = makeMiscellaneousField( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test37, ConvenienceMakeFunctions ) -{ - auto a = makeLineWidth( ); - auto b = makeLineWidth( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test38, ConvenienceMakeFunctions ) -{ - auto a = makeNoteSize( ); - auto b = makeNoteSize( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test39, ConvenienceMakeFunctions ) -{ - auto a = makeDistance( ); - auto b = makeDistance( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test40, ConvenienceMakeFunctions ) -{ - auto a = makeOtherAppearance( ); - auto b = makeOtherAppearance( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test41, ConvenienceMakeFunctions ) -{ - auto a = makeBreathMark( ); - auto b = makeBreathMark( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test42, ConvenienceMakeFunctions ) -{ - auto a = makeOtherArticulation( ); - auto b = makeOtherArticulation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test43, ConvenienceMakeFunctions ) -{ - auto a = makeWithBar( ); - auto b = makeWithBar( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test44, ConvenienceMakeFunctions ) -{ - auto a = makePrefix( ); - auto b = makePrefix( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test45, ConvenienceMakeFunctions ) -{ - auto a = makeFigureNumber( ); - auto b = makeFigureNumber( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test46, ConvenienceMakeFunctions ) -{ - auto a = makeSuffix( ); - auto b = makeSuffix( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test47, ConvenienceMakeFunctions ) -{ - auto a = makeHoleClosed( ); - auto b = makeHoleClosed( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test48, ConvenienceMakeFunctions ) -{ - auto a = makeText( ); - auto b = makeText( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test49, ConvenienceMakeFunctions ) -{ - auto a = makeElision( ); - auto b = makeElision( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test50, ConvenienceMakeFunctions ) -{ - auto a = makeGlissando( ); - auto b = makeGlissando( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test51, ConvenienceMakeFunctions ) -{ - auto a = makeSlide( ); - auto b = makeSlide( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test52, ConvenienceMakeFunctions ) -{ - auto a = makeAccidentalMark( ); - auto b = makeAccidentalMark( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test53, ConvenienceMakeFunctions ) -{ - auto a = makeOtherNotation( ); - auto b = makeOtherNotation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test54, ConvenienceMakeFunctions ) -{ - auto a = makeType( ); - auto b = makeType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test55, ConvenienceMakeFunctions ) -{ - auto a = makeAccidental( ); - auto b = makeAccidental( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test56, ConvenienceMakeFunctions ) -{ - auto a = makeStem( ); - auto b = makeStem( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test57, ConvenienceMakeFunctions ) -{ - auto a = makeNotehead( ); - auto b = makeNotehead( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test58, ConvenienceMakeFunctions ) -{ - auto a = makeBeam( ); - auto b = makeBeam( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test59, ConvenienceMakeFunctions ) -{ - auto a = makeTremolo( ); - auto b = makeTremolo( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test60, ConvenienceMakeFunctions ) -{ - auto a = makeOtherOrnament( ); - auto b = makeOtherOrnament( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test61, ConvenienceMakeFunctions ) -{ - auto a = makePluck( ); - auto b = makePluck( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test62, ConvenienceMakeFunctions ) -{ - auto a = makeHammerOn( ); - auto b = makeHammerOn( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test63, ConvenienceMakeFunctions ) -{ - auto a = makePullOff( ); - auto b = makePullOff( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test64, ConvenienceMakeFunctions ) -{ - auto a = makeTap( ); - auto b = makeTap( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test65, ConvenienceMakeFunctions ) -{ - auto a = makeHandbell( ); - auto b = makeHandbell( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test66, ConvenienceMakeFunctions ) -{ - auto a = makeOtherTechnical( ); - auto b = makeOtherTechnical( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test67, ConvenienceMakeFunctions ) -{ - auto a = makeTupletNumber( ); - auto b = makeTupletNumber( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test68, ConvenienceMakeFunctions ) -{ - auto a = makeTupletType( ); - auto b = makeTupletType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test69, ConvenienceMakeFunctions ) -{ - auto a = makeCreditWords( ); - auto b = makeCreditWords( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test70, ConvenienceMakeFunctions ) -{ - auto a = makeGroupName( ); - auto b = makeGroupName( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test71, ConvenienceMakeFunctions ) -{ - auto a = makeGroupAbbreviation( ); - auto b = makeGroupAbbreviation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test72, ConvenienceMakeFunctions ) -{ - auto a = makeGroupSymbol( ); - auto b = makeGroupSymbol( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test73, ConvenienceMakeFunctions ) -{ - auto a = makeGroupBarline( ); - auto b = makeGroupBarline( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test74, ConvenienceMakeFunctions ) -{ - auto a = makePartName( ); - auto b = makePartName( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test75, ConvenienceMakeFunctions ) -{ - auto a = makePartAbbreviation( ); - auto b = makePartAbbreviation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test76, ConvenienceMakeFunctions ) -{ - auto a = makeFootnote( ); - auto b = makeFootnote( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test77, ConvenienceMakeFunctions ) -{ - auto a = makeLevel( ); - auto b = makeLevel( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test78, ConvenienceMakeFunctions ) -{ - auto a = makeCancel( ); - auto b = makeCancel( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test79, ConvenienceMakeFunctions ) -{ - auto a = makeFunction( ); - auto b = makeFunction( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test80, ConvenienceMakeFunctions ) -{ - auto a = makeKind( ); - auto b = makeKind( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test81, ConvenienceMakeFunctions ) -{ - auto a = makeInversion( ); - auto b = makeInversion( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test82, ConvenienceMakeFunctions ) -{ - auto a = makeMidiChannel( ); - auto b = makeMidiChannel( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test83, ConvenienceMakeFunctions ) -{ - auto a = makeMidiName( ); - auto b = makeMidiName( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test84, ConvenienceMakeFunctions ) -{ - auto a = makeMidiBank( ); - auto b = makeMidiBank( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test85, ConvenienceMakeFunctions ) -{ - auto a = makeMidiProgram( ); - auto b = makeMidiProgram( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test86, ConvenienceMakeFunctions ) -{ - auto a = makeMidiUnpitched( ); - auto b = makeMidiUnpitched( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test87, ConvenienceMakeFunctions ) -{ - auto a = makeVolume( ); - auto b = makeVolume( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test88, ConvenienceMakeFunctions ) -{ - auto a = makePan( ); - auto b = makePan( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test89, ConvenienceMakeFunctions ) -{ - auto a = makeElevation( ); - auto b = makeElevation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test90, ConvenienceMakeFunctions ) -{ - auto a = makeIpa( ); - auto b = makeIpa( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test91, ConvenienceMakeFunctions ) -{ - auto a = makeMute( ); - auto b = makeMute( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test92, ConvenienceMakeFunctions ) -{ - auto a = makeSemiPitched( ); - auto b = makeSemiPitched( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test93, ConvenienceMakeFunctions ) -{ - auto a = makeDivisions( ); - auto b = makeDivisions( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test94, ConvenienceMakeFunctions ) -{ - auto a = makeStaves( ); - auto b = makeStaves( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test95, ConvenienceMakeFunctions ) -{ - auto a = makeInstruments( ); - auto b = makeInstruments( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test96, ConvenienceMakeFunctions ) -{ - auto a = makeSign( ); - auto b = makeSign( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test97, ConvenienceMakeFunctions ) -{ - auto a = makeLine( ); - auto b = makeLine( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test98, ConvenienceMakeFunctions ) -{ - auto a = makeClefOctaveChange( ); - auto b = makeClefOctaveChange( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test99, ConvenienceMakeFunctions ) -{ - auto a = makeTimeRelation( ); - auto b = makeTimeRelation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test100, ConvenienceMakeFunctions ) -{ - auto a = makeStaffType( ); - auto b = makeStaffType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test101, ConvenienceMakeFunctions ) -{ - auto a = makeStaffLines( ); - auto b = makeStaffLines( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test102, ConvenienceMakeFunctions ) -{ - auto a = makeCapo( ); - auto b = makeCapo( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test103, ConvenienceMakeFunctions ) -{ - auto a = makeStaffSize( ); - auto b = makeStaffSize( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test104, ConvenienceMakeFunctions ) -{ - auto a = makeSenzaMisura( ); - auto b = makeSenzaMisura( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test105, ConvenienceMakeFunctions ) -{ - auto a = makeDiatonic( ); - auto b = makeDiatonic( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test106, ConvenienceMakeFunctions ) -{ - auto a = makeChromatic( ); - auto b = makeChromatic( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test107, ConvenienceMakeFunctions ) -{ - auto a = makeOctaveChange( ); - auto b = makeOctaveChange( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test108, ConvenienceMakeFunctions ) -{ - auto a = makeAccordionMiddle( ); - auto b = makeAccordionMiddle( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test109, ConvenienceMakeFunctions ) -{ - auto a = makeFrameStrings( ); - auto b = makeFrameStrings( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test110, ConvenienceMakeFunctions ) -{ - auto a = makeFrameFrets( ); - auto b = makeFrameFrets( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test111, ConvenienceMakeFunctions ) -{ - auto a = makeMetronomeType( ); - auto b = makeMetronomeType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test112, ConvenienceMakeFunctions ) -{ - auto a = makePedalStep( ); - auto b = makePedalStep( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test113, ConvenienceMakeFunctions ) -{ - auto a = makePedalAlter( ); - auto b = makePedalAlter( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test114, ConvenienceMakeFunctions ) -{ - auto a = makeGlass( ); - auto b = makeGlass( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test115, ConvenienceMakeFunctions ) -{ - auto a = makeMetal( ); - auto b = makeMetal( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test116, ConvenienceMakeFunctions ) -{ - auto a = makeWood( ); - auto b = makeWood( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test117, ConvenienceMakeFunctions ) -{ - auto a = makePitched( ); - auto b = makePitched( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test118, ConvenienceMakeFunctions ) -{ - auto a = makeMembrane( ); - auto b = makeMembrane( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test119, ConvenienceMakeFunctions ) -{ - auto a = makeEffect( ); - auto b = makeEffect( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test120, ConvenienceMakeFunctions ) -{ - auto a = makeStickLocation( ); - auto b = makeStickLocation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test121, ConvenienceMakeFunctions ) -{ - auto a = makeOtherPercussion( ); - auto b = makeOtherPercussion( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test122, ConvenienceMakeFunctions ) -{ - auto a = makeStickType( ); - auto b = makeStickType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test123, ConvenienceMakeFunctions ) -{ - auto a = makeStickMaterial( ); - auto b = makeStickMaterial( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test124, ConvenienceMakeFunctions ) -{ - auto a = makeEncodingDate( ); - auto b = makeEncodingDate( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test125, ConvenienceMakeFunctions ) -{ - auto a = makeSoftware( ); - auto b = makeSoftware( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test126, ConvenienceMakeFunctions ) -{ - auto a = makeEncodingDescription( ); - auto b = makeEncodingDescription( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test127, ConvenienceMakeFunctions ) -{ - auto a = makeSource( ); - auto b = makeSource( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test128, ConvenienceMakeFunctions ) -{ - auto a = makeMeasureDistance( ); - auto b = makeMeasureDistance( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test129, ConvenienceMakeFunctions ) -{ - auto a = makePageHeight( ); - auto b = makePageHeight( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test130, ConvenienceMakeFunctions ) -{ - auto a = makePageWidth( ); - auto b = makePageWidth( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test131, ConvenienceMakeFunctions ) -{ - auto a = makeMillimeters( ); - auto b = makeMillimeters( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test132, ConvenienceMakeFunctions ) -{ - auto a = makeTenths( ); - auto b = makeTenths( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test133, ConvenienceMakeFunctions ) -{ - auto a = makeStaffDistance( ); - auto b = makeStaffDistance( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test134, ConvenienceMakeFunctions ) -{ - auto a = makeSystemDistance( ); - auto b = makeSystemDistance( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test135, ConvenienceMakeFunctions ) -{ - auto a = makeTopSystemDistance( ); - auto b = makeTopSystemDistance( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test136, ConvenienceMakeFunctions ) -{ - auto a = makeArrowDirection( ); - auto b = makeArrowDirection( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test137, ConvenienceMakeFunctions ) -{ - auto a = makeArrowStyle( ); - auto b = makeArrowStyle( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test138, ConvenienceMakeFunctions ) -{ - auto a = makeCircularArrow( ); - auto b = makeCircularArrow( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test139, ConvenienceMakeFunctions ) -{ - auto a = makeBendAlter( ); - auto b = makeBendAlter( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test140, ConvenienceMakeFunctions ) -{ - auto a = makeHoleType( ); - auto b = makeHoleType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test141, ConvenienceMakeFunctions ) -{ - auto a = makeHoleShape( ); - auto b = makeHoleShape( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test142, ConvenienceMakeFunctions ) -{ - auto a = makeSyllabic( ); - auto b = makeSyllabic( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test143, ConvenienceMakeFunctions ) -{ - auto a = makeStep( ); - auto b = makeStep( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test144, ConvenienceMakeFunctions ) -{ - auto a = makeAlter( ); - auto b = makeAlter( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test145, ConvenienceMakeFunctions ) -{ - auto a = makeOctave( ); - auto b = makeOctave( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test146, ConvenienceMakeFunctions ) -{ - auto a = makeActualNotes( ); - auto b = makeActualNotes( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test147, ConvenienceMakeFunctions ) -{ - auto a = makeNormalNotes( ); - auto b = makeNormalNotes( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test148, ConvenienceMakeFunctions ) -{ - auto a = makeNormalType( ); - auto b = makeNormalType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test149, ConvenienceMakeFunctions ) -{ - auto a = makeCreditType( ); - auto b = makeCreditType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test150, ConvenienceMakeFunctions ) -{ - auto a = makeInstrumentName( ); - auto b = makeInstrumentName( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test151, ConvenienceMakeFunctions ) -{ - auto a = makeInstrumentAbbreviation( ); - auto b = makeInstrumentAbbreviation( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test152, ConvenienceMakeFunctions ) -{ - auto a = makeInstrumentSound( ); - auto b = makeInstrumentSound( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test153, ConvenienceMakeFunctions ) -{ - auto a = makeEnsemble( ); - auto b = makeEnsemble( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test154, ConvenienceMakeFunctions ) -{ - auto a = makeGroup( ); - auto b = makeGroup( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test155, ConvenienceMakeFunctions ) -{ - auto a = makeVirtualLibrary( ); - auto b = makeVirtualLibrary( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test156, ConvenienceMakeFunctions ) -{ - auto a = makeVirtualName( ); - auto b = makeVirtualName( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test157, ConvenienceMakeFunctions ) -{ - auto a = makeWorkNumber( ); - auto b = makeWorkNumber( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test158, ConvenienceMakeFunctions ) -{ - auto a = makeWorkTitle( ); - auto b = makeWorkTitle( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test159, ConvenienceMakeFunctions ) -{ - auto a = makeStaff( ); - auto b = makeStaff( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test160, ConvenienceMakeFunctions ) -{ - auto a = makeTuningStep( ); - auto b = makeTuningStep( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test161, ConvenienceMakeFunctions ) -{ - auto a = makeTuningAlter( ); - auto b = makeTuningAlter( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test162, ConvenienceMakeFunctions ) -{ - auto a = makeTuningOctave( ); - auto b = makeTuningOctave( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test163, ConvenienceMakeFunctions ) -{ - auto a = makeVoice( ); - auto b = makeVoice( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test164, ConvenienceMakeFunctions ) -{ - auto a = makeKeyStep( ); - auto b = makeKeyStep( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test165, ConvenienceMakeFunctions ) -{ - auto a = makeKeyAlter( ); - auto b = makeKeyAlter( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test166, ConvenienceMakeFunctions ) -{ - auto a = makeKeyAccidental( ); - auto b = makeKeyAccidental( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test167, ConvenienceMakeFunctions ) -{ - auto a = makeSlashType( ); - auto b = makeSlashType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test168, ConvenienceMakeFunctions ) -{ - auto a = makeBeats( ); - auto b = makeBeats( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test169, ConvenienceMakeFunctions ) -{ - auto a = makeBeatType( ); - auto b = makeBeatType( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test170, ConvenienceMakeFunctions ) -{ - auto a = makeFifths( ); - auto b = makeFifths( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test171, ConvenienceMakeFunctions ) -{ - auto a = makeMode( ); - auto b = makeMode( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test172, ConvenienceMakeFunctions ) -{ - auto a = makeBeatUnit( ); - auto b = makeBeatUnit( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test173, ConvenienceMakeFunctions ) -{ - auto a = makeTopMargin( ); - auto b = makeTopMargin( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test174, ConvenienceMakeFunctions ) -{ - auto a = makeBottomMargin( ); - auto b = makeBottomMargin( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test175, ConvenienceMakeFunctions ) -{ - auto a = makeLeftMargin( ); - auto b = makeLeftMargin( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test176, ConvenienceMakeFunctions ) -{ - auto a = makeRightMargin( ); - auto b = makeRightMargin( ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test177, ConvenienceMakeFunctions ) -{ - auto val = PositiveDivisionsValue{ 3.214234 }; - auto a = makeDuration( val ); - auto b = makeDuration( val ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test178, ConvenienceMakeFunctions ) + auto a = makeAccidentalText(val); + auto b = makeAccidentalText(val); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test2, ConvenienceMakeFunctions) +{ + auto a = makeDisplayText(XsString{"something"}); + auto b = makeDisplayText(XsString{"something"}); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test3, ConvenienceMakeFunctions) +{ + auto a = makeOtherPlay(); + auto b = makeOtherPlay(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test4, ConvenienceMakeFunctions) +{ + auto a = makePartSymbol(GroupSymbolValue::square); + auto b = makePartSymbol(GroupSymbolValue::square); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test5, ConvenienceMakeFunctions) +{ + auto a = makeKeyOctave(); + auto b = makeKeyOctave(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test6, ConvenienceMakeFunctions) +{ + auto a = makeMultipleRest(); + auto b = makeMultipleRest(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test7, ConvenienceMakeFunctions) +{ + auto a = makeMeasureRepeat(); + auto b = makeMeasureRepeat(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test8, ConvenienceMakeFunctions) +{ + auto a = makeBarStyle(); + auto b = makeBarStyle(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test9, ConvenienceMakeFunctions) +{ + auto a = makeFermata(); + auto b = makeFermata(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test10, ConvenienceMakeFunctions) +{ + auto a = makeEnding(); + auto b = makeEnding(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test11, ConvenienceMakeFunctions) +{ + auto a = makeBassStep(); + auto b = makeBassStep(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test12, ConvenienceMakeFunctions) +{ + auto a = makeBassAlter(); + auto b = makeBassAlter(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test13, ConvenienceMakeFunctions) +{ + auto a = makeDegreeValue(); + auto b = makeDegreeValue(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test14, ConvenienceMakeFunctions) +{ + auto a = makeDegreeAlter(); + auto b = makeDegreeAlter(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test15, ConvenienceMakeFunctions) +{ + auto a = makeDegreeType(); + auto b = makeDegreeType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test16, ConvenienceMakeFunctions) +{ + auto a = makeOffset(); + auto b = makeOffset(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test17, ConvenienceMakeFunctions) +{ + auto a = makeRehearsal(); + auto b = makeRehearsal(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test18, ConvenienceMakeFunctions) +{ + auto a = makeWords(); + auto b = makeWords(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test19, ConvenienceMakeFunctions) +{ + auto a = makePrincipalVoice(); + auto b = makePrincipalVoice(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test20, ConvenienceMakeFunctions) +{ + auto a = makeOtherDirection(); + auto b = makeOtherDirection(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test21, ConvenienceMakeFunctions) +{ + auto a = makeFirstFret(); + auto b = makeFirstFret(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test22, ConvenienceMakeFunctions) +{ + auto a = makeFret(); + auto b = makeFret(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test23, ConvenienceMakeFunctions) +{ + auto a = makeFingering(); + auto b = makeFingering(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test24, ConvenienceMakeFunctions) +{ + auto a = makeFeature(); + auto b = makeFeature(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test25, ConvenienceMakeFunctions) +{ + auto a = makePerMinute(); + auto b = makePerMinute(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test26, ConvenienceMakeFunctions) +{ + auto a = makeMetronomeBeam(); + auto b = makeMetronomeBeam(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test27, ConvenienceMakeFunctions) +{ + auto a = makeBeater(); + auto b = makeBeater(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test28, ConvenienceMakeFunctions) +{ + auto a = makeMeasureNumbering(); + auto b = makeMeasureNumbering(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test29, ConvenienceMakeFunctions) +{ + auto a = makeRootStep(); + auto b = makeRootStep(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test30, ConvenienceMakeFunctions) +{ + auto a = makeRootAlter(); + auto b = makeRootAlter(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test31, ConvenienceMakeFunctions) +{ + auto a = makeMidiDevice(); + auto b = makeMidiDevice(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test32, ConvenienceMakeFunctions) +{ + auto a = makeEncoder(); + auto b = makeEncoder(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test33, ConvenienceMakeFunctions) +{ + auto a = makeCreator(); + auto b = makeCreator(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test34, ConvenienceMakeFunctions) +{ + auto a = makeRights(); + auto b = makeRights(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test35, ConvenienceMakeFunctions) +{ + auto a = makeRelation(); + auto b = makeRelation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test36, ConvenienceMakeFunctions) +{ + auto a = makeMiscellaneousField(); + auto b = makeMiscellaneousField(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test37, ConvenienceMakeFunctions) +{ + auto a = makeLineWidth(); + auto b = makeLineWidth(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test38, ConvenienceMakeFunctions) +{ + auto a = makeNoteSize(); + auto b = makeNoteSize(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test39, ConvenienceMakeFunctions) +{ + auto a = makeDistance(); + auto b = makeDistance(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test40, ConvenienceMakeFunctions) +{ + auto a = makeOtherAppearance(); + auto b = makeOtherAppearance(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test41, ConvenienceMakeFunctions) +{ + auto a = makeBreathMark(); + auto b = makeBreathMark(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test42, ConvenienceMakeFunctions) +{ + auto a = makeOtherArticulation(); + auto b = makeOtherArticulation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test43, ConvenienceMakeFunctions) +{ + auto a = makeWithBar(); + auto b = makeWithBar(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test44, ConvenienceMakeFunctions) +{ + auto a = makePrefix(); + auto b = makePrefix(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test45, ConvenienceMakeFunctions) +{ + auto a = makeFigureNumber(); + auto b = makeFigureNumber(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test46, ConvenienceMakeFunctions) +{ + auto a = makeSuffix(); + auto b = makeSuffix(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test47, ConvenienceMakeFunctions) +{ + auto a = makeHoleClosed(); + auto b = makeHoleClosed(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test48, ConvenienceMakeFunctions) +{ + auto a = makeText(); + auto b = makeText(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test49, ConvenienceMakeFunctions) +{ + auto a = makeElision(); + auto b = makeElision(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test50, ConvenienceMakeFunctions) +{ + auto a = makeGlissando(); + auto b = makeGlissando(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test51, ConvenienceMakeFunctions) +{ + auto a = makeSlide(); + auto b = makeSlide(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test52, ConvenienceMakeFunctions) +{ + auto a = makeAccidentalMark(); + auto b = makeAccidentalMark(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test53, ConvenienceMakeFunctions) +{ + auto a = makeOtherNotation(); + auto b = makeOtherNotation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test54, ConvenienceMakeFunctions) +{ + auto a = makeType(); + auto b = makeType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test55, ConvenienceMakeFunctions) +{ + auto a = makeAccidental(); + auto b = makeAccidental(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test56, ConvenienceMakeFunctions) +{ + auto a = makeStem(); + auto b = makeStem(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test57, ConvenienceMakeFunctions) +{ + auto a = makeNotehead(); + auto b = makeNotehead(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test58, ConvenienceMakeFunctions) +{ + auto a = makeBeam(); + auto b = makeBeam(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test59, ConvenienceMakeFunctions) +{ + auto a = makeTremolo(); + auto b = makeTremolo(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test60, ConvenienceMakeFunctions) +{ + auto a = makeOtherOrnament(); + auto b = makeOtherOrnament(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test61, ConvenienceMakeFunctions) +{ + auto a = makePluck(); + auto b = makePluck(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test62, ConvenienceMakeFunctions) +{ + auto a = makeHammerOn(); + auto b = makeHammerOn(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test63, ConvenienceMakeFunctions) +{ + auto a = makePullOff(); + auto b = makePullOff(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test64, ConvenienceMakeFunctions) +{ + auto a = makeTap(); + auto b = makeTap(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test65, ConvenienceMakeFunctions) +{ + auto a = makeHandbell(); + auto b = makeHandbell(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test66, ConvenienceMakeFunctions) +{ + auto a = makeOtherTechnical(); + auto b = makeOtherTechnical(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test67, ConvenienceMakeFunctions) +{ + auto a = makeTupletNumber(); + auto b = makeTupletNumber(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test68, ConvenienceMakeFunctions) +{ + auto a = makeTupletType(); + auto b = makeTupletType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test69, ConvenienceMakeFunctions) +{ + auto a = makeCreditWords(); + auto b = makeCreditWords(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test70, ConvenienceMakeFunctions) +{ + auto a = makeGroupName(); + auto b = makeGroupName(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test71, ConvenienceMakeFunctions) +{ + auto a = makeGroupAbbreviation(); + auto b = makeGroupAbbreviation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test72, ConvenienceMakeFunctions) +{ + auto a = makeGroupSymbol(); + auto b = makeGroupSymbol(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test73, ConvenienceMakeFunctions) +{ + auto a = makeGroupBarline(); + auto b = makeGroupBarline(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test74, ConvenienceMakeFunctions) +{ + auto a = makePartName(); + auto b = makePartName(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test75, ConvenienceMakeFunctions) +{ + auto a = makePartAbbreviation(); + auto b = makePartAbbreviation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test76, ConvenienceMakeFunctions) +{ + auto a = makeFootnote(); + auto b = makeFootnote(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test77, ConvenienceMakeFunctions) +{ + auto a = makeLevel(); + auto b = makeLevel(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test78, ConvenienceMakeFunctions) +{ + auto a = makeCancel(); + auto b = makeCancel(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test79, ConvenienceMakeFunctions) +{ + auto a = makeFunction(); + auto b = makeFunction(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test80, ConvenienceMakeFunctions) +{ + auto a = makeKind(); + auto b = makeKind(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test81, ConvenienceMakeFunctions) +{ + auto a = makeInversion(); + auto b = makeInversion(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test82, ConvenienceMakeFunctions) +{ + auto a = makeMidiChannel(); + auto b = makeMidiChannel(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test83, ConvenienceMakeFunctions) +{ + auto a = makeMidiName(); + auto b = makeMidiName(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test84, ConvenienceMakeFunctions) +{ + auto a = makeMidiBank(); + auto b = makeMidiBank(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test85, ConvenienceMakeFunctions) +{ + auto a = makeMidiProgram(); + auto b = makeMidiProgram(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test86, ConvenienceMakeFunctions) +{ + auto a = makeMidiUnpitched(); + auto b = makeMidiUnpitched(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test87, ConvenienceMakeFunctions) +{ + auto a = makeVolume(); + auto b = makeVolume(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test88, ConvenienceMakeFunctions) +{ + auto a = makePan(); + auto b = makePan(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test89, ConvenienceMakeFunctions) +{ + auto a = makeElevation(); + auto b = makeElevation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test90, ConvenienceMakeFunctions) +{ + auto a = makeIpa(); + auto b = makeIpa(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test91, ConvenienceMakeFunctions) +{ + auto a = makeMute(); + auto b = makeMute(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test92, ConvenienceMakeFunctions) +{ + auto a = makeSemiPitched(); + auto b = makeSemiPitched(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test93, ConvenienceMakeFunctions) +{ + auto a = makeDivisions(); + auto b = makeDivisions(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test94, ConvenienceMakeFunctions) +{ + auto a = makeStaves(); + auto b = makeStaves(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test95, ConvenienceMakeFunctions) +{ + auto a = makeInstruments(); + auto b = makeInstruments(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test96, ConvenienceMakeFunctions) +{ + auto a = makeSign(); + auto b = makeSign(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test97, ConvenienceMakeFunctions) +{ + auto a = makeLine(); + auto b = makeLine(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test98, ConvenienceMakeFunctions) +{ + auto a = makeClefOctaveChange(); + auto b = makeClefOctaveChange(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test99, ConvenienceMakeFunctions) +{ + auto a = makeTimeRelation(); + auto b = makeTimeRelation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test100, ConvenienceMakeFunctions) +{ + auto a = makeStaffType(); + auto b = makeStaffType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test101, ConvenienceMakeFunctions) +{ + auto a = makeStaffLines(); + auto b = makeStaffLines(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test102, ConvenienceMakeFunctions) +{ + auto a = makeCapo(); + auto b = makeCapo(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test103, ConvenienceMakeFunctions) +{ + auto a = makeStaffSize(); + auto b = makeStaffSize(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test104, ConvenienceMakeFunctions) +{ + auto a = makeSenzaMisura(); + auto b = makeSenzaMisura(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test105, ConvenienceMakeFunctions) +{ + auto a = makeDiatonic(); + auto b = makeDiatonic(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test106, ConvenienceMakeFunctions) +{ + auto a = makeChromatic(); + auto b = makeChromatic(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test107, ConvenienceMakeFunctions) +{ + auto a = makeOctaveChange(); + auto b = makeOctaveChange(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test108, ConvenienceMakeFunctions) +{ + auto a = makeAccordionMiddle(); + auto b = makeAccordionMiddle(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test109, ConvenienceMakeFunctions) +{ + auto a = makeFrameStrings(); + auto b = makeFrameStrings(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test110, ConvenienceMakeFunctions) +{ + auto a = makeFrameFrets(); + auto b = makeFrameFrets(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test111, ConvenienceMakeFunctions) +{ + auto a = makeMetronomeType(); + auto b = makeMetronomeType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test112, ConvenienceMakeFunctions) +{ + auto a = makePedalStep(); + auto b = makePedalStep(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test113, ConvenienceMakeFunctions) +{ + auto a = makePedalAlter(); + auto b = makePedalAlter(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test114, ConvenienceMakeFunctions) +{ + auto a = makeGlass(); + auto b = makeGlass(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test115, ConvenienceMakeFunctions) +{ + auto a = makeMetal(); + auto b = makeMetal(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test116, ConvenienceMakeFunctions) +{ + auto a = makeWood(); + auto b = makeWood(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test117, ConvenienceMakeFunctions) +{ + auto a = makePitched(); + auto b = makePitched(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test118, ConvenienceMakeFunctions) +{ + auto a = makeMembrane(); + auto b = makeMembrane(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test119, ConvenienceMakeFunctions) +{ + auto a = makeEffect(); + auto b = makeEffect(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test120, ConvenienceMakeFunctions) +{ + auto a = makeStickLocation(); + auto b = makeStickLocation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test121, ConvenienceMakeFunctions) +{ + auto a = makeOtherPercussion(); + auto b = makeOtherPercussion(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test122, ConvenienceMakeFunctions) +{ + auto a = makeStickType(); + auto b = makeStickType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test123, ConvenienceMakeFunctions) +{ + auto a = makeStickMaterial(); + auto b = makeStickMaterial(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test124, ConvenienceMakeFunctions) +{ + auto a = makeEncodingDate(); + auto b = makeEncodingDate(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test125, ConvenienceMakeFunctions) +{ + auto a = makeSoftware(); + auto b = makeSoftware(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test126, ConvenienceMakeFunctions) +{ + auto a = makeEncodingDescription(); + auto b = makeEncodingDescription(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test127, ConvenienceMakeFunctions) +{ + auto a = makeSource(); + auto b = makeSource(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test128, ConvenienceMakeFunctions) +{ + auto a = makeMeasureDistance(); + auto b = makeMeasureDistance(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test129, ConvenienceMakeFunctions) +{ + auto a = makePageHeight(); + auto b = makePageHeight(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test130, ConvenienceMakeFunctions) +{ + auto a = makePageWidth(); + auto b = makePageWidth(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test131, ConvenienceMakeFunctions) +{ + auto a = makeMillimeters(); + auto b = makeMillimeters(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test132, ConvenienceMakeFunctions) +{ + auto a = makeTenths(); + auto b = makeTenths(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test133, ConvenienceMakeFunctions) +{ + auto a = makeStaffDistance(); + auto b = makeStaffDistance(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test134, ConvenienceMakeFunctions) +{ + auto a = makeSystemDistance(); + auto b = makeSystemDistance(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test135, ConvenienceMakeFunctions) +{ + auto a = makeTopSystemDistance(); + auto b = makeTopSystemDistance(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test136, ConvenienceMakeFunctions) +{ + auto a = makeArrowDirection(); + auto b = makeArrowDirection(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test137, ConvenienceMakeFunctions) +{ + auto a = makeArrowStyle(); + auto b = makeArrowStyle(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test138, ConvenienceMakeFunctions) +{ + auto a = makeCircularArrow(); + auto b = makeCircularArrow(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test139, ConvenienceMakeFunctions) +{ + auto a = makeBendAlter(); + auto b = makeBendAlter(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test140, ConvenienceMakeFunctions) +{ + auto a = makeHoleType(); + auto b = makeHoleType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test141, ConvenienceMakeFunctions) +{ + auto a = makeHoleShape(); + auto b = makeHoleShape(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test142, ConvenienceMakeFunctions) +{ + auto a = makeSyllabic(); + auto b = makeSyllabic(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test143, ConvenienceMakeFunctions) +{ + auto a = makeStep(); + auto b = makeStep(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test144, ConvenienceMakeFunctions) +{ + auto a = makeAlter(); + auto b = makeAlter(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test145, ConvenienceMakeFunctions) +{ + auto a = makeOctave(); + auto b = makeOctave(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test146, ConvenienceMakeFunctions) +{ + auto a = makeActualNotes(); + auto b = makeActualNotes(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test147, ConvenienceMakeFunctions) +{ + auto a = makeNormalNotes(); + auto b = makeNormalNotes(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test148, ConvenienceMakeFunctions) +{ + auto a = makeNormalType(); + auto b = makeNormalType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test149, ConvenienceMakeFunctions) +{ + auto a = makeCreditType(); + auto b = makeCreditType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test150, ConvenienceMakeFunctions) +{ + auto a = makeInstrumentName(); + auto b = makeInstrumentName(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test151, ConvenienceMakeFunctions) +{ + auto a = makeInstrumentAbbreviation(); + auto b = makeInstrumentAbbreviation(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test152, ConvenienceMakeFunctions) +{ + auto a = makeInstrumentSound(); + auto b = makeInstrumentSound(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test153, ConvenienceMakeFunctions) +{ + auto a = makeEnsemble(); + auto b = makeEnsemble(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test154, ConvenienceMakeFunctions) +{ + auto a = makeGroup(); + auto b = makeGroup(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test155, ConvenienceMakeFunctions) +{ + auto a = makeVirtualLibrary(); + auto b = makeVirtualLibrary(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test156, ConvenienceMakeFunctions) +{ + auto a = makeVirtualName(); + auto b = makeVirtualName(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test157, ConvenienceMakeFunctions) +{ + auto a = makeWorkNumber(); + auto b = makeWorkNumber(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test158, ConvenienceMakeFunctions) +{ + auto a = makeWorkTitle(); + auto b = makeWorkTitle(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test159, ConvenienceMakeFunctions) +{ + auto a = makeStaff(); + auto b = makeStaff(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test160, ConvenienceMakeFunctions) +{ + auto a = makeTuningStep(); + auto b = makeTuningStep(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test161, ConvenienceMakeFunctions) +{ + auto a = makeTuningAlter(); + auto b = makeTuningAlter(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test162, ConvenienceMakeFunctions) +{ + auto a = makeTuningOctave(); + auto b = makeTuningOctave(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test163, ConvenienceMakeFunctions) +{ + auto a = makeVoice(); + auto b = makeVoice(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test164, ConvenienceMakeFunctions) +{ + auto a = makeKeyStep(); + auto b = makeKeyStep(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test165, ConvenienceMakeFunctions) +{ + auto a = makeKeyAlter(); + auto b = makeKeyAlter(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test166, ConvenienceMakeFunctions) +{ + auto a = makeKeyAccidental(); + auto b = makeKeyAccidental(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test167, ConvenienceMakeFunctions) +{ + auto a = makeSlashType(); + auto b = makeSlashType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test168, ConvenienceMakeFunctions) +{ + auto a = makeBeats(); + auto b = makeBeats(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test169, ConvenienceMakeFunctions) +{ + auto a = makeBeatType(); + auto b = makeBeatType(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test170, ConvenienceMakeFunctions) +{ + auto a = makeFifths(); + auto b = makeFifths(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test171, ConvenienceMakeFunctions) +{ + auto a = makeMode(); + auto b = makeMode(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test172, ConvenienceMakeFunctions) +{ + auto a = makeBeatUnit(); + auto b = makeBeatUnit(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test173, ConvenienceMakeFunctions) +{ + auto a = makeTopMargin(); + auto b = makeTopMargin(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test174, ConvenienceMakeFunctions) +{ + auto a = makeBottomMargin(); + auto b = makeBottomMargin(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test175, ConvenienceMakeFunctions) +{ + auto a = makeLeftMargin(); + auto b = makeLeftMargin(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test176, ConvenienceMakeFunctions) +{ + auto a = makeRightMargin(); + auto b = makeRightMargin(); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test177, ConvenienceMakeFunctions) +{ + auto val = PositiveDivisionsValue{3.214234}; + auto a = makeDuration(val); + auto b = makeDuration(val); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test178, ConvenienceMakeFunctions) { auto val = StepEnum::e; - auto a = makeDisplayStep( val ); - auto b = makeDisplayStep( val ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test179, ConvenienceMakeFunctions ) -{ - auto a = makeDisplayOctave( OctaveValue{ 2 } ); - auto b = makeDisplayOctave( OctaveValue{ 2 } ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test180, ConvenienceMakeFunctions ) -{ - auto a = makeMovementNumber( XsString{ "1" } ); - auto b = makeMovementNumber( XsString{ "1" } ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) -} -TEST( Test181, ConvenienceMakeFunctions ) -{ - auto a = makeMovementTitle( XsString{ "Bones" } ); - auto b = makeMovementTitle( XsString{ "Bones" } ); - stringstream aa; - stringstream bb; - aa << *a; - bb << *b; - string expected = aa.str(); - string actual = bb.str(); - CHECK( a ) - CHECK( b ) - CHECK_EQUAL( expected, actual ) + auto a = makeDisplayStep(val); + auto b = makeDisplayStep(val); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test179, ConvenienceMakeFunctions) +{ + auto a = makeDisplayOctave(OctaveValue{2}); + auto b = makeDisplayOctave(OctaveValue{2}); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test180, ConvenienceMakeFunctions) +{ + auto a = makeMovementNumber(XsString{"1"}); + auto b = makeMovementNumber(XsString{"1"}); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) +} + +TEST(Test181, ConvenienceMakeFunctions) +{ + auto a = makeMovementTitle(XsString{"Bones"}); + auto b = makeMovementTitle(XsString{"Bones"}); + stringstream aa; + stringstream bb; + aa << *a; + bb << *b; + string expected = aa.str(); + string actual = bb.str(); + CHECK(a) + CHECK(b) + CHECK_EQUAL(expected, actual) } #endif diff --git a/Sourcecode/private/mxtest/core/MeasureDistanceTest.cpp b/Sourcecode/private/mxtest/core/MeasureDistanceTest.cpp index 6f9ac05b9..1ccae448e 100644 --- a/Sourcecode/private/mxtest/core/MeasureDistanceTest.cpp +++ b/Sourcecode/private/mxtest/core/MeasureDistanceTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MeasureDistance ) +TEST(Test01, MeasureDistance) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - MeasureDistance object1; - MeasureDistance object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + MeasureDistance object1; + MeasureDistance object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MeasureLayoutTest.cpp b/Sourcecode/private/mxtest/core/MeasureLayoutTest.cpp index ca4c8d723..8e96ee46f 100644 --- a/Sourcecode/private/mxtest/core/MeasureLayoutTest.cpp +++ b/Sourcecode/private/mxtest/core/MeasureLayoutTest.cpp @@ -6,112 +6,108 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MeasureLayoutTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, MeasureLayout ) +TEST(Test01, MeasureLayout) { TestMode v = TestMode::one; - MeasureLayoutPtr object = tgenMeasureLayout( v ); - stringstream expected; - tgenMeasureLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MeasureLayoutPtr object = tgenMeasureLayout(v); + stringstream expected; + tgenMeasureLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, MeasureLayout ) + +TEST(Test02, MeasureLayout) { TestMode v = TestMode::two; - MeasureLayoutPtr object = tgenMeasureLayout( v ); - stringstream expected; - tgenMeasureLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MeasureLayoutPtr object = tgenMeasureLayout(v); + stringstream expected; + tgenMeasureLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, MeasureLayout ) + +TEST(Test03, MeasureLayout) { TestMode v = TestMode::three; - MeasureLayoutPtr object = tgenMeasureLayout( v ); - stringstream expected; - tgenMeasureLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MeasureLayoutPtr object = tgenMeasureLayout(v); + stringstream expected; + tgenMeasureLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - MeasureLayoutPtr tgenMeasureLayout( TestMode v ) +MeasureLayoutPtr tgenMeasureLayout(TestMode v) +{ + MeasureLayoutPtr o = makeMeasureLayout(); + switch (v) { - MeasureLayoutPtr o = makeMeasureLayout(); - switch ( v ) - { - case TestMode::one: - { - ; - } - break; - case TestMode::two: - { - o->setHasMeasureDistance( true ); - o->setMeasureDistance( makeMeasureDistance( TenthsValue( 13.43 ) ) ); - } - break; - case TestMode::three: - { - o->setHasMeasureDistance( true ); - o->setMeasureDistance( makeMeasureDistance( TenthsValue( -1 ) ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + ; + } + break; + case TestMode::two: { + o->setHasMeasureDistance(true); + o->setMeasureDistance(makeMeasureDistance(TenthsValue(13.43))); + } + break; + case TestMode::three: { + o->setHasMeasureDistance(true); + o->setMeasureDistance(makeMeasureDistance(TenthsValue(-1))); + } + break; + default: + break; } - void tgenMeasureLayoutExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenMeasureLayoutExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(13.43)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(-1)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(13.43)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(-1)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/MeasureLayoutTest.h b/Sourcecode/private/mxtest/core/MeasureLayoutTest.h index a5a4e8dd3..dff49ccaa 100644 --- a/Sourcecode/private/mxtest/core/MeasureLayoutTest.h +++ b/Sourcecode/private/mxtest/core/MeasureLayoutTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::MeasureLayoutPtr tgenMeasureLayout( TestMode v ); - void tgenMeasureLayoutExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::MeasureLayoutPtr tgenMeasureLayout(TestMode v); +void tgenMeasureLayoutExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MeasureNumberingTest.cpp b/Sourcecode/private/mxtest/core/MeasureNumberingTest.cpp index 8442d23e7..e7988788b 100644 --- a/Sourcecode/private/mxtest/core/MeasureNumberingTest.cpp +++ b/Sourcecode/private/mxtest/core/MeasureNumberingTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, MeasureNumbering ) +TEST(Test01, MeasureNumbering) { - std::string indentString( INDENT ); - MeasureNumberingValue value1 = MeasureNumberingValue::measure; - MeasureNumberingValue value2 = MeasureNumberingValue::system; - MeasureNumbering object1; - MeasureNumbering object2( value2 ); - MeasureNumberingAttributesPtr attributes1 = std::make_shared(); - MeasureNumberingAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + MeasureNumberingValue value1 = MeasureNumberingValue::measure; + MeasureNumberingValue value2 = MeasureNumberingValue::system; + MeasureNumbering object1; + MeasureNumbering object2(value2); + MeasureNumberingAttributesPtr attributes1 = std::make_shared(); + MeasureNumberingAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasHalign = true; attributes1->halign = LeftCenterRight::right; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(none)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(system)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(none)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(system)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MeasureRepeatTest.cpp b/Sourcecode/private/mxtest/core/MeasureRepeatTest.cpp index 021e15cd0..813ec2858 100644 --- a/Sourcecode/private/mxtest/core/MeasureRepeatTest.cpp +++ b/Sourcecode/private/mxtest/core/MeasureRepeatTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, MeasureRepeat ) +TEST(Test01, MeasureRepeat) { - std::string indentString( INDENT ); - PositiveIntegerOrEmpty value1{ "" }; - PositiveIntegerOrEmpty value2{ PositiveInteger{ 2 } }; - MeasureRepeat object1; - MeasureRepeat object2( value2 ); - MeasureRepeatAttributesPtr attributes1 = std::make_shared(); - MeasureRepeatAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + PositiveIntegerOrEmpty value1{""}; + PositiveIntegerOrEmpty value2{PositiveInteger{2}}; + MeasureRepeat object1; + MeasureRepeat object2(value2); + MeasureRepeatAttributesPtr attributes1 = std::make_shared(); + MeasureRepeatAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasSlashes = true; - attributes1->slashes = PositiveInteger{ 2 }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->slashes = PositiveInteger{2}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MeasureStyleTest.cpp b/Sourcecode/private/mxtest/core/MeasureStyleTest.cpp index 3d431b0c0..2720e0ba8 100644 --- a/Sourcecode/private/mxtest/core/MeasureStyleTest.cpp +++ b/Sourcecode/private/mxtest/core/MeasureStyleTest.cpp @@ -6,79 +6,82 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, MeasureStyle ) +TEST(Test01, MeasureStyle) { - MeasureStyle object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + MeasureStyle object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, MeasureStyle ) + +TEST(Test02, MeasureStyle) { - MeasureStyle object; - object.getMeasureStyleChoice()->setChoice( MeasureStyleChoice::Choice::beatRepeat ); - object.getMeasureStyleChoice()->getBeatRepeat()->addSlashDot( makeSlashDot() ); + MeasureStyle object; + object.getMeasureStyleChoice()->setChoice(MeasureStyleChoice::Choice::beatRepeat); + object.getMeasureStyleChoice()->getBeatRepeat()->addSlashDot(makeSlashDot()); object.getAttributes()->hasColor = true; - object.getAttributes()->color = Color{ 76, 58, 201, 43 }; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(eighth)" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.getAttributes()->color = Color{76, 58, 201, 43}; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(eighth)"); + streamLine(expected, 3, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test03, MeasureStyle ) + +TEST(Test03, MeasureStyle) { - MeasureStyle object; - object.getMeasureStyleChoice()->setChoice( MeasureStyleChoice::Choice::slash ); + MeasureStyle object; + object.getMeasureStyleChoice()->setChoice(MeasureStyleChoice::Choice::slash); stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(eighth)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(eighth)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test04, MeasureStyle ) + +TEST(Test04, MeasureStyle) { - MeasureStyle object; - object.getMeasureStyleChoice()->setChoice( MeasureStyleChoice::Choice::measureRepeat ); + MeasureStyle object; + object.getMeasureStyleChoice()->setChoice(MeasureStyleChoice::Choice::measureRepeat); stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/MembraneTest.cpp b/Sourcecode/private/mxtest/core/MembraneTest.cpp index ec73c66c5..8d815f17f 100644 --- a/Sourcecode/private/mxtest/core/MembraneTest.cpp +++ b/Sourcecode/private/mxtest/core/MembraneTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Membrane ) +TEST(Test01, Membrane) { - std::string indentString( INDENT ); - MembraneEnum value1 = MembraneEnum::congaDrum; - MembraneEnum value2 = MembraneEnum::tomtom; - Membrane object1; - Membrane object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(snare drum)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(tomtom)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + MembraneEnum value1 = MembraneEnum::congaDrum; + MembraneEnum value2 = MembraneEnum::tomtom; + Membrane object1; + Membrane object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(snare drum)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(tomtom)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MetalTest.cpp b/Sourcecode/private/mxtest/core/MetalTest.cpp index 2b8e354ee..d6a177649 100644 --- a/Sourcecode/private/mxtest/core/MetalTest.cpp +++ b/Sourcecode/private/mxtest/core/MetalTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Metal ) +TEST(Test01, Metal) { - std::string indentString( INDENT ); - MetalEnum value1 = MetalEnum::bellPlate; - MetalEnum value2 = MetalEnum::chineseCymbal; - Metal object1; - Metal object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(bell)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Chinese cymbal)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + MetalEnum value1 = MetalEnum::bellPlate; + MetalEnum value2 = MetalEnum::chineseCymbal; + Metal object1; + Metal object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(bell)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Chinese cymbal)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MetronomeBeamTest.cpp b/Sourcecode/private/mxtest/core/MetronomeBeamTest.cpp index 5c520b52a..2a41274e0 100644 --- a/Sourcecode/private/mxtest/core/MetronomeBeamTest.cpp +++ b/Sourcecode/private/mxtest/core/MetronomeBeamTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, MetronomeBeam ) +TEST(Test01, MetronomeBeam) { - std::string indentString( INDENT ); - BeamValue value1 = BeamValue::backwardHook; - BeamValue value2 = BeamValue::continue_; - MetronomeBeam object1; - MetronomeBeam object2( value2 ); - MetronomeBeamAttributesPtr attributes1 = std::make_shared(); - MetronomeBeamAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + BeamValue value1 = BeamValue::backwardHook; + BeamValue value2 = BeamValue::continue_; + MetronomeBeam object1; + MetronomeBeam object2(value2); + MetronomeBeamAttributesPtr attributes1 = std::make_shared(); + MetronomeBeamAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasNumber = true; - attributes1->number = BeamLevel{ 4 }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(begin)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(continue)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->number = BeamLevel{4}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(begin)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(continue)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MetronomeDotTest.cpp b/Sourcecode/private/mxtest/core/MetronomeDotTest.cpp index c14b38b19..22c2e8731 100644 --- a/Sourcecode/private/mxtest/core/MetronomeDotTest.cpp +++ b/Sourcecode/private/mxtest/core/MetronomeDotTest.cpp @@ -11,28 +11,27 @@ using namespace mx::core; - -TEST( Test01, MetronomeDot ) +TEST(Test01, MetronomeDot) { - std::string indentString( INDENT ); - MetronomeDot object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + MetronomeDot object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/MetronomeNoteTest.cpp b/Sourcecode/private/mxtest/core/MetronomeNoteTest.cpp index e64394808..7d1678759 100644 --- a/Sourcecode/private/mxtest/core/MetronomeNoteTest.cpp +++ b/Sourcecode/private/mxtest/core/MetronomeNoteTest.cpp @@ -6,62 +6,63 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, MetronomeNote ) +TEST(Test01, MetronomeNote) { - MetronomeNote object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(eighth)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + MetronomeNote object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(eighth)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, MetronomeNote ) + +TEST(Test02, MetronomeNote) { auto tm = makeTimeModificationNormalTypeNormalDot(); - tm->getNormalType()->setValue( NoteTypeValue::quarter ); - tm->addNormalDot( makeNormalDot() ); + tm->getNormalType()->setValue(NoteTypeValue::quarter); + tm->addNormalDot(makeNormalDot()); auto mt = makeMetronomeTuplet(); - mt->setHasTimeModificationNormalTypeNormalDot( true ); - mt->setTimeModificationNormalTypeNormalDot( tm ); - mt->getNormalNotes()->setValue( NonNegativeInteger( 3 ) ); - mt->getActualNotes()->setValue( NonNegativeInteger( 4 ) ); - MetronomeNote object; - object.setHasMetronomeTuplet( true ); - object.setMetronomeTuplet( mt ); + mt->setHasTimeModificationNormalTypeNormalDot(true); + mt->setTimeModificationNormalTypeNormalDot(tm); + mt->getNormalNotes()->setValue(NonNegativeInteger(3)); + mt->getActualNotes()->setValue(NonNegativeInteger(4)); + MetronomeNote object; + object.setHasMetronomeTuplet(true); + object.setMetronomeTuplet(mt); mt.reset(); - object.getMetronomeType()->setValue( NoteTypeValue::oneHundredTwentyEighth ); - object.addMetronomeBeam( makeMetronomeBeam() ); - object.addMetronomeBeam( makeMetronomeBeam() ); + object.getMetronomeType()->setValue(NoteTypeValue::oneHundredTwentyEighth); + object.addMetronomeBeam(makeMetronomeBeam()); + object.addMetronomeBeam(makeMetronomeBeam()); stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(128th)" ); - streamLine( expected, 2, R"(begin)" ); - streamLine( expected, 2, R"(begin)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(4)" ); - streamLine( expected, 3, R"(3)" ); - streamLine( expected, 3, R"(quarter)" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(128th)"); + streamLine(expected, 2, R"(begin)"); + streamLine(expected, 2, R"(begin)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(4)"); + streamLine(expected, 3, R"(3)"); + streamLine(expected, 3, R"(quarter)"); + streamLine(expected, 3, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/MetronomeRelationTest.cpp b/Sourcecode/private/mxtest/core/MetronomeRelationTest.cpp index d2f4b7c1d..244579ad0 100644 --- a/Sourcecode/private/mxtest/core/MetronomeRelationTest.cpp +++ b/Sourcecode/private/mxtest/core/MetronomeRelationTest.cpp @@ -11,39 +11,39 @@ using namespace mx::core; -TEST( Test01, MetronomeRelation ) +TEST(Test01, MetronomeRelation) { - std::string indentString( INDENT ); - - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - - MetronomeRelation object1; - MetronomeRelation object2( value2 ); - - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - - std::string expected = R"(equals)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - - value1 = object2.getValue(); - object1.setValue( value1 ); - - std::stringstream o1; - std::stringstream o2; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + + MetronomeRelation object1; + MetronomeRelation object2(value2); + + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + + std::string expected = R"(equals)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + + value1 = object2.getValue(); + object1.setValue(value1); + + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MetronomeTest.cpp b/Sourcecode/private/mxtest/core/MetronomeTest.cpp index 24818aee6..71ce36032 100644 --- a/Sourcecode/private/mxtest/core/MetronomeTest.cpp +++ b/Sourcecode/private/mxtest/core/MetronomeTest.cpp @@ -6,414 +6,400 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MetronomeTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Metronome ) +TEST(Test01, Metronome) { - Metronome object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(eighth)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + Metronome object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(eighth)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Metronome ) + +TEST(Test02, Metronome) { - MetronomePtr object = tgenMetronome( TestMode::one ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(16th)" ); - streamLine( expected, 2, R"(104)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + MetronomePtr object = tgenMetronome(TestMode::one); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(16th)"); + streamLine(expected, 2, R"(104)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Metronome ) + +TEST(Test03, Metronome) { - MetronomePtr object = tgenMetronome( TestMode::two ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(64th)" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 3, R"(begin)" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 4, R"(33)" ); - streamLine( expected, 4, R"(24)" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(32nd)" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 3, R"(begin)" ); - streamLine( expected, 3, R"(begin)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"(96)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(64th)" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 4, R"(10)" ); - streamLine( expected, 4, R"(11)" ); - streamLine( expected, 4, R"(eighth)" ); - streamLine( expected, 4, R"()" ); - streamLine( expected, 3, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + MetronomePtr object = tgenMetronome(TestMode::two); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(64th)"); + streamLine(expected, 3, R"()"); + streamLine(expected, 3, R"(begin)"); + streamLine(expected, 3, R"()"); + streamLine(expected, 4, R"(33)"); + streamLine(expected, 4, R"(24)"); + streamLine(expected, 3, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(32nd)"); + streamLine(expected, 3, R"()"); + streamLine(expected, 3, R"()"); + streamLine(expected, 3, R"(begin)"); + streamLine(expected, 3, R"(begin)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"(96)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(64th)"); + streamLine(expected, 3, R"()"); + streamLine(expected, 4, R"(10)"); + streamLine(expected, 4, R"(11)"); + streamLine(expected, 4, R"(eighth)"); + streamLine(expected, 4, R"()"); + streamLine(expected, 3, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test04, Metronome ) + +TEST(Test04, Metronome) { - MetronomePtr object = tgenMetronome( TestMode::three ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(quarter)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"(32nd)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + MetronomePtr object = tgenMetronome(TestMode::three); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(quarter)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"(32nd)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - BeatUnitGroupPtr tgenBeatUnitGroup( TestMode v ) +BeatUnitGroupPtr tgenBeatUnitGroup(TestMode v) +{ + BeatUnitGroupPtr o = makeBeatUnitGroup(); + switch (v) { - BeatUnitGroupPtr o = makeBeatUnitGroup(); - switch ( v ) - { - case TestMode::one: - { - o->getBeatUnit()->setValue( NoteTypeValue::sixteenth ); - } - break; - case TestMode::two: - { - o->getBeatUnit()->setValue( NoteTypeValue::quarter ); - o->addBeatUnitDot( makeBeatUnitDot() ); - } - break; - case TestMode::three: - { - o->getBeatUnit()->setValue( NoteTypeValue::thirtySecond ); - o->addBeatUnitDot( makeBeatUnitDot() ); - o->addBeatUnitDot( makeBeatUnitDot() ); - } - break; - default: - break; - } - return o; - } - MetronomeRelationGroupPtr tgenMetronomeRelationGroup( TestMode v ) + case TestMode::one: { + o->getBeatUnit()->setValue(NoteTypeValue::sixteenth); + } + break; + case TestMode::two: { + o->getBeatUnit()->setValue(NoteTypeValue::quarter); + o->addBeatUnitDot(makeBeatUnitDot()); + } + break; + case TestMode::three: { + o->getBeatUnit()->setValue(NoteTypeValue::thirtySecond); + o->addBeatUnitDot(makeBeatUnitDot()); + o->addBeatUnitDot(makeBeatUnitDot()); + } + break; + default: + break; + } + return o; +} + +MetronomeRelationGroupPtr tgenMetronomeRelationGroup(TestMode v) +{ + MetronomeRelationGroupPtr o = makeMetronomeRelationGroup(); + switch (v) { - MetronomeRelationGroupPtr o = makeMetronomeRelationGroup(); - switch ( v ) - { - case TestMode::one: - { - MetronomeRelationPtr mr = makeMetronomeRelation(); - mr->setValue( XsString( "120" ) ); - o->setMetronomeRelation( mr ); - MetronomeNotePtr mn = makeMetronomeNote(); - mn->setHasMetronomeTuplet( false ); - mn->getMetronomeType()->setValue( NoteTypeValue::whole ); - o->setMetronomeNote( mn ); - } - break; - case TestMode::two: - { - MetronomeRelationPtr mr = makeMetronomeRelation(); - mr->setValue( XsString( "96" ) ); - o->setMetronomeRelation( mr ); - MetronomeNotePtr mn = makeMetronomeNote(); - mn->setHasMetronomeTuplet( true ); - mn->getMetronomeType()->setValue( NoteTypeValue::sixtyFourth ); - MetronomeTupletPtr mtup = makeMetronomeTuplet(); - mtup->setHasTimeModificationNormalTypeNormalDot( true ); - mtup->getActualNotes()->setValue( NonNegativeInteger( 10 ) ); - mtup->getNormalNotes()->setValue( NonNegativeInteger( 11 ) ); - mtup->getTimeModificationNormalTypeNormalDot()->addNormalDot( makeNormalDot() ); - mn->setMetronomeTuplet( mtup ); - o->setMetronomeNote( mn ); - } - break; - case TestMode::three: - { - MetronomeRelationPtr mr = makeMetronomeRelation(); - mr->setValue( XsString( "30" ) ); - o->setMetronomeRelation( mr ); - MetronomeNotePtr mn = makeMetronomeNote(); - mn->setHasMetronomeTuplet( true ); - mn->getMetronomeType()->setValue( NoteTypeValue::sixtyFourth ); - MetronomeTupletPtr mtup = makeMetronomeTuplet(); - mtup->setHasTimeModificationNormalTypeNormalDot( true ); - mtup->getActualNotes()->setValue( NonNegativeInteger( 12 ) ); - mtup->getNormalNotes()->setValue( NonNegativeInteger( 14 ) ); - mtup->getTimeModificationNormalTypeNormalDot()->addNormalDot( makeNormalDot() ); - mtup->getTimeModificationNormalTypeNormalDot()->addNormalDot( makeNormalDot() ); - mn->setMetronomeTuplet( mtup ); - o->setMetronomeNote( mn ); - } - break; - default: - break; - } - return o; - } - NoteRelationNotePtr tgenNoteRelationNote( TestMode v ) + case TestMode::one: { + MetronomeRelationPtr mr = makeMetronomeRelation(); + mr->setValue(XsString("120")); + o->setMetronomeRelation(mr); + MetronomeNotePtr mn = makeMetronomeNote(); + mn->setHasMetronomeTuplet(false); + mn->getMetronomeType()->setValue(NoteTypeValue::whole); + o->setMetronomeNote(mn); + } + break; + case TestMode::two: { + MetronomeRelationPtr mr = makeMetronomeRelation(); + mr->setValue(XsString("96")); + o->setMetronomeRelation(mr); + MetronomeNotePtr mn = makeMetronomeNote(); + mn->setHasMetronomeTuplet(true); + mn->getMetronomeType()->setValue(NoteTypeValue::sixtyFourth); + MetronomeTupletPtr mtup = makeMetronomeTuplet(); + mtup->setHasTimeModificationNormalTypeNormalDot(true); + mtup->getActualNotes()->setValue(NonNegativeInteger(10)); + mtup->getNormalNotes()->setValue(NonNegativeInteger(11)); + mtup->getTimeModificationNormalTypeNormalDot()->addNormalDot(makeNormalDot()); + mn->setMetronomeTuplet(mtup); + o->setMetronomeNote(mn); + } + break; + case TestMode::three: { + MetronomeRelationPtr mr = makeMetronomeRelation(); + mr->setValue(XsString("30")); + o->setMetronomeRelation(mr); + MetronomeNotePtr mn = makeMetronomeNote(); + mn->setHasMetronomeTuplet(true); + mn->getMetronomeType()->setValue(NoteTypeValue::sixtyFourth); + MetronomeTupletPtr mtup = makeMetronomeTuplet(); + mtup->setHasTimeModificationNormalTypeNormalDot(true); + mtup->getActualNotes()->setValue(NonNegativeInteger(12)); + mtup->getNormalNotes()->setValue(NonNegativeInteger(14)); + mtup->getTimeModificationNormalTypeNormalDot()->addNormalDot(makeNormalDot()); + mtup->getTimeModificationNormalTypeNormalDot()->addNormalDot(makeNormalDot()); + mn->setMetronomeTuplet(mtup); + o->setMetronomeNote(mn); + } + break; + default: + break; + } + return o; +} + +NoteRelationNotePtr tgenNoteRelationNote(TestMode v) +{ + NoteRelationNotePtr o = makeNoteRelationNote(); + switch (v) { - NoteRelationNotePtr o = makeNoteRelationNote(); - switch ( v ) - { - case TestMode::one: - { - MetronomeNotePtr n = makeMetronomeNote(); - n->setHasMetronomeTuplet( true ); - n->getMetronomeType()->setValue( NoteTypeValue::half ); - n->getMetronomeTuplet()->getActualNotes()->setValue( NonNegativeInteger( 3 ) ); - n->getMetronomeTuplet()->getNormalNotes()->setValue( NonNegativeInteger( 4 ) ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeDot( makeMetronomeDot() ); - o->addMetronomeNote( n ); - n = makeMetronomeNote(); - n->setHasMetronomeTuplet( false ); - n->getMetronomeType()->setValue( NoteTypeValue::half ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeDot( makeMetronomeDot() ); - n->addMetronomeDot( makeMetronomeDot() ); - o->addMetronomeNote( n ); - o->removeMetronomeNote( o->getMetronomeNoteSet().cbegin() ); - o->setHasMetronomeRelationGroup( true ); - o->setMetronomeRelationGroup( tgenMetronomeRelationGroup( TestMode::three ) ); - } - break; - case TestMode::two: - { - MetronomeNotePtr n = makeMetronomeNote(); - n->setHasMetronomeTuplet( true ); - n->getMetronomeType()->setValue( NoteTypeValue::sixtyFourth ); - n->getMetronomeTuplet()->getActualNotes()->setValue( NonNegativeInteger( 33 ) ); - n->getMetronomeTuplet()->getNormalNotes()->setValue( NonNegativeInteger( 24 ) ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeDot( makeMetronomeDot() ); - o->addMetronomeNote( n ); - n = makeMetronomeNote(); - n->setHasMetronomeTuplet( false ); - n->getMetronomeType()->setValue( NoteTypeValue::thirtySecond ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeDot( makeMetronomeDot() ); - n->addMetronomeDot( makeMetronomeDot() ); - o->addMetronomeNote( n ); - o->removeMetronomeNote( o->getMetronomeNoteSet().cbegin() ); - o->setHasMetronomeRelationGroup( true ); - o->setMetronomeRelationGroup( tgenMetronomeRelationGroup( TestMode::two ) ); - } - break; - case TestMode::three: - { - MetronomeNotePtr n = makeMetronomeNote(); - n->setHasMetronomeTuplet( false ); - n->getMetronomeType()->setValue( NoteTypeValue::whole ); - n->getMetronomeTuplet()->getActualNotes()->setValue( NonNegativeInteger( 13 ) ); - n->getMetronomeTuplet()->getNormalNotes()->setValue( NonNegativeInteger( 11 ) ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeDot( makeMetronomeDot() ); - o->addMetronomeNote( n ); - n = makeMetronomeNote(); - n->setHasMetronomeTuplet( false ); - n->getMetronomeType()->setValue( NoteTypeValue::sixteenth ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeBeam( makeMetronomeBeam() ); - n->addMetronomeDot( makeMetronomeDot() ); - n->addMetronomeDot( makeMetronomeDot() ); - o->addMetronomeNote( n ); - o->removeMetronomeNote( o->getMetronomeNoteSet().cbegin() ); - o->setHasMetronomeRelationGroup( true ); - o->setMetronomeRelationGroup( tgenMetronomeRelationGroup( TestMode::one ) ); - } - break; - default: - break; - } - return o; - } - PerMinuteOrBeatUnitChoicePtr tgenPerMinuteOrBeatUnitChoice( TestMode v ) + case TestMode::one: { + MetronomeNotePtr n = makeMetronomeNote(); + n->setHasMetronomeTuplet(true); + n->getMetronomeType()->setValue(NoteTypeValue::half); + n->getMetronomeTuplet()->getActualNotes()->setValue(NonNegativeInteger(3)); + n->getMetronomeTuplet()->getNormalNotes()->setValue(NonNegativeInteger(4)); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeDot(makeMetronomeDot()); + o->addMetronomeNote(n); + n = makeMetronomeNote(); + n->setHasMetronomeTuplet(false); + n->getMetronomeType()->setValue(NoteTypeValue::half); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeDot(makeMetronomeDot()); + n->addMetronomeDot(makeMetronomeDot()); + o->addMetronomeNote(n); + o->removeMetronomeNote(o->getMetronomeNoteSet().cbegin()); + o->setHasMetronomeRelationGroup(true); + o->setMetronomeRelationGroup(tgenMetronomeRelationGroup(TestMode::three)); + } + break; + case TestMode::two: { + MetronomeNotePtr n = makeMetronomeNote(); + n->setHasMetronomeTuplet(true); + n->getMetronomeType()->setValue(NoteTypeValue::sixtyFourth); + n->getMetronomeTuplet()->getActualNotes()->setValue(NonNegativeInteger(33)); + n->getMetronomeTuplet()->getNormalNotes()->setValue(NonNegativeInteger(24)); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeDot(makeMetronomeDot()); + o->addMetronomeNote(n); + n = makeMetronomeNote(); + n->setHasMetronomeTuplet(false); + n->getMetronomeType()->setValue(NoteTypeValue::thirtySecond); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeDot(makeMetronomeDot()); + n->addMetronomeDot(makeMetronomeDot()); + o->addMetronomeNote(n); + o->removeMetronomeNote(o->getMetronomeNoteSet().cbegin()); + o->setHasMetronomeRelationGroup(true); + o->setMetronomeRelationGroup(tgenMetronomeRelationGroup(TestMode::two)); + } + break; + case TestMode::three: { + MetronomeNotePtr n = makeMetronomeNote(); + n->setHasMetronomeTuplet(false); + n->getMetronomeType()->setValue(NoteTypeValue::whole); + n->getMetronomeTuplet()->getActualNotes()->setValue(NonNegativeInteger(13)); + n->getMetronomeTuplet()->getNormalNotes()->setValue(NonNegativeInteger(11)); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeDot(makeMetronomeDot()); + o->addMetronomeNote(n); + n = makeMetronomeNote(); + n->setHasMetronomeTuplet(false); + n->getMetronomeType()->setValue(NoteTypeValue::sixteenth); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeBeam(makeMetronomeBeam()); + n->addMetronomeDot(makeMetronomeDot()); + n->addMetronomeDot(makeMetronomeDot()); + o->addMetronomeNote(n); + o->removeMetronomeNote(o->getMetronomeNoteSet().cbegin()); + o->setHasMetronomeRelationGroup(true); + o->setMetronomeRelationGroup(tgenMetronomeRelationGroup(TestMode::one)); + } + break; + default: + break; + } + return o; +} + +PerMinuteOrBeatUnitChoicePtr tgenPerMinuteOrBeatUnitChoice(TestMode v) +{ + PerMinuteOrBeatUnitChoicePtr o = makePerMinuteOrBeatUnitChoice(); + switch (v) { - PerMinuteOrBeatUnitChoicePtr o = makePerMinuteOrBeatUnitChoice(); - switch ( v ) - { - case TestMode::one: - { - o->setChoice( PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup ); - o->setBeatUnitGroup( tgenBeatUnitGroup( v ) ); - } - break; - case TestMode::two: - { - o->setChoice( PerMinuteOrBeatUnitChoice::Choice::perMinute ); - o->getPerMinute()->setValue( XsString( "104" ) ); - o->getPerMinute()->getAttributes()->hasFontSize = true; - o->getPerMinute()->getAttributes()->fontSize = FontSize( CssFontSize::xxLarge ); - } - break; - case TestMode::three: - { - o->setChoice( PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup ); - o->setChoice( PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup ); - o->setBeatUnitGroup( tgenBeatUnitGroup( v ) ); - } - break; - default: - break; - } - return o; - } - BeatUnitPerPtr tgenBeatUnitPer( TestMode v ) + case TestMode::one: { + o->setChoice(PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup); + o->setBeatUnitGroup(tgenBeatUnitGroup(v)); + } + break; + case TestMode::two: { + o->setChoice(PerMinuteOrBeatUnitChoice::Choice::perMinute); + o->getPerMinute()->setValue(XsString("104")); + o->getPerMinute()->getAttributes()->hasFontSize = true; + o->getPerMinute()->getAttributes()->fontSize = FontSize(CssFontSize::xxLarge); + } + break; + case TestMode::three: { + o->setChoice(PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup); + o->setChoice(PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup); + o->setBeatUnitGroup(tgenBeatUnitGroup(v)); + } + break; + default: + break; + } + return o; +} + +BeatUnitPerPtr tgenBeatUnitPer(TestMode v) +{ + BeatUnitPerPtr o = makeBeatUnitPer(); + switch (v) { - BeatUnitPerPtr o = makeBeatUnitPer(); - switch ( v ) - { - case TestMode::one: - { - o->setBeatUnitGroup( tgenBeatUnitGroup( TestMode::two ) ); - o->setPerMinuteOtBeatUnitChoice( tgenPerMinuteOrBeatUnitChoice( TestMode::three ) ); - } - break; - case TestMode::two: - { - o->setBeatUnitGroup( tgenBeatUnitGroup( TestMode::three ) ); - o->setPerMinuteOtBeatUnitChoice( tgenPerMinuteOrBeatUnitChoice( TestMode::one ) ); - } - break; - case TestMode::three: - { - o->setBeatUnitGroup( tgenBeatUnitGroup( TestMode::one ) ); - o->setPerMinuteOtBeatUnitChoice( tgenPerMinuteOrBeatUnitChoice( TestMode::two ) ); - } - break; - default: - break; - } - return o; - } - BeatUnitPerOrNoteRelationNoteChoicePtr tgenBeatUnitPerOrNoteRelationNoteChoice( TestMode v ) + case TestMode::one: { + o->setBeatUnitGroup(tgenBeatUnitGroup(TestMode::two)); + o->setPerMinuteOtBeatUnitChoice(tgenPerMinuteOrBeatUnitChoice(TestMode::three)); + } + break; + case TestMode::two: { + o->setBeatUnitGroup(tgenBeatUnitGroup(TestMode::three)); + o->setPerMinuteOtBeatUnitChoice(tgenPerMinuteOrBeatUnitChoice(TestMode::one)); + } + break; + case TestMode::three: { + o->setBeatUnitGroup(tgenBeatUnitGroup(TestMode::one)); + o->setPerMinuteOtBeatUnitChoice(tgenPerMinuteOrBeatUnitChoice(TestMode::two)); + } + break; + default: + break; + } + return o; +} + +BeatUnitPerOrNoteRelationNoteChoicePtr tgenBeatUnitPerOrNoteRelationNoteChoice(TestMode v) +{ + BeatUnitPerOrNoteRelationNoteChoicePtr o = makeBeatUnitPerOrNoteRelationNoteChoice(); + switch (v) { - BeatUnitPerOrNoteRelationNoteChoicePtr o = makeBeatUnitPerOrNoteRelationNoteChoice(); - switch ( v ) - { - case TestMode::one: - { - o->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::beatUnitPer ); - o->setBeatUnitPer( tgenBeatUnitPer( TestMode::three ) ); - } - break; - case TestMode::two: - { - o->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::noteRelationNote ); - o->setNoteRelationNote( tgenNoteRelationNote( TestMode::two ) ); - } - break; - case TestMode::three: - { - o->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::beatUnitPer ); - o->setBeatUnitPer( tgenBeatUnitPer( TestMode::one ) ); - } - break; - default: - break; - } - return o; - } - MetronomeAttributesPtr tgenMetronomeAttributesPtr( TestMode v ) + case TestMode::one: { + o->setChoice(BeatUnitPerOrNoteRelationNoteChoice::Choice::beatUnitPer); + o->setBeatUnitPer(tgenBeatUnitPer(TestMode::three)); + } + break; + case TestMode::two: { + o->setChoice(BeatUnitPerOrNoteRelationNoteChoice::Choice::noteRelationNote); + o->setNoteRelationNote(tgenNoteRelationNote(TestMode::two)); + } + break; + case TestMode::three: { + o->setChoice(BeatUnitPerOrNoteRelationNoteChoice::Choice::beatUnitPer); + o->setBeatUnitPer(tgenBeatUnitPer(TestMode::one)); + } + break; + default: + break; + } + return o; +} + +MetronomeAttributesPtr tgenMetronomeAttributesPtr(TestMode v) +{ + MetronomeAttributesPtr o = std::make_shared(); + switch (v) { - MetronomeAttributesPtr o = std::make_shared(); - switch ( v ) - { - case TestMode::one: - { - o->hasColor = true; - o->color = Color( 123, 201, 9 ); - o->hasFontFamily = true; - o->fontFamily = CommaSeparatedText( "Bone,and,Bish" ); - } - break; - case TestMode::two: - { - o->hasHalign = true; - o->hasJustify = true; - o->hasParentheses = true; - o->parentheses = YesNo::yes; - } - break; - case TestMode::three: - { - o->hasDefaultX = true; - o->defaultX = TenthsValue{ 13.2 }; - } - break; - default: - break; - } - return o; - } - MetronomePtr tgenMetronome( TestMode v ) + case TestMode::one: { + o->hasColor = true; + o->color = Color(123, 201, 9); + o->hasFontFamily = true; + o->fontFamily = CommaSeparatedText("Bone,and,Bish"); + } + break; + case TestMode::two: { + o->hasHalign = true; + o->hasJustify = true; + o->hasParentheses = true; + o->parentheses = YesNo::yes; + } + break; + case TestMode::three: { + o->hasDefaultX = true; + o->defaultX = TenthsValue{13.2}; + } + break; + default: + break; + } + return o; +} + +MetronomePtr tgenMetronome(TestMode v) +{ + MetronomePtr o = makeMetronome(); + switch (v) { - MetronomePtr o = makeMetronome(); - switch ( v ) - { - case TestMode::one: - { - o->setAttributes( tgenMetronomeAttributesPtr( v ) ); - o->setBeatUnitPerOrNoteRelationNoteChoice( tgenBeatUnitPerOrNoteRelationNoteChoice( v ) ); - } - break; - case TestMode::two: - { - o->setAttributes( tgenMetronomeAttributesPtr( v ) ); - o->setBeatUnitPerOrNoteRelationNoteChoice( tgenBeatUnitPerOrNoteRelationNoteChoice( v ) ); - } - break; - case TestMode::three: - { - o->setAttributes( tgenMetronomeAttributesPtr( v ) ); - o->setBeatUnitPerOrNoteRelationNoteChoice( tgenBeatUnitPerOrNoteRelationNoteChoice( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setAttributes(tgenMetronomeAttributesPtr(v)); + o->setBeatUnitPerOrNoteRelationNoteChoice(tgenBeatUnitPerOrNoteRelationNoteChoice(v)); + } + break; + case TestMode::two: { + o->setAttributes(tgenMetronomeAttributesPtr(v)); + o->setBeatUnitPerOrNoteRelationNoteChoice(tgenBeatUnitPerOrNoteRelationNoteChoice(v)); + } + break; + case TestMode::three: { + o->setAttributes(tgenMetronomeAttributesPtr(v)); + o->setBeatUnitPerOrNoteRelationNoteChoice(tgenBeatUnitPerOrNoteRelationNoteChoice(v)); + } + break; + default: + break; } + return o; } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MetronomeTest.h b/Sourcecode/private/mxtest/core/MetronomeTest.h index d847d9794..98b046bcb 100644 --- a/Sourcecode/private/mxtest/core/MetronomeTest.h +++ b/Sourcecode/private/mxtest/core/MetronomeTest.h @@ -6,22 +6,22 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; namespace mxtest { - BeatUnitGroupPtr tgenBeatUnitGroup( TestMode v ); - MetronomeRelationGroupPtr tgenMetronomeRelationGroup( TestMode v ); - NoteRelationNotePtr tgenNoteRelationNote( TestMode v ); - PerMinuteOrBeatUnitChoicePtr tgenPerMinuteOrBeatUnitChoice( TestMode v ); - BeatUnitPerPtr tgenBeatUnitPer( TestMode v ); - BeatUnitPerOrNoteRelationNoteChoicePtr tgenBeatUnitPerOrNoteRelationNoteChoice( TestMode v ); - MetronomeAttributesPtr tgenMetronomeAttributesPtr( TestMode v ); - MetronomePtr tgenMetronome( TestMode v ); -} +BeatUnitGroupPtr tgenBeatUnitGroup(TestMode v); +MetronomeRelationGroupPtr tgenMetronomeRelationGroup(TestMode v); +NoteRelationNotePtr tgenNoteRelationNote(TestMode v); +PerMinuteOrBeatUnitChoicePtr tgenPerMinuteOrBeatUnitChoice(TestMode v); +BeatUnitPerPtr tgenBeatUnitPer(TestMode v); +BeatUnitPerOrNoteRelationNoteChoicePtr tgenBeatUnitPerOrNoteRelationNoteChoice(TestMode v); +MetronomeAttributesPtr tgenMetronomeAttributesPtr(TestMode v); +MetronomePtr tgenMetronome(TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MetronomeTupletTest.cpp b/Sourcecode/private/mxtest/core/MetronomeTupletTest.cpp index 474dabdda..ae121992c 100644 --- a/Sourcecode/private/mxtest/core/MetronomeTupletTest.cpp +++ b/Sourcecode/private/mxtest/core/MetronomeTupletTest.cpp @@ -6,55 +6,57 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, MetronomeTuplet ) +TEST(Test01, MetronomeTuplet) { - MetronomeTuplet object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(0)" ); - streamLine( expected, 2, R"(0)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + MetronomeTuplet object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(0)"); + streamLine(expected, 2, R"(0)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, MetronomeTuplet ) + +TEST(Test02, MetronomeTuplet) { - MetronomeTuplet object; + MetronomeTuplet object; object.getAttributes()->hasShowNumber = true; object.getAttributes()->showNumber = ShowTuplet::none; object.getAttributes()->hasBracket = true; object.getAttributes()->bracket = YesNo::yes; - object.setHasTimeModificationNormalTypeNormalDot( true ); - object.getTimeModificationNormalTypeNormalDot()->getNormalType()->setValue( NoteTypeValue::breve ); - object.getTimeModificationNormalTypeNormalDot()->addNormalDot( makeNormalDot() ); - object.getTimeModificationNormalTypeNormalDot()->addNormalDot( makeNormalDot() ); - object.getNormalNotes()->setValue( NonNegativeInteger( 2 ) ); - object.getActualNotes()->setValue( NonNegativeInteger( 3 ) ); - stringstream expected;; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(3)" ); - streamLine( expected, 2, R"(2)" ); - streamLine( expected, 2, R"(breve)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.setHasTimeModificationNormalTypeNormalDot(true); + object.getTimeModificationNormalTypeNormalDot()->getNormalType()->setValue(NoteTypeValue::breve); + object.getTimeModificationNormalTypeNormalDot()->addNormalDot(makeNormalDot()); + object.getTimeModificationNormalTypeNormalDot()->addNormalDot(makeNormalDot()); + object.getNormalNotes()->setValue(NonNegativeInteger(2)); + object.getActualNotes()->setValue(NonNegativeInteger(3)); + stringstream expected; + ; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(3)"); + streamLine(expected, 2, R"(2)"); + streamLine(expected, 2, R"(breve)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/MetronomeTypeTest.cpp b/Sourcecode/private/mxtest/core/MetronomeTypeTest.cpp index 491b3868d..505bcd023 100644 --- a/Sourcecode/private/mxtest/core/MetronomeTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/MetronomeTypeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MetronomeType ) +TEST(Test01, MetronomeType) { - std::string indentString( INDENT ); - NoteTypeValue value1 = NoteTypeValue::quarter; - NoteTypeValue value2 = NoteTypeValue::whole; - MetronomeType object1; - MetronomeType object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(eighth)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(whole)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NoteTypeValue value1 = NoteTypeValue::quarter; + NoteTypeValue value2 = NoteTypeValue::whole; + MetronomeType object1; + MetronomeType object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(eighth)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(whole)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MidiBankTest.cpp b/Sourcecode/private/mxtest/core/MidiBankTest.cpp index 692765e8a..467d094b1 100644 --- a/Sourcecode/private/mxtest/core/MidiBankTest.cpp +++ b/Sourcecode/private/mxtest/core/MidiBankTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MidiBank ) +TEST(Test01, MidiBank) { - std::string indentString( INDENT ); - Midi16384 value1{ 234 }; - Midi16384 value2{ 567 }; - MidiBank object1; - MidiBank object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(567)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Midi16384 value1{234}; + Midi16384 value2{567}; + MidiBank object1; + MidiBank object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(567)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MidiChannelTest.cpp b/Sourcecode/private/mxtest/core/MidiChannelTest.cpp index e322600bf..cbe0699fb 100644 --- a/Sourcecode/private/mxtest/core/MidiChannelTest.cpp +++ b/Sourcecode/private/mxtest/core/MidiChannelTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MidiChannel ) +TEST(Test01, MidiChannel) { - std::string indentString( INDENT ); - Midi16 value1{ 3 }; - Midi16 value2{ 16 }; - MidiChannel object1; - MidiChannel object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(16)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Midi16 value1{3}; + Midi16 value2{16}; + MidiChannel object1; + MidiChannel object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(16)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MidiDeviceTest.cpp b/Sourcecode/private/mxtest/core/MidiDeviceTest.cpp index 123bcf742..bea0527ab 100644 --- a/Sourcecode/private/mxtest/core/MidiDeviceTest.cpp +++ b/Sourcecode/private/mxtest/core/MidiDeviceTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, MidiDevice ) +TEST(Test01, MidiDevice) { - std::string indentString( INDENT ); - XsString value1{ "Ives" }; - XsString value2{ "Vaughn-Williams" }; - MidiDevice object1; - MidiDevice object2( value2 ); - MidiDeviceAttributesPtr attributes1 = std::make_shared(); - MidiDeviceAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"Ives"}; + XsString value2{"Vaughn-Williams"}; + MidiDevice object1; + MidiDevice object2(value2); + MidiDeviceAttributesPtr attributes1 = std::make_shared(); + MidiDeviceAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasId = true; - attributes1->id = XsIDREF{ "M1" }; + attributes1->id = XsIDREF{"M1"}; attributes1->hasPort = true; - attributes1->port = Midi16{ 16 }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Vaughn-Williams)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->port = Midi16{16}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Vaughn-Williams)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MidiInstrumentTest.cpp b/Sourcecode/private/mxtest/core/MidiInstrumentTest.cpp index 6b163cb95..62408c336 100644 --- a/Sourcecode/private/mxtest/core/MidiInstrumentTest.cpp +++ b/Sourcecode/private/mxtest/core/MidiInstrumentTest.cpp @@ -6,173 +6,169 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, MidiInstrument ) +TEST(Test01, MidiInstrument) { TestMode v = TestMode::one; - MidiInstrumentPtr object = tgenMidiInstrument( v ); - stringstream expected; - tgenMidiInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + MidiInstrumentPtr object = tgenMidiInstrument(v); + stringstream expected; + tgenMidiInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, MidiInstrument ) + +TEST(Test02, MidiInstrument) { TestMode v = TestMode::two; - MidiInstrumentPtr object = tgenMidiInstrument( v ); - stringstream expected; - tgenMidiInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + MidiInstrumentPtr object = tgenMidiInstrument(v); + stringstream expected; + tgenMidiInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, MidiInstrument ) + +TEST(Test03, MidiInstrument) { TestMode v = TestMode::three; - MidiInstrumentPtr object = tgenMidiInstrument( v ); - stringstream expected; - tgenMidiInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + MidiInstrumentPtr object = tgenMidiInstrument(v); + stringstream expected; + tgenMidiInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - MidiInstrumentPtr tgenMidiInstrument( TestMode v ) +MidiInstrumentPtr tgenMidiInstrument(TestMode v) +{ + MidiInstrumentPtr o = makeMidiInstrument(); + switch (v) { - MidiInstrumentPtr o = makeMidiInstrument(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->id = XsIDREF( "M1" ); - o->setHasMidiChannel( true ); - o->setHasMidiName( true ); - o->setHasMidiBank( true ); - o->setHasMidiUnpitched( false ); - o->setHasVolume( true ); - o->setHasPan( true ); - o->setHasElevation( false ); - o->getMidiChannel()->setValue( Midi16( 2 ) ); - o->getMidiName()->setValue( XsString( "Trumpet" ) ); - o->getMidiBank()->setValue( Midi16384( 3 ) ); - o->getMidiUnpitched()->setValue( Midi128( 100 ) ); - o->getVolume()->setValue( Percent( 55.5 ) ); - o->getPan()->setValue( RotationDegrees( -88.6 ) ); - o->getElevation()->setValue( RotationDegrees( 101.112 ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->id = XsIDREF( "X2" ); - o->setHasMidiChannel( true ); - o->setHasMidiName( true ); - o->setHasMidiBank( true ); - o->setHasMidiUnpitched( true ); - o->setHasVolume( true ); - o->setHasPan( false ); - o->setHasElevation( true ); - o->getMidiChannel()->setValue( Midi16( 3 ) ); - o->getMidiName()->setValue( XsString( "Bassoon" ) ); - o->getMidiBank()->setValue( Midi16384( 4 ) ); - o->getMidiUnpitched()->setValue( Midi128( 97 ) ); - o->getVolume()->setValue( Percent( 0.123 ) ); - o->getPan()->setValue( RotationDegrees( 120.3 ) ); - o->getElevation()->setValue( RotationDegrees( -33.333 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->id = XsIDREF("M1"); + o->setHasMidiChannel(true); + o->setHasMidiName(true); + o->setHasMidiBank(true); + o->setHasMidiUnpitched(false); + o->setHasVolume(true); + o->setHasPan(true); + o->setHasElevation(false); + o->getMidiChannel()->setValue(Midi16(2)); + o->getMidiName()->setValue(XsString("Trumpet")); + o->getMidiBank()->setValue(Midi16384(3)); + o->getMidiUnpitched()->setValue(Midi128(100)); + o->getVolume()->setValue(Percent(55.5)); + o->getPan()->setValue(RotationDegrees(-88.6)); + o->getElevation()->setValue(RotationDegrees(101.112)); + } + break; + case TestMode::three: { + o->getAttributes()->id = XsIDREF("X2"); + o->setHasMidiChannel(true); + o->setHasMidiName(true); + o->setHasMidiBank(true); + o->setHasMidiUnpitched(true); + o->setHasVolume(true); + o->setHasPan(false); + o->setHasElevation(true); + o->getMidiChannel()->setValue(Midi16(3)); + o->getMidiName()->setValue(XsString("Bassoon")); + o->getMidiBank()->setValue(Midi16384(4)); + o->getMidiUnpitched()->setValue(Midi128(97)); + o->getVolume()->setValue(Percent(0.123)); + o->getPan()->setValue(RotationDegrees(120.3)); + o->getElevation()->setValue(RotationDegrees(-33.333)); } - void tgenMidiInstrumentExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenMidiInstrumentExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(2)" ); - streamLine( os, i+1, R"(Trumpet)" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i+1, R"(55.5)" ); - streamLine( os, i+1, R"(-88.6)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i+1, R"(Bassoon)" ); - streamLine( os, i+1, R"(4)" ); - streamLine( os, i+1, R"(97)" ); - streamLine( os, i+1, R"(0.123)" ); - streamLine( os, i+1, R"(-33.333)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(2)"); + streamLine(os, i + 1, R"(Trumpet)"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i + 1, R"(55.5)"); + streamLine(os, i + 1, R"(-88.6)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i + 1, R"(Bassoon)"); + streamLine(os, i + 1, R"(4)"); + streamLine(os, i + 1, R"(97)"); + streamLine(os, i + 1, R"(0.123)"); + streamLine(os, i + 1, R"(-33.333)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } - // MidiInstrumentChoicePtr tgenMidiInstrumentChoice( variant v ) - // { - // MidiInstrumentChoicePtr o = makeMidiInstrumentChoice(); - // switch ( v ) - // { - // case variant::one: - // { - // o->setChoice( MidiInstrumentChoice::Choice::stickType ); - // } - // break; - // case variant::two: - // { - // o->setChoice( MidiInstrumentChoice::Choice::wood ); - // } - // break; - // case variant::three: - // { - // o->setChoice( MidiInstrumentChoice::Choice::otherMidiInstrument ); - // o->getOtherMidiInstrument()->setValue( XsString("Hello" ) ); - // } - // break; - // default: - // break; - // } - // return o; - // } } +// MidiInstrumentChoicePtr tgenMidiInstrumentChoice( variant v ) +// { +// MidiInstrumentChoicePtr o = makeMidiInstrumentChoice(); +// switch ( v ) +// { +// case variant::one: +// { +// o->setChoice( MidiInstrumentChoice::Choice::stickType ); +// } +// break; +// case variant::two: +// { +// o->setChoice( MidiInstrumentChoice::Choice::wood ); +// } +// break; +// case variant::three: +// { +// o->setChoice( MidiInstrumentChoice::Choice::otherMidiInstrument ); +// o->getOtherMidiInstrument()->setValue( XsString("Hello" ) ); +// } +// break; +// default: +// break; +// } +// return o; +// } +} // namespace mxtest + #endif diff --git a/Sourcecode/private/mxtest/core/MidiInstrumentTest.h b/Sourcecode/private/mxtest/core/MidiInstrumentTest.h index 1629eae9e..8c3f4fd5a 100644 --- a/Sourcecode/private/mxtest/core/MidiInstrumentTest.h +++ b/Sourcecode/private/mxtest/core/MidiInstrumentTest.h @@ -6,13 +6,13 @@ #ifdef MX_COMPILE_CORE_TESTS #pragma once -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::MidiInstrumentPtr tgenMidiInstrument( TestMode v ); - void tgenMidiInstrumentExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::MidiInstrumentPtr tgenMidiInstrument(TestMode v); +void tgenMidiInstrumentExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MidiNameTest.cpp b/Sourcecode/private/mxtest/core/MidiNameTest.cpp index 995507e57..0f13ba177 100644 --- a/Sourcecode/private/mxtest/core/MidiNameTest.cpp +++ b/Sourcecode/private/mxtest/core/MidiNameTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MidiName ) +TEST(Test01, MidiName) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - MidiName object1; - MidiName object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + MidiName object1; + MidiName object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MidiProgramTest.cpp b/Sourcecode/private/mxtest/core/MidiProgramTest.cpp index 642c41bc0..5b94ec6c8 100644 --- a/Sourcecode/private/mxtest/core/MidiProgramTest.cpp +++ b/Sourcecode/private/mxtest/core/MidiProgramTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MidiProgram ) +TEST(Test01, MidiProgram) { - std::string indentString( INDENT ); - Midi128 value1{ 128 }; - Midi128 value2{ 3 }; - MidiProgram object1; - MidiProgram object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Midi128 value1{128}; + Midi128 value2{3}; + MidiProgram object1; + MidiProgram object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MidiUnpitchedTest.cpp b/Sourcecode/private/mxtest/core/MidiUnpitchedTest.cpp index 0d399d530..a2cb67e5a 100644 --- a/Sourcecode/private/mxtest/core/MidiUnpitchedTest.cpp +++ b/Sourcecode/private/mxtest/core/MidiUnpitchedTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MidiUnpitched ) +TEST(Test01, MidiUnpitched) { - std::string indentString( INDENT ); - Midi128 value1{ 100 }; - Midi128 value2{ 99 }; - MidiUnpitched object1; - MidiUnpitched object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(99)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Midi128 value1{100}; + Midi128 value2{99}; + MidiUnpitched object1; + MidiUnpitched object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(99)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MillimetersTest.cpp b/Sourcecode/private/mxtest/core/MillimetersTest.cpp index e328021fe..527a15d35 100644 --- a/Sourcecode/private/mxtest/core/MillimetersTest.cpp +++ b/Sourcecode/private/mxtest/core/MillimetersTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Millimeters ) +TEST(Test01, Millimeters) { - std::string indentString( INDENT ); - MillimetersValue value1{ 1.1 }; - MillimetersValue value2{ 2.2 }; - Millimeters object1; - Millimeters object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2.2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + MillimetersValue value1{1.1}; + MillimetersValue value2{2.2}; + Millimeters object1; + Millimeters object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2.2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MiscellaneousFieldTest.cpp b/Sourcecode/private/mxtest/core/MiscellaneousFieldTest.cpp index 06421574e..40b9c20d3 100644 --- a/Sourcecode/private/mxtest/core/MiscellaneousFieldTest.cpp +++ b/Sourcecode/private/mxtest/core/MiscellaneousFieldTest.cpp @@ -11,35 +11,38 @@ using namespace mx::core; -TEST( Test01, MiscellaneousField ) +TEST(Test01, MiscellaneousField) { - std::string indentString( INDENT ); - XsString value1{ "Freezing Pieces" }; - XsString value2{ "Escape Sequence" }; - MiscellaneousField object1; - MiscellaneousField object2( value2 ); - MiscellaneousFieldAttributesPtr attributes1 = std::make_shared(); - MiscellaneousFieldAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->name = XsToken{ "Title" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Escape Sequence)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"Freezing Pieces"}; + XsString value2{"Escape Sequence"}; + MiscellaneousField object1; + MiscellaneousField object2(value2); + MiscellaneousFieldAttributesPtr attributes1 = std::make_shared(); + MiscellaneousFieldAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->name = XsToken{"Title"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"(Escape Sequence)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MiscellaneousTest.cpp b/Sourcecode/private/mxtest/core/MiscellaneousTest.cpp index 0a1d18b9a..0d7ecd64a 100644 --- a/Sourcecode/private/mxtest/core/MiscellaneousTest.cpp +++ b/Sourcecode/private/mxtest/core/MiscellaneousTest.cpp @@ -6,120 +6,116 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MiscellaneousTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Miscellaneous ) +TEST(Test01, Miscellaneous) { TestMode v = TestMode::one; - MiscellaneousPtr object = tgenMiscellaneous( v ); - stringstream expected; - tgenMiscellaneousExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + MiscellaneousPtr object = tgenMiscellaneous(v); + stringstream expected; + tgenMiscellaneousExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Miscellaneous ) + +TEST(Test02, Miscellaneous) { TestMode v = TestMode::two; - MiscellaneousPtr object = tgenMiscellaneous( v ); - stringstream expected; - tgenMiscellaneousExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MiscellaneousPtr object = tgenMiscellaneous(v); + stringstream expected; + tgenMiscellaneousExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Miscellaneous ) + +TEST(Test03, Miscellaneous) { TestMode v = TestMode::three; - MiscellaneousPtr object = tgenMiscellaneous( v ); - stringstream expected; - tgenMiscellaneousExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MiscellaneousPtr object = tgenMiscellaneous(v); + stringstream expected; + tgenMiscellaneousExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - MiscellaneousPtr tgenMiscellaneous( TestMode v ) +MiscellaneousPtr tgenMiscellaneous(TestMode v) +{ + MiscellaneousPtr o = makeMiscellaneous(); + switch (v) { - MiscellaneousPtr o = makeMiscellaneous(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - auto m1 = makeMiscellaneousField(); - m1->setValue( XsString( "Something" ) ); - m1->getAttributes()->name = XsToken( "one" ); - auto m2 = makeMiscellaneousField(); - m2->setValue( XsString( "Interesting" ) ); - m2->getAttributes()->name = XsToken( "two" ); - o->addMiscellaneousField( m1 ); - o->addMiscellaneousField( m2 ); - } - break; - case TestMode::three: - { - auto m1 = makeMiscellaneousField(); - m1->setValue( XsString( "One Line Only Here" ) ); - m1->getAttributes()->name = XsToken( "ricky" ); - o->addMiscellaneousField( m1 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + auto m1 = makeMiscellaneousField(); + m1->setValue(XsString("Something")); + m1->getAttributes()->name = XsToken("one"); + auto m2 = makeMiscellaneousField(); + m2->setValue(XsString("Interesting")); + m2->getAttributes()->name = XsToken("two"); + o->addMiscellaneousField(m1); + o->addMiscellaneousField(m2); + } + break; + case TestMode::three: { + auto m1 = makeMiscellaneousField(); + m1->setValue(XsString("One Line Only Here")); + m1->getAttributes()->name = XsToken("ricky"); + o->addMiscellaneousField(m1); + } + break; + default: + break; } - void tgenMiscellaneousExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenMiscellaneousExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Something)" ); - streamLine( os, i+1, R"(Interesting)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(One Line Only Here)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Something)"); + streamLine(os, i + 1, R"(Interesting)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(One Line Only Here)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MiscellaneousTest.h b/Sourcecode/private/mxtest/core/MiscellaneousTest.h index 9789d201a..7e1f36c6c 100644 --- a/Sourcecode/private/mxtest/core/MiscellaneousTest.h +++ b/Sourcecode/private/mxtest/core/MiscellaneousTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::MiscellaneousPtr tgenMiscellaneous( TestMode v ); - void tgenMiscellaneousExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::MiscellaneousPtr tgenMiscellaneous(TestMode v); +void tgenMiscellaneousExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ModeTest.cpp b/Sourcecode/private/mxtest/core/ModeTest.cpp index feabd702e..a6701408e 100644 --- a/Sourcecode/private/mxtest/core/ModeTest.cpp +++ b/Sourcecode/private/mxtest/core/ModeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Mode ) +TEST(Test01, Mode) { - std::string indentString( INDENT ); - ModeValue value1{ ModeEnum::dorian }; - ModeValue value2{ "melodian" }; - Mode object1; - Mode object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(major)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(melodian)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + ModeValue value1{ModeEnum::dorian}; + ModeValue value2{"melodian"}; + Mode object1; + Mode object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(major)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(melodian)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MordentTest.cpp b/Sourcecode/private/mxtest/core/MordentTest.cpp index db46fd0d3..e345c405f 100644 --- a/Sourcecode/private/mxtest/core/MordentTest.cpp +++ b/Sourcecode/private/mxtest/core/MordentTest.cpp @@ -6,113 +6,108 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/MordentTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - +#include "mxtest/core/MordentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Mordent ) +TEST(Test01, Mordent) { TestMode v = TestMode::one; - MordentPtr object = tgenMordent( v ); - stringstream expected; - tgenMordentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + MordentPtr object = tgenMordent(v); + stringstream expected; + tgenMordentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Mordent ) + +TEST(Test02, Mordent) { TestMode v = TestMode::two; - MordentPtr object = tgenMordent( v ); - stringstream expected; - tgenMordentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + MordentPtr object = tgenMordent(v); + stringstream expected; + tgenMordentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test03, Mordent ) + +TEST(Test03, Mordent) { TestMode v = TestMode::three; - MordentPtr object = tgenMordent( v ); - stringstream expected; - tgenMordentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + MordentPtr object = tgenMordent(v); + stringstream expected; + tgenMordentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } namespace mxtest { - MordentPtr tgenMordent( TestMode v ) +MordentPtr tgenMordent(TestMode v) +{ + MordentPtr o = makeMordent(); + switch (v) { - MordentPtr o = makeMordent(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasBeats = true; - o->getAttributes()->beats = TrillBeats( 1.2 ); - o->getAttributes()->hasApproach = true; - o->getAttributes()->approach = AboveBelow::above; - o->getAttributes()->hasAccelerate = true; - o->getAttributes()->accelerate = YesNo::yes; - } - break; - case TestMode::three: - { - o->getAttributes()->hasDeparture = true; - o->getAttributes()->departure = AboveBelow::below; - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasBeats = true; + o->getAttributes()->beats = TrillBeats(1.2); + o->getAttributes()->hasApproach = true; + o->getAttributes()->approach = AboveBelow::above; + o->getAttributes()->hasAccelerate = true; + o->getAttributes()->accelerate = YesNo::yes; } - void tgenMordentExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->getAttributes()->hasDeparture = true; + o->getAttributes()->departure = AboveBelow::below; + } + break; + default: + break; + } + return o; +} + +void tgenMordentExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MordentTest.h b/Sourcecode/private/mxtest/core/MordentTest.h index 75ba03dc8..78ec348c5 100644 --- a/Sourcecode/private/mxtest/core/MordentTest.h +++ b/Sourcecode/private/mxtest/core/MordentTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::MordentPtr tgenMordent( TestMode v ); - void tgenMordentExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::MordentPtr tgenMordent(TestMode v); +void tgenMordentExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MovementNumberTest.cpp b/Sourcecode/private/mxtest/core/MovementNumberTest.cpp index 6dcb07bfd..c2028242b 100644 --- a/Sourcecode/private/mxtest/core/MovementNumberTest.cpp +++ b/Sourcecode/private/mxtest/core/MovementNumberTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MovementNumber ) +TEST(Test01, MovementNumber) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - MovementNumber object1; - MovementNumber object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + MovementNumber object1; + MovementNumber object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MovementTitleTest.cpp b/Sourcecode/private/mxtest/core/MovementTitleTest.cpp index 1d23559ea..2c3057bff 100644 --- a/Sourcecode/private/mxtest/core/MovementTitleTest.cpp +++ b/Sourcecode/private/mxtest/core/MovementTitleTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, MovementTitle ) +TEST(Test01, MovementTitle) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - MovementTitle object1; - MovementTitle object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + MovementTitle object1; + MovementTitle object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MultipleRestTest.cpp b/Sourcecode/private/mxtest/core/MultipleRestTest.cpp index d099a398f..39c81774b 100644 --- a/Sourcecode/private/mxtest/core/MultipleRestTest.cpp +++ b/Sourcecode/private/mxtest/core/MultipleRestTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, MultipleRest ) +TEST(Test01, MultipleRest) { - std::string indentString( INDENT ); - PositiveIntegerOrEmpty value1( PositiveInteger( 1 ) ); - PositiveIntegerOrEmpty value2( PositiveInteger( 2 ) ); - MultipleRest object1; - MultipleRest object2( value2 ); - MultipleRestAttributesPtr attributes1 = std::make_shared(); - MultipleRestAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + PositiveIntegerOrEmpty value1(PositiveInteger(1)); + PositiveIntegerOrEmpty value2(PositiveInteger(2)); + MultipleRest object1; + MultipleRest object2(value2); + MultipleRestAttributesPtr attributes1 = std::make_shared(); + MultipleRestAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasUseSymbols = true; attributes1->useSymbols = YesNo::no; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+"2"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + "2"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/MusicDataChoiceTest.cpp b/Sourcecode/private/mxtest/core/MusicDataChoiceTest.cpp index 60ed187f0..16ea624fc 100644 --- a/Sourcecode/private/mxtest/core/MusicDataChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/MusicDataChoiceTest.cpp @@ -6,181 +6,175 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/MusicDataChoiceTest.h" -#include "mxtest/core/NoteTest.h" #include "mxtest/core/BackupTest.h" -#include "mxtest/core/ForwardTest.h" +#include "mxtest/core/BarlineTest.h" #include "mxtest/core/DirectionTest.h" -#include "mxtest/core/PropertiesTest.h" -#include "mxtest/core/HarmonyTest.h" #include "mxtest/core/FiguredBassTest.h" +#include "mxtest/core/ForwardTest.h" +#include "mxtest/core/GroupingTest.h" +#include "mxtest/core/HarmonyTest.h" +#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/MusicDataChoiceTest.h" +#include "mxtest/core/NoteTest.h" #include "mxtest/core/PrintTest.h" +#include "mxtest/core/PropertiesTest.h" #include "mxtest/core/SoundTest.h" -#include "mxtest/core/BarlineTest.h" -#include "mxtest/core/GroupingTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, MusicDataChoice ) +TEST(Test01, MusicDataChoice) { TestMode v = TestMode::one; - MusicDataChoicePtr object = tgenMusicDataChoice( v ); - stringstream expected; - tgenMusicDataChoiceExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MusicDataChoicePtr object = tgenMusicDataChoice(v); + stringstream expected; + tgenMusicDataChoiceExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, MusicDataChoice ) + +TEST(Test02, MusicDataChoice) { TestMode v = TestMode::two; - MusicDataChoicePtr object = tgenMusicDataChoice( v ); - stringstream expected; - tgenMusicDataChoiceExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MusicDataChoicePtr object = tgenMusicDataChoice(v); + stringstream expected; + tgenMusicDataChoiceExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, MusicDataChoice ) + +TEST(Test03, MusicDataChoice) { TestMode v = TestMode::three; - MusicDataChoicePtr object = tgenMusicDataChoice( v ); - stringstream expected; - tgenMusicDataChoiceExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MusicDataChoicePtr object = tgenMusicDataChoice(v); + stringstream expected; + tgenMusicDataChoiceExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - MusicDataChoicePtr tgenMusicDataChoice( TestMode v ) +MusicDataChoicePtr tgenMusicDataChoice(TestMode v) +{ + MusicDataChoicePtr o; + switch (v) { - MusicDataChoicePtr o; - switch ( v ) - { - case TestMode::one: - { - o = makeMusicDataChoice(); - } - break; - case TestMode::two: - { - o = tgenMusicDataChoiceAll( v ); - o->setChoice( MusicDataChoice::Choice::barline ); - } - break; - case TestMode::three: - { - o = tgenMusicDataChoiceAll( v ); - o->setChoice( MusicDataChoice::Choice::figuredBass ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o = makeMusicDataChoice(); + } + break; + case TestMode::two: { + o = tgenMusicDataChoiceAll(v); + o->setChoice(MusicDataChoice::Choice::barline); + } + break; + case TestMode::three: { + o = tgenMusicDataChoiceAll(v); + o->setChoice(MusicDataChoice::Choice::figuredBass); + } + break; + default: + break; } - void tgenMusicDataChoiceExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenMusicDataChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenNoteExpected( os, i, v ); - } - break; - case TestMode::two: - { - tgenBarlineExpected( os, i, v ); - } - break; - case TestMode::three: - { - tgenFiguredBassExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenNoteExpected(os, i, v); } - MusicDataChoicePtr tgenMusicDataChoiceAll( TestMode v ) + break; + case TestMode::two: { + tgenBarlineExpected(os, i, v); + } + break; + case TestMode::three: { + tgenFiguredBassExpected(os, i, v); + } + break; + default: + break; + } +} + +MusicDataChoicePtr tgenMusicDataChoiceAll(TestMode v) +{ + MusicDataChoicePtr o = makeMusicDataChoice(); + /* + + + + + + + + + + + + + + */ + o->setNote(tgenNote(v)); + o->setBackup(tgenBackup(v)); + o->setForward(tgenForward(v)); + o->setDirection(tgenDirection(v)); + o->setProperties(tgenProperties(v)); + o->setHarmony(tgenHarmony(v)); + o->setFiguredBass(tgenFiguredBass(v)); + o->setPrint(tgenPrint(v)); + o->setSound(tgenSound(v)); + o->setBarline(tgenBarline(v)); + o->setGrouping(tgenGrouping(v)); + StringType linkString; + StringType bookmarkString; + switch (v) { - MusicDataChoicePtr o = makeMusicDataChoice(); - /* - - - - - - - - - - - - - - */ - o->setNote( tgenNote( v ) ); - o->setBackup( tgenBackup( v ) ); - o->setForward( tgenForward( v ) ); - o->setDirection( tgenDirection( v ) ); - o->setProperties( tgenProperties( v ) ); - o->setHarmony( tgenHarmony( v ) ); - o->setFiguredBass( tgenFiguredBass( v ) ); - o->setPrint( tgenPrint( v ) ); - o->setSound( tgenSound( v ) ); - o->setBarline( tgenBarline( v ) ); - o->setGrouping( tgenGrouping( v ) ); - StringType linkString; - StringType bookmarkString; - switch ( v ) - { - case TestMode::one: - { - linkString = "linkStringOne"; - bookmarkString = "bookmarkStringOne"; - } - break; - case TestMode::two: - { - linkString = "linkStringTwo"; - bookmarkString = "bookmarkStringTwo"; - } - break; - case TestMode::three: - { - linkString = "linkStringThree"; - bookmarkString = "bookmarkStringThree"; - } - break; - default: - break; - } - LinkPtr link = makeLink(); - BookmarkPtr bookmark = makeBookmark(); - link->getAttributes()->href = XlinkHref( linkString ); - bookmark->getAttributes()->hasName = true; - bookmark->getAttributes()->name = XsToken( bookmarkString ); - o->setLink( link ); - o->setBookmark( bookmark ); - return o; + case TestMode::one: { + linkString = "linkStringOne"; + bookmarkString = "bookmarkStringOne"; + } + break; + case TestMode::two: { + linkString = "linkStringTwo"; + bookmarkString = "bookmarkStringTwo"; + } + break; + case TestMode::three: { + linkString = "linkStringThree"; + bookmarkString = "bookmarkStringThree"; + } + break; + default: + break; } + LinkPtr link = makeLink(); + BookmarkPtr bookmark = makeBookmark(); + link->getAttributes()->href = XlinkHref(linkString); + bookmark->getAttributes()->hasName = true; + bookmark->getAttributes()->name = XsToken(bookmarkString); + o->setLink(link); + o->setBookmark(bookmark); + return o; } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MusicDataChoiceTest.h b/Sourcecode/private/mxtest/core/MusicDataChoiceTest.h index 510521b17..19b149617 100644 --- a/Sourcecode/private/mxtest/core/MusicDataChoiceTest.h +++ b/Sourcecode/private/mxtest/core/MusicDataChoiceTest.h @@ -6,14 +6,14 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::MusicDataChoicePtr tgenMusicDataChoice( TestMode v ); - mx::core::MusicDataChoicePtr tgenMusicDataChoiceAll( TestMode v ); - void tgenMusicDataChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::MusicDataChoicePtr tgenMusicDataChoice(TestMode v); +mx::core::MusicDataChoicePtr tgenMusicDataChoiceAll(TestMode v); +void tgenMusicDataChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MusicDataGroupTest.cpp b/Sourcecode/private/mxtest/core/MusicDataGroupTest.cpp index 9abaaec3e..ead1212f1 100644 --- a/Sourcecode/private/mxtest/core/MusicDataGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/MusicDataGroupTest.cpp @@ -6,226 +6,220 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/MusicDataGroupTest.h" -#include "mxtest/core/MusicDataChoiceTest.h" -#include "mxtest/core/NoteTest.h" #include "mxtest/core/BackupTest.h" -#include "mxtest/core/ForwardTest.h" +#include "mxtest/core/BarlineTest.h" #include "mxtest/core/DirectionTest.h" -#include "mxtest/core/PropertiesTest.h" -#include "mxtest/core/HarmonyTest.h" #include "mxtest/core/FiguredBassTest.h" +#include "mxtest/core/ForwardTest.h" +#include "mxtest/core/GroupingTest.h" +#include "mxtest/core/HarmonyTest.h" +#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/MusicDataChoiceTest.h" +#include "mxtest/core/MusicDataGroupTest.h" +#include "mxtest/core/NoteTest.h" #include "mxtest/core/PrintTest.h" +#include "mxtest/core/PropertiesTest.h" #include "mxtest/core/SoundTest.h" -#include "mxtest/core/BarlineTest.h" -#include "mxtest/core/GroupingTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, MusicDataGroup ) +TEST(Test01, MusicDataGroup) { TestMode v = TestMode::one; - MusicDataGroupPtr object = tgenMusicDataGroup( v ); - stringstream expected; - tgenMusicDataGroupExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + MusicDataGroupPtr object = tgenMusicDataGroup(v); + stringstream expected; + tgenMusicDataGroupExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, MusicDataGroup ) + +TEST(Test02, MusicDataGroup) { TestMode v = TestMode::two; - MusicDataGroupPtr object = tgenMusicDataGroup( v ); - stringstream expected; - tgenMusicDataGroupExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MusicDataGroupPtr object = tgenMusicDataGroup(v); + stringstream expected; + tgenMusicDataGroupExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, MusicDataGroup ) + +TEST(Test03, MusicDataGroup) { TestMode v = TestMode::three; - MusicDataGroupPtr object = tgenMusicDataGroup( v ); - stringstream expected; - tgenMusicDataGroupExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + MusicDataGroupPtr object = tgenMusicDataGroup(v); + stringstream expected; + tgenMusicDataGroupExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - MusicDataGroupPtr tgenMusicDataGroup( TestMode v ) +MusicDataGroupPtr tgenMusicDataGroup(TestMode v) +{ + MusicDataGroupPtr o = makeMusicDataGroup(); + switch (v) { - MusicDataGroupPtr o = makeMusicDataGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - /* - - - - - - - - - - - - */ - auto x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::note ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::forward ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::properties ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::figuredBass ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::sound ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::grouping ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::bookmark ); - o->addMusicDataChoice( x ); - x.reset(); - } - break; - case TestMode::three: - { - /* - - - - - - - - - - - - */ - auto x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::backup ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::direction ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::harmony ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::print ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::barline ); - o->addMusicDataChoice( x ); - x.reset(); - - x = tgenMusicDataChoiceAll( v ); - x->setChoice( MusicDataChoice::Choice::link ); - o->addMusicDataChoice( x ); - x.reset(); - } - break; - default: - break; - } - return o; + case TestMode::one: { } - void tgenMusicDataGroupExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::two: { + /* + + + + + + + + + + + + */ + auto x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::note); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::forward); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::properties); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::figuredBass); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::sound); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::grouping); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::bookmark); + o->addMusicDataChoice(x); + x.reset(); + } + break; + case TestMode::three: { + /* + + + + + + + + + + + + */ + auto x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::backup); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::direction); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::harmony); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::print); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::barline); + o->addMusicDataChoice(x); + x.reset(); + + x = tgenMusicDataChoiceAll(v); + x->setChoice(MusicDataChoice::Choice::link); + o->addMusicDataChoice(x); + x.reset(); + } + break; + default: + break; + } + return o; +} + +void tgenMusicDataGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - tgenNoteExpected( os, i, v ); - os << std::endl; - tgenForwardExpected( os, i, v ); - os << std::endl; - tgenPropertiesExpected( os, i, v ); - os << std::endl; - tgenFiguredBassExpected( os, i, v ); - os << std::endl; - tgenSoundExpected( os, i, v ); - os << std::endl; - tgenGroupingExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - tgenBackupExpected( os, i, v ); - os << std::endl; - tgenDirectionExpected( os, i, v ); - os << std::endl; - tgenHarmonyExpected( os, i, v ); - os << std::endl; - tgenPrintExpected( os, i, v ); - os << std::endl; - tgenBarlineExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + } + break; + case TestMode::two: { + tgenNoteExpected(os, i, v); + os << std::endl; + tgenForwardExpected(os, i, v); + os << std::endl; + tgenPropertiesExpected(os, i, v); + os << std::endl; + tgenFiguredBassExpected(os, i, v); + os << std::endl; + tgenSoundExpected(os, i, v); + os << std::endl; + tgenGroupingExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + tgenBackupExpected(os, i, v); + os << std::endl; + tgenDirectionExpected(os, i, v); + os << std::endl; + tgenHarmonyExpected(os, i, v); + os << std::endl; + tgenPrintExpected(os, i, v); + os << std::endl; + tgenBarlineExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MusicDataGroupTest.h b/Sourcecode/private/mxtest/core/MusicDataGroupTest.h index 056e9a290..e77ad6170 100644 --- a/Sourcecode/private/mxtest/core/MusicDataGroupTest.h +++ b/Sourcecode/private/mxtest/core/MusicDataGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::MusicDataGroupPtr tgenMusicDataGroup( TestMode v ); - void tgenMusicDataGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::MusicDataGroupPtr tgenMusicDataGroup(TestMode v); +void tgenMusicDataGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/MusicFontTest.cpp b/Sourcecode/private/mxtest/core/MusicFontTest.cpp index 1c3aca219..da3668cf8 100644 --- a/Sourcecode/private/mxtest/core/MusicFontTest.cpp +++ b/Sourcecode/private/mxtest/core/MusicFontTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, MusicFont ) +TEST(Test01, MusicFont) { - std::string indentString( INDENT ); - MusicFont object1; - MusicFont object2; - EmptyFontAttributesPtr attributes1 = std::make_shared(); - EmptyFontAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + MusicFont object1; + MusicFont object2; + EmptyFontAttributesPtr attributes1 = std::make_shared(); + EmptyFontAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/MuteTest.cpp b/Sourcecode/private/mxtest/core/MuteTest.cpp index 4f943d5e4..762e923e7 100644 --- a/Sourcecode/private/mxtest/core/MuteTest.cpp +++ b/Sourcecode/private/mxtest/core/MuteTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Mute ) +TEST(Test01, Mute) { - std::string indentString( INDENT ); - MuteEnum value1 = MuteEnum::harmonNoStem; - MuteEnum value2 = MuteEnum::straight; - Mute object1; - Mute object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(off)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(straight)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + MuteEnum value1 = MuteEnum::harmonNoStem; + MuteEnum value2 = MuteEnum::straight; + Mute object1; + Mute object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(off)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(straight)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/NaturalTest.cpp b/Sourcecode/private/mxtest/core/NaturalTest.cpp index dc9ed8591..420d869e3 100644 --- a/Sourcecode/private/mxtest/core/NaturalTest.cpp +++ b/Sourcecode/private/mxtest/core/NaturalTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, Natural ) +TEST(Test01, Natural) { - std::string indentString( INDENT ); - Natural object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Natural object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif \ No newline at end of file diff --git a/Sourcecode/private/mxtest/core/NonArpeggiateTest.cpp b/Sourcecode/private/mxtest/core/NonArpeggiateTest.cpp index 2b34316d7..5b01dd1e1 100644 --- a/Sourcecode/private/mxtest/core/NonArpeggiateTest.cpp +++ b/Sourcecode/private/mxtest/core/NonArpeggiateTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, NonArpeggiate ) +TEST(Test01, NonArpeggiate) { - std::string indentString( INDENT ); - NonArpeggiate object1; - NonArpeggiate object2; - NonArpeggiateAttributesPtr attributes1 = std::make_shared(); - NonArpeggiateAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + NonArpeggiate object1; + NonArpeggiate object2; + NonArpeggiateAttributesPtr attributes1 = std::make_shared(); + NonArpeggiateAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->number = NumberLevel{2}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/NormalDotTest.cpp b/Sourcecode/private/mxtest/core/NormalDotTest.cpp index 6051444a0..225550f57 100644 --- a/Sourcecode/private/mxtest/core/NormalDotTest.cpp +++ b/Sourcecode/private/mxtest/core/NormalDotTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, NormalDot ) +TEST(Test01, NormalDot) { - std::string indentString( INDENT ); - NormalDot object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + NormalDot object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/NormalNoteGroupTest.cpp b/Sourcecode/private/mxtest/core/NormalNoteGroupTest.cpp index 447ca8c22..012185040 100644 --- a/Sourcecode/private/mxtest/core/NormalNoteGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/NormalNoteGroupTest.cpp @@ -6,125 +6,121 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/FullNoteGroupTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/NormalNoteGroupTest.h" -#include "mxtest/core/FullNoteGroupTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, NormalNoteGroup ) +TEST(Test01, NormalNoteGroup) { TestMode v = TestMode::one; - NormalNoteGroupPtr object = tgenNormalNoteGroup( v ); - stringstream expected; - tgenNormalNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NormalNoteGroupPtr object = tgenNormalNoteGroup(v); + stringstream expected; + tgenNormalNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, NormalNoteGroup ) + +TEST(Test02, NormalNoteGroup) { TestMode v = TestMode::two; - NormalNoteGroupPtr object = tgenNormalNoteGroup( v ); - stringstream expected; - tgenNormalNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NormalNoteGroupPtr object = tgenNormalNoteGroup(v); + stringstream expected; + tgenNormalNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, NormalNoteGroup ) + +TEST(Test03, NormalNoteGroup) { TestMode v = TestMode::three; - NormalNoteGroupPtr object = tgenNormalNoteGroup( v ); - stringstream expected; - tgenNormalNoteGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NormalNoteGroupPtr object = tgenNormalNoteGroup(v); + stringstream expected; + tgenNormalNoteGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - NormalNoteGroupPtr tgenNormalNoteGroup( TestMode v ) +NormalNoteGroupPtr tgenNormalNoteGroup(TestMode v) +{ + NormalNoteGroupPtr o = makeNormalNoteGroup(); + switch (v) { - NormalNoteGroupPtr o = makeNormalNoteGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setFullNoteGroup( tgenFullNoteGroup( v ) ); - auto start = makeTie(); - start->getAttributes()->type = StartStop::start; - auto stop = makeTie(); - stop->getAttributes()->type = StartStop::stop; - o->addTie( start ); - o->addTie( stop ); - o->addTie( stop ); // has no affect // - o->getDuration()->setValue( PositiveDivisionsValue( 456 ) ); - } - break; - case TestMode::three: - { - o->setFullNoteGroup( tgenFullNoteGroup( v ) ); - o->getDuration()->setValue( PositiveDivisionsValue( 654 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setFullNoteGroup(tgenFullNoteGroup(v)); + auto start = makeTie(); + start->getAttributes()->type = StartStop::start; + auto stop = makeTie(); + stop->getAttributes()->type = StartStop::stop; + o->addTie(start); + o->addTie(stop); + o->addTie(stop); // has no affect // + o->getDuration()->setValue(PositiveDivisionsValue(456)); + } + break; + case TestMode::three: { + o->setFullNoteGroup(tgenFullNoteGroup(v)); + o->getDuration()->setValue(PositiveDivisionsValue(654)); + } + break; + default: + break; } - void tgenNormalNoteGroupExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenNormalNoteGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenFullNoteGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(1)", false ); - } - break; - case TestMode::two: - { - tgenFullNoteGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(456)" ); - streamLine( os, i, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - tgenFullNoteGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(654)", false ); - } - break; - default: - break; - } + case TestMode::one: { + tgenFullNoteGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(1)", false); + } + break; + case TestMode::two: { + tgenFullNoteGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(456)"); + streamLine(os, i, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + tgenFullNoteGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(654)", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NormalNoteGroupTest.h b/Sourcecode/private/mxtest/core/NormalNoteGroupTest.h index 3940724cd..968017562 100644 --- a/Sourcecode/private/mxtest/core/NormalNoteGroupTest.h +++ b/Sourcecode/private/mxtest/core/NormalNoteGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::NormalNoteGroupPtr tgenNormalNoteGroup( TestMode v ); - void tgenNormalNoteGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::NormalNoteGroupPtr tgenNormalNoteGroup(TestMode v); +void tgenNormalNoteGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NormalNotesTest.cpp b/Sourcecode/private/mxtest/core/NormalNotesTest.cpp index 98be9d01e..d8c31f806 100644 --- a/Sourcecode/private/mxtest/core/NormalNotesTest.cpp +++ b/Sourcecode/private/mxtest/core/NormalNotesTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, NormalNotes ) +TEST(Test01, NormalNotes) { - std::string indentString( INDENT ); - NonNegativeInteger value1{ 2 }; - NonNegativeInteger value2{ 3 }; - NormalNotes object1; - NormalNotes object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NonNegativeInteger value1{2}; + NonNegativeInteger value2{3}; + NormalNotes object1; + NormalNotes object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/NormalTypeTest.cpp b/Sourcecode/private/mxtest/core/NormalTypeTest.cpp index 758d5d7a5..99a829332 100644 --- a/Sourcecode/private/mxtest/core/NormalTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/NormalTypeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, NormalType ) +TEST(Test01, NormalType) { - std::string indentString( INDENT ); - NoteTypeValue value1 = NoteTypeValue::quarter; - NoteTypeValue value2 = NoteTypeValue::whole; - NormalType object1; - NormalType object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(eighth)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(whole)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NoteTypeValue value1 = NoteTypeValue::quarter; + NoteTypeValue value2 = NoteTypeValue::whole; + NormalType object1; + NormalType object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(eighth)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(whole)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/NotationsChoiceTest.cpp b/Sourcecode/private/mxtest/core/NotationsChoiceTest.cpp index 5f943d18a..5029782ce 100644 --- a/Sourcecode/private/mxtest/core/NotationsChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/NotationsChoiceTest.cpp @@ -6,137 +6,135 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/ArticulationsTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/NotationsChoiceTest.h" -#include "mxtest/core/TupletTest.h" #include "mxtest/core/OrnamentsTest.h" #include "mxtest/core/TechnicalTest.h" -#include "mxtest/core/ArticulationsTest.h" +#include "mxtest/core/TupletTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, NotationsChoice ) +TEST(Test01, NotationsChoice) { TestMode v = TestMode::one; - NotationsChoicePtr object = tgenNotationsChoice( v ); - stringstream expected; - tgenNotationsChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NotationsChoicePtr object = tgenNotationsChoice(v); + stringstream expected; + tgenNotationsChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, NotationsChoice ) + +TEST(Test02, NotationsChoice) { TestMode v = TestMode::two; - NotationsChoicePtr object = tgenNotationsChoice( v ); - stringstream expected; - tgenNotationsChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NotationsChoicePtr object = tgenNotationsChoice(v); + stringstream expected; + tgenNotationsChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, NotationsChoice ) + +TEST(Test03, NotationsChoice) { TestMode v = TestMode::three; - NotationsChoicePtr object = tgenNotationsChoice( v ); - stringstream expected; - tgenNotationsChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NotationsChoicePtr object = tgenNotationsChoice(v); + stringstream expected; + tgenNotationsChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - NotationsChoicePtr tgenNotationsChoice( TestMode v ) +NotationsChoicePtr tgenNotationsChoice(TestMode v) +{ + NotationsChoicePtr o; + switch (v) { - NotationsChoicePtr o; - switch ( v ) - { - case TestMode::one: - { - o = makeNotationsChoice(); - } - break; - case TestMode::two: - { - o = tgenNotationsChoice(); - o->setChoice( NotationsChoice::Choice::dynamics ); - } - break; - case TestMode::three: - { - o = tgenNotationsChoice(); - o->setChoice( NotationsChoice::Choice::technical ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o = makeNotationsChoice(); } - void tgenNotationsChoiceExpected(std::ostream& os, int i, TestMode v ) - { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - tgenTechnicalExpected(os, i, TestMode::two ); - } - break; - default: - break; - } + break; + case TestMode::two: { + o = tgenNotationsChoice(); + o->setChoice(NotationsChoice::Choice::dynamics); + } + break; + case TestMode::three: { + o = tgenNotationsChoice(); + o->setChoice(NotationsChoice::Choice::technical); + } + break; + default: + break; } - NotationsChoicePtr tgenNotationsChoice() + return o; +} + +void tgenNotationsChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - NotationsChoicePtr o = makeNotationsChoice(); - o->getTied()->getAttributes()->hasBezierOffset = true; - o->getTied()->getAttributes()->bezierOffset = DivisionsValue( 2.2 ); - o->getSlur()->getAttributes()->hasBezierOffset2 = true; - o->getSlur()->getAttributes()->bezierOffset2 = DivisionsValue( 3.1 ); - o->setTuplet( tgenTuplet( TestMode::two ) ); - o->getGlissando()->setValue( XsString( "Weeee" ) ); - o->getSlide()->setValue( XsString( "Geronamo?" ) ); - o->setOrnaments( tgenOrnaments( TestMode::three ) ); - o->setTechnical( tgenTechnical( TestMode::two ) ); - o->setArticulations( tgenArticulations( TestMode::three ) ); - o->getDynamics()->setValue( DynamicsValue( DynamicsEnum::fz ) ); - o->getFermata()->setValue( FermataShape::square ); - o->getArpeggiate()->getAttributes()->hasNumber = true; - o->getArpeggiate()->getAttributes()->number = NumberLevel( 3 ); - o->getNonArpeggiate()->getAttributes()->type = TopBottom::bottom; - o->getAccidentalMark()->setValue( AccidentalValue::flatFlat ); - o->getOtherNotation()->setValue( XsString( "yo mamma" ) ); - return o; + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); } + break; + case TestMode::three: { + tgenTechnicalExpected(os, i, TestMode::two); + } + break; + default: + break; + } +} + +NotationsChoicePtr tgenNotationsChoice() +{ + NotationsChoicePtr o = makeNotationsChoice(); + o->getTied()->getAttributes()->hasBezierOffset = true; + o->getTied()->getAttributes()->bezierOffset = DivisionsValue(2.2); + o->getSlur()->getAttributes()->hasBezierOffset2 = true; + o->getSlur()->getAttributes()->bezierOffset2 = DivisionsValue(3.1); + o->setTuplet(tgenTuplet(TestMode::two)); + o->getGlissando()->setValue(XsString("Weeee")); + o->getSlide()->setValue(XsString("Geronamo?")); + o->setOrnaments(tgenOrnaments(TestMode::three)); + o->setTechnical(tgenTechnical(TestMode::two)); + o->setArticulations(tgenArticulations(TestMode::three)); + o->getDynamics()->setValue(DynamicsValue(DynamicsEnum::fz)); + o->getFermata()->setValue(FermataShape::square); + o->getArpeggiate()->getAttributes()->hasNumber = true; + o->getArpeggiate()->getAttributes()->number = NumberLevel(3); + o->getNonArpeggiate()->getAttributes()->type = TopBottom::bottom; + o->getAccidentalMark()->setValue(AccidentalValue::flatFlat); + o->getOtherNotation()->setValue(XsString("yo mamma")); + return o; } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NotationsChoiceTest.h b/Sourcecode/private/mxtest/core/NotationsChoiceTest.h index 3b05e95e7..b31d4795e 100644 --- a/Sourcecode/private/mxtest/core/NotationsChoiceTest.h +++ b/Sourcecode/private/mxtest/core/NotationsChoiceTest.h @@ -6,14 +6,14 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::NotationsChoicePtr tgenNotationsChoice(); /* fully loaded with data */ - mx::core::NotationsChoicePtr tgenNotationsChoice( TestMode v ); - void tgenNotationsChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::NotationsChoicePtr tgenNotationsChoice(); /* fully loaded with data */ +mx::core::NotationsChoicePtr tgenNotationsChoice(TestMode v); +void tgenNotationsChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NotationsTest.cpp b/Sourcecode/private/mxtest/core/NotationsTest.cpp index acb946ffd..754c0ac5e 100644 --- a/Sourcecode/private/mxtest/core/NotationsTest.cpp +++ b/Sourcecode/private/mxtest/core/NotationsTest.cpp @@ -6,205 +6,199 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/ArticulationsTest.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/NotationsTest.h" #include "mxtest/core/NotationsChoiceTest.h" -#include "mxtest/core/TupletTest.h" +#include "mxtest/core/NotationsTest.h" #include "mxtest/core/OrnamentsTest.h" #include "mxtest/core/TechnicalTest.h" -#include "mxtest/core/ArticulationsTest.h" +#include "mxtest/core/TupletTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Notations ) +TEST(Test01, Notations) { TestMode v = TestMode::one; - NotationsPtr object = tgenNotations( v ); - stringstream expected; - tgenNotationsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + NotationsPtr object = tgenNotations(v); + stringstream expected; + tgenNotationsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Notations ) + +TEST(Test02, Notations) { TestMode v = TestMode::two; - NotationsPtr object = tgenNotations( v ); - stringstream expected; - tgenNotationsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + NotationsPtr object = tgenNotations(v); + stringstream expected; + tgenNotationsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Notations ) + +TEST(Test03, Notations) { TestMode v = TestMode::three; - NotationsPtr object = tgenNotations( v ); - stringstream expected; - tgenNotationsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + NotationsPtr object = tgenNotations(v); + stringstream expected; + tgenNotationsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - NotationsPtr tgenNotations( TestMode v ) +NotationsPtr tgenNotations(TestMode v) +{ + NotationsPtr o = makeNotations(); + switch (v) { - NotationsPtr o = makeNotations(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::yes; - - auto n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::tied ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::slur ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::tuplet ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::glissando ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::slide ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::ornaments ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::technical ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::articulations ); - o->addNotationsChoice( n ); - n.reset(); - - } - break; - case TestMode::three: - { - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::no; - - auto n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::dynamics ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::fermata ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::arpeggiate ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::nonArpeggiate ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::accidentalMark ); - o->addNotationsChoice( n ); - n.reset(); - - n = tgenNotationsChoice(); - n->setChoice( NotationsChoice::Choice::otherNotation ); - o->addNotationsChoice( n ); - n.reset(); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::yes; + + auto n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::tied); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::slur); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::tuplet); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::glissando); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::slide); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::ornaments); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::technical); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::articulations); + o->addNotationsChoice(n); + n.reset(); + } + break; + case TestMode::three: { + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::no; + + auto n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::dynamics); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::fermata); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::arpeggiate); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::nonArpeggiate); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::accidentalMark); + o->addNotationsChoice(n); + n.reset(); + + n = tgenNotationsChoice(); + n->setChoice(NotationsChoice::Choice::otherNotation); + o->addNotationsChoice(n); + n.reset(); + } + break; + default: + break; } - void tgenNotationsExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenNotationsExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - tgenTupletExpected(os, i+1, TestMode::two ); - os << std::endl; - streamLine( os, i+1, R"(Weeee)" ); - streamLine( os, i+1, R"(Geronamo?)" ); - tgenOrnamentsExpected(os, i+1, TestMode::three ); - os << std::endl; - tgenTechnicalExpected(os, i+1, TestMode::two ); - os << std::endl; - tgenArticulationsExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(square)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(flat-flat)" ); - streamLine( os, i+1, R"(yo mamma)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + tgenTupletExpected(os, i + 1, TestMode::two); + os << std::endl; + streamLine(os, i + 1, R"(Weeee)"); + streamLine(os, i + 1, R"(Geronamo?)"); + tgenOrnamentsExpected(os, i + 1, TestMode::three); + os << std::endl; + tgenTechnicalExpected(os, i + 1, TestMode::two); + os << std::endl; + tgenArticulationsExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(square)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(flat-flat)"); + streamLine(os, i + 1, R"(yo mamma)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/NotationsTest.h b/Sourcecode/private/mxtest/core/NotationsTest.h index 8baae1806..074861f22 100644 --- a/Sourcecode/private/mxtest/core/NotationsTest.h +++ b/Sourcecode/private/mxtest/core/NotationsTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::NotationsPtr tgenNotations( TestMode v ); - void tgenNotationsExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::NotationsPtr tgenNotations(TestMode v); +void tgenNotationsExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NoteChoiceTest.cpp b/Sourcecode/private/mxtest/core/NoteChoiceTest.cpp index 96dc6cbfc..1ae0e7114 100644 --- a/Sourcecode/private/mxtest/core/NoteChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/NoteChoiceTest.cpp @@ -6,114 +6,111 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/NoteChoiceTest.h" +#include "mxtest/core/CueNoteGroupTest.h" #include "mxtest/core/FullNoteGroupTest.h" #include "mxtest/core/GraceNoteGroupTest.h" -#include "mxtest/core/CueNoteGroupTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/NormalNoteGroupTest.h" +#include "mxtest/core/NoteChoiceTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, NoteChoice ) +TEST(Test01, NoteChoice) { TestMode v = TestMode::one; - NoteChoicePtr object = tgenNoteChoice( v ); - stringstream expected; - tgenNoteChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NoteChoicePtr object = tgenNoteChoice(v); + stringstream expected; + tgenNoteChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, NoteChoice ) + +TEST(Test02, NoteChoice) { TestMode v = TestMode::two; - NoteChoicePtr object = tgenNoteChoice( v ); - stringstream expected; - tgenNoteChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NoteChoicePtr object = tgenNoteChoice(v); + stringstream expected; + tgenNoteChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, NoteChoice ) + +TEST(Test03, NoteChoice) { TestMode v = TestMode::three; - NoteChoicePtr object = tgenNoteChoice( v ); - stringstream expected; - tgenNoteChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + NoteChoicePtr object = tgenNoteChoice(v); + stringstream expected; + tgenNoteChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - NoteChoicePtr tgenNoteChoice( TestMode v ) +NoteChoicePtr tgenNoteChoice(TestMode v) +{ + NoteChoicePtr o = makeNoteChoice(); + switch (v) { - NoteChoicePtr o = makeNoteChoice(); - switch ( v ) - { - case TestMode::one: - { - o->setChoice( NoteChoice::Choice::normal ); - o->setNormalNoteGroup( tgenNormalNoteGroup( v ) ); - } - break; - case TestMode::two: - { - o->setChoice( NoteChoice::Choice::grace ); - o->setGraceNoteGroup( tgenGraceNoteGroup( v ) ); - } - break; - case TestMode::three: - { - o->setChoice( NoteChoice::Choice::cue ); - o->setCueNoteGroup( tgenCueNoteGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setChoice(NoteChoice::Choice::normal); + o->setNormalNoteGroup(tgenNormalNoteGroup(v)); + } + break; + case TestMode::two: { + o->setChoice(NoteChoice::Choice::grace); + o->setGraceNoteGroup(tgenGraceNoteGroup(v)); } - void tgenNoteChoiceExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->setChoice(NoteChoice::Choice::cue); + o->setCueNoteGroup(tgenCueNoteGroup(v)); + } + break; + default: + break; + } + return o; +} + +void tgenNoteChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenNormalNoteGroupExpected( os, i, v ); - } - break; - case TestMode::two: - { - tgenGraceNoteGroupExpected( os, i, v ); - } - break; - case TestMode::three: - { - tgenCueNoteGroupExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenNormalNoteGroupExpected(os, i, v); + } + break; + case TestMode::two: { + tgenGraceNoteGroupExpected(os, i, v); + } + break; + case TestMode::three: { + tgenCueNoteGroupExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NoteChoiceTest.h b/Sourcecode/private/mxtest/core/NoteChoiceTest.h index f5e2666d8..4ee4bf46b 100644 --- a/Sourcecode/private/mxtest/core/NoteChoiceTest.h +++ b/Sourcecode/private/mxtest/core/NoteChoiceTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::NoteChoicePtr tgenNoteChoice( TestMode v ); - void tgenNoteChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::NoteChoicePtr tgenNoteChoice(TestMode v); +void tgenNoteChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NoteSizeTest.cpp b/Sourcecode/private/mxtest/core/NoteSizeTest.cpp index 371806ee7..b9215d26f 100644 --- a/Sourcecode/private/mxtest/core/NoteSizeTest.cpp +++ b/Sourcecode/private/mxtest/core/NoteSizeTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, NoteSize ) +TEST(Test01, NoteSize) { - std::string indentString( INDENT ); - NonNegativeDecimal value1{ 2 }; - NonNegativeDecimal value2{ 3 }; - NoteSize object1; - NoteSize object2( value2 ); - NoteSizeAttributesPtr attributes1 = std::make_shared(); - NoteSizeAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + NonNegativeDecimal value1{2}; + NonNegativeDecimal value2{3}; + NoteSize object1; + NoteSize object2(value2); + NoteSizeAttributesPtr attributes1 = std::make_shared(); + NoteSizeAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->type = NoteSizeType::grace; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/NoteTest.cpp b/Sourcecode/private/mxtest/core/NoteTest.cpp index 70c25d42f..717fba604 100644 --- a/Sourcecode/private/mxtest/core/NoteTest.cpp +++ b/Sourcecode/private/mxtest/core/NoteTest.cpp @@ -6,194 +6,190 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/EditorialVoiceGroupTest.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/NoteTest.h" +#include "mxtest/core/LyricTest.h" +#include "mxtest/core/NotationsTest.h" #include "mxtest/core/NoteChoiceTest.h" -#include "mxtest/core/EditorialVoiceGroupTest.h" -#include "mxtest/core/TimeModificationTest.h" +#include "mxtest/core/NoteTest.h" #include "mxtest/core/NoteheadTextTest.h" -#include "mxtest/core/NotationsTest.h" -#include "mxtest/core/LyricTest.h" #include "mxtest/core/PlayTest.h" +#include "mxtest/core/TimeModificationTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Note ) +TEST(Test01, Note) { TestMode v = TestMode::one; - NotePtr object = tgenNote( v ); - stringstream expected; - tgenNoteExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + NotePtr object = tgenNote(v); + stringstream expected; + tgenNoteExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Note ) + +TEST(Test02, Note) { TestMode v = TestMode::two; - NotePtr object = tgenNote( v ); - stringstream expected; - tgenNoteExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + NotePtr object = tgenNote(v); + stringstream expected; + tgenNoteExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Note ) + +TEST(Test03, Note) { TestMode v = TestMode::three; - NotePtr object = tgenNote( v ); - stringstream expected; - tgenNoteExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + NotePtr object = tgenNote(v); + stringstream expected; + tgenNoteExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - NotePtr tgenNote( TestMode v ) +NotePtr tgenNote(TestMode v) +{ + NotePtr o = makeNote(); + switch (v) { - NotePtr o = makeNote(); - switch ( v ) - { - case TestMode::one: - { - o->setNoteChoice( tgenNoteChoice( v ) ); - } - break; - case TestMode::two: - { - o->getAttributes()->hasAttack = true; - o->getAttributes()->attack = DivisionsValue( 33 ); - o->getAttributes()->hasDynamics = true; - o->getAttributes()->dynamics = NonNegativeDecimal( 126.99 ); - o->setNoteChoice( tgenNoteChoice( v ) ); - o->getInstrument()->getAttributes()->id = XsIDREF( "I01" ); - o->setHasInstrument( true ); - o->setEditorialVoiceGroup( tgenEditorialVoiceGroup( v ) ); - o->setHasType( true ); - o->getType()->setValue( NoteTypeValue::quarter ); - o->addDot( makeDot() ); - o->addDot( makeDot() ); - o->setHasAccidental( true ); - o->getAccidental()->setValue( AccidentalValue::natural ); - o->setHasTimeModification( true ); - o->setTimeModification( tgenTimeModification( v ) ); - o->addBeam( makeBeam() ); - o->getBeam( o->getBeamSet().cbegin() )->setValue( BeamValue::backwardHook ); - o->addNotations( tgenNotations( v ) ); - o->addLyric( tgenLyric( v ) ); - o->addLyric( tgenLyric( TestMode::one ) ); - o->setHasPlay( true ); - o->setPlay( tgenPlay( v ) ); - } - break; - case TestMode::three: - { - o->setNoteChoice( tgenNoteChoice( v ) ); - o->getAttributes()->hasColor = true; - o->getAttributes()->color = Color( 1, 2, 3 ); - o->getAttributes()->hasPizzicato = true; - o->getAttributes()->pizzicato = YesNo::yes; - o->getInstrument()->getAttributes()->id = XsIDREF( "X987S87F987" ); - o->setHasInstrument( true ); - o->setEditorialVoiceGroup( tgenEditorialVoiceGroup( v ) ); - o->setHasType( true ); - o->getType()->setValue( NoteTypeValue::eighth ); - o->setHasAccidental( true ); - o->getAccidental()->setValue( AccidentalValue::sharpUp ); - o->setHasTimeModification( true ); - o->setTimeModification( tgenTimeModification( v ) ); - o->addNotations( tgenNotations( v ) ); - o->addNotations( tgenNotations( TestMode::one ) ); - o->addLyric( tgenLyric( v ) ); - o->setHasPlay( true ); - o->setPlay( tgenPlay( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setNoteChoice(tgenNoteChoice(v)); + } + break; + case TestMode::two: { + o->getAttributes()->hasAttack = true; + o->getAttributes()->attack = DivisionsValue(33); + o->getAttributes()->hasDynamics = true; + o->getAttributes()->dynamics = NonNegativeDecimal(126.99); + o->setNoteChoice(tgenNoteChoice(v)); + o->getInstrument()->getAttributes()->id = XsIDREF("I01"); + o->setHasInstrument(true); + o->setEditorialVoiceGroup(tgenEditorialVoiceGroup(v)); + o->setHasType(true); + o->getType()->setValue(NoteTypeValue::quarter); + o->addDot(makeDot()); + o->addDot(makeDot()); + o->setHasAccidental(true); + o->getAccidental()->setValue(AccidentalValue::natural); + o->setHasTimeModification(true); + o->setTimeModification(tgenTimeModification(v)); + o->addBeam(makeBeam()); + o->getBeam(o->getBeamSet().cbegin())->setValue(BeamValue::backwardHook); + o->addNotations(tgenNotations(v)); + o->addLyric(tgenLyric(v)); + o->addLyric(tgenLyric(TestMode::one)); + o->setHasPlay(true); + o->setPlay(tgenPlay(v)); + } + break; + case TestMode::three: { + o->setNoteChoice(tgenNoteChoice(v)); + o->getAttributes()->hasColor = true; + o->getAttributes()->color = Color(1, 2, 3); + o->getAttributes()->hasPizzicato = true; + o->getAttributes()->pizzicato = YesNo::yes; + o->getInstrument()->getAttributes()->id = XsIDREF("X987S87F987"); + o->setHasInstrument(true); + o->setEditorialVoiceGroup(tgenEditorialVoiceGroup(v)); + o->setHasType(true); + o->getType()->setValue(NoteTypeValue::eighth); + o->setHasAccidental(true); + o->getAccidental()->setValue(AccidentalValue::sharpUp); + o->setHasTimeModification(true); + o->setTimeModification(tgenTimeModification(v)); + o->addNotations(tgenNotations(v)); + o->addNotations(tgenNotations(TestMode::one)); + o->addLyric(tgenLyric(v)); + o->setHasPlay(true); + o->setPlay(tgenPlay(v)); } - void tgenNoteExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenNoteExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenNoteChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenNoteChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"()" ); - tgenEditorialVoiceGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(quarter)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(natural)" ); - tgenTimeModificationExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(backward hook)" ); - tgenNotationsExpected( os, i+1, v ); - os << std::endl; - tgenLyricExpected( os, i+1, v ); - os << std::endl; - tgenLyricExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenPlayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenNoteChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"()" ); - tgenEditorialVoiceGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(eighth)" ); - streamLine( os, i+1, R"(sharp-up)" ); - tgenTimeModificationExpected( os, i+1, v ); - os << std::endl; - tgenNotationsExpected( os, i+1, v ); - os << std::endl; - tgenNotationsExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenLyricExpected( os, i+1, v ); - os << std::endl; - tgenPlayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenNoteChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenNoteChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + tgenEditorialVoiceGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(quarter)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(natural)"); + tgenTimeModificationExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(backward hook)"); + tgenNotationsExpected(os, i + 1, v); + os << std::endl; + tgenLyricExpected(os, i + 1, v); + os << std::endl; + tgenLyricExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenPlayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenNoteChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"()"); + tgenEditorialVoiceGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(eighth)"); + streamLine(os, i + 1, R"(sharp-up)"); + tgenTimeModificationExpected(os, i + 1, v); + os << std::endl; + tgenNotationsExpected(os, i + 1, v); + os << std::endl; + tgenNotationsExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenLyricExpected(os, i + 1, v); + os << std::endl; + tgenPlayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/NoteTest.h b/Sourcecode/private/mxtest/core/NoteTest.h index d9597a24f..b0888b6d5 100644 --- a/Sourcecode/private/mxtest/core/NoteTest.h +++ b/Sourcecode/private/mxtest/core/NoteTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::NotePtr tgenNote( TestMode v ); - void tgenNoteExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::NotePtr tgenNote(TestMode v); +void tgenNoteExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NoteheadTest.cpp b/Sourcecode/private/mxtest/core/NoteheadTest.cpp index b43201b88..9bd40a2ce 100644 --- a/Sourcecode/private/mxtest/core/NoteheadTest.cpp +++ b/Sourcecode/private/mxtest/core/NoteheadTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, Notehead ) +TEST(Test01, Notehead) { - std::string indentString( INDENT ); - NoteheadValue value1 = NoteheadValue::leftTriangle; - NoteheadValue value2 = NoteheadValue::normal; - Notehead object1; - Notehead object2( value2 ); - NoteheadAttributesPtr attributes1 = std::make_shared(); - NoteheadAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + NoteheadValue value1 = NoteheadValue::leftTriangle; + NoteheadValue value2 = NoteheadValue::normal; + Notehead object1; + Notehead object2(value2); + NoteheadAttributesPtr attributes1 = std::make_shared(); + NoteheadAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasParentheses = true; attributes1->parentheses = YesNo::yes; attributes1->hasFilled = true; attributes1->filled = YesNo::no; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(normal)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(normal)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(normal)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(normal)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/NoteheadTextTest.cpp b/Sourcecode/private/mxtest/core/NoteheadTextTest.cpp index e6e09c41c..59a5ba8d7 100644 --- a/Sourcecode/private/mxtest/core/NoteheadTextTest.cpp +++ b/Sourcecode/private/mxtest/core/NoteheadTextTest.cpp @@ -6,135 +6,130 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/NoteheadTextTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - +#include "mxtest/core/NoteheadTextTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, NoteheadText ) +TEST(Test01, NoteheadText) { TestMode v = TestMode::one; - NoteheadTextPtr object = tgenNoteheadText( v ); - stringstream expected; - tgenNoteheadTextExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + NoteheadTextPtr object = tgenNoteheadText(v); + stringstream expected; + tgenNoteheadTextExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, NoteheadText ) + +TEST(Test02, NoteheadText) { TestMode v = TestMode::two; - NoteheadTextPtr object = tgenNoteheadText( v ); - stringstream expected; - tgenNoteheadTextExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + NoteheadTextPtr object = tgenNoteheadText(v); + stringstream expected; + tgenNoteheadTextExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, NoteheadText ) + +TEST(Test03, NoteheadText) { TestMode v = TestMode::three; - NoteheadTextPtr object = tgenNoteheadText( v ); - stringstream expected; - tgenNoteheadTextExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + NoteheadTextPtr object = tgenNoteheadText(v); + stringstream expected; + tgenNoteheadTextExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - NoteheadTextPtr tgenNoteheadText( TestMode v ) +NoteheadTextPtr tgenNoteheadText(TestMode v) +{ + NoteheadTextPtr o = makeNoteheadText(); + switch (v) { - NoteheadTextPtr o = makeNoteheadText(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - auto dt = makeNoteheadTextChoice(); - dt->setChoice( NoteheadTextChoice::Choice::displayText ); - dt->getDisplayText()->setValue( XsString( "B" ) ); - o->addNoteheadTextChoice( dt ); - o->removeNoteheadTextChoice( o->getNoteheadTextChoiceSet().cbegin() ); - - auto at = makeNoteheadTextChoice(); - at->setChoice( NoteheadTextChoice::Choice::accidentalText ); - at->getAccidentalText()->setValue( AccidentalValue::koron ); - o->addNoteheadTextChoice( at ); - } - break; - case TestMode::three: - { - auto dt = makeNoteheadTextChoice(); - dt->setChoice( NoteheadTextChoice::Choice::displayText ); - dt->getDisplayText()->setValue( XsString( "C" ) ); - dt->getAccidentalText()->setValue( AccidentalValue::koron ); - o->addNoteheadTextChoice( dt ); - o->removeNoteheadTextChoice( o->getNoteheadTextChoiceSet().cbegin() ); - - auto at = makeNoteheadTextChoice(); - at->setChoice( NoteheadTextChoice::Choice::accidentalText ); - at->getAccidentalText()->setValue( AccidentalValue::sharp ); - o->addNoteheadTextChoice( at ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + auto dt = makeNoteheadTextChoice(); + dt->setChoice(NoteheadTextChoice::Choice::displayText); + dt->getDisplayText()->setValue(XsString("B")); + o->addNoteheadTextChoice(dt); + o->removeNoteheadTextChoice(o->getNoteheadTextChoiceSet().cbegin()); + + auto at = makeNoteheadTextChoice(); + at->setChoice(NoteheadTextChoice::Choice::accidentalText); + at->getAccidentalText()->setValue(AccidentalValue::koron); + o->addNoteheadTextChoice(at); } - void tgenNoteheadTextExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + auto dt = makeNoteheadTextChoice(); + dt->setChoice(NoteheadTextChoice::Choice::displayText); + dt->getDisplayText()->setValue(XsString("C")); + dt->getAccidentalText()->setValue(AccidentalValue::koron); + o->addNoteheadTextChoice(dt); + o->removeNoteheadTextChoice(o->getNoteheadTextChoiceSet().cbegin()); + + auto at = makeNoteheadTextChoice(); + at->setChoice(NoteheadTextChoice::Choice::accidentalText); + at->getAccidentalText()->setValue(AccidentalValue::sharp); + o->addNoteheadTextChoice(at); + } + break; + default: + break; + } + return o; +} + +void tgenNoteheadTextExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - //streamLine( os, i+1, R"(natural)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(B)" ); - streamLine( os, i+1, R"(koron)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(C)" ); - streamLine( os, i+1, R"(sharp)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + // streamLine( os, i+1, R"(natural)" ); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(B)"); + streamLine(os, i + 1, R"(koron)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(C)"); + streamLine(os, i + 1, R"(sharp)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NoteheadTextTest.h b/Sourcecode/private/mxtest/core/NoteheadTextTest.h index 63c0b3351..c16c9190b 100644 --- a/Sourcecode/private/mxtest/core/NoteheadTextTest.h +++ b/Sourcecode/private/mxtest/core/NoteheadTextTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::NoteheadTextPtr tgenNoteheadText( TestMode v ); - void tgenNoteheadTextExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::NoteheadTextPtr tgenNoteheadText(TestMode v); +void tgenNoteheadTextExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/NumberOrNormal.cpp b/Sourcecode/private/mxtest/core/NumberOrNormal.cpp index 74c2fc8ec..f539df840 100644 --- a/Sourcecode/private/mxtest/core/NumberOrNormal.cpp +++ b/Sourcecode/private/mxtest/core/NumberOrNormal.cpp @@ -11,75 +11,80 @@ using namespace mx::core; -TEST( NumberOrNormal01, NumberOrNormal ) +TEST(NumberOrNormal01, NumberOrNormal) { NumberOrNormal x; std::string expected = "normal"; - CHECK( x.getIsNormal() ) - CHECK( !x.getIsNumber() ) - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + CHECK(x.getIsNormal()) + CHECK(!x.getIsNumber()) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( NumberOrNormal02, NumberOrNormal ) + +TEST(NumberOrNormal02, NumberOrNormal) { - NumberOrNormal x( Decimal( 31.2 ) ); - CHECK( !x.getIsNormal() ) - CHECK( x.getIsNumber() ) + NumberOrNormal x(Decimal(31.2)); + CHECK(!x.getIsNormal()) + CHECK(x.getIsNumber()) std::string expected = "31.2"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( NumberOrNormal03, NumberOrNormal ) + +TEST(NumberOrNormal03, NumberOrNormal) { - NumberOrNormal x( "normal" ); - CHECK( x.getIsNormal() ) - CHECK( !x.getIsNumber() ) + NumberOrNormal x("normal"); + CHECK(x.getIsNormal()) + CHECK(!x.getIsNumber()) std::string expected = "normal"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( NumberOrNormal04, NumberOrNormal ) + +TEST(NumberOrNormal04, NumberOrNormal) { - NumberOrNormal x( "XXX" ); - CHECK( !x.getIsNormal() ) - CHECK( x.getIsNumber() ) + NumberOrNormal x("XXX"); + CHECK(!x.getIsNormal()) + CHECK(x.getIsNumber()) std::string expected = "0"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( NumberOrNormal05, NumberOrNormal ) + +TEST(NumberOrNormal05, NumberOrNormal) { - NumberOrNormal x( "24.0" ); - CHECK( ! x.getIsNormal() ) - CHECK( x.getIsNumber() ) + NumberOrNormal x("24.0"); + CHECK(!x.getIsNormal()) + CHECK(x.getIsNumber()) DecimalType expected = 24; DecimalType actual = x.getValueNumber().getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, DEFAULT_PRECISION ) + CHECK_DOUBLES_EQUAL(expected, actual, DEFAULT_PRECISION) } -TEST( NumberOrNormal06, NumberOrNormal ) + +TEST(NumberOrNormal06, NumberOrNormal) { - NumberOrNormal x( "24.0" ); + NumberOrNormal x("24.0"); x.setValueNormal(); - CHECK( x.getIsNormal() ) - CHECK( ! x.getIsNumber() ) + CHECK(x.getIsNormal()) + CHECK(!x.getIsNumber()) std::string expected = "normal"; std::stringstream ss; ss << x; std::string actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( NumberOrNormal07, NumberOrNormal ) +TEST(NumberOrNormal07, NumberOrNormal) { - NumberOrNormal x( "normal" ); - x.setValue( Decimal( 30.9 ) ); - CHECK( ! x.getIsNormal() ) - CHECK( x.getIsNumber() ) + NumberOrNormal x("normal"); + x.setValue(Decimal(30.9)); + CHECK(!x.getIsNormal()) + CHECK(x.getIsNumber()) std::string expected = "30.9"; std::stringstream ss; - toStream( ss, x ); + toStream(ss, x); std::string actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } #endif diff --git a/Sourcecode/private/mxtest/core/OctaveChangeTest.cpp b/Sourcecode/private/mxtest/core/OctaveChangeTest.cpp index 3c9336c37..a45f33986 100644 --- a/Sourcecode/private/mxtest/core/OctaveChangeTest.cpp +++ b/Sourcecode/private/mxtest/core/OctaveChangeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, OctaveChange ) +TEST(Test01, OctaveChange) { - std::string indentString( INDENT ); - Integer value1{ 2 }; - Integer value2{ 3 }; - OctaveChange object1; - OctaveChange object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Integer value1{2}; + Integer value2{3}; + OctaveChange object1; + OctaveChange object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OctaveShiftTest.cpp b/Sourcecode/private/mxtest/core/OctaveShiftTest.cpp index 6ea089ad5..5abca2146 100644 --- a/Sourcecode/private/mxtest/core/OctaveShiftTest.cpp +++ b/Sourcecode/private/mxtest/core/OctaveShiftTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, OctaveShift ) +TEST(Test01, OctaveShift) { - std::string indentString( INDENT ); - OctaveShift object1; - OctaveShift object2; - OctaveShiftAttributesPtr attributes1 = std::make_shared(); - OctaveShiftAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + OctaveShift object1; + OctaveShift object2; + OctaveShiftAttributesPtr attributes1 = std::make_shared(); + OctaveShiftAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->number = NumberLevel{2}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/OctaveTest.cpp b/Sourcecode/private/mxtest/core/OctaveTest.cpp index 90b2d1f7a..3ff822702 100644 --- a/Sourcecode/private/mxtest/core/OctaveTest.cpp +++ b/Sourcecode/private/mxtest/core/OctaveTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Octave ) +TEST(Test01, Octave) { - std::string indentString( INDENT ); - OctaveValue value1{ 1 }; - OctaveValue value2{ 2 }; - Octave object1; - Octave object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + OctaveValue value1{1}; + OctaveValue value2{2}; + Octave object1; + Octave object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OffsetTest.cpp b/Sourcecode/private/mxtest/core/OffsetTest.cpp index b50c6ed7e..202081190 100644 --- a/Sourcecode/private/mxtest/core/OffsetTest.cpp +++ b/Sourcecode/private/mxtest/core/OffsetTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Offset ) +TEST(Test01, Offset) { - std::string indentString( INDENT ); - DivisionsValue value1{ -1.1 }; - DivisionsValue value2{ 3.33333 }; - Offset object1; - Offset object2( value2 ); - OffsetAttributesPtr attributes1 = std::make_shared(); - OffsetAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + DivisionsValue value1{-1.1}; + DivisionsValue value2{3.33333}; + Offset object1; + Offset object2(value2); + OffsetAttributesPtr attributes1 = std::make_shared(); + OffsetAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasSound = true; attributes1->sound = YesNo::no; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3.33333)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3.33333)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OpenStringTest.cpp b/Sourcecode/private/mxtest/core/OpenStringTest.cpp index fbc1441ef..0408fb672 100644 --- a/Sourcecode/private/mxtest/core/OpenStringTest.cpp +++ b/Sourcecode/private/mxtest/core/OpenStringTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, OpenString ) +TEST(Test01, OpenString) { - std::string indentString( INDENT ); - OpenString object1; - OpenString object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + OpenString object1; + OpenString object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/OpusTest.cpp b/Sourcecode/private/mxtest/core/OpusTest.cpp index 5d6e16f2b..554c70a12 100644 --- a/Sourcecode/private/mxtest/core/OpusTest.cpp +++ b/Sourcecode/private/mxtest/core/OpusTest.cpp @@ -11,41 +11,45 @@ using namespace mx::core; -TEST( Test01, Opus ) +TEST(Test01, Opus) { - std::string indentString( INDENT ); - Opus object1; - Opus object2; - OpusAttributesPtr attributes1 = std::make_shared(); - OpusAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Opus object1; + Opus object2; + OpusAttributesPtr attributes1 = std::make_shared(); + OpusAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasActuate = true; attributes1->hasRole = true; attributes1->hasTitle = true; attributes1->hasType = true; - attributes1->title = XlinkTitle{ "Hello World" }; - attributes1->role = XlinkRole{ "This is my role" }; + attributes1->title = XlinkTitle{"Hello World"}; + attributes1->role = XlinkRole{"This is my role"}; attributes1->actuate = XlinkActuate::none; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.cpp b/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.cpp index 11ed6c047..8ab8b60c9 100644 --- a/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.cpp @@ -6,115 +6,112 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/AppearanceTest.h" #include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/LayoutGroupTest.h" #include "mxtest/core/OrnamentsChoiceTest.h" #include "mxtest/core/ScalingTest.h" -#include "mxtest/core/LayoutGroupTest.h" -#include "mxtest/core/AppearanceTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, OrnamentsChoice ) +TEST(Test01, OrnamentsChoice) { TestMode v = TestMode::one; - OrnamentsChoicePtr object = tgenOrnamentsChoice( v ); - stringstream expected; - tgenOrnamentsChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + OrnamentsChoicePtr object = tgenOrnamentsChoice(v); + stringstream expected; + tgenOrnamentsChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, OrnamentsChoice ) + +TEST(Test02, OrnamentsChoice) { TestMode v = TestMode::two; - OrnamentsChoicePtr object = tgenOrnamentsChoice( v ); - stringstream expected; - tgenOrnamentsChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + OrnamentsChoicePtr object = tgenOrnamentsChoice(v); + stringstream expected; + tgenOrnamentsChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, OrnamentsChoice ) + +TEST(Test03, OrnamentsChoice) { TestMode v = TestMode::three; - OrnamentsChoicePtr object = tgenOrnamentsChoice( v ); - stringstream expected; - tgenOrnamentsChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + OrnamentsChoicePtr object = tgenOrnamentsChoice(v); + stringstream expected; + tgenOrnamentsChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = false; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - OrnamentsChoicePtr tgenOrnamentsChoice( TestMode v ) +OrnamentsChoicePtr tgenOrnamentsChoice(TestMode v) +{ + OrnamentsChoicePtr o = makeOrnamentsChoice(); + switch (v) { - OrnamentsChoicePtr o = makeOrnamentsChoice(); - switch ( v ) - { - case TestMode::one: - { - o->getTrillMark()->getAttributes()->hasFontStyle = true; - o->getTrillMark()->getAttributes()->fontStyle = FontStyle::italic; - } - break; - case TestMode::two: - { - o->setChoice( OrnamentsChoice::Choice::otherOrnament ); - o->getOtherOrnament()->setValue( XsString( "Mordiarty" ) ); - o->getOtherOrnament()->getAttributes()->hasPlacement = true; - } - break; - case TestMode::three: - { - o->setChoice( OrnamentsChoice::Choice::shake ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->getTrillMark()->getAttributes()->hasFontStyle = true; + o->getTrillMark()->getAttributes()->fontStyle = FontStyle::italic; + } + break; + case TestMode::two: { + o->setChoice(OrnamentsChoice::Choice::otherOrnament); + o->getOtherOrnament()->setValue(XsString("Mordiarty")); + o->getOtherOrnament()->getAttributes()->hasPlacement = true; + } + break; + case TestMode::three: { + o->setChoice(OrnamentsChoice::Choice::shake); } - void tgenOrnamentsChoiceExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenOrnamentsChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { - streamLine( os, i, R"(Mordiarty)", false ); - } - break; - case TestMode::three: - { + streamLine(os, i, R"(Mordiarty)", false); + } + break; + case TestMode::three: { - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.h b/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.h index 89545dc8d..4706bd188 100644 --- a/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.h +++ b/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::OrnamentsChoicePtr tgenOrnamentsChoice( TestMode v ); - void tgenOrnamentsChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::OrnamentsChoicePtr tgenOrnamentsChoice(TestMode v); +void tgenOrnamentsChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/OrnamentsTest.cpp b/Sourcecode/private/mxtest/core/OrnamentsTest.cpp index fa91d5138..0ee6878aa 100644 --- a/Sourcecode/private/mxtest/core/OrnamentsTest.cpp +++ b/Sourcecode/private/mxtest/core/OrnamentsTest.cpp @@ -7,129 +7,125 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/OrnamentsTest.h" #include "mxtest/core/OrnamentsChoiceTest.h" +#include "mxtest/core/OrnamentsTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Ornaments ) +TEST(Test01, Ornaments) { TestMode v = TestMode::one; - OrnamentsPtr object = tgenOrnaments( v ); - stringstream expected; - tgenOrnamentsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + OrnamentsPtr object = tgenOrnaments(v); + stringstream expected; + tgenOrnamentsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Ornaments ) + +TEST(Test02, Ornaments) { TestMode v = TestMode::two; - OrnamentsPtr object = tgenOrnaments( v ); - stringstream expected; - tgenOrnamentsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + OrnamentsPtr object = tgenOrnaments(v); + stringstream expected; + tgenOrnamentsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Ornaments ) + +TEST(Test03, Ornaments) { TestMode v = TestMode::three; - OrnamentsPtr object = tgenOrnaments( v ); - stringstream expected; - tgenOrnamentsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + OrnamentsPtr object = tgenOrnaments(v); + stringstream expected; + tgenOrnamentsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - OrnamentsPtr tgenOrnaments( TestMode v ) +OrnamentsPtr tgenOrnaments(TestMode v) +{ + OrnamentsPtr o = makeOrnaments(); + switch (v) { - OrnamentsPtr o = makeOrnaments(); - switch ( v ) - { - case TestMode::one: - { - auto choice = tgenOrnamentsChoice( v ); - o->addOrnamentsChoice( choice ); - } - break; - case TestMode::two: - { - auto choice = tgenOrnamentsChoice( v ); - o->addOrnamentsChoice( choice ); - auto mark1 = makeAccidentalMark(); - mark1->setValue( AccidentalValue::doubleSharp ); - o->addAccidentalMark( mark1 ); - } - break; - case TestMode::three: - { - auto choice = tgenOrnamentsChoice( v ); - o->addOrnamentsChoice( choice ); - auto mark1 = makeAccidentalMark(); - mark1->setValue( AccidentalValue::natural ); - o->addAccidentalMark( mark1 ); - auto mark2 = makeAccidentalMark(); - mark2->setValue( AccidentalValue::flat ); - o->addAccidentalMark( mark2 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + auto choice = tgenOrnamentsChoice(v); + o->addOrnamentsChoice(choice); + } + break; + case TestMode::two: { + auto choice = tgenOrnamentsChoice(v); + o->addOrnamentsChoice(choice); + auto mark1 = makeAccidentalMark(); + mark1->setValue(AccidentalValue::doubleSharp); + o->addAccidentalMark(mark1); + } + break; + case TestMode::three: { + auto choice = tgenOrnamentsChoice(v); + o->addOrnamentsChoice(choice); + auto mark1 = makeAccidentalMark(); + mark1->setValue(AccidentalValue::natural); + o->addAccidentalMark(mark1); + auto mark2 = makeAccidentalMark(); + mark2->setValue(AccidentalValue::flat); + o->addAccidentalMark(mark2); + } + break; + default: + break; } - void tgenOrnamentsExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenOrnamentsExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenOrnamentsChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenOrnamentsChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(double-sharp)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenOrnamentsChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(natural)" ); - streamLine( os, i+1, R"(flat)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenOrnamentsChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenOrnamentsChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(double-sharp)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenOrnamentsChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(natural)"); + streamLine(os, i + 1, R"(flat)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/OrnamentsTest.h b/Sourcecode/private/mxtest/core/OrnamentsTest.h index ab2de6d69..4015cda68 100644 --- a/Sourcecode/private/mxtest/core/OrnamentsTest.h +++ b/Sourcecode/private/mxtest/core/OrnamentsTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::OrnamentsPtr tgenOrnaments( TestMode v ); - void tgenOrnamentsExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::OrnamentsPtr tgenOrnaments(TestMode v); +void tgenOrnamentsExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/OtherAppearanceTest.cpp b/Sourcecode/private/mxtest/core/OtherAppearanceTest.cpp index 2491410e3..2ba84ccf0 100644 --- a/Sourcecode/private/mxtest/core/OtherAppearanceTest.cpp +++ b/Sourcecode/private/mxtest/core/OtherAppearanceTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, OtherAppearance ) +TEST(Test01, OtherAppearance) { - std::string indentString( INDENT ); - XsString value1{ "Centurylink" }; - XsString value2{ "Comcast" }; - OtherAppearance object1; - OtherAppearance object2( value2 ); - OtherAppearanceAttributesPtr attributes1 = std::make_shared(); - OtherAppearanceAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); - attributes1->type.setValue( "stupid" ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Comcast)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"Centurylink"}; + XsString value2{"Comcast"}; + OtherAppearance object1; + OtherAppearance object2(value2); + OtherAppearanceAttributesPtr attributes1 = std::make_shared(); + OtherAppearanceAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); + attributes1->type.setValue("stupid"); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Comcast)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OtherArticulationTest.cpp b/Sourcecode/private/mxtest/core/OtherArticulationTest.cpp index e3ccb6fa0..c29aedad8 100644 --- a/Sourcecode/private/mxtest/core/OtherArticulationTest.cpp +++ b/Sourcecode/private/mxtest/core/OtherArticulationTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, OtherArticulation ) +TEST(Test01, OtherArticulation) { - std::string indentString( INDENT ); - XsString value1{ "ding" }; - XsString value2{ "dong" }; - OtherArticulation object1; - OtherArticulation object2( value2 ); - OtherArticulationAttributesPtr attributes1 = std::make_shared(); - OtherArticulationAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"ding"}; + XsString value2{"dong"}; + OtherArticulation object1; + OtherArticulation object2(value2); + OtherArticulationAttributesPtr attributes1 = std::make_shared(); + OtherArticulationAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasPlacement = true; attributes1->placement = AboveBelow::above; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(dong)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(dong)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OtherDirectionTest.cpp b/Sourcecode/private/mxtest/core/OtherDirectionTest.cpp index 91f833404..b5f4fd52c 100644 --- a/Sourcecode/private/mxtest/core/OtherDirectionTest.cpp +++ b/Sourcecode/private/mxtest/core/OtherDirectionTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, OtherDirection ) +TEST(Test01, OtherDirection) { - std::string indentString( INDENT ); - XsString value1{ "Allegro" }; - XsString value2{ "Prestissimo" }; - OtherDirection object1; - OtherDirection object2( value2 ); - OtherDirectionAttributesPtr attributes1 = std::make_shared(); - OtherDirectionAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Allegro"}; + XsString value2{"Prestissimo"}; + OtherDirection object1; + OtherDirection object2(value2); + OtherDirectionAttributesPtr attributes1 = std::make_shared(); + OtherDirectionAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasHalign = true; attributes1->halign = LeftCenterRight::left; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Prestissimo)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Prestissimo)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OtherNotationTest.cpp b/Sourcecode/private/mxtest/core/OtherNotationTest.cpp index 1e1f8fb6e..d0b790248 100644 --- a/Sourcecode/private/mxtest/core/OtherNotationTest.cpp +++ b/Sourcecode/private/mxtest/core/OtherNotationTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, OtherNotation ) +TEST(Test01, OtherNotation) { - std::string indentString( INDENT ); - XsString value1{ "alarm" }; - XsString value2{ "bells" }; - OtherNotation object1; - OtherNotation object2( value2 ); - OtherNotationAttributesPtr attributes1 = std::make_shared(); - OtherNotationAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"alarm"}; + XsString value2{"bells"}; + OtherNotation object1; + OtherNotation object2(value2); + OtherNotationAttributesPtr attributes1 = std::make_shared(); + OtherNotationAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(bells)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->number = NumberLevel{2}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(bells)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OtherOrnamentTest.cpp b/Sourcecode/private/mxtest/core/OtherOrnamentTest.cpp index 63573d859..74ae5a339 100644 --- a/Sourcecode/private/mxtest/core/OtherOrnamentTest.cpp +++ b/Sourcecode/private/mxtest/core/OtherOrnamentTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, OtherOrnament ) +TEST(Test01, OtherOrnament) { - std::string indentString( INDENT ); - XsString value1( "Stravinsky" ); - XsString value2( "Webern" ); - OtherOrnament object1; - OtherOrnament object2( value2 ); - OtherOrnamentAttributesPtr attributes1 = std::make_shared(); - OtherOrnamentAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->hasFontSize = true; - attributes1->fontSize = FontSize( CssFontSize::xLarge ); - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); + std::string indentString(INDENT); + XsString value1("Stravinsky"); + XsString value2("Webern"); + OtherOrnament object1; + OtherOrnament object2(value2); + OtherOrnamentAttributesPtr attributes1 = std::make_shared(); + OtherOrnamentAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->hasFontSize = true; + attributes1->fontSize = FontSize(CssFontSize::xLarge); + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Webern)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Webern)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OtherPercussionTest.cpp b/Sourcecode/private/mxtest/core/OtherPercussionTest.cpp index e312ffb7b..0e5c44086 100644 --- a/Sourcecode/private/mxtest/core/OtherPercussionTest.cpp +++ b/Sourcecode/private/mxtest/core/OtherPercussionTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, OtherPercussion ) +TEST(Test01, OtherPercussion) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - OtherPercussion object1; - OtherPercussion object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + OtherPercussion object1; + OtherPercussion object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OtherPlayTest.cpp b/Sourcecode/private/mxtest/core/OtherPlayTest.cpp index 2e08cfa80..afca82c15 100644 --- a/Sourcecode/private/mxtest/core/OtherPlayTest.cpp +++ b/Sourcecode/private/mxtest/core/OtherPlayTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, OtherPlay ) +TEST(Test01, OtherPlay) { - std::string indentString( INDENT ); - XsString value1{ "thing1" }; - XsString value2{ "thing2" }; - OtherPlay object1; - OtherPlay object2( value2 ); - OtherPlayAttributesPtr attributes1 = std::make_shared(); - OtherPlayAttributesPtr attributesNull; - attributes1->type = XsToken{ "sometype" }; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(thing2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"thing1"}; + XsString value2{"thing2"}; + OtherPlay object1; + OtherPlay object2(value2); + OtherPlayAttributesPtr attributes1 = std::make_shared(); + OtherPlayAttributesPtr attributesNull; + attributes1->type = XsToken{"sometype"}; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(thing2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/OtherTechnicalTest.cpp b/Sourcecode/private/mxtest/core/OtherTechnicalTest.cpp index 2ea75b35f..b26674161 100644 --- a/Sourcecode/private/mxtest/core/OtherTechnicalTest.cpp +++ b/Sourcecode/private/mxtest/core/OtherTechnicalTest.cpp @@ -11,36 +11,39 @@ using namespace mx::core; -TEST( Test01, OtherTechnical ) +TEST(Test01, OtherTechnical) { - std::string indentString( INDENT ); - XsString value1{ "Bones" }; - XsString value2{ "Bish" }; - OtherTechnical object1; - OtherTechnical object2( value2 ); - OtherTechnicalAttributesPtr attributes1 = std::make_shared(); - OtherTechnicalAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Bones"}; + XsString value2{"Bish"}; + OtherTechnical object1; + OtherTechnical object2(value2); + OtherTechnicalAttributesPtr attributes1 = std::make_shared(); + OtherTechnicalAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasPlacement = true; attributes1->hasFontStyle = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Bish)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + + R"(Bish)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PageHeightTest.cpp b/Sourcecode/private/mxtest/core/PageHeightTest.cpp index 0461323aa..63341d80e 100644 --- a/Sourcecode/private/mxtest/core/PageHeightTest.cpp +++ b/Sourcecode/private/mxtest/core/PageHeightTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, PageHeight ) +TEST(Test01, PageHeight) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - PageHeight object1; - PageHeight object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + PageHeight object1; + PageHeight object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PageLayoutTest.cpp b/Sourcecode/private/mxtest/core/PageLayoutTest.cpp index 9437673c8..311b1a3bb 100644 --- a/Sourcecode/private/mxtest/core/PageLayoutTest.cpp +++ b/Sourcecode/private/mxtest/core/PageLayoutTest.cpp @@ -7,125 +7,121 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/MidiInstrumentTest.h" #include "mxtest/core/PageLayoutTest.h" #include "mxtest/core/PageMarginsTest.h" -#include "mxtest/core/MidiInstrumentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PageLayout ) +TEST(Test01, PageLayout) { TestMode v = TestMode::one; - PageLayoutPtr object = tgenPageLayout( v ); - stringstream expected; - tgenPageLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PageLayoutPtr object = tgenPageLayout(v); + stringstream expected; + tgenPageLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, PageLayout ) + +TEST(Test02, PageLayout) { TestMode v = TestMode::two; - PageLayoutPtr object = tgenPageLayout( v ); - stringstream expected; - tgenPageLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PageLayoutPtr object = tgenPageLayout(v); + stringstream expected; + tgenPageLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, PageLayout ) + +TEST(Test03, PageLayout) { TestMode v = TestMode::three; - PageLayoutPtr object = tgenPageLayout( v ); - stringstream expected; - tgenPageLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PageLayoutPtr object = tgenPageLayout(v); + stringstream expected; + tgenPageLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PageLayoutPtr tgenPageLayout( TestMode v ) +PageLayoutPtr tgenPageLayout(TestMode v) +{ + PageLayoutPtr o = makePageLayout(); + switch (v) { - PageLayoutPtr o = makePageLayout(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getPageHeight()->setValue( TenthsValue( 2534 ) ); - o->getPageWidth()->setValue( TenthsValue( 4352 ) ); - o->addPageMargins( tgenPageMargins( TestMode::one ) ); - o->addPageMargins( tgenPageMargins( TestMode::two ) ); - } - break; - case TestMode::three: - { - o->getPageHeight()->setValue( TenthsValue( 3524 ) ); - o->getPageWidth()->setValue( TenthsValue( 3241 ) ); - o->addPageMargins( tgenPageMargins( TestMode::three ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getPageHeight()->setValue(TenthsValue(2534)); + o->getPageWidth()->setValue(TenthsValue(4352)); + o->addPageMargins(tgenPageMargins(TestMode::one)); + o->addPageMargins(tgenPageMargins(TestMode::two)); + } + break; + case TestMode::three: { + o->getPageHeight()->setValue(TenthsValue(3524)); + o->getPageWidth()->setValue(TenthsValue(3241)); + o->addPageMargins(tgenPageMargins(TestMode::three)); + } + break; + default: + break; } - void tgenPageLayoutExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenPageLayoutExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(2534)" ); - streamLine( os, i+1, R"(4352)" ); - tgenPageMarginsExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenPageMarginsExpected(os, i+1, TestMode::two ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(3524)" ); - streamLine( os, i+1, R"(3241)" ); - tgenPageMarginsExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(2534)"); + streamLine(os, i + 1, R"(4352)"); + tgenPageMarginsExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenPageMarginsExpected(os, i + 1, TestMode::two); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(3524)"); + streamLine(os, i + 1, R"(3241)"); + tgenPageMarginsExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PageLayoutTest.h b/Sourcecode/private/mxtest/core/PageLayoutTest.h index d3929ea0b..1c4220fa9 100644 --- a/Sourcecode/private/mxtest/core/PageLayoutTest.h +++ b/Sourcecode/private/mxtest/core/PageLayoutTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PageLayoutPtr tgenPageLayout( TestMode v ); - void tgenPageLayoutExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PageLayoutPtr tgenPageLayout(TestMode v); +void tgenPageLayoutExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PageMarginsTest.cpp b/Sourcecode/private/mxtest/core/PageMarginsTest.cpp index c0c433719..46d013af2 100644 --- a/Sourcecode/private/mxtest/core/PageMarginsTest.cpp +++ b/Sourcecode/private/mxtest/core/PageMarginsTest.cpp @@ -6,131 +6,127 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/MidiInstrumentTest.h" #include "mxtest/core/PageMarginsTest.h" #include "mxtest/core/PlayTest.h" -#include "mxtest/core/MidiInstrumentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PageMargins ) +TEST(Test01, PageMargins) { TestMode v = TestMode::one; - PageMarginsPtr object = tgenPageMargins( v ); - stringstream expected; - tgenPageMarginsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PageMarginsPtr object = tgenPageMargins(v); + stringstream expected; + tgenPageMarginsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, PageMargins ) + +TEST(Test02, PageMargins) { TestMode v = TestMode::two; - PageMarginsPtr object = tgenPageMargins( v ); - stringstream expected; - tgenPageMarginsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PageMarginsPtr object = tgenPageMargins(v); + stringstream expected; + tgenPageMarginsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, PageMargins ) + +TEST(Test03, PageMargins) { TestMode v = TestMode::three; - PageMarginsPtr object = tgenPageMargins( v ); - stringstream expected; - tgenPageMarginsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PageMarginsPtr object = tgenPageMargins(v); + stringstream expected; + tgenPageMarginsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PageMarginsPtr tgenPageMargins( TestMode v ) +PageMarginsPtr tgenPageMargins(TestMode v) +{ + PageMarginsPtr o = makePageMargins(); + switch (v) { - PageMarginsPtr o = makePageMargins(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getLeftMargin()->setValue( TenthsValue( 11.1 ) ); - o->getRightMargin()->setValue( TenthsValue( 12.2 ) ); - o->getTopMargin()->setValue( TenthsValue( 13.3 ) ); - o->getBottomMargin()->setValue( TenthsValue( 14.4 ) ); - o->getAttributes()->hasType = true; - } - break; - case TestMode::three: - { - o->getLeftMargin()->setValue( TenthsValue( 110.1 ) ); - o->getRightMargin()->setValue( TenthsValue( 120.2 ) ); - o->getTopMargin()->setValue( TenthsValue( 130.3 ) ); - o->getBottomMargin()->setValue( TenthsValue( 140.4 ) ); - o->getAttributes()->hasType = true; - o->getAttributes()->type = MarginType::even; - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getLeftMargin()->setValue(TenthsValue(11.1)); + o->getRightMargin()->setValue(TenthsValue(12.2)); + o->getTopMargin()->setValue(TenthsValue(13.3)); + o->getBottomMargin()->setValue(TenthsValue(14.4)); + o->getAttributes()->hasType = true; + } + break; + case TestMode::three: { + o->getLeftMargin()->setValue(TenthsValue(110.1)); + o->getRightMargin()->setValue(TenthsValue(120.2)); + o->getTopMargin()->setValue(TenthsValue(130.3)); + o->getBottomMargin()->setValue(TenthsValue(140.4)); + o->getAttributes()->hasType = true; + o->getAttributes()->type = MarginType::even; } - void tgenPageMarginsExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenPageMarginsExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(11.1)" ); - streamLine( os, i+1, R"(12.2)" ); - streamLine( os, i+1, R"(13.3)" ); - streamLine( os, i+1, R"(14.4)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(110.1)" ); - streamLine( os, i+1, R"(120.2)" ); - streamLine( os, i+1, R"(130.3)" ); - streamLine( os, i+1, R"(140.4)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(11.1)"); + streamLine(os, i + 1, R"(12.2)"); + streamLine(os, i + 1, R"(13.3)"); + streamLine(os, i + 1, R"(14.4)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(110.1)"); + streamLine(os, i + 1, R"(120.2)"); + streamLine(os, i + 1, R"(130.3)"); + streamLine(os, i + 1, R"(140.4)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PageMarginsTest.h b/Sourcecode/private/mxtest/core/PageMarginsTest.h index 9be4defae..c050e2a1b 100644 --- a/Sourcecode/private/mxtest/core/PageMarginsTest.h +++ b/Sourcecode/private/mxtest/core/PageMarginsTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PageMarginsPtr tgenPageMargins( TestMode v ); - void tgenPageMarginsExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PageMarginsPtr tgenPageMargins(TestMode v); +void tgenPageMarginsExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PageWidthTest.cpp b/Sourcecode/private/mxtest/core/PageWidthTest.cpp index 3ae725267..5b4cbf928 100644 --- a/Sourcecode/private/mxtest/core/PageWidthTest.cpp +++ b/Sourcecode/private/mxtest/core/PageWidthTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, PageWidth ) +TEST(Test01, PageWidth) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - PageWidth object1; - PageWidth object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + PageWidth object1; + PageWidth object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PanTest.cpp b/Sourcecode/private/mxtest/core/PanTest.cpp index 07b3a7634..a3ee1c734 100644 --- a/Sourcecode/private/mxtest/core/PanTest.cpp +++ b/Sourcecode/private/mxtest/core/PanTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Pan ) +TEST(Test01, Pan) { - std::string indentString( INDENT ); - RotationDegrees value1{ 160.1 }; - RotationDegrees value2{ -45.01 }; - Pan object1; - Pan object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(-45.01)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + RotationDegrees value1{160.1}; + RotationDegrees value2{-45.01}; + Pan object1; + Pan object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(-45.01)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.cpp b/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.cpp index 95496fd93..1dae4318f 100644 --- a/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.cpp +++ b/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.cpp @@ -13,111 +13,107 @@ using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PartAbbreviationDisplay ) +TEST(Test01, PartAbbreviationDisplay) { TestMode v = TestMode::one; - PartAbbreviationDisplayPtr object = tgenPartAbbreviationDisplay( v ); - stringstream expected; - tgenPartAbbreviationDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + PartAbbreviationDisplayPtr object = tgenPartAbbreviationDisplay(v); + stringstream expected; + tgenPartAbbreviationDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, PartAbbreviationDisplay ) + +TEST(Test02, PartAbbreviationDisplay) { TestMode v = TestMode::two; - PartAbbreviationDisplayPtr object = tgenPartAbbreviationDisplay( v ); - stringstream expected; - tgenPartAbbreviationDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartAbbreviationDisplayPtr object = tgenPartAbbreviationDisplay(v); + stringstream expected; + tgenPartAbbreviationDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, PartAbbreviationDisplay ) + +TEST(Test03, PartAbbreviationDisplay) { TestMode v = TestMode::three; - PartAbbreviationDisplayPtr object = tgenPartAbbreviationDisplay( v ); - stringstream expected; - tgenPartAbbreviationDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PartAbbreviationDisplayPtr object = tgenPartAbbreviationDisplay(v); + stringstream expected; + tgenPartAbbreviationDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PartAbbreviationDisplayPtr tgenPartAbbreviationDisplay( TestMode v ) +PartAbbreviationDisplayPtr tgenPartAbbreviationDisplay(TestMode v) +{ + PartAbbreviationDisplayPtr o = makePartAbbreviationDisplay(); + switch (v) { - PartAbbreviationDisplayPtr o = makePartAbbreviationDisplay(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - auto ch = makeDisplayTextOrAccidentalText(); - ch->setChoice( DisplayTextOrAccidentalText::Choice::accidentalText ); - ch->getAccidentalText()->setValue( AccidentalValue::doubleSharp ); - o->addDisplayTextOrAccidentalText( ch ); - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::no; - } - break; - case TestMode::three: - { - auto ch = makeDisplayTextOrAccidentalText(); - ch->setChoice( DisplayTextOrAccidentalText::Choice::displayText ); - ch->getDisplayText()->setValue( XsString( "My Display String!" ) ); - ch->getDisplayText()->getAttributes()->hasSpace = true; - ch->getDisplayText()->getAttributes()->space = XmlSpace::preserve; - o->addDisplayTextOrAccidentalText( ch ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + auto ch = makeDisplayTextOrAccidentalText(); + ch->setChoice(DisplayTextOrAccidentalText::Choice::accidentalText); + ch->getAccidentalText()->setValue(AccidentalValue::doubleSharp); + o->addDisplayTextOrAccidentalText(ch); + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::no; } - void tgenPartAbbreviationDisplayExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + auto ch = makeDisplayTextOrAccidentalText(); + ch->setChoice(DisplayTextOrAccidentalText::Choice::displayText); + ch->getDisplayText()->setValue(XsString("My Display String!")); + ch->getDisplayText()->getAttributes()->hasSpace = true; + ch->getDisplayText()->getAttributes()->space = XmlSpace::preserve; + o->addDisplayTextOrAccidentalText(ch); + } + break; + default: + break; + } + return o; +} + +void tgenPartAbbreviationDisplayExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(double-sharp)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(My Display String!)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(double-sharp)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(My Display String!)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.h b/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.h index 347ed99fe..0b8e80d40 100644 --- a/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.h +++ b/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PartAbbreviationDisplayPtr tgenPartAbbreviationDisplay( TestMode v ); - void tgenPartAbbreviationDisplayExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PartAbbreviationDisplayPtr tgenPartAbbreviationDisplay(TestMode v); +void tgenPartAbbreviationDisplayExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartAbbreviationTest.cpp b/Sourcecode/private/mxtest/core/PartAbbreviationTest.cpp index da3c3a193..3f1f8a9f0 100644 --- a/Sourcecode/private/mxtest/core/PartAbbreviationTest.cpp +++ b/Sourcecode/private/mxtest/core/PartAbbreviationTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, PartAbbreviation ) +TEST(Test01, PartAbbreviation) { - std::string indentString( INDENT ); - XsString value1{ "Brahms" }; - XsString value2{ "Beethoven" }; - PartAbbreviation object1; - PartAbbreviation object2( value2 ); - PartAbbreviationAttributesPtr attributes1 = std::make_shared(); - PartAbbreviationAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Brahms"}; + XsString value2{"Beethoven"}; + PartAbbreviation object1; + PartAbbreviation object2(value2); + PartAbbreviationAttributesPtr attributes1 = std::make_shared(); + PartAbbreviationAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasJustify = true; attributes1->justify = LeftCenterRight::center; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Beethoven)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Beethoven)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.cpp b/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.cpp index bae8d66a4..93a986432 100644 --- a/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.cpp +++ b/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.cpp @@ -8,109 +8,105 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PartGroupOrScorePartTest.h" -#include "mxtest/core/ScorePartTest.h" #include "mxtest/core/PartGroupTest.h" +#include "mxtest/core/ScorePartTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PartGroupOrScorePart ) +TEST(Test01, PartGroupOrScorePart) { TestMode v = TestMode::one; - PartGroupOrScorePartPtr object = tgenPartGroupOrScorePart( v ); - stringstream expected; - tgenPartGroupOrScorePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + PartGroupOrScorePartPtr object = tgenPartGroupOrScorePart(v); + stringstream expected; + tgenPartGroupOrScorePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, PartGroupOrScorePart ) + +TEST(Test02, PartGroupOrScorePart) { TestMode v = TestMode::two; - PartGroupOrScorePartPtr object = tgenPartGroupOrScorePart( v ); - stringstream expected; - tgenPartGroupOrScorePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + PartGroupOrScorePartPtr object = tgenPartGroupOrScorePart(v); + stringstream expected; + tgenPartGroupOrScorePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, PartGroupOrScorePart ) + +TEST(Test03, PartGroupOrScorePart) { TestMode v = TestMode::three; - PartGroupOrScorePartPtr object = tgenPartGroupOrScorePart( v ); - stringstream expected; - tgenPartGroupOrScorePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + PartGroupOrScorePartPtr object = tgenPartGroupOrScorePart(v); + stringstream expected; + tgenPartGroupOrScorePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PartGroupOrScorePartPtr tgenPartGroupOrScorePart( TestMode v ) +PartGroupOrScorePartPtr tgenPartGroupOrScorePart(TestMode v) +{ + PartGroupOrScorePartPtr o = makePartGroupOrScorePart(); + switch (v) { - PartGroupOrScorePartPtr o = makePartGroupOrScorePart(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( PartGroupOrScorePart::Choice::scorePart ); - o->setScorePart( tgenScorePart( v ) ); - } - break; - case TestMode::three: - { - o->setChoice( PartGroupOrScorePart::Choice::partGroup ); - o->setPartGroup( tgenPartGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(PartGroupOrScorePart::Choice::scorePart); + o->setScorePart(tgenScorePart(v)); + } + break; + case TestMode::three: { + o->setChoice(PartGroupOrScorePart::Choice::partGroup); + o->setPartGroup(tgenPartGroup(v)); + } + break; + default: + break; } - void tgenPartGroupOrScorePartExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenPartGroupOrScorePartExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenPartGroupExpected( os, i, v ); - } - break; - case TestMode::two: - { - tgenScorePartExpected( os, i, v ); - } - break; - case TestMode::three: - { - tgenPartGroupExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenPartGroupExpected(os, i, v); + } + break; + case TestMode::two: { + tgenScorePartExpected(os, i, v); + } + break; + case TestMode::three: { + tgenPartGroupExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.h b/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.h index 96fcb94d0..0b5115d96 100644 --- a/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.h +++ b/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PartGroupOrScorePartPtr tgenPartGroupOrScorePart( TestMode v ); - void tgenPartGroupOrScorePartExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PartGroupOrScorePartPtr tgenPartGroupOrScorePart(TestMode v); +void tgenPartGroupOrScorePartExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartGroupTest.cpp b/Sourcecode/private/mxtest/core/PartGroupTest.cpp index c4f3021b4..c293f01b6 100644 --- a/Sourcecode/private/mxtest/core/PartGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/PartGroupTest.cpp @@ -6,160 +6,156 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/EditorialGroupTest.h" +#include "mxtest/core/GroupAbbreviationDisplayTest.h" +#include "mxtest/core/GroupNameDisplayTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PartGroupTest.h" -#include "mxtest/core/GroupNameDisplayTest.h" -#include "mxtest/core/GroupAbbreviationDisplayTest.h" -#include "mxtest/core/EditorialGroupTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PartGroup ) +TEST(Test01, PartGroup) { TestMode v = TestMode::one; - PartGroupPtr object = tgenPartGroup( v ); - stringstream expected; - tgenPartGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + PartGroupPtr object = tgenPartGroup(v); + stringstream expected; + tgenPartGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, PartGroup ) + +TEST(Test02, PartGroup) { TestMode v = TestMode::two; - PartGroupPtr object = tgenPartGroup( v ); - stringstream expected; - tgenPartGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartGroupPtr object = tgenPartGroup(v); + stringstream expected; + tgenPartGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, PartGroup ) + +TEST(Test03, PartGroup) { TestMode v = TestMode::three; - PartGroupPtr object = tgenPartGroup( v ); - stringstream expected; - tgenPartGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartGroupPtr object = tgenPartGroup(v); + stringstream expected; + tgenPartGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PartGroupPtr tgenPartGroup( TestMode v ) +PartGroupPtr tgenPartGroup(TestMode v) +{ + PartGroupPtr o = makePartGroup(); + switch (v) { - PartGroupPtr o = makePartGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->type = StartStop::stop; - o->getAttributes()->hasNumber = true; - o->setHasGroupName( true ); - o->getGroupName()->setValue( XsString( "Some Group of Instruments" ) ); - o->setHasGroupNameDisplay( true ); - o->setGroupNameDisplay( tgenGroupNameDisplay( v ) ); - o->setHasGroupAbbreviation( true ); - o->getGroupAbbreviation()->setValue( XsString( "SGI" ) ); - o->setHasGroupAbbreviationDisplay( true ); - o->setGroupAbbreviationDisplay( tgenGroupAbbreviationDisplay( v ) ); - o->setHasGroupSymbol( true ); - o->getGroupSymbol()->setValue( GroupSymbolValue::bracket ); - o->setHasGroupBarline( true ); - o->getGroupBarline()->setValue( GroupBarlineValue::mensurstrich ); - o->setHasGroupTime( true ); - o->setEditorialGroup( tgenEditorialGroup( v ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->type = StartStop::start; - o->getAttributes()->hasNumber = true; - o->getAttributes()->number = XsToken( "2" ); - o->setHasGroupName( true ); - o->getGroupName()->setValue( XsString( "Piano" ) ); - o->setHasGroupNameDisplay( true ); - o->setGroupNameDisplay( tgenGroupNameDisplay( v ) ); - o->setHasGroupAbbreviation( true ); - o->getGroupAbbreviation()->setValue( XsString( "pno." ) ); - o->setHasGroupAbbreviationDisplay( true ); - o->setGroupAbbreviationDisplay( tgenGroupAbbreviationDisplay( v ) ); - o->setHasGroupSymbol( true ); - o->getGroupSymbol()->setValue( GroupSymbolValue::square ); - o->setHasGroupBarline( true ); - o->getGroupBarline()->setValue( GroupBarlineValue::yes ); - o->setEditorialGroup( tgenEditorialGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->type = StartStop::stop; + o->getAttributes()->hasNumber = true; + o->setHasGroupName(true); + o->getGroupName()->setValue(XsString("Some Group of Instruments")); + o->setHasGroupNameDisplay(true); + o->setGroupNameDisplay(tgenGroupNameDisplay(v)); + o->setHasGroupAbbreviation(true); + o->getGroupAbbreviation()->setValue(XsString("SGI")); + o->setHasGroupAbbreviationDisplay(true); + o->setGroupAbbreviationDisplay(tgenGroupAbbreviationDisplay(v)); + o->setHasGroupSymbol(true); + o->getGroupSymbol()->setValue(GroupSymbolValue::bracket); + o->setHasGroupBarline(true); + o->getGroupBarline()->setValue(GroupBarlineValue::mensurstrich); + o->setHasGroupTime(true); + o->setEditorialGroup(tgenEditorialGroup(v)); } - void tgenPartGroupExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->getAttributes()->type = StartStop::start; + o->getAttributes()->hasNumber = true; + o->getAttributes()->number = XsToken("2"); + o->setHasGroupName(true); + o->getGroupName()->setValue(XsString("Piano")); + o->setHasGroupNameDisplay(true); + o->setGroupNameDisplay(tgenGroupNameDisplay(v)); + o->setHasGroupAbbreviation(true); + o->getGroupAbbreviation()->setValue(XsString("pno.")); + o->setHasGroupAbbreviationDisplay(true); + o->setGroupAbbreviationDisplay(tgenGroupAbbreviationDisplay(v)); + o->setHasGroupSymbol(true); + o->getGroupSymbol()->setValue(GroupSymbolValue::square); + o->setHasGroupBarline(true); + o->getGroupBarline()->setValue(GroupBarlineValue::yes); + o->setEditorialGroup(tgenEditorialGroup(v)); + } + break; + default: + break; + } + return o; +} + +void tgenPartGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Some Group of Instruments)" ); - tgenGroupNameDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(SGI)" ); - tgenGroupAbbreviationDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(bracket)" ); - streamLine( os, i+1, R"(Mensurstrich)" ); - streamLine( os, i+1, R"()" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Piano)" ); - tgenGroupNameDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(pno.)" ); - tgenGroupAbbreviationDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(square)" ); - streamLine( os, i+1, R"(yes)" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Some Group of Instruments)"); + tgenGroupNameDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(SGI)"); + tgenGroupAbbreviationDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(bracket)"); + streamLine(os, i + 1, R"(Mensurstrich)"); + streamLine(os, i + 1, R"()"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Piano)"); + tgenGroupNameDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(pno.)"); + tgenGroupAbbreviationDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(square)"); + streamLine(os, i + 1, R"(yes)"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartGroupTest.h b/Sourcecode/private/mxtest/core/PartGroupTest.h index 0362dfafb..3459c006b 100644 --- a/Sourcecode/private/mxtest/core/PartGroupTest.h +++ b/Sourcecode/private/mxtest/core/PartGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PartGroupPtr tgenPartGroup( TestMode v ); - void tgenPartGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PartGroupPtr tgenPartGroup(TestMode v); +void tgenPartGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartListTest.cpp b/Sourcecode/private/mxtest/core/PartListTest.cpp index 9f345e492..280a7af4c 100644 --- a/Sourcecode/private/mxtest/core/PartListTest.cpp +++ b/Sourcecode/private/mxtest/core/PartListTest.cpp @@ -7,133 +7,129 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/PartListTest.h" #include "mxtest/core/PartGroupOrScorePartTest.h" #include "mxtest/core/PartGroupTest.h" +#include "mxtest/core/PartListTest.h" #include "mxtest/core/ScorePartTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PartList ) +TEST(Test01, PartList) { TestMode v = TestMode::one; - PartListPtr object = tgenPartList( v ); - stringstream expected; - tgenPartListExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PartListPtr object = tgenPartList(v); + stringstream expected; + tgenPartListExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, PartList ) + +TEST(Test02, PartList) { TestMode v = TestMode::two; - PartListPtr object = tgenPartList( v ); - stringstream expected; - tgenPartListExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PartListPtr object = tgenPartList(v); + stringstream expected; + tgenPartListExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, PartList ) + +TEST(Test03, PartList) { TestMode v = TestMode::three; - PartListPtr object = tgenPartList( v ); - stringstream expected; - tgenPartListExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PartListPtr object = tgenPartList(v); + stringstream expected; + tgenPartListExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PartListPtr tgenPartList( TestMode v ) +PartListPtr tgenPartList(TestMode v) +{ + PartListPtr o = makePartList(); + switch (v) { - PartListPtr o = makePartList(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->addPartGroup( tgenPartGroup( v ) ); - o->addPartGroup( tgenPartGroup( TestMode::three ) ); - o->setScorePart( tgenScorePart( v ) ); - o->addPartGroupOrScorePart( tgenPartGroupOrScorePart( v ) ); - o->addPartGroupOrScorePart( tgenPartGroupOrScorePart( TestMode::one ) ); - o->addPartGroupOrScorePart( tgenPartGroupOrScorePart( TestMode::three ) ); - } - break; - case TestMode::three: - { - o->setScorePart( tgenScorePart( v ) ); - o->addPartGroupOrScorePart( tgenPartGroupOrScorePart( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->addPartGroup(tgenPartGroup(v)); + o->addPartGroup(tgenPartGroup(TestMode::three)); + o->setScorePart(tgenScorePart(v)); + o->addPartGroupOrScorePart(tgenPartGroupOrScorePart(v)); + o->addPartGroupOrScorePart(tgenPartGroupOrScorePart(TestMode::one)); + o->addPartGroupOrScorePart(tgenPartGroupOrScorePart(TestMode::three)); + } + break; + case TestMode::three: { + o->setScorePart(tgenScorePart(v)); + o->addPartGroupOrScorePart(tgenPartGroupOrScorePart(v)); + } + break; + default: + break; } - void tgenPartListExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenPartListExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenScorePartExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenPartGroupExpected( os, i+1, v ); - os << std::endl; - tgenPartGroupExpected(os, i+1, TestMode::three ); - os << std::endl; - tgenScorePartExpected( os, i+1, v ); - os << std::endl; - tgenPartGroupOrScorePartExpected( os, i+1, v ); - os << std::endl; - tgenPartGroupOrScorePartExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenPartGroupOrScorePartExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenScorePartExpected( os, i+1, v ); - os << std::endl; - tgenPartGroupOrScorePartExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenScorePartExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenPartGroupExpected(os, i + 1, v); + os << std::endl; + tgenPartGroupExpected(os, i + 1, TestMode::three); + os << std::endl; + tgenScorePartExpected(os, i + 1, v); + os << std::endl; + tgenPartGroupOrScorePartExpected(os, i + 1, v); + os << std::endl; + tgenPartGroupOrScorePartExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenPartGroupOrScorePartExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenScorePartExpected(os, i + 1, v); + os << std::endl; + tgenPartGroupOrScorePartExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartListTest.h b/Sourcecode/private/mxtest/core/PartListTest.h index 219984cec..2879cd28f 100644 --- a/Sourcecode/private/mxtest/core/PartListTest.h +++ b/Sourcecode/private/mxtest/core/PartListTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PartListPtr tgenPartList( TestMode v ); - void tgenPartListExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PartListPtr tgenPartList(TestMode v); +void tgenPartListExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartNameDisplayTest.cpp b/Sourcecode/private/mxtest/core/PartNameDisplayTest.cpp index b1820c1c8..9d98af5e3 100644 --- a/Sourcecode/private/mxtest/core/PartNameDisplayTest.cpp +++ b/Sourcecode/private/mxtest/core/PartNameDisplayTest.cpp @@ -6,163 +6,157 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PartNameDisplayTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PartNameDisplay ) +TEST(Test01, PartNameDisplay) { TestMode v = TestMode::one; - PartNameDisplayPtr object = tgenPartNameDisplay( v ); - stringstream expected; - tgenPartNameDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PartNameDisplayPtr object = tgenPartNameDisplay(v); + stringstream expected; + tgenPartNameDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, PartNameDisplay ) + +TEST(Test02, PartNameDisplay) { TestMode v = TestMode::two; - PartNameDisplayPtr object = tgenPartNameDisplay( v ); - stringstream expected; - tgenPartNameDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartNameDisplayPtr object = tgenPartNameDisplay(v); + stringstream expected; + tgenPartNameDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, PartNameDisplay ) + +TEST(Test03, PartNameDisplay) { TestMode v = TestMode::three; - PartNameDisplayPtr object = tgenPartNameDisplay( v ); - stringstream expected; - tgenPartNameDisplayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartNameDisplayPtr object = tgenPartNameDisplay(v); + stringstream expected; + tgenPartNameDisplayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PartNameDisplayPtr tgenPartNameDisplay( TestMode v ) +PartNameDisplayPtr tgenPartNameDisplay(TestMode v) +{ + PartNameDisplayPtr o = makePartNameDisplay(); + switch (v) { - PartNameDisplayPtr o = makePartNameDisplay(); - switch ( v ) - { - case TestMode::one: - { - ; - } - break; - case TestMode::two: - { - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::no; - o->addDisplayTextOrAccidentalText( tgenDisplayTextOrAccidentalText( TestMode::one ) ); - o->addDisplayTextOrAccidentalText( tgenDisplayTextOrAccidentalText( TestMode::two ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasPrintObject = true; - o->getAttributes()->printObject = YesNo::yes; - o->addDisplayTextOrAccidentalText( tgenDisplayTextOrAccidentalText( TestMode::two ) ); - o->addDisplayTextOrAccidentalText( tgenDisplayTextOrAccidentalText( TestMode::three ) ); - o->addDisplayTextOrAccidentalText( tgenDisplayTextOrAccidentalText( TestMode::two ) ); - o->addDisplayTextOrAccidentalText( tgenDisplayTextOrAccidentalText( TestMode::three ) ); - o->addDisplayTextOrAccidentalText( tgenDisplayTextOrAccidentalText( TestMode::two ) ); - o->addDisplayTextOrAccidentalText( tgenDisplayTextOrAccidentalText( TestMode::one ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + ; + } + break; + case TestMode::two: { + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::no; + o->addDisplayTextOrAccidentalText(tgenDisplayTextOrAccidentalText(TestMode::one)); + o->addDisplayTextOrAccidentalText(tgenDisplayTextOrAccidentalText(TestMode::two)); } - void tgenPartNameDisplayExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->getAttributes()->hasPrintObject = true; + o->getAttributes()->printObject = YesNo::yes; + o->addDisplayTextOrAccidentalText(tgenDisplayTextOrAccidentalText(TestMode::two)); + o->addDisplayTextOrAccidentalText(tgenDisplayTextOrAccidentalText(TestMode::three)); + o->addDisplayTextOrAccidentalText(tgenDisplayTextOrAccidentalText(TestMode::two)); + o->addDisplayTextOrAccidentalText(tgenDisplayTextOrAccidentalText(TestMode::three)); + o->addDisplayTextOrAccidentalText(tgenDisplayTextOrAccidentalText(TestMode::two)); + o->addDisplayTextOrAccidentalText(tgenDisplayTextOrAccidentalText(TestMode::one)); + } + break; + default: + break; + } + return o; +} + +void tgenPartNameDisplayExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(flat-flat)" ); - streamLine( os, i+1, R"(two)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(two)" ); - streamLine( os, i+1, R"(three)" ); - streamLine( os, i+1, R"(two)" ); - streamLine( os, i+1, R"(three)" ); - streamLine( os, i+1, R"(two)" ); - streamLine( os, i+1, R"(flat-flat)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(flat-flat)"); + streamLine(os, i + 1, R"(two)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(two)"); + streamLine(os, i + 1, R"(three)"); + streamLine(os, i + 1, R"(two)"); + streamLine(os, i + 1, R"(three)"); + streamLine(os, i + 1, R"(two)"); + streamLine(os, i + 1, R"(flat-flat)"); + streamLine(os, i, R"()", false); } - DisplayTextOrAccidentalTextPtr tgenDisplayTextOrAccidentalText( TestMode v ) + break; + default: + break; + } +} + +DisplayTextOrAccidentalTextPtr tgenDisplayTextOrAccidentalText(TestMode v) +{ + DisplayTextOrAccidentalTextPtr o = makeDisplayTextOrAccidentalText(); + switch (v) { - DisplayTextOrAccidentalTextPtr o = makeDisplayTextOrAccidentalText(); - switch ( v ) - { - case TestMode::one: - { - o->setChoice( DisplayTextOrAccidentalText::Choice::accidentalText ); - o->getAccidentalText()->setValue( AccidentalValue::flatFlat ); - o->getAccidentalText()->getAttributes()->hasEnclosure = true; - o->getAccidentalText()->getAttributes()->enclosure = EnclosureShape::oval; - - } - break; - case TestMode::two: - { - o->setChoice( DisplayTextOrAccidentalText::Choice::displayText ); - o->getDisplayText()->setValue( XsString( "two" ) ); - o->getDisplayText()->getAttributes()->hasJustify = true; - o->getDisplayText()->getAttributes()->justify = LeftCenterRight::center; - } - break; - case TestMode::three: - { - o->setChoice( DisplayTextOrAccidentalText::Choice::displayText ); - o->getDisplayText()->setValue( XsString( "three" ) ); - o->getDisplayText()->getAttributes()->hasEnclosure = false; - o->getDisplayText()->getAttributes()->hasHalign = true; - o->getDisplayText()->getAttributes()->halign = LeftCenterRight::right; - o->getDisplayText()->getAttributes()->hasFontWeight = true; - o->getDisplayText()->getAttributes()->fontWeight = FontWeight::bold; - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setChoice(DisplayTextOrAccidentalText::Choice::accidentalText); + o->getAccidentalText()->setValue(AccidentalValue::flatFlat); + o->getAccidentalText()->getAttributes()->hasEnclosure = true; + o->getAccidentalText()->getAttributes()->enclosure = EnclosureShape::oval; + } + break; + case TestMode::two: { + o->setChoice(DisplayTextOrAccidentalText::Choice::displayText); + o->getDisplayText()->setValue(XsString("two")); + o->getDisplayText()->getAttributes()->hasJustify = true; + o->getDisplayText()->getAttributes()->justify = LeftCenterRight::center; + } + break; + case TestMode::three: { + o->setChoice(DisplayTextOrAccidentalText::Choice::displayText); + o->getDisplayText()->setValue(XsString("three")); + o->getDisplayText()->getAttributes()->hasEnclosure = false; + o->getDisplayText()->getAttributes()->hasHalign = true; + o->getDisplayText()->getAttributes()->halign = LeftCenterRight::right; + o->getDisplayText()->getAttributes()->hasFontWeight = true; + o->getDisplayText()->getAttributes()->fontWeight = FontWeight::bold; + } + break; + default: + break; } + return o; } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartNameDisplayTest.h b/Sourcecode/private/mxtest/core/PartNameDisplayTest.h index 06283d718..8df9ca1ae 100644 --- a/Sourcecode/private/mxtest/core/PartNameDisplayTest.h +++ b/Sourcecode/private/mxtest/core/PartNameDisplayTest.h @@ -6,14 +6,14 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::DisplayTextOrAccidentalTextPtr tgenDisplayTextOrAccidentalText( TestMode v ); - mx::core::PartNameDisplayPtr tgenPartNameDisplay( TestMode v ); - void tgenPartNameDisplayExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::DisplayTextOrAccidentalTextPtr tgenDisplayTextOrAccidentalText(TestMode v); +mx::core::PartNameDisplayPtr tgenPartNameDisplay(TestMode v); +void tgenPartNameDisplayExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartNameTest.cpp b/Sourcecode/private/mxtest/core/PartNameTest.cpp index ccaa4ce32..0878102a1 100644 --- a/Sourcecode/private/mxtest/core/PartNameTest.cpp +++ b/Sourcecode/private/mxtest/core/PartNameTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, PartName ) +TEST(Test01, PartName) { - std::string indentString( INDENT ); - XsString value1{ "Flute" }; - XsString value2{ "Oboe" }; - PartName object1; - PartName object2( value2 ); - PartNameAttributesPtr attributes1 = std::make_shared(); - PartNameAttributesPtr attributesNull; + std::string indentString(INDENT); + XsString value1{"Flute"}; + XsString value2{"Oboe"}; + PartName object1; + PartName object2(value2); + PartNameAttributesPtr attributes1 = std::make_shared(); + PartNameAttributesPtr attributesNull; attributes1->hasFontStyle = true; attributes1->fontStyle = FontStyle::italic; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Oboe)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + /* set some attribute1 values here */ + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Oboe)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PartSymbolTest.cpp b/Sourcecode/private/mxtest/core/PartSymbolTest.cpp index e2c26aa2c..510d5d71e 100644 --- a/Sourcecode/private/mxtest/core/PartSymbolTest.cpp +++ b/Sourcecode/private/mxtest/core/PartSymbolTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, PartSymbol ) +TEST(Test01, PartSymbol) { - std::string indentString( INDENT ); - GroupSymbolValue value1 = GroupSymbolValue::brace; - GroupSymbolValue value2 = GroupSymbolValue::square; - PartSymbol object1; - PartSymbol object2( value2 ); - PartSymbolAttributesPtr attributes1 = std::make_shared(); - PartSymbolAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + GroupSymbolValue value1 = GroupSymbolValue::brace; + GroupSymbolValue value2 = GroupSymbolValue::square; + PartSymbol object1; + PartSymbol object2(value2); + PartSymbolAttributesPtr attributes1 = std::make_shared(); + PartSymbolAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasTopStaff = true; - attributes1->topStaff = StaffNumber{ 3 }; + attributes1->topStaff = StaffNumber{3}; attributes1->hasBottomStaff = true; - attributes1->bottomStaff = StaffNumber{ 15 }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(none)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(square)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->bottomStaff = StaffNumber{15}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(none)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(square)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PartwiseMeasureTest.cpp b/Sourcecode/private/mxtest/core/PartwiseMeasureTest.cpp index c81c6d8fd..9a816a071 100644 --- a/Sourcecode/private/mxtest/core/PartwiseMeasureTest.cpp +++ b/Sourcecode/private/mxtest/core/PartwiseMeasureTest.cpp @@ -7,117 +7,112 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/PartwiseMeasureTest.h" #include "mxtest/core/MusicDataGroupTest.h" +#include "mxtest/core/PartwiseMeasureTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Measure ) +TEST(Test01, Measure) { TestMode v = TestMode::one; - PartwiseMeasurePtr object = tgenPartwiseMeasure( v ); - stringstream expected; - tgenPartwiseMeasureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + PartwiseMeasurePtr object = tgenPartwiseMeasure(v); + stringstream expected; + tgenPartwiseMeasureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Measure ) + +TEST(Test02, Measure) { TestMode v = TestMode::two; - PartwiseMeasurePtr object = tgenPartwiseMeasure( v ); - stringstream expected; - tgenPartwiseMeasureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartwiseMeasurePtr object = tgenPartwiseMeasure(v); + stringstream expected; + tgenPartwiseMeasureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Measure ) + +TEST(Test03, Measure) { TestMode v = TestMode::three; - PartwiseMeasurePtr object = tgenPartwiseMeasure( v ); - stringstream expected; - tgenPartwiseMeasureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartwiseMeasurePtr object = tgenPartwiseMeasure(v); + stringstream expected; + tgenPartwiseMeasureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PartwiseMeasurePtr tgenPartwiseMeasure( TestMode v ) +PartwiseMeasurePtr tgenPartwiseMeasure(TestMode v) +{ + PartwiseMeasurePtr o = makePartwiseMeasure(); + switch (v) { - PartwiseMeasurePtr o = makePartwiseMeasure(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->number = XsToken( "200" ); - o->setMusicDataGroup( tgenMusicDataGroup( v ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->number = XsToken( "300" ); - o->getAttributes()->hasImplicit = true; - o->getAttributes()->implicit = YesNo::no; - o->getAttributes()->hasWidth = true; - o->getAttributes()->width = TenthsValue( 45.1 ); - o->setMusicDataGroup( tgenMusicDataGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->number = XsToken("200"); + o->setMusicDataGroup(tgenMusicDataGroup(v)); + } + break; + case TestMode::three: { + o->getAttributes()->number = XsToken("300"); + o->getAttributes()->hasImplicit = true; + o->getAttributes()->implicit = YesNo::no; + o->getAttributes()->hasWidth = true; + o->getAttributes()->width = TenthsValue(45.1); + o->setMusicDataGroup(tgenMusicDataGroup(v)); + } + break; + default: + break; } - void tgenPartwiseMeasureExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenPartwiseMeasureExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenMusicDataGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenMusicDataGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenMusicDataGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenMusicDataGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/PartwiseMeasureTest.h b/Sourcecode/private/mxtest/core/PartwiseMeasureTest.h index 59e5ba7e1..bf8f63b9c 100644 --- a/Sourcecode/private/mxtest/core/PartwiseMeasureTest.h +++ b/Sourcecode/private/mxtest/core/PartwiseMeasureTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PartwiseMeasurePtr tgenPartwiseMeasure( TestMode v ); - void tgenPartwiseMeasureExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PartwiseMeasurePtr tgenPartwiseMeasure(TestMode v); +void tgenPartwiseMeasureExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartwisePartTest.cpp b/Sourcecode/private/mxtest/core/PartwisePartTest.cpp index cd2f90446..886d7ea4a 100644 --- a/Sourcecode/private/mxtest/core/PartwisePartTest.cpp +++ b/Sourcecode/private/mxtest/core/PartwisePartTest.cpp @@ -7,123 +7,119 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/PartwisePartTest.h" #include "mxtest/core/PartwiseMeasureTest.h" +#include "mxtest/core/PartwisePartTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PartwisePart ) +TEST(Test01, PartwisePart) { TestMode v = TestMode::one; - PartwisePartPtr object = tgenPartwisePart( v ); - stringstream expected; - tgenPartwisePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartwisePartPtr object = tgenPartwisePart(v); + stringstream expected; + tgenPartwisePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, PartwisePart ) + +TEST(Test02, PartwisePart) { TestMode v = TestMode::two; - PartwisePartPtr object = tgenPartwisePart( v ); - stringstream expected; - tgenPartwisePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartwisePartPtr object = tgenPartwisePart(v); + stringstream expected; + tgenPartwisePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, PartwisePart ) + +TEST(Test03, PartwisePart) { TestMode v = TestMode::three; - PartwisePartPtr object = tgenPartwisePart( v ); - stringstream expected; - tgenPartwisePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PartwisePartPtr object = tgenPartwisePart(v); + stringstream expected; + tgenPartwisePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PartwisePartPtr tgenPartwisePart( TestMode v ) +PartwisePartPtr tgenPartwisePart(TestMode v) +{ + PartwisePartPtr o = makePartwisePart(); + switch (v) { - PartwisePartPtr o = makePartwisePart(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->id = XsIDREF( "IDTWO" ); - o->addPartwiseMeasure( tgenPartwiseMeasure( v ) ); - o->removePartwiseMeasure( o->getPartwiseMeasureSet().cbegin() ); - o->addPartwiseMeasure( tgenPartwiseMeasure( TestMode::three ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->id = XsIDREF( "ID3" ); - o->addPartwiseMeasure( tgenPartwiseMeasure( v ) ); - o->removePartwiseMeasure( o->getPartwiseMeasureSet().cbegin() ); - o->addPartwiseMeasure( tgenPartwiseMeasure( TestMode::two ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->id = XsIDREF("IDTWO"); + o->addPartwiseMeasure(tgenPartwiseMeasure(v)); + o->removePartwiseMeasure(o->getPartwiseMeasureSet().cbegin()); + o->addPartwiseMeasure(tgenPartwiseMeasure(TestMode::three)); + } + break; + case TestMode::three: { + o->getAttributes()->id = XsIDREF("ID3"); + o->addPartwiseMeasure(tgenPartwiseMeasure(v)); + o->removePartwiseMeasure(o->getPartwiseMeasureSet().cbegin()); + o->addPartwiseMeasure(tgenPartwiseMeasure(TestMode::two)); + } + break; + default: + break; } - void tgenPartwisePartExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenPartwisePartExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenPartwiseMeasureExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenPartwiseMeasureExpected( os, i+1, v ); - os << std::endl; - tgenPartwiseMeasureExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenPartwiseMeasureExpected( os, i+1, v ); - os << std::endl; - tgenPartwiseMeasureExpected(os, i+1, TestMode::two ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenPartwiseMeasureExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenPartwiseMeasureExpected(os, i + 1, v); + os << std::endl; + tgenPartwiseMeasureExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenPartwiseMeasureExpected(os, i + 1, v); + os << std::endl; + tgenPartwiseMeasureExpected(os, i + 1, TestMode::two); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PartwisePartTest.h b/Sourcecode/private/mxtest/core/PartwisePartTest.h index b229aca7a..b06e60718 100644 --- a/Sourcecode/private/mxtest/core/PartwisePartTest.h +++ b/Sourcecode/private/mxtest/core/PartwisePartTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PartwisePartPtr tgenPartwisePart( TestMode v ); - void tgenPartwisePartExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PartwisePartPtr tgenPartwisePart(TestMode v); +void tgenPartwisePartExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PedalAlterTest.cpp b/Sourcecode/private/mxtest/core/PedalAlterTest.cpp index ea91b916e..468e57f1a 100644 --- a/Sourcecode/private/mxtest/core/PedalAlterTest.cpp +++ b/Sourcecode/private/mxtest/core/PedalAlterTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, PedalAlter ) +TEST(Test01, PedalAlter) { - std::string indentString( INDENT ); - Semitones value1{ -0.1 }; - Semitones value2{ 2.02 }; - PedalAlter object1; - PedalAlter object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2.02)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Semitones value1{-0.1}; + Semitones value2{2.02}; + PedalAlter object1; + PedalAlter object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2.02)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PedalStepTest.cpp b/Sourcecode/private/mxtest/core/PedalStepTest.cpp index 7681eb479..14d563000 100644 --- a/Sourcecode/private/mxtest/core/PedalStepTest.cpp +++ b/Sourcecode/private/mxtest/core/PedalStepTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, PedalStep ) +TEST(Test01, PedalStep) { - std::string indentString( INDENT ); - StepEnum value1 = StepEnum::b; - StepEnum value2 = StepEnum::f; - PedalStep object1; - PedalStep object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(A)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(F)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StepEnum value1 = StepEnum::b; + StepEnum value2 = StepEnum::f; + PedalStep object1; + PedalStep object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(A)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(F)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PedalTest.cpp b/Sourcecode/private/mxtest/core/PedalTest.cpp index 122ceeb96..01e0d0f90 100644 --- a/Sourcecode/private/mxtest/core/PedalTest.cpp +++ b/Sourcecode/private/mxtest/core/PedalTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Pedal ) +TEST(Test01, Pedal) { - std::string indentString( INDENT ); - Pedal object1; - Pedal object2; - PedalAttributesPtr attributes1 = std::make_shared(); - PedalAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Pedal object1; + Pedal object2; + PedalAttributesPtr attributes1 = std::make_shared(); + PedalAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->type = StartStopChangeContinue::change; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/PedalTuningTest.cpp b/Sourcecode/private/mxtest/core/PedalTuningTest.cpp index 8aac04684..d58c3be2c 100644 --- a/Sourcecode/private/mxtest/core/PedalTuningTest.cpp +++ b/Sourcecode/private/mxtest/core/PedalTuningTest.cpp @@ -6,44 +6,45 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, PedalTuning ) +TEST(Test01, PedalTuning) { - PedalTuning object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(A)" ); - streamLine( expected, 2, R"(0)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + PedalTuning object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(A)"); + streamLine(expected, 2, R"(0)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, PedalTuning ) + +TEST(Test02, PedalTuning) { - PedalTuning object; - object.getPedalStep()->setValue( StepEnum::e ); - object.getPedalAlter()->setValue( Semitones( -1 ) ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(E)" ); - streamLine( expected, 2, R"(-1)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + PedalTuning object; + object.getPedalStep()->setValue(StepEnum::e); + object.getPedalAlter()->setValue(Semitones(-1)); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(E)"); + streamLine(expected, 2, R"(-1)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/PerMinuteTest.cpp b/Sourcecode/private/mxtest/core/PerMinuteTest.cpp index 15e89f92d..e7e517b8f 100644 --- a/Sourcecode/private/mxtest/core/PerMinuteTest.cpp +++ b/Sourcecode/private/mxtest/core/PerMinuteTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, PerMinute ) +TEST(Test01, PerMinute) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "DEF" }; - PerMinute object1; - PerMinute object2( value2 ); - PerMinuteAttributesPtr attributes1 = std::make_shared(); - PerMinuteAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"DEF"}; + PerMinute object1; + PerMinute object2(value2); + PerMinuteAttributesPtr attributes1 = std::make_shared(); + PerMinuteAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontWeight = true; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(DEF)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(DEF)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PercussionTest.cpp b/Sourcecode/private/mxtest/core/PercussionTest.cpp index eaca9c7dc..dc6f3a185 100644 --- a/Sourcecode/private/mxtest/core/PercussionTest.cpp +++ b/Sourcecode/private/mxtest/core/PercussionTest.cpp @@ -6,141 +6,136 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PercussionTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Percussion ) +TEST(Test01, Percussion) { TestMode v = TestMode::one; - PercussionPtr object = tgenPercussion( v ); - stringstream expected; - tgenPercussionExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PercussionPtr object = tgenPercussion(v); + stringstream expected; + tgenPercussionExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Percussion ) + +TEST(Test02, Percussion) { TestMode v = TestMode::two; - PercussionPtr object = tgenPercussion( v ); - stringstream expected; - tgenPercussionExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PercussionPtr object = tgenPercussion(v); + stringstream expected; + tgenPercussionExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Percussion ) + +TEST(Test03, Percussion) { TestMode v = TestMode::three; - PercussionPtr object = tgenPercussion( v ); - stringstream expected; - tgenPercussionExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PercussionPtr object = tgenPercussion(v); + stringstream expected; + tgenPercussionExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PercussionPtr tgenPercussion( TestMode v ) +PercussionPtr tgenPercussion(TestMode v) +{ + PercussionPtr o = makePercussion(); + switch (v) { - PercussionPtr o = makePercussion(); - switch ( v ) - { - case TestMode::one: - { - ; - } - break; - case TestMode::two: - { - o->setPercussionChoice( tgenPercussionChoice( v ) ); - o->getAttributes()->hasValign = true; - o->getAttributes()->valign = Valign::baseline; - } - break; - case TestMode::three: - { - o->setPercussionChoice( tgenPercussionChoice( v ) ); - o->getAttributes()->hasHalign = true; - o->getAttributes()->halign = LeftCenterRight::center; - } - break; - default: - break; - } - return o; + case TestMode::one: { + ; + } + break; + case TestMode::two: { + o->setPercussionChoice(tgenPercussionChoice(v)); + o->getAttributes()->hasValign = true; + o->getAttributes()->valign = Valign::baseline; } - void tgenPercussionExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->setPercussionChoice(tgenPercussionChoice(v)); + o->getAttributes()->hasHalign = true; + o->getAttributes()->halign = LeftCenterRight::center; + } + break; + default: + break; + } + return o; +} + +void tgenPercussionExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(wind chimes)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(claves)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Hello)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(wind chimes)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(claves)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Hello)"); + streamLine(os, i, R"()", false); } - PercussionChoicePtr tgenPercussionChoice( TestMode v ) + break; + default: + break; + } +} + +PercussionChoicePtr tgenPercussionChoice(TestMode v) +{ + PercussionChoicePtr o = makePercussionChoice(); + switch (v) { - PercussionChoicePtr o = makePercussionChoice(); - switch ( v ) - { - case TestMode::one: - { - o->setChoice( PercussionChoice::Choice::stickType ); - } - break; - case TestMode::two: - { - o->setChoice( PercussionChoice::Choice::wood ); - } - break; - case TestMode::three: - { - o->setChoice( PercussionChoice::Choice::otherPercussion ); - o->getOtherPercussion()->setValue( XsString("Hello" ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->setChoice(PercussionChoice::Choice::stickType); + } + break; + case TestMode::two: { + o->setChoice(PercussionChoice::Choice::wood); + } + break; + case TestMode::three: { + o->setChoice(PercussionChoice::Choice::otherPercussion); + o->getOtherPercussion()->setValue(XsString("Hello")); + } + break; + default: + break; } + return o; } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PercussionTest.h b/Sourcecode/private/mxtest/core/PercussionTest.h index 92c9d5020..340fd549c 100644 --- a/Sourcecode/private/mxtest/core/PercussionTest.h +++ b/Sourcecode/private/mxtest/core/PercussionTest.h @@ -6,14 +6,14 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PercussionChoicePtr tgenPercussionChoice( TestMode v ); - mx::core::PercussionPtr tgenPercussion( TestMode v ); - void tgenPercussionExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PercussionChoicePtr tgenPercussionChoice(TestMode v); +mx::core::PercussionPtr tgenPercussion(TestMode v); +void tgenPercussionExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PitchTest.cpp b/Sourcecode/private/mxtest/core/PitchTest.cpp index 6c678c1e2..415e57ab3 100644 --- a/Sourcecode/private/mxtest/core/PitchTest.cpp +++ b/Sourcecode/private/mxtest/core/PitchTest.cpp @@ -8,118 +8,114 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PitchTest.h" -#include "mxtest/core/SystemMarginsTest.h" #include "mxtest/core/SystemDividersTest.h" +#include "mxtest/core/SystemMarginsTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Pitch ) +TEST(Test01, Pitch) { TestMode v = TestMode::one; - PitchPtr object = tgenPitch( v ); - stringstream expected; - tgenPitchExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PitchPtr object = tgenPitch(v); + stringstream expected; + tgenPitchExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Pitch ) + +TEST(Test02, Pitch) { TestMode v = TestMode::two; - PitchPtr object = tgenPitch( v ); - stringstream expected; - tgenPitchExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PitchPtr object = tgenPitch(v); + stringstream expected; + tgenPitchExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Pitch ) + +TEST(Test03, Pitch) { TestMode v = TestMode::three; - PitchPtr object = tgenPitch( v ); - stringstream expected; - tgenPitchExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PitchPtr object = tgenPitch(v); + stringstream expected; + tgenPitchExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PitchPtr tgenPitch( TestMode v ) +PitchPtr tgenPitch(TestMode v) +{ + PitchPtr o = makePitch(); + switch (v) { - PitchPtr o = makePitch(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getOctave()->setValue( OctaveValue( 3 ) ); - o->getStep()->setValue( StepEnum::d ); - } - break; - case TestMode::three: - { - o->getOctave()->setValue( OctaveValue( 6 ) ); - o->getStep()->setValue( StepEnum::e ); - o->setHasAlter( true ); - o->getAlter()->setValue( Semitones( -1.1 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getOctave()->setValue(OctaveValue(3)); + o->getStep()->setValue(StepEnum::d); + } + break; + case TestMode::three: { + o->getOctave()->setValue(OctaveValue(6)); + o->getStep()->setValue(StepEnum::e); + o->setHasAlter(true); + o->getAlter()->setValue(Semitones(-1.1)); + } + break; + default: + break; } - void tgenPitchExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenPitchExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(A)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(D)" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(E)" ); - streamLine( os, i+1, R"(-1.1)" ); - streamLine( os, i+1, R"(6)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(A)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(D)"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(E)"); + streamLine(os, i + 1, R"(-1.1)"); + streamLine(os, i + 1, R"(6)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PitchTest.h b/Sourcecode/private/mxtest/core/PitchTest.h index b309b9944..b82008248 100644 --- a/Sourcecode/private/mxtest/core/PitchTest.h +++ b/Sourcecode/private/mxtest/core/PitchTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PitchPtr tgenPitch( TestMode v ); - void tgenPitchExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PitchPtr tgenPitch(TestMode v); +void tgenPitchExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PitchedTest.cpp b/Sourcecode/private/mxtest/core/PitchedTest.cpp index bdab5f0aa..027a250fb 100644 --- a/Sourcecode/private/mxtest/core/PitchedTest.cpp +++ b/Sourcecode/private/mxtest/core/PitchedTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Pitched ) +TEST(Test01, Pitched) { - std::string indentString( INDENT ); - PitchedEnum value1 = PitchedEnum::marimba; - PitchedEnum value2 = PitchedEnum::vibraphone; - Pitched object1; - Pitched object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(xylophone)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(vibraphone)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + PitchedEnum value1 = PitchedEnum::marimba; + PitchedEnum value2 = PitchedEnum::vibraphone; + Pitched object1; + Pitched object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(xylophone)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(vibraphone)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PlayTest.cpp b/Sourcecode/private/mxtest/core/PlayTest.cpp index 47ec72b21..18ea48c16 100644 --- a/Sourcecode/private/mxtest/core/PlayTest.cpp +++ b/Sourcecode/private/mxtest/core/PlayTest.cpp @@ -6,114 +6,110 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PlayTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Play ) +TEST(Test01, Play) { TestMode v = TestMode::one; - PlayPtr object = tgenPlay( v ); - stringstream expected; - tgenPlayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PlayPtr object = tgenPlay(v); + stringstream expected; + tgenPlayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Play ) + +TEST(Test02, Play) { TestMode v = TestMode::two; - PlayPtr object = tgenPlay( v ); - stringstream expected; - tgenPlayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PlayPtr object = tgenPlay(v); + stringstream expected; + tgenPlayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Play ) + +TEST(Test03, Play) { TestMode v = TestMode::three; - PlayPtr object = tgenPlay( v ); - stringstream expected; - tgenPlayExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PlayPtr object = tgenPlay(v); + stringstream expected; + tgenPlayExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PlayPtr tgenPlay( TestMode v ) +PlayPtr tgenPlay(TestMode v) +{ + PlayPtr o = makePlay(); + switch (v) { - PlayPtr o = makePlay(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( Play::Choice::mute ); - o->getMute()->setValue( MuteEnum::hat ); - } - break; - case TestMode::three: - { - o->setChoice( Play::Choice::otherPlay ); - o->getOtherPlay()->setValue( XsString( "SomeString" ) ); - o->getOtherPlay()->getAttributes()->type = XsToken( "sometype" ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(Play::Choice::mute); + o->getMute()->setValue(MuteEnum::hat); + } + break; + case TestMode::three: { + o->setChoice(Play::Choice::otherPlay); + o->getOtherPlay()->setValue(XsString("SomeString")); + o->getOtherPlay()->getAttributes()->type = XsToken("sometype"); + } + break; + default: + break; } - void tgenPlayExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenPlayExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(hat)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(SomeString)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(hat)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(SomeString)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PlayTest.h b/Sourcecode/private/mxtest/core/PlayTest.h index 8ef1ece96..d8f0dd611 100644 --- a/Sourcecode/private/mxtest/core/PlayTest.h +++ b/Sourcecode/private/mxtest/core/PlayTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PlayPtr tgenPlay( TestMode v ); - void tgenPlayExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PlayPtr tgenPlay(TestMode v); +void tgenPlayExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PlopTest.cpp b/Sourcecode/private/mxtest/core/PlopTest.cpp index 0e72785f3..3cf26b198 100644 --- a/Sourcecode/private/mxtest/core/PlopTest.cpp +++ b/Sourcecode/private/mxtest/core/PlopTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Plop ) +TEST(Test01, Plop) { - std::string indentString( INDENT ); - Plop object1; - Plop object2; - EmptyLineAttributesPtr attributes1 = std::make_shared(); - EmptyLineAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Plop object1; + Plop object2; + EmptyLineAttributesPtr attributes1 = std::make_shared(); + EmptyLineAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/PluckTest.cpp b/Sourcecode/private/mxtest/core/PluckTest.cpp index 72dbdf569..ab41e980c 100644 --- a/Sourcecode/private/mxtest/core/PluckTest.cpp +++ b/Sourcecode/private/mxtest/core/PluckTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, Pluck ) +TEST(Test01, Pluck) { - std::string indentString( INDENT ); - XsString value1{ "One" }; - XsString value2{ "Two" }; - Pluck object1; - Pluck object2( value2 ); - PluckAttributesPtr attributes1 = std::make_shared(); - PluckAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"One"}; + XsString value2{"Two"}; + Pluck object1; + Pluck object2(value2); + PluckAttributesPtr attributes1 = std::make_shared(); + PluckAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasRelativeX = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Two)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Two)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp b/Sourcecode/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp index df589239a..d8eeb2717 100644 --- a/Sourcecode/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp +++ b/Sourcecode/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp @@ -11,75 +11,80 @@ using namespace mx::core; -TEST( PositiveIntegerOrEmpty01, PositiveIntegerOrEmpty ) +TEST(PositiveIntegerOrEmpty01, PositiveIntegerOrEmpty) { PositiveIntegerOrEmpty x; std::string expected = ""; - CHECK( x.getIsEmpty() ) - CHECK( !x.getIsNumber() ) - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + CHECK(x.getIsEmpty()) + CHECK(!x.getIsNumber()) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( PositiveIntegerOrEmpty02, PositiveIntegerOrEmpty ) + +TEST(PositiveIntegerOrEmpty02, PositiveIntegerOrEmpty) { - PositiveIntegerOrEmpty x( PositiveInteger( 31 ) ); - CHECK( !x.getIsEmpty() ) - CHECK( x.getIsNumber() ) + PositiveIntegerOrEmpty x(PositiveInteger(31)); + CHECK(!x.getIsEmpty()) + CHECK(x.getIsNumber()) std::string expected = "31"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( PositiveIntegerOrEmpty03, PositiveIntegerOrEmpty ) + +TEST(PositiveIntegerOrEmpty03, PositiveIntegerOrEmpty) { - PositiveIntegerOrEmpty x( "" ); - CHECK( x.getIsEmpty() ) - CHECK( !x.getIsNumber() ) + PositiveIntegerOrEmpty x(""); + CHECK(x.getIsEmpty()) + CHECK(!x.getIsNumber()) std::string expected = ""; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( PositiveIntegerOrEmpty04, PositiveIntegerOrEmpty ) + +TEST(PositiveIntegerOrEmpty04, PositiveIntegerOrEmpty) { - PositiveIntegerOrEmpty x( "XXX" ); - CHECK( !x.getIsEmpty() ) - CHECK( x.getIsNumber() ) + PositiveIntegerOrEmpty x("XXX"); + CHECK(!x.getIsEmpty()) + CHECK(x.getIsNumber()) std::string expected = "1"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( PositiveIntegerOrEmpty05, PositiveIntegerOrEmpty ) + +TEST(PositiveIntegerOrEmpty05, PositiveIntegerOrEmpty) { - PositiveIntegerOrEmpty x( "24" ); - CHECK( ! x.getIsEmpty() ) - CHECK( x.getIsNumber() ) + PositiveIntegerOrEmpty x("24"); + CHECK(!x.getIsEmpty()) + CHECK(x.getIsNumber()) IntType expected = 24; IntType actual = x.getValueNumber().getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveIntegerOrEmpty06, PositiveIntegerOrEmpty ) + +TEST(PositiveIntegerOrEmpty06, PositiveIntegerOrEmpty) { - PositiveIntegerOrEmpty x( "24" ); + PositiveIntegerOrEmpty x("24"); x.setValueEmpty(); - CHECK( x.getIsEmpty() ) - CHECK( ! x.getIsNumber() ) + CHECK(x.getIsEmpty()) + CHECK(!x.getIsNumber()) std::string expected = ""; std::stringstream ss; ss << x; std::string actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( PositiveIntegerOrEmpty07, PositiveIntegerOrEmpty ) +TEST(PositiveIntegerOrEmpty07, PositiveIntegerOrEmpty) { - PositiveIntegerOrEmpty x( "" ); - x.setValue( PositiveInteger( 30 ) ); - CHECK( ! x.getIsEmpty() ) - CHECK( x.getIsNumber() ) + PositiveIntegerOrEmpty x(""); + x.setValue(PositiveInteger(30)); + CHECK(!x.getIsEmpty()) + CHECK(x.getIsNumber()) std::string expected = "30"; std::stringstream ss; - toStream( ss, x ); + toStream(ss, x); std::string actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } #endif diff --git a/Sourcecode/private/mxtest/core/PreBendTest.cpp b/Sourcecode/private/mxtest/core/PreBendTest.cpp index 090bbfb65..6503e9ed7 100644 --- a/Sourcecode/private/mxtest/core/PreBendTest.cpp +++ b/Sourcecode/private/mxtest/core/PreBendTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, PreBend ) +TEST(Test01, PreBend) { - std::string indentString( INDENT ); - PreBend object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + PreBend object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/PreciseDecimalTest.cpp b/Sourcecode/private/mxtest/core/PreciseDecimalTest.cpp index 88187b91b..fc47eeb22 100644 --- a/Sourcecode/private/mxtest/core/PreciseDecimalTest.cpp +++ b/Sourcecode/private/mxtest/core/PreciseDecimalTest.cpp @@ -11,155 +11,155 @@ using namespace mx::core; -TEST( ctorSSD, PreciseDecimalTest ) +TEST(ctorSSD, PreciseDecimalTest) { - PreciseDecimal d{ 3, 2, 123.45 }; - CHECK_EQUAL( 3, d.getMaxIntegerDigits() ); - CHECK_EQUAL( 2, d.getMaxDecimalDigits() ); - CHECK_DOUBLES_EQUAL( 999.99, d.getMaxExpressibleNumber(), 0.00001 ); - CHECK_DOUBLES_EQUAL( -999.99, d.getMinExpressibleNumber(), 0.00001 ); - CHECK_DOUBLES_EQUAL( 123.45, d.getValue(), 0.00002 ); + PreciseDecimal d{3, 2, 123.45}; + CHECK_EQUAL(3, d.getMaxIntegerDigits()); + CHECK_EQUAL(2, d.getMaxDecimalDigits()); + CHECK_DOUBLES_EQUAL(999.99, d.getMaxExpressibleNumber(), 0.00001); + CHECK_DOUBLES_EQUAL(-999.99, d.getMinExpressibleNumber(), 0.00001); + CHECK_DOUBLES_EQUAL(123.45, d.getValue(), 0.00002); } -T_END; +T_END; -TEST( ctorSS, PreciseDecimalTest ) +TEST(ctorSS, PreciseDecimalTest) { - PreciseDecimal d{ 4, 1 }; - CHECK_EQUAL( 4, d.getMaxIntegerDigits() ); - CHECK_EQUAL( 1, d.getMaxDecimalDigits() ); - CHECK_DOUBLES_EQUAL( 9999.9, d.getMaxExpressibleNumber(), 0.00001 ); - CHECK_DOUBLES_EQUAL( -9999.9, d.getMinExpressibleNumber(), 0.00001 ); - CHECK_DOUBLES_EQUAL( 0, d.getValue(), 0.00001 ); + PreciseDecimal d{4, 1}; + CHECK_EQUAL(4, d.getMaxIntegerDigits()); + CHECK_EQUAL(1, d.getMaxDecimalDigits()); + CHECK_DOUBLES_EQUAL(9999.9, d.getMaxExpressibleNumber(), 0.00001); + CHECK_DOUBLES_EQUAL(-9999.9, d.getMinExpressibleNumber(), 0.00001); + CHECK_DOUBLES_EQUAL(0, d.getValue(), 0.00001); } -T_END; +T_END; -TEST( ctorD, PreciseDecimalTest ) +TEST(ctorD, PreciseDecimalTest) { - PreciseDecimal d{ 44.33 }; - CHECK_EQUAL( 10, d.getMaxIntegerDigits() ); - CHECK_EQUAL( 6, d.getMaxDecimalDigits() ); - CHECK_DOUBLES_EQUAL( 9999999999.99999, d.getMaxExpressibleNumber(), 0.1 ); - CHECK_DOUBLES_EQUAL( -9999999999.99999, d.getMinExpressibleNumber(), 0.1 ); - CHECK_DOUBLES_EQUAL( 44.33, d.getValue(), 0.00001 ); + PreciseDecimal d{44.33}; + CHECK_EQUAL(10, d.getMaxIntegerDigits()); + CHECK_EQUAL(6, d.getMaxDecimalDigits()); + CHECK_DOUBLES_EQUAL(9999999999.99999, d.getMaxExpressibleNumber(), 0.1); + CHECK_DOUBLES_EQUAL(-9999999999.99999, d.getMinExpressibleNumber(), 0.1); + CHECK_DOUBLES_EQUAL(44.33, d.getValue(), 0.00001); } -T_END; +T_END; -TEST( ctor, PreciseDecimalTest ) +TEST(ctor, PreciseDecimalTest) { PreciseDecimal d{}; - CHECK_EQUAL( 10, d.getMaxIntegerDigits() ); - CHECK_EQUAL( 6, d.getMaxDecimalDigits() ); - CHECK_DOUBLES_EQUAL( 9999999999.99999, d.getMaxExpressibleNumber(), 0.1 ); - CHECK_DOUBLES_EQUAL( -9999999999.99999, d.getMinExpressibleNumber(), 0.1 ); - CHECK_DOUBLES_EQUAL( 0.0, d.getValue(), 0.00001 ); + CHECK_EQUAL(10, d.getMaxIntegerDigits()); + CHECK_EQUAL(6, d.getMaxDecimalDigits()); + CHECK_DOUBLES_EQUAL(9999999999.99999, d.getMaxExpressibleNumber(), 0.1); + CHECK_DOUBLES_EQUAL(-9999999999.99999, d.getMinExpressibleNumber(), 0.1); + CHECK_DOUBLES_EQUAL(0.0, d.getValue(), 0.00001); } -T_END; +T_END; -TEST( getValue, PreciseDecimalTest ) +TEST(getValue, PreciseDecimalTest) { const DecimalType expected = 123.654; - PreciseDecimal d{ 10, 5, expected }; + PreciseDecimal d{10, 5, expected}; const auto actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, 0.0001 ); + CHECK_DOUBLES_EQUAL(expected, actual, 0.0001); } -T_END; +T_END; -TEST( getValueRounded, PreciseDecimalTest ) +TEST(getValueRounded, PreciseDecimalTest) { const short numIntDigits = 4; const short numDecDeigits = 2; const DecimalType value = 7321.83940239; const DecimalType expected = 7321.84; - PreciseDecimal d{ numIntDigits, numDecDeigits, value }; + PreciseDecimal d{numIntDigits, numDecDeigits, value}; const auto actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, 0.0000001 ); + CHECK_DOUBLES_EQUAL(expected, actual, 0.0000001); } -T_END; +T_END; -TEST( setValue, PreciseDecimalTest ) +TEST(setValue, PreciseDecimalTest) { const DecimalType expected = 8329.9238; const short numIntDigits = 6; const short numDecDeigits = 7; - PreciseDecimal d{ numIntDigits, numDecDeigits, 3458.2342 }; - d.setValue( expected ); + PreciseDecimal d{numIntDigits, numDecDeigits, 3458.2342}; + d.setValue(expected); const auto actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, 0.0001 ); + CHECK_DOUBLES_EQUAL(expected, actual, 0.0001); } -T_END; +T_END; -TEST( setValueRounded, PreciseDecimalTest ) +TEST(setValueRounded, PreciseDecimalTest) { const short numIntDigits = 1; const short numDecDeigits = 1; const DecimalType value = 0.55; const DecimalType expected = 0.6; - PreciseDecimal d{ numIntDigits, numDecDeigits, 1232.1212 }; - d.setValue( value ); + PreciseDecimal d{numIntDigits, numDecDeigits, 1232.1212}; + d.setValue(value); const auto actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, 0.0000001 ); + CHECK_DOUBLES_EQUAL(expected, actual, 0.0000001); } -T_END; +T_END; -TEST( tooBig, PreciseDecimalTest ) +TEST(tooBig, PreciseDecimalTest) { const short numIntDigits = 3; const short numDecDeigits = 1; const DecimalType value = 8769.5; const DecimalType expected = 999.9; - PreciseDecimal d{ numIntDigits, numDecDeigits }; - d.setValue( value ); + PreciseDecimal d{numIntDigits, numDecDeigits}; + d.setValue(value); const auto actual = d.getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, 0.0000001 ); + CHECK_DOUBLES_EQUAL(expected, actual, 0.0000001); } -T_END; +T_END; -TEST( str01, PreciseDecimalTest ) +TEST(str01, PreciseDecimalTest) { const short numIntDigits = 4; const short numDecDeigits = 3; const DecimalType value = 8769.5; const std::string expected = "8769.5"; - PreciseDecimal d{ numIntDigits, numDecDeigits, value }; + PreciseDecimal d{numIntDigits, numDecDeigits, value}; const auto actual = d.toString(); - CHECK_EQUAL( expected, actual ); + CHECK_EQUAL(expected, actual); } -T_END; +T_END; -TEST( str02, PreciseDecimalTest ) +TEST(str02, PreciseDecimalTest) { const short numIntDigits = 4; const short numDecDeigits = 3; const DecimalType value = 1234.99999; const std::string expected = "1235"; - PreciseDecimal d{ numIntDigits, numDecDeigits, value }; + PreciseDecimal d{numIntDigits, numDecDeigits, value}; const auto actual = d.toString(); - CHECK_EQUAL( expected, actual ); + CHECK_EQUAL(expected, actual); } -T_END; +T_END; -TEST( str03, PreciseDecimalTest ) +TEST(str03, PreciseDecimalTest) { const short numIntDigits = 4; const short numDecDeigits = 10; const DecimalType value = -0.0000000001; const std::string expected = "-0.0000000001"; - PreciseDecimal d{ numIntDigits, numDecDeigits, value }; + PreciseDecimal d{numIntDigits, numDecDeigits, value}; const auto actual = d.toString(); - CHECK_EQUAL( expected, actual ); + CHECK_EQUAL(expected, actual); } -T_END; +T_END; #endif diff --git a/Sourcecode/private/mxtest/core/PrefixTest.cpp b/Sourcecode/private/mxtest/core/PrefixTest.cpp index e1749db6b..9aecd545c 100644 --- a/Sourcecode/private/mxtest/core/PrefixTest.cpp +++ b/Sourcecode/private/mxtest/core/PrefixTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Prefix ) +TEST(Test01, Prefix) { - std::string indentString( INDENT ); - XsString value1{ "Premium" }; - XsString value2{ "Unleaded" }; - Prefix object1; - Prefix object2( value2 ); - PrefixAttributesPtr attributes1 = std::make_shared(); - PrefixAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"Premium"}; + XsString value2{"Unleaded"}; + Prefix object1; + Prefix object2(value2); + PrefixAttributesPtr attributes1 = std::make_shared(); + PrefixAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasFontFamily = true; - attributes1->fontFamily = CommaSeparatedText{ "Times New Roman, Courier" }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Unleaded)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->fontFamily = CommaSeparatedText{"Times New Roman, Courier"}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Unleaded)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PrincipalVoiceTest.cpp b/Sourcecode/private/mxtest/core/PrincipalVoiceTest.cpp index 7dd12da99..104fd98d5 100644 --- a/Sourcecode/private/mxtest/core/PrincipalVoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/PrincipalVoiceTest.cpp @@ -11,36 +11,39 @@ using namespace mx::core; -TEST( Test01, PrincipalVoice ) +TEST(Test01, PrincipalVoice) { - std::string indentString( INDENT ); - XsString value1{ "somevoicethingy" }; - XsString value2{ "letters" }; - PrincipalVoice object1; - PrincipalVoice object2( value2 ); - PrincipalVoiceAttributesPtr attributes1 = std::make_shared(); - PrincipalVoiceAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"somevoicethingy"}; + XsString value2{"letters"}; + PrincipalVoice object1; + PrincipalVoice object2(value2); + PrincipalVoiceAttributesPtr attributes1 = std::make_shared(); + PrincipalVoiceAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->symbol = PrincipalVoiceSymbol::hauptstimme; attributes1->type = StartStop::stop; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(letters)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"(letters)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/PrintTest.cpp b/Sourcecode/private/mxtest/core/PrintTest.cpp index 64435d5ac..256c8364c 100644 --- a/Sourcecode/private/mxtest/core/PrintTest.cpp +++ b/Sourcecode/private/mxtest/core/PrintTest.cpp @@ -7,150 +7,145 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/PrintTest.h" #include "mxtest/core/LayoutGroupTest.h" #include "mxtest/core/MeasureLayoutTest.h" -#include "mxtest/core/PartNameDisplayTest.h" #include "mxtest/core/PartAbbreviationDisplayTest.h" +#include "mxtest/core/PartNameDisplayTest.h" +#include "mxtest/core/PrintTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Print ) +TEST(Test01, Print) { TestMode v = TestMode::one; - PrintPtr object = tgenPrint( v ); - stringstream expected; - tgenPrintExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + PrintPtr object = tgenPrint(v); + stringstream expected; + tgenPrintExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Print ) + +TEST(Test02, Print) { TestMode v = TestMode::two; - PrintPtr object = tgenPrint( v ); - stringstream expected; - tgenPrintExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PrintPtr object = tgenPrint(v); + stringstream expected; + tgenPrintExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Print ) + +TEST(Test03, Print) { TestMode v = TestMode::three; - PrintPtr object = tgenPrint( v ); - stringstream expected; - tgenPrintExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + PrintPtr object = tgenPrint(v); + stringstream expected; + tgenPrintExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PrintPtr tgenPrint( TestMode v ) +PrintPtr tgenPrint(TestMode v) +{ + PrintPtr o = makePrint(); + switch (v) { - PrintPtr o = makePrint(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasBlankPage = true; - o->getAttributes()->blankPage = PositiveInteger( 2 ); - o->setLayoutGroup( tgenLayoutGroup( v ) ); - o->setHasMeasureLayout( true ); - o->setMeasureLayout( tgenMeasureLayout( v ) ); - o->setHasMeasureNumbering( true ); - o->getMeasureNumbering()->setValue( MeasureNumberingValue::system ); - o->setHasPartNameDisplay( true ); - o->setPartNameDisplay( tgenPartNameDisplay( v ) ); - o->setHasPartAbbreviationDisplay( true ); - o->setPartAbbreviationDisplay( tgenPartAbbreviationDisplay( v ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasNewPage = true; - o->getAttributes()->newPage = YesNo::yes; - o->getAttributes()->hasNewSystem = true; - o->getAttributes()->newSystem = YesNo::no; - o->setLayoutGroup( tgenLayoutGroup( v ) ); - o->setHasMeasureLayout( true ); - o->setMeasureLayout( tgenMeasureLayout( v ) ); - o->setHasMeasureNumbering( true ); - o->getMeasureNumbering()->setValue( MeasureNumberingValue::none ); - o->setHasPartNameDisplay( true ); - o->setPartNameDisplay( tgenPartNameDisplay( v ) ); - o->setHasPartAbbreviationDisplay( true ); - o->setPartAbbreviationDisplay( tgenPartAbbreviationDisplay( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasBlankPage = true; + o->getAttributes()->blankPage = PositiveInteger(2); + o->setLayoutGroup(tgenLayoutGroup(v)); + o->setHasMeasureLayout(true); + o->setMeasureLayout(tgenMeasureLayout(v)); + o->setHasMeasureNumbering(true); + o->getMeasureNumbering()->setValue(MeasureNumberingValue::system); + o->setHasPartNameDisplay(true); + o->setPartNameDisplay(tgenPartNameDisplay(v)); + o->setHasPartAbbreviationDisplay(true); + o->setPartAbbreviationDisplay(tgenPartAbbreviationDisplay(v)); + } + break; + case TestMode::three: { + o->getAttributes()->hasNewPage = true; + o->getAttributes()->newPage = YesNo::yes; + o->getAttributes()->hasNewSystem = true; + o->getAttributes()->newSystem = YesNo::no; + o->setLayoutGroup(tgenLayoutGroup(v)); + o->setHasMeasureLayout(true); + o->setMeasureLayout(tgenMeasureLayout(v)); + o->setHasMeasureNumbering(true); + o->getMeasureNumbering()->setValue(MeasureNumberingValue::none); + o->setHasPartNameDisplay(true); + o->setPartNameDisplay(tgenPartNameDisplay(v)); + o->setHasPartAbbreviationDisplay(true); + o->setPartAbbreviationDisplay(tgenPartAbbreviationDisplay(v)); } - void tgenPrintExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenPrintExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenLayoutGroupExpected( os, i+1, v ); - os << std::endl; - tgenMeasureLayoutExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(system)" ); - tgenPartNameDisplayExpected( os, i+1, v ); - os << std::endl; - tgenPartAbbreviationDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenLayoutGroupExpected( os, i+1, v ); - os << std::endl; - tgenMeasureLayoutExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(none)" ); - tgenPartNameDisplayExpected( os, i+1, v ); - os << std::endl; - tgenPartAbbreviationDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenLayoutGroupExpected(os, i + 1, v); + os << std::endl; + tgenMeasureLayoutExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(system)"); + tgenPartNameDisplayExpected(os, i + 1, v); + os << std::endl; + tgenPartAbbreviationDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenLayoutGroupExpected(os, i + 1, v); + os << std::endl; + tgenMeasureLayoutExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(none)"); + tgenPartNameDisplayExpected(os, i + 1, v); + os << std::endl; + tgenPartAbbreviationDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/PrintTest.h b/Sourcecode/private/mxtest/core/PrintTest.h index db795af1c..3d2abc46e 100644 --- a/Sourcecode/private/mxtest/core/PrintTest.h +++ b/Sourcecode/private/mxtest/core/PrintTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PrintPtr tgenPrint( TestMode v ); - void tgenPrintExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PrintPtr tgenPrint(TestMode v); +void tgenPrintExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PropertiesTest.cpp b/Sourcecode/private/mxtest/core/PropertiesTest.cpp index dfb1a7a7e..4cbbbe9a5 100644 --- a/Sourcecode/private/mxtest/core/PropertiesTest.cpp +++ b/Sourcecode/private/mxtest/core/PropertiesTest.cpp @@ -6,263 +6,259 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/EditorialGroupTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/PropertiesTest.h" -#include "mxtest/core/EditorialGroupTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Properties ) +TEST(Test01, Properties) { TestMode v = TestMode::one; - PropertiesPtr object = tgenProperties( v ); - stringstream expected; - tgenPropertiesExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + PropertiesPtr object = tgenProperties(v); + stringstream expected; + tgenPropertiesExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Properties ) + +TEST(Test02, Properties) { TestMode v = TestMode::two; - PropertiesPtr object = tgenProperties( v ); - stringstream expected; - tgenPropertiesExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PropertiesPtr object = tgenProperties(v); + stringstream expected; + tgenPropertiesExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Properties ) + +TEST(Test03, Properties) { TestMode v = TestMode::three; - PropertiesPtr object = tgenProperties( v ); - stringstream expected; - tgenPropertiesExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + PropertiesPtr object = tgenProperties(v); + stringstream expected; + tgenPropertiesExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - PropertiesPtr tgenProperties( TestMode v ) +PropertiesPtr tgenProperties(TestMode v) +{ + PropertiesPtr o = makeProperties(); + switch (v) { - PropertiesPtr o = makeProperties(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setEditorialGroup( tgenEditorialGroup( v ) ); - auto d = makeDivisions(); - d->setValue( PositiveDivisionsValue( 120 ) ); - o->setDivisions( d ); - o->setHasDivisions( true ); - auto k = makeKey(); - k->getKeyChoice()->setChoice( KeyChoice::Choice::traditionalKey ); - k->getKeyChoice()->getTraditionalKey()->getFifths()->setValue( FifthsValue( -2 ) ); - k->getKeyChoice()->getTraditionalKey()->setHasCancel( true ); - k->getKeyChoice()->getTraditionalKey()->getCancel()->setValue( FifthsValue ( 1 ) ); - o->addKey( k ); - - auto t = makeTime(); - t->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - auto timeSignature = makeTimeSignatureGroup(); - timeSignature->getBeats()->setValue( XsString( "3" ) ); - timeSignature->getBeatType()->setValue( XsString( "4" ) ); - t->getTimeChoice()->addTimeSignatureGroup( timeSignature ); - t->getTimeChoice()->removeTimeSignatureGroup( t->getTimeChoice()->getTimeSignatureGroupSet().cbegin() ); - - o->addTime( t ); - o->setHasStaves( true ); - o->getStaves()->setValue( NonNegativeInteger( 4 ) ); - o->setHasPartSymbol( true ); - o->getPartSymbol()->setValue( GroupSymbolValue::none ); - o->setHasInstruments( true ); - o->getInstruments()->setValue( NonNegativeInteger( 3 ) ); - auto c = makeClef(); - c->getSign()->setValue( ClefSign::g ); - c->getLine()->setValue( StaffLine( 2 ) ); - c->setHasLine( true ); - o->addClef( c ); - auto sd = makeStaffDetails(); - sd->setHasStaffLines( true ); - sd->getStaffLines()->setValue( NonNegativeInteger( 5 ) ); - sd->setHasStaffType( true ); - sd->getStaffType()->setValue( StaffTypeEnum::regular ); - o->addStaffDetails( sd ); - auto dir = makeDirective(); - dir->setValue( XsString( "allegro" ) ); - dir->getAttributes()->hasLang = true; - o->addDirective( dir ); - auto ms = makeMeasureStyle(); - ms->getMeasureStyleChoice()->setChoice( MeasureStyleChoice::Choice::slash ); - ms->getMeasureStyleChoice()->getSlash()->getSlashType()->setValue( NoteTypeValue::eighth ); - o->addMeasureStyle( ms ); - } - break; - case TestMode::three: - { - o->setEditorialGroup( tgenEditorialGroup( v ) ); - auto d = makeDivisions(); - d->setValue( PositiveDivisionsValue( 99 ) ); - o->setDivisions( d ); - o->setHasDivisions( true ); - auto k = makeKey(); - k->getKeyChoice()->setChoice( KeyChoice::Choice::traditionalKey ); - k->getKeyChoice()->getTraditionalKey()->getFifths()->setValue( FifthsValue( -2 ) ); - k->getKeyChoice()->getTraditionalKey()->setHasCancel( true ); - k->getKeyChoice()->getTraditionalKey()->getCancel()->setValue( FifthsValue ( 1 ) ); - o->addKey( k ); - - auto t = makeTime(); - t->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - auto timeSignature = makeTimeSignatureGroup(); - timeSignature->getBeats()->setValue( XsString( "5" ) ); - timeSignature->getBeatType()->setValue( XsString( "4" ) ); - t->getTimeChoice()->addTimeSignatureGroup( timeSignature ); - t->getTimeChoice()->removeTimeSignatureGroup( t->getTimeChoice()->getTimeSignatureGroupSet().cbegin() ); - - o->addTime( t ); - o->setHasStaves( true ); - o->getStaves()->setValue( NonNegativeInteger( 4 ) ); - o->setHasPartSymbol( true ); - o->getPartSymbol()->setValue( GroupSymbolValue::none ); - o->setHasInstruments( true ); - o->getInstruments()->setValue( NonNegativeInteger( 3 ) ); - auto c = makeClef(); - c->getSign()->setValue( ClefSign::g ); - c->getLine()->setValue( StaffLine( 2 ) ); - c->setHasLine( true ); - o->addClef( c ); - c = makeClef(); - c->getSign()->setValue( ClefSign::c ); - c->getLine()->setValue( StaffLine( 3 ) ); - c->setHasLine( true ); - o->addClef( c ); - -// auto sd = makeStaffDetails(); -// sd->setHasStaffLines( true ); -// sd->getStaffLines()->setValue( NonNegativeInteger( 5 ) ); -// sd->setHasStaffType( true ); -// sd->getStaffType()->setValue( StaffTypeEnum::regular ); -// o->addStaffDetails( sd ); - auto dir = makeDirective(); - dir->setValue( XsString( "allegro" ) ); - dir->getAttributes()->hasLang = true; - o->addDirective( dir ); - auto ms = makeMeasureStyle(); - ms->getMeasureStyleChoice()->setChoice( MeasureStyleChoice::Choice::slash ); - ms->getMeasureStyleChoice()->getSlash()->getSlashType()->setValue( NoteTypeValue::eighth ); - o->addMeasureStyle( ms ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setEditorialGroup(tgenEditorialGroup(v)); + auto d = makeDivisions(); + d->setValue(PositiveDivisionsValue(120)); + o->setDivisions(d); + o->setHasDivisions(true); + auto k = makeKey(); + k->getKeyChoice()->setChoice(KeyChoice::Choice::traditionalKey); + k->getKeyChoice()->getTraditionalKey()->getFifths()->setValue(FifthsValue(-2)); + k->getKeyChoice()->getTraditionalKey()->setHasCancel(true); + k->getKeyChoice()->getTraditionalKey()->getCancel()->setValue(FifthsValue(1)); + o->addKey(k); + + auto t = makeTime(); + t->getTimeChoice()->setChoice(TimeChoice::Choice::timeSignature); + auto timeSignature = makeTimeSignatureGroup(); + timeSignature->getBeats()->setValue(XsString("3")); + timeSignature->getBeatType()->setValue(XsString("4")); + t->getTimeChoice()->addTimeSignatureGroup(timeSignature); + t->getTimeChoice()->removeTimeSignatureGroup(t->getTimeChoice()->getTimeSignatureGroupSet().cbegin()); + + o->addTime(t); + o->setHasStaves(true); + o->getStaves()->setValue(NonNegativeInteger(4)); + o->setHasPartSymbol(true); + o->getPartSymbol()->setValue(GroupSymbolValue::none); + o->setHasInstruments(true); + o->getInstruments()->setValue(NonNegativeInteger(3)); + auto c = makeClef(); + c->getSign()->setValue(ClefSign::g); + c->getLine()->setValue(StaffLine(2)); + c->setHasLine(true); + o->addClef(c); + auto sd = makeStaffDetails(); + sd->setHasStaffLines(true); + sd->getStaffLines()->setValue(NonNegativeInteger(5)); + sd->setHasStaffType(true); + sd->getStaffType()->setValue(StaffTypeEnum::regular); + o->addStaffDetails(sd); + auto dir = makeDirective(); + dir->setValue(XsString("allegro")); + dir->getAttributes()->hasLang = true; + o->addDirective(dir); + auto ms = makeMeasureStyle(); + ms->getMeasureStyleChoice()->setChoice(MeasureStyleChoice::Choice::slash); + ms->getMeasureStyleChoice()->getSlash()->getSlashType()->setValue(NoteTypeValue::eighth); + o->addMeasureStyle(ms); + } + break; + case TestMode::three: { + o->setEditorialGroup(tgenEditorialGroup(v)); + auto d = makeDivisions(); + d->setValue(PositiveDivisionsValue(99)); + o->setDivisions(d); + o->setHasDivisions(true); + auto k = makeKey(); + k->getKeyChoice()->setChoice(KeyChoice::Choice::traditionalKey); + k->getKeyChoice()->getTraditionalKey()->getFifths()->setValue(FifthsValue(-2)); + k->getKeyChoice()->getTraditionalKey()->setHasCancel(true); + k->getKeyChoice()->getTraditionalKey()->getCancel()->setValue(FifthsValue(1)); + o->addKey(k); + + auto t = makeTime(); + t->getTimeChoice()->setChoice(TimeChoice::Choice::timeSignature); + auto timeSignature = makeTimeSignatureGroup(); + timeSignature->getBeats()->setValue(XsString("5")); + timeSignature->getBeatType()->setValue(XsString("4")); + t->getTimeChoice()->addTimeSignatureGroup(timeSignature); + t->getTimeChoice()->removeTimeSignatureGroup(t->getTimeChoice()->getTimeSignatureGroupSet().cbegin()); + + o->addTime(t); + o->setHasStaves(true); + o->getStaves()->setValue(NonNegativeInteger(4)); + o->setHasPartSymbol(true); + o->getPartSymbol()->setValue(GroupSymbolValue::none); + o->setHasInstruments(true); + o->getInstruments()->setValue(NonNegativeInteger(3)); + auto c = makeClef(); + c->getSign()->setValue(ClefSign::g); + c->getLine()->setValue(StaffLine(2)); + c->setHasLine(true); + o->addClef(c); + c = makeClef(); + c->getSign()->setValue(ClefSign::c); + c->getLine()->setValue(StaffLine(3)); + c->setHasLine(true); + o->addClef(c); + + // auto sd = makeStaffDetails(); + // sd->setHasStaffLines( true ); + // sd->getStaffLines()->setValue( NonNegativeInteger( 5 ) ); + // sd->setHasStaffType( true ); + // sd->getStaffType()->setValue( StaffTypeEnum::regular ); + // o->addStaffDetails( sd ); + auto dir = makeDirective(); + dir->setValue(XsString("allegro")); + dir->getAttributes()->hasLang = true; + o->addDirective(dir); + auto ms = makeMeasureStyle(); + ms->getMeasureStyleChoice()->setChoice(MeasureStyleChoice::Choice::slash); + ms->getMeasureStyleChoice()->getSlash()->getSlashType()->setValue(NoteTypeValue::eighth); + o->addMeasureStyle(ms); + } + break; + default: + break; } - void tgenPropertiesExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenPropertiesExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(120)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(1)" ); - streamLine( os, i+2, R"(-2)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(4)" ); - streamLine( os, i+1, R"(none)" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(G)" ); - streamLine( os, i+2, R"(2)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(regular)" ); - streamLine( os, i+2, R"(5)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(allegro)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+3, R"(eighth)" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenEditorialGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(99)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(1)" ); - streamLine( os, i+2, R"(-2)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(4)" ); - streamLine( os, i+1, R"(none)" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(G)" ); - streamLine( os, i+2, R"(2)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(C)" ); - streamLine( os, i+2, R"(3)" ); - streamLine( os, i+1, R"()" ); -// streamLine( os, i+1, R"()" ); -// streamLine( os, i+2, R"(regular)" ); -// streamLine( os, i+2, R"(5)" ); -// streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"(allegro)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+3, R"(eighth)" ); - streamLine( os, i+2, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(120)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(1)"); + streamLine(os, i + 2, R"(-2)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(4)"); + streamLine(os, i + 1, R"(none)"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(G)"); + streamLine(os, i + 2, R"(2)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(regular)"); + streamLine(os, i + 2, R"(5)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(allegro)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 3, R"(eighth)"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenEditorialGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(99)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(1)"); + streamLine(os, i + 2, R"(-2)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"(4)"); + streamLine(os, i + 1, R"(none)"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(G)"); + streamLine(os, i + 2, R"(2)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(C)"); + streamLine(os, i + 2, R"(3)"); + streamLine(os, i + 1, R"()"); + // streamLine( os, i+1, R"()" ); + // streamLine( os, i+2, R"(regular)" ); + // streamLine( os, i+2, R"(5)" ); + // streamLine( os, i+1, R"()" ); + streamLine(os, i + 1, R"(allegro)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 3, R"(eighth)"); + streamLine(os, i + 2, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PropertiesTest.h b/Sourcecode/private/mxtest/core/PropertiesTest.h index a16cffa84..d89a00e3d 100644 --- a/Sourcecode/private/mxtest/core/PropertiesTest.h +++ b/Sourcecode/private/mxtest/core/PropertiesTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::PropertiesPtr tgenProperties( TestMode v ); - void tgenPropertiesExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::PropertiesPtr tgenProperties(TestMode v); +void tgenPropertiesExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/PullOffTest.cpp b/Sourcecode/private/mxtest/core/PullOffTest.cpp index 4c0d5dbf0..9e321d320 100644 --- a/Sourcecode/private/mxtest/core/PullOffTest.cpp +++ b/Sourcecode/private/mxtest/core/PullOffTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, PullOff ) +TEST(Test01, PullOff) { - std::string indentString( INDENT ); - XsString value1{ "blue" }; - XsString value2{ "red" }; - PullOff object1; - PullOff object2( value2 ); - PullOffAttributesPtr attributes1 = std::make_shared(); - PullOffAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"blue"}; + XsString value2{"red"}; + PullOff object1; + PullOff object2(value2); + PullOffAttributesPtr attributes1 = std::make_shared(); + PullOffAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontSize = true; - attributes1->fontSize = FontSize{ CssFontSize::xxLarge }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(red)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->fontSize = FontSize{CssFontSize::xxLarge}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(red)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/RehearsalTest.cpp b/Sourcecode/private/mxtest/core/RehearsalTest.cpp index f382e2995..9706502b8 100644 --- a/Sourcecode/private/mxtest/core/RehearsalTest.cpp +++ b/Sourcecode/private/mxtest/core/RehearsalTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Rehearsal ) +TEST(Test01, Rehearsal) { - std::string indentString( INDENT ); - XsString value1{ "A" }; - XsString value2{ "B" }; - Rehearsal object1; - Rehearsal object2( value2 ); - RehearsalAttributesPtr attributes1 = std::make_shared(); - RehearsalAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"A"}; + XsString value2{"B"}; + Rehearsal object1; + Rehearsal object2(value2); + RehearsalAttributesPtr attributes1 = std::make_shared(); + RehearsalAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasLang = true; attributes1->hasOverline = true; - attributes1->overline = NumberOfLines{ 2 }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(B)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->overline = NumberOfLines{2}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(B)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/RelationTest.cpp b/Sourcecode/private/mxtest/core/RelationTest.cpp index f4701e493..18f7fb7bb 100644 --- a/Sourcecode/private/mxtest/core/RelationTest.cpp +++ b/Sourcecode/private/mxtest/core/RelationTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Relation ) +TEST(Test01, Relation) { - std::string indentString( INDENT ); - XsString value1{ "suliban" }; - XsString value2{ "denobulan" }; - Relation object1; - Relation object2( value2 ); - RelationAttributesPtr attributes1 = std::make_shared(); - RelationAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"suliban"}; + XsString value2{"denobulan"}; + Relation object1; + Relation object2(value2); + RelationAttributesPtr attributes1 = std::make_shared(); + RelationAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasType = true; - attributes1->type = XsToken{ "Some Token" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(denobulan)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->type = XsToken{"Some Token"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(denobulan)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ReleaseTest.cpp b/Sourcecode/private/mxtest/core/ReleaseTest.cpp index 8bf14105b..14ccdd45f 100644 --- a/Sourcecode/private/mxtest/core/ReleaseTest.cpp +++ b/Sourcecode/private/mxtest/core/ReleaseTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, Release ) +TEST(Test01, Release) { - std::string indentString( INDENT ); - Release object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Release object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/RepeatTest.cpp b/Sourcecode/private/mxtest/core/RepeatTest.cpp index f3171881e..37d0c7489 100644 --- a/Sourcecode/private/mxtest/core/RepeatTest.cpp +++ b/Sourcecode/private/mxtest/core/RepeatTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, Repeat ) +TEST(Test01, Repeat) { - std::string indentString( INDENT ); - Repeat object1; - Repeat object2; - RepeatAttributesPtr attributes1 = std::make_shared(); - RepeatAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Repeat object1; + Repeat object2; + RepeatAttributesPtr attributes1 = std::make_shared(); + RepeatAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasTimes = true; - attributes1->times = NonNegativeInteger{ 3 }; + attributes1->times = NonNegativeInteger{3}; attributes1->hasWinged = true; attributes1->winged = Winged::doubleCurved; attributes1->direction = BackwardForward::forward; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/RestTest.cpp b/Sourcecode/private/mxtest/core/RestTest.cpp index ced2f2549..421b4a399 100644 --- a/Sourcecode/private/mxtest/core/RestTest.cpp +++ b/Sourcecode/private/mxtest/core/RestTest.cpp @@ -6,117 +6,113 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/DisplayStepOctaveGroupTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/RestTest.h" -#include "mxtest/core/DisplayStepOctaveGroupTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Rest ) +TEST(Test01, Rest) { TestMode v = TestMode::one; - RestPtr object = tgenRest( v ); - stringstream expected; - tgenRestExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + RestPtr object = tgenRest(v); + stringstream expected; + tgenRestExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Rest ) + +TEST(Test02, Rest) { TestMode v = TestMode::two; - RestPtr object = tgenRest( v ); - stringstream expected; - tgenRestExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + RestPtr object = tgenRest(v); + stringstream expected; + tgenRestExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Rest ) + +TEST(Test03, Rest) { TestMode v = TestMode::three; - RestPtr object = tgenRest( v ); - stringstream expected; - tgenRestExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + RestPtr object = tgenRest(v); + stringstream expected; + tgenRestExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - RestPtr tgenRest( TestMode v ) +RestPtr tgenRest(TestMode v) +{ + RestPtr o = makeRest(); + switch (v) { - RestPtr o = makeRest(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasMeasure = true; - o->getAttributes()->measure = YesNo::yes; - o->setHasDisplayStepOctaveGroup( true ); - o->setDisplayStepOctaveGroup( tgenDisplayStepOctaveGroup( v ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasMeasure = true; - o->getAttributes()->measure = YesNo::no; - o->setHasDisplayStepOctaveGroup( true ); - o->setDisplayStepOctaveGroup( tgenDisplayStepOctaveGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasMeasure = true; + o->getAttributes()->measure = YesNo::yes; + o->setHasDisplayStepOctaveGroup(true); + o->setDisplayStepOctaveGroup(tgenDisplayStepOctaveGroup(v)); + } + break; + case TestMode::three: { + o->getAttributes()->hasMeasure = true; + o->getAttributes()->measure = YesNo::no; + o->setHasDisplayStepOctaveGroup(true); + o->setDisplayStepOctaveGroup(tgenDisplayStepOctaveGroup(v)); + } + break; + default: + break; } - void tgenRestExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenRestExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenDisplayStepOctaveGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenDisplayStepOctaveGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenDisplayStepOctaveGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenDisplayStepOctaveGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/RestTest.h b/Sourcecode/private/mxtest/core/RestTest.h index 216d4f63c..4a00403c3 100644 --- a/Sourcecode/private/mxtest/core/RestTest.h +++ b/Sourcecode/private/mxtest/core/RestTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::RestPtr tgenRest( TestMode v ); - void tgenRestExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::RestPtr tgenRest(TestMode v); +void tgenRestExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/RightDividerTest.cpp b/Sourcecode/private/mxtest/core/RightDividerTest.cpp index d9e66dbf7..e86bbb46c 100644 --- a/Sourcecode/private/mxtest/core/RightDividerTest.cpp +++ b/Sourcecode/private/mxtest/core/RightDividerTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, RightDivider ) +TEST(Test01, RightDivider) { - std::string indentString( INDENT ); - RightDivider object1; - RightDivider object2; - EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); - EmptyPrintObjectStyleAlignAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + RightDivider object1; + RightDivider object2; + EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); + EmptyPrintObjectStyleAlignAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/RightMarginTest.cpp b/Sourcecode/private/mxtest/core/RightMarginTest.cpp index 762afb424..d491d5c3f 100644 --- a/Sourcecode/private/mxtest/core/RightMarginTest.cpp +++ b/Sourcecode/private/mxtest/core/RightMarginTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, RightMargin ) +TEST(Test01, RightMargin) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - RightMargin object1; - RightMargin object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + RightMargin object1; + RightMargin object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/RightsTest.cpp b/Sourcecode/private/mxtest/core/RightsTest.cpp index 57f7f28fb..61423f0a1 100644 --- a/Sourcecode/private/mxtest/core/RightsTest.cpp +++ b/Sourcecode/private/mxtest/core/RightsTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Rights ) +TEST(Test01, Rights) { - std::string indentString( INDENT ); - XsString value1{ "Granger" }; - XsString value2{ "Purcell" }; - Rights object1; - Rights object2( value2 ); - RightsAttributesPtr attributes1 = std::make_shared(); - RightsAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"Granger"}; + XsString value2{"Purcell"}; + Rights object1; + Rights object2(value2); + RightsAttributesPtr attributes1 = std::make_shared(); + RightsAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasType = true; - attributes1->type = XsToken{ "copyright" }; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Purcell)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->type = XsToken{"copyright"}; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Purcell)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/RootAlterTest.cpp b/Sourcecode/private/mxtest/core/RootAlterTest.cpp index 7f6992932..dc9cf0f76 100644 --- a/Sourcecode/private/mxtest/core/RootAlterTest.cpp +++ b/Sourcecode/private/mxtest/core/RootAlterTest.cpp @@ -11,38 +11,40 @@ using namespace mx::core; -TEST( Test01, RootAlter ) +TEST(Test01, RootAlter) { - std::string indentString( INDENT ); - Semitones value1( -1.1 ); - Semitones value2( 2.3 ); - RootAlter object1; - RootAlter object2( value2 ); - RootAlterAttributesPtr attributes1 = std::make_shared(); - RootAlterAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Semitones value1(-1.1); + Semitones value2(2.3); + RootAlter object1; + RootAlter object2(value2); + RootAlterAttributesPtr attributes1 = std::make_shared(); + RootAlterAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasLocation = true; attributes1->location = LeftRight::right; attributes1->hasPrintObject = true; attributes1->printObject = YesNo::yes; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = "0"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+"2.3"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = "0"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + "2.3"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/RootStepTest.cpp b/Sourcecode/private/mxtest/core/RootStepTest.cpp index 4589083a9..dba250dfa 100644 --- a/Sourcecode/private/mxtest/core/RootStepTest.cpp +++ b/Sourcecode/private/mxtest/core/RootStepTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, RootStep ) +TEST(Test01, RootStep) { - std::string indentString( INDENT ); - StepEnum value1 = StepEnum::f; - StepEnum value2 = StepEnum::c; - RootStep object1; - RootStep object2( value2 ); - RootStepAttributesPtr attributes1 = std::make_shared(); - RootStepAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + StepEnum value1 = StepEnum::f; + StepEnum value2 = StepEnum::c; + RootStep object1; + RootStep object2(value2); + RootStepAttributesPtr attributes1 = std::make_shared(); + RootStepAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasText = true; - attributes1->text = XsToken{ "Bones" }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(A)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(C)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->text = XsToken{"Bones"}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(A)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(C)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/RootTest.cpp b/Sourcecode/private/mxtest/core/RootTest.cpp index 4dc54a08a..50ce2f6e8 100644 --- a/Sourcecode/private/mxtest/core/RootTest.cpp +++ b/Sourcecode/private/mxtest/core/RootTest.cpp @@ -7,116 +7,112 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/RootTest.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/RootTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Root ) +TEST(Test01, Root) { TestMode v = TestMode::one; - RootPtr object = tgenRoot( v ); - stringstream expected; - tgenRootExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + RootPtr object = tgenRoot(v); + stringstream expected; + tgenRootExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Root ) + +TEST(Test02, Root) { TestMode v = TestMode::two; - RootPtr object = tgenRoot( v ); - stringstream expected; - tgenRootExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + RootPtr object = tgenRoot(v); + stringstream expected; + tgenRootExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Root ) + +TEST(Test03, Root) { TestMode v = TestMode::three; - RootPtr object = tgenRoot( v ); - stringstream expected; - tgenRootExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + RootPtr object = tgenRoot(v); + stringstream expected; + tgenRootExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - RootPtr tgenRoot( TestMode v ) +RootPtr tgenRoot(TestMode v) +{ + RootPtr o = makeRoot(); + switch (v) { - RootPtr o = makeRoot(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasRootAlter( true ); - o->getRootAlter()->setValue( Semitones( -2 ) ); - o->getRootStep()->setValue( StepEnum::f ); - } - break; - case TestMode::three: - { - o->setHasRootAlter( true ); - o->getRootAlter()->setValue( Semitones( 1.1 ) ); - o->getRootStep()->setValue( StepEnum::c ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasRootAlter(true); + o->getRootAlter()->setValue(Semitones(-2)); + o->getRootStep()->setValue(StepEnum::f); + } + break; + case TestMode::three: { + o->setHasRootAlter(true); + o->getRootAlter()->setValue(Semitones(1.1)); + o->getRootStep()->setValue(StepEnum::c); + } + break; + default: + break; } - void tgenRootExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenRootExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(A)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(F)" ); - streamLine( os, i+1, R"(-2)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(C)" ); - streamLine( os, i+1, R"(1.1)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(A)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(F)"); + streamLine(os, i + 1, R"(-2)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(C)"); + streamLine(os, i + 1, R"(1.1)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/RootTest.h b/Sourcecode/private/mxtest/core/RootTest.h index 4cb1cd9a6..663064fff 100644 --- a/Sourcecode/private/mxtest/core/RootTest.h +++ b/Sourcecode/private/mxtest/core/RootTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::RootPtr tgenRoot( TestMode v ); - void tgenRootExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::RootPtr tgenRoot(TestMode v); +void tgenRootExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScalingTest.cpp b/Sourcecode/private/mxtest/core/ScalingTest.cpp index c9c7b39e5..8c382004b 100644 --- a/Sourcecode/private/mxtest/core/ScalingTest.cpp +++ b/Sourcecode/private/mxtest/core/ScalingTest.cpp @@ -6,117 +6,113 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/ScalingTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/ScalingTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Scaling ) +TEST(Test01, Scaling) { TestMode v = TestMode::one; - ScalingPtr object = tgenScaling( v ); - stringstream expected; - tgenScalingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScalingPtr object = tgenScaling(v); + stringstream expected; + tgenScalingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Scaling ) + +TEST(Test02, Scaling) { TestMode v = TestMode::two; - ScalingPtr object = tgenScaling( v ); - stringstream expected; - tgenScalingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScalingPtr object = tgenScaling(v); + stringstream expected; + tgenScalingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Scaling ) + +TEST(Test03, Scaling) { TestMode v = TestMode::three; - ScalingPtr object = tgenScaling( v ); - stringstream expected; - tgenScalingExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScalingPtr object = tgenScaling(v); + stringstream expected; + tgenScalingExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ScalingPtr tgenScaling( TestMode v ) +ScalingPtr tgenScaling(TestMode v) +{ + ScalingPtr o = makeScaling(); + switch (v) { - ScalingPtr o = makeScaling(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getMillimeters()->setValue( MillimetersValue( 9 ) ); - o->getTenths()->setValue( TenthsValue( 42 ) ); - } - break; - case TestMode::three: - { - o->getMillimeters()->setValue( MillimetersValue( 11 ) ); - o->getTenths()->setValue( TenthsValue( 44 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getMillimeters()->setValue(MillimetersValue(9)); + o->getTenths()->setValue(TenthsValue(42)); } - void tgenScalingExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->getMillimeters()->setValue(MillimetersValue(11)); + o->getTenths()->setValue(TenthsValue(44)); + } + break; + default: + break; + } + return o; +} + +void tgenScalingExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(7)" ); - streamLine( os, i+1, R"(40)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(9)" ); - streamLine( os, i+1, R"(42)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(11)" ); - streamLine( os, i+1, R"(44)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(7)"); + streamLine(os, i + 1, R"(40)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(9)"); + streamLine(os, i + 1, R"(42)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(11)"); + streamLine(os, i + 1, R"(44)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScalingTest.h b/Sourcecode/private/mxtest/core/ScalingTest.h index 3267f7369..9d956bacd 100644 --- a/Sourcecode/private/mxtest/core/ScalingTest.h +++ b/Sourcecode/private/mxtest/core/ScalingTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ScalingPtr tgenScaling( TestMode v ); - void tgenScalingExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ScalingPtr tgenScaling(TestMode v); +void tgenScalingExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SchleiferTest.cpp b/Sourcecode/private/mxtest/core/SchleiferTest.cpp index 16d923df7..1e6df86aa 100644 --- a/Sourcecode/private/mxtest/core/SchleiferTest.cpp +++ b/Sourcecode/private/mxtest/core/SchleiferTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Schleifer ) +TEST(Test01, Schleifer) { - std::string indentString( INDENT ); - Schleifer object1; - Schleifer object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Schleifer object1; + Schleifer object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/ScoopTest.cpp b/Sourcecode/private/mxtest/core/ScoopTest.cpp index 1aa5d0def..353531897 100644 --- a/Sourcecode/private/mxtest/core/ScoopTest.cpp +++ b/Sourcecode/private/mxtest/core/ScoopTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Scoop ) +TEST(Test01, Scoop) { - std::string indentString( INDENT ); - Scoop object1; - Scoop object2; - EmptyLineAttributesPtr attributes1 = std::make_shared(); - EmptyLineAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Scoop object1; + Scoop object2; + EmptyLineAttributesPtr attributes1 = std::make_shared(); + EmptyLineAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/ScordaturaTest.cpp b/Sourcecode/private/mxtest/core/ScordaturaTest.cpp index a72bf0da4..a7baa833d 100644 --- a/Sourcecode/private/mxtest/core/ScordaturaTest.cpp +++ b/Sourcecode/private/mxtest/core/ScordaturaTest.cpp @@ -6,126 +6,123 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/AccordTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/ScordaturaTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Scordatura ) +TEST(Test01, Scordatura) { TestMode v = TestMode::one; - ScordaturaPtr object = tgenScordatura( v ); - stringstream expected; - tgenScordaturaExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScordaturaPtr object = tgenScordatura(v); + stringstream expected; + tgenScordaturaExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, Scordatura ) + +TEST(Test02, Scordatura) { TestMode v = TestMode::two; - ScordaturaPtr object = tgenScordatura( v ); - stringstream expected; - tgenScordaturaExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScordaturaPtr object = tgenScordatura(v); + stringstream expected; + tgenScordaturaExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Scordatura ) + +TEST(Test03, Scordatura) { TestMode v = TestMode::three; - ScordaturaPtr object = tgenScordatura( v ); - stringstream expected; - tgenScordaturaExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScordaturaPtr object = tgenScordatura(v); + stringstream expected; + tgenScordaturaExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ScordaturaPtr tgenScordatura( TestMode v ) +ScordaturaPtr tgenScordatura(TestMode v) +{ + ScordaturaPtr o = makeScordatura(); + switch (v) { - ScordaturaPtr o = makeScordatura(); - switch ( v ) - { - case TestMode::one: - { - ; - } - break; - case TestMode::two: - { - o->addAccord( tgenAccord( TestMode::two ) ); - o->removeAccord( o->getAccordSet().cbegin() ); - o->addAccord( tgenAccord( TestMode::three ) ); - } - break; - case TestMode::three: - { - o->addAccord( tgenAccord( TestMode::three ) ); - o->removeAccord( o->getAccordSet().cbegin() ); - o->addAccord( tgenAccord( TestMode::two ) ); - o->addAccord( tgenAccord( TestMode::one ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + ; + } + break; + case TestMode::two: { + o->addAccord(tgenAccord(TestMode::two)); + o->removeAccord(o->getAccordSet().cbegin()); + o->addAccord(tgenAccord(TestMode::three)); + } + break; + case TestMode::three: { + o->addAccord(tgenAccord(TestMode::three)); + o->removeAccord(o->getAccordSet().cbegin()); + o->addAccord(tgenAccord(TestMode::two)); + o->addAccord(tgenAccord(TestMode::one)); + } + break; + default: + break; } - void tgenScordaturaExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenScordaturaExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenAccordExpected(os, i+1, TestMode::one ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenAccordExpected(os, i+1, TestMode::two ); - os << std::endl; - tgenAccordExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenAccordExpected(os, i+1, TestMode::three ); - os << std::endl; - tgenAccordExpected(os, i+1, TestMode::two ); - os << std::endl; - tgenAccordExpected(os, i+1, TestMode::one ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenAccordExpected(os, i + 1, TestMode::one); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenAccordExpected(os, i + 1, TestMode::two); + os << std::endl; + tgenAccordExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenAccordExpected(os, i + 1, TestMode::three); + os << std::endl; + tgenAccordExpected(os, i + 1, TestMode::two); + os << std::endl; + tgenAccordExpected(os, i + 1, TestMode::one); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScordaturaTest.h b/Sourcecode/private/mxtest/core/ScordaturaTest.h index 052caef36..9543ef3ac 100644 --- a/Sourcecode/private/mxtest/core/ScordaturaTest.h +++ b/Sourcecode/private/mxtest/core/ScordaturaTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ScordaturaPtr tgenScordatura( TestMode v ); - void tgenScordaturaExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ScordaturaPtr tgenScordatura(TestMode v); +void tgenScordaturaExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.cpp b/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.cpp index e98389592..1703b7a68 100644 --- a/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.cpp @@ -6,125 +6,121 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/CreditTest.h" +#include "mxtest/core/DefaultsTest.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/ScoreHeaderGroupTest.h" -#include "mxtest/core/WorkTest.h" #include "mxtest/core/IdentificationTest.h" -#include "mxtest/core/DefaultsTest.h" -#include "mxtest/core/CreditTest.h" #include "mxtest/core/PartListTest.h" +#include "mxtest/core/ScoreHeaderGroupTest.h" +#include "mxtest/core/WorkTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, ScoreHeaderGroup ) +TEST(Test01, ScoreHeaderGroup) { TestMode v = TestMode::one; - ScoreHeaderGroupPtr object = tgenScoreHeaderGroup( v ); - stringstream expected; - tgenScoreHeaderGroupExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreHeaderGroupPtr object = tgenScoreHeaderGroup(v); + stringstream expected; + tgenScoreHeaderGroupExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, ScoreHeaderGroup ) + +TEST(Test02, ScoreHeaderGroup) { TestMode v = TestMode::two; - ScoreHeaderGroupPtr object = tgenScoreHeaderGroup( v ); - stringstream expected; - tgenScoreHeaderGroupExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreHeaderGroupPtr object = tgenScoreHeaderGroup(v); + stringstream expected; + tgenScoreHeaderGroupExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, ScoreHeaderGroup ) + +TEST(Test03, ScoreHeaderGroup) { TestMode v = TestMode::three; - ScoreHeaderGroupPtr object = tgenScoreHeaderGroup( v ); - stringstream expected; - tgenScoreHeaderGroupExpected( expected, 1, v ); - stringstream actual; - bool isOneLineOnly; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreHeaderGroupPtr object = tgenScoreHeaderGroup(v); + stringstream expected; + tgenScoreHeaderGroupExpected(expected, 1, v); + stringstream actual; + bool isOneLineOnly; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ScoreHeaderGroupPtr tgenScoreHeaderGroup( TestMode v ) +ScoreHeaderGroupPtr tgenScoreHeaderGroup(TestMode v) +{ + ScoreHeaderGroupPtr o = makeScoreHeaderGroup(); + switch (v) { - ScoreHeaderGroupPtr o = makeScoreHeaderGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasWork( true ); - o->setWork( tgenWork( v ) ); - o->setHasMovementNumber( true ); - o->getMovementNumber()->setValue( XsString( "I" ) ); - o->setHasMovementTitle( true ); - o->getMovementTitle()->setValue( XsString( "Allegro" ) ); - o->setPartList( tgenPartList( v ) ); - } - break; - case TestMode::three: - { - o->addCredit( tgenCredit( TestMode::two ) ); - o->addCredit( tgenCredit( TestMode::three ) ); - o->setPartList( tgenPartList( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { } - void tgenScoreHeaderGroupExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::two: { + o->setHasWork(true); + o->setWork(tgenWork(v)); + o->setHasMovementNumber(true); + o->getMovementNumber()->setValue(XsString("I")); + o->setHasMovementTitle(true); + o->getMovementTitle()->setValue(XsString("Allegro")); + o->setPartList(tgenPartList(v)); + } + break; + case TestMode::three: { + o->addCredit(tgenCredit(TestMode::two)); + o->addCredit(tgenCredit(TestMode::three)); + o->setPartList(tgenPartList(v)); + } + break; + default: + break; + } + return o; +} + +void tgenScoreHeaderGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - tgenPartListExpected( os, i, v ); - } - break; - case TestMode::two: - { - tgenWorkExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"(I)" ); - streamLine( os, i, R"(Allegro)" ); - tgenPartListExpected( os, i, v ); - } - break; - case TestMode::three: - { - tgenCreditExpected(os, i, TestMode::two ); - os << std::endl; - tgenCreditExpected(os, i, TestMode::three ); - os << std::endl; - tgenPartListExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + tgenPartListExpected(os, i, v); + } + break; + case TestMode::two: { + tgenWorkExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"(I)"); + streamLine(os, i, R"(Allegro)"); + tgenPartListExpected(os, i, v); + } + break; + case TestMode::three: { + tgenCreditExpected(os, i, TestMode::two); + os << std::endl; + tgenCreditExpected(os, i, TestMode::three); + os << std::endl; + tgenPartListExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.h b/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.h index 404420ab5..6d6e40ff7 100644 --- a/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.h +++ b/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ScoreHeaderGroupPtr tgenScoreHeaderGroup( TestMode v ); - void tgenScoreHeaderGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ScoreHeaderGroupPtr tgenScoreHeaderGroup(TestMode v); +void tgenScoreHeaderGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScoreInstrumentTest.cpp b/Sourcecode/private/mxtest/core/ScoreInstrumentTest.cpp index 0ffcc3668..1009e281f 100644 --- a/Sourcecode/private/mxtest/core/ScoreInstrumentTest.cpp +++ b/Sourcecode/private/mxtest/core/ScoreInstrumentTest.cpp @@ -6,136 +6,131 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/EncodingTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/ScoreInstrumentTest.h" #include "mxtest/core/VirtualInstrumentTest.h" -#include "mxtest/core/EncodingTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, ScoreInstrument ) +TEST(Test01, ScoreInstrument) { TestMode v = TestMode::one; - ScoreInstrumentPtr object = tgenScoreInstrument( v ); - stringstream expected; - tgenScoreInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreInstrumentPtr object = tgenScoreInstrument(v); + stringstream expected; + tgenScoreInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, ScoreInstrument ) + +TEST(Test02, ScoreInstrument) { TestMode v = TestMode::two; - ScoreInstrumentPtr object = tgenScoreInstrument( v ); - stringstream expected; - tgenScoreInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreInstrumentPtr object = tgenScoreInstrument(v); + stringstream expected; + tgenScoreInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, ScoreInstrument ) + +TEST(Test03, ScoreInstrument) { TestMode v = TestMode::three; - ScoreInstrumentPtr object = tgenScoreInstrument( v ); - stringstream expected; - tgenScoreInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreInstrumentPtr object = tgenScoreInstrument(v); + stringstream expected; + tgenScoreInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ScoreInstrumentPtr tgenScoreInstrument( TestMode v ) +ScoreInstrumentPtr tgenScoreInstrument(TestMode v) +{ + ScoreInstrumentPtr o = makeScoreInstrument(); + switch (v) { - ScoreInstrumentPtr o = makeScoreInstrument(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getInstrumentName()->setValue( XsString( "Bassoon" ) ); - o->setHasInstrumentAbbreviation( true ); - o->getInstrumentAbbreviation()->setValue( XsString( "Bsn." ) ); - o->setHasSoloOrEnsembleChoice( true ); - o->setHasVirtualInstrument( true ); - o->setVirtualInstrument( tgenVirtualInstrument( v ) ); - o->getAttributes()->id = XsID{ "Instrument01" }; - - } - break; - case TestMode::three: - { - o->getInstrumentName()->setValue( XsString( "Trumpet" ) ); - o->setHasInstrumentAbbreviation( true ); - o->getInstrumentAbbreviation()->setValue( XsString( "Trp." ) ); - o->setHasSoloOrEnsembleChoice( true ); - o->getSoloOrEnsembleChoice()->setChoice( SoloOrEnsembleChoice::Choice::ensemble ); - PositiveIntegerOrEmpty forteen{ PositiveInteger{ 14 } }; - o->getSoloOrEnsembleChoice()->getEnsemble()->setValue( forteen ); - o->setHasVirtualInstrument( true ); - o->setVirtualInstrument( tgenVirtualInstrument( v ) ); - o->getAttributes()->id = XsID{ "Instrument02" }; - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getInstrumentName()->setValue(XsString("Bassoon")); + o->setHasInstrumentAbbreviation(true); + o->getInstrumentAbbreviation()->setValue(XsString("Bsn.")); + o->setHasSoloOrEnsembleChoice(true); + o->setHasVirtualInstrument(true); + o->setVirtualInstrument(tgenVirtualInstrument(v)); + o->getAttributes()->id = XsID{"Instrument01"}; + } + break; + case TestMode::three: { + o->getInstrumentName()->setValue(XsString("Trumpet")); + o->setHasInstrumentAbbreviation(true); + o->getInstrumentAbbreviation()->setValue(XsString("Trp.")); + o->setHasSoloOrEnsembleChoice(true); + o->getSoloOrEnsembleChoice()->setChoice(SoloOrEnsembleChoice::Choice::ensemble); + PositiveIntegerOrEmpty forteen{PositiveInteger{14}}; + o->getSoloOrEnsembleChoice()->getEnsemble()->setValue(forteen); + o->setHasVirtualInstrument(true); + o->setVirtualInstrument(tgenVirtualInstrument(v)); + o->getAttributes()->id = XsID{"Instrument02"}; + } + break; + default: + break; } - void tgenScoreInstrumentExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenScoreInstrumentExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Bassoon)" ); - streamLine( os, i+1, R"(Bsn.)" ); - streamLine( os, i+1, R"()" ); - tgenVirtualInstrumentExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(Trumpet)" ); - streamLine( os, i+1, R"(Trp.)" ); - streamLine( os, i+1, R"(14)" ); - tgenVirtualInstrumentExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Bassoon)"); + streamLine(os, i + 1, R"(Bsn.)"); + streamLine(os, i + 1, R"()"); + tgenVirtualInstrumentExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(Trumpet)"); + streamLine(os, i + 1, R"(Trp.)"); + streamLine(os, i + 1, R"(14)"); + tgenVirtualInstrumentExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScoreInstrumentTest.h b/Sourcecode/private/mxtest/core/ScoreInstrumentTest.h index 679055029..bfed57c1e 100644 --- a/Sourcecode/private/mxtest/core/ScoreInstrumentTest.h +++ b/Sourcecode/private/mxtest/core/ScoreInstrumentTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ScoreInstrumentPtr tgenScoreInstrument( TestMode v ); - void tgenScoreInstrumentExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ScoreInstrumentPtr tgenScoreInstrument(TestMode v); +void tgenScoreInstrumentExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScorePartTest.cpp b/Sourcecode/private/mxtest/core/ScorePartTest.cpp index c71241775..e7e97b178 100644 --- a/Sourcecode/private/mxtest/core/ScorePartTest.cpp +++ b/Sourcecode/private/mxtest/core/ScorePartTest.cpp @@ -7,209 +7,203 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/ScorePartTest.h" #include "mxtest/core/IdentificationTest.h" -#include "mxtest/core/PartNameDisplayTest.h" #include "mxtest/core/PartAbbreviationDisplayTest.h" +#include "mxtest/core/PartNameDisplayTest.h" #include "mxtest/core/ScoreInstrumentTest.h" +#include "mxtest/core/ScorePartTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, ScorePart ) +TEST(Test01, ScorePart) { TestMode v = TestMode::one; - ScorePartPtr object = tgenScorePart( v ); - stringstream expected; - tgenScorePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ScorePartPtr object = tgenScorePart(v); + stringstream expected; + tgenScorePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, ScorePart ) + +TEST(Test02, ScorePart) { TestMode v = TestMode::two; - ScorePartPtr object = tgenScorePart( v ); - stringstream expected; - tgenScorePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ScorePartPtr object = tgenScorePart(v); + stringstream expected; + tgenScorePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, ScorePart ) + +TEST(Test03, ScorePart) { TestMode v = TestMode::three; - ScorePartPtr object = tgenScorePart( v ); - stringstream expected; - tgenScorePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ScorePartPtr object = tgenScorePart(v); + stringstream expected; + tgenScorePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ScorePartPtr tgenScorePart( TestMode v ) +ScorePartPtr tgenScorePart(TestMode v) +{ + ScorePartPtr o = makeScorePart(); + switch (v) { - ScorePartPtr o = makeScorePart(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->id = XsID( "P001" ); - o->setHasIdentification( true ); - o->setIdentification( tgenIdentification( v ) ); - o->getPartName()->setValue( XsString( "Trumpet" ) ); - o->setHasPartNameDisplay( true ); - o->setPartNameDisplay( tgenPartNameDisplay( v ) ); - o->setHasPartAbbreviation( true ); - o->getPartAbbreviation()->setValue( XsString( "Trp." ) ); - o->setHasPartAbbreviationDisplay( true ); - o->setPartAbbreviationDisplay( tgenPartAbbreviationDisplay( v ) ); - auto g = makeGroup(); - g->setValue( XsString ("Groupie" ) ); - o->addGroup( g ); - auto s = tgenScoreInstrument( v ); - o->addScoreInstrument( s ); - - auto m = makeMidiDeviceInstrumentGroup(); - o->addMidiDeviceInstrumentGroup( m ); /* no values, weird! */ - m.reset(); - - m = makeMidiDeviceInstrumentGroup(); - m->setHasMidiDevice( true ); - m->getMidiDevice()->setValue( XsString( "SomeDevice1" ) ); - o->addMidiDeviceInstrumentGroup( m ); - m.reset(); - - m = makeMidiDeviceInstrumentGroup(); - m->setHasMidiDevice( true ); - m->getMidiDevice()->setValue( XsString( "SomeDevice2" ) ); - m->setHasMidiInstrument( true ); - m->getMidiInstrument()->getAttributes()->id = XsID( "Instrument2" ); - m->getMidiInstrument()->setHasVolume( true ); - m->getMidiInstrument()->getVolume()->setValue( Percent( 0.99) ); - m->getMidiInstrument()->setHasMidiChannel( true ); - m->getMidiInstrument()->getMidiChannel()->setValue( Midi16( 16 ) ); - o->addMidiDeviceInstrumentGroup( m ); - m.reset(); - - m = makeMidiDeviceInstrumentGroup(); - m->setHasMidiInstrument( true ); - m->getMidiInstrument()->getAttributes()->id = XsID( "Instrument3" ); - m->getMidiInstrument()->setHasVolume( true ); - m->getMidiInstrument()->getVolume()->setValue( Percent( 0.11) ); - m->getMidiInstrument()->setHasMidiChannel( true ); - m->getMidiInstrument()->getMidiChannel()->setValue( Midi16( 13 ) ); - o->addMidiDeviceInstrumentGroup( m ); - m.reset(); - - } - break; - case TestMode::three: - { - o->getAttributes()->id = XsID( "XXX123" ); - o->setHasIdentification( true ); - o->setIdentification( tgenIdentification( v ) ); - o->getPartName()->setValue( XsString( "Ruck" ) ); - o->setHasPartNameDisplay( true ); - o->setPartNameDisplay( tgenPartNameDisplay( v ) ); - o->setHasPartAbbreviation( true ); - o->getPartAbbreviation()->setValue( XsString( "R." ) ); - o->setHasPartAbbreviationDisplay( true ); - o->setPartAbbreviationDisplay( tgenPartAbbreviationDisplay( v ) ); - auto g = makeGroup(); - g->setValue( XsString ("Roapie" ) ); - o->addGroup( g ); - auto s = tgenScoreInstrument( v ); - o->addScoreInstrument( s ); - - auto m = makeMidiDeviceInstrumentGroup(); - o->addMidiDeviceInstrumentGroup( m ); /* no values, weird! */ - m.reset(); - - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->id = XsID("P001"); + o->setHasIdentification(true); + o->setIdentification(tgenIdentification(v)); + o->getPartName()->setValue(XsString("Trumpet")); + o->setHasPartNameDisplay(true); + o->setPartNameDisplay(tgenPartNameDisplay(v)); + o->setHasPartAbbreviation(true); + o->getPartAbbreviation()->setValue(XsString("Trp.")); + o->setHasPartAbbreviationDisplay(true); + o->setPartAbbreviationDisplay(tgenPartAbbreviationDisplay(v)); + auto g = makeGroup(); + g->setValue(XsString("Groupie")); + o->addGroup(g); + auto s = tgenScoreInstrument(v); + o->addScoreInstrument(s); + + auto m = makeMidiDeviceInstrumentGroup(); + o->addMidiDeviceInstrumentGroup(m); /* no values, weird! */ + m.reset(); + + m = makeMidiDeviceInstrumentGroup(); + m->setHasMidiDevice(true); + m->getMidiDevice()->setValue(XsString("SomeDevice1")); + o->addMidiDeviceInstrumentGroup(m); + m.reset(); + + m = makeMidiDeviceInstrumentGroup(); + m->setHasMidiDevice(true); + m->getMidiDevice()->setValue(XsString("SomeDevice2")); + m->setHasMidiInstrument(true); + m->getMidiInstrument()->getAttributes()->id = XsID("Instrument2"); + m->getMidiInstrument()->setHasVolume(true); + m->getMidiInstrument()->getVolume()->setValue(Percent(0.99)); + m->getMidiInstrument()->setHasMidiChannel(true); + m->getMidiInstrument()->getMidiChannel()->setValue(Midi16(16)); + o->addMidiDeviceInstrumentGroup(m); + m.reset(); + + m = makeMidiDeviceInstrumentGroup(); + m->setHasMidiInstrument(true); + m->getMidiInstrument()->getAttributes()->id = XsID("Instrument3"); + m->getMidiInstrument()->setHasVolume(true); + m->getMidiInstrument()->getVolume()->setValue(Percent(0.11)); + m->getMidiInstrument()->setHasMidiChannel(true); + m->getMidiInstrument()->getMidiChannel()->setValue(Midi16(13)); + o->addMidiDeviceInstrumentGroup(m); + m.reset(); + } + break; + case TestMode::three: { + o->getAttributes()->id = XsID("XXX123"); + o->setHasIdentification(true); + o->setIdentification(tgenIdentification(v)); + o->getPartName()->setValue(XsString("Ruck")); + o->setHasPartNameDisplay(true); + o->setPartNameDisplay(tgenPartNameDisplay(v)); + o->setHasPartAbbreviation(true); + o->getPartAbbreviation()->setValue(XsString("R.")); + o->setHasPartAbbreviationDisplay(true); + o->setPartAbbreviationDisplay(tgenPartAbbreviationDisplay(v)); + auto g = makeGroup(); + g->setValue(XsString("Roapie")); + o->addGroup(g); + auto s = tgenScoreInstrument(v); + o->addScoreInstrument(s); + + auto m = makeMidiDeviceInstrumentGroup(); + o->addMidiDeviceInstrumentGroup(m); /* no values, weird! */ + m.reset(); } - void tgenScorePartExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenScorePartExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenIdentificationExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(Trumpet)" ); - tgenPartNameDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(Trp.)" ); - tgenPartAbbreviationDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(Groupie)" ); - tgenScoreInstrumentExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(SomeDevice1)" ); - streamLine( os, i+1, R"(SomeDevice2)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(16)" ); - streamLine( os, i+2, R"(0.99)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+2, R"(13)" ); - streamLine( os, i+2, R"(0.11)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenIdentificationExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(Ruck)" ); - tgenPartNameDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(R.)" ); - tgenPartAbbreviationDisplayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(Roapie)" ); - tgenScoreInstrumentExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenIdentificationExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(Trumpet)"); + tgenPartNameDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(Trp.)"); + tgenPartAbbreviationDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(Groupie)"); + tgenScoreInstrumentExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(SomeDevice1)"); + streamLine(os, i + 1, R"(SomeDevice2)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(16)"); + streamLine(os, i + 2, R"(0.99)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 2, R"(13)"); + streamLine(os, i + 2, R"(0.11)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenIdentificationExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(Ruck)"); + tgenPartNameDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(R.)"); + tgenPartAbbreviationDisplayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(Roapie)"); + tgenScoreInstrumentExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScorePartTest.h b/Sourcecode/private/mxtest/core/ScorePartTest.h index d13303ae9..177d11d81 100644 --- a/Sourcecode/private/mxtest/core/ScorePartTest.h +++ b/Sourcecode/private/mxtest/core/ScorePartTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ScorePartPtr tgenScorePart( TestMode v ); - void tgenScorePartExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ScorePartPtr tgenScorePart(TestMode v); +void tgenScorePartExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScorePartwiseTest.cpp b/Sourcecode/private/mxtest/core/ScorePartwiseTest.cpp index 7db38d272..ba3071f5d 100644 --- a/Sourcecode/private/mxtest/core/ScorePartwiseTest.cpp +++ b/Sourcecode/private/mxtest/core/ScorePartwiseTest.cpp @@ -7,134 +7,128 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/ScorePartwiseTest.h" #include "mxtest/core/PartwisePartTest.h" #include "mxtest/core/ScoreHeaderGroupTest.h" - +#include "mxtest/core/ScorePartwiseTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, ScorePartwise ) +TEST(Test01, ScorePartwise) { TestMode v = TestMode::one; - ScorePartwisePtr object = tgenScorePartwise( v ); - stringstream expected; - tgenScorePartwiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScorePartwisePtr object = tgenScorePartwise(v); + stringstream expected; + tgenScorePartwiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, ScorePartwise ) + +TEST(Test02, ScorePartwise) { TestMode v = TestMode::two; - ScorePartwisePtr object = tgenScorePartwise( v ); - stringstream expected; - tgenScorePartwiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ScorePartwisePtr object = tgenScorePartwise(v); + stringstream expected; + tgenScorePartwiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, ScorePartwise ) + +TEST(Test03, ScorePartwise) { TestMode v = TestMode::three; - ScorePartwisePtr object = tgenScorePartwise( v ); - stringstream expected; - tgenScorePartwiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScorePartwisePtr object = tgenScorePartwise(v); + stringstream expected; + tgenScorePartwiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ScorePartwisePtr tgenScorePartwise( TestMode v ) +ScorePartwisePtr tgenScorePartwise(TestMode v) +{ + ScorePartwisePtr o = makeScorePartwise(); + switch (v) { - ScorePartwisePtr o = makeScorePartwise(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasVersion = true; - o->getAttributes()->version = XsToken( "3.0" ); - o->setScoreHeaderGroup( tgenScoreHeaderGroup( v ) ); - o->addPartwisePart( tgenPartwisePart( v ) ); - o->removePartwisePart( o->getPartwisePartSet().cbegin() ); - } - break; - case TestMode::three: - { - o->setScoreHeaderGroup( tgenScoreHeaderGroup( v ) ); - o->addPartwisePart( tgenPartwisePart( v ) ); - o->removePartwisePart( o->getPartwisePartSet().cbegin() ); - o->addPartwisePart( tgenPartwisePart( TestMode::one ) ); - o->addPartwisePart( tgenPartwisePart( TestMode::two ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasVersion = true; + o->getAttributes()->version = XsToken("3.0"); + o->setScoreHeaderGroup(tgenScoreHeaderGroup(v)); + o->addPartwisePart(tgenPartwisePart(v)); + o->removePartwisePart(o->getPartwisePartSet().cbegin()); + } + break; + case TestMode::three: { + o->setScoreHeaderGroup(tgenScoreHeaderGroup(v)); + o->addPartwisePart(tgenPartwisePart(v)); + o->removePartwisePart(o->getPartwisePartSet().cbegin()); + o->addPartwisePart(tgenPartwisePart(TestMode::one)); + o->addPartwisePart(tgenPartwisePart(TestMode::two)); + } + break; + default: + break; } - void tgenScorePartwiseExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenScorePartwiseExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenScoreHeaderGroupExpected( os, i+1, v ); - os << std::endl; - tgenPartwisePartExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenScoreHeaderGroupExpected( os, i+1, v ); - os << std::endl; - tgenPartwisePartExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenScoreHeaderGroupExpected( os, i+1, v ); - os << std::endl; - tgenPartwisePartExpected( os, i+1, v ); - os << std::endl; - tgenPartwisePartExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenPartwisePartExpected(os, i+1, TestMode::two ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenScoreHeaderGroupExpected(os, i + 1, v); + os << std::endl; + tgenPartwisePartExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenScoreHeaderGroupExpected(os, i + 1, v); + os << std::endl; + tgenPartwisePartExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenScoreHeaderGroupExpected(os, i + 1, v); + os << std::endl; + tgenPartwisePartExpected(os, i + 1, v); + os << std::endl; + tgenPartwisePartExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenPartwisePartExpected(os, i + 1, TestMode::two); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/ScorePartwiseTest.h b/Sourcecode/private/mxtest/core/ScorePartwiseTest.h index 82416375f..ab0618ec6 100644 --- a/Sourcecode/private/mxtest/core/ScorePartwiseTest.h +++ b/Sourcecode/private/mxtest/core/ScorePartwiseTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ScorePartwisePtr tgenScorePartwise( TestMode v ); - void tgenScorePartwiseExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ScorePartwisePtr tgenScorePartwise(TestMode v); +void tgenScorePartwiseExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScoreTimewiseTest.cpp b/Sourcecode/private/mxtest/core/ScoreTimewiseTest.cpp index 6b4c212f0..7befb7672 100644 --- a/Sourcecode/private/mxtest/core/ScoreTimewiseTest.cpp +++ b/Sourcecode/private/mxtest/core/ScoreTimewiseTest.cpp @@ -7,133 +7,128 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/ScoreHeaderGroupTest.h" #include "mxtest/core/ScoreTimewiseTest.h" #include "mxtest/core/TimewiseMeasureTest.h" -#include "mxtest/core/ScoreHeaderGroupTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, ScoreTimewise ) +TEST(Test01, ScoreTimewise) { TestMode v = TestMode::one; - ScoreTimewisePtr object = tgenScoreTimewise( v ); - stringstream expected; - tgenScoreTimewiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreTimewisePtr object = tgenScoreTimewise(v); + stringstream expected; + tgenScoreTimewiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, ScoreTimewise ) + +TEST(Test02, ScoreTimewise) { TestMode v = TestMode::two; - ScoreTimewisePtr object = tgenScoreTimewise( v ); - stringstream expected; - tgenScoreTimewiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreTimewisePtr object = tgenScoreTimewise(v); + stringstream expected; + tgenScoreTimewiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, ScoreTimewise ) + +TEST(Test03, ScoreTimewise) { TestMode v = TestMode::three; - ScoreTimewisePtr object = tgenScoreTimewise( v ); - stringstream expected; - tgenScoreTimewiseExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + ScoreTimewisePtr object = tgenScoreTimewise(v); + stringstream expected; + tgenScoreTimewiseExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - ScoreTimewisePtr tgenScoreTimewise( TestMode v ) +ScoreTimewisePtr tgenScoreTimewise(TestMode v) +{ + ScoreTimewisePtr o = makeScoreTimewise(); + switch (v) { - ScoreTimewisePtr o = makeScoreTimewise(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasVersion = true; - o->getAttributes()->version = XsToken( "3.0" ); - o->setScoreHeaderGroup( tgenScoreHeaderGroup( v ) ); - o->addTimewiseMeasure( tgenTimewiseMeasure( v ) ); - o->removeTimewiseMeasure( o->getTimewiseMeasureSet().cbegin() ); - } - break; - case TestMode::three: - { - o->setScoreHeaderGroup( tgenScoreHeaderGroup( v ) ); - o->addTimewiseMeasure( tgenTimewiseMeasure( v ) ); - o->removeTimewiseMeasure( o->getTimewiseMeasureSet().cbegin() ); - o->addTimewiseMeasure( tgenTimewiseMeasure( TestMode::one ) ); - o->addTimewiseMeasure( tgenTimewiseMeasure( TestMode::two ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasVersion = true; + o->getAttributes()->version = XsToken("3.0"); + o->setScoreHeaderGroup(tgenScoreHeaderGroup(v)); + o->addTimewiseMeasure(tgenTimewiseMeasure(v)); + o->removeTimewiseMeasure(o->getTimewiseMeasureSet().cbegin()); + } + break; + case TestMode::three: { + o->setScoreHeaderGroup(tgenScoreHeaderGroup(v)); + o->addTimewiseMeasure(tgenTimewiseMeasure(v)); + o->removeTimewiseMeasure(o->getTimewiseMeasureSet().cbegin()); + o->addTimewiseMeasure(tgenTimewiseMeasure(TestMode::one)); + o->addTimewiseMeasure(tgenTimewiseMeasure(TestMode::two)); } - void tgenScoreTimewiseExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenScoreTimewiseExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenScoreHeaderGroupExpected( os, i+1, v ); - os << std::endl; - tgenTimewiseMeasureExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenScoreHeaderGroupExpected( os, i+1, v ); - os << std::endl; - tgenTimewiseMeasureExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenScoreHeaderGroupExpected( os, i+1, v ); - os << std::endl; - tgenTimewiseMeasureExpected( os, i+1, v ); - os << std::endl; - tgenTimewiseMeasureExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenTimewiseMeasureExpected(os, i+1, TestMode::two ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenScoreHeaderGroupExpected(os, i + 1, v); + os << std::endl; + tgenTimewiseMeasureExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenScoreHeaderGroupExpected(os, i + 1, v); + os << std::endl; + tgenTimewiseMeasureExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenScoreHeaderGroupExpected(os, i + 1, v); + os << std::endl; + tgenTimewiseMeasureExpected(os, i + 1, v); + os << std::endl; + tgenTimewiseMeasureExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenTimewiseMeasureExpected(os, i + 1, TestMode::two); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ScoreTimewiseTest.h b/Sourcecode/private/mxtest/core/ScoreTimewiseTest.h index 93bc4b22d..43319eebf 100644 --- a/Sourcecode/private/mxtest/core/ScoreTimewiseTest.h +++ b/Sourcecode/private/mxtest/core/ScoreTimewiseTest.h @@ -6,13 +6,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ScoreTimewisePtr tgenScoreTimewise( TestMode v ); - void tgenScoreTimewiseExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ScoreTimewisePtr tgenScoreTimewise(TestMode v); +void tgenScoreTimewiseExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SegnoTest.cpp b/Sourcecode/private/mxtest/core/SegnoTest.cpp index 419250d1e..ff157a375 100644 --- a/Sourcecode/private/mxtest/core/SegnoTest.cpp +++ b/Sourcecode/private/mxtest/core/SegnoTest.cpp @@ -11,40 +11,42 @@ using namespace mx::core; -TEST( Test01, Segno ) +TEST(Test01, Segno) { - std::string indentString( INDENT ); - Segno object1; - Segno object2; - EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); - EmptyPrintObjectStyleAlignAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Segno object1; + Segno object2; + EmptyPrintObjectStyleAlignAttributesPtr attributes1 = std::make_shared(); + EmptyPrintObjectStyleAlignAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasHalign = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; attributes1->halign = LeftCenterRight::right; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/SemiPitchedTest.cpp b/Sourcecode/private/mxtest/core/SemiPitchedTest.cpp index 6ce8753f6..bc2078a27 100644 --- a/Sourcecode/private/mxtest/core/SemiPitchedTest.cpp +++ b/Sourcecode/private/mxtest/core/SemiPitchedTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, SemiPitched ) +TEST(Test01, SemiPitched) { - std::string indentString( INDENT ); - SemiPitchedEnum value1 = SemiPitchedEnum::high; - SemiPitchedEnum value2 = SemiPitchedEnum::veryLow; - SemiPitched object1; - SemiPitched object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(medium)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(very-low)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + SemiPitchedEnum value1 = SemiPitchedEnum::high; + SemiPitchedEnum value2 = SemiPitchedEnum::veryLow; + SemiPitched object1; + SemiPitched object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(medium)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(very-low)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SenzaMisuraTest.cpp b/Sourcecode/private/mxtest/core/SenzaMisuraTest.cpp index 89be0ae39..91c20b1b5 100644 --- a/Sourcecode/private/mxtest/core/SenzaMisuraTest.cpp +++ b/Sourcecode/private/mxtest/core/SenzaMisuraTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, SenzaMisura ) +TEST(Test01, SenzaMisura) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - SenzaMisura object1; - SenzaMisura object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + SenzaMisura object1; + SenzaMisura object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ShakeTest.cpp b/Sourcecode/private/mxtest/core/ShakeTest.cpp index 69e50b645..3e854277c 100644 --- a/Sourcecode/private/mxtest/core/ShakeTest.cpp +++ b/Sourcecode/private/mxtest/core/ShakeTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Shake ) +TEST(Test01, Shake) { - std::string indentString( INDENT ); - Shake object1; - Shake object2; - EmptyTrillSoundAttributesPtr attributes1 = std::make_shared(); - EmptyTrillSoundAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Shake object1; + Shake object2; + EmptyTrillSoundAttributesPtr attributes1 = std::make_shared(); + EmptyTrillSoundAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/SignTest.cpp b/Sourcecode/private/mxtest/core/SignTest.cpp index ed398abac..f8e1bf106 100644 --- a/Sourcecode/private/mxtest/core/SignTest.cpp +++ b/Sourcecode/private/mxtest/core/SignTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Sign ) +TEST(Test01, Sign) { - std::string indentString( INDENT ); - ClefSign value1 = ClefSign::f; - ClefSign value2 = ClefSign::jianpu; - Sign object1; - Sign object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(G)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(jianpu)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + ClefSign value1 = ClefSign::f; + ClefSign value2 = ClefSign::jianpu; + Sign object1; + Sign object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(G)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(jianpu)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SlashDotTest.cpp b/Sourcecode/private/mxtest/core/SlashDotTest.cpp index 090480f42..ca09d1935 100644 --- a/Sourcecode/private/mxtest/core/SlashDotTest.cpp +++ b/Sourcecode/private/mxtest/core/SlashDotTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, SlashDot ) +TEST(Test01, SlashDot) { - std::string indentString( INDENT ); - SlashDot object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + SlashDot object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/SlashTest.cpp b/Sourcecode/private/mxtest/core/SlashTest.cpp index def234dc4..2f28f5fcf 100644 --- a/Sourcecode/private/mxtest/core/SlashTest.cpp +++ b/Sourcecode/private/mxtest/core/SlashTest.cpp @@ -6,49 +6,50 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Slash ) +TEST(Test01, Slash) { - Slash object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(eighth)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + Slash object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(eighth)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Slash ) + +TEST(Test02, Slash) { - Slash object; + Slash object; object.getAttributes()->type = StartStop::stop; object.getAttributes()->hasUseDots = true; object.getAttributes()->useDots = YesNo::yes; object.getAttributes()->hasUseStems = true; object.getAttributes()->useStems = YesNo::yes; - object.addSlashDot( makeSlashDot() ); - object.addSlashDot( makeSlashDot() ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(eighth)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.addSlashDot(makeSlashDot()); + object.addSlashDot(makeSlashDot()); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(eighth)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/SlashTypeTest.cpp b/Sourcecode/private/mxtest/core/SlashTypeTest.cpp index 684553247..569584864 100644 --- a/Sourcecode/private/mxtest/core/SlashTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/SlashTypeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, SlashType ) +TEST(Test01, SlashType) { - std::string indentString( INDENT ); - NoteTypeValue value1 = NoteTypeValue::quarter; - NoteTypeValue value2 = NoteTypeValue::whole; - SlashType object1; - SlashType object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(eighth)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(whole)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NoteTypeValue value1 = NoteTypeValue::quarter; + NoteTypeValue value2 = NoteTypeValue::whole; + SlashType object1; + SlashType object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(eighth)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(whole)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SlideTest.cpp b/Sourcecode/private/mxtest/core/SlideTest.cpp index d7107509f..94e1613af 100644 --- a/Sourcecode/private/mxtest/core/SlideTest.cpp +++ b/Sourcecode/private/mxtest/core/SlideTest.cpp @@ -11,40 +11,43 @@ using namespace mx::core; -TEST( Test01, Slide ) +TEST(Test01, Slide) { - std::string indentString( INDENT ); - XsString value1{ "Popin" }; - XsString value2{ "Fresh" }; - Slide object1; - Slide object2( value2 ); - SlideAttributesPtr attributes1 = std::make_shared(); - SlideAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Popin"}; + XsString value2{"Fresh"}; + Slide object1; + Slide object2(value2); + SlideAttributesPtr attributes1 = std::make_shared(); + SlideAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFirstBeat = true; - attributes1->firstBeat = Percent{ 0.321 }; + attributes1->firstBeat = Percent{0.321}; attributes1->hasLastBeat = true; - attributes1->lastBeat = Percent{ 0.234 }; + attributes1->lastBeat = Percent{0.234}; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Fresh)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->number = NumberLevel{2}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + + R"(Fresh)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SlurTest.cpp b/Sourcecode/private/mxtest/core/SlurTest.cpp index c1dc9aaf0..52d9fcbdc 100644 --- a/Sourcecode/private/mxtest/core/SlurTest.cpp +++ b/Sourcecode/private/mxtest/core/SlurTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, Slur ) +TEST(Test01, Slur) { - std::string indentString( INDENT ); - Slur object1; - Slur object2; - SlurAttributesPtr attributes1 = std::make_shared(); - SlurAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Slur object1; + Slur object2; + SlurAttributesPtr attributes1 = std::make_shared(); + SlurAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->number = NumberLevel{2}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/SnapPizzicatoTest.cpp b/Sourcecode/private/mxtest/core/SnapPizzicatoTest.cpp index 16991570a..919606241 100644 --- a/Sourcecode/private/mxtest/core/SnapPizzicatoTest.cpp +++ b/Sourcecode/private/mxtest/core/SnapPizzicatoTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, SnapPizzicato ) +TEST(Test01, SnapPizzicato) { - std::string indentString( INDENT ); - SnapPizzicato object1; - SnapPizzicato object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + SnapPizzicato object1; + SnapPizzicato object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/SoftwareTest.cpp b/Sourcecode/private/mxtest/core/SoftwareTest.cpp index 853cd9e0f..ad1b2f5ca 100644 --- a/Sourcecode/private/mxtest/core/SoftwareTest.cpp +++ b/Sourcecode/private/mxtest/core/SoftwareTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Software ) +TEST(Test01, Software) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - Software object1; - Software object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + Software object1; + Software object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SoloTest.cpp b/Sourcecode/private/mxtest/core/SoloTest.cpp index 775c102cc..fa508768a 100644 --- a/Sourcecode/private/mxtest/core/SoloTest.cpp +++ b/Sourcecode/private/mxtest/core/SoloTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, Solo ) +TEST(Test01, Solo) { - std::string indentString( INDENT ); - Solo object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Solo object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/SoundTest.cpp b/Sourcecode/private/mxtest/core/SoundTest.cpp index b29979b37..9ed8ed238 100644 --- a/Sourcecode/private/mxtest/core/SoundTest.cpp +++ b/Sourcecode/private/mxtest/core/SoundTest.cpp @@ -6,131 +6,126 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/SoundTest.h" -#include "mxtest/core/PlayTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - +#include "mxtest/core/PlayTest.h" +#include "mxtest/core/SoundTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Sound ) +TEST(Test01, Sound) { TestMode v = TestMode::one; - SoundPtr object = tgenSound( v ); - stringstream expected; - tgenSoundExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + SoundPtr object = tgenSound(v); + stringstream expected; + tgenSoundExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Sound ) + +TEST(Test02, Sound) { TestMode v = TestMode::two; - SoundPtr object = tgenSound( v ); - stringstream expected; - tgenSoundExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + SoundPtr object = tgenSound(v); + stringstream expected; + tgenSoundExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Sound ) + +TEST(Test03, Sound) { TestMode v = TestMode::three; - SoundPtr object = tgenSound( v ); - stringstream expected; - tgenSoundExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + SoundPtr object = tgenSound(v); + stringstream expected; + tgenSoundExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - SoundPtr tgenSound( TestMode v ) +SoundPtr tgenSound(TestMode v) +{ + SoundPtr o = makeSound(); + switch (v) { - SoundPtr o = makeSound(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasCoda = true; - o->getAttributes()->coda = XsToken( "TestCoda" ); - o->getAttributes()->hasPizzicato = true; - o->getAttributes()->pizzicato = YesNo::yes; - o->setHasMidiInstrument( true ); - o->setMidiInstrument( tgenMidiInstrument( v ) ); - o->setHasMidiDevice( true ); - o->getMidiDevice()->setValue( XsString( "lello" ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasSoftPedal = true; - o->getAttributes()->softPedal = YesNoNumber( Decimal( 0.1 ) ); - o->setHasPlay( true ); - o->setPlay( tgenPlay( v ) ); - o->setHasMidiInstrument( true ); - o->setMidiInstrument( tgenMidiInstrument( v ) ); - o->setHasMidiDevice( true ); - } - break; - default: - break; - } - return o; + case TestMode::one: { } - void tgenSoundExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::two: { + o->getAttributes()->hasCoda = true; + o->getAttributes()->coda = XsToken("TestCoda"); + o->getAttributes()->hasPizzicato = true; + o->getAttributes()->pizzicato = YesNo::yes; + o->setHasMidiInstrument(true); + o->setMidiInstrument(tgenMidiInstrument(v)); + o->setHasMidiDevice(true); + o->getMidiDevice()->setValue(XsString("lello")); + } + break; + case TestMode::three: { + o->getAttributes()->hasSoftPedal = true; + o->getAttributes()->softPedal = YesNoNumber(Decimal(0.1)); + o->setHasPlay(true); + o->setPlay(tgenPlay(v)); + o->setHasMidiInstrument(true); + o->setMidiInstrument(tgenMidiInstrument(v)); + o->setHasMidiDevice(true); + } + break; + default: + break; + } + return o; +} + +void tgenSoundExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(lello)" ); - tgenMidiInstrumentExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - tgenMidiInstrumentExpected( os, i+1, v ); - os << std::endl; - tgenPlayExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(lello)"); + tgenMidiInstrumentExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + tgenMidiInstrumentExpected(os, i + 1, v); + os << std::endl; + tgenPlayExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SoundTest.h b/Sourcecode/private/mxtest/core/SoundTest.h index 42c052716..f7026159e 100644 --- a/Sourcecode/private/mxtest/core/SoundTest.h +++ b/Sourcecode/private/mxtest/core/SoundTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::SoundPtr tgenSound( TestMode v ); - void tgenSoundExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::SoundPtr tgenSound(TestMode v); +void tgenSoundExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SoundingPitchTest.cpp b/Sourcecode/private/mxtest/core/SoundingPitchTest.cpp index 1eb6c5f31..30b627a67 100644 --- a/Sourcecode/private/mxtest/core/SoundingPitchTest.cpp +++ b/Sourcecode/private/mxtest/core/SoundingPitchTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, SoundingPitch ) +TEST(Test01, SoundingPitch) { - std::string indentString( INDENT ); - SoundingPitch object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + SoundingPitch object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/SourceTest.cpp b/Sourcecode/private/mxtest/core/SourceTest.cpp index 4049eb47b..24440cec4 100644 --- a/Sourcecode/private/mxtest/core/SourceTest.cpp +++ b/Sourcecode/private/mxtest/core/SourceTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Source ) +TEST(Test01, Source) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - Source object1; - Source object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + Source object1; + Source object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SpiccatoTest.cpp b/Sourcecode/private/mxtest/core/SpiccatoTest.cpp index d14fd89b9..bd64c0e46 100644 --- a/Sourcecode/private/mxtest/core/SpiccatoTest.cpp +++ b/Sourcecode/private/mxtest/core/SpiccatoTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Spiccato ) +TEST(Test01, Spiccato) { - std::string indentString( INDENT ); - Spiccato object1; - Spiccato object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Spiccato object1; + Spiccato object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaccatissimoTest.cpp b/Sourcecode/private/mxtest/core/StaccatissimoTest.cpp index 2f800d39e..a9f7fddf9 100644 --- a/Sourcecode/private/mxtest/core/StaccatissimoTest.cpp +++ b/Sourcecode/private/mxtest/core/StaccatissimoTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, Staccatissimo ) +TEST(Test01, Staccatissimo) { - std::string indentString( INDENT ); - Staccatissimo object1; - Staccatissimo object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Staccatissimo object1; + Staccatissimo object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaccatoTest.cpp b/Sourcecode/private/mxtest/core/StaccatoTest.cpp index d595af6eb..a751de156 100644 --- a/Sourcecode/private/mxtest/core/StaccatoTest.cpp +++ b/Sourcecode/private/mxtest/core/StaccatoTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Staccato ) +TEST(Test01, Staccato) { - std::string indentString( INDENT ); - Staccato object1; - Staccato object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Staccato object1; + Staccato object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaffDetailsTest.cpp b/Sourcecode/private/mxtest/core/StaffDetailsTest.cpp index eabd22757..795d64d96 100644 --- a/Sourcecode/private/mxtest/core/StaffDetailsTest.cpp +++ b/Sourcecode/private/mxtest/core/StaffDetailsTest.cpp @@ -6,70 +6,71 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, StaffDetails ) +TEST(Test01, StaffDetails) { - StaffDetails object; - stringstream expected; - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( ! object.hasContents() ) + StaffDetails object; + stringstream expected; + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(!object.hasContents()) } -TEST( Test02, StaffDetails ) + +TEST(Test02, StaffDetails) { - StaffDetails object; + StaffDetails object; object.getAttributes()->hasPrintObject = true; object.getAttributes()->hasPrintSpacing = true; object.getAttributes()->hasNumber = true; - object.getAttributes()->number = StaffNumber{ 5 }; + object.getAttributes()->number = StaffNumber{5}; object.getAttributes()->hasShowFrets = true; - object.setHasStaffLines( true ); - object.setHasStaffSize( true ); - object.getStaffSize()->setValue( NonNegativeDecimal( 5.5 ) ); + object.setHasStaffLines(true); + object.setHasStaffSize(true); + object.getStaffSize()->setValue(NonNegativeDecimal(5.5)); auto tuning = makeStaffTuning(); - tuning->setHasTuningAlter( true ); - tuning->setTuningStep( makeTuningStep( StepEnum::c ) ); - tuning->setTuningAlter( makeTuningAlter( Semitones( -1.1 ) ) ); - tuning->setTuningOctave( makeTuningOctave( OctaveValue( 6 ) ) ); - object.addStaffTuning( tuning ); - + tuning->setHasTuningAlter(true); + tuning->setTuningStep(makeTuningStep(StepEnum::c)); + tuning->setTuningAlter(makeTuningAlter(Semitones(-1.1))); + tuning->setTuningOctave(makeTuningOctave(OctaveValue(6))); + object.addStaffTuning(tuning); + auto tuning2 = makeStaffTuning(); - tuning->setHasTuningAlter( true ); - tuning->setTuningStep( makeTuningStep( StepEnum::d ) ); - tuning->setTuningAlter( makeTuningAlter( Semitones( -0.1 ) ) ); - tuning->setTuningOctave( makeTuningOctave( OctaveValue( 3 ) ) ); - object.addStaffTuning( tuning2 ); - - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(5)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(D)" ); - streamLine( expected, 3, R"(-0.1)" ); - streamLine( expected, 3, R"(3)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 3, R"(A)" ); - streamLine( expected, 3, R"(0)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 2, R"(5.5)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + tuning->setHasTuningAlter(true); + tuning->setTuningStep(makeTuningStep(StepEnum::d)); + tuning->setTuningAlter(makeTuningAlter(Semitones(-0.1))); + tuning->setTuningOctave(makeTuningOctave(OctaveValue(3))); + object.addStaffTuning(tuning2); + + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(5)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(D)"); + streamLine(expected, 3, R"(-0.1)"); + streamLine(expected, 3, R"(3)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"()"); + streamLine(expected, 3, R"(A)"); + streamLine(expected, 3, R"(0)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 2, R"(5.5)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaffDistanceTest.cpp b/Sourcecode/private/mxtest/core/StaffDistanceTest.cpp index f9cf802d1..93e4d480a 100644 --- a/Sourcecode/private/mxtest/core/StaffDistanceTest.cpp +++ b/Sourcecode/private/mxtest/core/StaffDistanceTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, StaffDistance ) +TEST(Test01, StaffDistance) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - StaffDistance object1; - StaffDistance object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + StaffDistance object1; + StaffDistance object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaffLayoutTest.cpp b/Sourcecode/private/mxtest/core/StaffLayoutTest.cpp index f35ea6164..7ccbb22dc 100644 --- a/Sourcecode/private/mxtest/core/StaffLayoutTest.cpp +++ b/Sourcecode/private/mxtest/core/StaffLayoutTest.cpp @@ -8,114 +8,110 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/StaffLayoutTest.h" -#include "mxtest/core/SystemMarginsTest.h" #include "mxtest/core/SystemDividersTest.h" +#include "mxtest/core/SystemMarginsTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, StaffLayout ) +TEST(Test01, StaffLayout) { TestMode v = TestMode::one; - StaffLayoutPtr object = tgenStaffLayout( v ); - stringstream expected; - tgenStaffLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + StaffLayoutPtr object = tgenStaffLayout(v); + stringstream expected; + tgenStaffLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, StaffLayout ) + +TEST(Test02, StaffLayout) { TestMode v = TestMode::two; - StaffLayoutPtr object = tgenStaffLayout( v ); - stringstream expected; - tgenStaffLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + StaffLayoutPtr object = tgenStaffLayout(v); + stringstream expected; + tgenStaffLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, StaffLayout ) + +TEST(Test03, StaffLayout) { TestMode v = TestMode::three; - StaffLayoutPtr object = tgenStaffLayout( v ); - stringstream expected; - tgenStaffLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + StaffLayoutPtr object = tgenStaffLayout(v); + stringstream expected; + tgenStaffLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - StaffLayoutPtr tgenStaffLayout( TestMode v ) +StaffLayoutPtr tgenStaffLayout(TestMode v) +{ + StaffLayoutPtr o = makeStaffLayout(); + switch (v) { - StaffLayoutPtr o = makeStaffLayout(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasStaffDistance( true ); - o->getStaffDistance()->setValue( TenthsValue( 12.1 ) ); - o->getAttributes()->hasNumber = true; - o->getAttributes()->number = StaffNumber( 5 ); - } - break; - case TestMode::three: - { - o->setHasStaffDistance( true ); - o->getStaffDistance()->setValue( TenthsValue( 13.3 ) ); - o->getAttributes()->hasNumber = true; - o->getAttributes()->number = StaffNumber( 7 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasStaffDistance(true); + o->getStaffDistance()->setValue(TenthsValue(12.1)); + o->getAttributes()->hasNumber = true; + o->getAttributes()->number = StaffNumber(5); + } + break; + case TestMode::three: { + o->setHasStaffDistance(true); + o->getStaffDistance()->setValue(TenthsValue(13.3)); + o->getAttributes()->hasNumber = true; + o->getAttributes()->number = StaffNumber(7); + } + break; + default: + break; } - void tgenStaffLayoutExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenStaffLayoutExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(12.1)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(13.3)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(12.1)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(13.3)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/StaffLayoutTest.h b/Sourcecode/private/mxtest/core/StaffLayoutTest.h index 7058ad655..23f9751ff 100644 --- a/Sourcecode/private/mxtest/core/StaffLayoutTest.h +++ b/Sourcecode/private/mxtest/core/StaffLayoutTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::StaffLayoutPtr tgenStaffLayout( TestMode v ); - void tgenStaffLayoutExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::StaffLayoutPtr tgenStaffLayout(TestMode v); +void tgenStaffLayoutExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/StaffLinesTest.cpp b/Sourcecode/private/mxtest/core/StaffLinesTest.cpp index c1b0876db..1f1976c2b 100644 --- a/Sourcecode/private/mxtest/core/StaffLinesTest.cpp +++ b/Sourcecode/private/mxtest/core/StaffLinesTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, StaffLines ) +TEST(Test01, StaffLines) { - std::string indentString( INDENT ); - NonNegativeInteger value1{ 2 }; - NonNegativeInteger value2{ 3 }; - StaffLines object1; - StaffLines object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NonNegativeInteger value1{2}; + NonNegativeInteger value2{3}; + StaffLines object1; + StaffLines object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaffSizeTest.cpp b/Sourcecode/private/mxtest/core/StaffSizeTest.cpp index 175ccb728..2dc8d3e29 100644 --- a/Sourcecode/private/mxtest/core/StaffSizeTest.cpp +++ b/Sourcecode/private/mxtest/core/StaffSizeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, StaffSize ) +TEST(Test01, StaffSize) { - std::string indentString( INDENT ); - NonNegativeDecimal value1{ 1 }; - NonNegativeDecimal value2{ 3.333 }; - StaffSize object1; - StaffSize object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3.333)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NonNegativeDecimal value1{1}; + NonNegativeDecimal value2{3.333}; + StaffSize object1; + StaffSize object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3.333)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaffTest.cpp b/Sourcecode/private/mxtest/core/StaffTest.cpp index b4861eac9..9af2df69e 100644 --- a/Sourcecode/private/mxtest/core/StaffTest.cpp +++ b/Sourcecode/private/mxtest/core/StaffTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Staff ) +TEST(Test01, Staff) { - std::string indentString( INDENT ); - PositiveInteger value1{ 2 }; - PositiveInteger value2{ 3 }; - Staff object1; - Staff object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(1)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + PositiveInteger value1{2}; + PositiveInteger value2{3}; + Staff object1; + Staff object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(1)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaffTuningTest.cpp b/Sourcecode/private/mxtest/core/StaffTuningTest.cpp index f6bf96d32..91f4b9911 100644 --- a/Sourcecode/private/mxtest/core/StaffTuningTest.cpp +++ b/Sourcecode/private/mxtest/core/StaffTuningTest.cpp @@ -6,50 +6,51 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, StaffTuning ) +TEST(Test01, StaffTuning) { - StaffTuning object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(A)" ); - streamLine( expected, 2, R"(0)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + StaffTuning object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(A)"); + streamLine(expected, 2, R"(0)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, StaffTuning ) + +TEST(Test02, StaffTuning) { - StaffTuning object; + StaffTuning object; object.getAttributes()->hasLine = true; - object.getAttributes()->line = StaffLine{ 3 }; - object.setHasTuningAlter( true ); - object.getTuningAlter()->setValue( Semitones{ -1 } ); - object.getTuningStep()->setValue( StepEnum::f ); - auto value = makeTuningOctave( OctaveValue( 5 ) ); - object.setTuningOctave( value ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(F)" ); - streamLine( expected, 2, R"(-1)" ); - streamLine( expected, 2, R"(5)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.getAttributes()->line = StaffLine{3}; + object.setHasTuningAlter(true); + object.getTuningAlter()->setValue(Semitones{-1}); + object.getTuningStep()->setValue(StepEnum::f); + auto value = makeTuningOctave(OctaveValue(5)); + object.setTuningOctave(value); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(F)"); + streamLine(expected, 2, R"(-1)"); + streamLine(expected, 2, R"(5)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/StaffTypeTest.cpp b/Sourcecode/private/mxtest/core/StaffTypeTest.cpp index 047d62d30..4393d0702 100644 --- a/Sourcecode/private/mxtest/core/StaffTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/StaffTypeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, StaffType ) +TEST(Test01, StaffType) { - std::string indentString( INDENT ); - StaffTypeEnum value1 = StaffTypeEnum::cue; - StaffTypeEnum value2 = StaffTypeEnum::alternate; - StaffType object1; - StaffType object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(regular)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(alternate)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StaffTypeEnum value1 = StaffTypeEnum::cue; + StaffTypeEnum value2 = StaffTypeEnum::alternate; + StaffType object1; + StaffType object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(regular)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(alternate)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StavesTest.cpp b/Sourcecode/private/mxtest/core/StavesTest.cpp index 3f3221c2d..fd2cc5495 100644 --- a/Sourcecode/private/mxtest/core/StavesTest.cpp +++ b/Sourcecode/private/mxtest/core/StavesTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Staves ) +TEST(Test01, Staves) { - std::string indentString( INDENT ); - NonNegativeInteger value1{ 2 }; - NonNegativeInteger value2{ 3 }; - Staves object1; - Staves object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + NonNegativeInteger value1{2}; + NonNegativeInteger value2{3}; + Staves object1; + Staves object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StemTest.cpp b/Sourcecode/private/mxtest/core/StemTest.cpp index c6a72e633..2e9de8519 100644 --- a/Sourcecode/private/mxtest/core/StemTest.cpp +++ b/Sourcecode/private/mxtest/core/StemTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Stem ) +TEST(Test01, Stem) { - std::string indentString( INDENT ); - StemValue value1 = StemValue::down; - StemValue value2 = StemValue::double_; - Stem object1; - Stem object2( value2 ); - StemAttributesPtr attributes1 = std::make_shared(); - StemAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + StemValue value1 = StemValue::down; + StemValue value2 = StemValue::double_; + Stem object1; + Stem object2(value2); + StemAttributesPtr attributes1 = std::make_shared(); + StemAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasRelativeX = true; - attributes1->relativeX = TenthsValue{ -1.83028 }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(none)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(double)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->relativeX = TenthsValue{-1.83028}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(none)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(double)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StepTest.cpp b/Sourcecode/private/mxtest/core/StepTest.cpp index 7ca98df8c..d442ebecd 100644 --- a/Sourcecode/private/mxtest/core/StepTest.cpp +++ b/Sourcecode/private/mxtest/core/StepTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Step ) +TEST(Test01, Step) { - std::string indentString( INDENT ); - StepEnum value1 = StepEnum::b; - StepEnum value2 = StepEnum::f; - Step object1; - Step object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(A)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(F)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StepEnum value1 = StepEnum::b; + StepEnum value2 = StepEnum::f; + Step object1; + Step object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(A)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(F)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StickLocationTest.cpp b/Sourcecode/private/mxtest/core/StickLocationTest.cpp index 6cd390486..dacf8ecb6 100644 --- a/Sourcecode/private/mxtest/core/StickLocationTest.cpp +++ b/Sourcecode/private/mxtest/core/StickLocationTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, StickLocation ) +TEST(Test01, StickLocation) { - std::string indentString( INDENT ); - StickLocationEnum value1 = StickLocationEnum::cymbalBell; - StickLocationEnum value2 = StickLocationEnum::rim; - StickLocation object1; - StickLocation object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(center)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(rim)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StickLocationEnum value1 = StickLocationEnum::cymbalBell; + StickLocationEnum value2 = StickLocationEnum::rim; + StickLocation object1; + StickLocation object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(center)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(rim)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StickMaterialTest.cpp b/Sourcecode/private/mxtest/core/StickMaterialTest.cpp index b9bae63c8..19208e0d3 100644 --- a/Sourcecode/private/mxtest/core/StickMaterialTest.cpp +++ b/Sourcecode/private/mxtest/core/StickMaterialTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, StickMaterial ) +TEST(Test01, StickMaterial) { - std::string indentString( INDENT ); - StickMaterialEnum value1 = StickMaterialEnum::hard; - StickMaterialEnum value2 = StickMaterialEnum::x; - StickMaterial object1; - StickMaterial object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(medium)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(x)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StickMaterialEnum value1 = StickMaterialEnum::hard; + StickMaterialEnum value2 = StickMaterialEnum::x; + StickMaterial object1; + StickMaterial object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(medium)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(x)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StickTest.cpp b/Sourcecode/private/mxtest/core/StickTest.cpp index 1d64e8dcb..bbdd9e3e3 100644 --- a/Sourcecode/private/mxtest/core/StickTest.cpp +++ b/Sourcecode/private/mxtest/core/StickTest.cpp @@ -6,118 +6,114 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/StickTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Stick ) +TEST(Test01, Stick) { - Stick object; - stringstream expected; - tgenStickExpected(expected, 1, TestMode::one ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + Stick object; + stringstream expected; + tgenStickExpected(expected, 1, TestMode::one); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Stick ) + +TEST(Test02, Stick) { - StickPtr object = tgenStick( TestMode::two ); - stringstream expected; - tgenStickExpected(expected, 1, TestMode::two ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + StickPtr object = tgenStick(TestMode::two); + stringstream expected; + tgenStickExpected(expected, 1, TestMode::two); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Stick ) + +TEST(Test03, Stick) { - StickPtr object = tgenStick( TestMode::three ); - stringstream expected; - tgenStickExpected(expected, 1, TestMode::three ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + StickPtr object = tgenStick(TestMode::three); + stringstream expected; + tgenStickExpected(expected, 1, TestMode::three); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - StickPtr tgenStick( TestMode v ) +StickPtr tgenStick(TestMode v) +{ + StickPtr o = makeStick(); + switch (v) { - StickPtr o = makeStick(); - switch ( v ) - { - case TestMode::one: - { - ; - } - break; - case TestMode::two: - { - o->getStickMaterial()->setValue( StickMaterialEnum::x ); - o->getStickType()->setValue( StickTypeEnum::xylophone ); - o->getAttributes()->hasTip = true; - o->getAttributes()->tip = TipDirection::southwest; - - } - break; - case TestMode::three: - { - o->getStickMaterial()->setValue( StickMaterialEnum::shaded ); - o->getStickType()->setValue( StickTypeEnum::doubleBassDrum ); - o->getAttributes()->hasTip = true; - o->getAttributes()->tip = TipDirection::up; - } - break; - default: - break; - } - return o; + case TestMode::one: { + ; + } + break; + case TestMode::two: { + o->getStickMaterial()->setValue(StickMaterialEnum::x); + o->getStickType()->setValue(StickTypeEnum::xylophone); + o->getAttributes()->hasTip = true; + o->getAttributes()->tip = TipDirection::southwest; + } + break; + case TestMode::three: { + o->getStickMaterial()->setValue(StickMaterialEnum::shaded); + o->getStickType()->setValue(StickTypeEnum::doubleBassDrum); + o->getAttributes()->hasTip = true; + o->getAttributes()->tip = TipDirection::up; } - void tgenStickExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenStickExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(yarn)" ); - streamLine( os, i+1, R"(medium)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(xylophone)" ); - streamLine( os, i+1, R"(x)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(double bass drum)" ); - streamLine( os, i+1, R"(shaded)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(yarn)"); + streamLine(os, i + 1, R"(medium)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(xylophone)"); + streamLine(os, i + 1, R"(x)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(double bass drum)"); + streamLine(os, i + 1, R"(shaded)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/StickTest.h b/Sourcecode/private/mxtest/core/StickTest.h index af4cfeb8a..177fe8655 100644 --- a/Sourcecode/private/mxtest/core/StickTest.h +++ b/Sourcecode/private/mxtest/core/StickTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::StickPtr tgenStick( TestMode v ); - void tgenStickExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::StickPtr tgenStick(TestMode v); +void tgenStickExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/StickTypeTest.cpp b/Sourcecode/private/mxtest/core/StickTypeTest.cpp index 67d20ad2e..beec8703e 100644 --- a/Sourcecode/private/mxtest/core/StickTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/StickTypeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, StickType ) +TEST(Test01, StickType) { - std::string indentString( INDENT ); - StickTypeEnum value1 = StickTypeEnum::doubleBassDrum; - StickTypeEnum value2 = StickTypeEnum::xylophone; - StickType object1; - StickType object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(yarn)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(xylophone)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StickTypeEnum value1 = StickTypeEnum::doubleBassDrum; + StickTypeEnum value2 = StickTypeEnum::xylophone; + StickType object1; + StickType object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(yarn)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(xylophone)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/StoppedTest.cpp b/Sourcecode/private/mxtest/core/StoppedTest.cpp index e1a89c764..47105b28f 100644 --- a/Sourcecode/private/mxtest/core/StoppedTest.cpp +++ b/Sourcecode/private/mxtest/core/StoppedTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Stopped ) +TEST(Test01, Stopped) { - std::string indentString( INDENT ); - Stopped object1; - Stopped object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Stopped object1; + Stopped object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/StressTest.cpp b/Sourcecode/private/mxtest/core/StressTest.cpp index 1ff7db6fe..d0f829b39 100644 --- a/Sourcecode/private/mxtest/core/StressTest.cpp +++ b/Sourcecode/private/mxtest/core/StressTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Stress ) +TEST(Test01, Stress) { - std::string indentString( INDENT ); - Stress object1; - Stress object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Stress object1; + Stress object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/StringMuteTest.cpp b/Sourcecode/private/mxtest/core/StringMuteTest.cpp index 4bdbcb7b3..0d6819dce 100644 --- a/Sourcecode/private/mxtest/core/StringMuteTest.cpp +++ b/Sourcecode/private/mxtest/core/StringMuteTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, StringMute ) +TEST(Test01, StringMute) { - std::string indentString( INDENT ); - StringMute object1; - StringMute object2; - StringMuteAttributesPtr attributes1 = std::make_shared(); - StringMuteAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + StringMute object1; + StringMute object2; + StringMuteAttributesPtr attributes1 = std::make_shared(); + StringMuteAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->defaultX = TenthsValue{0.1}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/StringTest.cpp b/Sourcecode/private/mxtest/core/StringTest.cpp index 97d50c6af..b4239c840 100644 --- a/Sourcecode/private/mxtest/core/StringTest.cpp +++ b/Sourcecode/private/mxtest/core/StringTest.cpp @@ -6,38 +6,39 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, String ) +TEST(Test01, String) { - String object; - stringstream expected; - streamLine( expected, 1, R"(1)", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + String object; + stringstream expected; + streamLine(expected, 1, R"(1)", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, String ) + +TEST(Test02, String) { - String object; + String object; object.getAttributes()->hasColor = true; - object.setValue( StringNumber( 3 ) ); - stringstream expected; - streamLine( expected, 1, R"(3)", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.setValue(StringNumber(3)); + stringstream expected; + streamLine(expected, 1, R"(3)", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/StringsTest.cpp b/Sourcecode/private/mxtest/core/StringsTest.cpp index fced1ad5b..58956ac30 100644 --- a/Sourcecode/private/mxtest/core/StringsTest.cpp +++ b/Sourcecode/private/mxtest/core/StringsTest.cpp @@ -22,452 +22,484 @@ using namespace mx::core; -TEST( XsString01, Strings ) +TEST(XsString01, Strings) { XsString x; StringType expected = ""; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsString02, Strings ) + +TEST(XsString02, Strings) { - XsString x( "Test" ); + XsString x("Test"); StringType expected = "Test"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsString03, Strings ) + +TEST(XsString03, Strings) { - XsString x( "Test" ); - x.setValue( "Different" ); + XsString x("Test"); + x.setValue("Different"); StringType expected = "Different"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsString04, Strings ) + +TEST(XsString04, Strings) { - XsString x( "Test" ); - x.setValue( "Think" ); + XsString x("Test"); + x.setValue("Think"); std::stringstream ss; - toStream( ss, x ); + toStream(ss, x); StringType expected = "Think"; StringType actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsString05, Strings ) + +TEST(XsString05, Strings) { - XsString x( "Test" ); - x.setValue( "Hello" ); + XsString x("Test"); + x.setValue("Hello"); std::stringstream ss; ss << x; StringType expected = "Hello"; StringType actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsString06, Strings ) + +TEST(XsString06, Strings) { - XsString x( "Test" ); - x.setValue( "Hello" ); + XsString x("Test"); + x.setValue("Hello"); std::stringstream ss; ss << x; StringType expected = "Hello"; - StringType actual = toString( x ); - CHECK_EQUAL( expected, actual ) + StringType actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( XsToken01, Strings ) + +TEST(XsToken01, Strings) { XsToken x; StringType expected = ""; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsToken02, Strings ) + +TEST(XsToken02, Strings) { - XsToken x( "Test" ); + XsToken x("Test"); StringType expected = "Test"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsToken03, Strings ) + +TEST(XsToken03, Strings) { - XsToken x( "\n\t Test \r \t \n String \t" ); + XsToken x("\n\t Test \r \t \n String \t"); StringType expected = "Test String"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsNMToken01, Strings ) + +TEST(XsNMToken01, Strings) { XsNMToken x; StringType expected = ""; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsNMToken02, Strings ) + +TEST(XsNMToken02, Strings) { - XsNMToken x( "Test" ); + XsNMToken x("Test"); StringType expected = "Test"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsNMToken03, Strings ) + +TEST(XsNMToken03, Strings) { - XsNMToken x( "\n\t Test \r \t \n String \t" ); + XsNMToken x("\n\t Test \r \t \n String \t"); StringType expected = "Test String"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsID01, Strings ) +TEST(XsID01, Strings) { - XsID x( "$%#1" ); + XsID x("$%#1"); StringType expected = "___1"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsID02, Strings ) + +TEST(XsID02, Strings) { - XsID x( "" ); + XsID x(""); StringType expected = "ID"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsID03, Strings ) + +TEST(XsID03, Strings) { - XsID x( "123" ); + XsID x("123"); StringType expected = "ID123"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsID04, Strings ) + +TEST(XsID04, Strings) { - XsID x( "ABC045" ); + XsID x("ABC045"); StringType expected = "ABC045"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsID05, Strings ) +TEST(XsID05, Strings) { - XsID x( "X 21" ); + XsID x("X 21"); StringType expected = "X_21"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsIDREF01, Strings ) +TEST(XsIDREF01, Strings) { - XsIDREF x( "$%#1" ); + XsIDREF x("$%#1"); StringType expected = "___1"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsIDREF02, Strings ) + +TEST(XsIDREF02, Strings) { - XsIDREF x( "" ); + XsIDREF x(""); StringType expected = "ID"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsIDREF03, Strings ) + +TEST(XsIDREF03, Strings) { - XsIDREF x( "123" ); + XsIDREF x("123"); StringType expected = "ID123"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsIDREF04, Strings ) + +TEST(XsIDREF04, Strings) { - XsIDREF x( "ABC045" ); + XsIDREF x("ABC045"); StringType expected = "ABC045"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsIDREF05, Strings ) +TEST(XsIDREF05, Strings) { - XsIDREF x( "X 21" ); + XsIDREF x("X 21"); StringType expected = "X_21"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XmlLang01, Strings ) +TEST(XmlLang01, Strings) { XmlLang x; StringType expected = ""; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XmlLang02, Strings ) + +TEST(XmlLang02, Strings) { - XmlLang x( "Test" ); + XmlLang x("Test"); StringType expected = "Test"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XmlLang03, Strings ) + +TEST(XmlLang03, Strings) { - XmlLang x( "Test" ); - x.setValue( "Different" ); + XmlLang x("Test"); + x.setValue("Different"); StringType expected = "Different"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XmlLang04, Strings ) + +TEST(XmlLang04, Strings) { - XmlLang x( "Test" ); - x.setValue( "Think" ); + XmlLang x("Test"); + x.setValue("Think"); std::stringstream ss; - toStream( ss, x ); + toStream(ss, x); StringType expected = "Think"; StringType actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XmlLang05, Strings ) + +TEST(XmlLang05, Strings) { - XmlLang x( "Test" ); - x.setValue( "Hello" ); + XmlLang x("Test"); + x.setValue("Hello"); std::stringstream ss; ss << x; StringType expected = "Hello"; StringType actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XmlLang06, Strings ) + +TEST(XmlLang06, Strings) { - XmlLang x( "Test" ); - x.setValue( "Hello" ); + XmlLang x("Test"); + x.setValue("Hello"); std::stringstream ss; ss << x; StringType expected = "Hello"; - StringType actual = toString( x ); - CHECK_EQUAL( expected, actual ) + StringType actual = toString(x); + CHECK_EQUAL(expected, actual) } - - -TEST( XsAnyUri01, Strings ) +TEST(XsAnyUri01, Strings) { XsAnyUri x; StringType expected = ""; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsAnyUri02, Strings ) + +TEST(XsAnyUri02, Strings) { - XsAnyUri x( "Test" ); + XsAnyUri x("Test"); StringType expected = "Test"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsAnyUri03, Strings ) + +TEST(XsAnyUri03, Strings) { - XsAnyUri x( "Test" ); - x.setValue( "Different" ); + XsAnyUri x("Test"); + x.setValue("Different"); StringType expected = "Different"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsAnyUri04, Strings ) + +TEST(XsAnyUri04, Strings) { - XsAnyUri x( "Test" ); - x.setValue( "Think" ); + XsAnyUri x("Test"); + x.setValue("Think"); std::stringstream ss; - toStream( ss, x ); + toStream(ss, x); StringType expected = "Think"; StringType actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsAnyUri05, Strings ) + +TEST(XsAnyUri05, Strings) { - XsAnyUri x( "Test" ); - x.setValue( "Hello" ); + XsAnyUri x("Test"); + x.setValue("Hello"); std::stringstream ss; ss << x; StringType expected = "Hello"; StringType actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XsAnyUri06, Strings ) + +TEST(XsAnyUri06, Strings) { - XsAnyUri x( "Test" ); - x.setValue( "Hello" ); + XsAnyUri x("Test"); + x.setValue("Hello"); std::stringstream ss; ss << x; StringType expected = "Hello"; - StringType actual = toString( x ); - CHECK_EQUAL( expected, actual ) + StringType actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( XlinkRole01, Strings ) +TEST(XlinkRole01, Strings) { XlinkRole x; StringType expected = ""; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XlinkRole02, Strings ) + +TEST(XlinkRole02, Strings) { - XlinkRole x( "Test" ); + XlinkRole x("Test"); StringType expected = "Test"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XlinkRole03, Strings ) + +TEST(XlinkRole03, Strings) { - XlinkRole x( "\n\t Test \r \t \n String \t" ); + XlinkRole x("\n\t Test \r \t \n String \t"); StringType expected = "Test String"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XlinkTitle01, Strings ) +TEST(XlinkTitle01, Strings) { XlinkTitle x; StringType expected = ""; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XlinkTitle02, Strings ) + +TEST(XlinkTitle02, Strings) { - XlinkTitle x( "Test" ); + XlinkTitle x("Test"); StringType expected = "Test"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( XlinkTitle03, Strings ) + +TEST(XlinkTitle03, Strings) { - XlinkTitle x( "\n\t Test \r \t \n String \t" ); + XlinkTitle x("\n\t Test \r \t \n String \t"); StringType expected = "Test String"; StringType actual = x.getValue(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( CommaSeparatedText01, Strings ) +TEST(CommaSeparatedText01, Strings) { - CommaSeparatedText x( " Hello , \nWorld$#&" ); + CommaSeparatedText x(" Hello , \nWorld$#&"); StringType expected = "Hello,World$#&"; - StringType actual = toString( x ); - CHECK_EQUAL( expected, actual ) + StringType actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( CommaSeparatedText02, Strings ) + +TEST(CommaSeparatedText02, Strings) { CommaSeparatedText x; - x.parse( " One, two, Three, \nFOUR" ); + x.parse(" One, two, Three, \nFOUR"); auto it = x.getValues().cbegin(); - + StringType expected = "One"; - StringType actual = toString( *it ); - CHECK_EQUAL( expected, actual ) - + StringType actual = toString(*it); + CHECK_EQUAL(expected, actual) + ++it; expected = "two"; - actual = toString( *it ); - CHECK_EQUAL( expected, actual ) - + actual = toString(*it); + CHECK_EQUAL(expected, actual) + ++it; expected = "Three"; - actual = toString( *it ); - CHECK_EQUAL( expected, actual ) - + actual = toString(*it); + CHECK_EQUAL(expected, actual) + ++it; expected = "FOUR"; - actual = toString( *it ); - CHECK_EQUAL( expected, actual ) - + actual = toString(*it); + CHECK_EQUAL(expected, actual) + expected = "One,two,Three,FOUR"; - actual = toString( x ); - CHECK_EQUAL( expected, actual ) + actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( CommaSeparatedText03, Strings ) +TEST(CommaSeparatedText03, Strings) { CommaSeparatedText x; - x.parse( " One, two, Three, \nFOUR" ); - CHECK( x.getValuesBegin() != x.getValuesEnd() ); - CHECK( x.getValuesBeginConst() != x.getValuesEndConst() ); - + x.parse(" One, two, Three, \nFOUR"); + CHECK(x.getValuesBegin() != x.getValuesEnd()); + CHECK(x.getValuesBeginConst() != x.getValuesEndConst()); + StringType expected = "One"; StringType actual = toString((*x.getValuesBegin())); - CHECK_EQUAL( expected, actual ) - + CHECK_EQUAL(expected, actual) + expected = "two"; actual = toString((*(++x.getValuesBeginConst()))); - CHECK_EQUAL( expected, actual ) - + CHECK_EQUAL(expected, actual) + auto it = ++(x.getValuesBegin()); - *it = XsToken( " Bones & Bish " ); + *it = XsToken(" Bones & Bish "); expected = "Bones & Bish"; actual = toString((*(++x.getValuesBeginConst()))); - CHECK_EQUAL( expected, actual ) - + CHECK_EQUAL(expected, actual) } -TEST( EndingNumber01, Strings ) +TEST(EndingNumber01, Strings) { EndingNumber x; - CHECK( x.getValuesBegin() == x.getValuesEnd() ) - CHECK_EQUAL( "", toString( x ) ) + CHECK(x.getValuesBegin() == x.getValuesEnd()) + CHECK_EQUAL("", toString(x)) } -TEST( EndingNumber02, Strings ) + +TEST(EndingNumber02, Strings) { - EndingNumber x( "-2,-1,,,,XYZ, 0, @#$@*&#^1,2,3,3,3,3,3" ); - CHECK( x.getValuesBegin() != x.getValuesEnd() ) - CHECK( x.getValuesBeginConst() != x.getValuesEndConst() ) + EndingNumber x("-2,-1,,,,XYZ, 0, @#$@*&#^1,2,3,3,3,3,3"); + CHECK(x.getValuesBegin() != x.getValuesEnd()) + CHECK(x.getValuesBeginConst() != x.getValuesEndConst()) StringType expected = "1,2,3"; - StringType actual = toString( x ); - CHECK_EQUAL( expected, actual ); - CHECK_EQUAL( 1, *(x.getValues().begin()) ) - CHECK_EQUAL( 2, *( ++( x.getValuesBegin() ) ) ) - CHECK_EQUAL( 2, *( ++( x.getValuesBeginConst() ) ) ) - CHECK_EQUAL( 3, *( --( x.getValuesEnd() ) ) ) - CHECK_EQUAL( 3, *( --( x.getValuesEndConst() ) ) ) + StringType actual = toString(x); + CHECK_EQUAL(expected, actual); + CHECK_EQUAL(1, *(x.getValues().begin())) + CHECK_EQUAL(2, *(++(x.getValuesBegin()))) + CHECK_EQUAL(2, *(++(x.getValuesBeginConst()))) + CHECK_EQUAL(3, *(--(x.getValuesEnd()))) + CHECK_EQUAL(3, *(--(x.getValuesEndConst()))) std::stringstream ss; ss << x; expected = "1,2,3"; actual = ss.str(); - CHECK_EQUAL( expected, actual ); - ss.str( "" ); - toStream( ss, x ); + CHECK_EQUAL(expected, actual); + ss.str(""); + toStream(ss, x); expected = "1,2,3"; actual = ss.str(); - CHECK_EQUAL( expected, actual ); + CHECK_EQUAL(expected, actual); } -TEST( TimeOnly01, Strings ) + +TEST(TimeOnly01, Strings) { TimeOnly x; - CHECK( x.getValuesBegin() == x.getValuesEnd() ) - CHECK_EQUAL( "", toString( x ) ) + CHECK(x.getValuesBegin() == x.getValuesEnd()) + CHECK_EQUAL("", toString(x)) } -TEST( TimeOnly02, Strings ) + +TEST(TimeOnly02, Strings) { - TimeOnly x( "-2,-1,,,,XYZ, 0, @#$@*&#^1,2,3,3,3,3,3" ); - CHECK( x.getValuesBegin() != x.getValuesEnd() ) - CHECK( x.getValuesBeginConst() != x.getValuesEndConst() ) + TimeOnly x("-2,-1,,,,XYZ, 0, @#$@*&#^1,2,3,3,3,3,3"); + CHECK(x.getValuesBegin() != x.getValuesEnd()) + CHECK(x.getValuesBeginConst() != x.getValuesEndConst()) StringType expected = "1,2,3"; - StringType actual = toString( x ); - CHECK_EQUAL( expected, actual ); - CHECK_EQUAL( 1, *(x.getValues().begin()) ) - CHECK_EQUAL( 2, *( ++( x.getValuesBegin() ) ) ) - CHECK_EQUAL( 2, *( ++( x.getValuesBeginConst() ) ) ) - CHECK_EQUAL( 3, *( --( x.getValuesEnd() ) ) ) - CHECK_EQUAL( 3, *( --( x.getValuesEndConst() ) ) ) + StringType actual = toString(x); + CHECK_EQUAL(expected, actual); + CHECK_EQUAL(1, *(x.getValues().begin())) + CHECK_EQUAL(2, *(++(x.getValuesBegin()))) + CHECK_EQUAL(2, *(++(x.getValuesBeginConst()))) + CHECK_EQUAL(3, *(--(x.getValuesEnd()))) + CHECK_EQUAL(3, *(--(x.getValuesEndConst()))) std::stringstream ss; ss << x; expected = "1,2,3"; actual = ss.str(); - CHECK_EQUAL( expected, actual ); - ss.str( "" ); - toStream( ss, x ); + CHECK_EQUAL(expected, actual); + ss.str(""); + toStream(ss, x); expected = "1,2,3"; actual = ss.str(); - CHECK_EQUAL( expected, actual ); + CHECK_EQUAL(expected, actual); } -TEST( XlinkHref01, Strings ) +TEST(XlinkHref01, Strings) { - XlinkHref x{ "vodjs" }; - CHECK_EQUAL( "vodjs", x.getValue() ); + XlinkHref x{"vodjs"}; + CHECK_EQUAL("vodjs", x.getValue()); } #endif diff --git a/Sourcecode/private/mxtest/core/StrongAccentTest.cpp b/Sourcecode/private/mxtest/core/StrongAccentTest.cpp index 4710c243e..633b0b99b 100644 --- a/Sourcecode/private/mxtest/core/StrongAccentTest.cpp +++ b/Sourcecode/private/mxtest/core/StrongAccentTest.cpp @@ -6,111 +6,106 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/StrongAccentTest.h" -#include "mxtest/core/PlayTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/PlayTest.h" +#include "mxtest/core/StrongAccentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, StrongAccent ) +TEST(Test01, StrongAccent) { TestMode v = TestMode::one; - StrongAccentPtr object = tgenStrongAccent( v ); - stringstream expected; - tgenStrongAccentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + StrongAccentPtr object = tgenStrongAccent(v); + stringstream expected; + tgenStrongAccentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, StrongAccent ) + +TEST(Test02, StrongAccent) { TestMode v = TestMode::two; - StrongAccentPtr object = tgenStrongAccent( v ); - stringstream expected; - tgenStrongAccentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + StrongAccentPtr object = tgenStrongAccent(v); + stringstream expected; + tgenStrongAccentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test03, StrongAccent ) + +TEST(Test03, StrongAccent) { TestMode v = TestMode::three; - StrongAccentPtr object = tgenStrongAccent( v ); - stringstream expected; - tgenStrongAccentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + StrongAccentPtr object = tgenStrongAccent(v); + stringstream expected; + tgenStrongAccentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } namespace mxtest { - StrongAccentPtr tgenStrongAccent( TestMode v ) +StrongAccentPtr tgenStrongAccent(TestMode v) +{ + StrongAccentPtr o = makeStrongAccent(); + switch (v) { - StrongAccentPtr o = makeStrongAccent(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasFontStyle = true; - o->getAttributes()->hasRelativeX = true; - o->getAttributes()->relativeX = TenthsValue( -1.1 ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasDefaultY = true; - o->getAttributes()->defaultY = TenthsValue( 2.2 ); - } - break; - default: - break; - } - return o; + case TestMode::one: { } - void tgenStrongAccentExpected(std::ostream& os, int i, TestMode v ) - { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()", false ); + break; + case TestMode::two: { + o->getAttributes()->hasFontStyle = true; + o->getAttributes()->hasRelativeX = true; + o->getAttributes()->relativeX = TenthsValue(-1.1); + } + break; + case TestMode::three: { + o->getAttributes()->hasDefaultY = true; + o->getAttributes()->defaultY = TenthsValue(2.2); + } + break; + default: + break; + } + return o; +} + +void tgenStrongAccentExpected(std::ostream &os, int i, TestMode v) +{ - } - break; - default: - break; - } + switch (v) + { + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/StrongAccentTest.h b/Sourcecode/private/mxtest/core/StrongAccentTest.h index d61e4e808..ec3e996a4 100644 --- a/Sourcecode/private/mxtest/core/StrongAccentTest.h +++ b/Sourcecode/private/mxtest/core/StrongAccentTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::StrongAccentPtr tgenStrongAccent( TestMode v ); - void tgenStrongAccentExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::StrongAccentPtr tgenStrongAccent(TestMode v); +void tgenStrongAccentExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SuffixTest.cpp b/Sourcecode/private/mxtest/core/SuffixTest.cpp index 0bb6964b3..a37e780e1 100644 --- a/Sourcecode/private/mxtest/core/SuffixTest.cpp +++ b/Sourcecode/private/mxtest/core/SuffixTest.cpp @@ -11,35 +11,37 @@ using namespace mx::core; -TEST( Test01, Suffix ) +TEST(Test01, Suffix) { - std::string indentString( INDENT ); - XsString value1{ "Birds" }; - XsString value2{ "Bees" }; - Suffix object1; - Suffix object2( value2 ); - SuffixAttributesPtr attributes1 = std::make_shared(); - SuffixAttributesPtr attributesNull; - /* set some attribute1 values here */ - attributes1->hasRelativeX = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Bees)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"Birds"}; + XsString value2{"Bees"}; + Suffix object1; + Suffix object2(value2); + SuffixAttributesPtr attributes1 = std::make_shared(); + SuffixAttributesPtr attributesNull; + /* set some attribute1 values here */ + attributes1->hasRelativeX = true; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Bees)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SupportsTest.cpp b/Sourcecode/private/mxtest/core/SupportsTest.cpp index f983bd45b..c3c289b79 100644 --- a/Sourcecode/private/mxtest/core/SupportsTest.cpp +++ b/Sourcecode/private/mxtest/core/SupportsTest.cpp @@ -11,40 +11,42 @@ using namespace mx::core; -TEST( Test01, Supports ) +TEST(Test01, Supports) { - std::string indentString( INDENT ); - Supports object1; - Supports object2; - SupportsAttributesPtr attributes1 = std::make_shared(); - SupportsAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Supports object1; + Supports object2; + SupportsAttributesPtr attributes1 = std::make_shared(); + SupportsAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasValue = true; attributes1->hasAttribute = true; - attributes1->attribute = XsNMToken{ "A" }; - attributes1->value = XsToken{ "B" }; + attributes1->attribute = XsNMToken{"A"}; + attributes1->value = XsToken{"B"}; attributes1->type = YesNo::yes; - attributes1->element = { "C" }; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->element = {"C"}; + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/SyllabicTest.cpp b/Sourcecode/private/mxtest/core/SyllabicTest.cpp index 905220155..71e1c212f 100644 --- a/Sourcecode/private/mxtest/core/SyllabicTest.cpp +++ b/Sourcecode/private/mxtest/core/SyllabicTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Syllabic ) +TEST(Test01, Syllabic) { - std::string indentString( INDENT ); - SyllabicEnum value1 = SyllabicEnum::middle; - SyllabicEnum value2 = SyllabicEnum::single; - Syllabic object1; - Syllabic object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(begin)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(single)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + SyllabicEnum value1 = SyllabicEnum::middle; + SyllabicEnum value2 = SyllabicEnum::single; + Syllabic object1; + Syllabic object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(begin)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(single)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.cpp b/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.cpp index d510cca3e..c440ffb10 100644 --- a/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.cpp +++ b/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.cpp @@ -6,127 +6,124 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" #include "mxtest/core/ElisionSyllabicGroupTest.h" #include "mxtest/core/ElisionSyllabicTextGroupTest.h" -#include "mxtest/core/SyllabicTextGroupTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/SyllabicTextGroupTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, SyllabicTextGroup ) +TEST(Test01, SyllabicTextGroup) { TestMode v = TestMode::one; - SyllabicTextGroupPtr object = tgenSyllabicTextGroup( v ); - stringstream expected; - tgenSyllabicTextGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SyllabicTextGroupPtr object = tgenSyllabicTextGroup(v); + stringstream expected; + tgenSyllabicTextGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, SyllabicTextGroup ) + +TEST(Test02, SyllabicTextGroup) { TestMode v = TestMode::two; - SyllabicTextGroupPtr object = tgenSyllabicTextGroup( v ); - stringstream expected; - tgenSyllabicTextGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SyllabicTextGroupPtr object = tgenSyllabicTextGroup(v); + stringstream expected; + tgenSyllabicTextGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + bool isOneLineOnly = true; + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, SyllabicTextGroup ) + +TEST(Test03, SyllabicTextGroup) { TestMode v = TestMode::three; - SyllabicTextGroupPtr object = tgenSyllabicTextGroup( v ); - stringstream expected; - tgenSyllabicTextGroupExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + SyllabicTextGroupPtr object = tgenSyllabicTextGroup(v); + stringstream expected; + tgenSyllabicTextGroupExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - SyllabicTextGroupPtr tgenSyllabicTextGroup( TestMode v ) +SyllabicTextGroupPtr tgenSyllabicTextGroup(TestMode v) +{ + SyllabicTextGroupPtr o = makeSyllabicTextGroup(); + switch (v) { - SyllabicTextGroupPtr o = makeSyllabicTextGroup(); - switch ( v ) - { - case TestMode::one: - { - o->getText()->setValue( XsString( "tgenSyllabicTextGroup One" ) ); - } - break; - case TestMode::two: - { - o->getText()->setValue( XsString( "tgenSyllabicTextGroup Two" ) ); - o->addElisionSyllabicTextGroup( tgenElisionSyllabicTextGroup( v ) ); - o->setHasExtend( true ); - } - break; - case TestMode::three: - { - o->getText()->setValue( XsString( "tgenSyllabicTextGroup Three" ) ); - o->addElisionSyllabicTextGroup( tgenElisionSyllabicTextGroup( v ) ); - o->addElisionSyllabicTextGroup( tgenElisionSyllabicTextGroup( TestMode::one ) ); - o->setHasSyllabic( true ); - o->setHasExtend( true ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + o->getText()->setValue(XsString("tgenSyllabicTextGroup One")); + } + break; + case TestMode::two: { + o->getText()->setValue(XsString("tgenSyllabicTextGroup Two")); + o->addElisionSyllabicTextGroup(tgenElisionSyllabicTextGroup(v)); + o->setHasExtend(true); } - void tgenSyllabicTextGroupExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->getText()->setValue(XsString("tgenSyllabicTextGroup Three")); + o->addElisionSyllabicTextGroup(tgenElisionSyllabicTextGroup(v)); + o->addElisionSyllabicTextGroup(tgenElisionSyllabicTextGroup(TestMode::one)); + o->setHasSyllabic(true); + o->setHasExtend(true); + } + break; + default: + break; + } + return o; +} + +void tgenSyllabicTextGroupExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - - streamLine( os, i, R"(tgenSyllabicTextGroup One)", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"(tgenSyllabicTextGroup Two)" ); - tgenElisionSyllabicTextGroupExpected( os, i, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"(begin)" ); - streamLine( os, i, R"(tgenSyllabicTextGroup Three)" ); - tgenElisionSyllabicTextGroupExpected( os, i, v ); - os << std::endl; - tgenElisionSyllabicTextGroupExpected(os, i, TestMode::one ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + + streamLine(os, i, R"(tgenSyllabicTextGroup One)", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"(tgenSyllabicTextGroup Two)"); + tgenElisionSyllabicTextGroupExpected(os, i, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"(begin)"); + streamLine(os, i, R"(tgenSyllabicTextGroup Three)"); + tgenElisionSyllabicTextGroupExpected(os, i, v); + os << std::endl; + tgenElisionSyllabicTextGroupExpected(os, i, TestMode::one); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.h b/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.h index 53956dcf5..d18de224f 100644 --- a/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.h +++ b/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::SyllabicTextGroupPtr tgenSyllabicTextGroup( TestMode v ); - void tgenSyllabicTextGroupExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::SyllabicTextGroupPtr tgenSyllabicTextGroup(TestMode v); +void tgenSyllabicTextGroupExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SystemDistanceTest.cpp b/Sourcecode/private/mxtest/core/SystemDistanceTest.cpp index d9a731385..373577134 100644 --- a/Sourcecode/private/mxtest/core/SystemDistanceTest.cpp +++ b/Sourcecode/private/mxtest/core/SystemDistanceTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, SystemDistance ) +TEST(Test01, SystemDistance) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - SystemDistance object1; - SystemDistance object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + SystemDistance object1; + SystemDistance object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/SystemDividersTest.cpp b/Sourcecode/private/mxtest/core/SystemDividersTest.cpp index 6ad09f91c..c98e2fdcc 100644 --- a/Sourcecode/private/mxtest/core/SystemDividersTest.cpp +++ b/Sourcecode/private/mxtest/core/SystemDividersTest.cpp @@ -6,119 +6,114 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/SystemDividersTest.h" -#include "mxtest/core/PlayTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - +#include "mxtest/core/PlayTest.h" +#include "mxtest/core/SystemDividersTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, SystemDividers ) +TEST(Test01, SystemDividers) { TestMode v = TestMode::one; - SystemDividersPtr object = tgenSystemDividers( v ); - stringstream expected; - tgenSystemDividersExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SystemDividersPtr object = tgenSystemDividers(v); + stringstream expected; + tgenSystemDividersExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, SystemDividers ) + +TEST(Test02, SystemDividers) { TestMode v = TestMode::two; - SystemDividersPtr object = tgenSystemDividers( v ); - stringstream expected; - tgenSystemDividersExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SystemDividersPtr object = tgenSystemDividers(v); + stringstream expected; + tgenSystemDividersExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, SystemDividers ) + +TEST(Test03, SystemDividers) { TestMode v = TestMode::three; - SystemDividersPtr object = tgenSystemDividers( v ); - stringstream expected; - tgenSystemDividersExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SystemDividersPtr object = tgenSystemDividers(v); + stringstream expected; + tgenSystemDividersExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - SystemDividersPtr tgenSystemDividers( TestMode v ) +SystemDividersPtr tgenSystemDividers(TestMode v) +{ + SystemDividersPtr o = makeSystemDividers(); + switch (v) { - SystemDividersPtr o = makeSystemDividers(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getLeftDivider()->getAttributes()->hasHalign = true; - o->getRightDivider()->getAttributes()->hasFontSize = true; - } - break; - case TestMode::three: - { - o->getLeftDivider()->getAttributes()->hasDefaultY = true; - o->getRightDivider()->getAttributes()->hasRelativeX = true; - } - break; - default: - break; - } - return o; + case TestMode::one: { } - void tgenSystemDividersExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::two: { + o->getLeftDivider()->getAttributes()->hasHalign = true; + o->getRightDivider()->getAttributes()->hasFontSize = true; + } + break; + case TestMode::three: { + o->getLeftDivider()->getAttributes()->hasDefaultY = true; + o->getRightDivider()->getAttributes()->hasRelativeX = true; + } + break; + default: + break; + } + return o; +} + +void tgenSystemDividersExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SystemDividersTest.h b/Sourcecode/private/mxtest/core/SystemDividersTest.h index 729916836..18884b37d 100644 --- a/Sourcecode/private/mxtest/core/SystemDividersTest.h +++ b/Sourcecode/private/mxtest/core/SystemDividersTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::SystemDividersPtr tgenSystemDividers( TestMode v ); - void tgenSystemDividersExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::SystemDividersPtr tgenSystemDividers(TestMode v); +void tgenSystemDividersExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SystemLayoutTest.cpp b/Sourcecode/private/mxtest/core/SystemLayoutTest.cpp index bb1e9c725..f7c89357e 100644 --- a/Sourcecode/private/mxtest/core/SystemLayoutTest.cpp +++ b/Sourcecode/private/mxtest/core/SystemLayoutTest.cpp @@ -7,130 +7,125 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/SystemDividersTest.h" #include "mxtest/core/SystemLayoutTest.h" #include "mxtest/core/SystemMarginsTest.h" -#include "mxtest/core/SystemDividersTest.h" - using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, SystemLayout ) +TEST(Test01, SystemLayout) { TestMode v = TestMode::one; - SystemLayoutPtr object = tgenSystemLayout( v ); - stringstream expected; - tgenSystemLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + SystemLayoutPtr object = tgenSystemLayout(v); + stringstream expected; + tgenSystemLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, SystemLayout ) + +TEST(Test02, SystemLayout) { TestMode v = TestMode::two; - SystemLayoutPtr object = tgenSystemLayout( v ); - stringstream expected; - tgenSystemLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SystemLayoutPtr object = tgenSystemLayout(v); + stringstream expected; + tgenSystemLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, SystemLayout ) + +TEST(Test03, SystemLayout) { TestMode v = TestMode::three; - SystemLayoutPtr object = tgenSystemLayout( v ); - stringstream expected; - tgenSystemLayoutExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SystemLayoutPtr object = tgenSystemLayout(v); + stringstream expected; + tgenSystemLayoutExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - SystemLayoutPtr tgenSystemLayout( TestMode v ) +SystemLayoutPtr tgenSystemLayout(TestMode v) +{ + SystemLayoutPtr o = makeSystemLayout(); + switch (v) { - SystemLayoutPtr o = makeSystemLayout(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasSystemMargins( true ); - o->setSystemMargins( tgenSystemMargins( v ) ); - o->setHasTopSystemDistance( true ); - o->getTopSystemDistance()->setValue( TenthsValue( 1.1 ) ); - o->setHasSystemDistance( true ); - o->getSystemDistance()->setValue( TenthsValue( 2.2 ) ); - o->setHasSystemDividers( true ); - o->setSystemDividers( tgenSystemDividers( v ) ); - } - break; - case TestMode::three: - { - o->setHasSystemMargins( true ); - o->setSystemMargins( tgenSystemMargins( v ) ); - o->setHasTopSystemDistance( true ); - o->getTopSystemDistance()->setValue( TenthsValue( 3.3 ) ); - o->setHasSystemDistance( true ); - o->getSystemDistance()->setValue( TenthsValue( 4.4 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasSystemMargins(true); + o->setSystemMargins(tgenSystemMargins(v)); + o->setHasTopSystemDistance(true); + o->getTopSystemDistance()->setValue(TenthsValue(1.1)); + o->setHasSystemDistance(true); + o->getSystemDistance()->setValue(TenthsValue(2.2)); + o->setHasSystemDividers(true); + o->setSystemDividers(tgenSystemDividers(v)); + } + break; + case TestMode::three: { + o->setHasSystemMargins(true); + o->setSystemMargins(tgenSystemMargins(v)); + o->setHasTopSystemDistance(true); + o->getTopSystemDistance()->setValue(TenthsValue(3.3)); + o->setHasSystemDistance(true); + o->getSystemDistance()->setValue(TenthsValue(4.4)); } - void tgenSystemLayoutExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenSystemLayoutExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenSystemMarginsExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(2.2)" ); - streamLine( os, i+1, R"(1.1)" ); - tgenSystemDividersExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenSystemMarginsExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(4.4)" ); - streamLine( os, i+1, R"(3.3)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenSystemMarginsExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(2.2)"); + streamLine(os, i + 1, R"(1.1)"); + tgenSystemDividersExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenSystemMarginsExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(4.4)"); + streamLine(os, i + 1, R"(3.3)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SystemLayoutTest.h b/Sourcecode/private/mxtest/core/SystemLayoutTest.h index 3206d2f8b..680b61917 100644 --- a/Sourcecode/private/mxtest/core/SystemLayoutTest.h +++ b/Sourcecode/private/mxtest/core/SystemLayoutTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::SystemLayoutPtr tgenSystemLayout( TestMode v ); - void tgenSystemLayoutExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::SystemLayoutPtr tgenSystemLayout(TestMode v); +void tgenSystemLayoutExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SystemMarginsTest.cpp b/Sourcecode/private/mxtest/core/SystemMarginsTest.cpp index 25eeeb3e4..ede15b871 100644 --- a/Sourcecode/private/mxtest/core/SystemMarginsTest.cpp +++ b/Sourcecode/private/mxtest/core/SystemMarginsTest.cpp @@ -6,119 +6,115 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/SystemMarginsTest.h" -#include "mxtest/core/PlayTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" - +#include "mxtest/core/PlayTest.h" +#include "mxtest/core/SystemMarginsTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, SystemMargins ) +TEST(Test01, SystemMargins) { TestMode v = TestMode::one; - SystemMarginsPtr object = tgenSystemMargins( v ); - stringstream expected; - tgenSystemMarginsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SystemMarginsPtr object = tgenSystemMargins(v); + stringstream expected; + tgenSystemMarginsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, SystemMargins ) + +TEST(Test02, SystemMargins) { TestMode v = TestMode::two; - SystemMarginsPtr object = tgenSystemMargins( v ); - stringstream expected; - tgenSystemMarginsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SystemMarginsPtr object = tgenSystemMargins(v); + stringstream expected; + tgenSystemMarginsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, SystemMargins ) + +TEST(Test03, SystemMargins) { TestMode v = TestMode::three; - SystemMarginsPtr object = tgenSystemMargins( v ); - stringstream expected; - tgenSystemMarginsExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + SystemMarginsPtr object = tgenSystemMargins(v); + stringstream expected; + tgenSystemMarginsExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - SystemMarginsPtr tgenSystemMargins( TestMode v ) +SystemMarginsPtr tgenSystemMargins(TestMode v) +{ + SystemMarginsPtr o = makeSystemMargins(); + switch (v) { - SystemMarginsPtr o = makeSystemMargins(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getLeftMargin()->setValue( TenthsValue( 11.1 ) ); - o->getRightMargin()->setValue( TenthsValue( 12.2 ) ); - } - break; - case TestMode::three: - { - o->getLeftMargin()->setValue( TenthsValue( 110.1 ) ); - o->getRightMargin()->setValue( TenthsValue( 120.2 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { } - void tgenSystemMarginsExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::two: { + o->getLeftMargin()->setValue(TenthsValue(11.1)); + o->getRightMargin()->setValue(TenthsValue(12.2)); + } + break; + case TestMode::three: { + o->getLeftMargin()->setValue(TenthsValue(110.1)); + o->getRightMargin()->setValue(TenthsValue(120.2)); + } + break; + default: + break; + } + return o; +} + +void tgenSystemMarginsExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(11.1)" ); - streamLine( os, i+1, R"(12.2)" );; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(110.1)" ); - streamLine( os, i+1, R"(120.2)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(11.1)"); + streamLine(os, i + 1, R"(12.2)"); + ; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(110.1)"); + streamLine(os, i + 1, R"(120.2)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/SystemMarginsTest.h b/Sourcecode/private/mxtest/core/SystemMarginsTest.h index f5018d3fd..8c433b007 100644 --- a/Sourcecode/private/mxtest/core/SystemMarginsTest.h +++ b/Sourcecode/private/mxtest/core/SystemMarginsTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::SystemMarginsPtr tgenSystemMargins( TestMode v ); - void tgenSystemMarginsExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::SystemMarginsPtr tgenSystemMargins(TestMode v); +void tgenSystemMarginsExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TapTest.cpp b/Sourcecode/private/mxtest/core/TapTest.cpp index 603593a9f..f75af2a30 100644 --- a/Sourcecode/private/mxtest/core/TapTest.cpp +++ b/Sourcecode/private/mxtest/core/TapTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Tap ) +TEST(Test01, Tap) { - std::string indentString( INDENT ); - XsString value1{ "Grieg" }; - XsString value2{ "Sandström" }; - Tap object1; - Tap object2( value2 ); - TapAttributesPtr attributes1 = std::make_shared(); - TapAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"Grieg"}; + XsString value2{"Sandström"}; + Tap object1; + Tap object2(value2); + TapAttributesPtr attributes1 = std::make_shared(); + TapAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasFontWeight = true; attributes1->fontWeight = FontWeight::normal; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Sandström)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Sandström)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TechnicalChoiceTest.cpp b/Sourcecode/private/mxtest/core/TechnicalChoiceTest.cpp index 149f029cb..aa496f955 100644 --- a/Sourcecode/private/mxtest/core/TechnicalChoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/TechnicalChoiceTest.cpp @@ -6,110 +6,106 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/HarmonicTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/TechnicalChoiceTest.h" -#include "mxtest/core/HarmonicTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, TechnicalChoice ) +TEST(Test01, TechnicalChoice) { TestMode v = TestMode::one; - TechnicalChoicePtr object = tgenTechnicalChoice( v ); - stringstream expected; - tgenTechnicalChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + TechnicalChoicePtr object = tgenTechnicalChoice(v); + stringstream expected; + tgenTechnicalChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, TechnicalChoice ) + +TEST(Test02, TechnicalChoice) { TestMode v = TestMode::two; - TechnicalChoicePtr object = tgenTechnicalChoice( v ); - stringstream expected; - tgenTechnicalChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + TechnicalChoicePtr object = tgenTechnicalChoice(v); + stringstream expected; + tgenTechnicalChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, TechnicalChoice ) + +TEST(Test03, TechnicalChoice) { TestMode v = TestMode::three; - TechnicalChoicePtr object = tgenTechnicalChoice( v ); - stringstream expected; - tgenTechnicalChoiceExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); + TechnicalChoicePtr object = tgenTechnicalChoice(v); + stringstream expected; + tgenTechnicalChoiceExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); bool isOneLineOnly = true; - object->streamContents( actual, 1, isOneLineOnly ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + object->streamContents(actual, 1, isOneLineOnly); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - TechnicalChoicePtr tgenTechnicalChoice( TestMode v ) +TechnicalChoicePtr tgenTechnicalChoice(TestMode v) +{ + TechnicalChoicePtr o = makeTechnicalChoice(); + switch (v) { - TechnicalChoicePtr o = makeTechnicalChoice(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setChoice( TechnicalChoice::Choice::string_ ); - o->getString()->setValue( StringNumber( 4 ) ); - } - break; - case TestMode::three: - { - o->setChoice( TechnicalChoice::Choice::harmonic ); - o->setHarmonic( tgenHarmonic( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setChoice(TechnicalChoice::Choice::string_); + o->getString()->setValue(StringNumber(4)); + } + break; + case TestMode::three: { + o->setChoice(TechnicalChoice::Choice::harmonic); + o->setHarmonic(tgenHarmonic(v)); + } + break; + default: + break; } - void tgenTechnicalChoiceExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenTechnicalChoiceExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"(4)", false ); - } - break; - case TestMode::three: - { - tgenHarmonicExpected( os, i, v ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"(4)", false); + } + break; + case TestMode::three: { + tgenHarmonicExpected(os, i, v); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TechnicalChoiceTest.h b/Sourcecode/private/mxtest/core/TechnicalChoiceTest.h index dbd91564b..ca0e615c7 100644 --- a/Sourcecode/private/mxtest/core/TechnicalChoiceTest.h +++ b/Sourcecode/private/mxtest/core/TechnicalChoiceTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::TechnicalChoicePtr tgenTechnicalChoice( TestMode v ); - void tgenTechnicalChoiceExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::TechnicalChoicePtr tgenTechnicalChoice(TestMode v); +void tgenTechnicalChoiceExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TechnicalTest.cpp b/Sourcecode/private/mxtest/core/TechnicalTest.cpp index 7efef7695..3fe53e771 100644 --- a/Sourcecode/private/mxtest/core/TechnicalTest.cpp +++ b/Sourcecode/private/mxtest/core/TechnicalTest.cpp @@ -7,126 +7,121 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/TechnicalTest.h" #include "mxtest/core/TechnicalChoiceTest.h" +#include "mxtest/core/TechnicalTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Technical ) +TEST(Test01, Technical) { TestMode v = TestMode::one; - TechnicalPtr object = tgenTechnical( v ); - stringstream expected; - tgenTechnicalExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + TechnicalPtr object = tgenTechnical(v); + stringstream expected; + tgenTechnicalExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Technical ) + +TEST(Test02, Technical) { TestMode v = TestMode::two; - TechnicalPtr object = tgenTechnical( v ); - stringstream expected; - tgenTechnicalExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TechnicalPtr object = tgenTechnical(v); + stringstream expected; + tgenTechnicalExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Technical ) + +TEST(Test03, Technical) { TestMode v = TestMode::three; - TechnicalPtr object = tgenTechnical( v ); - stringstream expected; - tgenTechnicalExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TechnicalPtr object = tgenTechnical(v); + stringstream expected; + tgenTechnicalExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - TechnicalPtr tgenTechnical( TestMode v ) +TechnicalPtr tgenTechnical(TestMode v) +{ + TechnicalPtr o = makeTechnical(); + switch (v) { - TechnicalPtr o = makeTechnical(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->addTechnicalChoice( tgenTechnicalChoice( TestMode::one ) ); - o->addTechnicalChoice( tgenTechnicalChoice( TestMode::two ) ); - auto x = makeTechnicalChoice(); - x->setChoice( TechnicalChoice::Choice::handbell ); - x->getHandbell()->setValue( HandbellValue::gyro ); - o->addTechnicalChoice( x ); - } - break; - case TestMode::three: - { - o->addTechnicalChoice( tgenTechnicalChoice( v ) ); - auto x = makeTechnicalChoice(); - x->setChoice( TechnicalChoice::Choice::otherTechnical ); - x->getOtherTechnical()->setValue( XsString( "Jump up and down" ) ); - x->getOtherTechnical()->getAttributes()->hasFontStyle = true; - x->getOtherTechnical()->getAttributes()->fontStyle = FontStyle::italic; - o->addTechnicalChoice( x ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->addTechnicalChoice(tgenTechnicalChoice(TestMode::one)); + o->addTechnicalChoice(tgenTechnicalChoice(TestMode::two)); + auto x = makeTechnicalChoice(); + x->setChoice(TechnicalChoice::Choice::handbell); + x->getHandbell()->setValue(HandbellValue::gyro); + o->addTechnicalChoice(x); + } + break; + case TestMode::three: { + o->addTechnicalChoice(tgenTechnicalChoice(v)); + auto x = makeTechnicalChoice(); + x->setChoice(TechnicalChoice::Choice::otherTechnical); + x->getOtherTechnical()->setValue(XsString("Jump up and down")); + x->getOtherTechnical()->getAttributes()->hasFontStyle = true; + x->getOtherTechnical()->getAttributes()->fontStyle = FontStyle::italic; + o->addTechnicalChoice(x); + } + break; + default: + break; } - void tgenTechnicalExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenTechnicalExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenTechnicalChoiceExpected(os, i+1, TestMode::one ); - os << std::endl; - tgenTechnicalChoiceExpected(os, i+1, TestMode::two ); - os << std::endl; - streamLine( os, i+1, R"(gyro)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenTechnicalChoiceExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i+1, R"(Jump up and down)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenTechnicalChoiceExpected(os, i + 1, TestMode::one); + os << std::endl; + tgenTechnicalChoiceExpected(os, i + 1, TestMode::two); + os << std::endl; + streamLine(os, i + 1, R"(gyro)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenTechnicalChoiceExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i + 1, R"(Jump up and down)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif - diff --git a/Sourcecode/private/mxtest/core/TechnicalTest.h b/Sourcecode/private/mxtest/core/TechnicalTest.h index 64402f1ae..92aa33bfc 100644 --- a/Sourcecode/private/mxtest/core/TechnicalTest.h +++ b/Sourcecode/private/mxtest/core/TechnicalTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::TechnicalPtr tgenTechnical( TestMode v ); - void tgenTechnicalExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::TechnicalPtr tgenTechnical(TestMode v); +void tgenTechnicalExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TenthsTest.cpp b/Sourcecode/private/mxtest/core/TenthsTest.cpp index 6cd7c1654..ed99af6c9 100644 --- a/Sourcecode/private/mxtest/core/TenthsTest.cpp +++ b/Sourcecode/private/mxtest/core/TenthsTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Tenths ) +TEST(Test01, Tenths) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - Tenths object1; - Tenths object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + Tenths object1; + Tenths object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TenutoTest.cpp b/Sourcecode/private/mxtest/core/TenutoTest.cpp index ac6d40fe3..bfb990964 100644 --- a/Sourcecode/private/mxtest/core/TenutoTest.cpp +++ b/Sourcecode/private/mxtest/core/TenutoTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Tenuto ) +TEST(Test01, Tenuto) { - std::string indentString( INDENT ); - Tenuto object1; - Tenuto object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Tenuto object1; + Tenuto object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/TextTest.cpp b/Sourcecode/private/mxtest/core/TextTest.cpp index d95de012f..31d59e347 100644 --- a/Sourcecode/private/mxtest/core/TextTest.cpp +++ b/Sourcecode/private/mxtest/core/TextTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Text ) +TEST(Test01, Text) { - std::string indentString( INDENT ); - XsString value1{ "For score and seven years ago." }; - XsString value2{ "How now brown cow." }; - Text object1; - Text object2( value2 ); - TextAttributesPtr attributes1 = std::make_shared(); - TextAttributesPtr attributesNull; - /* set some attribute1 values here */ - object2.setAttributes( attributes1 ); + std::string indentString(INDENT); + XsString value1{"For score and seven years ago."}; + XsString value2{"How now brown cow."}; + Text object1; + Text object2(value2); + TextAttributesPtr attributes1 = std::make_shared(); + TextAttributesPtr attributesNull; + /* set some attribute1 values here */ + object2.setAttributes(attributes1); attributes1->hasLang = true; attributes1->hasLetterSpacing = true; - attributes1->letterSpacing = NumberOrNormal( "1" ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(How now brown cow.)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->letterSpacing = NumberOrNormal("1"); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(How now brown cow.)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/ThumbPositionTest.cpp b/Sourcecode/private/mxtest/core/ThumbPositionTest.cpp index 80a48dae8..945393e5b 100644 --- a/Sourcecode/private/mxtest/core/ThumbPositionTest.cpp +++ b/Sourcecode/private/mxtest/core/ThumbPositionTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, ThumbPosition ) +TEST(Test01, ThumbPosition) { - std::string indentString( INDENT ); - ThumbPosition object1; - ThumbPosition object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + ThumbPosition object1; + ThumbPosition object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/TieTest.cpp b/Sourcecode/private/mxtest/core/TieTest.cpp index 8dc98b442..b3039a9f0 100644 --- a/Sourcecode/private/mxtest/core/TieTest.cpp +++ b/Sourcecode/private/mxtest/core/TieTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Tie ) +TEST(Test01, Tie) { - std::string indentString( INDENT ); - Tie object1; - Tie object2; - TieAttributesPtr attributes1 = std::make_shared(); - TieAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Tie object1; + Tie object2; + TieAttributesPtr attributes1 = std::make_shared(); + TieAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasTimeOnly = true; - attributes1->timeOnly = TimeOnly{ "1,4,6" }; + attributes1->timeOnly = TimeOnly{"1,4,6"}; attributes1->type = StartStop::stop; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/TiedTest.cpp b/Sourcecode/private/mxtest/core/TiedTest.cpp index 91fdef68d..16ac3ce3c 100644 --- a/Sourcecode/private/mxtest/core/TiedTest.cpp +++ b/Sourcecode/private/mxtest/core/TiedTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, Tied ) +TEST(Test01, Tied) { - std::string indentString( INDENT ); - Tied object1; - Tied object2; - TiedAttributesPtr attributes1 = std::make_shared(); - TiedAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Tied object1; + Tied object2; + TiedAttributesPtr attributes1 = std::make_shared(); + TiedAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->number = NumberLevel{2}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/TimeModificationTest.cpp b/Sourcecode/private/mxtest/core/TimeModificationTest.cpp index ab52b177c..dfb9a1cff 100644 --- a/Sourcecode/private/mxtest/core/TimeModificationTest.cpp +++ b/Sourcecode/private/mxtest/core/TimeModificationTest.cpp @@ -6,153 +6,145 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/TimeModificationTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/TimeModificationTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, TimeModification ) +TEST(Test01, TimeModification) { TestMode v = TestMode::one; - TimeModificationPtr object = tgenTimeModification( v ); - stringstream expected; - tgenTimeModificationExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TimeModificationPtr object = tgenTimeModification(v); + stringstream expected; + tgenTimeModificationExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, TimeModification ) + +TEST(Test02, TimeModification) { TestMode v = TestMode::two; - TimeModificationPtr object = tgenTimeModification( v ); - stringstream expected; - tgenTimeModificationExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TimeModificationPtr object = tgenTimeModification(v); + stringstream expected; + tgenTimeModificationExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, TimeModification ) + +TEST(Test03, TimeModification) { TestMode v = TestMode::three; - TimeModificationPtr object = tgenTimeModification( v ); - stringstream expected; - tgenTimeModificationExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TimeModificationPtr object = tgenTimeModification(v); + stringstream expected; + tgenTimeModificationExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - NormalTypeNormalDotGroupPtr tgenNormalTypeNormalDotGroup( TestMode v ) +NormalTypeNormalDotGroupPtr tgenNormalTypeNormalDotGroup(TestMode v) +{ + NormalTypeNormalDotGroupPtr o = makeNormalTypeNormalDotGroup(); + switch (v) { - NormalTypeNormalDotGroupPtr o = makeNormalTypeNormalDotGroup(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getNormalType()->setValue( NoteTypeValue::half ); - o->addNormalDot( makeNormalDot() ); - o->addNormalDot( makeNormalDot() ); - - } - break; - case TestMode::three: - { - o->getNormalType()->setValue( NoteTypeValue::thirtySecond ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getNormalType()->setValue(NoteTypeValue::half); + o->addNormalDot(makeNormalDot()); + o->addNormalDot(makeNormalDot()); } - TimeModificationPtr tgenTimeModification( TestMode v ) + break; + case TestMode::three: { + o->getNormalType()->setValue(NoteTypeValue::thirtySecond); + } + break; + default: + break; + } + return o; +} + +TimeModificationPtr tgenTimeModification(TestMode v) +{ + TimeModificationPtr o = makeTimeModification(); + switch (v) { - TimeModificationPtr o = makeTimeModification(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasNormalTypeNormalDotGroup( true ); - o->setNormalTypeNormalDotGroup( tgenNormalTypeNormalDotGroup( v ) ); - o->getActualNotes()->setValue( NonNegativeInteger( 5 ) ); - o->getNormalNotes()->setValue( NonNegativeInteger( 4 ) ); - } - break; - case TestMode::three: - { - o->setHasNormalTypeNormalDotGroup( true ); - o->setNormalTypeNormalDotGroup( tgenNormalTypeNormalDotGroup( v ) ); - o->getActualNotes()->setValue( NonNegativeInteger( 4 ) ); - o->getNormalNotes()->setValue( NonNegativeInteger( 3 ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasNormalTypeNormalDotGroup(true); + o->setNormalTypeNormalDotGroup(tgenNormalTypeNormalDotGroup(v)); + o->getActualNotes()->setValue(NonNegativeInteger(5)); + o->getNormalNotes()->setValue(NonNegativeInteger(4)); } - void tgenTimeModificationExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->setHasNormalTypeNormalDotGroup(true); + o->setNormalTypeNormalDotGroup(tgenNormalTypeNormalDotGroup(v)); + o->getActualNotes()->setValue(NonNegativeInteger(4)); + o->getNormalNotes()->setValue(NonNegativeInteger(3)); + } + break; + default: + break; + } + return o; +} + +void tgenTimeModificationExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i+1, R"(0)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(5)" ); - streamLine( os, i+1, R"(4)" ); - streamLine( os, i+1, R"(half)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(4)" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i+1, R"(32nd)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i + 1, R"(0)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(5)"); + streamLine(os, i + 1, R"(4)"); + streamLine(os, i + 1, R"(half)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(4)"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i + 1, R"(32nd)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TimeModificationTest.h b/Sourcecode/private/mxtest/core/TimeModificationTest.h index cfad00a22..8a41449fb 100644 --- a/Sourcecode/private/mxtest/core/TimeModificationTest.h +++ b/Sourcecode/private/mxtest/core/TimeModificationTest.h @@ -7,14 +7,14 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::NormalTypeNormalDotGroupPtr tgenNormalTypeNormalDotGroup( TestMode v ); - mx::core::TimeModificationPtr tgenTimeModification( TestMode v ); - void tgenTimeModificationExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::NormalTypeNormalDotGroupPtr tgenNormalTypeNormalDotGroup(TestMode v); +mx::core::TimeModificationPtr tgenTimeModification(TestMode v); +void tgenTimeModificationExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TimeRelationTest.cpp b/Sourcecode/private/mxtest/core/TimeRelationTest.cpp index c6f59741b..3f4eae3dc 100644 --- a/Sourcecode/private/mxtest/core/TimeRelationTest.cpp +++ b/Sourcecode/private/mxtest/core/TimeRelationTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, TimeRelation ) +TEST(Test01, TimeRelation) { - std::string indentString( INDENT ); - TimeRelationEnum value1 = TimeRelationEnum::hyphen; - TimeRelationEnum value2 = TimeRelationEnum::parentheses; - TimeRelation object1; - TimeRelation object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(equals)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(parentheses)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TimeRelationEnum value1 = TimeRelationEnum::hyphen; + TimeRelationEnum value2 = TimeRelationEnum::parentheses; + TimeRelation object1; + TimeRelation object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(equals)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(parentheses)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TimeTest.cpp b/Sourcecode/private/mxtest/core/TimeTest.cpp index ea2bcb37f..6b5dd96e5 100644 --- a/Sourcecode/private/mxtest/core/TimeTest.cpp +++ b/Sourcecode/private/mxtest/core/TimeTest.cpp @@ -6,62 +6,63 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Time ) +TEST(Test01, Time) { - Time object; - stringstream expected; - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + Time object; + stringstream expected; + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Time ) + +TEST(Test02, Time) { - Time object; + Time object; object.getAttributes()->hasNumber = true; - object.getAttributes()->number = StaffNumber{ 9 }; - object.getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - + object.getAttributes()->number = StaffNumber{9}; + object.getTimeChoice()->setChoice(TimeChoice::Choice::timeSignature); + auto timeSignature = makeTimeSignatureGroup(); - timeSignature->getBeats()->setValue( XsString( "Test1" ) ); - timeSignature->getBeatType()->setValue( XsString( "Test2" ) ); - timeSignature->setHasInterchangeable( true ); - timeSignature->getInterchangeable()->getBeats()->setValue( XsString( "Bishop" ) ); - timeSignature->getInterchangeable()->getBeatType()->setValue( XsString( "Bones" ) ); - timeSignature->getInterchangeable()->setHasTimeRelation( true ); - timeSignature->getInterchangeable()->getTimeRelation()->setValue( TimeRelationEnum::bracket ); - object.getTimeChoice()->addTimeSignatureGroup( timeSignature ); - object.getTimeChoice()->removeTimeSignatureGroup( object.getTimeChoice()->getTimeSignatureGroupSet().cbegin() ); + timeSignature->getBeats()->setValue(XsString("Test1")); + timeSignature->getBeatType()->setValue(XsString("Test2")); + timeSignature->setHasInterchangeable(true); + timeSignature->getInterchangeable()->getBeats()->setValue(XsString("Bishop")); + timeSignature->getInterchangeable()->getBeatType()->setValue(XsString("Bones")); + timeSignature->getInterchangeable()->setHasTimeRelation(true); + timeSignature->getInterchangeable()->getTimeRelation()->setValue(TimeRelationEnum::bracket); + object.getTimeChoice()->addTimeSignatureGroup(timeSignature); + object.getTimeChoice()->removeTimeSignatureGroup(object.getTimeChoice()->getTimeSignatureGroupSet().cbegin()); - stringstream expected; - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + stringstream expected; + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/TimewiseMeasureTest.cpp b/Sourcecode/private/mxtest/core/TimewiseMeasureTest.cpp index ee77f217b..2cc8da187 100644 --- a/Sourcecode/private/mxtest/core/TimewiseMeasureTest.cpp +++ b/Sourcecode/private/mxtest/core/TimewiseMeasureTest.cpp @@ -14,118 +14,114 @@ using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, TimewiseMeasure ) +TEST(Test01, TimewiseMeasure) { TestMode v = TestMode::one; - TimewiseMeasurePtr object = tgenTimewiseMeasure( v ); - stringstream expected; - tgenTimewiseMeasureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + TimewiseMeasurePtr object = tgenTimewiseMeasure(v); + stringstream expected; + tgenTimewiseMeasureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test02, TimewiseMeasure ) + +TEST(Test02, TimewiseMeasure) { TestMode v = TestMode::two; - TimewiseMeasurePtr object = tgenTimewiseMeasure( v ); - stringstream expected; - tgenTimewiseMeasureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + TimewiseMeasurePtr object = tgenTimewiseMeasure(v); + stringstream expected; + tgenTimewiseMeasureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, TimewiseMeasure ) + +TEST(Test03, TimewiseMeasure) { TestMode v = TestMode::three; - TimewiseMeasurePtr object = tgenTimewiseMeasure( v ); - stringstream expected; - tgenTimewiseMeasureExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + TimewiseMeasurePtr object = tgenTimewiseMeasure(v); + stringstream expected; + tgenTimewiseMeasureExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - TimewiseMeasurePtr tgenTimewiseMeasure( TestMode v ) +TimewiseMeasurePtr tgenTimewiseMeasure(TestMode v) +{ + TimewiseMeasurePtr o = makeTimewiseMeasure(); + switch (v) { - TimewiseMeasurePtr o = makeTimewiseMeasure(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->number = XsToken( "215" ); - o->addTimewisePart( tgenTimewisePart( v ) ); - o->removeTimewisePart( o->getTimewisePartSet().cbegin() ); - o->addTimewisePart( tgenTimewisePart( TestMode::three ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->number = XsToken( "105" ); - o->getAttributes()->hasImplicit = true; - o->getAttributes()->implicit = YesNo::no; - o->addTimewisePart( tgenTimewisePart( v ) ); - o->removeTimewisePart( o->getTimewisePartSet().cbegin() ); - o->addTimewisePart( tgenTimewisePart( TestMode::two ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->number = XsToken("215"); + o->addTimewisePart(tgenTimewisePart(v)); + o->removeTimewisePart(o->getTimewisePartSet().cbegin()); + o->addTimewisePart(tgenTimewisePart(TestMode::three)); } - void tgenTimewiseMeasureExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->getAttributes()->number = XsToken("105"); + o->getAttributes()->hasImplicit = true; + o->getAttributes()->implicit = YesNo::no; + o->addTimewisePart(tgenTimewisePart(v)); + o->removeTimewisePart(o->getTimewisePartSet().cbegin()); + o->addTimewisePart(tgenTimewisePart(TestMode::two)); + } + break; + default: + break; + } + return o; +} + +void tgenTimewiseMeasureExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()" ); - tgenTimewisePartExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenTimewisePartExpected( os, i+1, v ); - os << std::endl; - tgenTimewisePartExpected(os, i+1, TestMode::three ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenTimewisePartExpected( os, i+1, v ); - os << std::endl; - tgenTimewisePartExpected(os, i+1, TestMode::two ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()"); + tgenTimewisePartExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenTimewisePartExpected(os, i + 1, v); + os << std::endl; + tgenTimewisePartExpected(os, i + 1, TestMode::three); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenTimewisePartExpected(os, i + 1, v); + os << std::endl; + tgenTimewisePartExpected(os, i + 1, TestMode::two); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TimewiseMeasureTest.h b/Sourcecode/private/mxtest/core/TimewiseMeasureTest.h index 3e09d5c37..91e137597 100644 --- a/Sourcecode/private/mxtest/core/TimewiseMeasureTest.h +++ b/Sourcecode/private/mxtest/core/TimewiseMeasureTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::TimewiseMeasurePtr tgenTimewiseMeasure( TestMode v ); - void tgenTimewiseMeasureExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::TimewiseMeasurePtr tgenTimewiseMeasure(TestMode v); +void tgenTimewiseMeasureExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TimewisePartTest.cpp b/Sourcecode/private/mxtest/core/TimewisePartTest.cpp index deb41f2f1..09a84d4f7 100644 --- a/Sourcecode/private/mxtest/core/TimewisePartTest.cpp +++ b/Sourcecode/private/mxtest/core/TimewisePartTest.cpp @@ -7,112 +7,108 @@ #include "cpul/cpulTestHarness.h" #include "mxtest/core/HelperFunctions.h" -#include "mxtest/core/TimewisePartTest.h" #include "mxtest/core/MusicDataGroupTest.h" +#include "mxtest/core/TimewisePartTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, TimewisePart ) +TEST(Test01, TimewisePart) { TestMode v = TestMode::one; - TimewisePartPtr object = tgenTimewisePart( v ); - stringstream expected; - tgenTimewisePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + TimewisePartPtr object = tgenTimewisePart(v); + stringstream expected; + tgenTimewisePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, TimewisePart ) + +TEST(Test02, TimewisePart) { TestMode v = TestMode::two; - TimewisePartPtr object = tgenTimewisePart( v ); - stringstream expected; - tgenTimewisePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + TimewisePartPtr object = tgenTimewisePart(v); + stringstream expected; + tgenTimewisePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, TimewisePart ) + +TEST(Test03, TimewisePart) { TestMode v = TestMode::three; - TimewisePartPtr object = tgenTimewisePart( v ); - stringstream expected; - tgenTimewisePartExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + TimewisePartPtr object = tgenTimewisePart(v); + stringstream expected; + tgenTimewisePartExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - TimewisePartPtr tgenTimewisePart( TestMode v ) +TimewisePartPtr tgenTimewisePart(TestMode v) +{ + TimewisePartPtr o = makeTimewisePart(); + switch (v) { - TimewisePartPtr o = makeTimewisePart(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->id = XsID( "IDTWO" ); - o->setMusicDataGroup( tgenMusicDataGroup( v ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->id = XsID( "ID300" ); - o->setMusicDataGroup( tgenMusicDataGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->id = XsID("IDTWO"); + o->setMusicDataGroup(tgenMusicDataGroup(v)); + } + break; + case TestMode::three: { + o->getAttributes()->id = XsID("ID300"); + o->setMusicDataGroup(tgenMusicDataGroup(v)); + } + break; + default: + break; } - void tgenTimewisePartExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenTimewisePartExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenMusicDataGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenMusicDataGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenMusicDataGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenMusicDataGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TimewisePartTest.h b/Sourcecode/private/mxtest/core/TimewisePartTest.h index c773be2f2..3794036df 100644 --- a/Sourcecode/private/mxtest/core/TimewisePartTest.h +++ b/Sourcecode/private/mxtest/core/TimewisePartTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::TimewisePartPtr tgenTimewisePart( TestMode v ); - void tgenTimewisePartExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::TimewisePartPtr tgenTimewisePart(TestMode v); +void tgenTimewisePartExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TimpaniTest.cpp b/Sourcecode/private/mxtest/core/TimpaniTest.cpp index 4f65828bb..572616ea8 100644 --- a/Sourcecode/private/mxtest/core/TimpaniTest.cpp +++ b/Sourcecode/private/mxtest/core/TimpaniTest.cpp @@ -11,27 +11,27 @@ using namespace mx::core; -TEST( Test01, Timpani ) +TEST(Test01, Timpani) { - std::string indentString( INDENT ); - Timpani object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + Timpani object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/ToeTest.cpp b/Sourcecode/private/mxtest/core/ToeTest.cpp index c17e5abdb..4dbfa6650 100644 --- a/Sourcecode/private/mxtest/core/ToeTest.cpp +++ b/Sourcecode/private/mxtest/core/ToeTest.cpp @@ -6,112 +6,108 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/ToeTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/ToeTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Toe ) +TEST(Test01, Toe) { TestMode v = TestMode::one; - ToePtr object = tgenToe( v ); - stringstream expected; - tgenToeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + ToePtr object = tgenToe(v); + stringstream expected; + tgenToeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Toe ) + +TEST(Test02, Toe) { TestMode v = TestMode::two; - ToePtr object = tgenToe( v ); - stringstream expected; - tgenToeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + ToePtr object = tgenToe(v); + stringstream expected; + tgenToeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test03, Toe ) + +TEST(Test03, Toe) { TestMode v = TestMode::three; - ToePtr object = tgenToe( v ); - stringstream expected; - tgenToeExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + ToePtr object = tgenToe(v); + stringstream expected; + tgenToeExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } namespace mxtest { - ToePtr tgenToe( TestMode v ) +ToePtr tgenToe(TestMode v) +{ + ToePtr o = makeToe(); + switch (v) { - ToePtr o = makeToe(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->hasSubstitution = true; - o->getAttributes()->substitution = YesNo::yes; - o->getAttributes()->hasFontStyle = true; - o->getAttributes()->fontStyle = FontStyle::italic; - o->getAttributes()->hasColor = true; - o->getAttributes()->color = Color( 83, 102, 30, 22 ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasFontFamily = true; - o->getAttributes()->fontFamily = CommaSeparatedText( "Bish,and,Bones" ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->hasSubstitution = true; + o->getAttributes()->substitution = YesNo::yes; + o->getAttributes()->hasFontStyle = true; + o->getAttributes()->fontStyle = FontStyle::italic; + o->getAttributes()->hasColor = true; + o->getAttributes()->color = Color(83, 102, 30, 22); + } + break; + case TestMode::three: { + o->getAttributes()->hasFontFamily = true; + o->getAttributes()->fontFamily = CommaSeparatedText("Bish,and,Bones"); } - void tgenToeExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenToeExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/ToeTest.h b/Sourcecode/private/mxtest/core/ToeTest.h index 85cec7755..b849650bb 100644 --- a/Sourcecode/private/mxtest/core/ToeTest.h +++ b/Sourcecode/private/mxtest/core/ToeTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::ToePtr tgenToe( TestMode v ); - void tgenToeExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::ToePtr tgenToe(TestMode v); +void tgenToeExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TopMarginTest.cpp b/Sourcecode/private/mxtest/core/TopMarginTest.cpp index 0f69f862c..b97ad2302 100644 --- a/Sourcecode/private/mxtest/core/TopMarginTest.cpp +++ b/Sourcecode/private/mxtest/core/TopMarginTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, TopMargin ) +TEST(Test01, TopMargin) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - TopMargin object1; - TopMargin object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + TopMargin object1; + TopMargin object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TopSystemDistanceTest.cpp b/Sourcecode/private/mxtest/core/TopSystemDistanceTest.cpp index e4e5f13f4..08e9ed3bf 100644 --- a/Sourcecode/private/mxtest/core/TopSystemDistanceTest.cpp +++ b/Sourcecode/private/mxtest/core/TopSystemDistanceTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, TopSystemDistance ) +TEST(Test01, TopSystemDistance) { - std::string indentString( INDENT ); - TenthsValue value1{ 1.23 }; - TenthsValue value2{ 4.56 }; - TopSystemDistance object1; - TopSystemDistance object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(4.56)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + TenthsValue value1{1.23}; + TenthsValue value2{4.56}; + TopSystemDistance object1; + TopSystemDistance object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(4.56)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TouchingPitchTest.cpp b/Sourcecode/private/mxtest/core/TouchingPitchTest.cpp index 35ae15b02..6cb8289a4 100644 --- a/Sourcecode/private/mxtest/core/TouchingPitchTest.cpp +++ b/Sourcecode/private/mxtest/core/TouchingPitchTest.cpp @@ -13,33 +13,34 @@ using namespace mx::core; /* 4727 - - The touching-pitch is the pitch at which the string is touched lightly to produce the harmonic. - + + The touching-pitch is the pitch at which the string is touched lightly to produce the +harmonic. + */ -TEST( Test01, TouchingPitch ) +TEST(Test01, TouchingPitch) { - std::string indentString( INDENT ); - TouchingPitch object1; - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream indented_stream; - object1.toStream( indented_stream, 2 ); - std::string expected = ""; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+expected; - actual = indented_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; - bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), "" ) - CHECK( ! object1.hasAttributes() ) - CHECK( ! object1.hasContents() ) + std::string indentString(INDENT); + TouchingPitch object1; + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream indented_stream; + object1.toStream(indented_stream, 2); + std::string expected = ""; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + expected; + actual = indented_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), "") + CHECK(!object1.hasAttributes()) + CHECK(!object1.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/TransposeTest.cpp b/Sourcecode/private/mxtest/core/TransposeTest.cpp index 6f3f26651..158e2d8d7 100644 --- a/Sourcecode/private/mxtest/core/TransposeTest.cpp +++ b/Sourcecode/private/mxtest/core/TransposeTest.cpp @@ -6,48 +6,49 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Transpose ) +TEST(Test01, Transpose) { - Transpose object; - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(0)" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object.hasAttributes() ) - CHECK( object.hasContents() ) + Transpose object; + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(0)"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object.hasAttributes()) + CHECK(object.hasContents()) } -TEST( Test02, Transpose ) + +TEST(Test02, Transpose) { - Transpose object; + Transpose object; object.getAttributes()->hasNumber = true; - object.getAttributes()->number = StaffNumber{ 2 }; - object.setHasDiatonic( true ); - object.getDiatonic()->setValue( Integer( 3 ) ); - object.getChromatic()->setValue( Semitones( 4 ) ); - object.setHasDouble( true ); - stringstream expected; - streamLine( expected, 1, R"()" ); - streamLine( expected, 2, R"(3)" ); - streamLine( expected, 2, R"(4)" ); - streamLine( expected, 2, R"()" ); - streamLine( expected, 1, R"()", false ); - stringstream actual; - // object.toStream( std::cout, 1 ); - object.toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object.hasAttributes() ) - CHECK( object.hasContents() ) + object.getAttributes()->number = StaffNumber{2}; + object.setHasDiatonic(true); + object.getDiatonic()->setValue(Integer(3)); + object.getChromatic()->setValue(Semitones(4)); + object.setHasDouble(true); + stringstream expected; + streamLine(expected, 1, R"()"); + streamLine(expected, 2, R"(3)"); + streamLine(expected, 2, R"(4)"); + streamLine(expected, 2, R"()"); + streamLine(expected, 1, R"()", false); + stringstream actual; + // object.toStream( std::cout, 1 ); + object.toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object.hasAttributes()) + CHECK(object.hasContents()) } #endif diff --git a/Sourcecode/private/mxtest/core/TremoloTest.cpp b/Sourcecode/private/mxtest/core/TremoloTest.cpp index 09208a8f9..ea38683cb 100644 --- a/Sourcecode/private/mxtest/core/TremoloTest.cpp +++ b/Sourcecode/private/mxtest/core/TremoloTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Tremolo ) +TEST(Test01, Tremolo) { - std::string indentString( INDENT ); - TremoloMarks value1{ 2 }; - TremoloMarks value2{ 3 }; - Tremolo object1; - Tremolo object2( value2 ); - TremoloAttributesPtr attributes1 = std::make_shared(); - TremoloAttributesPtr attributesNull; - /* set some attribute1 values here */ - //object2.setAttributes( attributes1 ); - object2.getAttributes()->hasPlacement = true; + std::string indentString(INDENT); + TremoloMarks value1{2}; + TremoloMarks value2{3}; + Tremolo object1; + Tremolo object2(value2); + TremoloAttributesPtr attributes1 = std::make_shared(); + TremoloAttributesPtr attributesNull; + /* set some attribute1 values here */ + // object2.setAttributes( attributes1 ); + object2.getAttributes()->hasPlacement = true; object2.getAttributes()->placement = AboveBelow::below; std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(3)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(3)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(3)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(3)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TrillMarkTest.cpp b/Sourcecode/private/mxtest/core/TrillMarkTest.cpp index 20954d590..f0b752b60 100644 --- a/Sourcecode/private/mxtest/core/TrillMarkTest.cpp +++ b/Sourcecode/private/mxtest/core/TrillMarkTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, TrillMark ) +TEST(Test01, TrillMark) { - std::string indentString( INDENT ); - TrillMark object1; - TrillMark object2; - EmptyTrillSoundAttributesPtr attributes1 = std::make_shared(); - EmptyTrillSoundAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + TrillMark object1; + TrillMark object2; + EmptyTrillSoundAttributesPtr attributes1 = std::make_shared(); + EmptyTrillSoundAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/TripleTongueTest.cpp b/Sourcecode/private/mxtest/core/TripleTongueTest.cpp index 2126d1478..240cf5c1f 100644 --- a/Sourcecode/private/mxtest/core/TripleTongueTest.cpp +++ b/Sourcecode/private/mxtest/core/TripleTongueTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, TripleTongue ) +TEST(Test01, TripleTongue) { - std::string indentString( INDENT ); - TripleTongue object1; - TripleTongue object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + TripleTongue object1; + TripleTongue object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/TuningAlterTest.cpp b/Sourcecode/private/mxtest/core/TuningAlterTest.cpp index f89b06773..96a92c087 100644 --- a/Sourcecode/private/mxtest/core/TuningAlterTest.cpp +++ b/Sourcecode/private/mxtest/core/TuningAlterTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, TuningAlter ) +TEST(Test01, TuningAlter) { - std::string indentString( INDENT ); - Semitones value1{ -0.1 }; - Semitones value2{ 2.02 }; - TuningAlter object1; - TuningAlter object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2.02)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Semitones value1{-0.1}; + Semitones value2{2.02}; + TuningAlter object1; + TuningAlter object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2.02)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TuningOctaveTest.cpp b/Sourcecode/private/mxtest/core/TuningOctaveTest.cpp index 7134f4be2..815e5f97e 100644 --- a/Sourcecode/private/mxtest/core/TuningOctaveTest.cpp +++ b/Sourcecode/private/mxtest/core/TuningOctaveTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, TuningOctave ) +TEST(Test01, TuningOctave) { - std::string indentString( INDENT ); - OctaveValue value1{ 1 }; - OctaveValue value2{ 2 }; - TuningOctave object1; - TuningOctave object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(2)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + OctaveValue value1{1}; + OctaveValue value2{2}; + TuningOctave object1; + TuningOctave object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(2)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TuningStepTest.cpp b/Sourcecode/private/mxtest/core/TuningStepTest.cpp index ce5ba2ae4..a3c4bafa2 100644 --- a/Sourcecode/private/mxtest/core/TuningStepTest.cpp +++ b/Sourcecode/private/mxtest/core/TuningStepTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, TuningStep ) +TEST(Test01, TuningStep) { - std::string indentString( INDENT ); - StepEnum value1 = StepEnum::b; - StepEnum value2 = StepEnum::f; - TuningStep object1; - TuningStep object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(A)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(F)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + StepEnum value1 = StepEnum::b; + StepEnum value2 = StepEnum::f; + TuningStep object1; + TuningStep object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(A)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(F)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TupletActualTest.cpp b/Sourcecode/private/mxtest/core/TupletActualTest.cpp index e25f97df8..a635ab775 100644 --- a/Sourcecode/private/mxtest/core/TupletActualTest.cpp +++ b/Sourcecode/private/mxtest/core/TupletActualTest.cpp @@ -6,124 +6,120 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/TupletActualTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/TupletActualTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, TupletActual ) +TEST(Test01, TupletActual) { TestMode v = TestMode::one; - TupletActualPtr object = tgenTupletActual( v ); - stringstream expected; - tgenTupletActualExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + TupletActualPtr object = tgenTupletActual(v); + stringstream expected; + tgenTupletActualExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, TupletActual ) + +TEST(Test02, TupletActual) { TestMode v = TestMode::two; - TupletActualPtr object = tgenTupletActual( v ); - stringstream expected; - tgenTupletActualExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TupletActualPtr object = tgenTupletActual(v); + stringstream expected; + tgenTupletActualExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, TupletActual ) + +TEST(Test03, TupletActual) { TestMode v = TestMode::three; - TupletActualPtr object = tgenTupletActual( v ); - stringstream expected; - tgenTupletActualExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TupletActualPtr object = tgenTupletActual(v); + stringstream expected; + tgenTupletActualExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - TupletActualPtr tgenTupletActual( TestMode v ) +TupletActualPtr tgenTupletActual(TestMode v) +{ + TupletActualPtr o = makeTupletActual(); + switch (v) { - TupletActualPtr o = makeTupletActual(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasTupletNumber( true ); - o->getTupletNumber()->setValue( NonNegativeInteger( 2 ) ); - o->setHasTupletType( true ); - o->getTupletType()->setValue( NoteTypeValue::sixteenth ); - o->addTupletDot( makeTupletDot() ); - } - break; - case TestMode::three: - { - o->setHasTupletNumber( true ); - o->getTupletNumber()->setValue( NonNegativeInteger( 3 ) ); - o->setHasTupletType( true ); - o->getTupletType()->setValue( NoteTypeValue::half ); - o->addTupletDot( makeTupletDot() ); - o->addTupletDot( makeTupletDot() ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasTupletNumber(true); + o->getTupletNumber()->setValue(NonNegativeInteger(2)); + o->setHasTupletType(true); + o->getTupletType()->setValue(NoteTypeValue::sixteenth); + o->addTupletDot(makeTupletDot()); + } + break; + case TestMode::three: { + o->setHasTupletNumber(true); + o->getTupletNumber()->setValue(NonNegativeInteger(3)); + o->setHasTupletType(true); + o->getTupletType()->setValue(NoteTypeValue::half); + o->addTupletDot(makeTupletDot()); + o->addTupletDot(makeTupletDot()); } - void tgenTupletActualExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenTupletActualExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(2)" ); - streamLine( os, i+1, R"(16th)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i+1, R"(half)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(2)"); + streamLine(os, i + 1, R"(16th)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i + 1, R"(half)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TupletActualTest.h b/Sourcecode/private/mxtest/core/TupletActualTest.h index 7b87c65d9..87cd031ec 100644 --- a/Sourcecode/private/mxtest/core/TupletActualTest.h +++ b/Sourcecode/private/mxtest/core/TupletActualTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::TupletActualPtr tgenTupletActual( TestMode v ); - void tgenTupletActualExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::TupletActualPtr tgenTupletActual(TestMode v); +void tgenTupletActualExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TupletDotTest.cpp b/Sourcecode/private/mxtest/core/TupletDotTest.cpp index 7b472be7d..14ce0409c 100644 --- a/Sourcecode/private/mxtest/core/TupletDotTest.cpp +++ b/Sourcecode/private/mxtest/core/TupletDotTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, TupletDot ) +TEST(Test01, TupletDot) { - std::string indentString( INDENT ); - TupletDot object1; - TupletDot object2; - TupletDotAttributesPtr attributes1 = std::make_shared(); - TupletDotAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + TupletDot object1; + TupletDot object2; + TupletDotAttributesPtr attributes1 = std::make_shared(); + TupletDotAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontSize = true; - attributes1->fontSize = FontSize{ Decimal{ 12 } }; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->fontSize = FontSize{Decimal{12}}; + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/TupletNormalTest.cpp b/Sourcecode/private/mxtest/core/TupletNormalTest.cpp index 0016c325d..7fc372199 100644 --- a/Sourcecode/private/mxtest/core/TupletNormalTest.cpp +++ b/Sourcecode/private/mxtest/core/TupletNormalTest.cpp @@ -6,120 +6,116 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/TupletNormalTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/TupletNormalTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, TupletNormal ) +TEST(Test01, TupletNormal) { TestMode v = TestMode::one; - TupletNormalPtr object = tgenTupletNormal( v ); - stringstream expected; - tgenTupletNormalExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + TupletNormalPtr object = tgenTupletNormal(v); + stringstream expected; + tgenTupletNormalExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, TupletNormal ) + +TEST(Test02, TupletNormal) { TestMode v = TestMode::two; - TupletNormalPtr object = tgenTupletNormal( v ); - stringstream expected; - tgenTupletNormalExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TupletNormalPtr object = tgenTupletNormal(v); + stringstream expected; + tgenTupletNormalExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, TupletNormal ) + +TEST(Test03, TupletNormal) { TestMode v = TestMode::three; - TupletNormalPtr object = tgenTupletNormal( v ); - stringstream expected; - tgenTupletNormalExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + TupletNormalPtr object = tgenTupletNormal(v); + stringstream expected; + tgenTupletNormalExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - TupletNormalPtr tgenTupletNormal( TestMode v ) +TupletNormalPtr tgenTupletNormal(TestMode v) +{ + TupletNormalPtr o = makeTupletNormal(); + switch (v) { - TupletNormalPtr o = makeTupletNormal(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasTupletNumber( true ); - o->getTupletNumber()->setValue( NonNegativeInteger( 5 ) ); - o->setHasTupletType( true ); - o->getTupletType()->setValue( NoteTypeValue::eighth ); - } - break; - case TestMode::three: - { - o->setHasTupletNumber( true ); - o->getTupletNumber()->setValue( NonNegativeInteger( 3 ) ); - o->setHasTupletType( true ); - o->getTupletType()->setValue( NoteTypeValue::quarter ); - o->addTupletDot( makeTupletDot() ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasTupletNumber(true); + o->getTupletNumber()->setValue(NonNegativeInteger(5)); + o->setHasTupletType(true); + o->getTupletType()->setValue(NoteTypeValue::eighth); + } + break; + case TestMode::three: { + o->setHasTupletNumber(true); + o->getTupletNumber()->setValue(NonNegativeInteger(3)); + o->setHasTupletType(true); + o->getTupletType()->setValue(NoteTypeValue::quarter); + o->addTupletDot(makeTupletDot()); } - void tgenTupletNormalExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenTupletNormalExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(5)" ); - streamLine( os, i+1, R"(eighth)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(3)" ); - streamLine( os, i+1, R"(quarter)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(5)"); + streamLine(os, i + 1, R"(eighth)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(3)"); + streamLine(os, i + 1, R"(quarter)"); + streamLine(os, i + 1, R"()"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TupletNormalTest.h b/Sourcecode/private/mxtest/core/TupletNormalTest.h index 50eda4f30..7fdec1287 100644 --- a/Sourcecode/private/mxtest/core/TupletNormalTest.h +++ b/Sourcecode/private/mxtest/core/TupletNormalTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::TupletNormalPtr tgenTupletNormal( TestMode v ); - void tgenTupletNormalExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::TupletNormalPtr tgenTupletNormal(TestMode v); +void tgenTupletNormalExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TupletTest.cpp b/Sourcecode/private/mxtest/core/TupletTest.cpp index af998f572..b48ddd86a 100644 --- a/Sourcecode/private/mxtest/core/TupletTest.cpp +++ b/Sourcecode/private/mxtest/core/TupletTest.cpp @@ -6,127 +6,123 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/TupletTest.h" +#include "mxtest/core/HelperFunctions.h" +#include "mxtest/core/MidiInstrumentTest.h" #include "mxtest/core/TupletActualTest.h" #include "mxtest/core/TupletNormalTest.h" -#include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/TupletTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Tuplet ) +TEST(Test01, Tuplet) { TestMode v = TestMode::one; - TupletPtr object = tgenTuplet( v ); - stringstream expected; - tgenTupletExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( ! object->hasContents() ) + TupletPtr object = tgenTuplet(v); + stringstream expected; + tgenTupletExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Tuplet ) + +TEST(Test02, Tuplet) { TestMode v = TestMode::two; - TupletPtr object = tgenTuplet( v ); - stringstream expected; - tgenTupletExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + TupletPtr object = tgenTuplet(v); + stringstream expected; + tgenTupletExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Tuplet ) + +TEST(Test03, Tuplet) { TestMode v = TestMode::three; - TupletPtr object = tgenTuplet( v ); - stringstream expected; - tgenTupletExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( object->hasAttributes() ) - CHECK( object->hasContents() ) + TupletPtr object = tgenTuplet(v); + stringstream expected; + tgenTupletExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - TupletPtr tgenTuplet( TestMode v ) +TupletPtr tgenTuplet(TestMode v) +{ + TupletPtr o = makeTuplet(); + switch (v) { - TupletPtr o = makeTuplet(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->getAttributes()->type = StartStop::stop; - o->setHasTupletActual( true ); - o->setTupletActual( tgenTupletActual( v ) ); - o->setHasTupletNormal( true ); - o->setTupletNormal( tgenTupletNormal( v ) ); - } - break; - case TestMode::three: - { - o->getAttributes()->hasBracket = true; - o->getAttributes()->bracket = YesNo::yes; - o->getAttributes()->hasLineShape = true; - o->getAttributes()->lineShape = LineShape::curved; - o->setHasTupletActual( false ); - o->setTupletActual( tgenTupletActual( v ) ); - o->setHasTupletNormal( true ); - o->setTupletNormal( tgenTupletNormal( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->getAttributes()->type = StartStop::stop; + o->setHasTupletActual(true); + o->setTupletActual(tgenTupletActual(v)); + o->setHasTupletNormal(true); + o->setTupletNormal(tgenTupletNormal(v)); } - void tgenTupletExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->getAttributes()->hasBracket = true; + o->getAttributes()->bracket = YesNo::yes; + o->getAttributes()->hasLineShape = true; + o->getAttributes()->lineShape = LineShape::curved; + o->setHasTupletActual(false); + o->setTupletActual(tgenTupletActual(v)); + o->setHasTupletNormal(true); + o->setTupletNormal(tgenTupletNormal(v)); + } + break; + default: + break; + } + return o; +} + +void tgenTupletExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenTupletActualExpected( os, i+1, v ); - os << std::endl; - tgenTupletNormalExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenTupletNormalExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenTupletActualExpected(os, i + 1, v); + os << std::endl; + tgenTupletNormalExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenTupletNormalExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TupletTest.h b/Sourcecode/private/mxtest/core/TupletTest.h index be43f2842..d4aa91971 100644 --- a/Sourcecode/private/mxtest/core/TupletTest.h +++ b/Sourcecode/private/mxtest/core/TupletTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::TupletPtr tgenTuplet( TestMode v ); - void tgenTupletExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::TupletPtr tgenTuplet(TestMode v); +void tgenTupletExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/TupletTypeTest.cpp b/Sourcecode/private/mxtest/core/TupletTypeTest.cpp index 3c33a2056..491edabda 100644 --- a/Sourcecode/private/mxtest/core/TupletTypeTest.cpp +++ b/Sourcecode/private/mxtest/core/TupletTypeTest.cpp @@ -11,37 +11,40 @@ using namespace mx::core; -TEST( Test01, TupletType ) +TEST(Test01, TupletType) { - std::string indentString( INDENT ); - NoteTypeValue value1 = NoteTypeValue::quarter; - NoteTypeValue value2 = NoteTypeValue::sixtyFourth; - TupletType object1; - TupletType object2( value2 ); - TupletTypeAttributesPtr attributes1 = std::make_shared(); - TupletTypeAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + NoteTypeValue value1 = NoteTypeValue::quarter; + NoteTypeValue value2 = NoteTypeValue::sixtyFourth; + TupletType object1; + TupletType object2(value2); + TupletTypeAttributesPtr attributes1 = std::make_shared(); + TupletTypeAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontSize = true; attributes1->hasFontWeight = true; attributes1->hasFontStyle = true; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(eighth)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(64th)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(eighth)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + + R"(64th)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/TurnTest.cpp b/Sourcecode/private/mxtest/core/TurnTest.cpp index a4f847a17..0459793ac 100644 --- a/Sourcecode/private/mxtest/core/TurnTest.cpp +++ b/Sourcecode/private/mxtest/core/TurnTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Turn ) +TEST(Test01, Turn) { - std::string indentString( INDENT ); - Turn object1; - Turn object2; - TurnAttributesPtr attributes1 = std::make_shared(); - TurnAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Turn object1; + Turn object2; + TurnAttributesPtr attributes1 = std::make_shared(); + TurnAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->defaultX = TenthsValue{0.1}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/TypeTest.cpp b/Sourcecode/private/mxtest/core/TypeTest.cpp index f7e67e6fc..c9350dcda 100644 --- a/Sourcecode/private/mxtest/core/TypeTest.cpp +++ b/Sourcecode/private/mxtest/core/TypeTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, Type ) +TEST(Test01, Type) { - std::string indentString( INDENT ); - NoteTypeValue value1 = NoteTypeValue::fiveHundredTwelfth; - NoteTypeValue value2 = NoteTypeValue::long_; - Type object1; - Type object2( value2 ); - TypeAttributesPtr attributes1 = std::make_shared(); - TypeAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + NoteTypeValue value1 = NoteTypeValue::fiveHundredTwelfth; + NoteTypeValue value2 = NoteTypeValue::long_; + Type object1; + Type object2(value2); + TypeAttributesPtr attributes1 = std::make_shared(); + TypeAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasSize = true; attributes1->size = SymbolSize::large; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(quarter)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(long)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(quarter)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(long)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/UnpitchedTest.cpp b/Sourcecode/private/mxtest/core/UnpitchedTest.cpp index c86ab0877..a76874c20 100644 --- a/Sourcecode/private/mxtest/core/UnpitchedTest.cpp +++ b/Sourcecode/private/mxtest/core/UnpitchedTest.cpp @@ -6,113 +6,109 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" +#include "mxtest/core/DisplayStepOctaveGroupTest.h" #include "mxtest/core/HelperFunctions.h" #include "mxtest/core/UnpitchedTest.h" -#include "mxtest/core/DisplayStepOctaveGroupTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Unpitched ) +TEST(Test01, Unpitched) { TestMode v = TestMode::one; - UnpitchedPtr object = tgenUnpitched( v ); - stringstream expected; - tgenUnpitchedExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + UnpitchedPtr object = tgenUnpitched(v); + stringstream expected; + tgenUnpitchedExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Unpitched ) + +TEST(Test02, Unpitched) { TestMode v = TestMode::two; - UnpitchedPtr object = tgenUnpitched( v ); - stringstream expected; - tgenUnpitchedExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + UnpitchedPtr object = tgenUnpitched(v); + stringstream expected; + tgenUnpitchedExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Unpitched ) + +TEST(Test03, Unpitched) { TestMode v = TestMode::three; - UnpitchedPtr object = tgenUnpitched( v ); - stringstream expected; - tgenUnpitchedExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + UnpitchedPtr object = tgenUnpitched(v); + stringstream expected; + tgenUnpitchedExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - UnpitchedPtr tgenUnpitched( TestMode v ) +UnpitchedPtr tgenUnpitched(TestMode v) +{ + UnpitchedPtr o = makeUnpitched(); + switch (v) { - UnpitchedPtr o = makeUnpitched(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasDisplayStepOctaveGroup( true ); - o->setDisplayStepOctaveGroup( tgenDisplayStepOctaveGroup( v ) ); - } - break; - case TestMode::three: - { - o->setHasDisplayStepOctaveGroup( true ); - o->setDisplayStepOctaveGroup( tgenDisplayStepOctaveGroup( v ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasDisplayStepOctaveGroup(true); + o->setDisplayStepOctaveGroup(tgenDisplayStepOctaveGroup(v)); + } + break; + case TestMode::three: { + o->setHasDisplayStepOctaveGroup(true); + o->setDisplayStepOctaveGroup(tgenDisplayStepOctaveGroup(v)); + } + break; + default: + break; } - void tgenUnpitchedExpected(std::ostream& os, int i, TestMode v ) + return o; +} + +void tgenUnpitchedExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - tgenDisplayStepOctaveGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - tgenDisplayStepOctaveGroupExpected( os, i+1, v ); - os << std::endl; - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + tgenDisplayStepOctaveGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + tgenDisplayStepOctaveGroupExpected(os, i + 1, v); + os << std::endl; + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/UnpitchedTest.h b/Sourcecode/private/mxtest/core/UnpitchedTest.h index 9e82bf6ab..bb19b4268 100644 --- a/Sourcecode/private/mxtest/core/UnpitchedTest.h +++ b/Sourcecode/private/mxtest/core/UnpitchedTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::UnpitchedPtr tgenUnpitched( TestMode v ); - void tgenUnpitchedExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::UnpitchedPtr tgenUnpitched(TestMode v); +void tgenUnpitchedExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/UnstressTest.cpp b/Sourcecode/private/mxtest/core/UnstressTest.cpp index a2c60c2b8..89b353695 100644 --- a/Sourcecode/private/mxtest/core/UnstressTest.cpp +++ b/Sourcecode/private/mxtest/core/UnstressTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, Unstress ) +TEST(Test01, Unstress) { - std::string indentString( INDENT ); - Unstress object1; - Unstress object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Unstress object1; + Unstress object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/UpBowTest.cpp b/Sourcecode/private/mxtest/core/UpBowTest.cpp index 1a547058c..10a2410fa 100644 --- a/Sourcecode/private/mxtest/core/UpBowTest.cpp +++ b/Sourcecode/private/mxtest/core/UpBowTest.cpp @@ -11,41 +11,43 @@ using namespace mx::core; -TEST( Test01, UpBow ) +TEST(Test01, UpBow) { - std::string indentString( INDENT ); - UpBow object1; - UpBow object2; - EmptyPlacementAttributesPtr attributes1 = std::make_shared(); - EmptyPlacementAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + UpBow object1; + UpBow object2; + EmptyPlacementAttributesPtr attributes1 = std::make_shared(); + EmptyPlacementAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/VerticalTurnTest.cpp b/Sourcecode/private/mxtest/core/VerticalTurnTest.cpp index da5654e1b..f5da61cf0 100644 --- a/Sourcecode/private/mxtest/core/VerticalTurnTest.cpp +++ b/Sourcecode/private/mxtest/core/VerticalTurnTest.cpp @@ -11,41 +11,44 @@ using namespace mx::core; -TEST( Test01, VerticalTurn ) +TEST(Test01, VerticalTurn) { - std::string indentString( INDENT ); - VerticalTurn object1; - VerticalTurn object2; - EmptyTrillSoundAttributesPtr attributes1 = std::make_shared(); - EmptyTrillSoundAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + VerticalTurn object1; + VerticalTurn object2; + EmptyTrillSoundAttributesPtr attributes1 = std::make_shared(); + EmptyTrillSoundAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = + indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/VirtualInstrumentTest.cpp b/Sourcecode/private/mxtest/core/VirtualInstrumentTest.cpp index 2cc4be6d8..b6b7de6f6 100644 --- a/Sourcecode/private/mxtest/core/VirtualInstrumentTest.cpp +++ b/Sourcecode/private/mxtest/core/VirtualInstrumentTest.cpp @@ -6,115 +6,111 @@ #ifdef MX_COMPILE_CORE_TESTS #include "cpul/cpulTestHarness.h" -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" -#include "mxtest/core/VirtualInstrumentTest.h" +#include "mxtest/core/HelperFunctions.h" #include "mxtest/core/MidiInstrumentTest.h" +#include "mxtest/core/VirtualInstrumentTest.h" using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, VirtualInstrument ) +TEST(Test01, VirtualInstrument) { TestMode v = TestMode::one; - VirtualInstrumentPtr object = tgenVirtualInstrument( v ); - stringstream expected; - tgenVirtualInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + VirtualInstrumentPtr object = tgenVirtualInstrument(v); + stringstream expected; + tgenVirtualInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, VirtualInstrument ) + +TEST(Test02, VirtualInstrument) { TestMode v = TestMode::two; - VirtualInstrumentPtr object = tgenVirtualInstrument( v ); - stringstream expected; - tgenVirtualInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + VirtualInstrumentPtr object = tgenVirtualInstrument(v); + stringstream expected; + tgenVirtualInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, VirtualInstrument ) + +TEST(Test03, VirtualInstrument) { TestMode v = TestMode::three; - VirtualInstrumentPtr object = tgenVirtualInstrument( v ); - stringstream expected; - tgenVirtualInstrumentExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + VirtualInstrumentPtr object = tgenVirtualInstrument(v); + stringstream expected; + tgenVirtualInstrumentExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - VirtualInstrumentPtr tgenVirtualInstrument( TestMode v ) +VirtualInstrumentPtr tgenVirtualInstrument(TestMode v) +{ + VirtualInstrumentPtr o = makeVirtualInstrument(); + switch (v) { - VirtualInstrumentPtr o = makeVirtualInstrument(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasVirtualName( true ); - o->getVirtualName()->setValue( XsString( "VI1" ) ); - } - break; - case TestMode::three: - { - o->setHasVirtualName( true ); - o->getVirtualName()->setValue( XsString( "VI2" ) ); - o->setHasVirtualLibrary( true ); - o->getVirtualLibrary()->setValue( XsString( "VL2" ) ); - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasVirtualName(true); + o->getVirtualName()->setValue(XsString("VI1")); + } + break; + case TestMode::three: { + o->setHasVirtualName(true); + o->getVirtualName()->setValue(XsString("VI2")); + o->setHasVirtualLibrary(true); + o->getVirtualLibrary()->setValue(XsString("VL2")); } - void tgenVirtualInstrumentExpected(std::ostream& os, int i, TestMode v ) + break; + default: + break; + } + return o; +} + +void tgenVirtualInstrumentExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(VI1)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(VL2)" ); - streamLine( os, i+1, R"(VI2)" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(VI1)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(VL2)"); + streamLine(os, i + 1, R"(VI2)"); + streamLine(os, i, R"()", false); + } + break; + default: + break; } } +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/VirtualInstrumentTest.h b/Sourcecode/private/mxtest/core/VirtualInstrumentTest.h index 7852b6439..5759b9efd 100644 --- a/Sourcecode/private/mxtest/core/VirtualInstrumentTest.h +++ b/Sourcecode/private/mxtest/core/VirtualInstrumentTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::VirtualInstrumentPtr tgenVirtualInstrument( TestMode v ); - void tgenVirtualInstrumentExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::VirtualInstrumentPtr tgenVirtualInstrument(TestMode v); +void tgenVirtualInstrumentExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/VirtualLibraryTest.cpp b/Sourcecode/private/mxtest/core/VirtualLibraryTest.cpp index 2f42bb0f1..bdd67d54b 100644 --- a/Sourcecode/private/mxtest/core/VirtualLibraryTest.cpp +++ b/Sourcecode/private/mxtest/core/VirtualLibraryTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, VirtualLibrary ) +TEST(Test01, VirtualLibrary) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - VirtualLibrary object1; - VirtualLibrary object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + VirtualLibrary object1; + VirtualLibrary object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/VirtualNameTest.cpp b/Sourcecode/private/mxtest/core/VirtualNameTest.cpp index 649b1b664..5a3983bda 100644 --- a/Sourcecode/private/mxtest/core/VirtualNameTest.cpp +++ b/Sourcecode/private/mxtest/core/VirtualNameTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, VirtualName ) +TEST(Test01, VirtualName) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - VirtualName object1; - VirtualName object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + VirtualName object1; + VirtualName object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/VoiceTest.cpp b/Sourcecode/private/mxtest/core/VoiceTest.cpp index 04960956e..949481902 100644 --- a/Sourcecode/private/mxtest/core/VoiceTest.cpp +++ b/Sourcecode/private/mxtest/core/VoiceTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Voice ) +TEST(Test01, Voice) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - Voice object1; - Voice object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + Voice object1; + Voice object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/VolumeTest.cpp b/Sourcecode/private/mxtest/core/VolumeTest.cpp index ed2b70c3e..4abf3b63f 100644 --- a/Sourcecode/private/mxtest/core/VolumeTest.cpp +++ b/Sourcecode/private/mxtest/core/VolumeTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Volume ) +TEST(Test01, Volume) { - std::string indentString( INDENT ); - Percent value1{ 0.25 }; - Percent value2{ 0.93 }; - Volume object1; - Volume object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(0)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(0.93)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + Percent value1{0.25}; + Percent value2{0.93}; + Volume object1; + Volume object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(0)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(0.93)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/WavyLineTest.cpp b/Sourcecode/private/mxtest/core/WavyLineTest.cpp index 8888e3991..bb709aa61 100644 --- a/Sourcecode/private/mxtest/core/WavyLineTest.cpp +++ b/Sourcecode/private/mxtest/core/WavyLineTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, WavyLine ) +TEST(Test01, WavyLine) { - std::string indentString( INDENT ); - WavyLine object1; - WavyLine object2; - WavyLineAttributesPtr attributes1 = std::make_shared(); - WavyLineAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + WavyLine object1; + WavyLine object2; + WavyLineAttributesPtr attributes1 = std::make_shared(); + WavyLineAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; - - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + attributes1->number = NumberLevel{2}; + + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/WedgeTest.cpp b/Sourcecode/private/mxtest/core/WedgeTest.cpp index fd951f287..2b116288d 100644 --- a/Sourcecode/private/mxtest/core/WedgeTest.cpp +++ b/Sourcecode/private/mxtest/core/WedgeTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, Wedge ) +TEST(Test01, Wedge) { - std::string indentString( INDENT ); - Wedge object1; - Wedge object2; - WedgeAttributesPtr attributes1 = std::make_shared(); - WedgeAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + Wedge object1; + Wedge object2; + WedgeAttributesPtr attributes1 = std::make_shared(); + WedgeAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultX = true; - attributes1->defaultX = TenthsValue{ 0.1 }; + attributes1->defaultX = TenthsValue{0.1}; attributes1->hasNumber = true; - attributes1->number = NumberLevel{ 2 }; + attributes1->number = NumberLevel{2}; attributes1->type = WedgeType::continue_; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/WithBarTest.cpp b/Sourcecode/private/mxtest/core/WithBarTest.cpp index e821fa6a7..aae38a096 100644 --- a/Sourcecode/private/mxtest/core/WithBarTest.cpp +++ b/Sourcecode/private/mxtest/core/WithBarTest.cpp @@ -11,36 +11,38 @@ using namespace mx::core; -TEST( Test01, WithBar ) +TEST(Test01, WithBar) { - std::string indentString( INDENT ); - XsString value1{ "Lang" }; - XsString value2{ "Adams" }; - WithBar object1; - WithBar object2( value2 ); - WithBarAttributesPtr attributes1 = std::make_shared(); - WithBarAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Lang"}; + XsString value2{"Adams"}; + WithBar object1; + WithBar object2(value2); + WithBarAttributesPtr attributes1 = std::make_shared(); + WithBarAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasDefaultY = true; - attributes1->defaultY = TenthsValue{ 0.391 }; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Adams)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + attributes1->defaultY = TenthsValue{0.391}; + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Adams)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/WoodTest.cpp b/Sourcecode/private/mxtest/core/WoodTest.cpp index 94dded134..b6424f9f0 100644 --- a/Sourcecode/private/mxtest/core/WoodTest.cpp +++ b/Sourcecode/private/mxtest/core/WoodTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, Wood ) +TEST(Test01, Wood) { - std::string indentString( INDENT ); - WoodEnum value1 = WoodEnum::cabasa; - WoodEnum value2 = WoodEnum::logDrum; - Wood object1; - Wood object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"(claves)"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(log drum)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + WoodEnum value1 = WoodEnum::cabasa; + WoodEnum value2 = WoodEnum::logDrum; + Wood object1; + Wood object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"(claves)"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(log drum)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/WordFontTest.cpp b/Sourcecode/private/mxtest/core/WordFontTest.cpp index 16ff540cc..e7544dc17 100644 --- a/Sourcecode/private/mxtest/core/WordFontTest.cpp +++ b/Sourcecode/private/mxtest/core/WordFontTest.cpp @@ -11,39 +11,41 @@ using namespace mx::core; -TEST( Test01, WordFont ) +TEST(Test01, WordFont) { - std::string indentString( INDENT ); - WordFont object1; - WordFont object2; - EmptyFontAttributesPtr attributes1 = std::make_shared(); - EmptyFontAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + WordFont object1; + WordFont object2; + EmptyFontAttributesPtr attributes1 = std::make_shared(); + EmptyFontAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasFontStyle = true; attributes1->hasFontWeight = true; attributes1->fontStyle = FontStyle::italic; attributes1->fontWeight = FontWeight::bold; - object2.setAttributes( attributes1 ); - object2.setAttributes( attributesNull ); /* should have no affect */ - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"()"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) - CHECK( !object1.hasContents() ) - CHECK( !object1.hasAttributes() ) - CHECK( object2.hasAttributes() ) + object2.setAttributes(attributes1); + object2.setAttributes(attributesNull); /* should have no affect */ + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"()"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) + CHECK(!object1.hasContents()) + CHECK(!object1.hasAttributes()) + CHECK(object2.hasAttributes()) } #endif diff --git a/Sourcecode/private/mxtest/core/WordsTest.cpp b/Sourcecode/private/mxtest/core/WordsTest.cpp index ccd29394c..f371bb6b8 100644 --- a/Sourcecode/private/mxtest/core/WordsTest.cpp +++ b/Sourcecode/private/mxtest/core/WordsTest.cpp @@ -11,37 +11,39 @@ using namespace mx::core; -TEST( Test01, Words ) +TEST(Test01, Words) { - std::string indentString( INDENT ); - XsString value1{ "Handel" }; - XsString value2{ "Haydn" }; - Words object1; - Words object2( value2 ); - WordsAttributesPtr attributes1 = std::make_shared(); - WordsAttributesPtr attributesNull; - /* set some attribute1 values here */ + std::string indentString(INDENT); + XsString value1{"Handel"}; + XsString value2{"Haydn"}; + Words object1; + Words object2(value2); + WordsAttributesPtr attributes1 = std::make_shared(); + WordsAttributesPtr attributesNull; + /* set some attribute1 values here */ attributes1->hasLang = true; attributes1->hasHalign = true; attributes1->halign = LeftCenterRight::right; - object2.setAttributes( attributes1 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(Haydn)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + object2.setAttributes(attributes1); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(Haydn)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/WorkNumberTest.cpp b/Sourcecode/private/mxtest/core/WorkNumberTest.cpp index 9eea20f0e..f1c1c9d31 100644 --- a/Sourcecode/private/mxtest/core/WorkNumberTest.cpp +++ b/Sourcecode/private/mxtest/core/WorkNumberTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, WorkNumber ) +TEST(Test01, WorkNumber) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - WorkNumber object1; - WorkNumber object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + WorkNumber object1; + WorkNumber object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/WorkTest.cpp b/Sourcecode/private/mxtest/core/WorkTest.cpp index 6ddb6e011..da4bc3c90 100644 --- a/Sourcecode/private/mxtest/core/WorkTest.cpp +++ b/Sourcecode/private/mxtest/core/WorkTest.cpp @@ -13,112 +13,110 @@ using namespace mx::core; using namespace std; using namespace mxtest; -TEST( Test01, Work ) +TEST(Test01, Work) { TestMode v = TestMode::one; - WorkPtr object = tgenWork( v ); - stringstream expected; - tgenWorkExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( ! object->hasContents() ) + WorkPtr object = tgenWork(v); + stringstream expected; + tgenWorkExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(!object->hasContents()) } -TEST( Test02, Work ) + +TEST(Test02, Work) { TestMode v = TestMode::two; - WorkPtr object = tgenWork( v ); - stringstream expected; - tgenWorkExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + WorkPtr object = tgenWork(v); + stringstream expected; + tgenWorkExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } -TEST( Test03, Work ) + +TEST(Test03, Work) { TestMode v = TestMode::three; - WorkPtr object = tgenWork( v ); - stringstream expected; - tgenWorkExpected( expected, 1, v ); - stringstream actual; - // object->toStream( std::cout, 1 ); - object->toStream( actual, 1 ); - CHECK_EQUAL( expected.str(), actual.str() ) - CHECK( ! object->hasAttributes() ) - CHECK( object->hasContents() ) + WorkPtr object = tgenWork(v); + stringstream expected; + tgenWorkExpected(expected, 1, v); + stringstream actual; + // object->toStream( std::cout, 1 ); + object->toStream(actual, 1); + CHECK_EQUAL(expected.str(), actual.str()) + CHECK(!object->hasAttributes()) + CHECK(object->hasContents()) } namespace mxtest { - WorkPtr tgenWork( TestMode v ) +WorkPtr tgenWork(TestMode v) +{ + WorkPtr o = makeWork(); + switch (v) { - WorkPtr o = makeWork(); - switch ( v ) - { - case TestMode::one: - { - - } - break; - case TestMode::two: - { - o->setHasWorkTitle( true ); - o->getWorkTitle()->setValue( XsString( "The Incident at Ezinar" ) ); - } - break; - case TestMode::three: - { - o->setHasWorkTitle( true ); - o->getWorkTitle()->setValue( XsString( "Freezing Pieces" ) ); - o->setHasWorkNumber( true ); - o->getWorkNumber()->setValue( XsString( "1" ) ); - o->setHasOpus( true ); - o->getOpus()->getAttributes()->href = XsAnyUri( "//Macintosh HD/SomeFolder/SomeFile.xml" ); - o->getOpus()->getAttributes()->hasType = true; - o->getOpus()->getAttributes()->hasActuate = true; - o->getOpus()->getAttributes()->actuate = XlinkActuate::onRequest; - } - break; - default: - break; - } - return o; + case TestMode::one: { + } + break; + case TestMode::two: { + o->setHasWorkTitle(true); + o->getWorkTitle()->setValue(XsString("The Incident at Ezinar")); } - void tgenWorkExpected(std::ostream& os, int i, TestMode v ) + break; + case TestMode::three: { + o->setHasWorkTitle(true); + o->getWorkTitle()->setValue(XsString("Freezing Pieces")); + o->setHasWorkNumber(true); + o->getWorkNumber()->setValue(XsString("1")); + o->setHasOpus(true); + o->getOpus()->getAttributes()->href = XsAnyUri("//Macintosh HD/SomeFolder/SomeFile.xml"); + o->getOpus()->getAttributes()->hasType = true; + o->getOpus()->getAttributes()->hasActuate = true; + o->getOpus()->getAttributes()->actuate = XlinkActuate::onRequest; + } + break; + default: + break; + } + return o; +} + +void tgenWorkExpected(std::ostream &os, int i, TestMode v) +{ + + switch (v) { - - switch ( v ) - { - case TestMode::one: - { - streamLine( os, i, R"()", false ); - } - break; - case TestMode::two: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(The Incident at Ezinar)" ); - streamLine( os, i, R"()", false ); - } - break; - case TestMode::three: - { - streamLine( os, i, R"()" ); - streamLine( os, i+1, R"(1)" ); - streamLine( os, i+1, R"(Freezing Pieces)" ); - streamLine( os, i+1, R"()" ); - streamLine( os, i, R"()", false ); - } - break; - default: - break; - } + case TestMode::one: { + streamLine(os, i, R"()", false); + } + break; + case TestMode::two: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(The Incident at Ezinar)"); + streamLine(os, i, R"()", false); + } + break; + case TestMode::three: { + streamLine(os, i, R"()"); + streamLine(os, i + 1, R"(1)"); + streamLine(os, i + 1, R"(Freezing Pieces)"); + streamLine( + os, i + 1, + R"()"); + streamLine(os, i, R"()", false); } - } - + break; + default: + break; + } +} +} // namespace mxtest + #endif diff --git a/Sourcecode/private/mxtest/core/WorkTest.h b/Sourcecode/private/mxtest/core/WorkTest.h index 72853754d..00fe844f4 100644 --- a/Sourcecode/private/mxtest/core/WorkTest.h +++ b/Sourcecode/private/mxtest/core/WorkTest.h @@ -7,13 +7,13 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_CORE_TESTS -#include "mxtest/core/HelperFunctions.h" #include "mx/core/Elements.h" +#include "mxtest/core/HelperFunctions.h" namespace mxtest { - mx::core::WorkPtr tgenWork( TestMode v ); - void tgenWorkExpected(std::ostream& os, int indentLevel, TestMode v ); -} +mx::core::WorkPtr tgenWork(TestMode v); +void tgenWorkExpected(std::ostream &os, int indentLevel, TestMode v); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/core/WorkTitleTest.cpp b/Sourcecode/private/mxtest/core/WorkTitleTest.cpp index 9ce6cef01..e2947b7b4 100644 --- a/Sourcecode/private/mxtest/core/WorkTitleTest.cpp +++ b/Sourcecode/private/mxtest/core/WorkTitleTest.cpp @@ -11,30 +11,32 @@ using namespace mx::core; -TEST( Test01, WorkTitle ) +TEST(Test01, WorkTitle) { - std::string indentString( INDENT ); - XsString value1{ "ABC" }; - XsString value2{ "XYZ" }; - WorkTitle object1; - WorkTitle object2( value2 ); - std::stringstream default_constructed; - object1.toStream( default_constructed, 0 ); - std::stringstream object2_stream; - object2.toStream( object2_stream, 2 ); - std::string expected = R"()"; - std::string actual = default_constructed.str(); - CHECK_EQUAL( expected, actual ) - expected = indentString+indentString+R"(XYZ)"; - actual = object2_stream.str(); - CHECK_EQUAL( expected, actual ) - value1 = object2.getValue(); - object1.setValue( value1 ); - std::stringstream o1; std::stringstream o2; bool isOneLineOnly = false; - object1.streamContents( o1, 0, isOneLineOnly ); - object2.streamContents( o2, 0, isOneLineOnly ); - CHECK( isOneLineOnly ) - CHECK_EQUAL( o1.str(), o2.str() ) + std::string indentString(INDENT); + XsString value1{"ABC"}; + XsString value2{"XYZ"}; + WorkTitle object1; + WorkTitle object2(value2); + std::stringstream default_constructed; + object1.toStream(default_constructed, 0); + std::stringstream object2_stream; + object2.toStream(object2_stream, 2); + std::string expected = R"()"; + std::string actual = default_constructed.str(); + CHECK_EQUAL(expected, actual) + expected = indentString + indentString + R"(XYZ)"; + actual = object2_stream.str(); + CHECK_EQUAL(expected, actual) + value1 = object2.getValue(); + object1.setValue(value1); + std::stringstream o1; + std::stringstream o2; + bool isOneLineOnly = false; + object1.streamContents(o1, 0, isOneLineOnly); + object2.streamContents(o2, 0, isOneLineOnly); + CHECK(isOneLineOnly) + CHECK_EQUAL(o1.str(), o2.str()) } #endif diff --git a/Sourcecode/private/mxtest/core/YesNoNumberTest.cpp b/Sourcecode/private/mxtest/core/YesNoNumberTest.cpp index 675f7c381..aa8fb9af9 100644 --- a/Sourcecode/private/mxtest/core/YesNoNumberTest.cpp +++ b/Sourcecode/private/mxtest/core/YesNoNumberTest.cpp @@ -11,75 +11,80 @@ using namespace mx::core; -TEST( YesNoNumber01, YesNoNumber ) +TEST(YesNoNumber01, YesNoNumber) { YesNoNumber x; std::string expected = "yes"; - CHECK( x.getIsYesNo() ) - CHECK( !x.getIsDecimal() ) - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + CHECK(x.getIsYesNo()) + CHECK(!x.getIsDecimal()) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( YesNoNumber02, YesNoNumber ) + +TEST(YesNoNumber02, YesNoNumber) { - YesNoNumber x( Decimal( 31.2 ) ); - CHECK( !x.getIsYesNo() ) - CHECK( x.getIsDecimal() ) + YesNoNumber x(Decimal(31.2)); + CHECK(!x.getIsYesNo()) + CHECK(x.getIsDecimal()) std::string expected = "31.2"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( YesNoNumber03, YesNoNumber ) + +TEST(YesNoNumber03, YesNoNumber) { - YesNoNumber x( YesNo::yes ); - CHECK( x.getIsYesNo() ) - CHECK( !x.getIsDecimal() ) + YesNoNumber x(YesNo::yes); + CHECK(x.getIsYesNo()) + CHECK(!x.getIsDecimal()) std::string expected = "yes"; - std::string actual = toString( x ); - CHECK_EQUAL( expected, actual ) + std::string actual = toString(x); + CHECK_EQUAL(expected, actual) } -TEST( YesNoNumber04, YesNoNumber ) + +TEST(YesNoNumber04, YesNoNumber) { - YesNoNumber x( "no" ); - CHECK( x.getIsYesNo() ) - CHECK( !x.getIsDecimal() ) + YesNoNumber x("no"); + CHECK(x.getIsYesNo()) + CHECK(!x.getIsDecimal()) YesNo expected = YesNo::no; YesNo actual = x.getValueYesNo(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( YesNoNumber05, YesNoNumber ) + +TEST(YesNoNumber05, YesNoNumber) { - YesNoNumber x( "24.0" ); - CHECK( ! x.getIsYesNo() ) - CHECK( x.getIsDecimal() ) + YesNoNumber x("24.0"); + CHECK(!x.getIsYesNo()) + CHECK(x.getIsDecimal()) DecimalType expected = 24; DecimalType actual = x.getValueDecimal().getValue(); - CHECK_DOUBLES_EQUAL( expected, actual, DEFAULT_PRECISION ) + CHECK_DOUBLES_EQUAL(expected, actual, DEFAULT_PRECISION) } -TEST( YesNoNumber06, YesNoNumber ) + +TEST(YesNoNumber06, YesNoNumber) { - YesNoNumber x( "24.0" ); - x.setYesNo( YesNo::yes ); - CHECK( x.getIsYesNo() ) - CHECK( ! x.getIsDecimal() ) + YesNoNumber x("24.0"); + x.setYesNo(YesNo::yes); + CHECK(x.getIsYesNo()) + CHECK(!x.getIsDecimal()) std::string expected = "yes"; std::stringstream ss; ss << x; std::string actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } -TEST( YesNoNumber07, YesNoNumber ) +TEST(YesNoNumber07, YesNoNumber) { - YesNoNumber x( "yes" ); - x.setDecimal( Decimal( 30.9 ) ); - CHECK( ! x.getIsYesNo() ) - CHECK( x.getIsDecimal() ) + YesNoNumber x("yes"); + x.setDecimal(Decimal(30.9)); + CHECK(!x.getIsYesNo()) + CHECK(x.getIsDecimal()) std::string expected = "30.9"; std::stringstream ss; - toStream( ss, x ); + toStream(ss, x); std::string actual = ss.str(); - CHECK_EQUAL( expected, actual ) + CHECK_EQUAL(expected, actual) } #endif diff --git a/Sourcecode/private/mxtest/file/MxFile.h b/Sourcecode/private/mxtest/file/MxFile.h index 770a14a7c..241d42404 100644 --- a/Sourcecode/private/mxtest/file/MxFile.h +++ b/Sourcecode/private/mxtest/file/MxFile.h @@ -9,23 +9,22 @@ namespace mxtest { - class MxFile - { - public: - std::string fileName; - std::string subdirectory; - std::string path; - bool isLoadFailureExpected; - int sizeBytes; +class MxFile +{ + public: + std::string fileName; + std::string subdirectory; + std::string path; + bool isLoadFailureExpected; + int sizeBytes; - inline std::string getFileNamePart() const - { - return fileName.substr( 0, static_cast( static_cast( fileName.size() ) - 4 ) ); - } + inline std::string getFileNamePart() const + { + return fileName.substr(0, static_cast(static_cast(fileName.size()) - 4)); + } - private: - - }; + private: +}; - using MxFiles = std::vector; -} +using MxFiles = std::vector; +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/file/MxFileRepository.h b/Sourcecode/private/mxtest/file/MxFileRepository.h index cb50cedc0..150127a06 100644 --- a/Sourcecode/private/mxtest/file/MxFileRepository.h +++ b/Sourcecode/private/mxtest/file/MxFileRepository.h @@ -4,44 +4,44 @@ #pragma once +#include "mx/api/ScoreData.h" #include "mxtest/control/CompileControl.h" #include "mxtest/file/MxFile.h" -#include "mx/api/ScoreData.h" -#include -#include -#include #include +#include #include +#include +#include namespace mxtest { - using StringPair = std::pair; - using StringMap = std::map; - - class MxFileRepository - { - public: - static const std::string getFullPath( const std::string& fileName ); - static const std::string getNameWithoutExtension( const std::string& fileName ); - static const std::string& getSubdirectory( const std::string& fileName ); - static MxFiles getTestFiles( int maxFileSizeBytes ); - static const MxFiles& getTestFiles(); - static const MxFile& getTestFile( const std::string& fileName ); - static mx::api::ScoreData loadFile( const std::string& fileName ); - - private: - MxFileRepository(); - static const MxFileRepository& getInstance(); - void initializeExpectedLoadFailures(); - void initializeTestFiles(); - void initializeNameSubdirectoryMap(); +using StringPair = std::pair; +using StringMap = std::map; + +class MxFileRepository +{ + public: + static const std::string getFullPath(const std::string &fileName); + static const std::string getNameWithoutExtension(const std::string &fileName); + static const std::string &getSubdirectory(const std::string &fileName); + static MxFiles getTestFiles(int maxFileSizeBytes); + static const MxFiles &getTestFiles(); + static const MxFile &getTestFile(const std::string &fileName); + static mx::api::ScoreData loadFile(const std::string &fileName); + + private: + MxFileRepository(); + static const MxFileRepository &getInstance(); + void initializeExpectedLoadFailures(); + void initializeTestFiles(); + void initializeNameSubdirectoryMap(); - private: - const std::string myPath; - const std::string mySeparator; - std::set myExpectedLoadFailures; - StringMap myNameSubdirectoryMap; - MxFiles myTestFiles; - }; -} + private: + const std::string myPath; + const std::string mySeparator; + std::set myExpectedLoadFailures; + StringMap myNameSubdirectoryMap; + MxFiles myTestFiles; +}; +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/file/MxFileRepositoy.cpp b/Sourcecode/private/mxtest/file/MxFileRepositoy.cpp index 8d070ffde..090cac7f9 100644 --- a/Sourcecode/private/mxtest/file/MxFileRepositoy.cpp +++ b/Sourcecode/private/mxtest/file/MxFileRepositoy.cpp @@ -12,473 +12,455 @@ namespace mxtest { - MxFileRepository::MxFileRepository() - : myPath{ mxtest::getResourcesDirectoryPath() } - , mySeparator{ FILE_PATH_SEPARATOR } - , myExpectedLoadFailures{} - , myNameSubdirectoryMap{} - , myTestFiles{} - { - initializeNameSubdirectoryMap(); - initializeExpectedLoadFailures(); - - // should run last - initializeTestFiles(); - } +MxFileRepository::MxFileRepository() + : myPath{mxtest::getResourcesDirectoryPath()}, mySeparator{FILE_PATH_SEPARATOR}, myExpectedLoadFailures{}, + myNameSubdirectoryMap{}, myTestFiles{} +{ + initializeNameSubdirectoryMap(); + initializeExpectedLoadFailures(); + + // should run last + initializeTestFiles(); +} - - const std::string MxFileRepository::getFullPath( const std::string& fileName ) +const std::string MxFileRepository::getFullPath(const std::string &fileName) +{ + const auto &subDir = getSubdirectory(fileName); + if (subDir.empty()) { - const auto& subDir = getSubdirectory( fileName ); - if( subDir.empty() ) - { - throw std::runtime_error{ "TestFiles::getFullPath - fileName not found" }; - } - const auto& instance = getInstance(); - return instance.myPath + subDir + instance.mySeparator + fileName; + throw std::runtime_error{"TestFiles::getFullPath - fileName not found"}; } + const auto &instance = getInstance(); + return instance.myPath + subDir + instance.mySeparator + fileName; +} +const std::string MxFileRepository::getNameWithoutExtension(const std::string &fileName) +{ + const auto lastDot = fileName.find_last_of('.'); + return fileName.substr(0, lastDot - 1); +} - const std::string MxFileRepository::getNameWithoutExtension( const std::string& fileName ) - { - const auto lastDot = fileName.find_last_of( '.' ); - return fileName.substr( 0, lastDot - 1 ); - } - - - const std::string& MxFileRepository::getSubdirectory( const std::string& fileName ) +const std::string &MxFileRepository::getSubdirectory(const std::string &fileName) +{ + const auto &instance = getInstance(); + const auto iter = instance.myNameSubdirectoryMap.find(fileName); + if (iter == instance.myNameSubdirectoryMap.cend()) { - const auto& instance = getInstance(); - const auto iter = instance.myNameSubdirectoryMap.find( fileName ); - if( iter == instance.myNameSubdirectoryMap.cend() ) - { - throw std::runtime_error( "MxFileRepository::getSubdirectory fileName not found" ); - } - return iter->second; + throw std::runtime_error("MxFileRepository::getSubdirectory fileName not found"); } - - - MxFiles MxFileRepository::getTestFiles( int maxFileSizeBytes ) + return iter->second; +} + +MxFiles MxFileRepository::getTestFiles(int maxFileSizeBytes) +{ + MxFiles outFiles; + for (const auto &file : getTestFiles()) { - MxFiles outFiles; - for( const auto& file : getTestFiles() ) + if (maxFileSizeBytes <= 0 || file.sizeBytes <= maxFileSizeBytes) { - if( maxFileSizeBytes <= 0 || file.sizeBytes <= maxFileSizeBytes ) - { - outFiles.push_back( file ); - } + outFiles.push_back(file); } - return outFiles; - } - - - const MxFiles& MxFileRepository::getTestFiles() - { - const auto& instance = getInstance(); - return instance.myTestFiles; } - - - const MxFile& MxFileRepository::getTestFile( const std::string& fileName ) - { - const auto& instance = getInstance(); + return outFiles; +} - auto lambda = [&]( const MxFile& inMxFile ) - { - return fileName == inMxFile.fileName; - }; - - const auto iter = std::find_if( instance.myTestFiles.cbegin(), instance.myTestFiles.cend(), lambda ); - - if( iter == instance.myTestFiles.cend() ) - { - throw std::runtime_error( "MxFileRepository::getTestFile fileName not found" ); - } - - return *iter; - } - - - const MxFileRepository& MxFileRepository::getInstance() - { - static MxFileRepository ourInstance; - return ourInstance; - } - - - void MxFileRepository::initializeExpectedLoadFailures() - { - myExpectedLoadFailures.emplace( "ly41g_PartNoId.xml" ); - } - - - inline int MxFileRepositoryGetTheFilesize(const char* filename) - { - std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary); - return static_cast( in.tellg() ); - } +const MxFiles &MxFileRepository::getTestFiles() +{ + const auto &instance = getInstance(); + return instance.myTestFiles; +} + +const MxFile &MxFileRepository::getTestFile(const std::string &fileName) +{ + const auto &instance = getInstance(); + + auto lambda = [&](const MxFile &inMxFile) { return fileName == inMxFile.fileName; }; - - void MxFileRepository::initializeTestFiles() + const auto iter = std::find_if(instance.myTestFiles.cbegin(), instance.myTestFiles.cend(), lambda); + + if (iter == instance.myTestFiles.cend()) { - for( const auto& stringPair : myNameSubdirectoryMap ) - { - MxFile file; - file.fileName = stringPair.first; - file.subdirectory = stringPair.second; - file.path = myPath + file.subdirectory + mySeparator + file.fileName; - file.isLoadFailureExpected = ( myExpectedLoadFailures.find( file.fileName ) ) != myExpectedLoadFailures.cend(); - file.sizeBytes = MxFileRepositoryGetTheFilesize( file.path.c_str() ); - myTestFiles.emplace_back( std::move( file ) ); - } + throw std::runtime_error("MxFileRepository::getTestFile fileName not found"); } - - - mx::api::ScoreData MxFileRepository::loadFile( const std::string& fileName ) + + return *iter; +} + +const MxFileRepository &MxFileRepository::getInstance() +{ + static MxFileRepository ourInstance; + return ourInstance; +} + +void MxFileRepository::initializeExpectedLoadFailures() +{ + myExpectedLoadFailures.emplace("ly41g_PartNoId.xml"); +} + +inline int MxFileRepositoryGetTheFilesize(const char *filename) +{ + std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary); + return static_cast(in.tellg()); +} + +void MxFileRepository::initializeTestFiles() +{ + for (const auto &stringPair : myNameSubdirectoryMap) { - const std::string fullPath = getFullPath( fileName ); - auto& docMgr = mx::api::DocumentManager::getInstance(); - const int docId = docMgr.createFromFile( fullPath ); - auto scoreData = docMgr.getData( docId ); - docMgr.destroyDocument( docId ); - return scoreData; + MxFile file; + file.fileName = stringPair.first; + file.subdirectory = stringPair.second; + file.path = myPath + file.subdirectory + mySeparator + file.fileName; + file.isLoadFailureExpected = (myExpectedLoadFailures.find(file.fileName)) != myExpectedLoadFailures.cend(); + file.sizeBytes = MxFileRepositoryGetTheFilesize(file.path.c_str()); + myTestFiles.emplace_back(std::move(file)); } - - - void MxFileRepository::initializeNameSubdirectoryMap() - { - // lily files - myNameSubdirectoryMap.emplace( "ly01a_Pitches_Pitches.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly01b_Pitches_Intervals.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly01c_Pitches_NoVoiceElement.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly01d_Pitches_Microtones.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly01e_Pitches_ParenthesizedAccidentals.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly01f_Pitches_ParenthesizedMicrotoneAccidentals.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly02a_Rests_Durations.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly02b_Rests_PitchedRests.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly02c_Rests_MultiMeasureRests.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly02d_Rests_Multimeasure_TimeSignatures.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly02e_Rests_NoType.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly03a_Rhythm_Durations.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly03b_Rhythm_Backup.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly03c_Rhythm_DivisionChange.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly03d_Rhythm_DottedDurations_Factors.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly11a_TimeSignatures.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly11b_TimeSignatures_NoTime.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly11c_TimeSignatures_CompoundSimple.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly11d_TimeSignatures_CompoundMultiple.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly11e_TimeSignatures_CompoundMixed.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly11f_TimeSignatures_SymbolMeaning.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly11g_TimeSignatures_SingleNumber.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly11h_TimeSignatures_SenzaMisura.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly12a_Clefs.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly12b_Clefs_NoKeyOrClef.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly13a_KeySignatures.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly13b_KeySignatures_ChurchModes.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly13c_KeySignatures_NonTraditional.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly13d_KeySignatures_Microtones.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly14a_StaffDetails_LineChanges.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly21a_Chord_Basic.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly21b_Chords_TwoNotes.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly21c_Chords_ThreeNotesDuration.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly21d_Chords_SchubertStabatMater.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly21e_Chords_PickupMeasures.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly21f_Chord_ElementInBetween.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly22a_Noteheads.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly22b_Staff_Notestyles.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly22c_Noteheads_Chords.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly22d_Parenthesized_Noteheads.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly23a_Tuplets.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly23b_Tuplets_Styles.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly23c_Tuplet_Display_NonStandard.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly23d_Tuplets_Nested.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly23e_Tuplets_Tremolo.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly23f_Tuplets_DurationButNoBracket.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly24a_GraceNotes.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly24b_ChordAsGraceNote.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly24c_GraceNote_MeasureEnd.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly24d_AfterGrace.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly24e_GraceNote_StaffChange.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly24f_GraceNote_Slur.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly31a_Directions.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly31c_MetronomeMarks.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly32a_Notations.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly32b_Articulations_Texts.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly32c_MultipleNotationChildren.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly32d_Arpeggio.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33a_Spanners.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33b_Spanners_Tie.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33c_Spanners_Slurs.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33d_Spanners_OctaveShifts.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33e_Spanners_OctaveShifts_InvalidSize.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33f_Trill_EndingOnGraceNote.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33g_Slur_ChordedNotes.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33h_Spanners_Glissando.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly33i_Ties_NotEnded.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41a_MultiParts_Partorder.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41b_MultiParts_MoreThan10.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41c_StaffGroups.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41d_StaffGroups_Nested.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41e_StaffGroups_InstrumentNames_Linebroken.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41f_StaffGroups_Overlapping.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41g_PartNoId.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41h_TooManyParts.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly41i_PartNameDisplay_Override.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly42b_MultiVoice_MidMeasureClefChange.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly43a_PianoStaff.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly43b_MultiStaff_DifferentKeys.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly43c_MultiStaff_DifferentKeysAfterBackup.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly43d_MultiStaff_StaffChange.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly43e_Multistaff_ClefDynamics.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly45a_SimpleRepeat.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly45b_RepeatWithAlternatives.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly45c_RepeatMultipleTimes.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly45d_Repeats_Nested_Alternatives.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly45e_Repeats_Nested_Alternatives.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly45f_Repeats_InvalidEndings.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly45g_Repeats_NotEnded.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly46a_Barlines.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly46b_MidmeasureBarline.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly46c_Midmeasure_Clef.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly46d_PickupMeasure_ImplicitMeasures.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly46e_PickupMeasure_SecondVoiceStartsLater.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly46f_IncompleteMeasures.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly46g_PickupMeasure_Chordnames_FiguredBass.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly51b_Header_Quotes.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly51c_MultipleRights.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly51d_EmptyTitle.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly52a_PageLayout.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly52b_Breaks.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61a_Lyrics.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61b_MultipleLyrics.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61c_Lyrics_Pianostaff.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61d_Lyrics_Melisma.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61e_Lyrics_Chords.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61f_Lyrics_GracedNotes.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61g_Lyrics_NameNumber.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61h_Lyrics_BeamsMelismata.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61i_Lyrics_Chords.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61j_Lyrics_Elisions.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly61k_Lyrics_SpannersExtenders.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly71a_Chordnames.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly71c_ChordsFrets.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly71d_ChordsFrets_Multistaff.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly71e_TabStaves.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly71f_AllChordTypes.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly71g_MultipleChordnames.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly72a_TransposingInstruments.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly72b_TransposingInstruments_Full.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly72c_TransposingInstruments_Change.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly73a_Percussion.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly74a_FiguredBass.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly75a_AccordionRegistrations.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly99a_Sibelius5_IgnoreBeaming.xml", "lysuite" ); - myNameSubdirectoryMap.emplace( "ly99b_Lyrics_BeamsMelismata_IgnoreBeams.xml", "lysuite" ); - - // mjb files - myNameSubdirectoryMap.emplace( "ezinar.xml", "mjbsuite" ); - myNameSubdirectoryMap.emplace( "freezing.xml", "mjbsuite" ); - myNameSubdirectoryMap.emplace( "hello_timewise.xml", "mjbsuite" ); - myNameSubdirectoryMap.emplace( "lyre_timewise.xml", "mjbsuite" ); - myNameSubdirectoryMap.emplace( "chords_simple.xml", "mjbsuite" ); - myNameSubdirectoryMap.emplace( "ChordDirectionPlacement.xml", "mjbsuite" ); - myNameSubdirectoryMap.emplace( "HasMusicXmlVersionTrue.xml", "mjbsuite" ); - myNameSubdirectoryMap.emplace( "HasMusicXmlVersionFalse.xml", "mjbsuite" ); - myNameSubdirectoryMap.emplace( "PreserveTimeModificationNormalType.xml", "mjbsuite" ); - - // museScore - myNameSubdirectoryMap.emplace( "A_Walk_through_the_Park.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "different_keysigs_1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "different_keysigs_2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "test_harmony.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "test98.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testAccidentals1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testAccidentals2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testArpGliss1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testArpGliss2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testBarStyles.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testChord.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testChordDiagrams1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testChordNoVoice.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testChordNoVoice_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testClefs1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testCompleteMeasureRests.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDalSegno.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDCalCoda.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDCalFine.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDirections1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDrumset1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDrumset2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDurationRoundingError.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDurationRoundingError_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDynamics1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDynamics2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDynamics3.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testDynamics3_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testEmptyMeasure.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testEmptyMeasure_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testEmptyVoice1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testEmptyVoice1_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testFiguredBass1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testFiguredBass2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testGrace1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testGrace2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testHarmony1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testHarmony2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testHarmony3.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testHello.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testImplicitMeasure1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testInvalid.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testInvisibleElements.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testKeysig1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testLineBreaks.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testLines1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testLines1_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testLines2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testLines2_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testLyricsVoice2a.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testLyricsVoice2b.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testLyricsVoice2b_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testManualBreaks.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMeasureLength.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMeasureLength_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMetaData.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMultiMeasureRest1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMultiMeasureRest1_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMultiMeasureRest2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMultiMeasureRest2_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMultiMeasureRest3.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMultiMeasureRest3_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMultipleNotations.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testMultipleNotations_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNonUniqueThings.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNonUniqueThings_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNoteAttributes1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNoteAttributes2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNoteAttributes2_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNoteAttributes3.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNoteheads.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNotesRests1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNotesRests2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNumberedLyrics.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testNumberedLyrics_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testPartsSpecialCases.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testPartsSpecialCases_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testPiano.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testRestsNoType.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testRestsNoType_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testSlurs.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testStaffTwoKeySigs.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testStringVoiceName.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testStringVoiceName_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testSystemBrackets1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testSystemBrackets2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTablature1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTablature2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTablature3.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTempo1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTimesig1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTimesig3.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTremolo.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTuplets1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTuplets1_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTuplets2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTuplets2_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTuplets3.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTuplets3_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testTuplets4.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testUnusualDurations.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testUnusualDurations_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testVoiceMapper1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testVoiceMapper1_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testVoiceMapper2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testVoiceMapper2_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testVoiceMapper3.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testVoiceMapper3_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testVoicePiano1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testVolta1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testWedge1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testWedge2.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testWedge2_ref.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "testWords1.xml", "musuite" ); - myNameSubdirectoryMap.emplace( "ActorPreludeSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "BeetAnGeSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "Binchois.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "BrahWiMeSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "BrookeWestSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "Chant.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "DebuMandSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "Dichterliebe01.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "Echigo_Jishi.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "FaurReveSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "MahlFaGe4Sample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "MozaChloSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "MozaChloSample2.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "MozartPianoSonata.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "MozartTrio.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "MozaVeilSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "Saltarello.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "SchbAvMaSample.xml", "recsuite" ); - myNameSubdirectoryMap.emplace( "Telemann.xml", "recsuite" ); - - // ksuite - myNameSubdirectoryMap.emplace( "Bombe.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k001a_Articulations.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k001b_Articulations_Above.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k001c_Articulations_Below.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k002a_Fermatas.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k003a_Ornaments.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k004a_Technical.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k005a_Spanners_Slides.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006a_Clefs_sign_G_ln_2_oct_0_Treble.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006a_Header_Scaling_Decimals.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006b_Clefs_sign_F_ln_4_oct_0_Bass.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006c_Clefs_sign_C_ln_3_oct_0_Viola.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006d_Clefs_sign_C_ln_4_oct_0_Tenor.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006e_Clefs_sign_C_ln_5_oct_0_Baritone.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006f_Clefs_sign_C_ln_1_oct_0_Soprano.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006h_Clefs_sign_G_ln_1_oct_0_French.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006j_Clefs_sign_F_ln_5_oct_0_Subbass.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k006v_Clefs_sign_none_ln_3_oct_0_None.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k007a_Notations_Dynamics.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k007b_Notations_Dynamics_Attributes.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k007c_Directions_Dynamics.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k007d_Directions_Dynamics_Attributes.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k008a_Beaming.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k009a_Slurs.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k009b_Slur_Attributes.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k010a_Ties.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k010b_Bad_Ties.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k011a_Tuplets.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k012a_Tempo_Markings.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k013a_OrchestralScoreFinale.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k013b_OrchestralScoreSibelius.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k014a_Fermatas.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k015a_System_Layout.xml", "ksuite" ); - myNameSubdirectoryMap.emplace( "k016a_Miscellaneous_Fields.xml", "ksuite" ); - - // other - myNameSubdirectoryMap.emplace( "logic01a_homoSapiens.xml", "logicpro" ); - myNameSubdirectoryMap.emplace( "Schubert_der_Mueller.xml", "foundsuite" ); - myNameSubdirectoryMap.emplace( "musescore-slur-start-stop.musicxml", "custom" ); - myNameSubdirectoryMap.emplace( "systems-and-pages.xml", "custom" ); - myNameSubdirectoryMap.emplace( "transposition.musicxml", "custom" ); +} - // mxl - myNameSubdirectoryMap.emplace( "Dichterliebe01.mxl", "mxl" ); - } +mx::api::ScoreData MxFileRepository::loadFile(const std::string &fileName) +{ + const std::string fullPath = getFullPath(fileName); + auto &docMgr = mx::api::DocumentManager::getInstance(); + const int docId = docMgr.createFromFile(fullPath); + auto scoreData = docMgr.getData(docId); + docMgr.destroyDocument(docId); + return scoreData; +} + +void MxFileRepository::initializeNameSubdirectoryMap() +{ + // lily files + myNameSubdirectoryMap.emplace("ly01a_Pitches_Pitches.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly01b_Pitches_Intervals.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly01c_Pitches_NoVoiceElement.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly01d_Pitches_Microtones.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly01e_Pitches_ParenthesizedAccidentals.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly01f_Pitches_ParenthesizedMicrotoneAccidentals.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly02a_Rests_Durations.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly02b_Rests_PitchedRests.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly02c_Rests_MultiMeasureRests.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly02d_Rests_Multimeasure_TimeSignatures.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly02e_Rests_NoType.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly03a_Rhythm_Durations.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly03b_Rhythm_Backup.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly03c_Rhythm_DivisionChange.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly03d_Rhythm_DottedDurations_Factors.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly11a_TimeSignatures.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly11b_TimeSignatures_NoTime.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly11c_TimeSignatures_CompoundSimple.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly11d_TimeSignatures_CompoundMultiple.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly11e_TimeSignatures_CompoundMixed.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly11f_TimeSignatures_SymbolMeaning.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly11g_TimeSignatures_SingleNumber.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly11h_TimeSignatures_SenzaMisura.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly12a_Clefs.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly12b_Clefs_NoKeyOrClef.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly13a_KeySignatures.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly13b_KeySignatures_ChurchModes.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly13c_KeySignatures_NonTraditional.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly13d_KeySignatures_Microtones.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly14a_StaffDetails_LineChanges.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly21a_Chord_Basic.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly21b_Chords_TwoNotes.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly21c_Chords_ThreeNotesDuration.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly21d_Chords_SchubertStabatMater.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly21e_Chords_PickupMeasures.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly21f_Chord_ElementInBetween.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly22a_Noteheads.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly22b_Staff_Notestyles.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly22c_Noteheads_Chords.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly22d_Parenthesized_Noteheads.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly23a_Tuplets.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly23b_Tuplets_Styles.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly23c_Tuplet_Display_NonStandard.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly23d_Tuplets_Nested.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly23e_Tuplets_Tremolo.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly23f_Tuplets_DurationButNoBracket.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly24a_GraceNotes.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly24b_ChordAsGraceNote.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly24c_GraceNote_MeasureEnd.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly24d_AfterGrace.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly24e_GraceNote_StaffChange.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly24f_GraceNote_Slur.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly31a_Directions.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly31c_MetronomeMarks.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly32a_Notations.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly32b_Articulations_Texts.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly32c_MultipleNotationChildren.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly32d_Arpeggio.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33a_Spanners.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33b_Spanners_Tie.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33c_Spanners_Slurs.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33d_Spanners_OctaveShifts.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33e_Spanners_OctaveShifts_InvalidSize.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33f_Trill_EndingOnGraceNote.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33g_Slur_ChordedNotes.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33h_Spanners_Glissando.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly33i_Ties_NotEnded.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41a_MultiParts_Partorder.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41b_MultiParts_MoreThan10.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41c_StaffGroups.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41d_StaffGroups_Nested.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41e_StaffGroups_InstrumentNames_Linebroken.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41f_StaffGroups_Overlapping.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41g_PartNoId.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41h_TooManyParts.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly41i_PartNameDisplay_Override.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly42b_MultiVoice_MidMeasureClefChange.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly43a_PianoStaff.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly43b_MultiStaff_DifferentKeys.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly43c_MultiStaff_DifferentKeysAfterBackup.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly43d_MultiStaff_StaffChange.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly43e_Multistaff_ClefDynamics.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly45a_SimpleRepeat.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly45b_RepeatWithAlternatives.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly45c_RepeatMultipleTimes.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly45d_Repeats_Nested_Alternatives.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly45e_Repeats_Nested_Alternatives.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly45f_Repeats_InvalidEndings.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly45g_Repeats_NotEnded.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly46a_Barlines.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly46b_MidmeasureBarline.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly46c_Midmeasure_Clef.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly46d_PickupMeasure_ImplicitMeasures.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly46e_PickupMeasure_SecondVoiceStartsLater.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly46f_IncompleteMeasures.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly46g_PickupMeasure_Chordnames_FiguredBass.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly51b_Header_Quotes.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly51c_MultipleRights.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly51d_EmptyTitle.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly52a_PageLayout.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly52b_Breaks.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61a_Lyrics.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61b_MultipleLyrics.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61c_Lyrics_Pianostaff.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61d_Lyrics_Melisma.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61e_Lyrics_Chords.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61f_Lyrics_GracedNotes.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61g_Lyrics_NameNumber.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61h_Lyrics_BeamsMelismata.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61i_Lyrics_Chords.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61j_Lyrics_Elisions.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly61k_Lyrics_SpannersExtenders.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly71a_Chordnames.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly71c_ChordsFrets.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly71d_ChordsFrets_Multistaff.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly71e_TabStaves.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly71f_AllChordTypes.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly71g_MultipleChordnames.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly72a_TransposingInstruments.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly72b_TransposingInstruments_Full.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly72c_TransposingInstruments_Change.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly73a_Percussion.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly74a_FiguredBass.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly75a_AccordionRegistrations.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly99a_Sibelius5_IgnoreBeaming.xml", "lysuite"); + myNameSubdirectoryMap.emplace("ly99b_Lyrics_BeamsMelismata_IgnoreBeams.xml", "lysuite"); + + // mjb files + myNameSubdirectoryMap.emplace("ezinar.xml", "mjbsuite"); + myNameSubdirectoryMap.emplace("freezing.xml", "mjbsuite"); + myNameSubdirectoryMap.emplace("hello_timewise.xml", "mjbsuite"); + myNameSubdirectoryMap.emplace("lyre_timewise.xml", "mjbsuite"); + myNameSubdirectoryMap.emplace("chords_simple.xml", "mjbsuite"); + myNameSubdirectoryMap.emplace("ChordDirectionPlacement.xml", "mjbsuite"); + myNameSubdirectoryMap.emplace("HasMusicXmlVersionTrue.xml", "mjbsuite"); + myNameSubdirectoryMap.emplace("HasMusicXmlVersionFalse.xml", "mjbsuite"); + myNameSubdirectoryMap.emplace("PreserveTimeModificationNormalType.xml", "mjbsuite"); + + // museScore + myNameSubdirectoryMap.emplace("A_Walk_through_the_Park.xml", "musuite"); + myNameSubdirectoryMap.emplace("different_keysigs_1.xml", "musuite"); + myNameSubdirectoryMap.emplace("different_keysigs_2.xml", "musuite"); + myNameSubdirectoryMap.emplace("test_harmony.xml", "musuite"); + myNameSubdirectoryMap.emplace("test98.xml", "musuite"); + myNameSubdirectoryMap.emplace("testAccidentals1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testAccidentals2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testArpGliss1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testArpGliss2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testBarStyles.xml", "musuite"); + myNameSubdirectoryMap.emplace("testChord.xml", "musuite"); + myNameSubdirectoryMap.emplace("testChordDiagrams1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testChordNoVoice.xml", "musuite"); + myNameSubdirectoryMap.emplace("testChordNoVoice_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testClefs1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testCompleteMeasureRests.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDalSegno.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDCalCoda.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDCalFine.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDirections1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDrumset1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDrumset2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDurationRoundingError.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDurationRoundingError_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDynamics1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDynamics2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDynamics3.xml", "musuite"); + myNameSubdirectoryMap.emplace("testDynamics3_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testEmptyMeasure.xml", "musuite"); + myNameSubdirectoryMap.emplace("testEmptyMeasure_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testEmptyVoice1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testEmptyVoice1_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testFiguredBass1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testFiguredBass2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testGrace1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testGrace2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testHarmony1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testHarmony2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testHarmony3.xml", "musuite"); + myNameSubdirectoryMap.emplace("testHello.xml", "musuite"); + myNameSubdirectoryMap.emplace("testImplicitMeasure1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testInvalid.xml", "musuite"); + myNameSubdirectoryMap.emplace("testInvisibleElements.xml", "musuite"); + myNameSubdirectoryMap.emplace("testKeysig1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testLineBreaks.xml", "musuite"); + myNameSubdirectoryMap.emplace("testLines1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testLines1_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testLines2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testLines2_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testLyricsVoice2a.xml", "musuite"); + myNameSubdirectoryMap.emplace("testLyricsVoice2b.xml", "musuite"); + myNameSubdirectoryMap.emplace("testLyricsVoice2b_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testManualBreaks.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMeasureLength.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMeasureLength_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMetaData.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMultiMeasureRest1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMultiMeasureRest1_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMultiMeasureRest2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMultiMeasureRest2_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMultiMeasureRest3.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMultiMeasureRest3_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMultipleNotations.xml", "musuite"); + myNameSubdirectoryMap.emplace("testMultipleNotations_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNonUniqueThings.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNonUniqueThings_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNoteAttributes1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNoteAttributes2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNoteAttributes2_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNoteAttributes3.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNoteheads.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNotesRests1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNotesRests2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNumberedLyrics.xml", "musuite"); + myNameSubdirectoryMap.emplace("testNumberedLyrics_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testPartsSpecialCases.xml", "musuite"); + myNameSubdirectoryMap.emplace("testPartsSpecialCases_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testPiano.xml", "musuite"); + myNameSubdirectoryMap.emplace("testRestsNoType.xml", "musuite"); + myNameSubdirectoryMap.emplace("testRestsNoType_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testSlurs.xml", "musuite"); + myNameSubdirectoryMap.emplace("testStaffTwoKeySigs.xml", "musuite"); + myNameSubdirectoryMap.emplace("testStringVoiceName.xml", "musuite"); + myNameSubdirectoryMap.emplace("testStringVoiceName_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testSystemBrackets1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testSystemBrackets2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTablature1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTablature2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTablature3.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTempo1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTimesig1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTimesig3.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTremolo.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTuplets1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTuplets1_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTuplets2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTuplets2_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTuplets3.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTuplets3_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testTuplets4.xml", "musuite"); + myNameSubdirectoryMap.emplace("testUnusualDurations.xml", "musuite"); + myNameSubdirectoryMap.emplace("testUnusualDurations_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testVoiceMapper1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testVoiceMapper1_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testVoiceMapper2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testVoiceMapper2_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testVoiceMapper3.xml", "musuite"); + myNameSubdirectoryMap.emplace("testVoiceMapper3_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testVoicePiano1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testVolta1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testWedge1.xml", "musuite"); + myNameSubdirectoryMap.emplace("testWedge2.xml", "musuite"); + myNameSubdirectoryMap.emplace("testWedge2_ref.xml", "musuite"); + myNameSubdirectoryMap.emplace("testWords1.xml", "musuite"); + myNameSubdirectoryMap.emplace("ActorPreludeSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("BeetAnGeSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("Binchois.xml", "recsuite"); + myNameSubdirectoryMap.emplace("BrahWiMeSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("BrookeWestSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("Chant.xml", "recsuite"); + myNameSubdirectoryMap.emplace("DebuMandSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("Dichterliebe01.xml", "recsuite"); + myNameSubdirectoryMap.emplace("Echigo_Jishi.xml", "recsuite"); + myNameSubdirectoryMap.emplace("FaurReveSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("MahlFaGe4Sample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("MozaChloSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("MozaChloSample2.xml", "recsuite"); + myNameSubdirectoryMap.emplace("MozartPianoSonata.xml", "recsuite"); + myNameSubdirectoryMap.emplace("MozartTrio.xml", "recsuite"); + myNameSubdirectoryMap.emplace("MozaVeilSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("Saltarello.xml", "recsuite"); + myNameSubdirectoryMap.emplace("SchbAvMaSample.xml", "recsuite"); + myNameSubdirectoryMap.emplace("Telemann.xml", "recsuite"); + + // ksuite + myNameSubdirectoryMap.emplace("Bombe.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k001a_Articulations.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k001b_Articulations_Above.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k001c_Articulations_Below.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k002a_Fermatas.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k003a_Ornaments.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k004a_Technical.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k005a_Spanners_Slides.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006a_Clefs_sign_G_ln_2_oct_0_Treble.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006a_Header_Scaling_Decimals.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006b_Clefs_sign_F_ln_4_oct_0_Bass.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006c_Clefs_sign_C_ln_3_oct_0_Viola.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006d_Clefs_sign_C_ln_4_oct_0_Tenor.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006e_Clefs_sign_C_ln_5_oct_0_Baritone.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006f_Clefs_sign_C_ln_1_oct_0_Soprano.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006h_Clefs_sign_G_ln_1_oct_0_French.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006j_Clefs_sign_F_ln_5_oct_0_Subbass.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k006v_Clefs_sign_none_ln_3_oct_0_None.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k007a_Notations_Dynamics.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k007b_Notations_Dynamics_Attributes.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k007c_Directions_Dynamics.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k007d_Directions_Dynamics_Attributes.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k008a_Beaming.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k009a_Slurs.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k009b_Slur_Attributes.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k010a_Ties.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k010b_Bad_Ties.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k011a_Tuplets.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k012a_Tempo_Markings.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k013a_OrchestralScoreFinale.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k013b_OrchestralScoreSibelius.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k014a_Fermatas.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k015a_System_Layout.xml", "ksuite"); + myNameSubdirectoryMap.emplace("k016a_Miscellaneous_Fields.xml", "ksuite"); + + // other + myNameSubdirectoryMap.emplace("logic01a_homoSapiens.xml", "logicpro"); + myNameSubdirectoryMap.emplace("Schubert_der_Mueller.xml", "foundsuite"); + myNameSubdirectoryMap.emplace("musescore-slur-start-stop.musicxml", "custom"); + myNameSubdirectoryMap.emplace("systems-and-pages.xml", "custom"); + myNameSubdirectoryMap.emplace("transposition.musicxml", "custom"); + + // mxl + myNameSubdirectoryMap.emplace("Dichterliebe01.mxl", "mxl"); } +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/file/MxFileTest.cpp b/Sourcecode/private/mxtest/file/MxFileTest.cpp index 5bd7c629c..74c84ce9e 100644 --- a/Sourcecode/private/mxtest/file/MxFileTest.cpp +++ b/Sourcecode/private/mxtest/file/MxFileTest.cpp @@ -9,102 +9,90 @@ namespace mxtest { - MxFileTest::MxFileTest( mxtest::MxFile inTestFile, std::string inTestName, std::string inTestCppFileName, int inTestCppFileLineNumber ) - : myTestFile{ std::move(inTestFile) } - , myTestName{ std::move(inTestName) } - , myCppFileName{ std::move(inTestCppFileName) } - , myCppFileLineNumber{ inTestCppFileLineNumber } - , myIsSuccess{ false } - , myFailureMessage{} - { - - } - - - void MxFileTest::runTest() - { - bool isExceptionThrown = false; - std::string exceptionMessage; - - try - { - this->runTestCode(); - } - catch ( std::exception& e ) - { - isExceptionThrown = true; - exceptionMessage = std::string{ e.what() }; - } - catch ( ... ) - { - isExceptionThrown = true; - exceptionMessage = "exception of unknown (non-standard) type"; - } - - if( isExceptionThrown ) - { - std::stringstream failureMessage; - failureMessage << "'" << myTestName << "' " << testFileName() << " exception was thrown '" << exceptionMessage << "'"; - FAIL( failureMessage.str() ); - } - else if( !getIsSuccess() ) - { - std::stringstream failureMessage; - failureMessage << "'" << myTestName << "' " << testFileName() << " '" << getFailureMessage() << "'"; - FAIL( failureMessage.str() ); - } - } - - const std::string& MxFileTest::testFileName() const - { - return myTestFile.fileName; - } - - - const std::string MxFileTest::testFileNamePart() const - { - return myTestFile.getFileNamePart(); - } - - - const std::string MxFileTest::testFileExtension() const - { - return myTestFile.fileName.substr( myTestFile.fileName.size() - 3, 3 ); - } - - - const std::string& MxFileTest::testFilePath() const - { - return myTestFile.path; - } - - - const std::string& MxFileTest::testSubdirectory() const +MxFileTest::MxFileTest(mxtest::MxFile inTestFile, std::string inTestName, std::string inTestCppFileName, + int inTestCppFileLineNumber) + : myTestFile{std::move(inTestFile)}, myTestName{std::move(inTestName)}, myCppFileName{std::move(inTestCppFileName)}, + myCppFileLineNumber{inTestCppFileLineNumber}, myIsSuccess{false}, myFailureMessage{} +{ +} + +void MxFileTest::runTest() +{ + bool isExceptionThrown = false; + std::string exceptionMessage; + + try { - return myTestFile.subdirectory; + this->runTestCode(); } - - - bool MxFileTest::getIsSuccess() const + catch (std::exception &e) { - return myIsSuccess; + isExceptionThrown = true; + exceptionMessage = std::string{e.what()}; } - - - void MxFileTest::setIsSuccess( bool inIsSuccess ) + catch (...) { - myIsSuccess = inIsSuccess; + isExceptionThrown = true; + exceptionMessage = "exception of unknown (non-standard) type"; } - - - const std::string& MxFileTest::getFailureMessage() const + + if (isExceptionThrown) { - return myFailureMessage; + std::stringstream failureMessage; + failureMessage << "'" << myTestName << "' " << testFileName() << " exception was thrown '" << exceptionMessage + << "'"; + FAIL(failureMessage.str()); } - - - void MxFileTest::setFailureMessage( std::string inMessage ) + else if (!getIsSuccess()) { - myFailureMessage = inMessage; + std::stringstream failureMessage; + failureMessage << "'" << myTestName << "' " << testFileName() << " '" << getFailureMessage() << "'"; + FAIL(failureMessage.str()); } } + +const std::string &MxFileTest::testFileName() const +{ + return myTestFile.fileName; +} + +const std::string MxFileTest::testFileNamePart() const +{ + return myTestFile.getFileNamePart(); +} + +const std::string MxFileTest::testFileExtension() const +{ + return myTestFile.fileName.substr(myTestFile.fileName.size() - 3, 3); +} + +const std::string &MxFileTest::testFilePath() const +{ + return myTestFile.path; +} + +const std::string &MxFileTest::testSubdirectory() const +{ + return myTestFile.subdirectory; +} + +bool MxFileTest::getIsSuccess() const +{ + return myIsSuccess; +} + +void MxFileTest::setIsSuccess(bool inIsSuccess) +{ + myIsSuccess = inIsSuccess; +} + +const std::string &MxFileTest::getFailureMessage() const +{ + return myFailureMessage; +} + +void MxFileTest::setFailureMessage(std::string inMessage) +{ + myFailureMessage = inMessage; +} +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/file/MxFileTest.h b/Sourcecode/private/mxtest/file/MxFileTest.h index 562ab2a6d..ac9b62027 100644 --- a/Sourcecode/private/mxtest/file/MxFileTest.h +++ b/Sourcecode/private/mxtest/file/MxFileTest.h @@ -9,40 +9,48 @@ namespace mxtest { - class MxFileTest - { - public: - MxFileTest( - mxtest::MxFile inTestFile, - std::string inTestName, - std::string inTestCppFileName, - int inTestCppFileLineNumber ); - - virtual void runTest() final; - - virtual const std::string& testFileName() const final; - virtual const std::string testFileNamePart() const final; - virtual const std::string testFileExtension() const final; - virtual const std::string& testFilePath() const final; - virtual const std::string& testSubdirectory() const final; - virtual const bool isLoadFailureExpected() const final { return myTestFile.isLoadFailureExpected; } - - virtual bool getIsSuccess() const final; - virtual void setIsSuccess( bool inIsSuccess ) final; - virtual const std::string& getFailureMessage() const final; - virtual void setFailureMessage( std::string inMessage ) final; - - virtual inline const std::string& getCppFileName() const final { return myCppFileName; } - virtual inline const int getCppFileLineNumber() const final { return myCppFileLineNumber; } - - virtual void runTestCode() = 0; - - private: - mxtest::MxFile myTestFile; - std::string myTestName; - std::string myCppFileName; - int myCppFileLineNumber; - bool myIsSuccess; - std::string myFailureMessage; - }; -} +class MxFileTest +{ + public: + MxFileTest(mxtest::MxFile inTestFile, std::string inTestName, std::string inTestCppFileName, + int inTestCppFileLineNumber); + + virtual void runTest() final; + + virtual const std::string &testFileName() const final; + virtual const std::string testFileNamePart() const final; + virtual const std::string testFileExtension() const final; + virtual const std::string &testFilePath() const final; + virtual const std::string &testSubdirectory() const final; + + virtual const bool isLoadFailureExpected() const final + { + return myTestFile.isLoadFailureExpected; + } + + virtual bool getIsSuccess() const final; + virtual void setIsSuccess(bool inIsSuccess) final; + virtual const std::string &getFailureMessage() const final; + virtual void setFailureMessage(std::string inMessage) final; + + virtual inline const std::string &getCppFileName() const final + { + return myCppFileName; + } + + virtual inline const int getCppFileLineNumber() const final + { + return myCppFileLineNumber; + } + + virtual void runTestCode() = 0; + + private: + mxtest::MxFile myTestFile; + std::string myTestName; + std::string myCppFileName; + int myCppFileLineNumber; + bool myIsSuccess; + std::string myFailureMessage; +}; +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/file/MxFileTestGroup.h b/Sourcecode/private/mxtest/file/MxFileTestGroup.h index 545c5f95c..d58d12d24 100644 --- a/Sourcecode/private/mxtest/file/MxFileTestGroup.h +++ b/Sourcecode/private/mxtest/file/MxFileTestGroup.h @@ -7,62 +7,52 @@ #include "mxtest/file/MxFileTest.h" #include "mxtest/import/ImportTestImpl.h" -#include #include #include +#include namespace mxtest { - enum class MxFileTestListType - { - includedFiles, - excludedFiles - }; - - // the purpose of this class is to create a collection of MxFileTest instances - // and to keep them alive for the lifetime of the test run. pointers to these - // tests will be inserted into the cpul test registry and run during main() - template - class MxFileTestGroup - { - public: - - // will automatically include all files from TestFiles.h which are less - // than or equal to maxFileSizeBytes in size. maxFileSizeBytes 0 is infinity - MxFileTestGroup( - int maxFileSizeBytes, - std::string testName, - std::string testCppFileName, - int testCppFileLineNumber ) - { - auto files = MxFileRepository::getTestFiles( maxFileSizeBytes ); - for( auto& file : files ) - { - std::shared_ptr testPtr{ new MX_FILE_TEST_DERIVITAVE_TYPE{ file, testName, testCppFileName, testCppFileLineNumber } }; - myTests.push_back( testPtr ); - } - } - - // if you use MxFileTestListType::includedFiles then only those files which - // are in fileList and which are less than or equal to maxFileSizeBytes - // will be included. only those files which are found in TestFiles.h may be - // added to the fileList. if you use MxFileTestListType::excludedFiles then - // all files which are found in TestFiles.h and which are less than or equal - // to maxFileSizeBytes and which are *not* found in fileList will be included. - // maxFileSizeBytes == 0 means infinity - MxFileTestGroup( - int maxFileSizeBytes, - std::vector fileList, - MxFileTestListType listType, - std::string testName, - std::string testCppFileName, - int testCppFileLineNumber ) - { - throw std::runtime_error{ "not implemented" }; - } - - private: - std::list> myTests; - }; -} +enum class MxFileTestListType +{ + includedFiles, + excludedFiles +}; + +// the purpose of this class is to create a collection of MxFileTest instances +// and to keep them alive for the lifetime of the test run. pointers to these +// tests will be inserted into the cpul test registry and run during main() +template class MxFileTestGroup +{ + public: + // will automatically include all files from TestFiles.h which are less + // than or equal to maxFileSizeBytes in size. maxFileSizeBytes 0 is infinity + MxFileTestGroup(int maxFileSizeBytes, std::string testName, std::string testCppFileName, int testCppFileLineNumber) + { + auto files = MxFileRepository::getTestFiles(maxFileSizeBytes); + for (auto &file : files) + { + std::shared_ptr testPtr{ + new MX_FILE_TEST_DERIVITAVE_TYPE{file, testName, testCppFileName, testCppFileLineNumber}}; + myTests.push_back(testPtr); + } + } + + // if you use MxFileTestListType::includedFiles then only those files which + // are in fileList and which are less than or equal to maxFileSizeBytes + // will be included. only those files which are found in TestFiles.h may be + // added to the fileList. if you use MxFileTestListType::excludedFiles then + // all files which are found in TestFiles.h and which are less than or equal + // to maxFileSizeBytes and which are *not* found in fileList will be included. + // maxFileSizeBytes == 0 means infinity + MxFileTestGroup(int maxFileSizeBytes, std::vector fileList, MxFileTestListType listType, + std::string testName, std::string testCppFileName, int testCppFileLineNumber) + { + throw std::runtime_error{"not implemented"}; + } + + private: + std::list> myTests; +}; +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/file/Path.h b/Sourcecode/private/mxtest/file/Path.h index e8bd9f8b8..3a3ecb556 100644 --- a/Sourcecode/private/mxtest/file/Path.h +++ b/Sourcecode/private/mxtest/file/Path.h @@ -4,24 +4,24 @@ #pragma once #include "mxtest/file/PathRoot.h" -#include #include +#include namespace mxtest { #ifdef _MSC_VER - constexpr const char FILE_PATH_SEPARATOR = '\\'; +constexpr const char FILE_PATH_SEPARATOR = '\\'; #else - constexpr const char FILE_PATH_SEPARATOR = '/'; +constexpr const char FILE_PATH_SEPARATOR = '/'; #endif - inline const std::string getResourcesDirectoryPath() - { - std::stringstream ss; - ss << MX_REPO_ROOT_PATH << FILE_PATH_SEPARATOR; - ss << "Resources" << FILE_PATH_SEPARATOR; - return ss.str(); - } - +inline const std::string getResourcesDirectoryPath() +{ + std::stringstream ss; + ss << MX_REPO_ROOT_PATH << FILE_PATH_SEPARATOR; + ss << "Resources" << FILE_PATH_SEPARATOR; + return ss.str(); } + +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/file/StupidFileFunctions.cpp b/Sourcecode/private/mxtest/file/StupidFileFunctions.cpp index 59edd950c..9c8c3dcf3 100644 --- a/Sourcecode/private/mxtest/file/StupidFileFunctions.cpp +++ b/Sourcecode/private/mxtest/file/StupidFileFunctions.cpp @@ -3,124 +3,104 @@ // Distributed under the MIT License #include "mxtest/file/StupidFileFunctions.h" -#include "mxtest/file/Path.h" #include "mx/utility/Throw.h" +#include "mxtest/file/Path.h" +#include #include -#include #include -#include +#include namespace mxtest { - - std::string getSubdirectoryFullPath( const std::string& subdirectory ) + +std::string getSubdirectoryFullPath(const std::string &subdirectory) +{ + std::stringstream ss; + ss << mxtest::getResourcesDirectoryPath() << subdirectory << FILE_PATH_SEPARATOR; + return ss.str(); +} + +std::string getTestOutputFullDirectoryPath() +{ + return getSubdirectoryFullPath(TEST_OUTPUT_DIRECTORY_NAME); +} + +std::string getExpectedFilesFullDirectoryPath() +{ + return getSubdirectoryFullPath(EXPECTED_FILES_DIRECTORY_NAME); +} + +std::string concatFileNameParts(const std::string &fileNamePart, const std::string &fileExtensionPart) +{ + std::stringstream ss; + ss << fileNamePart << "." << fileExtensionPart; + return ss.str(); +} + +std::string getExpectedFileFullPath(const std::string &filename) +{ + std::stringstream ss; + ss << getExpectedFilesFullDirectoryPath(); + ss << filename; + return ss.str(); +} + +std::string filePath(const std::string &subdirectory, const std::string &fileName) +{ + std::stringstream ss; + ss << getSubdirectoryFullPath(subdirectory); + ss << fileName; + return ss.str(); +} + +void openInputFile(std::ifstream &outFileRef, const std::string &inFullpath) +{ + outFileRef = std::ifstream(inFullpath); + if (!outFileRef.is_open()) { std::stringstream ss; - ss << mxtest::getResourcesDirectoryPath() << subdirectory << FILE_PATH_SEPARATOR; - return ss.str(); + ss << "the file '" << inFullpath << "' could not be opened for reading"; + MX_THROW(ss.str()); } - - - std::string getTestOutputFullDirectoryPath() - { - return getSubdirectoryFullPath( TEST_OUTPUT_DIRECTORY_NAME ); - } - - - std::string getExpectedFilesFullDirectoryPath() - { - return getSubdirectoryFullPath( EXPECTED_FILES_DIRECTORY_NAME ); - } - - - std::string concatFileNameParts( - const std::string& fileNamePart, - const std::string& fileExtensionPart ) +} + +void openOutputFile(std::ofstream &outFileRef, const std::string &inFullpath) +{ + outFileRef = std::ofstream(inFullpath); + if (!outFileRef.is_open()) { std::stringstream ss; - ss << fileNamePart << "." << fileExtensionPart; - return ss.str(); + ss << "the file '" << inFullpath << "' could not be opened for writing"; + MX_THROW(ss.str()); } - - - std::string getExpectedFileFullPath( const std::string& filename ) +} + +void openAppendFile(std::ofstream &outFileRef, const std::string &inFullpath) +{ + outFileRef = std::ofstream(inFullpath, std::ios::app); + if (!outFileRef.is_open()) { std::stringstream ss; - ss << getExpectedFilesFullDirectoryPath(); - ss << filename; - return ss.str(); + ss << "the file '" << inFullpath << "' could not be opened for appending"; + MX_THROW(ss.str()); } - - - std::string filePath( - const std::string& subdirectory, - const std::string& fileName ) +} + +void deleteFileThrowError(const std::string fullpath) +{ + auto result = std::remove(fullpath.c_str()); + if (result != 0) { std::stringstream ss; - ss << getSubdirectoryFullPath( subdirectory ); - ss << fileName; - return ss.str(); - } - - - void openInputFile( - std::ifstream& outFileRef, - const std::string& inFullpath ) - { - outFileRef = std::ifstream( inFullpath ); - if( !outFileRef.is_open() ) - { - std::stringstream ss; - ss << "the file '" << inFullpath << "' could not be opened for reading"; - MX_THROW( ss.str() ); - } - } - - - void openOutputFile( - std::ofstream& outFileRef, - const std::string& inFullpath ) - { - outFileRef = std::ofstream( inFullpath ); - if( !outFileRef.is_open() ) - { - std::stringstream ss; - ss << "the file '" << inFullpath << "' could not be opened for writing"; - MX_THROW( ss.str() ); - } - } - - - void openAppendFile( - std::ofstream& outFileRef, - const std::string& inFullpath ) - { - outFileRef = std::ofstream( inFullpath, std::ios::app ); - if( !outFileRef.is_open() ) - { - std::stringstream ss; - ss << "the file '" << inFullpath << "' could not be opened for appending"; - MX_THROW( ss.str() ); - } - } - - - void deleteFileThrowError( const std::string fullpath ) - { - auto result = std::remove( fullpath.c_str() ); - if( result != 0 ) - { - std::stringstream ss; - ss << "deletion of the file '" << fullpath << "' failed"; - std::cout << ss.str() << std::endl; - } + ss << "deletion of the file '" << fullpath << "' failed"; + std::cout << ss.str() << std::endl; } +} - - bool deleteFileNoThrow( const std::string fullpath ) - { - return 0 == std::remove( fullpath.c_str() ); - } - +bool deleteFileNoThrow(const std::string fullpath) +{ + return 0 == std::remove(fullpath.c_str()); } + +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/file/StupidFileFunctions.h b/Sourcecode/private/mxtest/file/StupidFileFunctions.h index 63711c74e..9343820bb 100644 --- a/Sourcecode/private/mxtest/file/StupidFileFunctions.h +++ b/Sourcecode/private/mxtest/file/StupidFileFunctions.h @@ -8,35 +8,25 @@ namespace mxtest { - constexpr const char* const TEST_OUTPUT_DIRECTORY_NAME = "testOutput"; - constexpr const char* const EXPECTED_FILES_DIRECTORY_NAME = "expected"; - - std::string getSubdirectoryFullPath( const std::string& subdirectory ); - std::string getTestOutputFullDirectoryPath(); - std::string getExpectedFilesFullDirectoryPath(); - std::string getExpectedFileFullPath( const std::string& filename ); - - std::string concatFileNameParts( - const std::string& fileNamePart, - const std::string& fileExtensionPart ); - - std::string filePath( - const std::string& subdirectory, - const std::string& fileName ); - - void openInputFile( - std::ifstream& outFileRef, - const std::string& inFullpath ); - - void openOutputFile( - std::ofstream& outFileRef, - const std::string& inFullpath ); - - void openAppendFile( - std::ofstream& outFileRef, - const std::string& inFullpath ); - - void deleteFileThrowError( const std::string fullpath ); - - bool deleteFileNoThrow( const std::string fullpath ); -} +constexpr const char *const TEST_OUTPUT_DIRECTORY_NAME = "testOutput"; +constexpr const char *const EXPECTED_FILES_DIRECTORY_NAME = "expected"; + +std::string getSubdirectoryFullPath(const std::string &subdirectory); +std::string getTestOutputFullDirectoryPath(); +std::string getExpectedFilesFullDirectoryPath(); +std::string getExpectedFileFullPath(const std::string &filename); + +std::string concatFileNameParts(const std::string &fileNamePart, const std::string &fileExtensionPart); + +std::string filePath(const std::string &subdirectory, const std::string &fileName); + +void openInputFile(std::ifstream &outFileRef, const std::string &inFullpath); + +void openOutputFile(std::ofstream &outFileRef, const std::string &inFullpath); + +void openAppendFile(std::ofstream &outFileRef, const std::string &inFullpath); + +void deleteFileThrowError(const std::string fullpath); + +bool deleteFileNoThrow(const std::string fullpath); +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/impl/CurveFunctionsTest.cpp b/Sourcecode/private/mxtest/impl/CurveFunctionsTest.cpp index 4e744a0c8..cf6a24124 100644 --- a/Sourcecode/private/mxtest/impl/CurveFunctionsTest.cpp +++ b/Sourcecode/private/mxtest/impl/CurveFunctionsTest.cpp @@ -6,1044 +6,1036 @@ #ifdef MX_COMPILE_IMPL_TESTS #include "cpul/cpulTestHarness.h" -#include "mx/impl/CurveFunctions.h" #include "mx/core/elements/Slur.h" #include "mx/core/elements/Tied.h" +#include "mx/impl/CurveFunctions.h" using namespace mx; using namespace mx::impl; namespace { - template - std::shared_ptr seed() - { - using namespace mx::impl; - using namespace mx; - auto e = std::make_shared(); - auto& attr = *e->getAttributes(); - attr.type = core::StartStopContinue::start; - attr.bezierOffset.setValue( 1.0 ); - attr.hasBezierOffset = true; - attr.bezierOffset2.setValue( 2.0 ); - attr.hasBezierOffset2 = true; - attr.defaultX.setValue( 3.0 ); - attr.hasDefaultX = true; - attr.defaultY.setValue( 4.0 ); - attr.hasDefaultY = true; - attr.relativeX.setValue( 5.0 ); - attr.hasRelativeX = true; - attr.relativeY.setValue( 6.0 ); - attr.hasRelativeY = true; - attr.color = core::Color{ 7, 8, 9, 10 }; - attr.hasColor = true; - attr.dashLength.setValue( 11.0 ); - attr.hasDashLength = true; - attr.spaceLength.setValue( 12.0 ); - attr.hasSpaceLength = true; - attr.number.setValue( 2 ); - attr.hasNumber = true; - attr.lineType = core::LineType::wavy; - attr.hasLineType = true; - attr.placement = core::AboveBelow::below; - attr.hasPlacement = true; - attr.orientation = core::OverUnder::over; - attr.hasOrientation = true; - attr.bezierX.setValue( 13.0 ); - attr.hasBezierX = true; - attr.bezierY.setValue( 14.0 ); - attr.hasBezierY = true; - attr.bezierX2.setValue( 15.0 ); - attr.hasBezierX2 = true; - attr.bezierY2.setValue( 16.0 ); - attr.hasBezierY2 = true; - return e; - } - - api::CurveStart seedStart( api::CurveType t ) - { - api::CurveStart c{ t }; - c.numberLevel = 2; - c.curvePoints.isBezierOffsetSpecified = true; - c.curvePoints.bezierOffset = 1.0; - c.curvePoints.isBezierXSpecified = true; - c.curvePoints.bezierX = 13.0; - c.curvePoints.isBezierYSpecified = true; - c.curvePoints.bezierY = 14.0; - c.curvePoints.positionData.isDefaultXSpecified = true; - c.curvePoints.positionData.defaultX = 3.0; - c.curvePoints.positionData.isDefaultYSpecified = true; - c.curvePoints.positionData.defaultY = 4.0; - c.curvePoints.positionData.isRelativeXSpecified = true; - c.curvePoints.positionData.relativeX = 5.0; - c.curvePoints.positionData.isRelativeYSpecified = true; - c.curvePoints.positionData.relativeY = 6.0; - c.isColorSpecified = true; - c.colorData.red = 8; - c.colorData.green = 9; - c.colorData.blue = 10; - c.colorData.isAlphaSpecified = false; - c.lineData.lineType = api::LineType::wavy; - c.lineData.isDashLengthSpecified = true; - c.lineData.dashLength = 11.0; - c.lineData.isSpaceLengthSpecified = true; - c.lineData.spaceLength = 12.0; - c.curvePoints.positionData.placement = api::Placement::below; - c.curveOrientation = api::CurveOrientation::overhand; - return c; - } - - api::CurveContinue seedContinue( api::CurveType t ) - { - api::CurveContinue c{ t }; - c.numberLevel = 2; - c.curvePoints.isBezierOffsetSpecified = true; - c.curvePoints.bezierOffset = 1.0; - c.curvePoints.isBezierXSpecified = true; - c.curvePoints.bezierX = 13.0; - c.curvePoints.isBezierYSpecified = true; - c.curvePoints.bezierY = 14.0; - c.curvePoints.positionData.isDefaultXSpecified = true; - c.curvePoints.positionData.defaultX = 3.0; - c.curvePoints.positionData.isDefaultYSpecified = true; - c.curvePoints.positionData.defaultY = 4.0; - c.curvePoints.positionData.isRelativeXSpecified = true; - c.curvePoints.positionData.relativeX = 5.0; - c.curvePoints.positionData.isRelativeYSpecified = true; - c.curvePoints.positionData.relativeY = 6.0; - c.curvePoints.positionData.placement = api::Placement::below; - c.isBezierX2Specified = true; - c.bezierX2 = 100.0; - c.isBezierY2Specified = true; - c.bezierY2 = 101.0; - c.isBezierOffset2Specified = true; - c.bezierOffset2 = 102.0; - return c; - } - - api::CurveStop seedStop( api::CurveType t ) - { - api::CurveStop c{ t }; - c.numberLevel = 2; - c.curvePoints.isBezierOffsetSpecified = true; - c.curvePoints.bezierOffset = 1.0; - c.curvePoints.isBezierXSpecified = true; - c.curvePoints.bezierX = 13.0; - c.curvePoints.isBezierYSpecified = true; - c.curvePoints.bezierY = 14.0; - c.curvePoints.positionData.isDefaultXSpecified = true; - c.curvePoints.positionData.defaultX = 3.0; - c.curvePoints.positionData.isDefaultYSpecified = true; - c.curvePoints.positionData.defaultY = 4.0; - c.curvePoints.positionData.isRelativeXSpecified = true; - c.curvePoints.positionData.relativeX = 5.0; - c.curvePoints.positionData.isRelativeYSpecified = true; - c.curvePoints.positionData.relativeY = 6.0; - c.curvePoints.positionData.placement = api::Placement::below; - return c; - } -} - - - -TEST( parseCurveStart_curveType, CurveFunctions ) +template std::shared_ptr seed() +{ + using namespace mx::impl; + using namespace mx; + auto e = std::make_shared(); + auto &attr = *e->getAttributes(); + attr.type = core::StartStopContinue::start; + attr.bezierOffset.setValue(1.0); + attr.hasBezierOffset = true; + attr.bezierOffset2.setValue(2.0); + attr.hasBezierOffset2 = true; + attr.defaultX.setValue(3.0); + attr.hasDefaultX = true; + attr.defaultY.setValue(4.0); + attr.hasDefaultY = true; + attr.relativeX.setValue(5.0); + attr.hasRelativeX = true; + attr.relativeY.setValue(6.0); + attr.hasRelativeY = true; + attr.color = core::Color{7, 8, 9, 10}; + attr.hasColor = true; + attr.dashLength.setValue(11.0); + attr.hasDashLength = true; + attr.spaceLength.setValue(12.0); + attr.hasSpaceLength = true; + attr.number.setValue(2); + attr.hasNumber = true; + attr.lineType = core::LineType::wavy; + attr.hasLineType = true; + attr.placement = core::AboveBelow::below; + attr.hasPlacement = true; + attr.orientation = core::OverUnder::over; + attr.hasOrientation = true; + attr.bezierX.setValue(13.0); + attr.hasBezierX = true; + attr.bezierY.setValue(14.0); + attr.hasBezierY = true; + attr.bezierX2.setValue(15.0); + attr.hasBezierX2 = true; + attr.bezierY2.setValue(16.0); + attr.hasBezierY2 = true; + return e; +} + +api::CurveStart seedStart(api::CurveType t) +{ + api::CurveStart c{t}; + c.numberLevel = 2; + c.curvePoints.isBezierOffsetSpecified = true; + c.curvePoints.bezierOffset = 1.0; + c.curvePoints.isBezierXSpecified = true; + c.curvePoints.bezierX = 13.0; + c.curvePoints.isBezierYSpecified = true; + c.curvePoints.bezierY = 14.0; + c.curvePoints.positionData.isDefaultXSpecified = true; + c.curvePoints.positionData.defaultX = 3.0; + c.curvePoints.positionData.isDefaultYSpecified = true; + c.curvePoints.positionData.defaultY = 4.0; + c.curvePoints.positionData.isRelativeXSpecified = true; + c.curvePoints.positionData.relativeX = 5.0; + c.curvePoints.positionData.isRelativeYSpecified = true; + c.curvePoints.positionData.relativeY = 6.0; + c.isColorSpecified = true; + c.colorData.red = 8; + c.colorData.green = 9; + c.colorData.blue = 10; + c.colorData.isAlphaSpecified = false; + c.lineData.lineType = api::LineType::wavy; + c.lineData.isDashLengthSpecified = true; + c.lineData.dashLength = 11.0; + c.lineData.isSpaceLengthSpecified = true; + c.lineData.spaceLength = 12.0; + c.curvePoints.positionData.placement = api::Placement::below; + c.curveOrientation = api::CurveOrientation::overhand; + return c; +} + +api::CurveContinue seedContinue(api::CurveType t) +{ + api::CurveContinue c{t}; + c.numberLevel = 2; + c.curvePoints.isBezierOffsetSpecified = true; + c.curvePoints.bezierOffset = 1.0; + c.curvePoints.isBezierXSpecified = true; + c.curvePoints.bezierX = 13.0; + c.curvePoints.isBezierYSpecified = true; + c.curvePoints.bezierY = 14.0; + c.curvePoints.positionData.isDefaultXSpecified = true; + c.curvePoints.positionData.defaultX = 3.0; + c.curvePoints.positionData.isDefaultYSpecified = true; + c.curvePoints.positionData.defaultY = 4.0; + c.curvePoints.positionData.isRelativeXSpecified = true; + c.curvePoints.positionData.relativeX = 5.0; + c.curvePoints.positionData.isRelativeYSpecified = true; + c.curvePoints.positionData.relativeY = 6.0; + c.curvePoints.positionData.placement = api::Placement::below; + c.isBezierX2Specified = true; + c.bezierX2 = 100.0; + c.isBezierY2Specified = true; + c.bezierY2 = 101.0; + c.isBezierOffset2Specified = true; + c.bezierOffset2 = 102.0; + return c; +} + +api::CurveStop seedStop(api::CurveType t) +{ + api::CurveStop c{t}; + c.numberLevel = 2; + c.curvePoints.isBezierOffsetSpecified = true; + c.curvePoints.bezierOffset = 1.0; + c.curvePoints.isBezierXSpecified = true; + c.curvePoints.bezierX = 13.0; + c.curvePoints.isBezierYSpecified = true; + c.curvePoints.bezierY = 14.0; + c.curvePoints.positionData.isDefaultXSpecified = true; + c.curvePoints.positionData.defaultX = 3.0; + c.curvePoints.positionData.isDefaultYSpecified = true; + c.curvePoints.positionData.defaultY = 4.0; + c.curvePoints.positionData.isRelativeXSpecified = true; + c.curvePoints.positionData.relativeX = 5.0; + c.curvePoints.positionData.isRelativeYSpecified = true; + c.curvePoints.positionData.relativeY = 6.0; + c.curvePoints.positionData.placement = api::Placement::below; + return c; +} +} // namespace + +TEST(parseCurveStart_curveType, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( api::CurveType::tie == c.curveType ); + auto c = impl::parseCurveStart(*e); + CHECK(api::CurveType::tie == c.curveType); } -T_END +T_END -TEST( parseCurveStart_numberLevel, CurveFunctions ) +TEST(parseCurveStart_numberLevel, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK_EQUAL( 2, c.numberLevel ); + auto c = impl::parseCurveStart(*e); + CHECK_EQUAL(2, c.numberLevel); } -T_END +T_END -TEST( parseCurveStart_curvePoints_bx, CurveFunctions ) +TEST(parseCurveStart_curvePoints_bx, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( c.curvePoints.isBezierXSpecified ); - CHECK_DOUBLES_EQUAL( 13.0, c.curvePoints.bezierX, 0.01 ); + auto c = impl::parseCurveStart(*e); + CHECK(c.curvePoints.isBezierXSpecified); + CHECK_DOUBLES_EQUAL(13.0, c.curvePoints.bezierX, 0.01); } -T_END +T_END -TEST( parseCurveStart_curvePoints_by, CurveFunctions ) +TEST(parseCurveStart_curvePoints_by, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( c.curvePoints.isBezierYSpecified ); - CHECK_DOUBLES_EQUAL( 14.0, c.curvePoints.bezierY, 0.01 ); + auto c = impl::parseCurveStart(*e); + CHECK(c.curvePoints.isBezierYSpecified); + CHECK_DOUBLES_EQUAL(14.0, c.curvePoints.bezierY, 0.01); } -T_END +T_END -TEST( parseCurveStart_curvePoints_bo, CurveFunctions ) +TEST(parseCurveStart_curvePoints_bo, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( c.curvePoints.isBezierOffsetSpecified ); - CHECK_EQUAL( 1, c.curvePoints.bezierOffset ); + auto c = impl::parseCurveStart(*e); + CHECK(c.curvePoints.isBezierOffsetSpecified); + CHECK_EQUAL(1, c.curvePoints.bezierOffset); } -T_END +T_END -TEST( parseCurveStart_curvePoints_positionData_x, CurveFunctions ) +TEST(parseCurveStart_curvePoints_positionData_x, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( c.curvePoints.positionData.isDefaultXSpecified ); - CHECK_DOUBLES_EQUAL( 3.0, c.curvePoints.positionData.defaultX, 0.01 ); + auto c = impl::parseCurveStart(*e); + CHECK(c.curvePoints.positionData.isDefaultXSpecified); + CHECK_DOUBLES_EQUAL(3.0, c.curvePoints.positionData.defaultX, 0.01); } -T_END +T_END -TEST( parseCurveStart_curvePoints_positionData_y, CurveFunctions ) +TEST(parseCurveStart_curvePoints_positionData_y, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( c.curvePoints.positionData.isDefaultYSpecified ); - CHECK_DOUBLES_EQUAL( 4.0, c.curvePoints.positionData.defaultY, 0.01 ); + auto c = impl::parseCurveStart(*e); + CHECK(c.curvePoints.positionData.isDefaultYSpecified); + CHECK_DOUBLES_EQUAL(4.0, c.curvePoints.positionData.defaultY, 0.01); } -T_END +T_END -TEST( parseCurveStart_curvePoints_positionData_rx, CurveFunctions ) +TEST(parseCurveStart_curvePoints_positionData_rx, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( c.curvePoints.positionData.isRelativeXSpecified ); - CHECK_DOUBLES_EQUAL( 5.0, c.curvePoints.positionData.relativeX, 0.01 ); + auto c = impl::parseCurveStart(*e); + CHECK(c.curvePoints.positionData.isRelativeXSpecified); + CHECK_DOUBLES_EQUAL(5.0, c.curvePoints.positionData.relativeX, 0.01); } -T_END +T_END -TEST( parseCurveStart_curvePoints_positionData_ry, CurveFunctions ) +TEST(parseCurveStart_curvePoints_positionData_ry, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( c.curvePoints.positionData.isRelativeYSpecified ); - CHECK_DOUBLES_EQUAL( 6.0, c.curvePoints.positionData.relativeY, 0.01 ); + auto c = impl::parseCurveStart(*e); + CHECK(c.curvePoints.positionData.isRelativeYSpecified); + CHECK_DOUBLES_EQUAL(6.0, c.curvePoints.positionData.relativeY, 0.01); } -T_END +T_END -TEST( parseCurveStart_lineData_dashLength, CurveFunctions ) +TEST(parseCurveStart_lineData_dashLength, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - const auto& l = c.lineData; - CHECK( l.isDashLengthSpecified ); - CHECK_DOUBLES_EQUAL( 11.0, l.dashLength, 0.01 ); + auto c = impl::parseCurveStart(*e); + const auto &l = c.lineData; + CHECK(l.isDashLengthSpecified); + CHECK_DOUBLES_EQUAL(11.0, l.dashLength, 0.01); } -T_END +T_END -TEST( parseCurveStart_lineData_spaceLength, CurveFunctions ) +TEST(parseCurveStart_lineData_spaceLength, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - const auto& l = c.lineData; - CHECK( l.isSpaceLengthSpecified ); - CHECK_DOUBLES_EQUAL( 12.0, l.spaceLength, 0.01 ); + auto c = impl::parseCurveStart(*e); + const auto &l = c.lineData; + CHECK(l.isSpaceLengthSpecified); + CHECK_DOUBLES_EQUAL(12.0, l.spaceLength, 0.01); } -T_END +T_END -TEST( parseCurveStart_lineData_lineType, CurveFunctions ) +TEST(parseCurveStart_lineData_lineType, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - const auto& l = c.lineData; - CHECK( api::LineType::wavy == l.lineType ); + auto c = impl::parseCurveStart(*e); + const auto &l = c.lineData; + CHECK(api::LineType::wavy == l.lineType); } -T_END +T_END -TEST( parseCurveStart_color, CurveFunctions ) +TEST(parseCurveStart_color, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - const auto& color = c.colorData; - CHECK( c.isColorSpecified ); - CHECK_EQUAL( 8, static_cast( color.red ) ); - CHECK_EQUAL( 9, static_cast( color.green ) ); - CHECK_EQUAL( 10, static_cast( color.blue ) ); - CHECK( color.isAlphaSpecified ); - CHECK_EQUAL( 7, static_cast( color.alpha ) ); + auto c = impl::parseCurveStart(*e); + const auto &color = c.colorData; + CHECK(c.isColorSpecified); + CHECK_EQUAL(8, static_cast(color.red)); + CHECK_EQUAL(9, static_cast(color.green)); + CHECK_EQUAL(10, static_cast(color.blue)); + CHECK(color.isAlphaSpecified); + CHECK_EQUAL(7, static_cast(color.alpha)); } -T_END +T_END -TEST( parseCurveStart_orientation, CurveFunctions ) +TEST(parseCurveStart_orientation, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStart( *e ); - CHECK( api::CurveOrientation::overhand == c.curveOrientation ); + auto c = impl::parseCurveStart(*e); + CHECK(api::CurveOrientation::overhand == c.curveOrientation); } -T_END +T_END ///////////////////////////////////////////////////////////////////////////////// - -TEST( parseCurveContinue_curveType, CurveFunctions ) +TEST(parseCurveContinue_curveType, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( api::CurveType::tie == c.curveType ); + auto c = impl::parseCurveContinue(*e); + CHECK(api::CurveType::tie == c.curveType); } -T_END +T_END -TEST( parseCurveContinue_numberLevel, CurveFunctions ) +TEST(parseCurveContinue_numberLevel, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK_EQUAL( 2, c.numberLevel ); + auto c = impl::parseCurveContinue(*e); + CHECK_EQUAL(2, c.numberLevel); } -T_END +T_END -TEST( parseCurveContinue_curvePoints_bx, CurveFunctions ) +TEST(parseCurveContinue_curvePoints_bx, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.curvePoints.isBezierXSpecified ); - CHECK_DOUBLES_EQUAL( 13.0, c.curvePoints.bezierX, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.curvePoints.isBezierXSpecified); + CHECK_DOUBLES_EQUAL(13.0, c.curvePoints.bezierX, 0.01); } -T_END +T_END -TEST( parseCurveContinue_curvePoints_by, CurveFunctions ) +TEST(parseCurveContinue_curvePoints_by, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.curvePoints.isBezierYSpecified ); - CHECK_DOUBLES_EQUAL( 14.0, c.curvePoints.bezierY, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.curvePoints.isBezierYSpecified); + CHECK_DOUBLES_EQUAL(14.0, c.curvePoints.bezierY, 0.01); } -T_END +T_END -TEST( parseCurveContinue_curvePoints_bo, CurveFunctions ) +TEST(parseCurveContinue_curvePoints_bo, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.curvePoints.isBezierOffsetSpecified ); - CHECK_EQUAL( 1, c.curvePoints.bezierOffset ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.curvePoints.isBezierOffsetSpecified); + CHECK_EQUAL(1, c.curvePoints.bezierOffset); } -T_END +T_END -TEST( parseCurveContinue_curvePoints_bo2, CurveFunctions ) +TEST(parseCurveContinue_curvePoints_bo2, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.isBezierOffset2Specified ); - CHECK_DOUBLES_EQUAL( 2.0, c.bezierOffset2, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.isBezierOffset2Specified); + CHECK_DOUBLES_EQUAL(2.0, c.bezierOffset2, 0.01); } -T_END +T_END -TEST( parseCurveContinue_bx2, CurveFunctions ) +TEST(parseCurveContinue_bx2, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.isBezierX2Specified ); - CHECK_DOUBLES_EQUAL( 15.0, c.bezierX2, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.isBezierX2Specified); + CHECK_DOUBLES_EQUAL(15.0, c.bezierX2, 0.01); } -T_END +T_END -TEST( parseCurveContinue_by2, CurveFunctions ) +TEST(parseCurveContinue_by2, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.isBezierY2Specified ); - CHECK_DOUBLES_EQUAL( 16.0, c.bezierY2, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.isBezierY2Specified); + CHECK_DOUBLES_EQUAL(16.0, c.bezierY2, 0.01); } -T_END - +T_END -TEST( parseCurveContinue_curvePoints_positionData_x, CurveFunctions ) +TEST(parseCurveContinue_curvePoints_positionData_x, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.curvePoints.positionData.isDefaultXSpecified ); - CHECK_DOUBLES_EQUAL( 3.0, c.curvePoints.positionData.defaultX, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.curvePoints.positionData.isDefaultXSpecified); + CHECK_DOUBLES_EQUAL(3.0, c.curvePoints.positionData.defaultX, 0.01); } -T_END +T_END -TEST( parseCurveContinue_curvePoints_positionData_y, CurveFunctions ) +TEST(parseCurveContinue_curvePoints_positionData_y, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.curvePoints.positionData.isDefaultYSpecified ); - CHECK_DOUBLES_EQUAL( 4.0, c.curvePoints.positionData.defaultY, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.curvePoints.positionData.isDefaultYSpecified); + CHECK_DOUBLES_EQUAL(4.0, c.curvePoints.positionData.defaultY, 0.01); } -T_END +T_END -TEST( parseCurveContinue_curvePoints_positionData_rx, CurveFunctions ) +TEST(parseCurveContinue_curvePoints_positionData_rx, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.curvePoints.positionData.isRelativeXSpecified ); - CHECK_DOUBLES_EQUAL( 5.0, c.curvePoints.positionData.relativeX, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.curvePoints.positionData.isRelativeXSpecified); + CHECK_DOUBLES_EQUAL(5.0, c.curvePoints.positionData.relativeX, 0.01); } -T_END +T_END -TEST( parseCurveContinue_curvePoints_positionData_ry, CurveFunctions ) +TEST(parseCurveContinue_curvePoints_positionData_ry, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveContinue( *e ); - CHECK( c.curvePoints.positionData.isRelativeYSpecified ); - CHECK_DOUBLES_EQUAL( 6.0, c.curvePoints.positionData.relativeY, 0.01 ); + auto c = impl::parseCurveContinue(*e); + CHECK(c.curvePoints.positionData.isRelativeYSpecified); + CHECK_DOUBLES_EQUAL(6.0, c.curvePoints.positionData.relativeY, 0.01); } -T_END +T_END ///////////////////////////////////////////////////////////////////////////////// - -TEST( parseCurveStop_curveType, CurveFunctions ) +TEST(parseCurveStop_curveType, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK( api::CurveType::tie == c.curveType ); + auto c = impl::parseCurveStop(*e); + CHECK(api::CurveType::tie == c.curveType); } -T_END +T_END -TEST( parseCurveStop_numberLevel, CurveFunctions ) +TEST(parseCurveStop_numberLevel, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK_EQUAL( 2, c.numberLevel ); + auto c = impl::parseCurveStop(*e); + CHECK_EQUAL(2, c.numberLevel); } -T_END +T_END -TEST( parseCurveStop_curvePoints_bx, CurveFunctions ) +TEST(parseCurveStop_curvePoints_bx, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK( c.curvePoints.isBezierXSpecified ); - CHECK_DOUBLES_EQUAL( 13.0, c.curvePoints.bezierX, 0.01 ); + auto c = impl::parseCurveStop(*e); + CHECK(c.curvePoints.isBezierXSpecified); + CHECK_DOUBLES_EQUAL(13.0, c.curvePoints.bezierX, 0.01); } -T_END +T_END -TEST( parseCurveStop_curvePoints_by, CurveFunctions ) +TEST(parseCurveStop_curvePoints_by, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK( c.curvePoints.isBezierYSpecified ); - CHECK_DOUBLES_EQUAL( 14.0, c.curvePoints.bezierY, 0.01 ); + auto c = impl::parseCurveStop(*e); + CHECK(c.curvePoints.isBezierYSpecified); + CHECK_DOUBLES_EQUAL(14.0, c.curvePoints.bezierY, 0.01); } -T_END +T_END -TEST( parseCurveStop_curvePoints_bo, CurveFunctions ) +TEST(parseCurveStop_curvePoints_bo, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK( c.curvePoints.isBezierOffsetSpecified ); - CHECK_EQUAL( 1, c.curvePoints.bezierOffset ); + auto c = impl::parseCurveStop(*e); + CHECK(c.curvePoints.isBezierOffsetSpecified); + CHECK_EQUAL(1, c.curvePoints.bezierOffset); } -T_END +T_END -TEST( parseCurveStop_curvePoints_positionData_x, CurveFunctions ) +TEST(parseCurveStop_curvePoints_positionData_x, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK( c.curvePoints.positionData.isDefaultXSpecified ); - CHECK_DOUBLES_EQUAL( 3.0, c.curvePoints.positionData.defaultX, 0.01 ); + auto c = impl::parseCurveStop(*e); + CHECK(c.curvePoints.positionData.isDefaultXSpecified); + CHECK_DOUBLES_EQUAL(3.0, c.curvePoints.positionData.defaultX, 0.01); } -T_END +T_END -TEST( parseCurveStop_curvePoints_positionData_y, CurveFunctions ) +TEST(parseCurveStop_curvePoints_positionData_y, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK( c.curvePoints.positionData.isDefaultYSpecified ); - CHECK_DOUBLES_EQUAL( 4.0, c.curvePoints.positionData.defaultY, 0.01 ); + auto c = impl::parseCurveStop(*e); + CHECK(c.curvePoints.positionData.isDefaultYSpecified); + CHECK_DOUBLES_EQUAL(4.0, c.curvePoints.positionData.defaultY, 0.01); } -T_END +T_END -TEST( parseCurveStop_curvePoints_positionData_rx, CurveFunctions ) +TEST(parseCurveStop_curvePoints_positionData_rx, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK( c.curvePoints.positionData.isRelativeXSpecified ); - CHECK_DOUBLES_EQUAL( 5.0, c.curvePoints.positionData.relativeX, 0.01 ); + auto c = impl::parseCurveStop(*e); + CHECK(c.curvePoints.positionData.isRelativeXSpecified); + CHECK_DOUBLES_EQUAL(5.0, c.curvePoints.positionData.relativeX, 0.01); } -T_END +T_END -TEST( parseCurveStop_curvePoints_positionData_ry, CurveFunctions ) +TEST(parseCurveStop_curvePoints_positionData_ry, CurveFunctions) { using namespace mx::impl; using namespace mx; auto e = seed(); - auto c = impl::parseCurveStop( *e ); - CHECK( c.curvePoints.positionData.isRelativeYSpecified ); - CHECK_DOUBLES_EQUAL( 6.0, c.curvePoints.positionData.relativeY, 0.01 ); + auto c = impl::parseCurveStop(*e); + CHECK(c.curvePoints.positionData.isRelativeYSpecified); + CHECK_DOUBLES_EQUAL(6.0, c.curvePoints.positionData.relativeY, 0.01); } -T_END +T_END ///////////////////////////////////////////////////////////////////////////////// - -TEST( writeAttributesFromCurveStart_type, CurveFunctions ) +TEST(writeAttributesFromCurveStart_type, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( core::StartStopContinue::start == attr.type ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(core::StartStopContinue::start == attr.type); } + T_END -TEST( writeAttributesFromCurveStart_number, CurveFunctions ) +TEST(writeAttributesFromCurveStart_number, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK_EQUAL( 2, attr.number.getValue() ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK_EQUAL(2, attr.number.getValue()); } -T_END +T_END -TEST( writeAttributesFromCurveStart_bezierOffset, CurveFunctions ) +TEST(writeAttributesFromCurveStart_bezierOffset, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasBezierOffset ); - CHECK_DOUBLES_EQUAL( 1.0, attr.bezierOffset.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasBezierOffset); + CHECK_DOUBLES_EQUAL(1.0, attr.bezierOffset.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_bezierX, CurveFunctions ) +TEST(writeAttributesFromCurveStart_bezierX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasBezierX ); - CHECK_DOUBLES_EQUAL( 13.0, attr.bezierX.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasBezierX); + CHECK_DOUBLES_EQUAL(13.0, attr.bezierX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_bezierY, CurveFunctions ) +TEST(writeAttributesFromCurveStart_bezierY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasBezierY ); - CHECK_DOUBLES_EQUAL( 14.0, attr.bezierY.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasBezierY); + CHECK_DOUBLES_EQUAL(14.0, attr.bezierY.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_defaultX, CurveFunctions ) +TEST(writeAttributesFromCurveStart_defaultX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasDefaultX ); - CHECK_DOUBLES_EQUAL( 3.0, attr.defaultX.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasDefaultX); + CHECK_DOUBLES_EQUAL(3.0, attr.defaultX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_defaultY, CurveFunctions ) +TEST(writeAttributesFromCurveStart_defaultY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasDefaultY ); - CHECK_DOUBLES_EQUAL( 4.0, attr.defaultY.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasDefaultY); + CHECK_DOUBLES_EQUAL(4.0, attr.defaultY.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_relativeX, CurveFunctions ) +TEST(writeAttributesFromCurveStart_relativeX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasRelativeX ); - CHECK_DOUBLES_EQUAL( 5.0, attr.relativeX.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasRelativeX); + CHECK_DOUBLES_EQUAL(5.0, attr.relativeX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_relativeY, CurveFunctions ) +TEST(writeAttributesFromCurveStart_relativeY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasRelativeY ); - CHECK_DOUBLES_EQUAL( 6.0, attr.relativeY.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasRelativeY); + CHECK_DOUBLES_EQUAL(6.0, attr.relativeY.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_color, CurveFunctions ) +TEST(writeAttributesFromCurveStart_color, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasColor ); - CHECK_EQUAL( 8, static_cast( attr.color.getRed() ) ); - CHECK_EQUAL( 9, static_cast( attr.color.getGreen() ) ); - CHECK_EQUAL( 10, static_cast( attr.color.getBlue() ) ); - CHECK( core::Color::ColorType::RGB == attr.color.getColorType() ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasColor); + CHECK_EQUAL(8, static_cast(attr.color.getRed())); + CHECK_EQUAL(9, static_cast(attr.color.getGreen())); + CHECK_EQUAL(10, static_cast(attr.color.getBlue())); + CHECK(core::Color::ColorType::RGB == attr.color.getColorType()); } -T_END +T_END -TEST( writeAttributesFromCurveStart_lineType, CurveFunctions ) +TEST(writeAttributesFromCurveStart_lineType, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasLineType ); - CHECK( core::LineType::wavy == attr.lineType ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasLineType); + CHECK(core::LineType::wavy == attr.lineType); } -T_END +T_END -TEST( writeAttributesFromCurveStart_dashLength, CurveFunctions ) +TEST(writeAttributesFromCurveStart_dashLength, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasDashLength ); - CHECK_DOUBLES_EQUAL( 11.0, attr.dashLength.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasDashLength); + CHECK_DOUBLES_EQUAL(11.0, attr.dashLength.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_spaceLength, CurveFunctions ) +TEST(writeAttributesFromCurveStart_spaceLength, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasSpaceLength ); - CHECK_DOUBLES_EQUAL( 12.0, attr.spaceLength.getValue(), 0.01 ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasSpaceLength); + CHECK_DOUBLES_EQUAL(12.0, attr.spaceLength.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStart_placement, CurveFunctions ) +TEST(writeAttributesFromCurveStart_placement, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasPlacement ); - CHECK( core::AboveBelow::below == attr.placement ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasPlacement); + CHECK(core::AboveBelow::below == attr.placement); } -T_END +T_END -TEST( writeAttributesFromCurveStart_orientation, CurveFunctions ) +TEST(writeAttributesFromCurveStart_orientation, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStart( api::CurveType::slur ); - impl::writeAttributesFromCurveStart( c, attr ); - CHECK( attr.hasOrientation ); - CHECK( core::OverUnder::over == attr.orientation ); + auto c = seedStart(api::CurveType::slur); + impl::writeAttributesFromCurveStart(c, attr); + CHECK(attr.hasOrientation); + CHECK(core::OverUnder::over == attr.orientation); } -T_END +T_END ///////////////////////////////////////////////////////////////////////////////// - -TEST( writeAttributesFromCurveContinue_type, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_type, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( core::StartStopContinue::continue_ == attr.type ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(core::StartStopContinue::continue_ == attr.type); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_number, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_number, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK_EQUAL( 2, attr.number.getValue() ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK_EQUAL(2, attr.number.getValue()); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_bezierOffset, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_bezierOffset, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasBezierOffset ); - CHECK_DOUBLES_EQUAL( 1.0, attr.bezierOffset.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasBezierOffset); + CHECK_DOUBLES_EQUAL(1.0, attr.bezierOffset.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_bezierX, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_bezierX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasBezierX ); - CHECK_DOUBLES_EQUAL( 13.0, attr.bezierX.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasBezierX); + CHECK_DOUBLES_EQUAL(13.0, attr.bezierX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_bezierY, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_bezierY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasBezierY ); - CHECK_DOUBLES_EQUAL( 14.0, attr.bezierY.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasBezierY); + CHECK_DOUBLES_EQUAL(14.0, attr.bezierY.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_defaultX, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_defaultX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasDefaultX ); - CHECK_DOUBLES_EQUAL( 3.0, attr.defaultX.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasDefaultX); + CHECK_DOUBLES_EQUAL(3.0, attr.defaultX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_defaultY, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_defaultY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasDefaultY ); - CHECK_DOUBLES_EQUAL( 4.0, attr.defaultY.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasDefaultY); + CHECK_DOUBLES_EQUAL(4.0, attr.defaultY.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_relativeX, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_relativeX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasRelativeX ); - CHECK_DOUBLES_EQUAL( 5.0, attr.relativeX.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasRelativeX); + CHECK_DOUBLES_EQUAL(5.0, attr.relativeX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_relativeY, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_relativeY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasRelativeY ); - CHECK_DOUBLES_EQUAL( 6.0, attr.relativeY.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasRelativeY); + CHECK_DOUBLES_EQUAL(6.0, attr.relativeY.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_bezierX2, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_bezierX2, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasBezierX2 ); - CHECK_DOUBLES_EQUAL( 100.0, attr.bezierX2.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasBezierX2); + CHECK_DOUBLES_EQUAL(100.0, attr.bezierX2.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_bezierY2, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_bezierY2, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasBezierY2 ); - CHECK_DOUBLES_EQUAL( 101.0, attr.bezierY2.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasBezierY2); + CHECK_DOUBLES_EQUAL(101.0, attr.bezierY2.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveContinue_bezierOffset2, CurveFunctions ) +TEST(writeAttributesFromCurveContinue_bezierOffset2, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedContinue( api::CurveType::slur ); - impl::writeAttributesFromCurveContinue( c, attr ); - CHECK( attr.hasBezierOffset2 ); - CHECK_DOUBLES_EQUAL( 102.0, attr.bezierOffset2.getValue(), 0.01 ); + auto c = seedContinue(api::CurveType::slur); + impl::writeAttributesFromCurveContinue(c, attr); + CHECK(attr.hasBezierOffset2); + CHECK_DOUBLES_EQUAL(102.0, attr.bezierOffset2.getValue(), 0.01); } -T_END +T_END ///////////////////////////////////////////////////////////////////////////////// - -TEST( writeAttributesFromCurveStop_type, CurveFunctions ) +TEST(writeAttributesFromCurveStop_type, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK( core::StartStopContinue::stop == attr.type ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK(core::StartStopContinue::stop == attr.type); } -T_END +T_END -TEST( writeAttributesFromCurveStop_number, CurveFunctions ) +TEST(writeAttributesFromCurveStop_number, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK_EQUAL( 2, attr.number.getValue() ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK_EQUAL(2, attr.number.getValue()); } -T_END +T_END -TEST( writeAttributesFromCurveStop_bezierOffset, CurveFunctions ) +TEST(writeAttributesFromCurveStop_bezierOffset, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK( attr.hasBezierOffset ); - CHECK_DOUBLES_EQUAL( 1.0, attr.bezierOffset.getValue(), 0.01 ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK(attr.hasBezierOffset); + CHECK_DOUBLES_EQUAL(1.0, attr.bezierOffset.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStop_bezierX, CurveFunctions ) +TEST(writeAttributesFromCurveStop_bezierX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK( attr.hasBezierX ); - CHECK_DOUBLES_EQUAL( 13.0, attr.bezierX.getValue(), 0.01 ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK(attr.hasBezierX); + CHECK_DOUBLES_EQUAL(13.0, attr.bezierX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStop_bezierY, CurveFunctions ) +TEST(writeAttributesFromCurveStop_bezierY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK( attr.hasBezierY ); - CHECK_DOUBLES_EQUAL( 14.0, attr.bezierY.getValue(), 0.01 ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK(attr.hasBezierY); + CHECK_DOUBLES_EQUAL(14.0, attr.bezierY.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStop_defaultX, CurveFunctions ) +TEST(writeAttributesFromCurveStop_defaultX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK( attr.hasDefaultX ); - CHECK_DOUBLES_EQUAL( 3.0, attr.defaultX.getValue(), 0.01 ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK(attr.hasDefaultX); + CHECK_DOUBLES_EQUAL(3.0, attr.defaultX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStop_defaultY, CurveFunctions ) +TEST(writeAttributesFromCurveStop_defaultY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK( attr.hasDefaultY ); - CHECK_DOUBLES_EQUAL( 4.0, attr.defaultY.getValue(), 0.01 ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK(attr.hasDefaultY); + CHECK_DOUBLES_EQUAL(4.0, attr.defaultY.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStop_relativeX, CurveFunctions ) +TEST(writeAttributesFromCurveStop_relativeX, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK( attr.hasRelativeX ); - CHECK_DOUBLES_EQUAL( 5.0, attr.relativeX.getValue(), 0.01 ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK(attr.hasRelativeX); + CHECK_DOUBLES_EQUAL(5.0, attr.relativeX.getValue(), 0.01); } -T_END +T_END -TEST( writeAttributesFromCurveStop_relativeY, CurveFunctions ) +TEST(writeAttributesFromCurveStop_relativeY, CurveFunctions) { using namespace mx::impl; using namespace mx; core::SlurAttributes attr; - auto c = seedStop( api::CurveType::slur ); - impl::writeAttributesFromCurveStop( c, attr ); - CHECK( attr.hasRelativeY ); - CHECK_DOUBLES_EQUAL( 6.0, attr.relativeY.getValue(), 0.01 ); + auto c = seedStop(api::CurveType::slur); + impl::writeAttributesFromCurveStop(c, attr); + CHECK(attr.hasRelativeY); + CHECK_DOUBLES_EQUAL(6.0, attr.relativeY.getValue(), 0.01); } -T_END +T_END #endif diff --git a/Sourcecode/private/mxtest/impl/DirectionReaderTest.cpp b/Sourcecode/private/mxtest/impl/DirectionReaderTest.cpp index cbf3c8372..aa10ccef2 100644 --- a/Sourcecode/private/mxtest/impl/DirectionReaderTest.cpp +++ b/Sourcecode/private/mxtest/impl/DirectionReaderTest.cpp @@ -6,116 +6,116 @@ #ifdef MX_COMPILE_IMPL_TESTS #include "cpul/cpulTestHarness.h" -#include "mx/impl/DirectionReader.h" +#include "mx/api/OttavaData.h" #include "mx/core/elements/Direction.h" #include "mx/core/elements/DirectionType.h" -#include "mx/api/OttavaData.h" #include "mx/core/elements/OctaveShift.h" +#include "mx/impl/DirectionReader.h" #include using namespace mx; using namespace mx::impl; -TEST( ottavaStart15mb, DirectionReader ) +TEST(ottavaStart15mb, DirectionReader) { const int tickTimePosition = 150; auto dir = core::makeDirection(); - CHECK_EQUAL( 1, dir->getDirectionTypeSet().size() ); + CHECK_EQUAL(1, dir->getDirectionTypeSet().size()); auto dirType = dir->getDirectionTypeSet().front(); - dirType->setChoice( core::DirectionType::Choice::octaveShift ); + dirType->setChoice(core::DirectionType::Choice::octaveShift); auto oct = dirType->getOctaveShift(); auto attr = oct->getAttributes(); attr->type = core::UpDownStopContinue::down; attr->hasSize = true; - attr->size = core::PositiveInteger{ 15 }; - Cursor cursor{ 1, 100 }; + attr->size = core::PositiveInteger{15}; + Cursor cursor{1, 100}; cursor.tickTimePosition = tickTimePosition; - DirectionReader reader{ dir, cursor }; + DirectionReader reader{dir, cursor}; auto directionData = reader.getDirectionData(); - CHECK_EQUAL( 1, directionData.ottavaStarts.size() ); - const auto& ottavaStart = directionData.ottavaStarts.front(); - CHECK_EQUAL( tickTimePosition, ottavaStart.spannerStart.tickTimePosition ); - CHECK( api::OttavaType::o15mb == ottavaStart.ottavaType ); + CHECK_EQUAL(1, directionData.ottavaStarts.size()); + const auto &ottavaStart = directionData.ottavaStarts.front(); + CHECK_EQUAL(tickTimePosition, ottavaStart.spannerStart.tickTimePosition); + CHECK(api::OttavaType::o15mb == ottavaStart.ottavaType); } -T_END +T_END -TEST( ottavaStart8vaAnd8vb, DirectionReader ) +TEST(ottavaStart8vaAnd8vb, DirectionReader) { const int tickTimePosition = 199; - + // add an 8va start auto dir = core::makeDirection(); - CHECK_EQUAL( 1, dir->getDirectionTypeSet().size() ); + CHECK_EQUAL(1, dir->getDirectionTypeSet().size()); auto dirType = dir->getDirectionTypeSet().front(); - dirType->setChoice( core::DirectionType::Choice::octaveShift ); + dirType->setChoice(core::DirectionType::Choice::octaveShift); auto oct = dirType->getOctaveShift(); auto attr = oct->getAttributes(); attr->type = core::UpDownStopContinue::up; attr->hasSize = true; - attr->size = core::PositiveInteger{ 8 }; + attr->size = core::PositiveInteger{8}; // add a phantom "continue" which should be ignored by our code dirType = core::makeDirectionType(); - dirType->setChoice( core::DirectionType::Choice::octaveShift ); - dir->addDirectionType( dirType ); + dirType->setChoice(core::DirectionType::Choice::octaveShift); + dir->addDirectionType(dirType); oct = dirType->getOctaveShift(); attr = oct->getAttributes(); attr->type = core::UpDownStopContinue::continue_; // add an 8vb but rely on the default 'size' dirType = core::makeDirectionType(); - dirType->setChoice( core::DirectionType::Choice::octaveShift ); - dir->addDirectionType( dirType ); + dirType->setChoice(core::DirectionType::Choice::octaveShift); + dir->addDirectionType(dirType); oct = dirType->getOctaveShift(); attr = oct->getAttributes(); attr->type = core::UpDownStopContinue::down; attr->hasNumber = true; - attr->number = core::NumberLevel{ 3 }; + attr->number = core::NumberLevel{3}; - Cursor cursor{ 1, 111 }; + Cursor cursor{1, 111}; cursor.tickTimePosition = tickTimePosition; - DirectionReader reader{ dir, cursor }; + DirectionReader reader{dir, cursor}; auto directionData = reader.getDirectionData(); - - CHECK_EQUAL( 2, directionData.ottavaStarts.size() ); + + CHECK_EQUAL(2, directionData.ottavaStarts.size()); auto ottavaStart = directionData.ottavaStarts.front(); - - CHECK_EQUAL( tickTimePosition, ottavaStart.spannerStart.tickTimePosition ); - CHECK( api::OttavaType::o8va == ottavaStart.ottavaType ); - CHECK_EQUAL( -1, ottavaStart.spannerStart.numberLevel ); - - ottavaStart = directionData.ottavaStarts.at( 1 ); - CHECK_EQUAL( tickTimePosition, ottavaStart.spannerStart.tickTimePosition ); - CHECK( api::OttavaType::o8vb == ottavaStart.ottavaType ); - CHECK_EQUAL( 3, ottavaStart.spannerStart.numberLevel ); + + CHECK_EQUAL(tickTimePosition, ottavaStart.spannerStart.tickTimePosition); + CHECK(api::OttavaType::o8va == ottavaStart.ottavaType); + CHECK_EQUAL(-1, ottavaStart.spannerStart.numberLevel); + + ottavaStart = directionData.ottavaStarts.at(1); + CHECK_EQUAL(tickTimePosition, ottavaStart.spannerStart.tickTimePosition); + CHECK(api::OttavaType::o8vb == ottavaStart.ottavaType); + CHECK_EQUAL(3, ottavaStart.spannerStart.numberLevel); } -T_END +T_END -TEST( ottavaStop, DirectionReader ) +TEST(ottavaStop, DirectionReader) { const int tickTimePosition = 150; auto dir = core::makeDirection(); - CHECK_EQUAL( 1, dir->getDirectionTypeSet().size() ); + CHECK_EQUAL(1, dir->getDirectionTypeSet().size()); auto dirType = dir->getDirectionTypeSet().front(); - dirType->setChoice( core::DirectionType::Choice::octaveShift ); + dirType->setChoice(core::DirectionType::Choice::octaveShift); auto oct = dirType->getOctaveShift(); auto attr = oct->getAttributes(); attr->type = core::UpDownStopContinue::stop; attr->hasSize = true; - attr->size = core::PositiveInteger{ 15 }; - Cursor cursor{ 1, 100 }; + attr->size = core::PositiveInteger{15}; + Cursor cursor{1, 100}; cursor.tickTimePosition = tickTimePosition; - DirectionReader reader{ dir, cursor }; + DirectionReader reader{dir, cursor}; auto directionData = reader.getDirectionData(); - CHECK_EQUAL( 1, directionData.ottavaStops.size() ); - const auto& ottavaStop = directionData.ottavaStops.front(); - CHECK_EQUAL( tickTimePosition, ottavaStop.tickTimePosition ); - CHECK_EQUAL( -1, ottavaStop.numberLevel ); + CHECK_EQUAL(1, directionData.ottavaStops.size()); + const auto &ottavaStop = directionData.ottavaStops.front(); + CHECK_EQUAL(tickTimePosition, ottavaStop.tickTimePosition); + CHECK_EQUAL(-1, ottavaStop.numberLevel); } -T_END +T_END #endif diff --git a/Sourcecode/private/mxtest/impl/DirectionWriterTest.cpp b/Sourcecode/private/mxtest/impl/DirectionWriterTest.cpp index 877fa29cc..0ab623f33 100644 --- a/Sourcecode/private/mxtest/impl/DirectionWriterTest.cpp +++ b/Sourcecode/private/mxtest/impl/DirectionWriterTest.cpp @@ -6,43 +6,43 @@ #ifdef MX_COMPILE_IMPL_TESTS #include "cpul/cpulTestHarness.h" -#include "mx/impl/DirectionWriter.h" +#include "mx/api/OttavaData.h" #include "mx/core/elements/Direction.h" #include "mx/core/elements/DirectionType.h" -#include "mx/api/OttavaData.h" -#include "mx/core/elements/OctaveShift.h" #include "mx/core/elements/MusicDataChoice.h" +#include "mx/core/elements/OctaveShift.h" +#include "mx/impl/DirectionWriter.h" #include using namespace mx; using namespace mx::impl; -TEST( ottavaStartStop, DirectionWriter ) +TEST(ottavaStartStop, DirectionWriter) { - Cursor cursor{ 1, 100 }; + Cursor cursor{1, 100}; cursor.isFirstMeasureInPart = false; api::DirectionData directionData; - - directionData.ottavaStops.emplace_back( api::SpannerStop{} ); - auto& stop = directionData.ottavaStops.back(); + + directionData.ottavaStops.emplace_back(api::SpannerStop{}); + auto &stop = directionData.ottavaStops.back(); stop.numberLevel = 2; - - directionData.ottavaStarts.emplace_back( api::OttavaStart{} ); - auto& start = directionData.ottavaStarts.back(); + + directionData.ottavaStarts.emplace_back(api::OttavaStart{}); + auto &start = directionData.ottavaStarts.back(); start.ottavaType = api::OttavaType::o15mb; start.spannerStart.positionData.isDefaultXSpecified = true; start.spannerStart.positionData.defaultX = 100.0; - - DirectionWriter writer{ directionData, cursor }; + + DirectionWriter writer{directionData, cursor}; const auto mdcSet = writer.getDirectionLikeThings(); - CHECK( mdcSet.front()->getChoice() == core::MusicDataChoice::Choice::direction ); + CHECK(mdcSet.front()->getChoice() == core::MusicDataChoice::Choice::direction); const auto direction = mdcSet.front()->getDirection(); - const auto& directionTypes = direction->getDirectionTypeSet(); - - CHECK_EQUAL( 2, directionTypes.size() ); + const auto &directionTypes = direction->getDirectionTypeSet(); + + CHECK_EQUAL(2, directionTypes.size()); } -T_END +T_END #endif diff --git a/Sourcecode/private/mxtest/impl/MagicTemplatesTest.cpp b/Sourcecode/private/mxtest/impl/MagicTemplatesTest.cpp index a0c8d79f3..76ea255a1 100644 --- a/Sourcecode/private/mxtest/impl/MagicTemplatesTest.cpp +++ b/Sourcecode/private/mxtest/impl/MagicTemplatesTest.cpp @@ -6,11 +6,11 @@ #ifdef MX_COMPILE_IMPL_TESTS #include "cpul/cpulTestHarness.h" -#include "mx/impl/DirectionWriter.h" +#include "mx/api/OttavaData.h" #include "mx/core/elements/Direction.h" #include "mx/core/elements/DirectionType.h" -#include "mx/api/OttavaData.h" #include "mx/core/elements/OctaveShift.h" +#include "mx/impl/DirectionWriter.h" #include diff --git a/Sourcecode/private/mxtest/impl/MeasureWriterTest.cpp b/Sourcecode/private/mxtest/impl/MeasureWriterTest.cpp index 98c3e3309..2d6bd82ac 100644 --- a/Sourcecode/private/mxtest/impl/MeasureWriterTest.cpp +++ b/Sourcecode/private/mxtest/impl/MeasureWriterTest.cpp @@ -5,17 +5,17 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_IMPL_TESTS -#include "mx/impl/MeasureWriter.h" -#include "mx/impl/ScoreWriter.h" -#include "mx/core/elements/MusicDataChoice.h" -#include "mx/core/elements/MusicDataGroup.h" -#include "mx/core/elements/Properties.h" +#include "cpul/cpulTestHarness.h" #include "mx/core/elements/Barline.h" -#include "mx/core/elements/Note.h" -#include "mx/core/elements/Divisions.h" #include "mx/core/elements/Clef.h" +#include "mx/core/elements/Divisions.h" #include "mx/core/elements/Line.h" -#include "cpul/cpulTestHarness.h" +#include "mx/core/elements/MusicDataChoice.h" +#include "mx/core/elements/MusicDataGroup.h" +#include "mx/core/elements/Note.h" +#include "mx/core/elements/Properties.h" +#include "mx/impl/MeasureWriter.h" +#include "mx/impl/ScoreWriter.h" #include @@ -26,173 +26,172 @@ using namespace mx::impl; namespace mxtest { - struct TestItems - { - std::unique_ptr scoreData; - std::unique_ptr scoreWriter; - api::MeasureData* measureData; - std::unique_ptr measureCursor; - std::unique_ptr measureWriter; - }; - - struct TestParameters - { - int ticksPerQuarter; - int measureIndex; - int partIndex; - int numStaves; - }; - - TestItems setupTestItems( TestParameters params ) +struct TestItems +{ + std::unique_ptr scoreData; + std::unique_ptr scoreWriter; + api::MeasureData *measureData; + std::unique_ptr measureCursor; + std::unique_ptr measureWriter; +}; + +struct TestParameters +{ + int ticksPerQuarter; + int measureIndex; + int partIndex; + int numStaves; +}; + +TestItems setupTestItems(TestParameters params) +{ + TestItems t; + t.scoreData = std::make_unique(); + t.scoreData->ticksPerQuarter = params.ticksPerQuarter; + t.scoreData->parts.resize(params.partIndex + 1); + int pindex = 0; + for (auto &p : t.scoreData->parts) { - TestItems t; - t.scoreData = std::make_unique(); - t.scoreData->ticksPerQuarter = params.ticksPerQuarter; - t.scoreData->parts.resize( params.partIndex + 1 ); - int pindex = 0; - for( auto& p : t.scoreData->parts ) + p.measures.resize(params.measureIndex + 1); + int mindex = 0; + for (auto &m : p.measures) { - p.measures.resize( params.measureIndex + 1 ); - int mindex = 0; - for( auto& m : p.measures ) + m.staves.resize(params.numStaves); + if (pindex == params.partIndex && mindex == params.measureIndex) { - m.staves.resize( params.numStaves ); - if( pindex == params.partIndex && mindex == params.measureIndex ) - { - t.measureData = &m; - } - ++mindex; + t.measureData = &m; } - ++pindex; + ++mindex; } - t.scoreWriter = std::make_unique( *t.scoreData ); - t.measureCursor = std::make_unique( static_cast( t.measureData->staves.size() ), params.ticksPerQuarter ); - t.measureCursor->partIndex = params.partIndex; - t.measureCursor->measureIndex = params.measureIndex; - t.measureWriter = std::make_unique( *t.measureData, *t.measureCursor, *t.scoreWriter ); - return t; + ++pindex; } + t.scoreWriter = std::make_unique(*t.scoreData); + t.measureCursor = + std::make_unique(static_cast(t.measureData->staves.size()), params.ticksPerQuarter); + t.measureCursor->partIndex = params.partIndex; + t.measureCursor->measureIndex = params.measureIndex; + t.measureWriter = std::make_unique(*t.measureData, *t.measureCursor, *t.scoreWriter); + return t; } +} // namespace mxtest - -TEST( measureNumber, MeasureWriter ) +TEST(measureNumber, MeasureWriter) { mxtest::TestParameters params; params.ticksPerQuarter = 100; params.measureIndex = 3; params.partIndex = 4; params.numStaves = 2; - mxtest::TestItems t = mxtest::setupTestItems( params ); + mxtest::TestItems t = mxtest::setupTestItems(params); const auto partwiseMeasure = t.measureWriter->getPartwiseMeasure(); const auto expected = "4"; const auto actual = partwiseMeasure->getAttributes()->number.getValue(); - CHECK_EQUAL( expected, actual ); + CHECK_EQUAL(expected, actual); } -T_END +T_END -TEST( measureNumberString, MeasureWriter ) +TEST(measureNumberString, MeasureWriter) { mxtest::TestParameters params; params.ticksPerQuarter = 101; params.measureIndex = 0; params.partIndex = 0; params.numStaves = 1; - mxtest::TestItems t = mxtest::setupTestItems( params ); + mxtest::TestItems t = mxtest::setupTestItems(params); t.measureData->number = "hello"; const auto partwiseMeasure = t.measureWriter->getPartwiseMeasure(); const auto expected = "hello"; const auto actual = partwiseMeasure->getAttributes()->number.getValue(); - CHECK_EQUAL( expected, actual ); + CHECK_EQUAL(expected, actual); } -T_END +T_END -TEST( leftBarlineFirstNoteRequiresForward, MeasureWriter ) +TEST(leftBarlineFirstNoteRequiresForward, MeasureWriter) { mxtest::TestParameters params; params.ticksPerQuarter = 101; params.measureIndex = 0; params.partIndex = 0; params.numStaves = 1; - mxtest::TestItems t = mxtest::setupTestItems( params ); - t.measureData->barlines.emplace_back( api::BarlineData{} ); - auto& barline = t.measureData->barlines.front(); + mxtest::TestItems t = mxtest::setupTestItems(params); + t.measureData->barlines.emplace_back(api::BarlineData{}); + auto &barline = t.measureData->barlines.front(); barline.barlineType = api::BarlineType::heavyLight; - auto& staff = t.measureData->staves.at( 0 ); - auto& voice = staff.voices[0]; - voice.notes.emplace_back( api::NoteData{} ); - auto& note = voice.notes.back(); + auto &staff = t.measureData->staves.at(0); + auto &voice = staff.voices[0]; + voice.notes.emplace_back(api::NoteData{}); + auto ¬e = voice.notes.back(); note.tickTimePosition = 101; - - + const auto partwiseMeasure = t.measureWriter->getPartwiseMeasure(); auto mdcIter = partwiseMeasure->getMusicDataGroup()->getMusicDataChoiceSet().cbegin(); auto mdcEnd = partwiseMeasure->getMusicDataGroup()->getMusicDataChoiceSet().cend(); - CHECK( mdcIter != mdcEnd ); - + CHECK(mdcIter != mdcEnd); + auto choice = (*mdcIter)->getChoice(); - CHECK( choice == core::MusicDataChoice::Choice::barline ); + CHECK(choice == core::MusicDataChoice::Choice::barline); - CHECK( ++mdcIter != mdcEnd ); + CHECK(++mdcIter != mdcEnd); choice = (*mdcIter)->getChoice(); - CHECK( choice == core::MusicDataChoice::Choice::properties ); + CHECK(choice == core::MusicDataChoice::Choice::properties); - CHECK( ++mdcIter != mdcEnd ); + CHECK(++mdcIter != mdcEnd); choice = (*mdcIter)->getChoice(); - CHECK( choice == core::MusicDataChoice::Choice::forward ); + CHECK(choice == core::MusicDataChoice::Choice::forward); - CHECK( ++mdcIter != mdcEnd ); + CHECK(++mdcIter != mdcEnd); choice = (*mdcIter)->getChoice(); - CHECK( choice == core::MusicDataChoice::Choice::note ); - - CHECK( ++mdcIter == mdcEnd ); + CHECK(choice == core::MusicDataChoice::Choice::note); + CHECK(++mdcIter == mdcEnd); } -T_END +T_END -TEST( PropertiesButNoNotes, MeasureWriter ) +TEST(PropertiesButNoNotes, MeasureWriter) { mxtest::TestParameters params; params.ticksPerQuarter = 101; params.measureIndex = 0; params.partIndex = 0; params.numStaves = 1; - mxtest::TestItems t = mxtest::setupTestItems( params ); - t.measureData->barlines.emplace_back( api::BarlineData{} ); - auto& barline = t.measureData->barlines.front(); + mxtest::TestItems t = mxtest::setupTestItems(params); + t.measureData->barlines.emplace_back(api::BarlineData{}); + auto &barline = t.measureData->barlines.front(); barline.barlineType = api::BarlineType::heavyLight; - auto& staff = t.measureData->staves.at( 0 ); - staff.clefs.emplace_back( api::ClefData{} ); - auto& clef = staff.clefs.back(); + auto &staff = t.measureData->staves.at(0); + staff.clefs.emplace_back(api::ClefData{}); + auto &clef = staff.clefs.back(); clef.symbol = api::ClefSymbol::percussion; clef.line = 2; clef.tickTimePosition = 101; - + const auto partwiseMeasure = t.measureWriter->getPartwiseMeasure(); auto mdcIter = partwiseMeasure->getMusicDataGroup()->getMusicDataChoiceSet().cbegin(); auto mdcEnd = partwiseMeasure->getMusicDataGroup()->getMusicDataChoiceSet().cend(); - CHECK( mdcIter != mdcEnd ); - + CHECK(mdcIter != mdcEnd); + auto choice = (*mdcIter)->getChoice(); - CHECK( choice == core::MusicDataChoice::Choice::barline ); - - CHECK( ++mdcIter != mdcEnd ); + CHECK(choice == core::MusicDataChoice::Choice::barline); + + CHECK(++mdcIter != mdcEnd); choice = (*mdcIter)->getChoice(); - CHECK( choice == core::MusicDataChoice::Choice::properties ); + CHECK(choice == core::MusicDataChoice::Choice::properties); auto props = (*mdcIter)->getProperties(); - CHECK( props->getHasDivisions() ); - CHECK_DOUBLES_EQUAL( 101.0, props->getDivisions()->getValue().getValue(), 0.01 ); - - CHECK_EQUAL( 1, props->getClefSet().size() ); - CHECK( props->getClefSet().back()->getAttributes()->hasNumber ); - CHECK( 1 == props->getClefSet().back()->getAttributes()->number.getValue() ); - - CHECK( ++mdcIter == mdcEnd ); + CHECK(props->getHasDivisions()); + CHECK_DOUBLES_EQUAL(101.0, props->getDivisions()->getValue().getValue(), 0.01); + + CHECK_EQUAL(1, props->getClefSet().size()); + CHECK(props->getClefSet().back()->getAttributes()->hasNumber); + CHECK(1 == props->getClefSet().back()->getAttributes()->number.getValue()); + + CHECK(++mdcIter == mdcEnd); } + T_END #endif diff --git a/Sourcecode/private/mxtest/impl/PositionFunctionsTest.cpp b/Sourcecode/private/mxtest/impl/PositionFunctionsTest.cpp index 712d7449a..f2554bacb 100644 --- a/Sourcecode/private/mxtest/impl/PositionFunctionsTest.cpp +++ b/Sourcecode/private/mxtest/impl/PositionFunctionsTest.cpp @@ -6,73 +6,75 @@ #ifdef MX_COMPILE_IMPL_TESTS #include "cpul/cpulTestHarness.h" -#include "mx/impl/PositionFunctions.h" #include "mx/core/elements/BracketAttributes.h" #include "mx/core/elements/CreditWordsAttributes.h" #include "mx/core/elements/DirectionAttributes.h" +#include "mx/impl/PositionFunctions.h" using namespace mx; using namespace mx::impl; -TEST( setAttributesFromPositionDataBracket, PositionFunctions ) +TEST(setAttributesFromPositionDataBracket, PositionFunctions) { core::BracketAttributes attr; api::PositionData positionData; - + positionData.isDefaultXSpecified = true; positionData.defaultX = 0.1; positionData.isDefaultYSpecified = true; positionData.defaultY = 0.2; - + positionData.isRelativeXSpecified = true; positionData.relativeX = 0.3; positionData.isRelativeYSpecified = true; positionData.relativeY = 0.4; - - impl::setAttributesFromPositionData( positionData, attr ); - - CHECK( attr.hasDefaultX ); - CHECK_DOUBLES_EQUAL( 0.1, attr.defaultX.getValue(), 0.0001 ); - - CHECK( attr.hasDefaultY ); - CHECK_DOUBLES_EQUAL( 0.2, attr.defaultY.getValue(), 0.0001 ); - - CHECK( attr.hasRelativeX ); - CHECK_DOUBLES_EQUAL( 0.3, attr.relativeX.getValue(), 0.0001 ); - - CHECK( attr.hasRelativeY ); - CHECK_DOUBLES_EQUAL( 0.4, attr.relativeY.getValue(), 0.0001 ); -} -T_END + impl::setAttributesFromPositionData(positionData, attr); + + CHECK(attr.hasDefaultX); + CHECK_DOUBLES_EQUAL(0.1, attr.defaultX.getValue(), 0.0001); + + CHECK(attr.hasDefaultY); + CHECK_DOUBLES_EQUAL(0.2, attr.defaultY.getValue(), 0.0001); + + CHECK(attr.hasRelativeX); + CHECK_DOUBLES_EQUAL(0.3, attr.relativeX.getValue(), 0.0001); + + CHECK(attr.hasRelativeY); + CHECK_DOUBLES_EQUAL(0.4, attr.relativeY.getValue(), 0.0001); +} -class TotallyBogusClassToTestSetAttributesFromPositionData {}; +T_END +class TotallyBogusClassToTestSetAttributesFromPositionData +{ +}; -TEST( setAttributesFromPositionDataFakeClass, PositionFunctions ) +TEST(setAttributesFromPositionDataFakeClass, PositionFunctions) { TotallyBogusClassToTestSetAttributesFromPositionData fake; api::PositionData positionData; - impl::setAttributesFromPositionData( positionData, fake ); - + impl::setAttributesFromPositionData(positionData, fake); + // only check that it compiles - CHECK( true ); + CHECK(true); } -T_END +T_END -TEST( setAttributesFromPositionDataDirectionAttributes, PositionFunctions ) +TEST(setAttributesFromPositionDataDirectionAttributes, PositionFunctions) { core::DirectionAttributes attr; api::PositionData positionData; - + positionData.placement = api::Placement::below; - - impl::setAttributesFromPositionData( positionData, attr ); - - CHECK( attr.hasPlacement ); - CHECK( attr.placement == core::AboveBelow::below ); + + impl::setAttributesFromPositionData(positionData, attr); + + CHECK(attr.hasPlacement); + CHECK(attr.placement == core::AboveBelow::below); } + T_END #endif diff --git a/Sourcecode/private/mxtest/impl/PrintFunctionsTest.cpp b/Sourcecode/private/mxtest/impl/PrintFunctionsTest.cpp index 56affe9a0..4a98eabb6 100644 --- a/Sourcecode/private/mxtest/impl/PrintFunctionsTest.cpp +++ b/Sourcecode/private/mxtest/impl/PrintFunctionsTest.cpp @@ -6,79 +6,76 @@ #ifdef MX_COMPILE_IMPL_TESTS - #include "cpul/cpulTestHarness.h" - #include "mx/impl/PrintFunctions.h" - #include "mx/core/elements/FermataAttributes.h" - #include "mx/core/elements/DynamicsAttributes.h" +#include "cpul/cpulTestHarness.h" +#include "mx/core/elements/DynamicsAttributes.h" +#include "mx/core/elements/FermataAttributes.h" +#include "mx/impl/PrintFunctions.h" using namespace mx; using namespace mx::impl; -TEST( getColor, PrintFunctions ) +TEST(getColor, PrintFunctions) { core::FermataAttributes attr; attr.hasColor = true; - attr.color.setRed( 1 ); - attr.color.setGreen( 2 ); - attr.color.setBlue( 3 ); - attr.color.setColorType( core::Color::ColorType::RGB ); - auto printData = impl::getPrintData( attr ); + attr.color.setRed(1); + attr.color.setGreen(2); + attr.color.setBlue(3); + attr.color.setColorType(core::Color::ColorType::RGB); + auto printData = impl::getPrintData(attr); auto colorData = printData.color; - CHECK( printData.isColorSpecified ); - CHECK( !colorData.isAlphaSpecified ); - CHECK_EQUAL( static_cast( 1 ), static_cast( colorData.red ) ); - CHECK_EQUAL( static_cast( 2 ), static_cast( colorData.green ) ); - CHECK_EQUAL( static_cast( 3 ), static_cast( colorData.blue ) ); + CHECK(printData.isColorSpecified); + CHECK(!colorData.isAlphaSpecified); + CHECK_EQUAL(static_cast(1), static_cast(colorData.red)); + CHECK_EQUAL(static_cast(2), static_cast(colorData.green)); + CHECK_EQUAL(static_cast(3), static_cast(colorData.blue)); } T_END - -TEST( getColorAlpha, PrintFunctions ) +TEST(getColorAlpha, PrintFunctions) { core::FermataAttributes attr; attr.hasColor = true; - attr.color.setRed( 4 ); - attr.color.setGreen( 3 ); - attr.color.setBlue( 2 ); - attr.color.setColorType( core::Color::ColorType::ARGB ); - attr.color.setAlpha( 1 ); - auto printData = impl::getPrintData( attr ); + attr.color.setRed(4); + attr.color.setGreen(3); + attr.color.setBlue(2); + attr.color.setColorType(core::Color::ColorType::ARGB); + attr.color.setAlpha(1); + auto printData = impl::getPrintData(attr); auto colorData = printData.color; - CHECK( printData.isColorSpecified ); - CHECK( colorData.isAlphaSpecified ); - CHECK_EQUAL( static_cast( 4 ), static_cast( colorData.red ) ); - CHECK_EQUAL( static_cast( 3 ), static_cast( colorData.green ) ); - CHECK_EQUAL( static_cast( 2 ), static_cast( colorData.blue ) ); - CHECK_EQUAL( static_cast( 1 ), static_cast( colorData.alpha ) ); + CHECK(printData.isColorSpecified); + CHECK(colorData.isAlphaSpecified); + CHECK_EQUAL(static_cast(4), static_cast(colorData.red)); + CHECK_EQUAL(static_cast(3), static_cast(colorData.green)); + CHECK_EQUAL(static_cast(2), static_cast(colorData.blue)); + CHECK_EQUAL(static_cast(1), static_cast(colorData.alpha)); } T_END - -TEST( getColorFalse, PrintFunctions ) +TEST(getColorFalse, PrintFunctions) { core::FermataAttributes attr; attr.hasColor = false; - attr.color.setRed( 4 ); - attr.color.setGreen( 3 ); - attr.color.setBlue( 2 ); - attr.color.setColorType( core::Color::ColorType::ARGB ); - attr.color.setAlpha( 1 ); - auto printData = impl::getPrintData( attr ); + attr.color.setRed(4); + attr.color.setGreen(3); + attr.color.setBlue(2); + attr.color.setColorType(core::Color::ColorType::ARGB); + attr.color.setAlpha(1); + auto printData = impl::getPrintData(attr); auto colorData = printData.color; - CHECK( !printData.isColorSpecified ); - CHECK( !colorData.isAlphaSpecified ); - CHECK_EQUAL( static_cast( 255 ), static_cast( colorData.red ) ); - CHECK_EQUAL( static_cast( 255 ), static_cast( colorData.green ) ); - CHECK_EQUAL( static_cast( 255 ), static_cast( colorData.blue ) ); - CHECK_EQUAL( static_cast( 255 ), static_cast( colorData.alpha ) ); + CHECK(!printData.isColorSpecified); + CHECK(!colorData.isAlphaSpecified); + CHECK_EQUAL(static_cast(255), static_cast(colorData.red)); + CHECK_EQUAL(static_cast(255), static_cast(colorData.green)); + CHECK_EQUAL(static_cast(255), static_cast(colorData.blue)); + CHECK_EQUAL(static_cast(255), static_cast(colorData.alpha)); } T_END - -TEST( setColor, PrintFunctions ) +TEST(setColor, PrintFunctions) { api::ColorData color; color.red = 1; @@ -90,20 +87,19 @@ TEST( setColor, PrintFunctions ) printData.isColorSpecified = true; printData.color = color; core::FermataAttributes attr; - impl::setAttributesFromPrintData( printData, attr ); - CHECK( attr.hasColor ); - const auto& core = attr.color; - CHECK_EQUAL( 1, static_cast( core.getRed() ) ); - CHECK_EQUAL( 2, static_cast( core.getGreen() ) ); - CHECK_EQUAL( 3, static_cast( core.getBlue() ) ); - CHECK( core::Color::ColorType::RGB == core.getColorType() ); - CHECK_EQUAL( 255, static_cast( core.getAlpha() ) ); + impl::setAttributesFromPrintData(printData, attr); + CHECK(attr.hasColor); + const auto &core = attr.color; + CHECK_EQUAL(1, static_cast(core.getRed())); + CHECK_EQUAL(2, static_cast(core.getGreen())); + CHECK_EQUAL(3, static_cast(core.getBlue())); + CHECK(core::Color::ColorType::RGB == core.getColorType()); + CHECK_EQUAL(255, static_cast(core.getAlpha())); } T_END - -TEST( setColorAlpha, PrintFunctions ) +TEST(setColorAlpha, PrintFunctions) { api::ColorData color; color.red = 4; @@ -115,20 +111,19 @@ TEST( setColorAlpha, PrintFunctions ) printData.isColorSpecified = true; printData.color = color; core::FermataAttributes attr; - impl::setAttributesFromPrintData( printData, attr ); - CHECK( attr.hasColor ); - const auto& core = attr.color; - CHECK_EQUAL( 4, static_cast( core.getRed() ) ); - CHECK_EQUAL( 3, static_cast( core.getGreen() ) ); - CHECK_EQUAL( 2, static_cast( core.getBlue() ) ); - CHECK( core::Color::ColorType::ARGB == core.getColorType() ); - CHECK_EQUAL( 1, static_cast( core.getAlpha() ) ); + impl::setAttributesFromPrintData(printData, attr); + CHECK(attr.hasColor); + const auto &core = attr.color; + CHECK_EQUAL(4, static_cast(core.getRed())); + CHECK_EQUAL(3, static_cast(core.getGreen())); + CHECK_EQUAL(2, static_cast(core.getBlue())); + CHECK(core::Color::ColorType::ARGB == core.getColorType()); + CHECK_EQUAL(1, static_cast(core.getAlpha())); } T_END - -TEST( setColorFalse, PrintFunctions ) +TEST(setColorFalse, PrintFunctions) { api::ColorData color; color.red = 4; @@ -140,20 +135,19 @@ TEST( setColorFalse, PrintFunctions ) printData.isColorSpecified = false; printData.color = color; core::FermataAttributes attr; - impl::setAttributesFromPrintData( printData, attr ); - CHECK( !attr.hasColor ); - const auto& core = attr.color; - CHECK_EQUAL( 255, static_cast( core.getRed() ) ); - CHECK_EQUAL( 255, static_cast( core.getGreen() ) ); - CHECK_EQUAL( 255, static_cast( core.getBlue() ) ); - CHECK( core::Color::ColorType::RGB == core.getColorType() ); - CHECK_EQUAL( 255, static_cast( core.getAlpha() ) ); + impl::setAttributesFromPrintData(printData, attr); + CHECK(!attr.hasColor); + const auto &core = attr.color; + CHECK_EQUAL(255, static_cast(core.getRed())); + CHECK_EQUAL(255, static_cast(core.getGreen())); + CHECK_EQUAL(255, static_cast(core.getBlue())); + CHECK(core::Color::ColorType::RGB == core.getColorType()); + CHECK_EQUAL(255, static_cast(core.getAlpha())); } T_END - -TEST( everythingSet, PrintFunctions ) +TEST(everythingSet, PrintFunctions) { api::PrintData p; p.fontData.lineThrough = 1; @@ -163,64 +157,62 @@ TEST( everythingSet, PrintFunctions ) p.fontData.sizePoint = 2.0; p.fontData.style = api::FontStyle::italic; p.fontData.weight = api::FontWeight::bold; - p.fontData.fontFamily.emplace_back( "z" ); - p.fontData.fontFamily.emplace_back( "ABC" ); + p.fontData.fontFamily.emplace_back("z"); + p.fontData.fontFamily.emplace_back("ABC"); core::DynamicsAttributes attr; - impl::setAttributesFromPrintData( p, attr ); - CHECK( attr.hasLineThrough ); - CHECK_EQUAL( 1, attr.lineThrough.getValue() ); - CHECK( attr.hasOverline ); - CHECK_EQUAL( 2, attr.overline.getValue() ); - CHECK( attr.hasUnderline ); - CHECK_EQUAL( 3, attr.underline.getValue() ); - CHECK( attr.hasFontSize ); - CHECK( attr.fontSize.getIsDecimal() ); - CHECK_DOUBLES_EQUAL( 2.0, attr.fontSize.getValueDecimal().getValue(), 0.01 ); - CHECK( attr.hasFontStyle ); - CHECK( core::FontStyle::italic == attr.fontStyle ); - CHECK( attr.hasFontWeight ); - CHECK( core::FontWeight::bold == attr.fontWeight ); - CHECK( attr.hasFontFamily ); - CHECK_EQUAL( 2, attr.fontFamily.getValues().size() ); - CHECK_EQUAL( "z", attr.fontFamily.getValues().front().getValue() ); - CHECK_EQUAL( "ABC", attr.fontFamily.getValues().back().getValue() ); + impl::setAttributesFromPrintData(p, attr); + CHECK(attr.hasLineThrough); + CHECK_EQUAL(1, attr.lineThrough.getValue()); + CHECK(attr.hasOverline); + CHECK_EQUAL(2, attr.overline.getValue()); + CHECK(attr.hasUnderline); + CHECK_EQUAL(3, attr.underline.getValue()); + CHECK(attr.hasFontSize); + CHECK(attr.fontSize.getIsDecimal()); + CHECK_DOUBLES_EQUAL(2.0, attr.fontSize.getValueDecimal().getValue(), 0.01); + CHECK(attr.hasFontStyle); + CHECK(core::FontStyle::italic == attr.fontStyle); + CHECK(attr.hasFontWeight); + CHECK(core::FontWeight::bold == attr.fontWeight); + CHECK(attr.hasFontFamily); + CHECK_EQUAL(2, attr.fontFamily.getValues().size()); + CHECK_EQUAL("z", attr.fontFamily.getValues().front().getValue()); + CHECK_EQUAL("ABC", attr.fontFamily.getValues().back().getValue()); } T_END - -TEST( everythingGet, PrintFunctions ) +TEST(everythingGet, PrintFunctions) { core::DynamicsAttributes attr; attr.hasLineThrough = true; - attr.lineThrough.setValue( 1 ); + attr.lineThrough.setValue(1); attr.hasOverline = true; - attr.overline.setValue( 2 ); + attr.overline.setValue(2); attr.hasUnderline = true; - attr.underline.setValue( 3 ); + attr.underline.setValue(3); attr.hasFontSize = true; - attr.fontSize.setDecimal( core::Decimal{ 2.0 } ); + attr.fontSize.setDecimal(core::Decimal{2.0}); attr.hasFontStyle = true; attr.fontStyle = core::FontStyle::italic; attr.hasFontWeight = true; attr.fontWeight = core::FontWeight::bold; attr.hasFontFamily = true; core::XsTokenSet values; - values.emplace_back( "z" ); - values.emplace_back( "ABC" ); - attr.fontFamily.setValues( values ); - auto p = impl::getPrintData( attr ); - CHECK_EQUAL( 1, p.fontData.lineThrough ); - CHECK_EQUAL( 2, p.fontData.overline ); - CHECK_EQUAL( 3, p.fontData.underline ); - CHECK( api::FontSizeType::point == p.fontData.sizeType ); - CHECK_DOUBLES_EQUAL( 2.0, p.fontData.sizePoint, 0.01 ); - CHECK( api::FontStyle::italic == p.fontData.style ); - CHECK( api::FontWeight::bold == p.fontData.weight ); - CHECK_EQUAL( 2, p.fontData.fontFamily.size() ); - CHECK_EQUAL( "z", p.fontData.fontFamily.front() ); - CHECK_EQUAL( "ABC", p.fontData.fontFamily.back() ); - + values.emplace_back("z"); + values.emplace_back("ABC"); + attr.fontFamily.setValues(values); + auto p = impl::getPrintData(attr); + CHECK_EQUAL(1, p.fontData.lineThrough); + CHECK_EQUAL(2, p.fontData.overline); + CHECK_EQUAL(3, p.fontData.underline); + CHECK(api::FontSizeType::point == p.fontData.sizeType); + CHECK_DOUBLES_EQUAL(2.0, p.fontData.sizePoint, 0.01); + CHECK(api::FontStyle::italic == p.fontData.style); + CHECK(api::FontWeight::bold == p.fontData.weight); + CHECK_EQUAL(2, p.fontData.fontFamily.size()); + CHECK_EQUAL("z", p.fontData.fontFamily.front()); + CHECK_EQUAL("ABC", p.fontData.fontFamily.back()); } T_END diff --git a/Sourcecode/private/mxtest/impl/ScoreWriterTest.cpp b/Sourcecode/private/mxtest/impl/ScoreWriterTest.cpp index 66433e352..d69818954 100644 --- a/Sourcecode/private/mxtest/impl/ScoreWriterTest.cpp +++ b/Sourcecode/private/mxtest/impl/ScoreWriterTest.cpp @@ -13,13 +13,14 @@ using namespace mx::impl; // TODO - make real tests -TEST( testName, ScoreWriter) +TEST(testName, ScoreWriter) { api::ScoreData scoreData; - ScoreWriter scoreWriter{ scoreData }; + ScoreWriter scoreWriter{scoreData}; const auto scorePartwise = scoreWriter.getScorePartwise(); - CHECK( scorePartwise != nullptr ); + CHECK(scorePartwise != nullptr); } + T_END #endif diff --git a/Sourcecode/private/mxtest/import/ChangeValues.cpp b/Sourcecode/private/mxtest/import/ChangeValues.cpp index b451b9295..8dacef2c8 100644 --- a/Sourcecode/private/mxtest/import/ChangeValues.cpp +++ b/Sourcecode/private/mxtest/import/ChangeValues.cpp @@ -7,261 +7,257 @@ namespace mxtest { - void convertValues( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& existingValue, const std::string desiredValue ) +void convertValues(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &existingValue, + const std::string desiredValue) +{ + convertValues(*xdoc.getRoot(), elementName, existingValue, desiredValue); +} + +void convertValues(::ezxml::XElement &xelement, const std::string &elementName, const std::string &existingValue, + const std::string desiredValue) +{ + if (xelement.getType() == ::ezxml::XElementType::element) { - convertValues( *xdoc.getRoot(), elementName, existingValue, desiredValue ); + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + convertValues(*it, elementName, existingValue, desiredValue); + } } - - - void convertValues( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& existingValue, const std::string desiredValue ) + else if (xelement.getType() == ::ezxml::XElementType::text || xelement.getType() == ::ezxml::XElementType::empty) { - if( xelement.getType() == ::ezxml::XElementType::element ) + if (xelement.getName() == elementName && xelement.getValue() == existingValue) { - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - convertValues( *it, elementName, existingValue, desiredValue ); - } + xelement.setValue(desiredValue); } - else if ( xelement.getType() == ::ezxml::XElementType::text || xelement.getType() == ::ezxml::XElementType::empty ) + } +} + +void addChildIfNone(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &childNameToAdd, + const std::string childValueToAdd) +{ + addChildIfNone(*xdoc.getRoot(), elementName, childNameToAdd, childValueToAdd); +} + +void addChildIfNone(::ezxml::XElement &xelement, const std::string &elementName, const std::string &childNameToAdd, + const std::string childValueToAdd) +{ + if (xelement.getType() != ::ezxml::XElementType::text && xelement.getName() == elementName) + { + if (xelement.begin() == xelement.end()) { - if( xelement.getName() == elementName && xelement.getValue() == existingValue ) + auto x = xelement.appendChild(childNameToAdd); + if (!childValueToAdd.empty()) { - xelement.setValue( desiredValue ); + x->setValue(childValueToAdd); } } } - - - void addChildIfNone( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& childNameToAdd, const std::string childValueToAdd ) + else if (xelement.getType() == ::ezxml::XElementType::element || xelement.getType() == ::ezxml::XElementType::empty) { - addChildIfNone( *xdoc.getRoot(), elementName, childNameToAdd, childValueToAdd ); + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + addChildIfNone(*it, elementName, childNameToAdd, childValueToAdd); + } } - - - void addChildIfNone( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& childNameToAdd, const std::string childValueToAdd ) +} + +void addAttributeIfNone(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &attributeNameToAdd, + const std::string attributeValueToAdd) +{ + addAttributeIfNone(*xdoc.getRoot(), elementName, attributeNameToAdd, attributeValueToAdd); +} + +void addAttributeIfNone(::ezxml::XElement &xelement, const std::string &elementName, + const std::string &attributeNameToAdd, const std::string attributeValueToAdd) +{ + + if (xelement.getName() == elementName) { - if( xelement.getType() != ::ezxml::XElementType::text && xelement.getName() == elementName ) + bool isAttributeFound = false; + + for (auto it = xelement.attributesBegin(); it != xelement.attributesEnd(); ++it) { - if( xelement.begin() == xelement.end() ) + if (it->getName() == attributeNameToAdd) { - auto x = xelement.appendChild( childNameToAdd ); - if( !childValueToAdd.empty() ) - { - x->setValue( childValueToAdd ); - } + isAttributeFound = true; + break; } } - else if ( xelement.getType() == ::ezxml::XElementType::element || xelement.getType() == ::ezxml::XElementType::empty ) + + if (!isAttributeFound) { - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - addChildIfNone( *it, elementName, childNameToAdd, childValueToAdd ); - } + xelement.appendAttribute(attributeNameToAdd)->setValue(attributeValueToAdd); } } - - - void addAttributeIfNone( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& attributeNameToAdd, const std::string attributeValueToAdd ) - { - addAttributeIfNone( *xdoc.getRoot(), elementName, attributeNameToAdd, attributeValueToAdd ); - } - - - void addAttributeIfNone( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& attributeNameToAdd, const std::string attributeValueToAdd ) + + if (xelement.getType() == ::ezxml::XElementType::element) { - - if( xelement.getName() == elementName ) + for (auto it = xelement.begin(); it != xelement.end(); ++it) { - bool isAttributeFound = false; - - for( auto it = xelement.attributesBegin(); it != xelement.attributesEnd(); ++it ) - { - if( it->getName() == attributeNameToAdd ) - { - isAttributeFound = true; - break; - } - } - - if( !isAttributeFound ) - { - xelement.appendAttribute( attributeNameToAdd )->setValue( attributeValueToAdd ); - } + addAttributeIfNone(*it, elementName, attributeNameToAdd, attributeValueToAdd); } - - if ( xelement.getType() == ::ezxml::XElementType::element ) + } +} + +void removeAttribute(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &attributeNameToRemove) +{ + removeAttribute(*xdoc.getRoot(), elementName, attributeNameToRemove); +} + +void removeAttribute(::ezxml::XElement &xelement, const std::string &elementName, + const std::string &attributeNameToRemove) +{ + if (xelement.getName() == elementName) + { + for (auto it = xelement.attributesBegin(); it != xelement.attributesEnd(); ++it) { - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + if (it->getName() == attributeNameToRemove) { - addAttributeIfNone( *it, elementName, attributeNameToAdd, attributeValueToAdd ); + xelement.removeAttribute(it); + break; } } } - - - void removeAttribute( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& attributeNameToRemove ) + + if (xelement.getType() == ::ezxml::XElementType::element) { - removeAttribute( *xdoc.getRoot(), elementName, attributeNameToRemove ); + for (auto it = xelement.begin(); it != xelement.end(); ++it) + { + removeAttribute(*it, elementName, attributeNameToRemove); + } } - - - void removeAttribute( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& attributeNameToRemove ) +} + +void changeAttributeValue(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &attributeName, + const std::string &undesiredValueToReplace, const std::string &replacementValue) +{ + changeAttributeValue(*xdoc.getRoot(), elementName, attributeName, undesiredValueToReplace, replacementValue); +} + +void changeAttributeValue(::ezxml::XElement &xelement, const std::string &elementName, const std::string &attributeName, + const std::string &undesiredValueToReplace, const std::string &replacementValue) +{ + if (xelement.getName() == elementName) { - if( xelement.getName() == elementName ) + for (auto it = xelement.attributesBegin(); it != xelement.attributesEnd(); ++it) { - for( auto it = xelement.attributesBegin(); it != xelement.attributesEnd(); ++it ) + if (it->getName() == attributeName) { - if( it->getName() == attributeNameToRemove ) + if (it->getValue() == undesiredValueToReplace) { - xelement.removeAttribute( it ); + it->setValue(replacementValue); break; } } } - - if ( xelement.getType() == ::ezxml::XElementType::element ) + } + + if (xelement.getType() == ::ezxml::XElementType::element) + { + for (auto it = xelement.begin(); it != xelement.end(); ++it) { - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - removeAttribute( *it, elementName, attributeNameToRemove ); - } + changeAttributeValue(*it, elementName, attributeName, undesiredValueToReplace, replacementValue); } } - - - void changeAttributeValue( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& attributeName, const std::string& undesiredValueToReplace, const std::string& replacementValue ) +} + +void stripZerosFromDecimalFields(::ezxml::XDoc &xdoc) +{ + stripZerosFromMatchingFields(xdoc, decimalFields); +} + +void stripZerosFromMatchingFields(::ezxml::XDoc &xdoc, const std::set &fields) +{ + stripZerosFromMatchingFields(*xdoc.getRoot(), fields); +} + +void stripZerosFromMatchingFields(::ezxml::XElement &xelement, const std::set &fields) +{ + if (xelement.getType() == ::ezxml::XElementType::text) { - changeAttributeValue( *xdoc.getRoot(), elementName, attributeName, undesiredValueToReplace, replacementValue ); + auto foundIter = fields.find(xelement.getName()); + if (foundIter != fields.end()) + { + stripZeros(xelement); + } } - - - void changeAttributeValue( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& attributeName, const std::string& undesiredValueToReplace, const std::string& replacementValue) + + for (auto a = xelement.attributesBegin(); a != xelement.attributesEnd(); ++a) { - if( xelement.getName() == elementName ) + auto foundIter = fields.find(a->getName()); + if (foundIter != fields.end()) { - for( auto it = xelement.attributesBegin(); it != xelement.attributesEnd(); ++it ) - { - if( it->getName() == attributeName ) - { - if( it->getValue() == undesiredValueToReplace ) - { - it->setValue( replacementValue ); - break; - } - } - } + stripZeros(*a); } - - if( xelement.getType() == ::ezxml::XElementType::element ) + } + + if (xelement.getType() == ::ezxml::XElementType::element) + { + for (auto e = xelement.begin(); e != xelement.end(); ++e) { - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - changeAttributeValue( *it, elementName, attributeName, undesiredValueToReplace, replacementValue ); - } + // recursive + stripZerosFromMatchingFields(*e, fields); } } +} +void insertChildAfterIfMissing(const InsertChildAfterIfMissingParams ¶ms, ::ezxml::XElement &xelement) +{ - void stripZerosFromDecimalFields( ::ezxml::XDoc& xdoc ) + if (xelement.getType() == ::ezxml::XElementType::null) { - stripZerosFromMatchingFields( xdoc, decimalFields ); + return; } - - void stripZerosFromMatchingFields( ::ezxml::XDoc& xdoc, const std::set& fields ) + if (xelement.getType() != ::ezxml::XElementType::text && xelement.getName() == params.parentElement) { - stripZerosFromMatchingFields( *xdoc.getRoot(), fields ); - } + bool isTriggerFound = false; + bool isFollowerFound = false; + auto foundIter = xelement.end(); - void stripZerosFromMatchingFields( ::ezxml::XElement& xelement, const std::set& fields ) - { - if ( xelement.getType() == ::ezxml::XElementType::text ) + for (auto it = xelement.begin(); it != xelement.end(); ++it) { - auto foundIter = fields.find( xelement.getName() ); - if ( foundIter != fields.end() ) + if (it->getName() == params.insertAfterElement) { - stripZeros( xelement ); + isTriggerFound = true; + foundIter = it; } - } - for ( auto a = xelement.attributesBegin(); a != xelement.attributesEnd(); ++a ) - { - auto foundIter = fields.find( a->getName() ); - if ( foundIter != fields.end() ) + if (it->getName() == params.elementToInsert) { - stripZeros( *a ); + isFollowerFound = true; + break; } } - if ( xelement.getType() == ::ezxml::XElementType::element ) + if (isTriggerFound && !isFollowerFound) { - for ( auto e = xelement.begin(); e != xelement.end(); ++e ) - { - //recursive - stripZerosFromMatchingFields( *e, fields ); - } + auto newElement = foundIter->insertSiblingAfter(params.elementToInsert.c_str()); + newElement->setValue(params.value); } - } - - - void insertChildAfterIfMissing( const InsertChildAfterIfMissingParams& params, ::ezxml::XElement& xelement ) + else if (xelement.getType() == ::ezxml::XElementType::element || xelement.getType() == ::ezxml::XElementType::empty) { - - if( xelement.getType() == ::ezxml::XElementType::null ) + for (auto it = xelement.begin(); it != xelement.end(); ++it) { - return; + insertChildAfterIfMissing(params, *it); } - - if( xelement.getType() != ::ezxml::XElementType::text && xelement.getName() == params.parentElement ) - { + } +} - bool isTriggerFound = false; - bool isFollowerFound = false; - auto foundIter = xelement.end(); - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - if( it->getName() == params.insertAfterElement ) - { - isTriggerFound = true; - foundIter = it; - } - - if( it->getName() == params.elementToInsert ) - { - isFollowerFound = true; - break; - } - } - - if( isTriggerFound && !isFollowerFound ) - { - auto newElement = foundIter->insertSiblingAfter( params.elementToInsert.c_str() ); - newElement->setValue( params.value ); - } - - } - else if ( xelement.getType() == ::ezxml::XElementType::element || xelement.getType() == ::ezxml::XElementType::empty ) - { - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - insertChildAfterIfMissing( params, *it ); - } - } +void removeElement(::ezxml::XElement &xelement, const std::string &elementName) +{ + while (xelement.removeChild(elementName)) + { } - - void removeElement( ::ezxml::XElement& xelement, const std::string& elementName ) + + for (auto it = xelement.begin(); it != xelement.end(); ++it) { - while( xelement.removeChild( elementName ) ) {} - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) + if (it->getType() == ::ezxml::XElementType::element) { - if( it->getType() == ::ezxml::XElementType::element ) - { - removeElement( *it, elementName ); - } + removeElement(*it, elementName); } } } +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/import/ChangeValues.h b/Sourcecode/private/mxtest/import/ChangeValues.h index b13f5a4fc..724424d58 100644 --- a/Sourcecode/private/mxtest/import/ChangeValues.h +++ b/Sourcecode/private/mxtest/import/ChangeValues.h @@ -4,55 +4,64 @@ #pragma once +#include "ezxml/XAttribute.h" +#include "ezxml/XAttributeIterator.h" #include "ezxml/XDoc.h" #include "ezxml/XElement.h" -#include "ezxml/XAttribute.h" #include "ezxml/XElementIterator.h" -#include "ezxml/XAttributeIterator.h" -#include #include #include +#include namespace mxtest { - - using StringMap = std::map; - - // These functions recursively change the XML Document for test cases where - // either the input is questionable or the Mx library produces an acceptable - // output that does not precisely match the input See ExpectedFiles.cpp - // for the specific applications of these functions to the input test files. - - void convertValues( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& existingValue, const std::string desiredValue ); - void convertValues( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& existingValue, const std::string desiredValue ); - - void addChildIfNone( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& childNameToAdd, const std::string childValueToAdd ); - void addChildIfNone( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& childNameToAdd, const std::string childValueToAdd ); - - void addAttributeIfNone( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& attributeNameToAdd, const std::string attributeValueToAdd ); - void addAttributeIfNone( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& attributeNameToAdd, const std::string attributeValueToAdd ); - - void removeAttribute( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& attributeNameToRemove ); - void removeAttribute( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& attributeNameToRemove ); - - void changeAttributeValue( ::ezxml::XDoc& xdoc, const std::string& elementName, const std::string& attributeName, const std::string& undesiredValueToReplace, const std::string& replacementValue ); - void changeAttributeValue( ::ezxml::XElement& xelement, const std::string& elementName, const std::string& attributeName, const std::string& undesiredValueToReplace, const std::string& replacementValue); - - void stripZerosFromDecimalFields( ::ezxml::XDoc& xdoc ); - void stripZerosFromMatchingFields( ::ezxml::XDoc& xdoc, const std::set& fields ); - void stripZerosFromMatchingFields( ::ezxml::XElement& xelement, const std::set& fields ); - - struct InsertChildAfterIfMissingParams - { - std::string parentElement; - std::string insertAfterElement; - std::string elementToInsert; - std::string value; - }; - - void insertChildAfterIfMissing( const InsertChildAfterIfMissingParams& params, ::ezxml::XElement& xelement ); - - void removeElement( ::ezxml::XElement& xelement, const std::string& elementName ); - -} + +using StringMap = std::map; + +// These functions recursively change the XML Document for test cases where +// either the input is questionable or the Mx library produces an acceptable +// output that does not precisely match the input See ExpectedFiles.cpp +// for the specific applications of these functions to the input test files. + +void convertValues(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &existingValue, + const std::string desiredValue); +void convertValues(::ezxml::XElement &xelement, const std::string &elementName, const std::string &existingValue, + const std::string desiredValue); + +void addChildIfNone(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &childNameToAdd, + const std::string childValueToAdd); +void addChildIfNone(::ezxml::XElement &xelement, const std::string &elementName, const std::string &childNameToAdd, + const std::string childValueToAdd); + +void addAttributeIfNone(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &attributeNameToAdd, + const std::string attributeValueToAdd); +void addAttributeIfNone(::ezxml::XElement &xelement, const std::string &elementName, + const std::string &attributeNameToAdd, const std::string attributeValueToAdd); + +void removeAttribute(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &attributeNameToRemove); +void removeAttribute(::ezxml::XElement &xelement, const std::string &elementName, + const std::string &attributeNameToRemove); + +void changeAttributeValue(::ezxml::XDoc &xdoc, const std::string &elementName, const std::string &attributeName, + const std::string &undesiredValueToReplace, const std::string &replacementValue); +void changeAttributeValue(::ezxml::XElement &xelement, const std::string &elementName, const std::string &attributeName, + const std::string &undesiredValueToReplace, const std::string &replacementValue); + +void stripZerosFromDecimalFields(::ezxml::XDoc &xdoc); +void stripZerosFromMatchingFields(::ezxml::XDoc &xdoc, const std::set &fields); +void stripZerosFromMatchingFields(::ezxml::XElement &xelement, const std::set &fields); + +struct InsertChildAfterIfMissingParams +{ + std::string parentElement; + std::string insertAfterElement; + std::string elementToInsert; + std::string value; +}; + +void insertChildAfterIfMissing(const InsertChildAfterIfMissingParams ¶ms, ::ezxml::XElement &xelement); + +void removeElement(::ezxml::XElement &xelement, const std::string &elementName); + +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/import/DecimalFields.h b/Sourcecode/private/mxtest/import/DecimalFields.h index 591185bef..57af56023 100644 --- a/Sourcecode/private/mxtest/import/DecimalFields.h +++ b/Sourcecode/private/mxtest/import/DecimalFields.h @@ -4,14 +4,14 @@ #pragma once +#include "ezxml/XAttribute.h" +#include "ezxml/XAttributeIterator.h" #include "ezxml/XDoc.h" #include "ezxml/XElement.h" -#include "ezxml/XAttribute.h" #include "ezxml/XElementIterator.h" -#include "ezxml/XAttributeIterator.h" -#include #include +#include // Some of the test files (particularly MuseScore and Recordare) have // trailing zeros after decimal points. Mx does not do this, so for @@ -21,103 +21,92 @@ namespace mxtest { - const std::set decimalFields = - { - "top-system-distance", - "dynamics", - "left-margin", - "right-margin", - "staff-distance", - "system-distance", - "default-y", - "default-x", - "tenths" - }; - - inline int trailingCharsToStrip( const std::string& value ) +const std::set decimalFields = {"top-system-distance", "dynamics", "left-margin", + "right-margin", "staff-distance", "system-distance", + "default-y", "default-x", "tenths"}; + +inline int trailingCharsToStrip(const std::string &value) +{ + bool isDecimalFound = false; + bool isNonZeroFound = false; + int zeroCount = 0; + for (auto it = value.crbegin(); it != value.crend(); ++it) { - bool isDecimalFound = false; - bool isNonZeroFound = false; - int zeroCount = 0; - for ( auto it = value.crbegin(); it != value.crend(); ++it ) + if (*it == '0') { - if ( *it == '0' ) - { - if ( !isDecimalFound && !isNonZeroFound ) - { - ++zeroCount; - } - } - else if ( *it == '.' ) - { - isDecimalFound = true; - break; - } - else + if (!isDecimalFound && !isNonZeroFound) { - isNonZeroFound = true; + ++zeroCount; } } - - if ( !isDecimalFound ) + else if (*it == '.') { - return 0; + isDecimalFound = true; + break; } - - if ( !isNonZeroFound ) + else { - // add 1 to strip the decimal - return zeroCount + 1; + isNonZeroFound = true; } - - return zeroCount; } - - inline void stripZeros( ::ezxml::XElement& xelement ) + if (!isDecimalFound) { - const auto initialValue = xelement.getValue(); + return 0; + } - if ( initialValue.empty() ) - { - return; - } + if (!isNonZeroFound) + { + // add 1 to strip the decimal + return zeroCount + 1; + } - const int chars = trailingCharsToStrip( initialValue ); + return zeroCount; +} - if ( chars != 0 ) - { - xelement.setValue( initialValue.substr( 0, initialValue.size() - chars ) ); - } +inline void stripZeros(::ezxml::XElement &xelement) +{ + const auto initialValue = xelement.getValue(); - auto str = xelement.getValue(); - if( str == "-0" ) - { - xelement.setValue( "0" ); - } + if (initialValue.empty()) + { + return; } + const int chars = trailingCharsToStrip(initialValue); - inline void stripZeros( ::ezxml::XAttribute& xattribute ) + if (chars != 0) { - const auto initialValue = xattribute.getValue(); + xelement.setValue(initialValue.substr(0, initialValue.size() - chars)); + } - if ( initialValue.empty() ) - { - return; - } + auto str = xelement.getValue(); + if (str == "-0") + { + xelement.setValue("0"); + } +} - const int chars = trailingCharsToStrip( initialValue ); +inline void stripZeros(::ezxml::XAttribute &xattribute) +{ + const auto initialValue = xattribute.getValue(); - if ( chars != 0 ) - { - xattribute.setValue( initialValue.substr( 0, initialValue.size() - chars ) ); - } + if (initialValue.empty()) + { + return; + } - auto str = xattribute.getValue(); - if( str == "-0" ) - { - xattribute.setValue( "0" ); - } + const int chars = trailingCharsToStrip(initialValue); + + if (chars != 0) + { + xattribute.setValue(initialValue.substr(0, initialValue.size() - chars)); + } + + auto str = xattribute.getValue(); + if (str == "-0") + { + xattribute.setValue("0"); } } +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/import/ExpectedFiles.cpp b/Sourcecode/private/mxtest/import/ExpectedFiles.cpp index e488f585a..0935f8c35 100644 --- a/Sourcecode/private/mxtest/import/ExpectedFiles.cpp +++ b/Sourcecode/private/mxtest/import/ExpectedFiles.cpp @@ -5,361 +5,347 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_IMPORT_TESTS -#include "mxtest/file/StupidFileFunctions.h" -#include "mxtest/file/MxFileRepository.h" -#include "mxtest/import/ExpectedFiles.h" -#include "mx/utility/Throw.h" #include "mx/core/Document.h" -#include "mxtest/import/SortAttributes.h" +#include "mx/utility/Throw.h" +#include "mxtest/file/MxFileRepository.h" +#include "mxtest/file/StupidFileFunctions.h" #include "mxtest/import/ChangeValues.h" #include "mxtest/import/DecimalFields.h" +#include "mxtest/import/ExpectedFiles.h" +#include "mxtest/import/SortAttributes.h" -#include #include -#include #include +#include #include +#include using namespace ezxml; - namespace mxtest { - void generateExpectedFile( const std::string& subdir, const std::string& fileName ) +void generateExpectedFile(const std::string &subdir, const std::string &fileName) +{ + auto xdoc = readInputFile(subdir, fileName); + setXmlDeclaration(xdoc); + auto isScorePartwise = getIsScorePartwise(xdoc); + setDoctype(xdoc, isScorePartwise); + setRootMusicXmlVersion(xdoc, isScorePartwise); + + // ly01e_Pitches_ParenthesizedAccidentals incorrectly uses "double-flat" which should be "flat-flat" instead + convertValues(*xdoc, "accidental", "double-flat", "flat-flat"); + + // lysuite_ly22b_Staff_Notestyles.xml incorrectly has elements that are missing required attribute + // 'use-stems' and child element 'slash-type' + addChildIfNone(*xdoc, "slash", "slash-type", "eighth"); + + // ly32b_Atriculations_Texts.xml cas a 'color' attribute on the 'words' element + // I have examined the xsd thoughouly and I believe this is illegal + removeAttribute(*xdoc, "words", "color"); + + // ly32a_Notations.xml the 'fret' element should have a value + convertValues(*xdoc, "fret", "", "1"); + + // ly32a_Notations.xml the 'string' element should have a value + convertValues(*xdoc, "string", "", "1"); + + // lysuite_ly74a_FiguredBass.xml incorrectly has elements with zero + // 'figure' and child elements. one or more 'figure' elements are required + addChildIfNone(*xdoc, "figured-bass", "figure", ""); + + // lysuite_ly41g_PartNoId.xml the part-id attribute is required + addAttributeIfNone(*xdoc, "part", "id", "ID"); + + // several of the musescore test files say + // my code returns which I find acceptable + stripZerosFromDecimalFields(*xdoc); + // changeAttributeValue( *xdoc, "sound", "dynamics", "140.00", "140" ); + + // same as above, mx doesn't write the .00 but musescore does + // convertValues( *xdoc, "top-system-distance", "170.00", "170" ); + // convertValues( *xdoc, "left-margin", "21.00", "21" ); + // convertValues( *xdoc, "right-margin", "-0.00", "-0" ); + // convertValues( *xdoc, "top-system-distance", "70.00", "70" ); + // convertValues( *xdoc, "staff-distance", "65.00", "65" ); + + // convertValues( *xdoc, "top-system-distance", "275.00", "275" ); + // convertValues( *xdoc, "system-distance", "150.00", "150" ); + // convertValues( *xdoc, "system-distance", "100.00", "100" ); + + // changeAttributeValue( *xdoc, "note", "default-y", "-30.00", "-30" ); + // changeAttributeValue( *xdoc, "note", "default-y", "-20.00", "-20" ); + // changeAttributeValue( *xdoc, "note", "default-y", "-40.00", "-40" ); + // changeAttributeValue( *xdoc, "note", "default-y", "-35.00", "-35" ); + + // changeAttributeValue( *xdoc, "note", "default-x", "71.00", "71" ); + // changeAttributeValue( *xdoc, "note", "default-x", "211.40", "211.4" ); + // changeAttributeValue( *xdoc, "note", "default-x", "284.50", "284.5" ); + // changeAttributeValue( *xdoc, "note", "default-x", "87.30", "87.3" ); + + // ly75a_AccordionRegistrations has incorrect and missing values in the accordion-middle element + convertValues(*xdoc, "accordion-middle", "test", "0"); + convertValues(*xdoc, "accordion-middle", "", "0"); + convertValues(*xdoc, "accordion-middle", "5", "3"); + + // musuite_test_harmony.xml a 'kind' element which has a 'text' attribute consisting of a space character + // the 'text' attribute is of type XsToken which does not accept spaces + changeAttributeValue(*xdoc, "kind", "text", " ", ""); + + // musuite_test_harmony.xml has empty 'kind' elements which is incorrect, these will be defaulted to 'major' + // it also has values that are not allowed in the xsd + // it also has missing degree-alter tags which are required when 'degree' is used + convertValues(*xdoc, "kind", "", "none"); + convertValues(*xdoc, "kind", "minor-major", "none"); + convertValues(*xdoc, "kind", "dominant-seventh", "dominant"); + convertValues(*xdoc, "kind", "italian", "Italian"); + convertValues(*xdoc, "kind", "french", "French"); + convertValues(*xdoc, "kind", "german", "German"); + convertValues(*xdoc, "kind", "neapolitan", "Neapolitan"); + convertValues(*xdoc, "kind", "maj69", "none"); + convertValues(*xdoc, "kind", "augmented-ninth", "none"); + convertValues(*xdoc, "kind", "altered", "none"); + InsertChildAfterIfMissingParams insertDegreeAlterParams; + insertDegreeAlterParams.elementToInsert = "degree-alter"; + insertDegreeAlterParams.insertAfterElement = "degree-value"; + insertDegreeAlterParams.parentElement = "degree"; + insertDegreeAlterParams.value = "0"; + insertChildAfterIfMissing(insertDegreeAlterParams, *xdoc->getRoot()); + + // msuite more values that need the *.00 stripped + // convertValues( *xdoc, "left-margin", "0.00", "0" ); + // convertValues( *xdoc, "right-margin", "0.00", "0" ); + // changeAttributeValue( *xdoc, "note", "default-y", "-25.00", "-25" ); + // changeAttributeValue( *xdoc, "note", "default-y", "-15.00", "-15" ); + // changeAttributeValue( *xdoc, "note", "default-y", "-5.00", "-5" ); + + // remove the fake elements from musuite_testInvalid.xml + removeElement(*xdoc->getRoot(), "invalid_element"); + removeElement(*xdoc->getRoot(), "another_invalid_element"); + + // KEEP AS LAST - attribute order doesn't matter in xml so must be sorted for comparison + sortAttributes(*xdoc); + + std::string expectedFileName = getExpectedFileName(subdir, fileName); + std::string expectedFilePath = getExpectedFileFullPath(expectedFileName); + std::ofstream ofile; + openOutputFile(ofile, expectedFilePath); + xdoc->saveStream(ofile); + ofile.close(); +} + +::ezxml::XDocPtr readInputFile(const std::string &subdir, const std::string &fileName) +{ + std::ifstream inputFile; + std::string fullPath = filePath(subdir, fileName); + openInputFile(inputFile, fullPath); + auto xdoc = ::ezxml::XFactory::makeXDoc(); + xdoc->loadStream(inputFile); + return xdoc; +} + +void setXmlDeclaration(::ezxml::XDocPtr &xdoc) +{ + xdoc->setIsStandalone(false); + xdoc->setXmlVersion(::ezxml::XmlVersion::onePointZero); + auto encoding = xdoc->getEncoding(); + switch (encoding) { - auto xdoc = readInputFile( subdir, fileName ); - setXmlDeclaration( xdoc ); - auto isScorePartwise = getIsScorePartwise( xdoc ); - setDoctype( xdoc, isScorePartwise ); - setRootMusicXmlVersion( xdoc, isScorePartwise ); - - // ly01e_Pitches_ParenthesizedAccidentals incorrectly uses "double-flat" which should be "flat-flat" instead - convertValues( *xdoc, "accidental", "double-flat", "flat-flat" ); - - // lysuite_ly22b_Staff_Notestyles.xml incorrectly has elements that are missing required attribute - // 'use-stems' and child element 'slash-type' - addChildIfNone( *xdoc, "slash", "slash-type", "eighth" ); - - // ly32b_Atriculations_Texts.xml cas a 'color' attribute on the 'words' element - // I have examined the xsd thoughouly and I believe this is illegal - removeAttribute( *xdoc, "words", "color" ); - - // ly32a_Notations.xml the 'fret' element should have a value - convertValues( *xdoc, "fret", "", "1" ); - - // ly32a_Notations.xml the 'string' element should have a value - convertValues( *xdoc, "string", "", "1" ); - - // lysuite_ly74a_FiguredBass.xml incorrectly has elements with zero - // 'figure' and child elements. one or more 'figure' elements are required - addChildIfNone( *xdoc, "figured-bass", "figure", "" ); - - // lysuite_ly41g_PartNoId.xml the part-id attribute is required - addAttributeIfNone( *xdoc, "part", "id", "ID" ); - - // several of the musescore test files say - // my code returns which I find acceptable - stripZerosFromDecimalFields( *xdoc ); - //changeAttributeValue( *xdoc, "sound", "dynamics", "140.00", "140" ); - - // same as above, mx doesn't write the .00 but musescore does - //convertValues( *xdoc, "top-system-distance", "170.00", "170" ); - //convertValues( *xdoc, "left-margin", "21.00", "21" ); - //convertValues( *xdoc, "right-margin", "-0.00", "-0" ); - //convertValues( *xdoc, "top-system-distance", "70.00", "70" ); - //convertValues( *xdoc, "staff-distance", "65.00", "65" ); - - - //convertValues( *xdoc, "top-system-distance", "275.00", "275" ); - //convertValues( *xdoc, "system-distance", "150.00", "150" ); - //convertValues( *xdoc, "system-distance", "100.00", "100" ); - - //changeAttributeValue( *xdoc, "note", "default-y", "-30.00", "-30" ); - //changeAttributeValue( *xdoc, "note", "default-y", "-20.00", "-20" ); - //changeAttributeValue( *xdoc, "note", "default-y", "-40.00", "-40" ); - //changeAttributeValue( *xdoc, "note", "default-y", "-35.00", "-35" ); - - //changeAttributeValue( *xdoc, "note", "default-x", "71.00", "71" ); - //changeAttributeValue( *xdoc, "note", "default-x", "211.40", "211.4" ); - //changeAttributeValue( *xdoc, "note", "default-x", "284.50", "284.5" ); - //changeAttributeValue( *xdoc, "note", "default-x", "87.30", "87.3" ); - - // ly75a_AccordionRegistrations has incorrect and missing values in the accordion-middle element - convertValues( *xdoc, "accordion-middle", "test", "0" ); - convertValues( *xdoc, "accordion-middle", "", "0" ); - convertValues( *xdoc, "accordion-middle", "5", "3" ); - - // musuite_test_harmony.xml a 'kind' element which has a 'text' attribute consisting of a space character - // the 'text' attribute is of type XsToken which does not accept spaces - changeAttributeValue( *xdoc, "kind", "text", " ", "" ); - - // musuite_test_harmony.xml has empty 'kind' elements which is incorrect, these will be defaulted to 'major' - // it also has values that are not allowed in the xsd - // it also has missing degree-alter tags which are required when 'degree' is used - convertValues( *xdoc, "kind", "", "none" ); - convertValues( *xdoc, "kind", "minor-major", "none" ); - convertValues( *xdoc, "kind", "dominant-seventh", "dominant" ); - convertValues( *xdoc, "kind", "italian", "Italian" ); - convertValues( *xdoc, "kind", "french", "French" ); - convertValues( *xdoc, "kind", "german", "German" ); - convertValues( *xdoc, "kind", "neapolitan", "Neapolitan" ); - convertValues( *xdoc, "kind", "maj69", "none" ); - convertValues( *xdoc, "kind", "augmented-ninth", "none" ); - convertValues( *xdoc, "kind", "altered", "none" ); - InsertChildAfterIfMissingParams insertDegreeAlterParams; - insertDegreeAlterParams.elementToInsert = "degree-alter"; - insertDegreeAlterParams.insertAfterElement = "degree-value"; - insertDegreeAlterParams.parentElement = "degree"; - insertDegreeAlterParams.value = "0"; - insertChildAfterIfMissing( insertDegreeAlterParams, *xdoc->getRoot() ); - - // msuite more values that need the *.00 stripped - //convertValues( *xdoc, "left-margin", "0.00", "0" ); - //convertValues( *xdoc, "right-margin", "0.00", "0" ); - //changeAttributeValue( *xdoc, "note", "default-y", "-25.00", "-25" ); - //changeAttributeValue( *xdoc, "note", "default-y", "-15.00", "-15" ); - //changeAttributeValue( *xdoc, "note", "default-y", "-5.00", "-5" ); - - // remove the fake elements from musuite_testInvalid.xml - removeElement( *xdoc->getRoot(), "invalid_element" ); - removeElement( *xdoc->getRoot(), "another_invalid_element" ); - - // KEEP AS LAST - attribute order doesn't matter in xml so must be sorted for comparison - sortAttributes( *xdoc ); - - std::string expectedFileName = getExpectedFileName( subdir, fileName ); - std::string expectedFilePath = getExpectedFileFullPath( expectedFileName ); - std::ofstream ofile; - openOutputFile( ofile, expectedFilePath ); - xdoc->saveStream( ofile ); - ofile.close(); + case ::ezxml::Encoding::utfEight: + xdoc->setEncoding(::ezxml::Encoding::utfEight); + break; + case ::ezxml::Encoding::utfSixteen: + xdoc->setEncoding(::ezxml::Encoding::utfSixteen); + break; + case ::ezxml::Encoding::unknown: + xdoc->setEncoding(::ezxml::DEFAULT_ENCODING); + break; + default: + xdoc->setEncoding(::ezxml::DEFAULT_ENCODING); + break; } - - - ::ezxml::XDocPtr readInputFile( const std::string& subdir, const std::string& fileName ) +} + +bool getIsScorePartwise(const ::ezxml::XDocPtr &xdoc) +{ + std::string doctype = xdoc->getDoctypeValue(); + bool isScorePartwise = true; + if (mx::utility::containsCaseInsensitive("score-partwise", doctype)) { - std::ifstream inputFile; - std::string fullPath = filePath( subdir, fileName ); - openInputFile( inputFile, fullPath ); - auto xdoc = ::ezxml::XFactory::makeXDoc(); - xdoc->loadStream( inputFile ); - return xdoc; + isScorePartwise = true; } - - - void setXmlDeclaration( ::ezxml::XDocPtr& xdoc ) + else if (mx::utility::containsCaseInsensitive("score-timewise", doctype)) { - xdoc->setIsStandalone( false ); - xdoc->setXmlVersion( ::ezxml::XmlVersion::onePointZero ); - auto encoding = xdoc->getEncoding(); - switch( encoding ) - { - case ::ezxml::Encoding::utfEight: - xdoc->setEncoding( ::ezxml::Encoding::utfEight ); - break; - case ::ezxml::Encoding::utfSixteen: - xdoc->setEncoding( ::ezxml::Encoding::utfSixteen ); - break; - case ::ezxml::Encoding::unknown: - xdoc->setEncoding( ::ezxml::DEFAULT_ENCODING ); - break; - default: - xdoc->setEncoding( ::ezxml::DEFAULT_ENCODING ); - break; - } + isScorePartwise = false; } - - - bool getIsScorePartwise( const ::ezxml::XDocPtr& xdoc ) + else { - std::string doctype = xdoc->getDoctypeValue(); - bool isScorePartwise = true; - if( mx::utility::containsCaseInsensitive( "score-partwise", doctype ) ) - { - isScorePartwise = true; - } - else if( mx::utility::containsCaseInsensitive( "score-timewise", doctype ) ) - { - isScorePartwise = false; - } - else - { - std::stringstream ss; - ss << "the doctype was unrecognized '" << doctype << "'"; - MX_THROW( ss.str() ) - } - return isScorePartwise; + std::stringstream ss; + ss << "the doctype was unrecognized '" << doctype << "'"; + MX_THROW(ss.str()) + } + return isScorePartwise; +} + +void setDoctype(::ezxml::XDocPtr &xdoc, bool isScorePartwise) +{ + if (isScorePartwise) + { + xdoc->setDoctypeValue(mx::core::DOCTYPE_VALUE_SCORE_PARTWISE); } - - - void setDoctype( ::ezxml::XDocPtr& xdoc, bool isScorePartwise ) + else + { + xdoc->setDoctypeValue(mx::core::DOCTYPE_VALUE_SCORE_TIMEWISE); + } +} + +void setRootMusicXmlVersion(::ezxml::XDocPtr &xdoc, bool isScorePartwise) +{ + auto root = xdoc->getRoot(); + if (root->getName() == "score-partwise" || root->getName() == "score-timewise") { - if( isScorePartwise ) + if (root->getName() == "score-partwise" && !isScorePartwise) { - xdoc->setDoctypeValue( mx::core::DOCTYPE_VALUE_SCORE_PARTWISE ); + MX_THROW("the root element 'score-partwise' does not match the doctype declaration"); } - else + + if (root->getName() == "score-timewise" && isScorePartwise) { - xdoc->setDoctypeValue( mx::core::DOCTYPE_VALUE_SCORE_TIMEWISE ); + MX_THROW("the root element 'score-timewise' does not match the doctype declaration"); } - } - - - void setRootMusicXmlVersion( ::ezxml::XDocPtr& xdoc, bool isScorePartwise ) - { - auto root = xdoc->getRoot(); - if ( root->getName() == "score-partwise" || root->getName() == "score-timewise" ) + + auto it = root->attributesBegin(); + auto end = root->attributesEnd(); + if (it == end) { - if( root->getName() == "score-partwise" && !isScorePartwise ) - { - MX_THROW( "the root element 'score-partwise' does not match the doctype declaration" ); - } - - if( root->getName() == "score-timewise" && isScorePartwise ) - { - MX_THROW( "the root element 'score-timewise' does not match the doctype declaration" ); - } - - auto it = root->attributesBegin(); - auto end = root->attributesEnd(); - if( it == end ) - { - auto attr = root->appendAttribute( "version" ); - attr->setValue( "3.0" ); - } - else - { - if( it->getName() != "version" ) - { - MX_THROW( "attribute of root element is wrong, should be 'version'" ); - } - it->setValue( "3.0" ); - } + auto attr = root->appendAttribute("version"); + attr->setValue("3.0"); } else { - MX_THROW( "bad music xml file" ); + if (it->getName() != "version") + { + MX_THROW("attribute of root element is wrong, should be 'version'"); + } + it->setValue("3.0"); } } - - - std::string getExpectedFileName( const std::string& subdir, const std::string& fileName ) + else { - std::stringstream ss; - ss << subdir << "_" << fileName << ".expected.xml"; - return ss.str(); - } - - - - std::string getExpectedFileFullPath( const std::string& subdir, const std::string& fileName ) - { - return filePath( "expected", getExpectedFileName( subdir, fileName ) ); + MX_THROW("bad music xml file"); } +} - // Don't print a dot for every file, just print a dot for every X files processed - static constexpr const int PRINT_DOT_STRIDE_SIZE = 10; - - void deleteExpectedFiles() +std::string getExpectedFileName(const std::string &subdir, const std::string &fileName) +{ + std::stringstream ss; + ss << subdir << "_" << fileName << ".expected.xml"; + return ss.str(); +} + +std::string getExpectedFileFullPath(const std::string &subdir, const std::string &fileName) +{ + return filePath("expected", getExpectedFileName(subdir, fileName)); +} + +// Don't print a dot for every file, just print a dot for every X files processed +static constexpr const int PRINT_DOT_STRIDE_SIZE = 10; + +void deleteExpectedFiles() +{ + std::cout << "deleting expected files" << std::flush; + auto testFiles = MxFileRepository::getTestFiles(0); + int processedFileCount = 0; + for (const auto &testFile : testFiles) { - std::cout << "deleting expected files" << std::flush; - auto testFiles = MxFileRepository::getTestFiles( 0 ); - int processedFileCount = 0; - for(const auto & testFile : testFiles) + ++processedFileCount; + std::string fullpath = getExpectedFileFullPath(testFile.subdirectory, testFile.fileName); + deleteFileNoThrow(fullpath); + if (processedFileCount % PRINT_DOT_STRIDE_SIZE == 0) { - ++processedFileCount; - std::string fullpath = getExpectedFileFullPath( testFile.subdirectory, testFile.fileName ); - deleteFileNoThrow( fullpath ); - if( processedFileCount % PRINT_DOT_STRIDE_SIZE == 0 ) - { - std::cout << "." << std::flush; - } + std::cout << "." << std::flush; } - std::cout << "done" << std::endl; } - - - void generateExpectedFiles() + std::cout << "done" << std::endl; +} + +void generateExpectedFiles() +{ + std::cout << "creating expected files" << std::flush; + const int maxConcurrency = 48; + std::list> q; + auto testFiles = MxFileRepository::getTestFiles(MX_COMPILE_MAX_FILE_SIZE_BYTES); + int processedFileCount = 0; + for (const auto &testFile : testFiles) { - std::cout << "creating expected files" << std::flush; - const int maxConcurrency = 48; - std::list> q; - auto testFiles = MxFileRepository::getTestFiles( MX_COMPILE_MAX_FILE_SIZE_BYTES ); - int processedFileCount = 0; - for(const auto& testFile : testFiles) + ++processedFileCount; + if (processedFileCount % PRINT_DOT_STRIDE_SIZE == 0) { - ++processedFileCount; - if( processedFileCount % PRINT_DOT_STRIDE_SIZE == 0 ) - { - std::cout << "." << std::flush; - } - auto fut = std::async( std::launch::async, generateExpectedFile, testFile.subdirectory.c_str(), testFile.fileName.c_str() ); - - while( q.size() >= maxConcurrency && q.begin() != q.end() ) - { - for( auto qIter = q.begin(); qIter != q.end(); ++qIter ) - { - if( qIter->wait_for( std::chrono::milliseconds(2) ) == std::future_status::ready ) - { - qIter->wait(); - q.erase( qIter ); - break; - } - } - std::this_thread::sleep_for( std::chrono::milliseconds( maxConcurrency > 0 ? 10 : 0 ) ); - } - q.push_front( std::move( fut ) ); + std::cout << "." << std::flush; } - - while( !q.empty() ) + auto fut = std::async(std::launch::async, generateExpectedFile, testFile.subdirectory.c_str(), + testFile.fileName.c_str()); + + while (q.size() >= maxConcurrency && q.begin() != q.end()) { - for( auto qIter = q.begin(); qIter != q.end(); ++qIter ) + for (auto qIter = q.begin(); qIter != q.end(); ++qIter) { - if( qIter->wait_for( std::chrono::milliseconds(10) ) == std::future_status::ready ) + if (qIter->wait_for(std::chrono::milliseconds(2)) == std::future_status::ready) { qIter->wait(); - q.erase( qIter ); + q.erase(qIter); break; } - std::this_thread::sleep_for( std::chrono::milliseconds(50) ); } + std::this_thread::sleep_for(std::chrono::milliseconds(maxConcurrency > 0 ? 10 : 0)); } - std::cout << "done" << std::endl; + q.push_front(std::move(fut)); } - - std::string gettestOutputErrorFileName( const std::string& subdir, const std::string& fileName ) + while (!q.empty()) { - std::stringstream ss; - ss << subdir << "_" << fileName << ".error.xml"; - return ss.str(); - } - - - std::string getTestOutputErrorFileFullPath( const std::string& subdir, const std::string& fileName ) - { - return filePath( TEST_OUTPUT_DIRECTORY_NAME, gettestOutputErrorFileName( subdir, fileName ) ); - } - - - std::string getTestOutputExpectedFileFullPath( const std::string& subdir, const std::string& fileName ) - { - return filePath( TEST_OUTPUT_DIRECTORY_NAME, getExpectedFileName( subdir, fileName ) ); - } - - - void deleteTestOutputFiles() - { - auto testFiles = MxFileRepository::getTestFiles( 0 ); - for( auto it = testFiles.cbegin(); it != testFiles.cend(); ++it ) + for (auto qIter = q.begin(); qIter != q.end(); ++qIter) { - std::string ex = getTestOutputExpectedFileFullPath( it->subdirectory, it->fileName ); - std::string er = getTestOutputErrorFileFullPath( it->subdirectory, it->fileName ); - deleteFileNoThrow( ex ); - deleteFileNoThrow( er ); + if (qIter->wait_for(std::chrono::milliseconds(10)) == std::future_status::ready) + { + qIter->wait(); + q.erase(qIter); + break; + } + std::this_thread::sleep_for(std::chrono::milliseconds(50)); } } - + std::cout << "done" << std::endl; +} + +std::string gettestOutputErrorFileName(const std::string &subdir, const std::string &fileName) +{ + std::stringstream ss; + ss << subdir << "_" << fileName << ".error.xml"; + return ss.str(); +} + +std::string getTestOutputErrorFileFullPath(const std::string &subdir, const std::string &fileName) +{ + return filePath(TEST_OUTPUT_DIRECTORY_NAME, gettestOutputErrorFileName(subdir, fileName)); +} + +std::string getTestOutputExpectedFileFullPath(const std::string &subdir, const std::string &fileName) +{ + return filePath(TEST_OUTPUT_DIRECTORY_NAME, getExpectedFileName(subdir, fileName)); +} + +void deleteTestOutputFiles() +{ + auto testFiles = MxFileRepository::getTestFiles(0); + for (auto it = testFiles.cbegin(); it != testFiles.cend(); ++it) + { + std::string ex = getTestOutputExpectedFileFullPath(it->subdirectory, it->fileName); + std::string er = getTestOutputErrorFileFullPath(it->subdirectory, it->fileName); + deleteFileNoThrow(ex); + deleteFileNoThrow(er); + } } +} // namespace mxtest + #endif diff --git a/Sourcecode/private/mxtest/import/ExpectedFiles.h b/Sourcecode/private/mxtest/import/ExpectedFiles.h index a94df309f..df6ee62c8 100644 --- a/Sourcecode/private/mxtest/import/ExpectedFiles.h +++ b/Sourcecode/private/mxtest/import/ExpectedFiles.h @@ -7,49 +7,49 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_IMPORT_TESTS +#include "ezxml/XAttributeIterator.h" +#include "ezxml/XDoc.h" +#include "ezxml/XFactory.h" +#include "mx/utility/Parse.h" +#include "mxtest/file/MxFileRepository.h" #include "mxtest/file/Path.h" #include "mxtest/file/StupidFileFunctions.h" -#include "mxtest/file/MxFileRepository.h" -#include "mx/utility/Parse.h" -#include "ezxml/XFactory.h" -#include "ezxml/XDoc.h" -#include "ezxml/XAttributeIterator.h" -#include #include +#include namespace mxtest { - - void generateExpectedFile( const std::string& subdir, const std::string& fileName ); - - ::ezxml::XDocPtr readInputFile( const std::string& subdir, const std::string& fileName ); - - void setXmlDeclaration( ::ezxml::XDocPtr& xdoc ); - - bool getIsScorePartwise( const ::ezxml::XDocPtr& xdoc ); - - void setDoctype( ::ezxml::XDocPtr& xdoc, bool isScorePartwise ); - - void setRootMusicXmlVersion( ::ezxml::XDocPtr& xdoc, bool isScorePartwsise ); - - std::string getExpectedFileName( const std::string& subdir, const std::string& fileName ); - - std::string getExpectedFileFullPath( const std::string& subdir, const std::string& fileName ); - - void deleteExpectedFiles(); - - void generateExpectedFiles(); - - std::string gettestOutputErrorFileName( const std::string& subdir, const std::string& fileName ); - - std::string getTestOutputErrorFileFullPath( const std::string& subdir, const std::string& fileName ); - - std::string getTestOutputExpectedFileName( const std::string& subdir, const std::string& fileName ); - - std::string getTestOutputExpectedFileFullPath( const std::string& subdir, const std::string& fileName ); - - void deleteTestOutputFiles(); -} + +void generateExpectedFile(const std::string &subdir, const std::string &fileName); + +::ezxml::XDocPtr readInputFile(const std::string &subdir, const std::string &fileName); + +void setXmlDeclaration(::ezxml::XDocPtr &xdoc); + +bool getIsScorePartwise(const ::ezxml::XDocPtr &xdoc); + +void setDoctype(::ezxml::XDocPtr &xdoc, bool isScorePartwise); + +void setRootMusicXmlVersion(::ezxml::XDocPtr &xdoc, bool isScorePartwsise); + +std::string getExpectedFileName(const std::string &subdir, const std::string &fileName); + +std::string getExpectedFileFullPath(const std::string &subdir, const std::string &fileName); + +void deleteExpectedFiles(); + +void generateExpectedFiles(); + +std::string gettestOutputErrorFileName(const std::string &subdir, const std::string &fileName); + +std::string getTestOutputErrorFileFullPath(const std::string &subdir, const std::string &fileName); + +std::string getTestOutputExpectedFileName(const std::string &subdir, const std::string &fileName); + +std::string getTestOutputExpectedFileFullPath(const std::string &subdir, const std::string &fileName); + +void deleteTestOutputFiles(); +} // namespace mxtest #endif diff --git a/Sourcecode/private/mxtest/import/ImportTest.cpp b/Sourcecode/private/mxtest/import/ImportTest.cpp index 94d4a5275..c48b32359 100644 --- a/Sourcecode/private/mxtest/import/ImportTest.cpp +++ b/Sourcecode/private/mxtest/import/ImportTest.cpp @@ -5,10 +5,10 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_IMPORT_TESTS +#include "ExpectedFiles.h" +#include "cpul/cpulTestHarness.h" #include "mxtest/file/MxFileTestGroup.h" #include "mxtest/file/Path.h" -#include "cpul/cpulTestHarness.h" -#include "ExpectedFiles.h" #include "mxtest/import/ImportTestImpl.h" #include @@ -22,11 +22,12 @@ using namespace mxtest; #define MXTEST_DELETE_EXPECTED_FILES #ifdef MXTEST_DELETE_EXPECTED_FILES - TEST( DeleteExpected, Import ) - { - mxtest::deleteExpectedFiles(); - } - T_END +TEST(DeleteExpected, Import) +{ + mxtest::deleteExpectedFiles(); +} + +T_END #endif ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -35,11 +36,12 @@ using namespace mxtest; #define MXTEST_GENERATE_EXPECTED_FILES #ifdef MXTEST_GENERATE_EXPECTED_FILES - TEST( GenerateExpected, Import ) - { - mxtest::generateExpectedFiles(); - } - T_END +TEST(GenerateExpected, Import) +{ + mxtest::generateExpectedFiles(); +} + +T_END #endif ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -48,11 +50,12 @@ using namespace mxtest; #define MXTEST_DELETE_TEST_OUTPUT_FILES #ifdef MXTEST_DELETE_TEST_OUTPUT_FILES - TEST( DeleteTestOutputFiles, Import ) - { - mxtest::deleteTestOutputFiles(); - } - T_END +TEST(DeleteTestOutputFiles, Import) +{ + mxtest::deleteTestOutputFiles(); +} + +T_END #endif ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -61,26 +64,22 @@ using namespace mxtest; #define MXTEST_CREATE_CSV_FILE #ifdef MXTEST_CREATE_CSV_FILE - TEST( CreateCsvFile, Import ) - { - std::string csvFilePath = mxtest::getTestRecordFilepath(); - deleteFileNoThrow( csvFilePath ); - std::ofstream ofile; - openAppendFile( ofile, csvFilePath ); - ofile << mxtest::ImportRoundTripResult::getHeaderRow() << std::endl; - ofile.close(); - } - T_END +TEST(CreateCsvFile, Import) +{ + std::string csvFilePath = mxtest::getTestRecordFilepath(); + deleteFileNoThrow(csvFilePath); + std::ofstream ofile; + openAppendFile(ofile, csvFilePath); + ofile << mxtest::ImportRoundTripResult::getHeaderRow() << std::endl; + ofile.close(); +} + +T_END #endif ////////////////////////////////////////////////////////////////////////////////////////////////////////// -MxFileTestGroup instance -{ - MX_COMPILE_MAX_FILE_SIZE_BYTES, // maxFileSizeBytes - "XML Import Tests", - __FILE__, - __LINE__ -}; +MxFileTestGroup instance{MX_COMPILE_MAX_FILE_SIZE_BYTES, // maxFileSizeBytes + "XML Import Tests", __FILE__, __LINE__}; #endif diff --git a/Sourcecode/private/mxtest/import/ImportTestImpl.cpp b/Sourcecode/private/mxtest/import/ImportTestImpl.cpp index ffb23bb7d..13e78bb5a 100644 --- a/Sourcecode/private/mxtest/import/ImportTestImpl.cpp +++ b/Sourcecode/private/mxtest/import/ImportTestImpl.cpp @@ -7,8 +7,8 @@ #include "ImportTestImpl.h" #include "ezxml/XFactory.h" -#include "mxtest/file/StupidFileFunctions.h" #include "mxtest/file/Path.h" +#include "mxtest/file/StupidFileFunctions.h" #include "mxtest/import/ExpectedFiles.h" #include "mxtest/import/SortAttributes.h" @@ -19,459 +19,436 @@ using namespace mx::core; namespace mxtest { - - std::string ImportRoundTripResult::getHeaderRow() - { - std::stringstream ss; - ss << "testName" << ","; - ss << "testResult" << ","; - ss << "percentMatch" << ","; - ss << "totalMs" << ","; - ss << "xdocLoadMs" << ","; - ss << "mxLoadMs" << ","; - ss << "mxSaveMs" << ","; - ss << "strCompareMs" << ","; - ss << "xdocSaveMs" << ","; - ss << "inputFileName" << ","; - ss << "message"; - return ss.str(); - } - - - std::string ImportRoundTripResult::getMessageNoCommas() const + +std::string ImportRoundTripResult::getHeaderRow() +{ + std::stringstream ss; + ss << "testName" << ","; + ss << "testResult" << ","; + ss << "percentMatch" << ","; + ss << "totalMs" << ","; + ss << "xdocLoadMs" << ","; + ss << "mxLoadMs" << ","; + ss << "mxSaveMs" << ","; + ss << "strCompareMs" << ","; + ss << "xdocSaveMs" << ","; + ss << "inputFileName" << ","; + ss << "message"; + return ss.str(); +} + +std::string ImportRoundTripResult::getMessageNoCommas() const +{ + std::stringstream ss; + for (auto c = message.cbegin(); c != message.cend(); ++c) { - std::stringstream ss; - for( auto c = message.cbegin(); c != message.cend(); ++c ) + if (*c != ',' && *c != '\n' && *c != '\r' && *c != '\t' && *c != ';') { - if( *c != ',' && *c != '\n' && *c != '\r' && *c != '\t' && *c != ';' ) - { - ss << (*c); - } - else - { - ss << "_"; - } + ss << (*c); + } + else + { + ss << "_"; } - return ss.str().substr( 0, 128 ); } - - void ImportRoundTripResult::writeRow( std::ostream& os ) const + return ss.str().substr(0, 128); +} + +void ImportRoundTripResult::writeRow(std::ostream &os) const +{ + os << testName << ","; + os << testResult << ","; + os.precision(4); + os << percentMatch << ","; + os << totalMs << ","; + os << xdocLoadMs << ","; + os << mxLoadMs << ","; + os << mxSaveMs << ","; + os << strCompareMs << ","; + os << xdocSaveMs << ","; + os << inputFileName << ","; + os << getMessageNoCommas() << std::endl; +} + +ImportRoundTripTest::ImportRoundTripTest(const char *const paramInputFileNamePart, + const char *const paramInputFileExtensionPart, + const char *const paramInputSuiteName, const char *const paramTestCppFileName, + const int paramTestCppLineNum, const char *const paramResourceDirectoryPath) + : myInputFileNamePart(paramInputFileNamePart), myInputFileExtensionPart(paramInputFileExtensionPart), + myInputSuiteName(paramInputSuiteName), myTestCppFileName(paramTestCppFileName), + myTestCppLineNum(paramTestCppLineNum), myResourceDirectoryPath(paramResourceDirectoryPath), myTestTimer(), + myXdocLoadTimer(), myMxDeserializeTimer(), myMxReserializeTimer(), myTestCompareTimer(), myXdocWriteTimer(), + myIsMxBypassed(false) +{ +} + +bool ImportRoundTripTest::runTest(std::stringstream &outMessage) +{ + std::string inputFilePath = filePath(myInputSuiteName, getFileName()); + std::string expectedFilePath = getExpectedFileFullPath(myInputSuiteName, getFileName()); + + auto inputXDoc = XFactory::makeXDoc(); + auto expectedXDoc = XFactory::makeXDoc(); + auto reserializedXDoc = XFactory::makeXDoc(); + auto resultantMxDoc = makeDocument(); + + myTestTimer.start(); + + if (!loadTestFile(outMessage, inputXDoc, inputFilePath)) { - os << testName << ","; - os << testResult << ","; - os.precision(4); - os << percentMatch << ","; - os << totalMs << ","; - os << xdocLoadMs << ","; - os << mxLoadMs << ","; - os << mxSaveMs << ","; - os << strCompareMs << ","; - os << xdocSaveMs << ","; - os << inputFileName << ","; - os << getMessageNoCommas() << std::endl; + return false; } - - - ImportRoundTripTest::ImportRoundTripTest( - const char* const paramInputFileNamePart, - const char* const paramInputFileExtensionPart, - const char* const paramInputSuiteName, - const char* const paramTestCppFileName, - const int paramTestCppLineNum, - const char* const paramResourceDirectoryPath ) - : myInputFileNamePart( paramInputFileNamePart ) - , myInputFileExtensionPart( paramInputFileExtensionPart ) - , myInputSuiteName( paramInputSuiteName ) - , myTestCppFileName( paramTestCppFileName ) - , myTestCppLineNum( paramTestCppLineNum ) - , myResourceDirectoryPath( paramResourceDirectoryPath ) - , myTestTimer() - , myXdocLoadTimer() - , myMxDeserializeTimer() - , myMxReserializeTimer() - , myTestCompareTimer() - , myXdocWriteTimer() - , myIsMxBypassed( false ) + + myXdocLoadTimer.start(); + + if (!loadExpectedFile(outMessage, expectedXDoc, expectedFilePath)) { - + return false; } - - bool ImportRoundTripTest::runTest( std::stringstream& outMessage ) + + myXdocLoadTimer.stop(); + myMxDeserializeTimer.start(); + + bool isLoadIntoMxClassesSuccessful = false; + isLoadIntoMxClassesSuccessful = loadIntoMxClasses(outMessage, inputXDoc, resultantMxDoc); + + myMxDeserializeTimer.stop(); + myMxReserializeTimer.start(); + + if (myIsMxBypassed) { - std::string inputFilePath = filePath( myInputSuiteName, getFileName() ); - std::string expectedFilePath = getExpectedFileFullPath( myInputSuiteName, getFileName() ); - - auto inputXDoc = XFactory::makeXDoc(); - auto expectedXDoc = XFactory::makeXDoc(); - auto reserializedXDoc = XFactory::makeXDoc(); - auto resultantMxDoc = makeDocument(); - - myTestTimer.start(); - - if( !loadTestFile( outMessage, inputXDoc, inputFilePath ) ) - { - return false; - } - - myXdocLoadTimer.start(); - - if( !loadExpectedFile( outMessage, expectedXDoc, expectedFilePath ) ) + loadExpectedFile(outMessage, reserializedXDoc, expectedFilePath); + } + else + { + if (!reserializeToXDoc(outMessage, resultantMxDoc, reserializedXDoc)) { return false; } - - myXdocLoadTimer.stop(); - myMxDeserializeTimer.start(); - - bool isLoadIntoMxClassesSuccessful = false; - isLoadIntoMxClassesSuccessful = loadIntoMxClasses( outMessage, inputXDoc, resultantMxDoc ); - - myMxDeserializeTimer.stop(); - myMxReserializeTimer.start(); - - if( myIsMxBypassed ) - { - loadExpectedFile( outMessage, reserializedXDoc, expectedFilePath ); - } - else + } + + myMxReserializeTimer.stop(); + myTestCompareTimer.start(); + + std::stringstream expectedSstr; + std::stringstream actualSstr; + expectedXDoc->saveStream(expectedSstr); + reserializedXDoc->saveStream(actualSstr); + std::string expected = expectedSstr.str(); + std::string actual = actualSstr.str(); + double percentMatch = 0.0; + auto isCheckEqualSuccessful = checkEqual(outMessage, expected, actual, percentMatch); + + myTestCompareTimer.stop(); + myXdocWriteTimer.start(); + + if (!writeErrorFiles(isCheckEqualSuccessful, expected, actual)) + { + return false; + } + + myXdocWriteTimer.stop(); + auto resultInfo = createInfo(outMessage.str(), isCheckEqualSuccessful, percentMatch); + myTestTimer.stop(); + + if (!writeResultToOutputFile(resultInfo)) + { + return false; + } + + return isCheckEqualSuccessful && isLoadIntoMxClassesSuccessful; +} + +std::string ImportRoundTripTest::getTestName() const +{ + std::stringstream name; + name << myInputSuiteName << "_" << myInputFileNamePart; + return name.str(); +} + +std::string ImportRoundTripTest::getFileName() const +{ + return myInputFileNamePart + "." + myInputFileExtensionPart; +} + +std::ostream &ImportRoundTripTest::streamValues(std::ostream &os) const +{ + os << "inputFileNamePart: " << myInputFileNamePart << ", "; + os << "inputFileExtensionPart: " << myInputFileExtensionPart << ", "; + os << "inputSuiteName: " << myInputSuiteName << ", "; + os << "testCppFileName: " << myTestCppFileName << ", "; + os << "testCppLineNum: " << myTestCppLineNum << ", "; + os << "resourceDirectoryPath: " << myResourceDirectoryPath; + return os; +} + +void ImportRoundTripTest::setIsMxBypassed(bool value) +{ + myIsMxBypassed = value; +} + +bool ImportRoundTripTest::loadTestFile(std::ostream &msg, ::ezxml::XDocPtr &outXDoc, const std::string &filepath) +{ + try + { + outXDoc->loadFile(filepath); + auto root = outXDoc->getRoot(); + + for (auto it = root->attributesBegin(); it != root->attributesEnd(); ++it) { - if( !reserializeToXDoc( outMessage, resultantMxDoc, reserializedXDoc ) ) + if (it->getName() == "version") { - return false; + it->setValue("3.0"); + return true; } } - - myMxReserializeTimer.stop(); - myTestCompareTimer.start(); - - std::stringstream expectedSstr; - std::stringstream actualSstr; - expectedXDoc->saveStream( expectedSstr ); - reserializedXDoc->saveStream( actualSstr ); - std::string expected = expectedSstr.str(); - std::string actual = actualSstr.str(); - double percentMatch = 0.0; - auto isCheckEqualSuccessful = checkEqual( outMessage, expected, actual, percentMatch ); - - - myTestCompareTimer.stop(); - myXdocWriteTimer.start(); - - if( !writeErrorFiles( isCheckEqualSuccessful, expected, actual ) ) - { - return false; - } - myXdocWriteTimer.stop(); - auto resultInfo = createInfo( outMessage.str(), isCheckEqualSuccessful, percentMatch ); - myTestTimer.stop(); - - if( !writeResultToOutputFile( resultInfo ) ) - { - return false; - } + root->appendAttribute("version")->setValue("3.0"); + } + catch (std::exception &e) + { + msg << "exception occurred while loading xml file '" << filepath << "', exception message '" << e.what() << "'"; + return false; + } + return true; +} - - return isCheckEqualSuccessful && isLoadIntoMxClassesSuccessful; +bool ImportRoundTripTest::loadExpectedFile(std::ostream &msg, ::ezxml::XDocPtr &outXDoc, const std::string &filepath) +{ + try + { + outXDoc->loadFile(filepath); } - - std::string ImportRoundTripTest::getTestName() const + catch (std::exception &e) { - std::stringstream name; - name << myInputSuiteName << "_" << myInputFileNamePart; - return name.str(); + msg << "exception occurred while loading xml file '" << filepath << "', exception message '" << e.what() << "'"; + return false; } - - - std::string ImportRoundTripTest::getFileName() const + return true; +} + +bool ImportRoundTripTest::loadIntoMxClasses(std::ostream &msg, const ::ezxml::XDocPtr &inXdoc, + mx::core::DocumentPtr &outMx) +{ + if (myIsMxBypassed) { - return myInputFileNamePart + "." + myInputFileExtensionPart; + return true; } - - - std::ostream& ImportRoundTripTest::streamValues( std::ostream& os ) const + + std::stringstream xdocMsg; + bool isSuccess = false; + try { - os << "inputFileNamePart: " << myInputFileNamePart << ", "; - os << "inputFileExtensionPart: " << myInputFileExtensionPart << ", "; - os << "inputSuiteName: " << myInputSuiteName << ", "; - os << "testCppFileName: " << myTestCppFileName << ", "; - os << "testCppLineNum: " << myTestCppLineNum << ", "; - os << "resourceDirectoryPath: " << myResourceDirectoryPath; - return os; + isSuccess = outMx->fromXDoc(xdocMsg, *inXdoc); } - - void ImportRoundTripTest::setIsMxBypassed( bool value ) + catch (std::exception &e) { - myIsMxBypassed = value; + msg << "exception occurred in fromXDoc '" << e.what() << "' "; + msg << "additional messages from xdoc, if any '" << xdocMsg.str() << "'"; + return false; } - - - bool ImportRoundTripTest::loadTestFile( std::ostream& msg, ::ezxml::XDocPtr& outXDoc, const std::string& filepath ) + if (!isSuccess) { - try - { - outXDoc->loadFile( filepath ); - auto root = outXDoc->getRoot(); - - for( auto it = root->attributesBegin(); it != root->attributesEnd(); ++it ) - { - if( it->getName() == "version" ) - { - it->setValue( "3.0" ); - return true; - } - } - - root->appendAttribute( "version" )->setValue( "3.0" ); + msg << xdocMsg.str(); + } + return isSuccess; +} - } - catch ( std::exception& e ) - { - msg << "exception occurred while loading xml file '" << filepath << "', exception message '" << e.what() << "'"; - return false; - } +bool ImportRoundTripTest::reserializeToXDoc(std::ostream &msg, const mx::core::DocumentPtr &inMx, + ::ezxml::XDocPtr &outXDoc) +{ + if (myIsMxBypassed) + { return true; } - - - bool ImportRoundTripTest::loadExpectedFile( std::ostream& msg, ::ezxml::XDocPtr& outXDoc, const std::string& filepath ) + + try { - try - { - outXDoc->loadFile( filepath ); - } - catch ( std::exception& e ) - { - msg << "exception occurred while loading xml file '" << filepath << "', exception message '" << e.what() << "'"; - return false; - } - return true; + inMx->toXDoc(*outXDoc); + + // because attribute order doesn't matter in xml, we need to sort them alphabetically before and after round + // trip + sortAttributes(*outXDoc); } - - - bool ImportRoundTripTest::loadIntoMxClasses( std::ostream& msg, const ::ezxml::XDocPtr& inXdoc, mx::core::DocumentPtr& outMx ) + catch (std::exception &e) { - if( myIsMxBypassed ) - { - return true; - } + msg << "exception occurred in toXDoc '" << e.what() << "'"; + + const std::string filename = getTestOutputErrorFileFullPath(myInputSuiteName, getFileName()); + + std::ofstream errorFile; + openOutputFile(errorFile, filename); + inMx->toStream(errorFile); + errorFile.close(); + + return false; + } + return true; +} + +bool ImportRoundTripTest::checkEqual(std::ostream &msg, const std::string &inExpected, const std::string &inActual, + double &outPercentMatch) +{ + outPercentMatch = 0.0; + std::vector> failurePositions; + int charPosition = 1; + int lineNumber = 1; + int totalCharCount = 0; + int failedCharCount = 0; + int matchingCharCount = 0; + bool isEqual = true; + std::string::const_iterator eit = inExpected.cbegin(); + std::string::const_iterator ait = inActual.cbegin(); + std::string::const_iterator eend = inExpected.cend(); + std::string::const_iterator aend = inActual.cend(); + bool isExpectedLongerThanActual = false; + bool isActualLongerThanExpected = false; + for (; (eit != eend) && (ait != aend); ++eit, ++ait) + { + bool eIsEnd = (eit == eend); + bool aIsEnd = (ait == aend); - std::stringstream xdocMsg; - bool isSuccess = false; - try + if (!eIsEnd) { - isSuccess = outMx->fromXDoc( xdocMsg, *inXdoc ); + ++totalCharCount; } - catch ( std::exception& e ) + + if (eIsEnd && !aIsEnd) { - msg << "exception occurred in fromXDoc '" << e.what() << "' "; - msg << "additional messages from xdoc, if any '" << xdocMsg.str() << "'"; - return false; + ++failedCharCount; + isEqual = false; + + if (!isActualLongerThanExpected) + { + msg << "actual has more characters than expected "; + } + + isActualLongerThanExpected = true; + continue; } - if( !isSuccess ) + + if (!eIsEnd && aIsEnd) { - msg << xdocMsg.str(); + ++failedCharCount; + isEqual = false; + + if (!isExpectedLongerThanActual) + { + msg << "actual has fewer characters than expected "; + } + + isExpectedLongerThanActual = true; + continue; } - return isSuccess; - } - - - bool ImportRoundTripTest::reserializeToXDoc( std::ostream& msg, const mx::core::DocumentPtr& inMx, ::ezxml::XDocPtr& outXDoc ) - { - if( myIsMxBypassed ) + + if (eIsEnd || aIsEnd) { - return true; + continue; } - - try + + char e = *eit; + char a = *ait; + + if (e == '\n') { - inMx->toXDoc( *outXDoc ); - - // because attribute order doesn't matter in xml, we need to sort them alphabetically before and after round trip - sortAttributes( *outXDoc ); + ++lineNumber; + charPosition = 0; } - catch ( std::exception& e ) + else { - msg << "exception occurred in toXDoc '" << e.what() << "'"; - - const std::string filename = getTestOutputErrorFileFullPath( myInputSuiteName, getFileName() ); - - std::ofstream errorFile; - openOutputFile( errorFile, filename ); - inMx->toStream( errorFile ); - errorFile.close(); - - return false; + ++charPosition; } - return true; - } - - - bool ImportRoundTripTest::checkEqual( std::ostream& msg, const std::string& inExpected, const std::string& inActual, double& outPercentMatch ) - { - outPercentMatch = 0.0; - std::vector> failurePositions; - int charPosition = 1; - int lineNumber = 1; - int totalCharCount = 0; - int failedCharCount = 0; - int matchingCharCount = 0; - bool isEqual = true; - - std::string::const_iterator eit = inExpected.cbegin(); - std::string::const_iterator ait = inActual.cbegin(); - std::string::const_iterator eend = inExpected.cend(); - std::string::const_iterator aend = inActual.cend(); - bool isExpectedLongerThanActual = false; - bool isActualLongerThanExpected = false; - for( ; ( eit != eend ) && ( ait != aend ); ++eit, ++ait ) + + if (e != a) { - bool eIsEnd = ( eit == eend ); - bool aIsEnd = ( ait == aend ); - - if( !eIsEnd ) - { - ++totalCharCount; - } - - if( eIsEnd && !aIsEnd ) - { - ++failedCharCount; - isEqual = false; - - if( !isActualLongerThanExpected ) - { - msg << "actual has more characters than expected "; - } - - isActualLongerThanExpected = true; - continue; - } - - if( !eIsEnd && aIsEnd ) - { - ++failedCharCount; - isEqual = false; - - if( !isExpectedLongerThanActual ) - { - msg << "actual has fewer characters than expected "; - } - - isExpectedLongerThanActual = true; - continue; - } - - if( eIsEnd || aIsEnd ) + isEqual = false; + failurePositions.push_back(std::pair(lineNumber, charPosition)); + if (failurePositions.size() == 1) { - continue; - } - - char e = *eit; - char a = *ait; - - if( e == '\n' ) - { - ++lineNumber; - charPosition = 0; - } - else - { - ++charPosition; - } - - if( e != a ) - { - isEqual = false; - failurePositions.push_back( std::pair( lineNumber, charPosition ) ); - if( failurePositions.size() == 1 ) - { - msg << getTestName() << " "; - msg << "first non matching char found at lineNumber " << lineNumber; - msg << ", charPosition " << charPosition << ". expected '" << e << "' "; - msg << "but was '" << a << "' "; - } - ++failedCharCount; - } - else - { - ++matchingCharCount; + msg << getTestName() << " "; + msg << "first non matching char found at lineNumber " << lineNumber; + msg << ", charPosition " << charPosition << ". expected '" << e << "' "; + msg << "but was '" << a << "' "; } + ++failedCharCount; } - - if( inExpected.size() > 0 ) - { - outPercentMatch = ( static_cast( matchingCharCount ) / static_cast( inExpected.size() ) ); - } - - if( !isEqual || failurePositions.size() > 0 || failedCharCount > 0 ) + else { - msg << "total expected characters " << inExpected.size() << ", total matching characters " << matchingCharCount << ", "; - msg << "match percent " << outPercentMatch << " "; + ++matchingCharCount; } - - return isEqual && failurePositions.size() == 0 && failedCharCount == 0; } - - - ImportRoundTripResult ImportRoundTripTest::createInfo( const std::string& msg, bool success, const double percentMatch ) + + if (inExpected.size() > 0) { - ImportRoundTripResult result; - result.testName = getTestName(); - result.testResult = success ? "Passed" : "Failed"; - result.percentMatch = percentMatch; - result.totalMs = myTestTimer.getMilliseconds(); - result.xdocLoadMs = myXdocLoadTimer.getMilliseconds(); - result.mxLoadMs = myMxDeserializeTimer.getMilliseconds(); - result.mxSaveMs = myMxReserializeTimer.getMilliseconds(); - result.strCompareMs = myTestCompareTimer.getMilliseconds(); - result.xdocSaveMs = myXdocWriteTimer.getMilliseconds(); - result.inputFileName = getFileName(); - result.message = msg; - return result; + outPercentMatch = (static_cast(matchingCharCount) / static_cast(inExpected.size())); } - - - bool ImportRoundTripTest::writeResultToOutputFile( const ImportRoundTripResult& info ) + + if (!isEqual || failurePositions.size() > 0 || failedCharCount > 0) { - std::ofstream ofile( getTestRecordFilepath(), std::ios::app ); - if( !ofile.is_open() ) - { - return false; - } - ofile.setf( std::ios::fixed, std:: ios::floatfield ); - info.writeRow( ofile ); - ofile.close(); - return true; + msg << "total expected characters " << inExpected.size() << ", total matching characters " << matchingCharCount + << ", "; + msg << "match percent " << outPercentMatch << " "; } - - - bool ImportRoundTripTest::writeErrorFiles( bool isSuccess, const std::string& expectedContents, const std::string& actualContents ) - { - if( isSuccess ) - { - // no need to write the files - return true; - } + return isEqual && failurePositions.size() == 0 && failedCharCount == 0; +} - std::string testOutputErrorFilePath = getTestOutputErrorFileFullPath( myInputSuiteName, getFileName() ); - std::string testOutputExpectedFilePath = getTestOutputExpectedFileFullPath( myInputSuiteName, getFileName() ); - - std::ofstream errorFile; - openOutputFile( errorFile, testOutputErrorFilePath ); - errorFile << actualContents; - errorFile.close(); - - std::ofstream expectedFile; - openOutputFile( expectedFile, testOutputExpectedFilePath ); - expectedFile << expectedContents; - expectedFile.close(); - +ImportRoundTripResult ImportRoundTripTest::createInfo(const std::string &msg, bool success, const double percentMatch) +{ + ImportRoundTripResult result; + result.testName = getTestName(); + result.testResult = success ? "Passed" : "Failed"; + result.percentMatch = percentMatch; + result.totalMs = myTestTimer.getMilliseconds(); + result.xdocLoadMs = myXdocLoadTimer.getMilliseconds(); + result.mxLoadMs = myMxDeserializeTimer.getMilliseconds(); + result.mxSaveMs = myMxReserializeTimer.getMilliseconds(); + result.strCompareMs = myTestCompareTimer.getMilliseconds(); + result.xdocSaveMs = myXdocWriteTimer.getMilliseconds(); + result.inputFileName = getFileName(); + result.message = msg; + return result; +} + +bool ImportRoundTripTest::writeResultToOutputFile(const ImportRoundTripResult &info) +{ + std::ofstream ofile(getTestRecordFilepath(), std::ios::app); + if (!ofile.is_open()) + { + return false; + } + ofile.setf(std::ios::fixed, std::ios::floatfield); + info.writeRow(ofile); + ofile.close(); + return true; +} + +bool ImportRoundTripTest::writeErrorFiles(bool isSuccess, const std::string &expectedContents, + const std::string &actualContents) +{ + if (isSuccess) + { + // no need to write the files return true; } + std::string testOutputErrorFilePath = getTestOutputErrorFileFullPath(myInputSuiteName, getFileName()); + std::string testOutputExpectedFilePath = getTestOutputExpectedFileFullPath(myInputSuiteName, getFileName()); + + std::ofstream errorFile; + openOutputFile(errorFile, testOutputErrorFilePath); + errorFile << actualContents; + errorFile.close(); + + std::ofstream expectedFile; + openOutputFile(expectedFile, testOutputExpectedFilePath); + expectedFile << expectedContents; + expectedFile.close(); + + return true; } +} // namespace mxtest + #endif diff --git a/Sourcecode/private/mxtest/import/ImportTestImpl.h b/Sourcecode/private/mxtest/import/ImportTestImpl.h index 2a837ac37..48499d6dc 100644 --- a/Sourcecode/private/mxtest/import/ImportTestImpl.h +++ b/Sourcecode/private/mxtest/import/ImportTestImpl.h @@ -6,168 +6,146 @@ #include "mxtest/control/CompileControl.h" #ifdef MX_COMPILE_IMPORT_TESTS -#include "mxtest/file/MxFileTest.h" #include "cpul/cpulTestHarness.h" #include "cpul/cpulTestTimer.h" -#include "cpul/cpulTestHarness.h" -#include "ezxml/XFactory.h" #include "ezxml/XDoc.h" -#include "mxtest/file/Path.h" -#include "mxtest/file/MxFileRepository.h" +#include "ezxml/XFactory.h" #include "mx/core/Document.h" +#include "mxtest/file/MxFileRepository.h" +#include "mxtest/file/MxFileTest.h" +#include "mxtest/file/Path.h" #include -#include #include +#include -#define MXTEST_IMPORT_ROUNDTRIP(GROUPNAME,FNAME_PART,FEXT,IMPORT_DIR) \ -class GROUPNAME##FNAME_PART##Test : public Test \ -{ \ -public: \ - GROUPNAME##FNAME_PART##Test () \ - :Test ("TEST(" #GROUPNAME ", " #FNAME_PART ")", __FILE__, __LINE__) {} \ -void runTest (TestResult& rEsUlT_); \ -} GROUPNAME##FNAME_PART##Instance; \ -void GROUPNAME##FNAME_PART##Test::runTest (TestResult& rEsUlT_) \ -{ \ - mxtest::ImportRoundTripTest test( \ - #FNAME_PART, \ - #FEXT, \ - #GROUPNAME, \ - __FILE__, \ - __LINE__, \ - IMPORT_DIR); \ - \ - bool isSuccess = false; \ - std::stringstream msgsstr; \ - test.setIsMxBypassed( false ); \ - \ - \ - - -#define MXTEST_IMPORT_ROUNDTRIP_END } \ - \ +#define MXTEST_IMPORT_ROUNDTRIP(GROUPNAME, FNAME_PART, FEXT, IMPORT_DIR) \ + class GROUPNAME##FNAME_PART##Test : public Test \ + { \ + public: \ + GROUPNAME##FNAME_PART##Test() : Test("TEST(" #GROUPNAME ", " #FNAME_PART ")", __FILE__, __LINE__) \ + { \ + } \ + void runTest(TestResult &rEsUlT_); \ + } GROUPNAME##FNAME_PART##Instance; \ + void GROUPNAME##FNAME_PART##Test::runTest(TestResult &rEsUlT_) \ + { \ + mxtest::ImportRoundTripTest test(#FNAME_PART, #FEXT, #GROUPNAME, __FILE__, __LINE__, IMPORT_DIR); \ + \ + bool isSuccess = false; \ + std::stringstream msgsstr; \ + test.setIsMxBypassed(false); +#define MXTEST_IMPORT_ROUNDTRIP_END } namespace mxtest { - - constexpr const char* const TEST_RECORD_FILENAME = "_MxImportTestResults.csv"; - inline std::string getTestRecordFilepath() - { - std::stringstream ss; - ss << mxtest::getResourcesDirectoryPath() << "testOutput" << FILE_PATH_SEPARATOR; - ss << TEST_RECORD_FILENAME; - return ss.str(); - } - - struct ImportRoundTripResult - { - std::string testName; - std::string testResult; - double percentMatch; - double totalMs; - double xdocLoadMs; - double mxLoadMs; - double mxSaveMs; - double strCompareMs; - double xdocSaveMs; - std::string inputFileName; - std::string message; - - static std::string getHeaderRow(); - std::string getMessageNoCommas() const; - void writeRow( std::ostream& os ) const; - }; - - class ImportRoundTripTest - { - public: - - ImportRoundTripTest( - const char* const paramInputFileNamePart, - const char* const paramInputFileExtensionPart, - const char* const paramInputSuiteName, - const char* const paramTestCppFileName, - const int paramTestCppLineNum, - const char* const paramResourceDirectoryPath ); - - bool runTest( std::stringstream& outMessage ); - std::string getTestName() const; - std::string getFileName() const; - std::ostream& streamValues( std::ostream& os ) const; - - void setIsMxBypassed( bool value ); - - private: - const std::string myInputFileNamePart; - const std::string myInputFileExtensionPart; - const std::string myInputSuiteName; - const std::string myTestCppFileName; - const int myTestCppLineNum; - const std::string myResourceDirectoryPath; - cpul::TestTimer myTestTimer; - cpul::TestTimer myXdocLoadTimer; - cpul::TestTimer myMxDeserializeTimer; - cpul::TestTimer myMxReserializeTimer; - cpul::TestTimer myTestCompareTimer; - cpul::TestTimer myXdocWriteTimer; - bool myIsMxBypassed; - - bool loadTestFile( std::ostream& msg, ::ezxml::XDocPtr& outXDoc, const std::string& filepath ); - bool loadExpectedFile( std::ostream& msg, ::ezxml::XDocPtr& outXDoc, const std::string& filepath ); - bool loadIntoMxClasses( std::ostream& msg, const ::ezxml::XDocPtr& inXdoc, mx::core::DocumentPtr& outMx ); - bool reserializeToXDoc( std::ostream& msg, const mx::core::DocumentPtr& inMx, ::ezxml::XDocPtr& outXDoc ); - bool checkEqual( std::ostream& msg, const std::string& inExpected, const std::string& inActual, double& outPercentMatch ); - ImportRoundTripResult createInfo( const std::string& msg, bool success, const double percentMatch ); - bool writeResultToOutputFile( const ImportRoundTripResult& info ); - bool writeErrorFiles( bool isSuccess, const std::string& expectedContents, const std::string& actualContents ); - }; - - inline std::ostream& operator<<( std::ostream& os, const ImportRoundTripTest& value ) - { - return value.streamValues( os ); - } + +constexpr const char *const TEST_RECORD_FILENAME = "_MxImportTestResults.csv"; + +inline std::string getTestRecordFilepath() +{ + std::stringstream ss; + ss << mxtest::getResourcesDirectoryPath() << "testOutput" << FILE_PATH_SEPARATOR; + ss << TEST_RECORD_FILENAME; + return ss.str(); } +struct ImportRoundTripResult +{ + std::string testName; + std::string testResult; + double percentMatch; + double totalMs; + double xdocLoadMs; + double mxLoadMs; + double mxSaveMs; + double strCompareMs; + double xdocSaveMs; + std::string inputFileName; + std::string message; + + static std::string getHeaderRow(); + std::string getMessageNoCommas() const; + void writeRow(std::ostream &os) const; +}; + +class ImportRoundTripTest +{ + public: + ImportRoundTripTest(const char *const paramInputFileNamePart, const char *const paramInputFileExtensionPart, + const char *const paramInputSuiteName, const char *const paramTestCppFileName, + const int paramTestCppLineNum, const char *const paramResourceDirectoryPath); + + bool runTest(std::stringstream &outMessage); + std::string getTestName() const; + std::string getFileName() const; + std::ostream &streamValues(std::ostream &os) const; + + void setIsMxBypassed(bool value); + + private: + const std::string myInputFileNamePart; + const std::string myInputFileExtensionPart; + const std::string myInputSuiteName; + const std::string myTestCppFileName; + const int myTestCppLineNum; + const std::string myResourceDirectoryPath; + cpul::TestTimer myTestTimer; + cpul::TestTimer myXdocLoadTimer; + cpul::TestTimer myMxDeserializeTimer; + cpul::TestTimer myMxReserializeTimer; + cpul::TestTimer myTestCompareTimer; + cpul::TestTimer myXdocWriteTimer; + bool myIsMxBypassed; + + bool loadTestFile(std::ostream &msg, ::ezxml::XDocPtr &outXDoc, const std::string &filepath); + bool loadExpectedFile(std::ostream &msg, ::ezxml::XDocPtr &outXDoc, const std::string &filepath); + bool loadIntoMxClasses(std::ostream &msg, const ::ezxml::XDocPtr &inXdoc, mx::core::DocumentPtr &outMx); + bool reserializeToXDoc(std::ostream &msg, const mx::core::DocumentPtr &inMx, ::ezxml::XDocPtr &outXDoc); + bool checkEqual(std::ostream &msg, const std::string &inExpected, const std::string &inActual, + double &outPercentMatch); + ImportRoundTripResult createInfo(const std::string &msg, bool success, const double percentMatch); + bool writeResultToOutputFile(const ImportRoundTripResult &info); + bool writeErrorFiles(bool isSuccess, const std::string &expectedContents, const std::string &actualContents); +}; + +inline std::ostream &operator<<(std::ostream &os, const ImportRoundTripTest &value) +{ + return value.streamValues(os); +} +} // namespace mxtest + class ImportTestCpul : public mxtest::MxFileTest { -public: - ImportTestCpul( - mxtest::MxFile inTestFile, - std::string inTestName, - std::string inTestCppFileName, - int inTestCppFileLineNumber ) - : mxtest::MxFileTest( inTestFile, inTestName, inTestCppFileName, inTestCppFileLineNumber ) - {} - - + public: + ImportTestCpul(mxtest::MxFile inTestFile, std::string inTestName, std::string inTestCppFileName, + int inTestCppFileLineNumber) + : mxtest::MxFileTest(inTestFile, inTestName, inTestCppFileName, inTestCppFileLineNumber) + { + } + inline void runTestCode() { - mxtest::ImportRoundTripTest test{ - testFileNamePart().c_str(), - testFileExtension().c_str(), - testSubdirectory().c_str(), - testFileName().c_str(), - getCppFileLineNumber(), - testSubdirectory().c_str() }; - + mxtest::ImportRoundTripTest test{testFileNamePart().c_str(), testFileExtension().c_str(), + testSubdirectory().c_str(), testFileName().c_str(), + getCppFileLineNumber(), testSubdirectory().c_str()}; + std::stringstream msgsstr; - test.setIsMxBypassed( false ); - - bool isTestSuccess = test.runTest( msgsstr ); - if( isLoadFailureExpected() ) + test.setIsMxBypassed(false); + + bool isTestSuccess = test.runTest(msgsstr); + if (isLoadFailureExpected()) { - setIsSuccess( !isTestSuccess ); - setFailureMessage( "loading was expected to fail but succeeded instead" ); + setIsSuccess(!isTestSuccess); + setFailureMessage("loading was expected to fail but succeeded instead"); } else { - setIsSuccess( isTestSuccess ); - setFailureMessage( msgsstr.str() ); + setIsSuccess(isTestSuccess); + setFailureMessage(msgsstr.str()); } } - }; #endif diff --git a/Sourcecode/private/mxtest/import/SortAttributes.cpp b/Sourcecode/private/mxtest/import/SortAttributes.cpp index 615efba6d..4d82073d8 100644 --- a/Sourcecode/private/mxtest/import/SortAttributes.cpp +++ b/Sourcecode/private/mxtest/import/SortAttributes.cpp @@ -6,46 +6,44 @@ namespace mxtest { - void sortAttributes( ::ezxml::XDoc& xdoc ) +void sortAttributes(::ezxml::XDoc &xdoc) +{ + sortAttributes(*xdoc.getRoot()); +} + +void sortAttributes(::ezxml::XElement &xelement) +{ + StringMap stringMap; + + for (auto it = xelement.attributesBegin(); it != xelement.attributesEnd(); ++it) { - sortAttributes( *xdoc.getRoot() ); + stringMap[it->getName()] = it->getValue(); } - - - void sortAttributes ( ::ezxml::XElement& xelement ) + + while (xelement.attributesBegin() != xelement.attributesEnd()) { - StringMap stringMap; - - for( auto it = xelement.attributesBegin(); it != xelement.attributesEnd(); ++ it ) - { - stringMap[it->getName()] = it->getValue(); - } - - while( xelement.attributesBegin() != xelement.attributesEnd() ) - { - deleteFirstAttribute( xelement ); - } - - for( auto mapIter = stringMap.cbegin(); mapIter != stringMap.cend(); ++mapIter ) - { - xelement.appendAttribute( mapIter->first )->setValue( mapIter->second ); - } - - if( xelement.getType() == ::ezxml::XElementType::element ) - { - for( auto elementIter = xelement.begin(); elementIter != xelement.end(); ++elementIter ) - { - sortAttributes( *elementIter ); - } - } + deleteFirstAttribute(xelement); + } + + for (auto mapIter = stringMap.cbegin(); mapIter != stringMap.cend(); ++mapIter) + { + xelement.appendAttribute(mapIter->first)->setValue(mapIter->second); } - - - void deleteFirstAttribute( ::ezxml::XElement& xelement ) + + if (xelement.getType() == ::ezxml::XElementType::element) { - if( xelement.attributesBegin() != xelement.attributesEnd() ) + for (auto elementIter = xelement.begin(); elementIter != xelement.end(); ++elementIter) { - xelement.removeAttribute( xelement.attributesBegin() ); + sortAttributes(*elementIter); } } } + +void deleteFirstAttribute(::ezxml::XElement &xelement) +{ + if (xelement.attributesBegin() != xelement.attributesEnd()) + { + xelement.removeAttribute(xelement.attributesBegin()); + } +} +} // namespace mxtest diff --git a/Sourcecode/private/mxtest/import/SortAttributes.h b/Sourcecode/private/mxtest/import/SortAttributes.h index 76922e0f1..0ebc92cb6 100644 --- a/Sourcecode/private/mxtest/import/SortAttributes.h +++ b/Sourcecode/private/mxtest/import/SortAttributes.h @@ -4,25 +4,25 @@ #pragma once +#include "ezxml/XAttribute.h" +#include "ezxml/XAttributeIterator.h" #include "ezxml/XDoc.h" #include "ezxml/XElement.h" -#include "ezxml/XAttribute.h" #include "ezxml/XElementIterator.h" -#include "ezxml/XAttributeIterator.h" #include #include namespace mxtest { - - using StringMap = std::map; - - // unfortunately xml does not care about the order of attributes - // so both the expected and actual files will need to have their - // attributes sorted into alphabetical order so that they match. - - void sortAttributes( ::ezxml::XDoc& xdoc ); - void sortAttributes ( ::ezxml::XElement& xelement ); - void deleteFirstAttribute( ::ezxml::XElement& xelement ); -} + +using StringMap = std::map; + +// unfortunately xml does not care about the order of attributes +// so both the expected and actual files will need to have their +// attributes sorted into alphabetical order so that they match. + +void sortAttributes(::ezxml::XDoc &xdoc); +void sortAttributes(::ezxml::XElement &xelement); +void deleteFirstAttribute(::ezxml::XElement &xelement); +} // namespace mxtest From d51b4a8e5ec468d990af17e42f694042f6ce7c04 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 17:34:44 +0200 Subject: [PATCH 07/34] add clang-tidy config and make lint target --- .clang-tidy | 8 ++++++++ CMakeLists.txt | 1 + Makefile | 15 ++++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..fabba7303 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,8 @@ +Checks: > + -*, + bugprone-*, + modernize-use-nullptr, + modernize-use-override, + performance-* + +HeaderFilterRegex: 'Sourcecode/.*' diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c7afa2e8..af1d0851e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ project(mx) include(GNUInstallDirs) include(CMakePackageConfigHelpers) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CPP_VERSION 17) option(MX_BUILD_TESTS "build or skip the test suite" OFF) diff --git a/Makefile b/Makefile index ac2080320..ec89e5a82 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ define run_bin endef .DEFAULT_GOAL := help -.PHONY: help lib dev core test test-core examples-run all clean check-tools fmt +.PHONY: help lib dev core test test-core examples-run all clean check-tools check-format check-lint fmt lint help: @echo 'mx build/test targets (see comments at the top of the Makefile for rationale):' @@ -117,6 +117,7 @@ help: @echo ' make clean Remove the entire $(BUILD_ROOT)/ tree.' @echo '' @echo ' make fmt Format all C++ files under Sourcecode/.' + @echo ' make lint Run clang-tidy on all C++ files under Sourcecode/.' @echo '' @echo 'Knobs: JOBS (=$(JOBS)) BUILD_TYPE (=$(BUILD_TYPE)) GENERATOR ARGS' @echo 'Layout: $(BUILD_ROOT)//$(BUILD_TYPE)/' @@ -159,18 +160,22 @@ clean: # --- Quality targets -------------------------------------------------------- -check-tools: +check-format: @command -v clang-format >/dev/null 2>&1 || \ { echo "clang-format not found."; \ echo " macOS: brew install clang-format"; \ echo " Linux: sudo apt-get install clang-format"; \ exit 1; } + +check-lint: @command -v clang-tidy >/dev/null 2>&1 || \ { echo "clang-tidy not found."; \ echo " macOS: brew install llvm"; \ echo " Linux: sudo apt-get install clang-tidy"; \ exit 1; } +check-tools: check-format check-lint + FIND_CPP := find Sourcecode \ -path 'Sourcecode/private/cpul' -prune -o \ -name 'pugixml.cpp' -prune -o \ @@ -178,6 +183,10 @@ FIND_CPP := find Sourcecode \ -name 'pugiconfig.hpp' -prune -o \ -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print -fmt: check-tools +fmt: check-format @$(FIND_CPP) | xargs clang-format -i @echo "Formatted all C++ files under Sourcecode/" + +lint: check-lint dev + @$(FIND_CPP) | xargs clang-tidy -p $(call mode_dir,dev) + @echo "Lint complete." From 117f35c3431dd0d543ffc84b37ab2a9ddaf7a846 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 19:49:46 +0200 Subject: [PATCH 08/34] fix latent build errors exposed by formatting Break the circular include between XElementIterator.h and XElementIterImpl.h by forward-declaring XElementIterImpl in the iterator header and defining the destructor/move ops out-of-line. Add missing Converter.h include to LineFunctions.h. Fix run_bin to run the binary from the repo root rather than cd'ing into the build directory. Fix tests that wrote output files to cwd instead of Resources/testOutput/. Gitignore compile_commands.json. --- .gitignore | 1 + Makefile | 6 +++--- .../mx/ezxml/src/include/ezxml/XElementIterImpl.h | 3 --- .../mx/ezxml/src/include/ezxml/XElementIterator.h | 13 +++++++++---- .../ezxml/src/private/private/XElementIterator.cpp | 5 +++++ Sourcecode/private/mx/impl/LineFunctions.h | 1 + Sourcecode/private/mxtest/api/FreezingRoundTrip.cpp | 6 ++++-- Sourcecode/private/mxtest/api/NoteDataTest.cpp | 2 -- 8 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 6c2fcb0ca..e74c9b14c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Sourcecode/private/mxtest/file/PathRoot.h **/xcuserdata/ **/xcshareddata/ *.DS_Store +compile_commands.json diff --git a/Makefile b/Makefile index ec89e5a82..890c9bdef 100644 --- a/Makefile +++ b/Makefile @@ -90,13 +90,13 @@ endef # multi-config ones (MSVC, Xcode), so probe both. $1 = mode dir, $2 = binary # name, $3 = extra args. define run_bin - @d='$(1)'; b='$(2)'; found=''; bindir=''; \ + @d='$(1)'; b='$(2)'; found=''; \ for p in "$$d/$$b" "$$d/$$b.exe" "$$d/$(BUILD_TYPE)/$$b" "$$d/$(BUILD_TYPE)/$$b.exe"; do \ - if [ -x "$$p" ]; then found="$$p"; bindir="$$(dirname $$p)"; break; fi; \ + if [ -x "$$p" ]; then found="$$p"; break; fi; \ done; \ if [ -z "$$found" ]; then echo "error: $$b not found under $$d" >&2; exit 1; fi; \ echo ">> $$found $(3)"; \ - cd "$$bindir" && "$$found" $(3) + "$$found" $(3) endef .DEFAULT_GOAL := help diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h b/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h index f54645619..94e4cc90d 100644 --- a/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h +++ b/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h @@ -8,9 +8,6 @@ namespace ezxml { -class XElementIterImpl; -using XElementIterImplUP = std::unique_ptr; - class XElementIterImpl { public: diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterator.h b/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterator.h index 5c6832650..7b4bb80cf 100644 --- a/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterator.h +++ b/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterator.h @@ -3,12 +3,17 @@ #pragma once #include "ezxml/XElement.h" -#include "ezxml/XElementIterImpl.h" #include #include #include +namespace ezxml +{ +class XElementIterImpl; +using XElementIterImplUP = std::unique_ptr; +} // namespace ezxml + namespace ezxml { class XElementIterator final @@ -18,10 +23,10 @@ class XElementIterator final XElementIterator(); explicit XElementIterator(const XElementIterImpl &impl); XElementIterator(const XElementIterator &other); - XElementIterator(XElementIterator &&other) = default; + XElementIterator(XElementIterator &&other) noexcept; XElementIterator &operator=(const XElementIterator &other); - XElementIterator &operator=(XElementIterator &&other) = default; - ~XElementIterator() = default; + XElementIterator &operator=(XElementIterator &&other) noexcept; + ~XElementIterator(); // STL Iterator Compliance typedef ptrdiff_t difference_type; // ??? diff --git a/Sourcecode/private/mx/ezxml/src/private/private/XElementIterator.cpp b/Sourcecode/private/mx/ezxml/src/private/private/XElementIterator.cpp index 5248586b1..7742a80b2 100644 --- a/Sourcecode/private/mx/ezxml/src/private/private/XElementIterator.cpp +++ b/Sourcecode/private/mx/ezxml/src/private/private/XElementIterator.cpp @@ -1,6 +1,7 @@ // Copyright (c) Matthew James Briggs #include "ezxml/XElementIterator.h" +#include "ezxml/XElementIterImpl.h" namespace ezxml { @@ -8,6 +9,10 @@ XElementIterator::XElementIterator() : myImpl(nullptr) { } +XElementIterator::XElementIterator(XElementIterator &&other) noexcept = default; +XElementIterator &XElementIterator::operator=(XElementIterator &&other) noexcept = default; +XElementIterator::~XElementIterator() = default; + XElementIterator::XElementIterator(const XElementIterImpl &impl) : myImpl(impl.clone()) { } diff --git a/Sourcecode/private/mx/impl/LineFunctions.h b/Sourcecode/private/mx/impl/LineFunctions.h index d397abead..c121d4456 100644 --- a/Sourcecode/private/mx/impl/LineFunctions.h +++ b/Sourcecode/private/mx/impl/LineFunctions.h @@ -6,6 +6,7 @@ #include "mx/api/LineData.h" #include "mx/core/Enums.h" +#include "mx/impl/Converter.h" #include "mx/utility/OptionalMembers.h" namespace mx diff --git a/Sourcecode/private/mxtest/api/FreezingRoundTrip.cpp b/Sourcecode/private/mxtest/api/FreezingRoundTrip.cpp index 9230ee478..63b2ef6ad 100644 --- a/Sourcecode/private/mxtest/api/FreezingRoundTrip.cpp +++ b/Sourcecode/private/mxtest/api/FreezingRoundTrip.cpp @@ -12,6 +12,7 @@ #include "mx/core/elements/MusicDataChoice.h" #include "mxtest/api/RoundTrip.h" #include "mxtest/file/MxFileRepository.h" +#include "mxtest/file/StupidFileFunctions.h" // TODO - replace with specific includes #include "mx/core/Elements.h" @@ -35,8 +36,9 @@ namespace inline bool writeRoundTrip(std::string inFilename) { const auto nameWithoutExtension = mxtest::MxFileRepository::getNameWithoutExtension(inFilename); - const auto outBeforeFilepath = std::string{"./"} + nameWithoutExtension + std::string{"_before.xml"}; - const auto outAfterFilepath = std::string{"./"} + nameWithoutExtension + std::string{"_after.xml"}; + const auto outDir = mxtest::getTestOutputFullDirectoryPath(); + const auto outBeforeFilepath = outDir + nameWithoutExtension + std::string{"_before.xml"}; + const auto outAfterFilepath = outDir + nameWithoutExtension + std::string{"_after.xml"}; const auto scoreData = mxtest::MxFileRepository::loadFile(inFilename); const auto filePath = mxtest::MxFileRepository::getFullPath(inFilename); auto &docMgr = DocumentManager::getInstance(); diff --git a/Sourcecode/private/mxtest/api/NoteDataTest.cpp b/Sourcecode/private/mxtest/api/NoteDataTest.cpp index 4b1aef765..a0ecce53f 100644 --- a/Sourcecode/private/mxtest/api/NoteDataTest.cpp +++ b/Sourcecode/private/mxtest/api/NoteDataTest.cpp @@ -118,8 +118,6 @@ TEST(customArticulation, NoteData) auto docId = mgr.createFromScore(score); std::stringstream ss; mgr.writeToStream(docId, ss); - // TODO - SMUFLKILL - remove - mgr.writeToFile(docId, "./bloop.xml"); mgr.destroyDocument(docId); const std::string xml = ss.str(); std::istringstream iss{xml}; From 98d8c39fc0b11c5fddc0a077b967922b1f55de90 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 20:01:07 +0200 Subject: [PATCH 09/34] add compiler warnings and make check target --- CMakeLists.txt | 8 +++++++- Makefile | 29 ++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af1d0851e..37eea9d83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7.2) +cmake_minimum_required(VERSION 3.13) project(mx) include(GNUInstallDirs) @@ -47,6 +47,12 @@ source_group( "utility" FILES ${SRC_MX_UTILITY} ) source_group( "ezxml" FILES ${SRC_MX_EZXML} ) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD ${CPP_VERSION}) +if(MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE /W4) +else() + target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra) +endif() + target_include_directories(${PROJECT_NAME} PRIVATE ${PRIVATE_DIR}) # these header paths are a little different to make it easier to copy-and-paste the ezxml code over to diff --git a/Makefile b/Makefile index 890c9bdef..8c3f426ee 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ define run_bin endef .DEFAULT_GOAL := help -.PHONY: help lib dev core test test-core examples-run all clean check-tools check-format check-lint fmt lint +.PHONY: help lib dev core test test-core examples-run all clean check-tools check-format check-lint fmt lint check help: @echo 'mx build/test targets (see comments at the top of the Makefile for rationale):' @@ -118,6 +118,7 @@ help: @echo '' @echo ' make fmt Format all C++ files under Sourcecode/.' @echo ' make lint Run clang-tidy on all C++ files under Sourcecode/.' + @echo ' make check Full quality gate: fmt-check + warning-free build + lint.' @echo '' @echo 'Knobs: JOBS (=$(JOBS)) BUILD_TYPE (=$(BUILD_TYPE)) GENERATOR ARGS' @echo 'Layout: $(BUILD_ROOT)//$(BUILD_TYPE)/' @@ -190,3 +191,29 @@ fmt: check-format lint: check-lint dev @$(FIND_CPP) | xargs clang-tidy -p $(call mode_dir,dev) @echo "Lint complete." + +# Detect Windows (MSVC / Git Bash / MSYS2). +IS_WINDOWS := $(if $(filter Windows_NT,$(OS)),1,) + +check: check-tools + @echo "=== fmt-check ===" + @$(FIND_CPP) | xargs clang-format --dry-run --Werror + @echo "=== build (warning-free) ===" + @$(CMAKE) -S . -B $(call mode_dir,dev) \ + -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \ + -DMX_BUILD_TESTS=on \ + -DMX_BUILD_CORE_TESTS=off \ + -DMX_BUILD_EXAMPLES=on \ + $(GEN_ARG) 2>&1 | tee $(BUILD_ROOT)/build.log + @$(CMAKE) --build $(call mode_dir,dev) --parallel $(JOBS) --config $(BUILD_TYPE) 2>&1 \ + | tee -a $(BUILD_ROOT)/build.log; \ + if grep -q 'warning:' $(BUILD_ROOT)/build.log; then \ + echo "ERROR: build emitted warnings (see above)"; exit 1; \ + fi + @if [ -z "$(IS_WINDOWS)" ]; then \ + echo "=== lint ==="; \ + $(FIND_CPP) | xargs clang-tidy -p $(call mode_dir,dev); \ + else \ + echo "=== lint skipped (Windows) ==="; \ + fi + @echo "=== check passed ===" From 86dac1ed2d2cef202db8308a1dc7834512d381da Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 22:30:05 +0200 Subject: [PATCH 10/34] fix compiler and clang-tidy warnings --- Sourcecode/private/mx/core/elements/Lyric.cpp | 7 +++--- Sourcecode/private/mx/impl/DynamicsWriter.cpp | 7 +++--- Sourcecode/private/mx/impl/DynamicsWriter.h | 1 - Sourcecode/private/mx/impl/LyricType.cpp | 6 ++++- Sourcecode/private/mx/impl/MeasureWriter.cpp | 22 +------------------ Sourcecode/private/mx/impl/MeasureWriter.h | 2 +- .../private/mx/impl/NotationsWriter.cpp | 4 ++-- Sourcecode/private/mx/impl/NotationsWriter.h | 1 - Sourcecode/private/mx/impl/NoteFunctions.cpp | 2 +- Sourcecode/private/mx/impl/NoteFunctions.h | 1 - Sourcecode/private/mx/impl/ScoreReader.cpp | 6 ----- Sourcecode/private/mx/impl/SlideFunctions.cpp | 3 ++- .../private/mx/utility/EnumWithString.h | 2 +- 13 files changed, 20 insertions(+), 44 deletions(-) diff --git a/Sourcecode/private/mx/core/elements/Lyric.cpp b/Sourcecode/private/mx/core/elements/Lyric.cpp index e35052e3e..738689a7c 100644 --- a/Sourcecode/private/mx/core/elements/Lyric.cpp +++ b/Sourcecode/private/mx/core/elements/Lyric.cpp @@ -162,7 +162,6 @@ bool Lyric::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) { bool isSuccess = true; isSuccess &= myAttributes->fromXElement(message, xelement); - bool isLyricTextChoiceFound = false; auto endIter = xelement.end(); for (auto it = xelement.begin(); it != endIter; ++it) @@ -171,7 +170,7 @@ bool Lyric::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) if (checkSetChoiceMember(message, *it, isSuccess, myLyricTextChoice, "extend", &LyricTextChoice::getExtend, static_cast(LyricTextChoice::Choice::extend))) { - isLyricTextChoiceFound = true; + continue; } @@ -179,14 +178,14 @@ bool Lyric::fromXElementImpl(std::ostream &message, ::ezxml::XElement &xelement) &LyricTextChoice::getLaughing, static_cast(LyricTextChoice::Choice::laughing))) { - isLyricTextChoiceFound = true; + continue; } else if (checkSetChoiceMember(message, *it, isSuccess, myLyricTextChoice, "humming", &LyricTextChoice::getHumming, static_cast(LyricTextChoice::Choice::humming))) { - isLyricTextChoiceFound = true; + continue; } diff --git a/Sourcecode/private/mx/impl/DynamicsWriter.cpp b/Sourcecode/private/mx/impl/DynamicsWriter.cpp index 38e0e78b0..25aa1f67f 100644 --- a/Sourcecode/private/mx/impl/DynamicsWriter.cpp +++ b/Sourcecode/private/mx/impl/DynamicsWriter.cpp @@ -11,13 +11,14 @@ namespace mx namespace impl { DynamicsWriter::DynamicsWriter(const api::MarkData &inMark, impl::Cursor inCursor) - : myMarkData{inMark}, myCursor{inCursor}, myDirectionPlacement(api::Placement::unspecified), myConverter{} + : myMarkData{inMark}, myCursor{inCursor}, myConverter{} { MX_ASSERT(isMarkDynamic(inMark.markType)); } -DynamicsWriter::DynamicsWriter(const api::MarkData &inMark, impl::Cursor inCursor, api::Placement directionPlacement) - : myMarkData{inMark}, myCursor{inCursor}, myDirectionPlacement(directionPlacement), myConverter{} +DynamicsWriter::DynamicsWriter(const api::MarkData &inMark, impl::Cursor inCursor, + api::Placement /*directionPlacement*/) + : myMarkData{inMark}, myCursor{inCursor}, myConverter{} { MX_ASSERT(isMarkDynamic(inMark.markType)); } diff --git a/Sourcecode/private/mx/impl/DynamicsWriter.h b/Sourcecode/private/mx/impl/DynamicsWriter.h index 2ba69642e..c41e8bbed 100644 --- a/Sourcecode/private/mx/impl/DynamicsWriter.h +++ b/Sourcecode/private/mx/impl/DynamicsWriter.h @@ -29,7 +29,6 @@ class DynamicsWriter private: const api::MarkData &myMarkData; const impl::Cursor myCursor; - const api::Placement myDirectionPlacement; const Converter myConverter; private: diff --git a/Sourcecode/private/mx/impl/LyricType.cpp b/Sourcecode/private/mx/impl/LyricType.cpp index ee34d3b9c..d4bd49f3e 100644 --- a/Sourcecode/private/mx/impl/LyricType.cpp +++ b/Sourcecode/private/mx/impl/LyricType.cpp @@ -8,12 +8,16 @@ namespace mx { namespace impl { -LyricType::LyricType() : mySyllabic(core::SyllabicEnum::single) +LyricType::LyricType() : myText{}, mySyllabic(core::SyllabicEnum::single) { + (void)myText; + (void)mySyllabic; } LyricType::LyricType(const std::string &value, core::SyllabicEnum syllabic) : myText{value}, mySyllabic{syllabic} { + (void)myText; + (void)mySyllabic; } } // namespace impl } // namespace mx diff --git a/Sourcecode/private/mx/impl/MeasureWriter.cpp b/Sourcecode/private/mx/impl/MeasureWriter.cpp index d64c3ed4a..0e5006761 100644 --- a/Sourcecode/private/mx/impl/MeasureWriter.cpp +++ b/Sourcecode/private/mx/impl/MeasureWriter.cpp @@ -397,11 +397,6 @@ void MeasureWriter::writeVoices(const api::StaffData &inStaff) { bool isStartOfChord = false; - // if we are in a chord, and the next note is part of the same chord, then the next note is NOT independent - // if we are in a chord, and the next note is NOT part of the same chord, then the next note IS independent - // if we are NOT in a chord, then the next note IS independent - bool isNextNoteIndependent = true; - myHistory.setChord(noteIter->isChord); const auto &apiNote = *noteIter; writeForwardOrBackupIfNeeded(apiNote); @@ -422,13 +417,7 @@ void MeasureWriter::writeVoices(const api::StaffData &inStaff) if (localNextNoteIter != noteEnd) { - if (localNextNoteIter->isChord) - { - if (localNextNoteIter->tickTimePosition == currentChordTickPosition) - { - isNextNoteIndependent = false; - } - } + (void)localNextNoteIter; } previousChordTickPosition = currentChordTickPosition; @@ -458,15 +447,6 @@ void MeasureWriter::writeVoices(const api::StaffData &inStaff) myPropertiesWriter->flushBuffer(); - int minDirectionTime = myHistory.getCursor().tickTimePosition; - int maxDirectionTime = minDirectionTime + noteIter->durationData.durationTimeTicks; - auto nextNote = noteIter + 1; - - if (nextNote != noteEnd) - { - maxDirectionTime = nextNote->tickTimePosition; - } - { writeDirections(directionIter, directionEnd, noteIter, std::cbegin(voice.second.notes), noteEnd); } diff --git a/Sourcecode/private/mx/impl/MeasureWriter.h b/Sourcecode/private/mx/impl/MeasureWriter.h index dac208dbf..7d8453f55 100644 --- a/Sourcecode/private/mx/impl/MeasureWriter.h +++ b/Sourcecode/private/mx/impl/MeasureWriter.h @@ -52,7 +52,7 @@ class MeasureWriter struct History { - History(const MeasureCursor &inCursor) : myCursor{inCursor}, history{} + History(const MeasureCursor &inCursor) : history{}, myCursor{inCursor} { HistoryRecord record; record.reason = "initialize history"; diff --git a/Sourcecode/private/mx/impl/NotationsWriter.cpp b/Sourcecode/private/mx/impl/NotationsWriter.cpp index 25e1c7343..39b880145 100644 --- a/Sourcecode/private/mx/impl/NotationsWriter.cpp +++ b/Sourcecode/private/mx/impl/NotationsWriter.cpp @@ -83,8 +83,8 @@ namespace mx namespace impl { NotationsWriter::NotationsWriter(const api::NoteData &inNoteData, const MeasureCursor &inCursor, - const ScoreWriter &inScoreWriter) - : myNoteData{inNoteData}, myCursor{inCursor}, myScoreWriter{inScoreWriter}, myConverter{}, myOutNotations{nullptr} + const ScoreWriter & /*inScoreWriter*/) + : myNoteData{inNoteData}, myCursor{inCursor}, myConverter{}, myOutNotations{nullptr} { } diff --git a/Sourcecode/private/mx/impl/NotationsWriter.h b/Sourcecode/private/mx/impl/NotationsWriter.h index 361ca2eed..ca31ff928 100644 --- a/Sourcecode/private/mx/impl/NotationsWriter.h +++ b/Sourcecode/private/mx/impl/NotationsWriter.h @@ -37,7 +37,6 @@ class NotationsWriter private: const api::NoteData &myNoteData; const MeasureCursor &myCursor; - const ScoreWriter &myScoreWriter; const Converter myConverter; mutable core::NotationsPtr myOutNotations; diff --git a/Sourcecode/private/mx/impl/NoteFunctions.cpp b/Sourcecode/private/mx/impl/NoteFunctions.cpp index d6312a984..edff8dcd7 100644 --- a/Sourcecode/private/mx/impl/NoteFunctions.cpp +++ b/Sourcecode/private/mx/impl/NoteFunctions.cpp @@ -69,7 +69,7 @@ namespace mx namespace impl { NoteFunctions::NoteFunctions(const core::Note &inMxNote, impl::Cursor inCursor) - : myNote{inMxNote}, myCursor{inCursor}, myOutNoteData{}, myConverter() + : myNote{inMxNote}, myCursor{inCursor}, myOutNoteData{} { } diff --git a/Sourcecode/private/mx/impl/NoteFunctions.h b/Sourcecode/private/mx/impl/NoteFunctions.h index e90d510bf..1a4962a73 100644 --- a/Sourcecode/private/mx/impl/NoteFunctions.h +++ b/Sourcecode/private/mx/impl/NoteFunctions.h @@ -47,7 +47,6 @@ class NoteFunctions const impl::Cursor myCursor; mutable api::NoteData myOutNoteData; mutable std::mutex myMutex; - const Converter myConverter; private: api::DurationName deriveNoteTypeFromDurationValue(const NoteReader &reader) const; diff --git a/Sourcecode/private/mx/impl/ScoreReader.cpp b/Sourcecode/private/mx/impl/ScoreReader.cpp index 5ca556016..694320d4d 100644 --- a/Sourcecode/private/mx/impl/ScoreReader.cpp +++ b/Sourcecode/private/mx/impl/ScoreReader.cpp @@ -195,9 +195,6 @@ api::ScoreData ScoreReader::getScoreData() const bool isComposerFound = false; bool isCopyrightFound = false; - bool isArrangerFound = false; - bool isLyricistFound = false; - bool isPublisherFound = false; if (myHeaderGroup.getHasIdentification()) { @@ -219,19 +216,16 @@ api::ScoreData ScoreReader::getScoreData() const if (a->type.getValue() == "lyricist") { myOutScoreData.lyricist = i->getValue().getValue(); - isLyricistFound = true; } if (a->type.getValue() == "arranger") { myOutScoreData.lyricist = i->getValue().getValue(); - isArrangerFound = true; } if (a->type.getValue() == "publisher") { myOutScoreData.lyricist = i->getValue().getValue(); - isPublisherFound = true; } } diff --git a/Sourcecode/private/mx/impl/SlideFunctions.cpp b/Sourcecode/private/mx/impl/SlideFunctions.cpp index b6fc576c2..3a29c1533 100644 --- a/Sourcecode/private/mx/impl/SlideFunctions.cpp +++ b/Sourcecode/private/mx/impl/SlideFunctions.cpp @@ -16,8 +16,9 @@ SlideFunctions::SlideFunctions(const core::Slide &inSlide, impl::Cursor inCursor { } -void SlideFunctions::parseSlide(api::NoteAttachmentData &inNoteAttachmentData) const +void SlideFunctions::parseSlide(api::NoteAttachmentData & /*inNoteAttachmentData*/) const { + (void)mySlide; // const auto& attr = mySlide.getAttributes(); // const auto slideType = attr->type; // diff --git a/Sourcecode/private/mx/utility/EnumWithString.h b/Sourcecode/private/mx/utility/EnumWithString.h index 7806faec2..e4ee52743 100644 --- a/Sourcecode/private/mx/utility/EnumWithString.h +++ b/Sourcecode/private/mx/utility/EnumWithString.h @@ -46,7 +46,7 @@ MX_ENUM_MEMBERS(MX_ENUM_VALUE); #define MX_ENUM_TO_STRING(A) MX_PRIMITIVE_CAT(A, ToString) -inline const char *const MX_ENUM_TO_STRING(MX_ENUM_CLASS_NAME)(MX_ENUM_CLASS_NAME inValue) +inline const char *MX_ENUM_TO_STRING(MX_ENUM_CLASS_NAME)(MX_ENUM_CLASS_NAME inValue) { switch (inValue) { From f2a7d011d64f4ae0543cc8a598148a832ca2d665 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 22:33:22 +0200 Subject: [PATCH 11/34] design build and ci quality gates Add GitHub Actions CI (ci.yaml) with four jobs: - linux and macos as required quality gates - windows and xcode as advisory Archive the old ccpp.yml workflow. Add Xcode generate, build, and test targets to the Makefile. --- .../workflows/{ccpp.yml => ccpp.yml.archived} | 0 .github/workflows/ci.yaml | 117 ++++++++++++++++++ Makefile | 28 ++++- 3 files changed, 144 insertions(+), 1 deletion(-) rename .github/workflows/{ccpp.yml => ccpp.yml.archived} (100%) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml.archived similarity index 100% rename from .github/workflows/ccpp.yml rename to .github/workflows/ccpp.yml.archived diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..d047321be --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,117 @@ +name: CI + +on: + pull_request: + push: + branches: [master] + +jobs: + linux: + name: Linux (quality gate + core tests) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache build + uses: actions/cache@v4 + with: + path: build/ + key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} + restore-keys: | + ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}- + ${{ runner.os }}-build- + + - name: Install tools + run: sudo apt-get update && sudo apt-get install -y clang-format clang-tidy + + - name: Quality gate + run: make check + + - name: Full test suite + run: make test-core + + macos: + name: macOS (quality gate + tests) + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache build + uses: actions/cache@v4 + with: + path: build/ + key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} + restore-keys: | + ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}- + ${{ runner.os }}-build- + + - name: Install tools + run: brew install clang-format llvm + + - name: Quality gate + env: + PATH: /opt/homebrew/opt/llvm/bin:${{ env.PATH }} + run: make check + + - name: Run tests + run: make test + + - name: Run examples + run: make examples-run + + windows: + name: Windows (advisory) + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache build + uses: actions/cache@v4 + with: + path: build/ + key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} + restore-keys: | + ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}- + ${{ runner.os }}-build- + + - name: Install make + run: choco install make -y + + - name: Install LLVM + run: choco install llvm -y + + - name: Quality gate + shell: bash + run: make check + + - name: Run tests + shell: bash + run: make test + + xcode: + name: Xcode (advisory) + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache build + uses: actions/cache@v4 + with: + path: build/xcode/ + key: ${{ runner.os }}-xcode-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} + restore-keys: | + ${{ runner.os }}-xcode-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}- + ${{ runner.os }}-xcode- + + - name: Generate project + run: make xcode-gen + + - name: Build + run: make xcode-build + + - name: Test + run: make xcode-test diff --git a/Makefile b/Makefile index 8c3f426ee..3ad648746 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ define run_bin endef .DEFAULT_GOAL := help -.PHONY: help lib dev core test test-core examples-run all clean check-tools check-format check-lint fmt lint check +.PHONY: help lib dev core test test-core examples-run all clean check-tools check-format check-lint fmt lint check xcode-gen xcode-build xcode-test help: @echo 'mx build/test targets (see comments at the top of the Makefile for rationale):' @@ -120,6 +120,10 @@ help: @echo ' make lint Run clang-tidy on all C++ files under Sourcecode/.' @echo ' make check Full quality gate: fmt-check + warning-free build + lint.' @echo '' + @echo ' make xcode-gen Generate Xcode project in build/xcode/.' + @echo ' make xcode-build Build the Xcode project.' + @echo ' make xcode-test Run tests via xcodebuild.' + @echo '' @echo 'Knobs: JOBS (=$(JOBS)) BUILD_TYPE (=$(BUILD_TYPE)) GENERATOR ARGS' @echo 'Layout: $(BUILD_ROOT)//$(BUILD_TYPE)/' @@ -217,3 +221,25 @@ check: check-tools echo "=== lint skipped (Windows) ==="; \ fi @echo "=== check passed ===" + +# --- Xcode targets ---------------------------------------------------------- + +XCODE_DIR := $(BUILD_ROOT)/xcode + +xcode-gen: + $(CMAKE) -G Xcode -S . -B $(XCODE_DIR) \ + -DMX_BUILD_TESTS=on \ + -DMX_BUILD_CORE_TESTS=off \ + -DMX_BUILD_EXAMPLES=on + +xcode-build: xcode-gen + $(CMAKE) --build $(XCODE_DIR) --config $(BUILD_TYPE) + +xcode-test: xcode-build + @found=''; \ + for p in "$(XCODE_DIR)/$(BUILD_TYPE)/mxtest" "$(XCODE_DIR)/Debug/mxtest"; do \ + if [ -x "$$p" ]; then found="$$p"; break; fi; \ + done; \ + if [ -z "$$found" ]; then echo "error: mxtest not found under $(XCODE_DIR)" >&2; exit 1; fi; \ + echo ">> $$found"; \ + "$$found" From 29b1d939107b86e25d7ef3fee3757234d1dff246 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 22:33:49 +0200 Subject: [PATCH 12/34] add quality gates to agents md --- AGENTS.md | 22 ++++++++++++++++++++++ Documents/ai/project/agenda.md | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 5d9c5e291..59febcc02 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,6 +41,28 @@ version of the specification. MusicxML 4.0 has been out for a long time, and we new code-gen tooling to reproduce the emission of the core types and then expose the new features in `Sourcecode/include/mx/api/`. +## Quality Gates + +When modifying any file under `Sourcecode/`, run: + +``` +make test && make check +``` + +before considering the change complete. This enforces formatting (clang-format), zero compiler +warnings, and lint (clang-tidy). On failure, run `make fmt` to fix formatting, then address any +remaining warnings manually. + +If the changes include anything under `Sourcecode/private/mx/core/`, run: + +`make test && make check && make test-core` + +If `check-tools` reports a missing tool, install it (see `.clang-format` and `.clang-tidy` for +the tool versions, or run `make help`). + +See `Documents/ai/project/build-and-ci-design.md` for full details on the CI pipeline and +quality gate design. + ## The Project We are working on reverse engineering a new codegen system to regenerate mx/core for MusicXML 4.0. See the project diff --git a/Documents/ai/project/agenda.md b/Documents/ai/project/agenda.md index 88d70d618..1b50b11a9 100644 --- a/Documents/ai/project/agenda.md +++ b/Documents/ai/project/agenda.md @@ -7,7 +7,7 @@ This is the project plan for supporting MusicXML 4.0 - [x] Create a Makefile - [x] fix the line endind issues in markdown files like README.md - [x] write build-and-ci-design.md -- [ ] implement changes per build-and-ci-design.md +- [x] implement changes per build-and-ci-design.md - [ ] See how this now interacts with JetBrains CLion (which seems to create a `cmake-build-debug` directory) - [ ] Codefy Change Quality Gates in AGENTS.md From 253d3054b886bd2a2dcafe0fe8ddee1056519cab Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 16 May 2026 23:59:13 +0200 Subject: [PATCH 13/34] fix CI: pin clang-format version via pip, fix macOS PATH and Windows build dir --- .github/workflows/ci.yaml | 16 +++++++++++----- Makefile | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d047321be..26ab3c56f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,7 +23,10 @@ jobs: ${{ runner.os }}-build- - name: Install tools - run: sudo apt-get update && sudo apt-get install -y clang-format clang-tidy + run: | + sudo apt-get update + sudo apt-get install -y clang-tidy + pip install --break-system-packages clang-format - name: Quality gate run: make check @@ -48,11 +51,12 @@ jobs: ${{ runner.os }}-build- - name: Install tools - run: brew install clang-format llvm + run: | + brew install llvm + pip install --break-system-packages clang-format + echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH - name: Quality gate - env: - PATH: /opt/homebrew/opt/llvm/bin:${{ env.PATH }} run: make check - name: Run tests @@ -81,7 +85,9 @@ jobs: run: choco install make -y - name: Install LLVM - run: choco install llvm -y + run: | + choco install llvm -y + pip install --break-system-packages clang-format - name: Quality gate shell: bash diff --git a/Makefile b/Makefile index 3ad648746..48a6f5fbd 100644 --- a/Makefile +++ b/Makefile @@ -203,6 +203,7 @@ check: check-tools @echo "=== fmt-check ===" @$(FIND_CPP) | xargs clang-format --dry-run --Werror @echo "=== build (warning-free) ===" + @mkdir -p $(BUILD_ROOT) @$(CMAKE) -S . -B $(call mode_dir,dev) \ -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \ -DMX_BUILD_TESTS=on \ From 2520f738625baae964361754910d0791ad3e6b74 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 00:19:03 +0200 Subject: [PATCH 14/34] fix CI: restore lint on all platforms, fix macOS SDKROOT for clang-tidy --- .github/workflows/ci.yaml | 2 +- Makefile | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 26ab3c56f..43c153fd0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,7 +57,7 @@ jobs: echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH - name: Quality gate - run: make check + run: SDKROOT=$(xcrun --show-sdk-path) make check - name: Run tests run: make test diff --git a/Makefile b/Makefile index 48a6f5fbd..a608cf6a0 100644 --- a/Makefile +++ b/Makefile @@ -215,12 +215,8 @@ check: check-tools if grep -q 'warning:' $(BUILD_ROOT)/build.log; then \ echo "ERROR: build emitted warnings (see above)"; exit 1; \ fi - @if [ -z "$(IS_WINDOWS)" ]; then \ - echo "=== lint ==="; \ - $(FIND_CPP) | xargs clang-tidy -p $(call mode_dir,dev); \ - else \ - echo "=== lint skipped (Windows) ==="; \ - fi + @echo "=== lint ===" + @$(FIND_CPP) | xargs clang-tidy -p $(call mode_dir,dev) @echo "=== check passed ===" # --- Xcode targets ---------------------------------------------------------- From 7694f286313836a601e3cb46bc8254c6815ee383 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 02:14:06 +0200 Subject: [PATCH 15/34] fix CI: run clang-tidy on .cpp files only (headers checked transitively) --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a608cf6a0..1679389fd 100644 --- a/Makefile +++ b/Makefile @@ -188,17 +188,19 @@ FIND_CPP := find Sourcecode \ -name 'pugiconfig.hpp' -prune -o \ -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print +FIND_CPP_LINT := find Sourcecode \ + -path 'Sourcecode/private/cpul' -prune -o \ + -name 'pugixml.cpp' -prune -o \ + -type f -name '*.cpp' -print + fmt: check-format @$(FIND_CPP) | xargs clang-format -i @echo "Formatted all C++ files under Sourcecode/" lint: check-lint dev - @$(FIND_CPP) | xargs clang-tidy -p $(call mode_dir,dev) + @$(FIND_CPP_LINT) | xargs clang-tidy -p $(call mode_dir,dev) @echo "Lint complete." -# Detect Windows (MSVC / Git Bash / MSYS2). -IS_WINDOWS := $(if $(filter Windows_NT,$(OS)),1,) - check: check-tools @echo "=== fmt-check ===" @$(FIND_CPP) | xargs clang-format --dry-run --Werror @@ -216,7 +218,7 @@ check: check-tools echo "ERROR: build emitted warnings (see above)"; exit 1; \ fi @echo "=== lint ===" - @$(FIND_CPP) | xargs clang-tidy -p $(call mode_dir,dev) + @$(FIND_CPP_LINT) | xargs clang-tidy -p $(call mode_dir,dev) @echo "=== check passed ===" # --- Xcode targets ---------------------------------------------------------- From 0c0c2d922469bb85d6243869848cfa98c8b8a696 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 09:50:01 +0200 Subject: [PATCH 16/34] fixup windows build --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 1679389fd..03b24c4eb 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,12 @@ CMAKE ?= cmake BUILD_TYPE ?= Debug BUILD_ROOT := build +# Detect Windows (MSYS2, Git Bash, Cygwin all report names starting with MS/MINGW/CYGWIN). +IS_WINDOWS := $(if $(filter MINGW% MSYS% CYGWIN%,$(shell uname -s 2>/dev/null)),1,) +ifdef OS +IS_WINDOWS := $(if $(filter Windows_NT,$(OS)),1,$(IS_WINDOWS)) +endif + # Portable CPU-count detection. Tried in order; the final echo always succeeds # (Windows cmd/PowerShell exports NUMBER_OF_PROCESSORS; otherwise fall back 4). JOBS ?= $(shell nproc 2>/dev/null \ @@ -179,7 +185,11 @@ check-lint: echo " Linux: sudo apt-get install clang-tidy"; \ exit 1; } +ifndef IS_WINDOWS check-tools: check-format check-lint +else +check-tools: check-format +endif FIND_CPP := find Sourcecode \ -path 'Sourcecode/private/cpul' -prune -o \ @@ -208,6 +218,7 @@ check: check-tools @mkdir -p $(BUILD_ROOT) @$(CMAKE) -S . -B $(call mode_dir,dev) \ -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DMX_BUILD_TESTS=on \ -DMX_BUILD_CORE_TESTS=off \ -DMX_BUILD_EXAMPLES=on \ @@ -217,8 +228,10 @@ check: check-tools if grep -q 'warning:' $(BUILD_ROOT)/build.log; then \ echo "ERROR: build emitted warnings (see above)"; exit 1; \ fi +ifndef IS_WINDOWS @echo "=== lint ===" @$(FIND_CPP_LINT) | xargs clang-tidy -p $(call mode_dir,dev) +endif @echo "=== check passed ===" # --- Xcode targets ---------------------------------------------------------- From 6c6c04dfcae97feb363480936b96831f677c6171 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 09:50:20 +0200 Subject: [PATCH 17/34] fixup ci yaml --- .github/workflows/ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 43c153fd0..efffe62bc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -84,10 +84,8 @@ jobs: - name: Install make run: choco install make -y - - name: Install LLVM - run: | - choco install llvm -y - pip install --break-system-packages clang-format + - name: Install tools + run: pip install --break-system-packages clang-format - name: Quality gate shell: bash From b58a424b92b003ef03ba4947ff01d5bdae351dba Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 09:50:24 +0200 Subject: [PATCH 18/34] fixup design --- AGENTS.md | 17 +- Documents/ai/project/agenda.md | 11 +- Documents/ai/project/build-and-ci-design.md | 305 +++++++++++--------- 3 files changed, 180 insertions(+), 153 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 59febcc02..c2067f462 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -46,19 +46,18 @@ new code-gen tooling to reproduce the emission of the core types and then expose When modifying any file under `Sourcecode/`, run: ``` -make test && make check +make fmt && make check && make test ``` -before considering the change complete. This enforces formatting (clang-format), zero compiler -warnings, and lint (clang-tidy). On failure, run `make fmt` to fix formatting, then address any -remaining warnings manually. +before considering the change complete. If the changes include anything under +`Sourcecode/private/mx/core/`, use `make test-all` instead of `make test`. -If the changes include anything under `Sourcecode/private/mx/core/`, run: +`make fmt` and `make check` run inside Docker (requires Docker on the host). No other tool +installation is needed. `make check` enforces formatting (clang-format), zero compiler warnings, +and lint (clang-tidy) using pinned tool versions. -`make test && make check && make test-core` - -If `check-tools` reports a missing tool, install it (see `.clang-format` and `.clang-tidy` for -the tool versions, or run `make help`). +On `make check` failure, run `make fmt` to fix formatting, then address any remaining warnings +manually. See `Documents/ai/project/build-and-ci-design.md` for full details on the CI pipeline and quality gate design. diff --git a/Documents/ai/project/agenda.md b/Documents/ai/project/agenda.md index 1b50b11a9..861e8b210 100644 --- a/Documents/ai/project/agenda.md +++ b/Documents/ai/project/agenda.md @@ -8,7 +8,16 @@ This is the project plan for supporting MusicXML 4.0 - [x] fix the line endind issues in markdown files like README.md - [x] write build-and-ci-design.md - [x] implement changes per build-and-ci-design.md -- [ ] See how this now interacts with JetBrains CLion (which seems to create a `cmake-build-debug` directory) +- [ ] Change local dev workflow and CI workflow based on the changed ./build-and-ci-design.md file +- [ ] Push to CI in PR 145 and iteratively refine any mistakes so that the ci yaml works correctly (but we will fix lints and warnings locally) +- [ ] In parallel fix lints and warnings until make fmt && make check && make test-all passes locally +- [ ] push the changes to PR 145 and monitor for passing CI +- [ ] clean up the commits locally such that we have the originally desired commit sequence, i.e. fixup the original + commits so that they work +- [ ] prompt the user for a force push to PR 145 when commits are clean +- [ ] monitor PR 145 after the force push + +- [ ] See how the project now interacts with JetBrains CLion (which seems to create a `cmake-build-debug` directory) - [ ] Codefy Change Quality Gates in AGENTS.md ## Phase 1: Reverse Engineer Codegen diff --git a/Documents/ai/project/build-and-ci-design.md b/Documents/ai/project/build-and-ci-design.md index a690ebc22..5cd47f05a 100644 --- a/Documents/ai/project/build-and-ci-design.md +++ b/Documents/ai/project/build-and-ci-design.md @@ -5,9 +5,6 @@ This document describes the formatting, linting, compiler-warning enforcement, and CI pipeline for mx. It also defines the quality gates that coding agents must satisfy when modifying `Sourcecode/`. -The full implementation is delivered as the commit series at the end of this document. Each commit -leaves the repository in a buildable, coherent state. - ### Note on `mx/core/` The files in `Sourcecode/private/mx/core/` were originally machine-generated from the MusicXML XSD. @@ -15,9 +12,31 @@ The codegen program no longer exists. These files are now treated as normal hand must pass all quality gates like any other code. A future codegen rewrite will re-own these files and will be written to emit code that passes the linter from the start. +### Design Principle: One Authoritative Toolchain + +Running clang-tidy with one compiler's frontend against another compiler's standard library headers +is fragile. clang-tidy IS a clang compiler frontend - it builds a full AST, performs template +instantiation, and runs overload resolution. When it parses code against GCC's libstdc++, the two +compilers can disagree on edge cases in template internals (e.g. whether `std::sort` requires copy +assignment vs. move assignment in a particular code path). These disagreements produce spurious +errors that don't reflect real code bugs. + +Similarly, compiler warning sets and clang-format behavior can change between versions. CI runners +(`ubuntu-latest`, `macos-latest`) float their toolchain versions, so a CI break can occur with no +code change. + +To eliminate these fragility surfaces, all quality-gate tooling (formatting, linting, compiler +warnings) runs inside a Docker container with pinned tool versions. This gives deterministic, +reproducible results on any machine - local or CI. Platform-specific CI jobs only build and test. + * * * -## Toolchain +## Toolchain (Docker) + +All quality-gate tools are pinned inside a Docker image built from the `Dockerfile` at the repo +root. The image is based on Ubuntu 24.04 with clang-18 and uses libc++ (clang's own standard +library) so that clang-tidy's frontend and the standard library headers are from the same +toolchain. ### Formatting: clang-format @@ -29,19 +48,10 @@ The one visible change from the historical style is the removal of spaces inside A `.clang-format` file at the repo root encodes this style. All C++ files under `Sourcecode/` are formatted, including generated files in `mx/core/`. -**Installation** - -| Platform | Command | -|----------|-------------------------------------| -| macOS | `brew install clang-format` | -| Linux | `sudo apt-get install clang-format` | -| Windows | Install LLVM from llvm.org | - ### Linting: clang-tidy clang-tidy reads `compile_commands.json` produced by CMake (`-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`). -This gives it the correct include paths, preprocessor defines, and C++ standard — catching real -issues rather than false positives from missing context. +This gives it the correct include paths, preprocessor defines, and C++ standard. The `.clang-tidy` file at the repo root enables a conservative starter set of checks: @@ -54,112 +64,134 @@ The `.clang-tidy` file at the repo root enables a conservative starter set of ch The check set is intentionally narrow. It can be expanded as the codebase improves. -**Installation** - -| Platform | Command | -|----------|-------------------------------------------| -| macOS | `brew install llvm` (includes clang-tidy) | -| Linux | `sudo apt-get install clang-tidy` | -| Windows | Install LLVM from llvm.org | - ### Compiler Warnings -`CMakeLists.txt` adds `-Wall -Wextra` (GCC/Clang) or `/W4` (MSVC) to the `mx` target. `-Werror` is -intentionally omitted so that warnings can be addressed in a dedicated commit (4b) rather than -breaking the build immediately upon enabling them. Instead, `make check` treats any `warning:` line -in the build output as a failure. +`CMakeLists.txt` adds `-Wall -Wextra` (GCC/Clang) or `/W4` (MSVC) to the `mx` target. Inside the +Docker container, clang-18 is the compiler. `make check` treats any `warning:` line in the build +output as a failure. ### CMake Version `CMakeLists.txt` requires CMake >= 3.13. The Makefile uses `-S`/`-B` and `--build --parallel`, both -of which require 3.13+. The `cmake_minimum_required` in `CMakeLists.txt` is bumped to match in -commit 4. +of which require 3.13+. * * * -## Makefile Targets +## Docker -### check-tools - -A prerequisite target that verifies required tools are on `PATH`. It is a dependency of `fmt`, -`lint`, and `check`. If a tool is missing it prints a platform-appropriate install recommendation -and exits non-zero. - -```makefile -check-tools: - @command -v clang-format >/dev/null 2>&1 || \ - { echo "clang-format not found."; \ - echo " macOS: brew install clang-format"; \ - echo " Linux: sudo apt-get install clang-format"; \ - exit 1; } - @command -v clang-tidy >/dev/null 2>&1 || \ - { echo "clang-tidy not found."; \ - echo " macOS: brew install llvm"; \ - echo " Linux: sudo apt-get install clang-tidy"; \ - exit 1; } -``` +### Dockerfile -### make fmt +Located at the repo root. Based on Ubuntu 24.04 with pinned clang-18 packages: -Formats all C++ source files under `Sourcecode/` in-place using clang-format. +- `clang-18`, `libc++-18-dev`, `libc++abi-18-dev` - compiler and standard library +- `clang-format-18` - formatting +- `clang-tidy-18` - linting +- `cmake`, `make` - build tools -``` -make fmt -``` +The Dockerfile sets `ENV MX_RUNNING_IN_DOCKER=1`. The Makefile checks this variable to decide +whether to run tools directly or to launch Docker. -Depends on `check-tools`. This target modifies files; running it twice is a no-op. +### BuildKit Cache -### make lint +The Dockerfile uses `RUN --mount=type=cache,target=/workspace/build` for the CMake build directory. +This persists the incremental build cache across Docker invocations on the same machine, avoiding +full recompiles on every `make check` run. -Runs clang-tidy against all C++ source files under `Sourcecode/`. Depends on `make dev` to ensure -`compile_commands.json` is current before linting. +### Makefile Docker Integration -``` -make lint -``` +The Makefile detects `MX_RUNNING_IN_DOCKER`: -Depends on `check-tools` and `dev`. +- **Inside the container** (`MX_RUNNING_IN_DOCKER=1`): runs clang-format, clang-tidy, and the + compiler directly. +- **Outside the container**: runs `docker buildx build` to build the image and execute the + requested target inside it. -### make check +For `make fmt`, which needs to write formatted files back to the host, the Makefile uses +`docker buildx build --output type=local,dest=.` to extract the formatted `Sourcecode/` tree. -The full quality gate. Runs each sub-check in order and fails on the first violation: +For `make check` and `make lint`, only the exit code matters - no file extraction needed. -1. **fmt** - runs `clang-format --dry-run --Werror` on all files under `Sourcecode/`. Any - unformatted file is a failure. -2. **build** - runs `make dev`, capturing output. Any `warning:` line is a failure. -3. **lint** - runs clang-tidy using the `compile_commands.json` produced by step 2. Any warning is a - failure. +* * * + +## Makefile Targets + +### Developer Workflow + +The standard workflow for any code change under `Sourcecode/`: ``` -make check +make fmt && make check && make test ``` -CI runs `make check` on Linux and macOS. On Windows, `make check` runs steps 1 and 2 (fmt-check and -warning-grep) but skips clang-tidy because `compile_commands.json` is not produced by the Visual -Studio generator. MSVC's `/W4` provides adequate static analysis coverage on Windows. +If the change touches files under `Sourcecode/private/mx/core/`: -Developers can run `make check` locally to confirm their changes will pass before pushing. +``` +make fmt && make check && make test-all +``` -### Xcode Targets +These three commands are all a developer or AI agent needs to verify their work. `fmt` and `check` +run in Docker (deterministic, no local tool installation required). `test` and `test-all` run +natively with the local compiler. -The Xcode project is generated by CMake and is not checked into the repository. `build/xcode/` is -added to `.gitignore`. Three Makefile targets cover the Xcode workflow, allowing developers to -replicate the CI Xcode job locally: +### Quality Targets (Docker) + +| Target | What it does | +|--------------------|-------------------------------------------------------------------| +| `make fmt` | Formats all C++ files under `Sourcecode/` in-place via Docker | +| `make check` | Full quality gate: fmt-check + warning-free build + lint (Docker) | +| `make lint` | Runs clang-tidy only (Docker) | +| `make clean-docker`| Removes the Docker image and buildx cache | + +`check-docker` is an internal prerequisite that verifies Docker is available on `PATH`. + +### Build Targets (Native) + +| Target | What it does | +|--------------------|-------------------------------------------------------------------| +| `make lib` | Build just the static library (no tests, no examples) | +| `make dev` | Build tests (no slow core tests) + examples | +| `make core` | Build the full suite including slow `mx::core` tests | + +### Run Targets (Native) + +| Target | What it does | +|---------------------|------------------------------------------------------------------| +| `make test` | Build dev, then run mxtest. `ARGS=` forwarded | +| `make test-all` | Build core, then run full mxtest. `ARGS=` forwarded | +| `make examples-run` | Build dev, then run mxread/mxwrite/mxhide | +| `make all` | Build core, run examples, run full mxtest | + +### Xcode Targets (Native) | Target | What it does | |--------------------|-----------------------------------------------| -| `make xcode-gen` | Runs `cmake -G Xcode -S . -B build/xcode` | +| `make xcode-gen` | Runs `cmake -G Xcode -S . -B build/xcode` | | `make xcode-build` | Builds the generated project via `xcodebuild` | | `make xcode-test` | Runs tests via `xcodebuild test` | +### Housekeeping + +| Target | What it does | +|--------------------|--------------------------------------| +| `make clean` | Remove the entire `build/` tree | +| `make clean-docker`| Remove Docker image and buildx cache | + +### Knobs + +| Variable | Default | Purpose | +|------------|--------------------|----------------------------------------------------| +| `JOBS` | auto-detected | Parallel compile jobs | +| `BUILD_TYPE`| `Debug` | CMake build type | +| `GENERATOR`| platform default | CMake generator override | +| `ARGS` | (none) | Forwarded to mxtest (Catch2) | + * * * ## CI Design ### File -`.github/workflows/ci.yaml` - the primary workflow. The old `ccpp.yml` is renamed to -`ccpp.yml.archived` to preserve history without running it. +`.github/workflows/ci.yaml` - the primary workflow. ### Triggers @@ -170,54 +202,58 @@ on: branches: [master] ``` -CI runs on every PR update and on every push to `master`. This ensures `master` is always verified -green, not just PRs. +CI runs on every PR update and on every push to `master`. ### Jobs -All jobs invoke Makefile targets. This is deliberate: a developer can reproduce any CI job locally -by running the same `make` command. +#### linux-gate (required - quality gate + tests) -#### linux (required - quality gate + core tests) +Runner: `ubuntu-latest` + +| Step | Command | +|-----------------|----------------| +| Quality gate | `make check` | +| Run tests | `make test` | + +The Makefile handles Docker internally - CI just runs `make check`. The Docker image is built +from the repo's `Dockerfile` with BuildKit layer caching via GitHub Actions cache. + +This is the authoritative quality gate. Formatting, linting, and compiler warnings are enforced +here with pinned tool versions. + +#### linux-core (required - full test suite with GCC) Runner: `ubuntu-latest` -| Step | Command | -|-----------------|-------------------------------------------| -| Install tools | `apt-get install clang-format clang-tidy` | -| Quality gate | `make check` | -| Full test suite | `make test-core` | +| Step | Command | +|-----------------|----------------| +| Full test suite | `make test-all`| -This is the deepest job. It enforces all quality gates (fmt, lint, compiler warnings) and runs the -complete test suite including the slow `mx::core` tests. +Builds and runs the complete test suite including the slow `mx::core` tests using GCC (the +system compiler). This provides GCC compilation coverage that the Docker gate job (which uses +clang) does not. -#### macos (required - quality gate + tests) +#### macos (required - build + tests) Runner: `macos-latest` -| Step | Command | -|-----------------|----------------------------------| -| Install tools | `brew install clang-format llvm` | -| Quality gate | `make check` | -| Run tests | `make test` | -| Run examples | `make examples-run` | +| Step | Command | +|-----------------|-------------------| +| Run tests | `make test` | +| Run examples | `make examples-run`| -Runs `make check` (fmt, build with warning-grep, lint) followed by the test suite and examples. -Verifies macOS-specific build and runtime correctness. +Builds and tests with the system clang. No quality gates - those are enforced by linux-gate. -#### windows (advisory) +#### windows (required - build + tests) Runner: `windows-latest` -| Step | Command | -|-----------------|------------------------------------------------| -| Install make | `choco install make` | -| Install tools | Install LLVM (for clang-format) | -| Quality gate | `make check` (fmt-check + warning-grep, no lint) | -| Run tests | `make test` | +| Step | Command | +|-----------------|------------| +| Install make | `choco install make` | +| Run tests | `make test`| -Uses GNU make installed via Chocolatey. clang-tidy is skipped because the Visual Studio generator -does not produce `compile_commands.json`. MSVC `/W4` warnings are caught by the warning-grep step. +Builds and tests with MSVC. No quality gates. #### xcode (advisory) @@ -233,20 +269,20 @@ Verifies the Xcode generator path separately from the Unix Makefiles build. ### Caching -All jobs cache their `build/` directory to avoid full rebuilds on every run. The cache key is: +The linux-gate job caches Docker BuildKit layers via GitHub Actions cache, avoiding a full image +rebuild on every run. The Dockerfile is structured to maximize layer reuse - tool installation +layers change rarely, source code layers change frequently. + +Build-and-test jobs (linux-core, macos, windows) cache their `build/` directory: ``` -${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} +${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }} ``` -If `CMakeLists.txt` or any source file changes, the cache is invalidated. A `.github/cache-bust` -file allows manual invalidation when needed. - ### Branch Protection -The `master` branch requires the **linux** and **macos** jobs to pass before merge. The **windows** -and **xcode** jobs are advisory - failures are visible but do not block merge. Merge strategy: -regular merge commits (not squash). +The `master` branch requires **linux-gate**, **linux-core**, **macos**, and **windows** to pass +before merge. The **xcode** job is advisory. Merge strategy: regular merge commits (not squash). * * * @@ -255,33 +291,16 @@ regular merge commits (not squash). When modifying any file under `Sourcecode/`, an agent must run: ``` -make check +make fmt && make check && make test ``` -before considering the change complete. `make check` enforces: - -1. **Formatting** - all files must be formatted per `.clang-format`. Run `make fmt` to fix - formatting, then re-run `make check`. -2. **Linting** - all clang-tidy checks in `.clang-tidy` must pass with zero warnings. -3. **Compiler warnings** - the build must emit no `warning:` lines. - -If `check-tools` reports a missing tool, install it before running `make check`. The CI Linux and -macOS jobs are both authoritative gates. If the two platforms disagree on a warning (e.g. GCC emits -one that Clang does not, or vice versa), both must be fixed. - -* * * +If the change touches `Sourcecode/private/mx/core/`, run `make test-all` instead of `make test`. -## Commit Series +`make check` enforces: -The following commits implement this design in order. Each commit leaves the repository in a -buildable, coherent state. +1. **Formatting** - all files must be formatted per `.clang-format`. `make fmt` fixes formatting. +2. **Compiler warnings** - the build must emit no `warning:` lines. +3. **Linting** - all clang-tidy checks in `.clang-tidy` must pass with zero warnings. -| # | Commit message | What it does | -|----|---------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| 1 | `add clang-format config and make fmt target` | Adds `.clang-format` (Microsoft style), `check-tools` prerequisite, and `make fmt` target to the Makefile. No files are reformatted yet. | -| 2 | `reformat Sourcecode/ with clang-format` | Applies `make fmt` to all of `Sourcecode/`. Pure formatting diff — no logic changes. | -| 3 | `add clang-tidy config and make lint target` | Adds `.clang-tidy`, enables `CMAKE_EXPORT_COMPILE_COMMANDS=ON` in CMake, adds `make lint` target. | -| 4 | `add compiler warnings and make check target` | Adds `-Wall -Wextra` / `/W4` to `CMakeLists.txt`, bumps `cmake_minimum_required` to 3.13, adds `make check` target combining fmt-check, build-warning grep, and lint. On Windows, `make check` skips lint. | -| 4b | `fix compiler and clang-tidy warnings` | Fixes all warnings surfaced by commit 4 across `Sourcecode/`, including the historically-generated files in `mx/core/` (which are normal source today - see Overview). | -| 5 | `modernize CI: new ci.yaml, archive old workflow` | Renames `ccpp.yml` to `ccpp.yml.archived`. Writes `ci.yaml` with linux/macos as required gates, windows/xcode as advisory. Adds Xcode targets, build caching, and `choco install make` for Windows. | -| 6 | `add quality gates to AGENTS.md` | Documents `make check` as the required pre-commit gate for agents modifying `Sourcecode/`. | +These commands require Docker. If Docker is not available, `make check` will report the error. +No other tool installation is needed for quality gates. From 529db573d7da6b3e2b2e2cdbe9248b871bd8ec1c Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 10:18:08 +0200 Subject: [PATCH 19/34] wip: dockerized quality gates + 5-job CI Move fmt/check/lint into a pinned Docker toolchain (Ubuntu 24.04 + clang-18 + libc++). Rework Makefile and ci.yaml per build-and-ci-design.md. WIP; fixed up into the original commits later. --- .dockerignore | 13 ++++ .github/workflows/ci.yaml | 82 ++++++++--------------- Dockerfile | 59 +++++++++++++++++ Makefile | 135 ++++++++++++++++++++++++++------------ 4 files changed, 193 insertions(+), 96 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..88ba5f7bd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +# Keep the build context small and fast. The quality gates only need the +# source tree plus the build configuration; tests are not run in Docker, so +# the (large) MusicXML corpus and unrelated trees are excluded. +build/ +.git/ +.github/ +Xcode/ +Documents/ +DevScripts/ +Resources/ +*.md +.DS_Store +.idea/ diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index efffe62bc..33da52a06 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,8 +6,29 @@ on: branches: [master] jobs: - linux: - name: Linux (quality gate + core tests) + linux-gate: + name: Linux (quality gate + tests) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # Container-driver builder (needed to export the gha layer cache) plus + # the runtime-token export so the Makefile auto-detects + # ACTIONS_RUNTIME_TOKEN and pushes/pulls the Docker layer cache. Keeps + # the toolchain-install layer warm across runs. The same `make check` + # runs locally with no cache (token absent -> plain build). + - uses: docker/setup-buildx-action@v3 + - uses: crazy-max/ghaction-github-runtime@v3 + + - name: Quality gate + run: make check + + - name: Run tests + run: make test + + linux-core: + name: Linux (full test suite, GCC) runs-on: ubuntu-latest steps: @@ -17,25 +38,15 @@ jobs: uses: actions/cache@v4 with: path: build/ - key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} + key: ${{ runner.os }}-core-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }} restore-keys: | - ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}- - ${{ runner.os }}-build- - - - name: Install tools - run: | - sudo apt-get update - sudo apt-get install -y clang-tidy - pip install --break-system-packages clang-format - - - name: Quality gate - run: make check + ${{ runner.os }}-core- - name: Full test suite - run: make test-core + run: make test-all macos: - name: macOS (quality gate + tests) + name: macOS (build + tests) runs-on: macos-latest steps: @@ -45,20 +56,10 @@ jobs: uses: actions/cache@v4 with: path: build/ - key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} + key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }} restore-keys: | - ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}- ${{ runner.os }}-build- - - name: Install tools - run: | - brew install llvm - pip install --break-system-packages clang-format - echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH - - - name: Quality gate - run: SDKROOT=$(xcrun --show-sdk-path) make check - - name: Run tests run: make test @@ -66,31 +67,15 @@ jobs: run: make examples-run windows: - name: Windows (advisory) + name: Windows (build + tests) runs-on: windows-latest steps: - uses: actions/checkout@v4 - - name: Cache build - uses: actions/cache@v4 - with: - path: build/ - key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} - restore-keys: | - ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}- - ${{ runner.os }}-build- - - name: Install make run: choco install make -y - - name: Install tools - run: pip install --break-system-packages clang-format - - - name: Quality gate - shell: bash - run: make check - - name: Run tests shell: bash run: make test @@ -102,15 +87,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Cache build - uses: actions/cache@v4 - with: - path: build/xcode/ - key: ${{ runner.os }}-xcode-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}-${{ hashFiles('.github/cache-bust') }} - restore-keys: | - ${{ runner.os }}-xcode-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }}- - ${{ runner.os }}-xcode- - - name: Generate project run: make xcode-gen diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..6a4bab57c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,59 @@ +# syntax=docker/dockerfile:1 +# +# Pinned quality-gate toolchain for mx. +# +# This image is not a deliverable. It is a deterministic environment for the +# `make fmt`, `make check`, and `make lint` quality gates: Ubuntu 24.04 with +# clang-18 and libc++, so clang-tidy's frontend and the standard-library +# headers come from one toolchain (no clang-vs-libstdc++ false positives) and +# formatting / warning behavior is identical on every machine. +# +# The Makefile drives this file: outside the container `make check` runs +# `docker buildx build` with a target/build-arg; inside the container (where +# MX_RUNNING_IN_DOCKER=1) the same `make check` runs the tools directly. +# +# See Documents/ai/project/build-and-ci-design.md. + +FROM ubuntu:24.04 AS base + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y --no-install-recommends \ + clang-18 \ + clang-tidy-18 \ + clang-format-18 \ + libc++-18-dev \ + libc++abi-18-dev \ + cmake \ + make \ + && rm -rf /var/lib/apt/lists/* + +# Unversioned names so the Makefile and CMake invoke the pinned tools without +# knowing the version suffix. +RUN ln -sf /usr/bin/clang-18 /usr/local/bin/clang \ + && ln -sf /usr/bin/clang++-18 /usr/local/bin/clang++ \ + && ln -sf /usr/bin/clang-tidy-18 /usr/local/bin/clang-tidy \ + && ln -sf /usr/bin/clang-format-18 /usr/local/bin/clang-format + +# Build with clang + libc++. CMake reads CC/CXX/CXXFLAGS/LDFLAGS at first +# configure. MX_RUNNING_IN_DOCKER tells the Makefile it is inside the +# container and should run the tools directly. +ENV MX_RUNNING_IN_DOCKER=1 \ + CC=clang \ + CXX=clang++ \ + CXXFLAGS=-stdlib=libc++ \ + LDFLAGS=-stdlib=libc++ + +WORKDIR /workspace +COPY . . + +# --- run stage: execute a make target for its exit code (check / lint) ------ +FROM base AS run +ARG MX_TARGET=check +RUN --mount=type=cache,target=/workspace/build make "$MX_TARGET" + +# --- fmt stage: format in place, then export only the Sourcecode tree ------- +FROM base AS fmt +RUN --mount=type=cache,target=/workspace/build make fmt + +FROM scratch AS fmt-out +COPY --from=fmt /workspace/Sourcecode /Sourcecode diff --git a/Makefile b/Makefile index 03b24c4eb..61a776d6d 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,16 @@ # Requires CMake >= 3.13 (for `cmake -S/-B` and `--build --parallel`). # # ---------------------------------------------------------------------------- +# Quality gates run in Docker +# ---------------------------------------------------------------------------- +# +# `make fmt`, `make check`, and `make lint` run inside a Docker container with +# a pinned toolchain (Ubuntu 24.04 + clang-18 + libc++) so formatting, linting, +# and compiler warnings are deterministic on any machine. The build/test +# targets (`make test`, `make test-all`, ...) run natively with the local +# compiler. See Documents/ai/project/build-and-ci-design.md. +# +# ---------------------------------------------------------------------------- # Build modes # ---------------------------------------------------------------------------- # @@ -52,17 +62,22 @@ # GENERATOR=Ninja make dev # ARGS Forwarded to the mxtest (Catch2) binary, e.g. # make test ARGS='[core]' or make test ARGS='--list-tests' +# DOCKER Docker executable (default: docker). # # ============================================================================ CMAKE ?= cmake +DOCKER ?= docker BUILD_TYPE ?= Debug BUILD_ROOT := build -# Detect Windows (MSYS2, Git Bash, Cygwin all report names starting with MS/MINGW/CYGWIN). -IS_WINDOWS := $(if $(filter MINGW% MSYS% CYGWIN%,$(shell uname -s 2>/dev/null)),1,) -ifdef OS -IS_WINDOWS := $(if $(filter Windows_NT,$(OS)),1,$(IS_WINDOWS)) +# In GitHub Actions, crazy-max/ghaction-github-runtime exports +# ACTIONS_RUNTIME_TOKEN. When present, push/pull the Docker layer cache to the +# GitHub Actions cache so linux-gate does not reinstall the toolchain every +# run. Absent (local, fork PRs) -> no flags, plain build. Same `make check` +# everywhere. +ifneq ($(ACTIONS_RUNTIME_TOKEN),) +DOCKER_CACHE := --cache-from type=gha --cache-to type=gha,mode=max endif # Portable CPU-count detection. Tried in order; the final echo always succeeds @@ -106,31 +121,42 @@ define run_bin endef .DEFAULT_GOAL := help -.PHONY: help lib dev core test test-core examples-run all clean check-tools check-format check-lint fmt lint check xcode-gen xcode-build xcode-test +.PHONY: help lib dev core test test-all examples-run all clean clean-docker \ + check-docker fmt lint check xcode-gen xcode-build xcode-test help: - @echo 'mx build/test targets (see comments at the top of the Makefile for rationale):' + @echo 'mx build/test targets (see the comments at the top of the Makefile):' @echo '' - @echo ' make lib Build just the static library (no tests, no examples).' - @echo ' make dev Build tests (no slow core tests) + examples. Dev loop.' + @echo 'Done with a code change? Run:' + @echo ' make fmt && make check && make test' + @echo ' (use make test-all instead of make test if you touched mx/core)' + @echo '' + @echo 'Quality gates (run in Docker, pinned toolchain):' + @echo ' make fmt Format all C++ files under Sourcecode/.' + @echo ' make check fmt-check + warning-free build + lint.' + @echo ' make lint Run clang-tidy only.' + @echo '' + @echo 'Build (native):' + @echo ' make lib Build just the static library (no tests/examples).' + @echo ' make dev Build tests (no slow core tests) + examples.' @echo ' make core Build the full suite incl. slow mx::core tests.' @echo '' + @echo 'Run (native):' @echo ' make test Build dev, then run mxtest. ARGS= forwarded.' - @echo ' make test-core Build core, then run full mxtest. ARGS= forwarded.' + @echo ' make test-all Build core, then run full mxtest. ARGS= forwarded.' @echo ' make examples-run Build dev, then run mxread/mxwrite/mxhide.' @echo ' make all Build core, run examples, run full mxtest.' @echo '' + @echo 'Housekeeping:' @echo ' make clean Remove the entire $(BUILD_ROOT)/ tree.' + @echo ' make clean-docker Remove the Docker build cache.' @echo '' - @echo ' make fmt Format all C++ files under Sourcecode/.' - @echo ' make lint Run clang-tidy on all C++ files under Sourcecode/.' - @echo ' make check Full quality gate: fmt-check + warning-free build + lint.' - @echo '' + @echo 'Xcode:' @echo ' make xcode-gen Generate Xcode project in build/xcode/.' @echo ' make xcode-build Build the Xcode project.' @echo ' make xcode-test Run tests via xcodebuild.' @echo '' - @echo 'Knobs: JOBS (=$(JOBS)) BUILD_TYPE (=$(BUILD_TYPE)) GENERATOR ARGS' + @echo 'Knobs: JOBS (=$(JOBS)) BUILD_TYPE (=$(BUILD_TYPE)) GENERATOR ARGS DOCKER' @echo 'Layout: $(BUILD_ROOT)//$(BUILD_TYPE)/' # --- Compile-only targets --------------------------------------------------- @@ -149,7 +175,7 @@ core: test: dev $(call run_bin,$(call mode_dir,dev),mxtest,$(ARGS)) -test-core: core +test-all: core $(call run_bin,$(call mode_dir,core),mxtest,$(ARGS)) examples-run: dev @@ -169,27 +195,16 @@ all: core clean: rm -rf $(BUILD_ROOT) -# --- Quality targets -------------------------------------------------------- - -check-format: - @command -v clang-format >/dev/null 2>&1 || \ - { echo "clang-format not found."; \ - echo " macOS: brew install clang-format"; \ - echo " Linux: sudo apt-get install clang-format"; \ - exit 1; } - -check-lint: - @command -v clang-tidy >/dev/null 2>&1 || \ - { echo "clang-tidy not found."; \ - echo " macOS: brew install llvm"; \ - echo " Linux: sudo apt-get install clang-tidy"; \ - exit 1; } +clean-docker: + -$(DOCKER) buildx prune -af + @echo "Removed Docker build cache." -ifndef IS_WINDOWS -check-tools: check-format check-lint -else -check-tools: check-format -endif +# --- Quality targets -------------------------------------------------------- +# +# fmt/check/lint run inside a pinned Docker toolchain. The Makefile detects +# MX_RUNNING_IN_DOCKER (set by the Dockerfile): inside the container it runs +# the tools directly; outside it builds the image and runs the target inside +# it via `docker buildx build`. FIND_CPP := find Sourcecode \ -path 'Sourcecode/private/cpul' -prune -o \ @@ -203,15 +218,26 @@ FIND_CPP_LINT := find Sourcecode \ -name 'pugixml.cpp' -prune -o \ -type f -name '*.cpp' -print -fmt: check-format +check-docker: + @command -v $(DOCKER) >/dev/null 2>&1 || \ + { echo "Docker not found. The quality gates (fmt/check/lint) run in"; \ + echo "Docker with a pinned toolchain. Install Docker to continue:"; \ + echo " https://docs.docker.com/get-docker/"; \ + exit 1; } + +ifdef MX_RUNNING_IN_DOCKER + +# ===== Inside the container: run the pinned tools directly ================== + +fmt: @$(FIND_CPP) | xargs clang-format -i @echo "Formatted all C++ files under Sourcecode/" -lint: check-lint dev +lint: dev @$(FIND_CPP_LINT) | xargs clang-tidy -p $(call mode_dir,dev) @echo "Lint complete." -check: check-tools +check: @echo "=== fmt-check ===" @$(FIND_CPP) | xargs clang-format --dry-run --Werror @echo "=== build (warning-free) ===" @@ -222,18 +248,41 @@ check: check-tools -DMX_BUILD_TESTS=on \ -DMX_BUILD_CORE_TESTS=off \ -DMX_BUILD_EXAMPLES=on \ - $(GEN_ARG) 2>&1 | tee $(BUILD_ROOT)/build.log - @$(CMAKE) --build $(call mode_dir,dev) --parallel $(JOBS) --config $(BUILD_TYPE) 2>&1 \ - | tee -a $(BUILD_ROOT)/build.log; \ + $(GEN_ARG) > $(BUILD_ROOT)/build.log 2>&1 \ + || { cat $(BUILD_ROOT)/build.log; \ + echo "ERROR: cmake configure failed (see above)"; exit 1; } + @$(CMAKE) --build $(call mode_dir,dev) --parallel $(JOBS) --config $(BUILD_TYPE) \ + >> $(BUILD_ROOT)/build.log 2>&1; status=$$?; \ + cat $(BUILD_ROOT)/build.log; \ + if [ $$status -ne 0 ]; then \ + echo "ERROR: build failed (see above)"; exit $$status; \ + fi; \ if grep -q 'warning:' $(BUILD_ROOT)/build.log; then \ echo "ERROR: build emitted warnings (see above)"; exit 1; \ fi -ifndef IS_WINDOWS @echo "=== lint ===" @$(FIND_CPP_LINT) | xargs clang-tidy -p $(call mode_dir,dev) -endif @echo "=== check passed ===" +else + +# ===== Outside the container: delegate to Docker =========================== + +fmt: check-docker + $(DOCKER) buildx build --target fmt-out \ + --output type=local,dest=. $(DOCKER_CACHE) . + @echo "Formatted all C++ files under Sourcecode/" + +lint: check-docker + $(DOCKER) buildx build --target run --build-arg MX_TARGET=lint \ + --output type=cacheonly $(DOCKER_CACHE) . + +check: check-docker + $(DOCKER) buildx build --target run --build-arg MX_TARGET=check \ + --output type=cacheonly $(DOCKER_CACHE) . + +endif + # --- Xcode targets ---------------------------------------------------------- XCODE_DIR := $(BUILD_ROOT)/xcode From ddc9d7049e0baf6c257a8a7da3f0743d99e19def Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 10:55:16 +0200 Subject: [PATCH 20/34] wip: drop clang-tidy, keep warning gate Remove clang-tidy from Makefile/Dockerfile/.clang-tidy and the design doc; make check is now fmt-check + warning-free build. Add to Decimals.h (GCC 14 / libc++). Reformat the two clang-format-18 stragglers. WIP; fixed up later. --- .clang-tidy | 8 -- .dockerignore | 25 ++-- AGENTS.md | 5 +- Dockerfile | 17 +-- Documents/ai/project/build-and-ci-design.md | 132 +++++++++--------- Makefile | 36 ++--- Sourcecode/include/mx/api/ApiEquality.h | 5 +- Sourcecode/private/mx/core/Decimals.h | 1 + .../private/mx/utility/OptionalMembers.h | 23 +-- 9 files changed, 117 insertions(+), 135 deletions(-) delete mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy deleted file mode 100644 index fabba7303..000000000 --- a/.clang-tidy +++ /dev/null @@ -1,8 +0,0 @@ -Checks: > - -*, - bugprone-*, - modernize-use-nullptr, - modernize-use-override, - performance-* - -HeaderFilterRegex: 'Sourcecode/.*' diff --git a/.dockerignore b/.dockerignore index 88ba5f7bd..3859f0d9b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,13 +1,12 @@ -# Keep the build context small and fast. The quality gates only need the -# source tree plus the build configuration; tests are not run in Docker, so -# the (large) MusicXML corpus and unrelated trees are excluded. -build/ -.git/ -.github/ -Xcode/ -Documents/ -DevScripts/ -Resources/ -*.md -.DS_Store -.idea/ +# Allowlist: ignore everything, then re-include only what the quality gates +# need (the source tree + build configuration). Tests are not run in Docker, +# so the MusicXML corpus, the Rust CodeGen tool, IDE/build dirs, .git, etc. +# are all excluded. This keeps the build context tiny and stable even when +# stray build dirs (CLion's cmake-build-debug, etc.) appear at the repo root. +* + +!Sourcecode +!CMakeLists.txt +!Makefile +!.clang-format +!Dockerfile diff --git a/AGENTS.md b/AGENTS.md index c2067f462..96c26efe4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,8 +53,9 @@ before considering the change complete. If the changes include anything under `Sourcecode/private/mx/core/`, use `make test-all` instead of `make test`. `make fmt` and `make check` run inside Docker (requires Docker on the host). No other tool -installation is needed. `make check` enforces formatting (clang-format), zero compiler warnings, -and lint (clang-tidy) using pinned tool versions. +installation is needed. `make check` enforces formatting (clang-format) and zero compiler +warnings using a pinned toolchain. (clang-tidy is deferred future work, scoped to `mx/api` +only - see the design doc.) On `make check` failure, run `make fmt` to fix formatting, then address any remaining warnings manually. diff --git a/Dockerfile b/Dockerfile index 6a4bab57c..e70c244ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,13 @@ # Pinned quality-gate toolchain for mx. # # This image is not a deliverable. It is a deterministic environment for the -# `make fmt`, `make check`, and `make lint` quality gates: Ubuntu 24.04 with -# clang-18 and libc++, so clang-tidy's frontend and the standard-library -# headers come from one toolchain (no clang-vs-libstdc++ false positives) and -# formatting / warning behavior is identical on every machine. +# `make fmt` and `make check` quality gates: Ubuntu 24.04 with a pinned +# clang-18 / clang-format-18 / libc++ toolchain, so clang-format output and +# the compiler warning set are identical on every machine regardless of the +# floating CI runner image. # # The Makefile drives this file: outside the container `make check` runs -# `docker buildx build` with a target/build-arg; inside the container (where +# `docker buildx build --target ...`; inside the container (where # MX_RUNNING_IN_DOCKER=1) the same `make check` runs the tools directly. # # See Documents/ai/project/build-and-ci-design.md. @@ -19,7 +19,6 @@ FROM ubuntu:24.04 AS base ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ clang-18 \ - clang-tidy-18 \ clang-format-18 \ libc++-18-dev \ libc++abi-18-dev \ @@ -31,7 +30,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # knowing the version suffix. RUN ln -sf /usr/bin/clang-18 /usr/local/bin/clang \ && ln -sf /usr/bin/clang++-18 /usr/local/bin/clang++ \ - && ln -sf /usr/bin/clang-tidy-18 /usr/local/bin/clang-tidy \ && ln -sf /usr/bin/clang-format-18 /usr/local/bin/clang-format # Build with clang + libc++. CMake reads CC/CXX/CXXFLAGS/LDFLAGS at first @@ -46,10 +44,9 @@ ENV MX_RUNNING_IN_DOCKER=1 \ WORKDIR /workspace COPY . . -# --- run stage: execute a make target for its exit code (check / lint) ------ +# --- run stage: run `make check` for its exit code -------------------------- FROM base AS run -ARG MX_TARGET=check -RUN --mount=type=cache,target=/workspace/build make "$MX_TARGET" +RUN --mount=type=cache,target=/workspace/build make check # --- fmt stage: format in place, then export only the Sourcecode tree ------- FROM base AS fmt diff --git a/Documents/ai/project/build-and-ci-design.md b/Documents/ai/project/build-and-ci-design.md index 5cd47f05a..23ed47c44 100644 --- a/Documents/ai/project/build-and-ci-design.md +++ b/Documents/ai/project/build-and-ci-design.md @@ -2,41 +2,36 @@ ## Overview -This document describes the formatting, linting, compiler-warning enforcement, and CI pipeline for -mx. It also defines the quality gates that coding agents must satisfy when modifying `Sourcecode/`. +This document describes the formatting, compiler-warning enforcement, and CI pipeline for mx. It +also defines the quality gates that coding agents must satisfy when modifying `Sourcecode/`. ### Note on `mx/core/` The files in `Sourcecode/private/mx/core/` were originally machine-generated from the MusicXML XSD. -The codegen program no longer exists. These files are now treated as normal hand-edited source and -must pass all quality gates like any other code. A future codegen rewrite will re-own these files -and will be written to emit code that passes the linter from the start. +The codegen program no longer exists. These files are treated as normal hand-edited source for the +current gates (formatting and compiler warnings) and must pass them like any other code. They are +not linted (see Future Work). A future codegen rewrite will re-own these files and emit code that +passes the gates from the start. ### Design Principle: One Authoritative Toolchain -Running clang-tidy with one compiler's frontend against another compiler's standard library headers -is fragile. clang-tidy IS a clang compiler frontend - it builds a full AST, performs template -instantiation, and runs overload resolution. When it parses code against GCC's libstdc++, the two -compilers can disagree on edge cases in template internals (e.g. whether `std::sort` requires copy -assignment vs. move assignment in a particular code path). These disagreements produce spurious -errors that don't reflect real code bugs. +Compiler warning sets and clang-format behavior change between tool versions. CI runners +(`ubuntu-latest`, `macos-latest`, `windows-latest`) float their toolchain versions, so a warning or +formatting CI break can occur with no code change at all. -Similarly, compiler warning sets and clang-format behavior can change between versions. CI runners -(`ubuntu-latest`, `macos-latest`) float their toolchain versions, so a CI break can occur with no -code change. - -To eliminate these fragility surfaces, all quality-gate tooling (formatting, linting, compiler -warnings) runs inside a Docker container with pinned tool versions. This gives deterministic, -reproducible results on any machine - local or CI. Platform-specific CI jobs only build and test. +To eliminate that fragility, the quality-gate tooling (clang-format and the warning-enforcing +compiler) runs inside a Docker container with pinned tool versions. This gives deterministic, +reproducible results on any machine - local or CI. Platform-specific CI jobs only build and test +with their native toolchains; they enforce no quality gates. * * * ## Toolchain (Docker) -All quality-gate tools are pinned inside a Docker image built from the `Dockerfile` at the repo -root. The image is based on Ubuntu 24.04 with clang-18 and uses libc++ (clang's own standard -library) so that clang-tidy's frontend and the standard library headers are from the same -toolchain. +The quality-gate tools are pinned inside a Docker image built from the `Dockerfile` at the repo +root. The image is Ubuntu 24.04 with clang-18, clang-format-18, and libc++. libc++ is used because +the codebase compiles warning-free under clang-18 + libc++, and pinning the standard library keeps +the `-Wall -Wextra` warning set deterministic. ### Formatting: clang-format @@ -48,27 +43,16 @@ The one visible change from the historical style is the removal of spaces inside A `.clang-format` file at the repo root encodes this style. All C++ files under `Sourcecode/` are formatted, including generated files in `mx/core/`. -### Linting: clang-tidy - -clang-tidy reads `compile_commands.json` produced by CMake (`-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`). -This gives it the correct include paths, preprocessor defines, and C++ standard. - -The `.clang-tidy` file at the repo root enables a conservative starter set of checks: +### Linting (deferred) -| Check group | Purpose | -|--------------------------|-----------------------------------------------------------------| -| `bugprone-*` | Flags likely bugs (suspicious constructs, error-prone patterns) | -| `modernize-use-nullptr` | Replace `NULL`/`0` with `nullptr` | -| `modernize-use-override` | Add `override` to overriding virtual functions | -| `performance-*` | Common performance anti-patterns | - -The check set is intentionally narrow. It can be expanded as the codebase improves. +clang-tidy is **not** a current quality gate. It was evaluated and removed because running it across +the whole tree is not viable. See Future Work for the rationale and the intended scoped reintroduction. ### Compiler Warnings `CMakeLists.txt` adds `-Wall -Wextra` (GCC/Clang) or `/W4` (MSVC) to the `mx` target. Inside the Docker container, clang-18 is the compiler. `make check` treats any `warning:` line in the build -output as a failure. +output as a failure, and also fails on configure or build errors. ### CMake Version @@ -85,11 +69,11 @@ Located at the repo root. Based on Ubuntu 24.04 with pinned clang-18 packages: - `clang-18`, `libc++-18-dev`, `libc++abi-18-dev` - compiler and standard library - `clang-format-18` - formatting -- `clang-tidy-18` - linting - `cmake`, `make` - build tools The Dockerfile sets `ENV MX_RUNNING_IN_DOCKER=1`. The Makefile checks this variable to decide -whether to run tools directly or to launch Docker. +whether to run tools directly or to launch Docker. A `.dockerignore` allowlist keeps the build +context to the source tree and build configuration only. ### BuildKit Cache @@ -101,15 +85,15 @@ full recompiles on every `make check` run. The Makefile detects `MX_RUNNING_IN_DOCKER`: -- **Inside the container** (`MX_RUNNING_IN_DOCKER=1`): runs clang-format, clang-tidy, and the - compiler directly. +- **Inside the container** (`MX_RUNNING_IN_DOCKER=1`): runs clang-format and the compiler directly. - **Outside the container**: runs `docker buildx build` to build the image and execute the requested target inside it. For `make fmt`, which needs to write formatted files back to the host, the Makefile uses -`docker buildx build --output type=local,dest=.` to extract the formatted `Sourcecode/` tree. +`docker buildx build --output type=local,dest=.` to extract the formatted `Sourcecode/` tree from a +`scratch` export stage (only `Sourcecode/` is written back). -For `make check` and `make lint`, only the exit code matters - no file extraction needed. +For `make check`, only the exit code matters - the build runs with `--output type=cacheonly`. * * * @@ -135,12 +119,11 @@ natively with the local compiler. ### Quality Targets (Docker) -| Target | What it does | -|--------------------|-------------------------------------------------------------------| -| `make fmt` | Formats all C++ files under `Sourcecode/` in-place via Docker | -| `make check` | Full quality gate: fmt-check + warning-free build + lint (Docker) | -| `make lint` | Runs clang-tidy only (Docker) | -| `make clean-docker`| Removes the Docker image and buildx cache | +| Target | What it does | +|--------------------|---------------------------------------------------------------| +| `make fmt` | Formats all C++ files under `Sourcecode/` in-place via Docker | +| `make check` | Quality gate: fmt-check + warning-free build (Docker) | +| `make clean-docker`| Removes the Docker buildx cache | `check-docker` is an internal prerequisite that verifies Docker is available on `PATH`. @@ -171,19 +154,20 @@ natively with the local compiler. ### Housekeeping -| Target | What it does | -|--------------------|--------------------------------------| -| `make clean` | Remove the entire `build/` tree | -| `make clean-docker`| Remove Docker image and buildx cache | +| Target | What it does | +|--------------------|-------------------------------| +| `make clean` | Remove the entire `build/` tree | +| `make clean-docker`| Remove the Docker buildx cache | ### Knobs -| Variable | Default | Purpose | -|------------|--------------------|----------------------------------------------------| -| `JOBS` | auto-detected | Parallel compile jobs | -| `BUILD_TYPE`| `Debug` | CMake build type | -| `GENERATOR`| platform default | CMake generator override | -| `ARGS` | (none) | Forwarded to mxtest (Catch2) | +| Variable | Default | Purpose | +|-------------|------------------|----------------------------------------------------| +| `JOBS` | auto-detected | Parallel compile jobs | +| `BUILD_TYPE`| `Debug` | CMake build type | +| `GENERATOR` | platform default | CMake generator override | +| `ARGS` | (none) | Forwarded to mxtest (Catch2) | +| `DOCKER` | `docker` | Docker executable | * * * @@ -216,10 +200,11 @@ Runner: `ubuntu-latest` | Run tests | `make test` | The Makefile handles Docker internally - CI just runs `make check`. The Docker image is built -from the repo's `Dockerfile` with BuildKit layer caching via GitHub Actions cache. +from the repo's `Dockerfile` with BuildKit layer caching via GitHub Actions cache (the Makefile +auto-detects `ACTIONS_RUNTIME_TOKEN` and enables the gha cache only when present). -This is the authoritative quality gate. Formatting, linting, and compiler warnings are enforced -here with pinned tool versions. +This is the authoritative quality gate. Formatting and compiler warnings are enforced here with +pinned tool versions. #### linux-core (required - full test suite with GCC) @@ -299,8 +284,27 @@ If the change touches `Sourcecode/private/mx/core/`, run `make test-all` instead `make check` enforces: 1. **Formatting** - all files must be formatted per `.clang-format`. `make fmt` fixes formatting. -2. **Compiler warnings** - the build must emit no `warning:` lines. -3. **Linting** - all clang-tidy checks in `.clang-tidy` must pass with zero warnings. +2. **Compiler warnings** - the build must configure, compile, and emit no `warning:` lines. These commands require Docker. If Docker is not available, `make check` will report the error. No other tool installation is needed for quality gates. + +* * * + +## Future Work: scoped clang-tidy + +clang-tidy is not currently a quality gate. It was evaluated and removed because running it across +the whole tree is not viable: + +- `Sourcecode/private/mx/core/` holds ~1131 generated element `.cpp` files. clang-tidy over all of + them measured at roughly 8 s/file (~2.6 hours total). +- With a `Sourcecode/.*` header filter, clang-tidy re-parses shared headers once per translation + unit and reports millions of duplicated diagnostics. +- The generated `mx/core` code is slated for replacement by a future codegen rewrite, so linting + it now has little value. + +The intended future direction is to reintroduce clang-tidy **scoped to the hand-written public API +and implementation** - starting with `Sourcecode/include/mx/api/` (`mx/api`) - and explicitly +**excluding generated `mx/core`**. Scoped that way the file count and header-filter scope are small +enough to be a fast, useful gate. This is deferred and is not part of the current pipeline; the +future codegen rewrite is expected to emit `mx/core` that would itself pass such a scoped lint. diff --git a/Makefile b/Makefile index 61a776d6d..142f39e2e 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,12 @@ # Quality gates run in Docker # ---------------------------------------------------------------------------- # -# `make fmt`, `make check`, and `make lint` run inside a Docker container with -# a pinned toolchain (Ubuntu 24.04 + clang-18 + libc++) so formatting, linting, -# and compiler warnings are deterministic on any machine. The build/test -# targets (`make test`, `make test-all`, ...) run natively with the local -# compiler. See Documents/ai/project/build-and-ci-design.md. +# `make fmt` and `make check` run inside a Docker container with a pinned +# toolchain (Ubuntu 24.04 + clang-18 + libc++) so formatting and compiler +# warnings are deterministic on any machine regardless of the floating CI +# runner image. The build/test targets (`make test`, `make test-all`, ...) +# run natively with the local compiler. +# See Documents/ai/project/build-and-ci-design.md. # # ---------------------------------------------------------------------------- # Build modes @@ -122,7 +123,7 @@ endef .DEFAULT_GOAL := help .PHONY: help lib dev core test test-all examples-run all clean clean-docker \ - check-docker fmt lint check xcode-gen xcode-build xcode-test + check-docker fmt check xcode-gen xcode-build xcode-test help: @echo 'mx build/test targets (see the comments at the top of the Makefile):' @@ -133,8 +134,7 @@ help: @echo '' @echo 'Quality gates (run in Docker, pinned toolchain):' @echo ' make fmt Format all C++ files under Sourcecode/.' - @echo ' make check fmt-check + warning-free build + lint.' - @echo ' make lint Run clang-tidy only.' + @echo ' make check fmt-check + warning-free build.' @echo '' @echo 'Build (native):' @echo ' make lib Build just the static library (no tests/examples).' @@ -201,7 +201,7 @@ clean-docker: # --- Quality targets -------------------------------------------------------- # -# fmt/check/lint run inside a pinned Docker toolchain. The Makefile detects +# fmt/check run inside a pinned Docker toolchain. The Makefile detects # MX_RUNNING_IN_DOCKER (set by the Dockerfile): inside the container it runs # the tools directly; outside it builds the image and runs the target inside # it via `docker buildx build`. @@ -213,11 +213,6 @@ FIND_CPP := find Sourcecode \ -name 'pugiconfig.hpp' -prune -o \ -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print -FIND_CPP_LINT := find Sourcecode \ - -path 'Sourcecode/private/cpul' -prune -o \ - -name 'pugixml.cpp' -prune -o \ - -type f -name '*.cpp' -print - check-docker: @command -v $(DOCKER) >/dev/null 2>&1 || \ { echo "Docker not found. The quality gates (fmt/check/lint) run in"; \ @@ -233,10 +228,6 @@ fmt: @$(FIND_CPP) | xargs clang-format -i @echo "Formatted all C++ files under Sourcecode/" -lint: dev - @$(FIND_CPP_LINT) | xargs clang-tidy -p $(call mode_dir,dev) - @echo "Lint complete." - check: @echo "=== fmt-check ===" @$(FIND_CPP) | xargs clang-format --dry-run --Werror @@ -244,7 +235,6 @@ check: @mkdir -p $(BUILD_ROOT) @$(CMAKE) -S . -B $(call mode_dir,dev) \ -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DMX_BUILD_TESTS=on \ -DMX_BUILD_CORE_TESTS=off \ -DMX_BUILD_EXAMPLES=on \ @@ -260,8 +250,6 @@ check: if grep -q 'warning:' $(BUILD_ROOT)/build.log; then \ echo "ERROR: build emitted warnings (see above)"; exit 1; \ fi - @echo "=== lint ===" - @$(FIND_CPP_LINT) | xargs clang-tidy -p $(call mode_dir,dev) @echo "=== check passed ===" else @@ -273,12 +261,8 @@ fmt: check-docker --output type=local,dest=. $(DOCKER_CACHE) . @echo "Formatted all C++ files under Sourcecode/" -lint: check-docker - $(DOCKER) buildx build --target run --build-arg MX_TARGET=lint \ - --output type=cacheonly $(DOCKER_CACHE) . - check: check-docker - $(DOCKER) buildx build --target run --build-arg MX_TARGET=check \ + $(DOCKER) buildx build --target run \ --output type=cacheonly $(DOCKER_CACHE) . endif diff --git a/Sourcecode/include/mx/api/ApiEquality.h b/Sourcecode/include/mx/api/ApiEquality.h index 661f50a41..de5e62db4 100644 --- a/Sourcecode/include/mx/api/ApiEquality.h +++ b/Sourcecode/include/mx/api/ApiEquality.h @@ -82,7 +82,10 @@ inline void streamComparisonUnequalMessage(const char *const inClassName, const #define MX_SHOW_UNEQUAL(XtheCurrentClassName, XmxapiMemberName) \ streamComparisonUnequalMessage(XtheCurrentClassName, XmxapiMemberName); #else -#define MX_SHOW_UNEQUAL(XtheCurrentClassName, XmxapiMemberName) {MX_API_UNUSED(XtheCurrentClassName)} +#define MX_SHOW_UNEQUAL(XtheCurrentClassName, XmxapiMemberName) \ + { \ + MX_API_UNUSED(XtheCurrentClassName) \ + } #endif #define MXAPI_EQUALS_BEGIN(mxapiClassName) \ diff --git a/Sourcecode/private/mx/core/Decimals.h b/Sourcecode/private/mx/core/Decimals.h index 76f0b9361..b24974127 100644 --- a/Sourcecode/private/mx/core/Decimals.h +++ b/Sourcecode/private/mx/core/Decimals.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include diff --git a/Sourcecode/private/mx/utility/OptionalMembers.h b/Sourcecode/private/mx/utility/OptionalMembers.h index 3c4d2c57e..966525adf 100644 --- a/Sourcecode/private/mx/utility/OptionalMembers.h +++ b/Sourcecode/private/mx/utility/OptionalMembers.h @@ -42,12 +42,12 @@ \ template \ auto check##attributeFieldNameCapitalized(const T *const attributesRawPtr) \ - -> decltype(attributesRawPtr->attributeFieldName) \ + ->decltype(attributesRawPtr->attributeFieldName) \ { \ return attributesRawPtr->attributeFieldName; \ } \ \ - template inline auto check##attributeFieldNameCapitalized(...) -> attributeType \ + template inline auto check##attributeFieldNameCapitalized(...)->attributeType \ { \ return defaultReturnValue; \ } @@ -58,12 +58,12 @@ defaultReturnValue) \ \ template \ - auto check##attributeFieldNameCapitalized(const T *const obj) -> decltype(obj->attributeFieldName.getValue()) \ + auto check##attributeFieldNameCapitalized(const T *const obj)->decltype(obj->attributeFieldName.getValue()) \ { \ return obj->attributeFieldName.getValue(); \ } \ \ - template inline auto check##attributeFieldNameCapitalized(...) -> attributeType \ + template inline auto check##attributeFieldNameCapitalized(...)->attributeType \ { \ return defaultReturnValue; \ } @@ -75,7 +75,7 @@ template \ auto MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized( \ VALUE_TYPE valueToSet, ATTRIBUTES_STRUCT *const outAttributesRawPtr, int dummy) \ - -> decltype(outAttributesRawPtr->attributeFieldName) \ + ->decltype(outAttributesRawPtr->attributeFieldName) \ { \ MX_UNUSED(dummy); \ outAttributesRawPtr->attributeFieldName = valueToSet; \ @@ -85,7 +85,7 @@ template \ auto MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized( \ VALUE_TYPE valueToSet, ATTRIBUTES_STRUCT *const outAttributesRawPtr, long dummy) \ - -> decltype(failureReturnValue) \ + ->decltype(failureReturnValue) \ { \ MX_UNUSED(outAttributesRawPtr); \ MX_UNUSED(dummy); \ @@ -96,7 +96,7 @@ template \ auto lookForAndSet##attributeFieldNameCapitalized(VALUE_TYPE valueToSet, \ ATTRIBUTES_STRUCT *const outAttributesRawPtr) \ - -> decltype(MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized(valueToSet, outAttributesRawPtr, 0)) \ + ->decltype(MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized(valueToSet, outAttributesRawPtr, 0)) \ { \ return MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized(valueToSet, outAttributesRawPtr, 0); \ } @@ -109,7 +109,7 @@ template \ auto MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized( \ VALUE_TYPE valueToSet, ATTRIBUTES_STRUCT *const outAttributesRawPtr, int dummy) \ - -> decltype(outAttributesRawPtr->attributeFieldName.setValue(valueToSet)) \ + ->decltype(outAttributesRawPtr->attributeFieldName.setValue(valueToSet)) \ { \ MX_UNUSED(dummy); \ outAttributesRawPtr->attributeFieldName.setValue(valueToSet); \ @@ -117,7 +117,8 @@ \ template \ auto MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized( \ - VALUE_TYPE valueToSet, ATTRIBUTES_STRUCT *const outAttributesRawPtr, long dummy) -> decltype(void()) \ + VALUE_TYPE valueToSet, ATTRIBUTES_STRUCT *const outAttributesRawPtr, long dummy) \ + ->decltype(void()) \ { \ MX_UNUSED(outAttributesRawPtr); \ MX_UNUSED(dummy); \ @@ -127,8 +128,8 @@ template \ auto lookForAndSet##attributeFieldNameCapitalized(VALUE_TYPE valueToSet, \ ATTRIBUTES_STRUCT *const outAttributesRawPtr) \ - -> decltype(MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized(valueToSet, outAttributesRawPtr, 0), \ - void()) \ + ->decltype(MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized(valueToSet, outAttributesRawPtr, 0), \ + void()) \ { \ MXIMPLFUNC_lookForAndSet##attributeFieldNameCapitalized(valueToSet, outAttributesRawPtr, 0); \ } From 715b94b383570a6377e5ae1033c5836372eb9c3a Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 10:55:32 +0200 Subject: [PATCH 21/34] fixup agenda --- Documents/ai/project/agenda.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documents/ai/project/agenda.md b/Documents/ai/project/agenda.md index 861e8b210..7d113a8a8 100644 --- a/Documents/ai/project/agenda.md +++ b/Documents/ai/project/agenda.md @@ -18,7 +18,10 @@ This is the project plan for supporting MusicXML 4.0 - [ ] monitor PR 145 after the force push - [ ] See how the project now interacts with JetBrains CLion (which seems to create a `cmake-build-debug` directory) -- [ ] Codefy Change Quality Gates in AGENTS.md + +- [ ] Properly instruct coding agents about how many C++ symbols are involved, especially in mxcore. They need to use + techniques such as sampling to understand the codebase (sample certain elements at random, for exmple). They need + some estimate of how long different build operations will take on a normal laptop. ## Phase 1: Reverse Engineer Codegen From 3de7aae9d0fadfb390bba616313fc462dad7cb4e Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 11:39:39 +0200 Subject: [PATCH 22/34] wip: g++-14 gate; fix portability bugs Switch the Docker gate from clang/libc++ to pinned g++-14 so make check matches the required Linux CI compiler. Add to ColorData.h. Fix missing break; in DocumentSpec toStream (emitted "timewiseerror" etc.). Drop ignored const cast in Decimals.cpp. test/test-all now run examples; drop the macOS-only examples CI step. WIP; fixed up later. --- .github/workflows/ci.yaml | 3 --- Dockerfile | 30 ++++++++++----------- Documents/ai/project/build-and-ci-design.md | 26 ++++++++++-------- Makefile | 24 ++++++++++------- Sourcecode/include/mx/api/ColorData.h | 2 ++ Sourcecode/private/mx/core/Decimals.cpp | 2 +- Sourcecode/private/mx/core/DocumentSpec.cpp | 4 +++ 7 files changed, 51 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 33da52a06..ab4a0fc86 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -63,9 +63,6 @@ jobs: - name: Run tests run: make test - - name: Run examples - run: make examples-run - windows: name: Windows (build + tests) runs-on: windows-latest diff --git a/Dockerfile b/Dockerfile index e70c244ee..960cf28bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,11 @@ # # This image is not a deliverable. It is a deterministic environment for the # `make fmt` and `make check` quality gates: Ubuntu 24.04 with a pinned -# clang-18 / clang-format-18 / libc++ toolchain, so clang-format output and -# the compiler warning set are identical on every machine regardless of the -# floating CI runner image. +# g++-14 / clang-format-18 toolchain. It compiles with GCC (not clang) so the +# gate matches the GCC the required Linux CI jobs use - the same standard +# library, so a `make check` pass locally means the GCC jobs compile too. +# Pinning keeps clang-format output and the warning set deterministic +# regardless of the floating CI runner image. # # The Makefile drives this file: outside the container `make check` runs # `docker buildx build --target ...`; inside the container (where @@ -18,28 +20,24 @@ FROM ubuntu:24.04 AS base ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ - clang-18 \ + gcc-14 \ + g++-14 \ clang-format-18 \ - libc++-18-dev \ - libc++abi-18-dev \ cmake \ make \ && rm -rf /var/lib/apt/lists/* -# Unversioned names so the Makefile and CMake invoke the pinned tools without -# knowing the version suffix. -RUN ln -sf /usr/bin/clang-18 /usr/local/bin/clang \ - && ln -sf /usr/bin/clang++-18 /usr/local/bin/clang++ \ - && ln -sf /usr/bin/clang-format-18 /usr/local/bin/clang-format +# Unversioned name so the Makefile invokes the pinned formatter without +# knowing the version suffix. The compiler is selected via CC/CXX below. +RUN ln -sf /usr/bin/clang-format-18 /usr/local/bin/clang-format -# Build with clang + libc++. CMake reads CC/CXX/CXXFLAGS/LDFLAGS at first +# Build with the pinned GCC so the gate matches the GCC the required Linux CI +# jobs use (same compiler family + libstdc++). CMake reads CC/CXX at first # configure. MX_RUNNING_IN_DOCKER tells the Makefile it is inside the # container and should run the tools directly. ENV MX_RUNNING_IN_DOCKER=1 \ - CC=clang \ - CXX=clang++ \ - CXXFLAGS=-stdlib=libc++ \ - LDFLAGS=-stdlib=libc++ + CC=gcc-14 \ + CXX=g++-14 WORKDIR /workspace COPY . . diff --git a/Documents/ai/project/build-and-ci-design.md b/Documents/ai/project/build-and-ci-design.md index 23ed47c44..8205517f1 100644 --- a/Documents/ai/project/build-and-ci-design.md +++ b/Documents/ai/project/build-and-ci-design.md @@ -29,8 +29,11 @@ with their native toolchains; they enforce no quality gates. ## Toolchain (Docker) The quality-gate tools are pinned inside a Docker image built from the `Dockerfile` at the repo -root. The image is Ubuntu 24.04 with clang-18, clang-format-18, and libc++. libc++ is used because -the codebase compiles warning-free under clang-18 + libc++, and pinning the standard library keeps +root. The image is Ubuntu 24.04 with **g++-14** and clang-format-18. The gate compiles with GCC +(not clang) so it uses the same compiler family and standard library (libstdc++) as the required +Linux CI jobs - a `make check` pass locally therefore means the GCC jobs compile too. clang-tidy +was previously the reason to use clang + libc++ here; with clang-tidy removed (see Future Work), +GCC is the better choice because it removes the local-vs-CI portability blind spot. Pinning keeps the `-Wall -Wextra` warning set deterministic. ### Formatting: clang-format @@ -51,7 +54,7 @@ the whole tree is not viable. See Future Work for the rationale and the intended ### Compiler Warnings `CMakeLists.txt` adds `-Wall -Wextra` (GCC/Clang) or `/W4` (MSVC) to the `mx` target. Inside the -Docker container, clang-18 is the compiler. `make check` treats any `warning:` line in the build +Docker container, g++-14 is the compiler. `make check` treats any `warning:` line in the build output as a failure, and also fails on configure or build errors. ### CMake Version @@ -67,7 +70,7 @@ of which require 3.13+. Located at the repo root. Based on Ubuntu 24.04 with pinned clang-18 packages: -- `clang-18`, `libc++-18-dev`, `libc++abi-18-dev` - compiler and standard library +- `gcc-14`, `g++-14` - compiler and libstdc++ (matches the required Linux CI jobs) - `clang-format-18` - formatting - `cmake`, `make` - build tools @@ -139,8 +142,8 @@ natively with the local compiler. | Target | What it does | |---------------------|------------------------------------------------------------------| -| `make test` | Build dev, then run mxtest. `ARGS=` forwarded | -| `make test-all` | Build core, then run full mxtest. `ARGS=` forwarded | +| `make test` | Build dev, run examples + mxtest. `ARGS=` forwarded | +| `make test-all` | Build core, run examples + full mxtest. `ARGS=` forwarded | | `make examples-run` | Build dev, then run mxread/mxwrite/mxhide | | `make all` | Build core, run examples, run full mxtest | @@ -222,12 +225,13 @@ clang) does not. Runner: `macos-latest` -| Step | Command | -|-----------------|-------------------| -| Run tests | `make test` | -| Run examples | `make examples-run`| +| Step | Command | +|-----------------|-------------| +| Run tests | `make test` | -Builds and tests with the system clang. No quality gates - those are enforced by linux-gate. +Builds and tests with the system clang. `make test` runs the example programs in addition to +`mxtest`, so the examples are exercised on every platform that runs tests (not just macOS). No +quality gates - those are enforced by linux-gate. #### windows (required - build + tests) diff --git a/Makefile b/Makefile index 142f39e2e..a083d1db3 100644 --- a/Makefile +++ b/Makefile @@ -121,6 +121,14 @@ define run_bin "$$found" $(3) endef +# Run the three example programs from the given mode dir ($1). The test +# targets run these too, so the examples are exercised everywhere tests run. +define run_examples + $(call run_bin,$(1),mxread,) + $(call run_bin,$(1),mxwrite,) + $(call run_bin,$(1),mxhide,) +endef + .DEFAULT_GOAL := help .PHONY: help lib dev core test test-all examples-run all clean clean-docker \ check-docker fmt check xcode-gen xcode-build xcode-test @@ -142,10 +150,10 @@ help: @echo ' make core Build the full suite incl. slow mx::core tests.' @echo '' @echo 'Run (native):' - @echo ' make test Build dev, then run mxtest. ARGS= forwarded.' - @echo ' make test-all Build core, then run full mxtest. ARGS= forwarded.' + @echo ' make test Build dev, run examples + mxtest. ARGS= forwarded.' + @echo ' make test-all Build core, run examples + full mxtest. ARGS= fwd.' @echo ' make examples-run Build dev, then run mxread/mxwrite/mxhide.' - @echo ' make all Build core, run examples, run full mxtest.' + @echo ' make all Build core, run examples + full mxtest.' @echo '' @echo 'Housekeeping:' @echo ' make clean Remove the entire $(BUILD_ROOT)/ tree.' @@ -173,21 +181,19 @@ core: # --- Run targets ------------------------------------------------------------ test: dev + $(call run_examples,$(call mode_dir,dev)) $(call run_bin,$(call mode_dir,dev),mxtest,$(ARGS)) test-all: core + $(call run_examples,$(call mode_dir,core)) $(call run_bin,$(call mode_dir,core),mxtest,$(ARGS)) examples-run: dev - $(call run_bin,$(call mode_dir,dev),mxread,) - $(call run_bin,$(call mode_dir,dev),mxwrite,) - $(call run_bin,$(call mode_dir,dev),mxhide,) + $(call run_examples,$(call mode_dir,dev)) # Behavioral replacement for the old build.sh: full build + run everything. all: core - $(call run_bin,$(call mode_dir,core),mxread,) - $(call run_bin,$(call mode_dir,core),mxwrite,) - $(call run_bin,$(call mode_dir,core),mxhide,) + $(call run_examples,$(call mode_dir,core)) $(call run_bin,$(call mode_dir,core),mxtest,$(ARGS)) # --- Housekeeping ----------------------------------------------------------- diff --git a/Sourcecode/include/mx/api/ColorData.h b/Sourcecode/include/mx/api/ColorData.h index f6f20df66..3a036cf98 100644 --- a/Sourcecode/include/mx/api/ColorData.h +++ b/Sourcecode/include/mx/api/ColorData.h @@ -4,6 +4,8 @@ #pragma once +#include + #include "mx/api/ApiCommon.h" namespace mx diff --git a/Sourcecode/private/mx/core/Decimals.cpp b/Sourcecode/private/mx/core/Decimals.cpp index fae92571c..ba97f9175 100644 --- a/Sourcecode/private/mx/core/Decimals.cpp +++ b/Sourcecode/private/mx/core/Decimals.cpp @@ -73,7 +73,7 @@ void PreciseDecimal::setValue(DecimalType inValue) const auto powerMultiplierAsFloat = std::pow(static_cast(10), static_cast(getMaxDecimalDigits())); const auto powerMultiplier = static_cast(std::ceil(powerMultiplierAsFloat - POINT_FIVE)); - const auto decimalDigitsShifted = decimalPartAsFloat * static_cast(powerMultiplier); + const auto decimalDigitsShifted = decimalPartAsFloat * static_cast(powerMultiplier); const auto decimalDigits = static_cast(std::ceil(decimalDigitsShifted - POINT_FIVE)); if (decimalDigits > myMaxExpressibleDecimal) diff --git a/Sourcecode/private/mx/core/DocumentSpec.cpp b/Sourcecode/private/mx/core/DocumentSpec.cpp index e156e1e03..36985e8ff 100644 --- a/Sourcecode/private/mx/core/DocumentSpec.cpp +++ b/Sourcecode/private/mx/core/DocumentSpec.cpp @@ -20,6 +20,7 @@ std::ostream &toStream(std::ostream &os, const DocumentChoice value) break; case DocumentChoice::timewise: os << "timewise"; + break; default: os << "error"; break; @@ -56,6 +57,7 @@ std::ostream &toStream(std::ostream &os, const MusicXmlVersion value) break; case MusicXmlVersion::threePointZero: os << "3.0"; + break; default: os << "error"; break; @@ -88,8 +90,10 @@ std::ostream &toStream(std::ostream &os, const SpecificationType value) break; case SpecificationType::dtd: os << "dtd"; + break; case SpecificationType::xsd: os << "xsd"; + break; default: os << "error"; break; From 608df6e51613b5228fceb06e4b283c6dd8b95fb0 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:22:44 +0200 Subject: [PATCH 23/34] wip: update changelog unreleased section --- CHANGELOG.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c6fcddd8..2d87a4102 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 ## [Unreleased] ### API Changes - Add support for setting an instrument's transposition at the start of the score. [#116] +- Add reading and writing of `arpeggiate`; move mark reading functions into helper classes. [#138] + +### Behavior Fixes +- Export `stop` elements before `start` elements. [#140] +- Fix a missing `break` in `DocumentSpec` enum `toStream` that produced incorrect text + (for example `timewise` rendered as `timewiseerror`). [#145] ### Internal Changes - Change the default-constructed value of `DynamicsEnum` to `mf` instead of `otherDynamics`. [#106]/[8a5cd6b] @@ -15,7 +21,27 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 - Rewrite `Decimals.h` and `Decimals.cpp`. [#111]. (Related to codegen, [#58]). - Rewrite `Enums`, `Integers` and `Decimals`. Add try parse and return bool from parse methods. [#112]. (Related to codegen, [#58]). - Rewrite union types `FontSize` and `YesNoNumber`. Also reformat a bunch of documentation. [#113]. (Related to codegen, [#58]). +- Change the example binary names to lowercase (`mxread`, `mxwrite`, `mxhide`). [#82] +- Add missing `` includes for stricter standard libraries and remove an + ignored-qualifier cast. [#145] + +### Repository, Build, and CI +- Set up the repository for AI-assisted development: agent guides (`AGENTS.md`, + `Documents/ai/project/`) and a build/CI design document. [#145] +- Replace `build.sh` with a portable `Makefile` wrapping CMake (build modes, run targets, + knobs); `make test` and `make test-all` also run the example programs. [#145] +- Add a `.clang-format` (Microsoft base) and reformat the entire `Sourcecode/` tree; `make fmt` + formats in place. [#145] +- Add a pinned-toolchain Docker quality gate: `make check` runs a format check plus a + warning-free `g++-14` build, reproducible regardless of the floating CI runner images. [#145] +- Replace the single workflow with a five-job GitHub Actions pipeline (Linux quality gate, + Linux GCC full suite, macOS, Windows, advisory Xcode); archive the old workflow. [#145] +- Add Apple `XCFramework` build support. [#124] +- Update the Catch2 test library to v3.2.1. [#135] +- Remove the CircleCI configuration. [#136] +[#58]: https://github.com/webern/mx/issues/58 +[#82]: https://github.com/webern/mx/pull/82 [#105]: https://github.com/webern/mx/pull/105 [#106]: https://github.com/webern/mx/pull/106 [#107]: https://github.com/webern/mx/pull/107 @@ -24,7 +50,12 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 [#112]: https://github.com/webern/mx/pull/112 [#113]: https://github.com/webern/mx/pull/113 [#116]: https://github.com/webern/mx/pull/116 -[#58]: https://github.com/webern/mx/issues/58 +[#124]: https://github.com/webern/mx/pull/124 +[#135]: https://github.com/webern/mx/pull/135 +[#136]: https://github.com/webern/mx/pull/136 +[#138]: https://github.com/webern/mx/pull/138 +[#140]: https://github.com/webern/mx/pull/140 +[#145]: https://github.com/webern/mx/pull/145 [8a5cd6b]: https://github.com/webern/mx/commit/8a5cd6b ## [v0.5.1] - 2020-06-13 From e858b595db3fd445d70e48744594d9fff63edaab Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:30:10 +0200 Subject: [PATCH 24/34] fmt md --- AGENTS.md | 39 +-- CHANGELOG.md | 143 ++++++----- Documents/ai/project/AGENTS.md | 8 +- Documents/ai/project/agenda.md | 34 +-- Documents/ai/project/build-and-ci-design.md | 121 +++++----- LICENSE | 21 ++ LICENSE.txt | 8 - README.md | 248 +++++++++++--------- 8 files changed, 345 insertions(+), 277 deletions(-) create mode 100644 LICENSE delete mode 100644 LICENSE.txt diff --git a/AGENTS.md b/AGENTS.md index 96c26efe4..511aed1b4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,10 +7,12 @@ A library for serializing and deserializing MusicXML in C++. The ./README.md fil Key paths in this repository: - `Sourcecode/` — Main C++ source tree (public API, core elements, implementation, tests) -- `Sourcecode/include/mx/api/` — Public API headers: `*Data` structs and `DocumentManager` entry point +- `Sourcecode/include/mx/api/` — Public API headers: `*Data` structs and `DocumentManager` entry + point - `Sourcecode/private/mx/api/` — Public API implementation backing the `include/mx/api` headers - `Sourcecode/private/mx/core/` — Strongly-typed MusicXML element classes (mostly code-generated) -- `Sourcecode/private/mx/core/elements/` — Generated element classes, one pair per MusicXML element (1182 files) +- `Sourcecode/private/mx/core/elements/` — Generated element classes, one pair per MusicXML element + (1182 files) - `Sourcecode/private/mx/impl/` — Conversion layer mapping the core DOM to the public API - `Sourcecode/private/mx/ezxml/` — Embedded lightweight XML reader/writer used by the core - `Sourcecode/private/mx/utility/` — Shared helpers (string, parsing, file system utilities) @@ -28,18 +30,19 @@ Key paths in this repository: ## Historical Context -`Sourcecode/private/mx/core/` and `Sourcecode/private/mx/core/elements/` was originally "hand-generated" by human -brute-force using Ruby scripts which can still be found in `./DevScripts`. This was never a one-shot solution to -generating the code from the XSD spec. Rather, it was an iterative process, solving problems encountered one-at-a-time -until the XSD spec was entirely covered. As such, it is not viable for re-use at this time, but can be used to -understand the historical nature of how the types were first generated. +`Sourcecode/private/mx/core/` and `Sourcecode/private/mx/core/elements/` was originally +"hand-generated" by human brute-force using Ruby scripts which can still be found in `./DevScripts`. +This was never a one-shot solution to generating the code from the XSD spec. Rather, it was an +iterative process, solving problems encountered one-at-a-time until the XSD spec was entirely +covered. As such, it is not viable for re-use at this time, but can be used to understand the +historical nature of how the types were first generated. ## The Problem -We are stuck somewhere around MusicXML 3.1 (or maybe 3.0) because we cannot reliably re-generate the types from a newer -version of the specification. MusicxML 4.0 has been out for a long time, and we want to support it. But we need to write -new code-gen tooling to reproduce the emission of the core types and then expose the new features in -`Sourcecode/include/mx/api/`. +We are stuck somewhere around MusicXML 3.1 (or maybe 3.0) because we cannot reliably re-generate the +types from a newer version of the specification. MusicxML 4.0 has been out for a long time, and we +want to support it. But we need to write new code-gen tooling to reproduce the emission of the core +types and then expose the new features in `Sourcecode/include/mx/api/`. ## Quality Gates @@ -53,17 +56,17 @@ before considering the change complete. If the changes include anything under `Sourcecode/private/mx/core/`, use `make test-all` instead of `make test`. `make fmt` and `make check` run inside Docker (requires Docker on the host). No other tool -installation is needed. `make check` enforces formatting (clang-format) and zero compiler -warnings using a pinned toolchain. (clang-tidy is deferred future work, scoped to `mx/api` -only - see the design doc.) +installation is needed. `make check` enforces formatting (clang-format) and zero compiler warnings +using a pinned toolchain. (clang-tidy is deferred future work, scoped to `mx/api` only - see the +design doc.) On `make check` failure, run `make fmt` to fix formatting, then address any remaining warnings manually. -See `Documents/ai/project/build-and-ci-design.md` for full details on the CI pipeline and -quality gate design. +See `Documents/ai/project/build-and-ci-design.md` for full details on the CI pipeline and quality +gate design. ## The Project -We are working on reverse engineering a new codegen system to regenerate mx/core for MusicXML 4.0. See the project -directory @./Documents/ai/project/AGENTS.md +We are working on reverse engineering a new codegen system to regenerate mx/core for MusicXML 4.0. +See the project directory @./Documents/ai/project/AGENTS.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d87a4102..ee78313f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,41 +1,53 @@ # Changelog -All notable changes to this project will be documented in this file. -On 2020-05-31, two tags were deleted from origin, `v1.0.0` and `v1.0.1` and replaced with `v0.4.0` and `v0.4.1` respectively. -If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0` and `v1.0.1` and pull tags. + +All notable changes to this project will be documented in this file. On 2020-05-31, two tags were +deleted from origin, `v1.0.0` and `v1.0.1` and replaced with `v0.4.0` and `v0.4.1` respectively. If +you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0` and `v1.0.1` and pull +tags. ## [Unreleased] + ### API Changes + - Add support for setting an instrument's transposition at the start of the score. [#116] - Add reading and writing of `arpeggiate`; move mark reading functions into helper classes. [#138] ### Behavior Fixes + - Export `stop` elements before `start` elements. [#140] -- Fix a missing `break` in `DocumentSpec` enum `toStream` that produced incorrect text - (for example `timewise` rendered as `timewiseerror`). [#145] +- Fix a missing `break` in `DocumentSpec` enum `toStream` that produced incorrect text (for example + `timewise` rendered as `timewiseerror`). [#145] ### Internal Changes -- Change the default-constructed value of `DynamicsEnum` to `mf` instead of `otherDynamics`. [#106]/[8a5cd6b] + +- Change the default-constructed value of `DynamicsEnum` to `mf` instead of `otherDynamics`. + [#106]/[8a5cd6b] - Change the spelling of `KindValue` enums from, e.g. `dominant11Th` to `dominant11th`. [#105] -- Break up `Strings.h` into multiple `.h` files, one for each type [#107]. (Related to codegen, [#58]). -- Rewrite `Integers.h` and `Integers.cpp`. Changed `NonNegativeInteger` to default to 0, and changed the tests that had locked-in that behavior. [#109]. (Related to codegen, [#58]). +- Break up `Strings.h` into multiple `.h` files, one for each type [#107]. (Related to codegen, + [#58]). +- Rewrite `Integers.h` and `Integers.cpp`. Changed `NonNegativeInteger` to default to 0, and changed + the tests that had locked-in that behavior. [#109]. (Related to codegen, [#58]). - Rewrite `Decimals.h` and `Decimals.cpp`. [#111]. (Related to codegen, [#58]). -- Rewrite `Enums`, `Integers` and `Decimals`. Add try parse and return bool from parse methods. [#112]. (Related to codegen, [#58]). -- Rewrite union types `FontSize` and `YesNoNumber`. Also reformat a bunch of documentation. [#113]. (Related to codegen, [#58]). +- Rewrite `Enums`, `Integers` and `Decimals`. Add try parse and return bool from parse methods. + [#112]. (Related to codegen, [#58]). +- Rewrite union types `FontSize` and `YesNoNumber`. Also reformat a bunch of documentation. [#113]. + (Related to codegen, [#58]). - Change the example binary names to lowercase (`mxread`, `mxwrite`, `mxhide`). [#82] -- Add missing `` includes for stricter standard libraries and remove an - ignored-qualifier cast. [#145] +- Add missing `` includes for stricter standard libraries and remove an ignored-qualifier + cast. [#145] ### Repository, Build, and CI + - Set up the repository for AI-assisted development: agent guides (`AGENTS.md`, `Documents/ai/project/`) and a build/CI design document. [#145] -- Replace `build.sh` with a portable `Makefile` wrapping CMake (build modes, run targets, - knobs); `make test` and `make test-all` also run the example programs. [#145] +- Replace `build.sh` with a portable `Makefile` wrapping CMake (build modes, run targets, knobs); + `make test` and `make test-all` also run the example programs. [#145] - Add a `.clang-format` (Microsoft base) and reformat the entire `Sourcecode/` tree; `make fmt` formats in place. [#145] -- Add a pinned-toolchain Docker quality gate: `make check` runs a format check plus a - warning-free `g++-14` build, reproducible regardless of the floating CI runner images. [#145] -- Replace the single workflow with a five-job GitHub Actions pipeline (Linux quality gate, - Linux GCC full suite, macOS, Windows, advisory Xcode); archive the old workflow. [#145] +- Add a pinned-toolchain Docker quality gate: `make check` runs a format check plus a warning-free + `g++-14` build, reproducible regardless of the floating CI runner images. [#145] +- Replace the single workflow with a five-job GitHub Actions pipeline (Linux quality gate, Linux GCC + full suite, macOS, Windows, advisory Xcode); archive the old workflow. [#145] - Add Apple `XCFramework` build support. [#124] - Update the Catch2 test library to v3.2.1. [#135] - Remove the CircleCI configuration. [#136] @@ -59,16 +71,22 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 [8a5cd6b]: https://github.com/webern/mx/commit/8a5cd6b ## [v0.5.1] - 2020-06-13 + - Fix xcode build, new headers were missing from frameworks. ## [v0.5.0] - 2020-06-13 + ### Breaking Changes + - Add support for `new-page` attributes and page layout [#94] - The `LayoutData layout` field of `ScoreData` has been renamed to `DefaultsData defaults` [#94] - What used to be the `LayoutData` class has been renamed to `DefaultsData`. - - This name change freed up the name `LayoutsData` to be used for a new class that better fits the name. -- The `std::set systems` field of `ScoreData` has been replaced by `std::map`. [#94] - - `LayoutData` is a new class (not to be confused with `DefaultsData` which previously held the name). + - This name change freed up the name `LayoutsData` to be used for a new class that better fits the + name. +- The `std::set systems` field of `ScoreData` has been replaced by + `std::map`. [#94] + - `LayoutData` is a new class (not to be confused with `DefaultsData` which previously held the + name). - `LayoutData` holds a `SystemData` and a `PageData` (new) to specify system and page layout. - Some recurring data patterns were factored out into new classes. [#94] - The existing classes affected by these changes are: @@ -83,6 +101,7 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 - `SystemLayoutData` ### Other Changes + - Bump C++ standard to 17 [#93] - Support non-traditional key signatures in `mx::api`. [#81] - Add a constructor for `PitchData`. [#90] @@ -102,19 +121,24 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 [#97]: https://github.com/webern/mx/pull/97 ## [v0.4.1] - 2019-11-23 + - Mostly internal changes related to the xml parser. ## [v0.4.0] - 2019-04-08 + - A simplified data model, called `mx::api`. ## [v0.3.0] - 2017-11-20 + - MusicXML files can be parsed into the C++ classes. ## [v0.2.0] - 2016-08-21 + - MusicXML 3.0 represented in C++ classes, mostly generated from XSD using custom Ruby scripts. - MusicXML DOM classes can serialize to XML. ## [v0.1.0] - 2016-06-20 + - Initial Commit [v0.1.0]: https://github.com/webern/mx/commit/5d46609 @@ -128,44 +152,55 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 #### Historical Notes -**Historical Note: April 7, 2019** Trying to button up a '1.0' 'release' by tying up some of the loose ends with the build, continuous integration, testing, and header leakage. -The use of the semver `1.0` implies that we hope there won't be many breaking changes. -I suppose the way I will use semver is as follows: a patch release may cause slight compilation annoyances, but nothing that would cause any rewriting of code. -A minor release may similarly require some tweaks but hopefully nothing too major. -A major release could be anything up-to a complete re-write. +**Historical Note: April 7, 2019** Trying to button up a '1.0' 'release' by tying up some of the +loose ends with the build, continuous integration, testing, and header leakage. The use of the +semver `1.0` implies that we hope there won't be many breaking changes. I suppose the way I will use +semver is as follows: a patch release may cause slight compilation annoyances, but nothing that +would cause any rewriting of code. A minor release may similarly require some tweaks but hopefully +nothing too major. A major release could be anything up-to a complete re-write. -**Historical Note: October 6, 2016:** Significant progress has been made on the `api` namespace, which is a simplified set of data structures to represent a MusicXML document. -These are being implemented as mostly-POD structs. -Currently the importing of data into these structures is well-underway, but the exporting from these data structures has not been implemented. +**Historical Note: October 6, 2016:** Significant progress has been made on the `api` namespace, +which is a simplified set of data structures to represent a MusicXML document. These are being +implemented as mostly-POD structs. Currently the importing of data into these structures is +well-underway, but the exporting from these data structures has not been implemented. -**Historical Note: August 16, 2016:** All tests are passing (core, xml and import). -The remaining items to do on the ximport feature are +**Historical Note: August 16, 2016:** All tests are passing (core, xml and import). The remaining +items to do on the ximport feature are - search for all `\\TODO's` and fix those that can be fixed - Standardize the code file copyrights and bump to version 0.2 - Rename XElement functions to better names -- Update the readme including information about the XDoc XElement classes and how to implement those interfaces. +- Update the readme including information about the XDoc XElement classes and how to implement those + interfaces. -**Historical Note: August 11, 2016:** The feature to import MusicXML files is essentially complete with most "round-trip" integration tests passing. +**Historical Note: August 11, 2016:** The feature to import MusicXML files is essentially complete +with most "round-trip" integration tests passing. **Historical Note: June 27, 2016:** An "integration" tester has been added to the MxTest executable. -This exists in ImportTest.cpp, and ImportTestImpl.h/cpp. -A top level directory "Resources" has been added to hold test input (i.e. "golden") files. -The input files are gathered from Recordare, Lilypond and MuseScore and to this I have added a few of my own scores as exported by Finale Dolet. - -Each of these test input files has been "scrubbed" using the XDoc classes (i.e. it has been round-tripped through pugixml and has been updated to a normalized MusicXML 3.0 header format. -The resultant scrubbed files are in Resources/expected. -During the test run, a csv file is written in Resources/testOutput recording a row for each test (Pass/Fail, duration of test, messages, etc). -Each time a test failure is encountered the expected file and the error file will be saved to the Resources/testOutput directory to allow for visual inspection. - -Currently this tester is a "wire-up". -All 263 of these round-trip import/export tests fail because the implementation does not yet exist in mx::core. -The next body of work will be the mx::core implementation. - -**Historical Note: June 20, 2016:** A simple interface to for XML DOM has been added in the ::ezxml:: namespace. -The key classes (pure virtual) are XDoc, XElement, XAttribute, XElementIterator, XAttributeIterator. -These are implemented by concrete classes PugiDoc, PugiElement, etc. which serve as a wrapper for the pugixml library (http://pugixml.org/). -Although this is a static library, a class XFactory can be used to create a Pugi instance of the XDoc interface. - -The idea behind using a pure virtual interface is that the client of the Music XML Class Library can, in theory choose a different XML DOM library (Xerces, TinyXML, etc) and wrap with instances of the XDoc interfaces and the Music XML core classes will not know the difference. - -**Historical Note: June 20, 2016:** The GitHub repo was bloated and has been entirely wiped-out and restarted. +This exists in ImportTest.cpp, and ImportTestImpl.h/cpp. A top level directory "Resources" has been +added to hold test input (i.e. "golden") files. The input files are gathered from Recordare, +Lilypond and MuseScore and to this I have added a few of my own scores as exported by Finale Dolet. + +Each of these test input files has been "scrubbed" using the XDoc classes (i.e. it has been +round-tripped through pugixml and has been updated to a normalized MusicXML 3.0 header format. The +resultant scrubbed files are in Resources/expected. During the test run, a csv file is written in +Resources/testOutput recording a row for each test (Pass/Fail, duration of test, messages, etc). +Each time a test failure is encountered the expected file and the error file will be saved to the +Resources/testOutput directory to allow for visual inspection. + +Currently this tester is a "wire-up". All 263 of these round-trip import/export tests fail because +the implementation does not yet exist in mx::core. The next body of work will be the mx::core +implementation. + +**Historical Note: June 20, 2016:** A simple interface to for XML DOM has been added in the +::ezxml:: namespace. The key classes (pure virtual) are XDoc, XElement, XAttribute, +XElementIterator, XAttributeIterator. These are implemented by concrete classes PugiDoc, +PugiElement, etc. which serve as a wrapper for the pugixml library (http://pugixml.org/). Although +this is a static library, a class XFactory can be used to create a Pugi instance of the XDoc +interface. + +The idea behind using a pure virtual interface is that the client of the Music XML Class Library +can, in theory choose a different XML DOM library (Xerces, TinyXML, etc) and wrap with instances of +the XDoc interfaces and the Music XML core classes will not know the difference. + +**Historical Note: June 20, 2016:** The GitHub repo was bloated and has been entirely wiped-out and +restarted. diff --git a/Documents/ai/project/AGENTS.md b/Documents/ai/project/AGENTS.md index d9c64fd32..6bfadbbcd 100644 --- a/Documents/ai/project/AGENTS.md +++ b/Documents/ai/project/AGENTS.md @@ -2,12 +2,12 @@ This is the directory for supporting MusicXML 4.0. -./agenda.md is the TODO list of work items. -./build-and-ci-design.md is the plan for how Makefile and CI targets will lint, build, test and fmt the code. +./agenda.md is the TODO list of work items. ./build-and-ci-design.md is the plan for how Makefile +and CI targets will lint, build, test and fmt the code. ## Note on mx/core/ The files in `Sourcecode/private/mx/core/` were originally machine-generated from the MusicXML XSD. -The codegen program no longer exists. These files are normal hand-edited source now and must pass all -quality gates. A future codegen rewrite will re-own them. Do not treat them as generated or +The codegen program no longer exists. These files are normal hand-edited source now and must pass +all quality gates. A future codegen rewrite will re-own them. Do not treat them as generated or read-only. diff --git a/Documents/ai/project/agenda.md b/Documents/ai/project/agenda.md index 7d113a8a8..ab896c72a 100644 --- a/Documents/ai/project/agenda.md +++ b/Documents/ai/project/agenda.md @@ -8,20 +8,20 @@ This is the project plan for supporting MusicXML 4.0 - [x] fix the line endind issues in markdown files like README.md - [x] write build-and-ci-design.md - [x] implement changes per build-and-ci-design.md -- [ ] Change local dev workflow and CI workflow based on the changed ./build-and-ci-design.md file -- [ ] Push to CI in PR 145 and iteratively refine any mistakes so that the ci yaml works correctly (but we will fix lints and warnings locally) -- [ ] In parallel fix lints and warnings until make fmt && make check && make test-all passes locally -- [ ] push the changes to PR 145 and monitor for passing CI -- [ ] clean up the commits locally such that we have the originally desired commit sequence, i.e. fixup the original - commits so that they work -- [ ] prompt the user for a force push to PR 145 when commits are clean -- [ ] monitor PR 145 after the force push - -- [ ] See how the project now interacts with JetBrains CLion (which seems to create a `cmake-build-debug` directory) - -- [ ] Properly instruct coding agents about how many C++ symbols are involved, especially in mxcore. They need to use - techniques such as sampling to understand the codebase (sample certain elements at random, for exmple). They need - some estimate of how long different build operations will take on a normal laptop. +- [x] Change local dev workflow and CI workflow based on the changed ./build-and-ci-design.md file +- [x] Push to CI in PR 145 and iteratively refine any mistakes so that the ci yaml works correctly + (but we will fix lints and warnings locally) +- [x] In parallel fix lints and warnings until make fmt && make check && make test-all passes + locally +- [x] push the changes to PR 145 and monitor for passing CI +- [x] clean up the commits locally such that we have the originally desired commit sequence, i.e. + fixup the original commits so that they work +- [x] prompt the user for a force push to PR 145 when commits are clean +- [x] monitor PR 145 after the force push +- [ ] Properly instruct coding agents about how many C++ symbols are involved, especially in mxcore. + They need to use techniques such as sampling to understand the codebase (sample certain elements + at random, for exmple). They need some estimate of how long different build operations will take + on a normal laptop. ## Phase 1: Reverse Engineer Codegen @@ -29,8 +29,8 @@ This is the project plan for supporting MusicXML 4.0 ## Phase 2: Modernize or Improve the C++ -Before we codegen 4.0, maybe we should improve what is being generated from the current MusicXML Spec for performance -and for new C++ features, e.g. enum variants etc. Can it be more optimal? +Before we codegen 4.0, maybe we should improve what is being generated from the current MusicXML +Spec for performance and for new C++ features, e.g. enum variants etc. Can it be more optimal? ## Phase 3: Analyze which features of MusicXML are inaccessible from mx/api @@ -43,4 +43,4 @@ and for new C++ features, e.g. enum variants etc. Can it be more optimal? Not related to the larger project plan: - [ ] Remove CircleCI Stuff -- [ ] Cleanup the Changelog \ No newline at end of file +- [ ] Cleanup the Changelog diff --git a/Documents/ai/project/build-and-ci-design.md b/Documents/ai/project/build-and-ci-design.md index 8205517f1..58bb90279 100644 --- a/Documents/ai/project/build-and-ci-design.md +++ b/Documents/ai/project/build-and-ci-design.md @@ -29,12 +29,12 @@ with their native toolchains; they enforce no quality gates. ## Toolchain (Docker) The quality-gate tools are pinned inside a Docker image built from the `Dockerfile` at the repo -root. The image is Ubuntu 24.04 with **g++-14** and clang-format-18. The gate compiles with GCC -(not clang) so it uses the same compiler family and standard library (libstdc++) as the required -Linux CI jobs - a `make check` pass locally therefore means the GCC jobs compile too. clang-tidy -was previously the reason to use clang + libc++ here; with clang-tidy removed (see Future Work), -GCC is the better choice because it removes the local-vs-CI portability blind spot. Pinning keeps -the `-Wall -Wextra` warning set deterministic. +root. The image is Ubuntu 24.04 with **g++-14** and clang-format-18. The gate compiles with GCC (not +clang) so it uses the same compiler family and standard library (libstdc++) as the required Linux CI +jobs - a `make check` pass locally therefore means the GCC jobs compile too. clang-tidy was +previously the reason to use clang + libc++ here; with clang-tidy removed (see Future Work), GCC is +the better choice because it removes the local-vs-CI portability blind spot. Pinning keeps the +`-Wall -Wextra` warning set deterministic. ### Formatting: clang-format @@ -49,7 +49,8 @@ formatted, including generated files in `mx/core/`. ### Linting (deferred) clang-tidy is **not** a current quality gate. It was evaluated and removed because running it across -the whole tree is not viable. See Future Work for the rationale and the intended scoped reintroduction. +the whole tree is not viable. See Future Work for the rationale and the intended scoped +reintroduction. ### Compiler Warnings @@ -89,8 +90,8 @@ full recompiles on every `make check` run. The Makefile detects `MX_RUNNING_IN_DOCKER`: - **Inside the container** (`MX_RUNNING_IN_DOCKER=1`): runs clang-format and the compiler directly. -- **Outside the container**: runs `docker buildx build` to build the image and execute the - requested target inside it. +- **Outside the container**: runs `docker buildx build` to build the image and execute the requested + target inside it. For `make fmt`, which needs to write formatted files back to the host, the Makefile uses `docker buildx build --output type=local,dest=.` to extract the formatted `Sourcecode/` tree from a @@ -122,55 +123,55 @@ natively with the local compiler. ### Quality Targets (Docker) -| Target | What it does | -|--------------------|---------------------------------------------------------------| -| `make fmt` | Formats all C++ files under `Sourcecode/` in-place via Docker | -| `make check` | Quality gate: fmt-check + warning-free build (Docker) | -| `make clean-docker`| Removes the Docker buildx cache | +| Target | What it does | +|---------------------|---------------------------------------------------------------| +| `make fmt` | Formats all C++ files under `Sourcecode/` in-place via Docker | +| `make check` | Quality gate: fmt-check + warning-free build (Docker) | +| `make clean-docker` | Removes the Docker buildx cache | `check-docker` is an internal prerequisite that verifies Docker is available on `PATH`. ### Build Targets (Native) -| Target | What it does | -|--------------------|-------------------------------------------------------------------| -| `make lib` | Build just the static library (no tests, no examples) | -| `make dev` | Build tests (no slow core tests) + examples | -| `make core` | Build the full suite including slow `mx::core` tests | +| Target | What it does | +|-------------|-------------------------------------------------------| +| `make lib` | Build just the static library (no tests, no examples) | +| `make dev` | Build tests (no slow core tests) + examples | +| `make core` | Build the full suite including slow `mx::core` tests | ### Run Targets (Native) -| Target | What it does | -|---------------------|------------------------------------------------------------------| -| `make test` | Build dev, run examples + mxtest. `ARGS=` forwarded | -| `make test-all` | Build core, run examples + full mxtest. `ARGS=` forwarded | -| `make examples-run` | Build dev, then run mxread/mxwrite/mxhide | -| `make all` | Build core, run examples, run full mxtest | +| Target | What it does | +|---------------------|-----------------------------------------------------------| +| `make test` | Build dev, run examples + mxtest. `ARGS=` forwarded | +| `make test-all` | Build core, run examples + full mxtest. `ARGS=` forwarded | +| `make examples-run` | Build dev, then run mxread/mxwrite/mxhide | +| `make all` | Build core, run examples, run full mxtest | ### Xcode Targets (Native) | Target | What it does | |--------------------|-----------------------------------------------| -| `make xcode-gen` | Runs `cmake -G Xcode -S . -B build/xcode` | +| `make xcode-gen` | Runs `cmake -G Xcode -S . -B build/xcode` | | `make xcode-build` | Builds the generated project via `xcodebuild` | | `make xcode-test` | Runs tests via `xcodebuild test` | ### Housekeeping -| Target | What it does | -|--------------------|-------------------------------| -| `make clean` | Remove the entire `build/` tree | -| `make clean-docker`| Remove the Docker buildx cache | +| Target | What it does | +|---------------------|---------------------------------| +| `make clean` | Remove the entire `build/` tree | +| `make clean-docker` | Remove the Docker buildx cache | ### Knobs -| Variable | Default | Purpose | -|-------------|------------------|----------------------------------------------------| -| `JOBS` | auto-detected | Parallel compile jobs | -| `BUILD_TYPE`| `Debug` | CMake build type | -| `GENERATOR` | platform default | CMake generator override | -| `ARGS` | (none) | Forwarded to mxtest (Catch2) | -| `DOCKER` | `docker` | Docker executable | +| Variable | Default | Purpose | +|--------------|------------------|------------------------------| +| `JOBS` | auto-detected | Parallel compile jobs | +| `BUILD_TYPE` | `Debug` | CMake build type | +| `GENERATOR` | platform default | CMake generator override | +| `ARGS` | (none) | Forwarded to mxtest (Catch2) | +| `DOCKER` | `docker` | Docker executable | * * * @@ -197,13 +198,13 @@ CI runs on every PR update and on every push to `master`. Runner: `ubuntu-latest` -| Step | Command | -|-----------------|----------------| -| Quality gate | `make check` | -| Run tests | `make test` | +| Step | Command | +|--------------|--------------| +| Quality gate | `make check` | +| Run tests | `make test` | -The Makefile handles Docker internally - CI just runs `make check`. The Docker image is built -from the repo's `Dockerfile` with BuildKit layer caching via GitHub Actions cache (the Makefile +The Makefile handles Docker internally - CI just runs `make check`. The Docker image is built from +the repo's `Dockerfile` with BuildKit layer caching via GitHub Actions cache (the Makefile auto-detects `ACTIONS_RUNTIME_TOKEN` and enables the gha cache only when present). This is the authoritative quality gate. Formatting and compiler warnings are enforced here with @@ -213,21 +214,21 @@ pinned tool versions. Runner: `ubuntu-latest` -| Step | Command | -|-----------------|----------------| -| Full test suite | `make test-all`| +| Step | Command | +|-----------------|-----------------| +| Full test suite | `make test-all` | -Builds and runs the complete test suite including the slow `mx::core` tests using GCC (the -system compiler). This provides GCC compilation coverage that the Docker gate job (which uses -clang) does not. +Builds and runs the complete test suite including the slow `mx::core` tests using GCC (the system +compiler). This provides GCC compilation coverage that the Docker gate job (which uses clang) does +not. #### macos (required - build + tests) Runner: `macos-latest` -| Step | Command | -|-----------------|-------------| -| Run tests | `make test` | +| Step | Command | +|-----------|-------------| +| Run tests | `make test` | Builds and tests with the system clang. `make test` runs the example programs in addition to `mxtest`, so the examples are exercised on every platform that runs tests (not just macOS). No @@ -237,10 +238,10 @@ quality gates - those are enforced by linux-gate. Runner: `windows-latest` -| Step | Command | -|-----------------|------------| -| Install make | `choco install make` | -| Run tests | `make test`| +| Step | Command | +|--------------|----------------------| +| Install make | `choco install make` | +| Run tests | `make test` | Builds and tests with MSVC. No quality gates. @@ -290,8 +291,8 @@ If the change touches `Sourcecode/private/mx/core/`, run `make test-all` instead 1. **Formatting** - all files must be formatted per `.clang-format`. `make fmt` fixes formatting. 2. **Compiler warnings** - the build must configure, compile, and emit no `warning:` lines. -These commands require Docker. If Docker is not available, `make check` will report the error. -No other tool installation is needed for quality gates. +These commands require Docker. If Docker is not available, `make check` will report the error. No +other tool installation is needed for quality gates. * * * @@ -304,8 +305,8 @@ the whole tree is not viable: them measured at roughly 8 s/file (~2.6 hours total). - With a `Sourcecode/.*` header filter, clang-tidy re-parses shared headers once per translation unit and reports millions of duplicated diagnostics. -- The generated `mx/core` code is slated for replacement by a future codegen rewrite, so linting - it now has little value. +- The generated `mx/core` code is slated for replacement by a future codegen rewrite, so linting it + now has little value. The intended future direction is to reintroduce clang-tidy **scoped to the hand-written public API and implementation** - starting with `Sourcecode/include/mx/api/` (`mx/api`) - and explicitly diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..4d022c751 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Matthew James Briggs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 2d9c94606..000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2017 Matthew James Briggs - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 6e9a75de9..c553d0e54 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -MusicXML Class Library -====================== +# MusicXML Class Library - Author: Matthew James Briggs - License: MIT @@ -7,7 +6,7 @@ MusicXML Class Library - Supported MusicXML Version: 3.0 - Language: C++17 ------------------------------------------ +* * * [![CircleCI](https://circleci.com/gh/webern/mx.svg?style=svg)](https://circleci.com/gh/webern/mx) @@ -17,11 +16,10 @@ This project is a C++ library for working with MusicXML. # Build -A top-level `Makefile` wraps CMake and encodes the build/test configurations this project uses. -It is a convenience layer, not a replacement for CMake. It needs `cmake` (>= 3.13) and a POSIX -shell. On Windows it is best-effort: install CMake plus GNU make and a POSIX shell (Git Bash, -MSYS2, or WSL); the underlying compiler can still be MSVC, since builds go through -`cmake --build`. +A top-level `Makefile` wraps CMake and encodes the build/test configurations this project uses. It +is a convenience layer, not a replacement for CMake. It needs `cmake` (>= 3.13) and a POSIX shell. +On Windows it is best-effort: install CMake plus GNU make and a POSIX shell (Git Bash, MSYS2, or +WSL); the underlying compiler can still be MSVC, since builds go through `cmake --build`. Building and running tests should be as simple as: @@ -35,21 +33,21 @@ Run `make` (or `make help`) to list every target. ### Build Modes -There are three `cmake` options (`MX_BUILD_TESTS`, `MX_BUILD_CORE_TESTS`, `MX_BUILD_EXAMPLES`). -Only three combinations are useful workflows, exposed as three build targets: +There are three `cmake` options (`MX_BUILD_TESTS`, `MX_BUILD_CORE_TESTS`, `MX_BUILD_EXAMPLES`). Only +three combinations are useful workflows, exposed as three build targets: -| Target | Builds | Notes | -|------------|---------------------------------------------------------|----------------------------------------------------| -| `make lib` | the static library only | fastest; use this if you just need the lib | -| `make dev` | tests (no core tests) + examples | recommended for development | -| `make core`| tests including the `mx::core` tests + examples | slow to compile; only needed for `mx::core` changes| +| Target | Builds | Notes | +|-------------|-------------------------------------------------|-----------------------------------------------------| +| `make lib` | the static library only | fastest; use this if you just need the lib | +| `make dev` | tests (no core tests) + examples | recommended for development | +| `make core` | tests including the `mx::core` tests + examples | slow to compile; only needed for `mx::core` changes | The `core` tests take a long time to compile. You only need them if you make changes in the `mx::core` namespace. Run targets build the needed mode first, then run binaries: `make test` (runs `mxtest`), -`make test-core` (full `mxtest`), `make examples-run` (runs the examples), and `make all` -(full build, examples, and full `mxtest`). `make clean` removes the build tree. +`make test-core` (full `mxtest`), `make examples-run` (runs the examples), and `make all` (full +build, examples, and full `mxtest`). `make clean` removes the build tree. Each mode builds into `build//` with its own cache and incremental state, so switching modes never recompiles another mode's tree. Knobs: `JOBS` (parallelism, auto-detected), @@ -60,12 +58,15 @@ switching modes never recompiles another mode's tree. Knobs: `JOBS` (parallelism * `mx` should not depend on any outside libraries (no deps). * `mx` third-party code should be kept to a minimum. -* `mx` third-party code should be checked into the `mx` repo and compiled as part of the `mx` library. -* `mx` should not depened on any package manager, though it may be published into any package manager. +* `mx` third-party code should be checked into the `mx` repo and compiled as part of the `mx` + library. +* `mx` should not depened on any package manager, though it may be published into any package + manager. ### Using `mx` in a Cmake Project -The following script demonstrates how you can start a new cmake project that uses `mx` by commiting its sourcecode into your project: +The following script demonstrates how you can start a new cmake project that uses `mx` by commiting +its sourcecode into your project: ```sh #!/bin/bash @@ -163,20 +164,19 @@ cmake .. && make -j10 ### Xcode Project The Xcode project (checked-in to the repo) has targets for iOS and macOS frameworks and dylibs. -These are not specified in the cmake file. -Contributors are not required to keep the Xcode project up-to-date. -If you add, move or remove files from the codebase, it is likely that the Xcode CI run will fail. -This will not prevent a contribution from being merged, the maintainer will fix the project after-the-fact. - +These are not specified in the cmake file. Contributors are not required to keep the Xcode project +up-to-date. If you add, move or remove files from the codebase, it is likely that the Xcode CI run +will fail. This will not prevent a contribution from being merged, the maintainer will fix the +project after-the-fact. # Using `mx` ## API -The `mx::api` namespace is intended to be a simplified structural representation of MusicXML. -It should be more intuitive than manipulating the DOM representation directly. -In particular, voices and time positions are more explicitly managed. -Some complexities, on the other hand, are retained in `mx::api`, such as the need to manage beam starts and stops explicitly. +The `mx::api` namespace is intended to be a simplified structural representation of MusicXML. It +should be more intuitive than manipulating the DOM representation directly. In particular, voices +and time positions are more explicitly managed. Some complexities, on the other hand, are retained +in `mx::api`, such as the need to manage beam starts and stops explicitly. #### Writing MusicXML with `mx::api` @@ -415,10 +415,10 @@ int main(int argc, const char * argv[]) # Implementation Details -The MusicXML classes in `mx::core` are tightly bound to the `musicxml.xsd` specification. -MusicXML can be challenging to use and the `mx::core` class structure mirrors the complexity of the MusicXML specification. -A simplified representation is available in `mx::api`. -It is possible to work with a subset of MusicXML using only `mx::api`, without delving into `mx::core`. +The MusicXML classes in `mx::core` are tightly bound to the `musicxml.xsd` specification. MusicXML +can be challenging to use and the `mx::core` class structure mirrors the complexity of the MusicXML +specification. A simplified representation is available in `mx::api`. It is possible to work with a +subset of MusicXML using only `mx::api`, without delving into `mx::core`. ##### Namespaces @@ -432,8 +432,9 @@ using namespace ezxml; // generic serialization and deserialization of xml ##### `mx::api` -The `mx::api` namespace is a set of 'plain old data' structs that represent a simplified model of MusicXML. -For example, here is the `ScoreData.h`, which represents the top level of the object heirarchy: +The `mx::api` namespace is a set of 'plain old data' structs that represent a simplified model of +MusicXML. For example, here is the `ScoreData.h`, which represents the top level of the object +heirarchy: ```C++ class ScoreData @@ -462,18 +463,21 @@ public: `mx::api` and `mx::core` are kept completely separate.\ That is, `mx::api` data is serialized into `mx::core` data, which is then serialized into MusicXML. -The `mx::api` struct allow us to simplify things like specifying a note's tick time position, and allowing the serialization process to take care of details such as `` `` elements. +The `mx::api` struct allow us to simplify things like specifying a note's tick time position, and +allowing the serialization process to take care of details such as `` `` elements. ##### `mx::core` -The `mx::core` namespace contains the MusicXML representation objects such as elements and attributes. -`mx::core` was mostly generated from `musicxml.xsd` with plenty of intervention by hand. +The `mx::core` namespace contains the MusicXML representation objects such as elements and +attributes. `mx::core` was mostly generated from `musicxml.xsd` with plenty of intervention by hand. ###### XML Choices and Groups -In the `musicxml.xsd` there are many cases of `xs:choice` or `xs:group` being used. -These constructs are typically represented in the `mx::core` class structure the same way that they are found in the `musicxml.xsd` specification. -The interfaces in this namespace are relatively stable, however they are tightly bound to MusicXML's specification and thus they will change when it comes time to support a future version of MusicXML. +In the `musicxml.xsd` there are many cases of `xs:choice` or `xs:group` being used. These constructs +are typically represented in the `mx::core` class structure the same way that they are found in the +`musicxml.xsd` specification. The interfaces in this namespace are relatively stable, however they +are tightly bound to MusicXML's specification and thus they will change when it comes time to +support a future version of MusicXML. ##### `mx::impl` @@ -481,40 +485,39 @@ The interfaces in this namespace are relatively stable, however they are tightly ##### `mx::utility` -This namespace is small. -It mostly contains macros and small, generic functions. +This namespace is small. It mostly contains macros and small, generic functions. ##### `ezxml` -The `ezxml` namespace contains generic XML DOM functionality. -Under the hood [pugixml](http://pugixml.org/) is being used. -See the XML DOM section for more information. -Note that, even though `ezxml` can stand alone as a useful abstraction, we build it as if it were entirely owned by the `mx` project. -Additionally, we check the `pugixml` library in and build it as if it were part of the `mx` project. -This is in keeping with the build tenets [above](#build-tenets) +The `ezxml` namespace contains generic XML DOM functionality. Under the hood +[pugixml](http://pugixml.org/) is being used. See the XML DOM section for more information. Note +that, even though `ezxml` can stand alone as a useful abstraction, we build it as if it were +entirely owned by the `mx` project. Additionally, we check the `pugixml` library in and build it as +if it were part of the `mx` project. This is in keeping with the build tenets [above](#build-tenets) ##### Partwise vs. Timewise -There are two types of MusicXML documents, `partwise` and `timewise`. -A partwise document consists of a set of parts which contain measures. -A timewise document consists of a set of measures which contain parts. -Partwise is used more often by MusicXML applications while Timewise documents seem to be rare or even nonresistant. -Nonetheless *MusicXML Class Library* implements both Timewise and Partwise. -The class `mx::core::Document` can hold *either* a Partwise *or* a Timewise score. -Note that it actually holds both, but only one or the other is 'active' (this is similar to how `xsd` `choice` constructs are handled). -You can check the inner document type with the getChoice function. + +There are two types of MusicXML documents, `partwise` and `timewise`. A partwise document consists +of a set of parts which contain measures. A timewise document consists of a set of measures which +contain parts. Partwise is used more often by MusicXML applications while Timewise documents seem to +be rare or even nonresistant. Nonetheless *MusicXML Class Library* implements both Timewise and +Partwise. The class `mx::core::Document` can hold *either* a Partwise *or* a Timewise score. Note +that it actually holds both, but only one or the other is 'active' (this is similar to how `xsd` +`choice` constructs are handled). You can check the inner document type with the getChoice function. You can convert between Partwise and Timewise with the convertContents function. ##### Elements -Each XML element is represented by a class which derives from ElementInterface. -Elements are created and used by way of shared pointers. -Each element comes with a set of using/typedef statements as well as a convenience function for making the shared pointers. + +Each XML element is represented by a class which derives from ElementInterface. Elements are created +and used by way of shared pointers. Each element comes with a set of using/typedef statements as +well as a convenience function for making the shared pointers. ##### Shared Pointers -Many elements contain other elements. -When they do, these data members will also be shared pointers. + +Many elements contain other elements. When they do, these data members will also be shared pointers. Get/set functions will allow access to the data members by accepting and returning shared pointers. -If you attempt to set a data member to a nullptr, the setter function will silently do nothing. -Thus we can be reasonably assured our objects will never return nullptr. +If you attempt to set a data member to a nullptr, the setter function will silently do nothing. Thus +we can be reasonably assured our objects will never return nullptr. For example @@ -526,18 +529,20 @@ x->somefuntion(); /* OK to dereference without checking for nullptr */ ``` ##### Optional Member Data -Many of the elements in MusicXML are optional. -In these cases there is a bool which indicates whether or not the element is present. -The bool serves as a flag indicating whether or not the optional element will be output when you stream out your MusicXML document. -The bool has no side-effect on the element who's presence/absence it represents. -So for example we may set some data: + +Many of the elements in MusicXML are optional. In these cases there is a bool which indicates +whether or not the element is present. The bool serves as a flag indicating whether or not the +optional element will be output when you stream out your MusicXML document. The bool has no +side-effect on the element who's presence/absence it represents. So for example we may set some +data: ```C++ foo->setValue( "hello" ); bar->setFoo( foo ); ``` -But in this example, if Foo is an optional member of Bar, then we must also set hasFoo to *true* or else foo will not be in the XML output. +But in this example, if Foo is an optional member of Bar, then we must also set hasFoo to *true* or +else foo will not be in the XML output. ```C++ bar->toStream(...); /* Foo is not in the output! */ @@ -553,14 +558,15 @@ bar->getFoo()->getValue() == "hello"; /* True! The value still exists but is not ``` ##### Optional Member Data with Unbounded Occurrences -Sometimes an element may contain zero, one, or many occurrences of another element. -For example + +Sometimes an element may contain zero, one, or many occurrences of another element. For example ```xml ``` -In this case there will be a collection of Key objects and the getter/setters will look like this, where `KeySet` is a typedef of `std::vector`. +In this case there will be a collection of Key objects and the getter/setters will look like this, +where `KeySet` is a typedef of `std::vector`. ```C++ const KeySet& getKeySet() const; @@ -571,15 +577,15 @@ KeyPtr getKey( const KeySetIterConst& setIterator ) const; ``` ##### Required Member Data with Unbounded Occurrences -Sometimes an element is required, but you may optionally have more than one. -For example + +Sometimes an element is required, but you may optionally have more than one. For example ```xml ``` -In this case, minOccurs="1" (by default per XSD language rules). -The functions will look just like the previous example, but they will behave differently +In this case, minOccurs="1" (by default per XSD language rules). The functions will look just like +the previous example, but they will behave differently ```C++ const DirectionTypeSet& getDirectionTypeSet() const; @@ -589,19 +595,22 @@ void clearDirectionTypeSet(); DirectionTypePtr getDirectionType( const DirectionTypeSetIterConst& setIterator ) const; ``` -When the containing element is constructed, a single DirectionType will be default constructed and pushed onto the vector. -Thus you will have one default constructed DirectionType in the set upon construction. +When the containing element is constructed, a single DirectionType will be default constructed and +pushed onto the vector. Thus you will have one default constructed DirectionType in the set upon +construction. -If you try to call removeDirectionType with only one DirectionType in the set (size==1) nothing will happen. -You will still have a single DirectionType in the collection. +If you try to call removeDirectionType with only one DirectionType in the set (size==1) nothing will +happen. You will still have a single DirectionType in the collection. -When you call clearDirectionTypeSet vector.clear() will be called but it will follow up by pushing a default constructed DirectionType onto the vector so you will still have size==1. +When you call clearDirectionTypeSet vector.clear() will be called but it will follow up by pushing a +default constructed DirectionType onto the vector so you will still have size==1. -As it turns out, this design choice tends to be annoying in practice. -On the upside, it does guarantee that your MusicXML document will be valid, even if you forget to add a required element. -The downside is that it means you have to deal with the fact that a default constructed element always exists in the set, so you must replace or remove the first element. -Furthermore, you cannot remove the existing element until another one has been added. -Here are the two patterns I have used for this (pseudocode). +As it turns out, this design choice tends to be annoying in practice. On the upside, it does +guarantee that your MusicXML document will be valid, even if you forget to add a required element. +The downside is that it means you have to deal with the fact that a default constructed element +always exists in the set, so you must replace or remove the first element. Furthermore, you cannot +remove the existing element until another one has been added. Here are the two patterns I have used +for this (pseudocode). **Pattern 1:** Replace the first element by dereferencing the begin() iterator: @@ -636,17 +645,19 @@ for( auto stuffElement : stuffIWantToAdd ) } ``` -Pattern 1 always works, even if you're not sure whether or not the `minOccurs="1"` or `"0"`. -Pattern 2 only works when `minOccurs="1"`. -There are no cases where `minOccurs` is greater than 1. +Pattern 1 always works, even if you're not sure whether or not the `minOccurs="1"` or `"0"`. Pattern +2 only works when `minOccurs="1"`. There are no cases where `minOccurs` is greater than 1. ##### Member Data with Bounded maxOccurs + ```xml ``` + In this case if you call addBeam when there are already 8 beams in the vector, nothing will happen. ##### xs:groups + For an xs:group there is usually a single 'element' class which represents the group of elements. For example this XSD snippet: @@ -680,7 +691,7 @@ public: void setLevel( const LevelPtr& value ); bool getHasLevel() const; void setHasLevel( const bool value ); - + bool fromXElement( std::ostream& message, xml::XElement& xelement ); private: @@ -693,10 +704,11 @@ private: ##### xs:choices -There are a few exceptions (mistakes) but for the most part, `xs:choice` constructs are represented by a class with a name ending in 'Choice'. -The element will have an enum named 'Choice' in the public scope of the class. -Each of the possible 'choices' will exist as data members of the class, but only one of them will be 'active' (was present in, or will be written to, XML). -For example, this xsd construct: +There are a few exceptions (mistakes) but for the most part, `xs:choice` constructs are represented +by a class with a name ending in 'Choice'. The element will have an enum named 'Choice' in the +public scope of the class. Each of the possible 'choices' will exist as data members of the class, +but only one of them will be 'active' (was present in, or will be written to, XML). For example, +this xsd construct: ```xml @@ -727,7 +739,7 @@ public: BendChoice(); /* ... other stuff ... */ - + BendChoice::Choice getChoice() const; void setChoice( BendChoice::Choice value ); @@ -748,16 +760,19 @@ private: }; ``` -When `getChoice() == BendChoice::Choice::preBend` then we will see `` in the XML, but when `getChoice() == BendChoice::Choice::postBend` then we will see `` in the XML. +When `getChoice() == BendChoice::Choice::preBend` then we will see `` in the XML, but +when `getChoice() == BendChoice::Choice::postBend` then we will see `` in the XML. ### XML DOM (::ezxml::) -Any XML document can be read and manipulated with the classes in the `::ezxml::` namespace. -Most notably, look at the following pure virtual interfaces XDoc, XElement, XAttribute. -Also look at the STL-compliant iterators XElementIterator and XAttributeIterator. +Any XML document can be read and manipulated with the classes in the `::ezxml::` namespace. Most +notably, look at the following pure virtual interfaces XDoc, XElement, XAttribute. Also look at the +STL-compliant iterators XElementIterator and XAttributeIterator. -These interfaces are designed to wrap any underlying XML DOM software so that `mx::core` does not care or know about the XML DOM code. -A set of implementation classes wrapping pugixml are provided, but if you need to use, say Xerces or RapidXML, you can look at the PugiElement, PugiDoc, etc classes and wrap whatever library you need. +These interfaces are designed to wrap any underlying XML DOM software so that `mx::core` does not +care or know about the XML DOM code. A set of implementation classes wrapping pugixml are provided, +but if you need to use, say Xerces or RapidXML, you can look at the PugiElement, PugiDoc, etc +classes and wrap whatever library you need. Here's how you can read a MusicXML document into `mx::core` classes by way of `::ezxml::`. @@ -777,48 +792,49 @@ int main(int argc, const char *argv[]) // allocate the objects mx::core::DocumentPtr mxDoc = makeDocument(); ::ezxml::::XDocPtr xmlDoc = ::ezxml::::XFactory::makeXDoc(); - + // read a MusicXML file into the XML DOM structure xmlDoc->loadFile( "music.xml" ); // create an ostream to receive any parsing messages std::stringstream parseMessages; - + // convert the XML DOM into MusicXML Classes bool isSuccess = mxDoc->fromXDoc( parseMessages, *xmlDoc ); - + if( !isSuccess ) { std::cout << "Parsing of the MusicXML document failed with the following message(s):" << std::endl; std::cout << parseMessages.str() << std::endl; return -1; } - + // maybe the document was timewise document. if so, convert it to partwise if( mxDoc->getChoice() == mx::core::DocumentChoice::timewise ) { mxDoc->convertContents(); } - + // get the root auto scorePartwise = mxDoc->getScorePartwise(); - + // change the title scorePartwise->getScoreHeaderGroup()->setHasWork( true ); scorePartwise->getScoreHeaderGroup()->getWork()->setHasWorkTitle( true ); scorePartwise->getScoreHeaderGroup()->getWork()->getWorkTitle()->setValue( mx::core::XsString( "New Title" ) ); - + // write it back out to disk mxDoc->toXDoc( *xmlDoc ); xmlDoc->write( "newtitle.xml" ); - + return 0; } ``` ### Hello World using mx::core -On the MusicXML home page there is an example of a "Hello World" simple MusicXML file. -Here is a main function that would output this "Hello World" MusicXML example to std::cout. + +On the MusicXML home page there is an example of a "Hello World" simple MusicXML file. Here is a +main function that would output this "Hello World" MusicXML example to std::cout. ```C++ #include @@ -867,7 +883,7 @@ int main(int argc, const char * argv[]) noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( PositiveDivisionsValue( 4 ) ); noteData->getNote()->getType()->setValue( NoteTypeValue::whole ); measure->getMusicDataGroup()->addMusicDataChoice( noteData ); - + doc->toStream( cout ); /* print Hello World MusicXML document to console */ return 0; } @@ -875,6 +891,6 @@ int main(int argc, const char * argv[]) ### Unit Test Framework -An executable program named mxtest is also included in the project. -mxtest utilizes the Catch2 test framework. -The core tests are slow to compile, see the [Build Modes](#build-modes) section for more info on how to skip compilation of the tests. +An executable program named mxtest is also included in the project. mxtest utilizes the Catch2 test +framework. The core tests are slow to compile, see the [Build Modes](#build-modes) section for more +info on how to skip compilation of the tests. From f7165d04be95abf39645131b0b814cb723fc7a99 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:45:10 +0200 Subject: [PATCH 25/34] rename CodeGen -> gen/version-b The gen/ directory will also hold gen/version-a (DevScripts) once that rename follows. Update AGENTS.md and .dockerignore. --- .dockerignore | 2 +- AGENTS.md | 4 ++-- CodeGen/.idea/.gitignore | 6 ------ CodeGen/.idea/CodeGen.iml | 15 --------------- CodeGen/.idea/codeStyles/codeStyleConfig.xml | 5 ----- .../inspectionProfiles/Project_Default.xml | 6 ------ CodeGen/.idea/modules.xml | 8 -------- CodeGen/.idea/runConfigurations/run.xml | 15 --------------- CodeGen/.idea/runConfigurations/show.xml | 17 ----------------- {CodeGen => gen/version-b}/.gitignore | 0 {CodeGen => gen/version-b}/Cargo.lock | 0 {CodeGen => gen/version-b}/Cargo.toml | 0 {CodeGen => gen/version-b}/rustfmt.toml | 0 {CodeGen => gen/version-b}/src/bin/flatten.rs | 0 {CodeGen => gen/version-b}/src/bin/main.rs | 0 {CodeGen => gen/version-b}/src/bin/show.rs | 0 {CodeGen => gen/version-b}/src/error.rs | 0 .../version-b}/src/generate/compile_mx.rs | 0 .../version-b}/src/generate/cpp/constants.rs | 0 .../version-b}/src/generate/cpp/cpp_template.rs | 0 .../version-b}/src/generate/cpp/helpers.rs | 0 .../version-b}/src/generate/cpp/mod.rs | 0 .../version-b}/src/generate/cpp/modeler.rs | 0 .../version-b}/src/generate/cpp/write_custom.rs | 0 .../version-b}/src/generate/cpp/write_enums.rs | 0 .../src/generate/cpp/write_numerics.rs | 0 .../version-b}/src/generate/cpp/write_unions.rs | 0 .../version-b}/src/generate/cpp/writer.rs | 0 .../generate/data/NumberOrNormal.cpp.template | 0 .../src/generate/data/NumberOrNormal.h.template | 0 .../data/PositiveIntegerOrEmpty.cpp.template | 0 .../data/PositiveIntegerOrEmpty.h.template | 0 .../src/generate/data/core.cpp.template | 0 .../src/generate/data/core.h.template | 0 .../generate/data/decimal_builtins.cpp.template | 0 .../generate/data/decimal_builtins.h.template | 0 .../src/generate/data/decimal_type.cpp.template | 0 .../src/generate/data/decimal_type.h.template | 0 .../src/generate/data/enum.cpp.template | 0 .../src/generate/data/enum.h.template | 0 .../src/generate/data/enum_wrapper.cpp.template | 0 .../src/generate/data/enum_wrapper.h.template | 0 .../generate/data/integer_builtins.cpp.template | 0 .../generate/data/integer_builtins.h.template | 0 .../src/generate/data/integer_type.cpp.template | 0 .../src/generate/data/integer_type.h.template | 0 .../src/generate/data/union.cpp.template | 0 .../src/generate/data/union.h.template | 0 {CodeGen => gen/version-b}/src/generate/mod.rs | 0 .../version-b}/src/generate/paths.rs | 0 .../version-b}/src/generate/template.rs | 0 {CodeGen => gen/version-b}/src/lib.rs | 0 {CodeGen => gen/version-b}/src/model/builtin.rs | 0 {CodeGen => gen/version-b}/src/model/create.rs | 0 {CodeGen => gen/version-b}/src/model/creator.rs | 0 .../src/model/default_create/enumeration.rs | 0 .../version-b}/src/model/default_create/mod.rs | 0 .../src/model/default_create/scalar.rs | 0 .../version-b}/src/model/enumeration.rs | 0 {CodeGen => gen/version-b}/src/model/mod.rs | 0 .../version-b}/src/model/post_process.rs | 0 {CodeGen => gen/version-b}/src/model/scalar.rs | 0 {CodeGen => gen/version-b}/src/model/symbol.rs | 0 .../version-b}/src/model/transform.rs | 0 {CodeGen => gen/version-b}/src/utils/mod.rs | 0 .../version-b}/src/utils/string_stuff.rs | 0 .../version-b}/src/xsd/annotation.rs | 0 {CodeGen => gen/version-b}/src/xsd/attribute.rs | 0 .../version-b}/src/xsd/attribute_group.rs | 0 .../version-b}/src/xsd/attributes.rs | 0 {CodeGen => gen/version-b}/src/xsd/choice.rs | 0 {CodeGen => gen/version-b}/src/xsd/common.rs | 0 .../version-b}/src/xsd/complex_content.rs | 0 .../version-b}/src/xsd/complex_type.rs | 0 {CodeGen => gen/version-b}/src/xsd/constants.rs | 0 {CodeGen => gen/version-b}/src/xsd/element.rs | 0 {CodeGen => gen/version-b}/src/xsd/extension.rs | 0 {CodeGen => gen/version-b}/src/xsd/group.rs | 0 {CodeGen => gen/version-b}/src/xsd/id.rs | 0 {CodeGen => gen/version-b}/src/xsd/import.rs | 0 {CodeGen => gen/version-b}/src/xsd/list.rs | 0 {CodeGen => gen/version-b}/src/xsd/mod.rs | 0 .../version-b}/src/xsd/primitives.rs | 0 .../version-b}/src/xsd/restriction.rs | 0 {CodeGen => gen/version-b}/src/xsd/sequence.rs | 0 .../version-b}/src/xsd/simple_content.rs | 0 .../version-b}/src/xsd/simple_type.rs | 0 {CodeGen => gen/version-b}/src/xsd/union.rs | 0 {CodeGen => gen/version-b}/src/xsd/utils.rs | 0 {CodeGen => gen/version-b}/tests/xsd.rs | 0 90 files changed, 3 insertions(+), 75 deletions(-) delete mode 100644 CodeGen/.idea/.gitignore delete mode 100644 CodeGen/.idea/CodeGen.iml delete mode 100644 CodeGen/.idea/codeStyles/codeStyleConfig.xml delete mode 100644 CodeGen/.idea/inspectionProfiles/Project_Default.xml delete mode 100644 CodeGen/.idea/modules.xml delete mode 100644 CodeGen/.idea/runConfigurations/run.xml delete mode 100644 CodeGen/.idea/runConfigurations/show.xml rename {CodeGen => gen/version-b}/.gitignore (100%) rename {CodeGen => gen/version-b}/Cargo.lock (100%) rename {CodeGen => gen/version-b}/Cargo.toml (100%) rename {CodeGen => gen/version-b}/rustfmt.toml (100%) rename {CodeGen => gen/version-b}/src/bin/flatten.rs (100%) rename {CodeGen => gen/version-b}/src/bin/main.rs (100%) rename {CodeGen => gen/version-b}/src/bin/show.rs (100%) rename {CodeGen => gen/version-b}/src/error.rs (100%) rename {CodeGen => gen/version-b}/src/generate/compile_mx.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/constants.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/cpp_template.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/helpers.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/mod.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/modeler.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/write_custom.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/write_enums.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/write_numerics.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/write_unions.rs (100%) rename {CodeGen => gen/version-b}/src/generate/cpp/writer.rs (100%) rename {CodeGen => gen/version-b}/src/generate/data/NumberOrNormal.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/NumberOrNormal.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/PositiveIntegerOrEmpty.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/PositiveIntegerOrEmpty.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/core.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/core.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/decimal_builtins.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/decimal_builtins.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/decimal_type.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/decimal_type.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/enum.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/enum.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/enum_wrapper.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/enum_wrapper.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/integer_builtins.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/integer_builtins.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/integer_type.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/integer_type.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/union.cpp.template (100%) rename {CodeGen => gen/version-b}/src/generate/data/union.h.template (100%) rename {CodeGen => gen/version-b}/src/generate/mod.rs (100%) rename {CodeGen => gen/version-b}/src/generate/paths.rs (100%) rename {CodeGen => gen/version-b}/src/generate/template.rs (100%) rename {CodeGen => gen/version-b}/src/lib.rs (100%) rename {CodeGen => gen/version-b}/src/model/builtin.rs (100%) rename {CodeGen => gen/version-b}/src/model/create.rs (100%) rename {CodeGen => gen/version-b}/src/model/creator.rs (100%) rename {CodeGen => gen/version-b}/src/model/default_create/enumeration.rs (100%) rename {CodeGen => gen/version-b}/src/model/default_create/mod.rs (100%) rename {CodeGen => gen/version-b}/src/model/default_create/scalar.rs (100%) rename {CodeGen => gen/version-b}/src/model/enumeration.rs (100%) rename {CodeGen => gen/version-b}/src/model/mod.rs (100%) rename {CodeGen => gen/version-b}/src/model/post_process.rs (100%) rename {CodeGen => gen/version-b}/src/model/scalar.rs (100%) rename {CodeGen => gen/version-b}/src/model/symbol.rs (100%) rename {CodeGen => gen/version-b}/src/model/transform.rs (100%) rename {CodeGen => gen/version-b}/src/utils/mod.rs (100%) rename {CodeGen => gen/version-b}/src/utils/string_stuff.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/annotation.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/attribute.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/attribute_group.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/attributes.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/choice.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/common.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/complex_content.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/complex_type.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/constants.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/element.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/extension.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/group.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/id.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/import.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/list.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/mod.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/primitives.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/restriction.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/sequence.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/simple_content.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/simple_type.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/union.rs (100%) rename {CodeGen => gen/version-b}/src/xsd/utils.rs (100%) rename {CodeGen => gen/version-b}/tests/xsd.rs (100%) diff --git a/.dockerignore b/.dockerignore index 3859f0d9b..23d0e2874 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,6 @@ # Allowlist: ignore everything, then re-include only what the quality gates # need (the source tree + build configuration). Tests are not run in Docker, -# so the MusicXML corpus, the Rust CodeGen tool, IDE/build dirs, .git, etc. +# so the MusicXML corpus, the Rust gen/version-b codegen tool, IDE/build dirs, .git, etc. # are all excluded. This keeps the build context tiny and stable even when # stray build dirs (CLion's cmake-build-debug, etc.) appear at the repo root. * diff --git a/AGENTS.md b/AGENTS.md index 511aed1b4..3ee01f786 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,8 +18,8 @@ Key paths in this repository: - `Sourcecode/private/mx/utility/` — Shared helpers (string, parsing, file system utilities) - `Sourcecode/private/mxtest/` — Test suite (api, core, file, import, impl, control) - `Sourcecode/private/cpul/` — Catch-based unit-test harness and test runner main -- `CodeGen/` — Rust tool that generates the core element classes from the MusicXML XSD -- `CodeGen/src/` — Generator source: XSD parsing, model, and C++ emission +- `gen/version-b/` — Rust tool that generates the core element classes from the MusicXML XSD +- `gen/version-b/src/` — Generator source: XSD parsing, model, and C++ emission - `Resources/` — MusicXML input files and expected-output suites for round-trip tests - `Documents/` — MusicXML XSD specifications and developer notes - `DevScripts/` — Ruby and shell scripts for one-off code maintenance diff --git a/CodeGen/.idea/.gitignore b/CodeGen/.idea/.gitignore deleted file mode 100644 index e54edd16d..000000000 --- a/CodeGen/.idea/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/shelf/ -/workspace.xml -/dataSources/ -/dataSources.local.xml -/httpRequests/ -vcs.xml diff --git a/CodeGen/.idea/CodeGen.iml b/CodeGen/.idea/CodeGen.iml deleted file mode 100644 index 1b9b74e8c..000000000 --- a/CodeGen/.idea/CodeGen.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CodeGen/.idea/codeStyles/codeStyleConfig.xml b/CodeGen/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index a55e7a179..000000000 --- a/CodeGen/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/CodeGen/.idea/inspectionProfiles/Project_Default.xml b/CodeGen/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 1a6adf94a..000000000 --- a/CodeGen/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/CodeGen/.idea/modules.xml b/CodeGen/.idea/modules.xml deleted file mode 100644 index 185e828dd..000000000 --- a/CodeGen/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/CodeGen/.idea/runConfigurations/run.xml b/CodeGen/.idea/runConfigurations/run.xml deleted file mode 100644 index 52f5cfcb8..000000000 --- a/CodeGen/.idea/runConfigurations/run.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - \ No newline at end of file diff --git a/CodeGen/.idea/runConfigurations/show.xml b/CodeGen/.idea/runConfigurations/show.xml deleted file mode 100644 index 84ec8c5ca..000000000 --- a/CodeGen/.idea/runConfigurations/show.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - \ No newline at end of file diff --git a/CodeGen/.gitignore b/gen/version-b/.gitignore similarity index 100% rename from CodeGen/.gitignore rename to gen/version-b/.gitignore diff --git a/CodeGen/Cargo.lock b/gen/version-b/Cargo.lock similarity index 100% rename from CodeGen/Cargo.lock rename to gen/version-b/Cargo.lock diff --git a/CodeGen/Cargo.toml b/gen/version-b/Cargo.toml similarity index 100% rename from CodeGen/Cargo.toml rename to gen/version-b/Cargo.toml diff --git a/CodeGen/rustfmt.toml b/gen/version-b/rustfmt.toml similarity index 100% rename from CodeGen/rustfmt.toml rename to gen/version-b/rustfmt.toml diff --git a/CodeGen/src/bin/flatten.rs b/gen/version-b/src/bin/flatten.rs similarity index 100% rename from CodeGen/src/bin/flatten.rs rename to gen/version-b/src/bin/flatten.rs diff --git a/CodeGen/src/bin/main.rs b/gen/version-b/src/bin/main.rs similarity index 100% rename from CodeGen/src/bin/main.rs rename to gen/version-b/src/bin/main.rs diff --git a/CodeGen/src/bin/show.rs b/gen/version-b/src/bin/show.rs similarity index 100% rename from CodeGen/src/bin/show.rs rename to gen/version-b/src/bin/show.rs diff --git a/CodeGen/src/error.rs b/gen/version-b/src/error.rs similarity index 100% rename from CodeGen/src/error.rs rename to gen/version-b/src/error.rs diff --git a/CodeGen/src/generate/compile_mx.rs b/gen/version-b/src/generate/compile_mx.rs similarity index 100% rename from CodeGen/src/generate/compile_mx.rs rename to gen/version-b/src/generate/compile_mx.rs diff --git a/CodeGen/src/generate/cpp/constants.rs b/gen/version-b/src/generate/cpp/constants.rs similarity index 100% rename from CodeGen/src/generate/cpp/constants.rs rename to gen/version-b/src/generate/cpp/constants.rs diff --git a/CodeGen/src/generate/cpp/cpp_template.rs b/gen/version-b/src/generate/cpp/cpp_template.rs similarity index 100% rename from CodeGen/src/generate/cpp/cpp_template.rs rename to gen/version-b/src/generate/cpp/cpp_template.rs diff --git a/CodeGen/src/generate/cpp/helpers.rs b/gen/version-b/src/generate/cpp/helpers.rs similarity index 100% rename from CodeGen/src/generate/cpp/helpers.rs rename to gen/version-b/src/generate/cpp/helpers.rs diff --git a/CodeGen/src/generate/cpp/mod.rs b/gen/version-b/src/generate/cpp/mod.rs similarity index 100% rename from CodeGen/src/generate/cpp/mod.rs rename to gen/version-b/src/generate/cpp/mod.rs diff --git a/CodeGen/src/generate/cpp/modeler.rs b/gen/version-b/src/generate/cpp/modeler.rs similarity index 100% rename from CodeGen/src/generate/cpp/modeler.rs rename to gen/version-b/src/generate/cpp/modeler.rs diff --git a/CodeGen/src/generate/cpp/write_custom.rs b/gen/version-b/src/generate/cpp/write_custom.rs similarity index 100% rename from CodeGen/src/generate/cpp/write_custom.rs rename to gen/version-b/src/generate/cpp/write_custom.rs diff --git a/CodeGen/src/generate/cpp/write_enums.rs b/gen/version-b/src/generate/cpp/write_enums.rs similarity index 100% rename from CodeGen/src/generate/cpp/write_enums.rs rename to gen/version-b/src/generate/cpp/write_enums.rs diff --git a/CodeGen/src/generate/cpp/write_numerics.rs b/gen/version-b/src/generate/cpp/write_numerics.rs similarity index 100% rename from CodeGen/src/generate/cpp/write_numerics.rs rename to gen/version-b/src/generate/cpp/write_numerics.rs diff --git a/CodeGen/src/generate/cpp/write_unions.rs b/gen/version-b/src/generate/cpp/write_unions.rs similarity index 100% rename from CodeGen/src/generate/cpp/write_unions.rs rename to gen/version-b/src/generate/cpp/write_unions.rs diff --git a/CodeGen/src/generate/cpp/writer.rs b/gen/version-b/src/generate/cpp/writer.rs similarity index 100% rename from CodeGen/src/generate/cpp/writer.rs rename to gen/version-b/src/generate/cpp/writer.rs diff --git a/CodeGen/src/generate/data/NumberOrNormal.cpp.template b/gen/version-b/src/generate/data/NumberOrNormal.cpp.template similarity index 100% rename from CodeGen/src/generate/data/NumberOrNormal.cpp.template rename to gen/version-b/src/generate/data/NumberOrNormal.cpp.template diff --git a/CodeGen/src/generate/data/NumberOrNormal.h.template b/gen/version-b/src/generate/data/NumberOrNormal.h.template similarity index 100% rename from CodeGen/src/generate/data/NumberOrNormal.h.template rename to gen/version-b/src/generate/data/NumberOrNormal.h.template diff --git a/CodeGen/src/generate/data/PositiveIntegerOrEmpty.cpp.template b/gen/version-b/src/generate/data/PositiveIntegerOrEmpty.cpp.template similarity index 100% rename from CodeGen/src/generate/data/PositiveIntegerOrEmpty.cpp.template rename to gen/version-b/src/generate/data/PositiveIntegerOrEmpty.cpp.template diff --git a/CodeGen/src/generate/data/PositiveIntegerOrEmpty.h.template b/gen/version-b/src/generate/data/PositiveIntegerOrEmpty.h.template similarity index 100% rename from CodeGen/src/generate/data/PositiveIntegerOrEmpty.h.template rename to gen/version-b/src/generate/data/PositiveIntegerOrEmpty.h.template diff --git a/CodeGen/src/generate/data/core.cpp.template b/gen/version-b/src/generate/data/core.cpp.template similarity index 100% rename from CodeGen/src/generate/data/core.cpp.template rename to gen/version-b/src/generate/data/core.cpp.template diff --git a/CodeGen/src/generate/data/core.h.template b/gen/version-b/src/generate/data/core.h.template similarity index 100% rename from CodeGen/src/generate/data/core.h.template rename to gen/version-b/src/generate/data/core.h.template diff --git a/CodeGen/src/generate/data/decimal_builtins.cpp.template b/gen/version-b/src/generate/data/decimal_builtins.cpp.template similarity index 100% rename from CodeGen/src/generate/data/decimal_builtins.cpp.template rename to gen/version-b/src/generate/data/decimal_builtins.cpp.template diff --git a/CodeGen/src/generate/data/decimal_builtins.h.template b/gen/version-b/src/generate/data/decimal_builtins.h.template similarity index 100% rename from CodeGen/src/generate/data/decimal_builtins.h.template rename to gen/version-b/src/generate/data/decimal_builtins.h.template diff --git a/CodeGen/src/generate/data/decimal_type.cpp.template b/gen/version-b/src/generate/data/decimal_type.cpp.template similarity index 100% rename from CodeGen/src/generate/data/decimal_type.cpp.template rename to gen/version-b/src/generate/data/decimal_type.cpp.template diff --git a/CodeGen/src/generate/data/decimal_type.h.template b/gen/version-b/src/generate/data/decimal_type.h.template similarity index 100% rename from CodeGen/src/generate/data/decimal_type.h.template rename to gen/version-b/src/generate/data/decimal_type.h.template diff --git a/CodeGen/src/generate/data/enum.cpp.template b/gen/version-b/src/generate/data/enum.cpp.template similarity index 100% rename from CodeGen/src/generate/data/enum.cpp.template rename to gen/version-b/src/generate/data/enum.cpp.template diff --git a/CodeGen/src/generate/data/enum.h.template b/gen/version-b/src/generate/data/enum.h.template similarity index 100% rename from CodeGen/src/generate/data/enum.h.template rename to gen/version-b/src/generate/data/enum.h.template diff --git a/CodeGen/src/generate/data/enum_wrapper.cpp.template b/gen/version-b/src/generate/data/enum_wrapper.cpp.template similarity index 100% rename from CodeGen/src/generate/data/enum_wrapper.cpp.template rename to gen/version-b/src/generate/data/enum_wrapper.cpp.template diff --git a/CodeGen/src/generate/data/enum_wrapper.h.template b/gen/version-b/src/generate/data/enum_wrapper.h.template similarity index 100% rename from CodeGen/src/generate/data/enum_wrapper.h.template rename to gen/version-b/src/generate/data/enum_wrapper.h.template diff --git a/CodeGen/src/generate/data/integer_builtins.cpp.template b/gen/version-b/src/generate/data/integer_builtins.cpp.template similarity index 100% rename from CodeGen/src/generate/data/integer_builtins.cpp.template rename to gen/version-b/src/generate/data/integer_builtins.cpp.template diff --git a/CodeGen/src/generate/data/integer_builtins.h.template b/gen/version-b/src/generate/data/integer_builtins.h.template similarity index 100% rename from CodeGen/src/generate/data/integer_builtins.h.template rename to gen/version-b/src/generate/data/integer_builtins.h.template diff --git a/CodeGen/src/generate/data/integer_type.cpp.template b/gen/version-b/src/generate/data/integer_type.cpp.template similarity index 100% rename from CodeGen/src/generate/data/integer_type.cpp.template rename to gen/version-b/src/generate/data/integer_type.cpp.template diff --git a/CodeGen/src/generate/data/integer_type.h.template b/gen/version-b/src/generate/data/integer_type.h.template similarity index 100% rename from CodeGen/src/generate/data/integer_type.h.template rename to gen/version-b/src/generate/data/integer_type.h.template diff --git a/CodeGen/src/generate/data/union.cpp.template b/gen/version-b/src/generate/data/union.cpp.template similarity index 100% rename from CodeGen/src/generate/data/union.cpp.template rename to gen/version-b/src/generate/data/union.cpp.template diff --git a/CodeGen/src/generate/data/union.h.template b/gen/version-b/src/generate/data/union.h.template similarity index 100% rename from CodeGen/src/generate/data/union.h.template rename to gen/version-b/src/generate/data/union.h.template diff --git a/CodeGen/src/generate/mod.rs b/gen/version-b/src/generate/mod.rs similarity index 100% rename from CodeGen/src/generate/mod.rs rename to gen/version-b/src/generate/mod.rs diff --git a/CodeGen/src/generate/paths.rs b/gen/version-b/src/generate/paths.rs similarity index 100% rename from CodeGen/src/generate/paths.rs rename to gen/version-b/src/generate/paths.rs diff --git a/CodeGen/src/generate/template.rs b/gen/version-b/src/generate/template.rs similarity index 100% rename from CodeGen/src/generate/template.rs rename to gen/version-b/src/generate/template.rs diff --git a/CodeGen/src/lib.rs b/gen/version-b/src/lib.rs similarity index 100% rename from CodeGen/src/lib.rs rename to gen/version-b/src/lib.rs diff --git a/CodeGen/src/model/builtin.rs b/gen/version-b/src/model/builtin.rs similarity index 100% rename from CodeGen/src/model/builtin.rs rename to gen/version-b/src/model/builtin.rs diff --git a/CodeGen/src/model/create.rs b/gen/version-b/src/model/create.rs similarity index 100% rename from CodeGen/src/model/create.rs rename to gen/version-b/src/model/create.rs diff --git a/CodeGen/src/model/creator.rs b/gen/version-b/src/model/creator.rs similarity index 100% rename from CodeGen/src/model/creator.rs rename to gen/version-b/src/model/creator.rs diff --git a/CodeGen/src/model/default_create/enumeration.rs b/gen/version-b/src/model/default_create/enumeration.rs similarity index 100% rename from CodeGen/src/model/default_create/enumeration.rs rename to gen/version-b/src/model/default_create/enumeration.rs diff --git a/CodeGen/src/model/default_create/mod.rs b/gen/version-b/src/model/default_create/mod.rs similarity index 100% rename from CodeGen/src/model/default_create/mod.rs rename to gen/version-b/src/model/default_create/mod.rs diff --git a/CodeGen/src/model/default_create/scalar.rs b/gen/version-b/src/model/default_create/scalar.rs similarity index 100% rename from CodeGen/src/model/default_create/scalar.rs rename to gen/version-b/src/model/default_create/scalar.rs diff --git a/CodeGen/src/model/enumeration.rs b/gen/version-b/src/model/enumeration.rs similarity index 100% rename from CodeGen/src/model/enumeration.rs rename to gen/version-b/src/model/enumeration.rs diff --git a/CodeGen/src/model/mod.rs b/gen/version-b/src/model/mod.rs similarity index 100% rename from CodeGen/src/model/mod.rs rename to gen/version-b/src/model/mod.rs diff --git a/CodeGen/src/model/post_process.rs b/gen/version-b/src/model/post_process.rs similarity index 100% rename from CodeGen/src/model/post_process.rs rename to gen/version-b/src/model/post_process.rs diff --git a/CodeGen/src/model/scalar.rs b/gen/version-b/src/model/scalar.rs similarity index 100% rename from CodeGen/src/model/scalar.rs rename to gen/version-b/src/model/scalar.rs diff --git a/CodeGen/src/model/symbol.rs b/gen/version-b/src/model/symbol.rs similarity index 100% rename from CodeGen/src/model/symbol.rs rename to gen/version-b/src/model/symbol.rs diff --git a/CodeGen/src/model/transform.rs b/gen/version-b/src/model/transform.rs similarity index 100% rename from CodeGen/src/model/transform.rs rename to gen/version-b/src/model/transform.rs diff --git a/CodeGen/src/utils/mod.rs b/gen/version-b/src/utils/mod.rs similarity index 100% rename from CodeGen/src/utils/mod.rs rename to gen/version-b/src/utils/mod.rs diff --git a/CodeGen/src/utils/string_stuff.rs b/gen/version-b/src/utils/string_stuff.rs similarity index 100% rename from CodeGen/src/utils/string_stuff.rs rename to gen/version-b/src/utils/string_stuff.rs diff --git a/CodeGen/src/xsd/annotation.rs b/gen/version-b/src/xsd/annotation.rs similarity index 100% rename from CodeGen/src/xsd/annotation.rs rename to gen/version-b/src/xsd/annotation.rs diff --git a/CodeGen/src/xsd/attribute.rs b/gen/version-b/src/xsd/attribute.rs similarity index 100% rename from CodeGen/src/xsd/attribute.rs rename to gen/version-b/src/xsd/attribute.rs diff --git a/CodeGen/src/xsd/attribute_group.rs b/gen/version-b/src/xsd/attribute_group.rs similarity index 100% rename from CodeGen/src/xsd/attribute_group.rs rename to gen/version-b/src/xsd/attribute_group.rs diff --git a/CodeGen/src/xsd/attributes.rs b/gen/version-b/src/xsd/attributes.rs similarity index 100% rename from CodeGen/src/xsd/attributes.rs rename to gen/version-b/src/xsd/attributes.rs diff --git a/CodeGen/src/xsd/choice.rs b/gen/version-b/src/xsd/choice.rs similarity index 100% rename from CodeGen/src/xsd/choice.rs rename to gen/version-b/src/xsd/choice.rs diff --git a/CodeGen/src/xsd/common.rs b/gen/version-b/src/xsd/common.rs similarity index 100% rename from CodeGen/src/xsd/common.rs rename to gen/version-b/src/xsd/common.rs diff --git a/CodeGen/src/xsd/complex_content.rs b/gen/version-b/src/xsd/complex_content.rs similarity index 100% rename from CodeGen/src/xsd/complex_content.rs rename to gen/version-b/src/xsd/complex_content.rs diff --git a/CodeGen/src/xsd/complex_type.rs b/gen/version-b/src/xsd/complex_type.rs similarity index 100% rename from CodeGen/src/xsd/complex_type.rs rename to gen/version-b/src/xsd/complex_type.rs diff --git a/CodeGen/src/xsd/constants.rs b/gen/version-b/src/xsd/constants.rs similarity index 100% rename from CodeGen/src/xsd/constants.rs rename to gen/version-b/src/xsd/constants.rs diff --git a/CodeGen/src/xsd/element.rs b/gen/version-b/src/xsd/element.rs similarity index 100% rename from CodeGen/src/xsd/element.rs rename to gen/version-b/src/xsd/element.rs diff --git a/CodeGen/src/xsd/extension.rs b/gen/version-b/src/xsd/extension.rs similarity index 100% rename from CodeGen/src/xsd/extension.rs rename to gen/version-b/src/xsd/extension.rs diff --git a/CodeGen/src/xsd/group.rs b/gen/version-b/src/xsd/group.rs similarity index 100% rename from CodeGen/src/xsd/group.rs rename to gen/version-b/src/xsd/group.rs diff --git a/CodeGen/src/xsd/id.rs b/gen/version-b/src/xsd/id.rs similarity index 100% rename from CodeGen/src/xsd/id.rs rename to gen/version-b/src/xsd/id.rs diff --git a/CodeGen/src/xsd/import.rs b/gen/version-b/src/xsd/import.rs similarity index 100% rename from CodeGen/src/xsd/import.rs rename to gen/version-b/src/xsd/import.rs diff --git a/CodeGen/src/xsd/list.rs b/gen/version-b/src/xsd/list.rs similarity index 100% rename from CodeGen/src/xsd/list.rs rename to gen/version-b/src/xsd/list.rs diff --git a/CodeGen/src/xsd/mod.rs b/gen/version-b/src/xsd/mod.rs similarity index 100% rename from CodeGen/src/xsd/mod.rs rename to gen/version-b/src/xsd/mod.rs diff --git a/CodeGen/src/xsd/primitives.rs b/gen/version-b/src/xsd/primitives.rs similarity index 100% rename from CodeGen/src/xsd/primitives.rs rename to gen/version-b/src/xsd/primitives.rs diff --git a/CodeGen/src/xsd/restriction.rs b/gen/version-b/src/xsd/restriction.rs similarity index 100% rename from CodeGen/src/xsd/restriction.rs rename to gen/version-b/src/xsd/restriction.rs diff --git a/CodeGen/src/xsd/sequence.rs b/gen/version-b/src/xsd/sequence.rs similarity index 100% rename from CodeGen/src/xsd/sequence.rs rename to gen/version-b/src/xsd/sequence.rs diff --git a/CodeGen/src/xsd/simple_content.rs b/gen/version-b/src/xsd/simple_content.rs similarity index 100% rename from CodeGen/src/xsd/simple_content.rs rename to gen/version-b/src/xsd/simple_content.rs diff --git a/CodeGen/src/xsd/simple_type.rs b/gen/version-b/src/xsd/simple_type.rs similarity index 100% rename from CodeGen/src/xsd/simple_type.rs rename to gen/version-b/src/xsd/simple_type.rs diff --git a/CodeGen/src/xsd/union.rs b/gen/version-b/src/xsd/union.rs similarity index 100% rename from CodeGen/src/xsd/union.rs rename to gen/version-b/src/xsd/union.rs diff --git a/CodeGen/src/xsd/utils.rs b/gen/version-b/src/xsd/utils.rs similarity index 100% rename from CodeGen/src/xsd/utils.rs rename to gen/version-b/src/xsd/utils.rs diff --git a/CodeGen/tests/xsd.rs b/gen/version-b/tests/xsd.rs similarity index 100% rename from CodeGen/tests/xsd.rs rename to gen/version-b/tests/xsd.rs From c1b999d308132101b45204dfa96cd69340318285 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:45:56 +0200 Subject: [PATCH 26/34] rename Documents -> docs Update all references in AGENTS.md, Dockerfile, Makefile, CHANGELOG.md, and DevScripts/parseXsd.rb. --- AGENTS.md | 6 +++--- CHANGELOG.md | 2 +- DevScripts/parseXsd.rb | 2 +- Dockerfile | 2 +- Makefile | 2 +- .../DevNotes/Attribute Group Reference.xml | 0 {Documents => docs}/DevNotes/CocoaNotes.txt | 0 {Documents => docs}/DevNotes/Elements.h.order.csv | 0 {Documents => docs}/DevNotes/FourLayers.musx | Bin {Documents => docs}/DevNotes/FourLayers.png | Bin {Documents => docs}/DevNotes/FourLayers.xml | 0 .../DevNotes/FourLayersWithBackup.png | Bin .../DevNotes/FourLayersWithBackup.xml | 0 {Documents => docs}/DevNotes/GmMapToMusicXML.xml | 0 {Documents => docs}/DevNotes/IllogicalVoiceTags.png | Bin {Documents => docs}/DevNotes/IllogicalVoiceTags.xml | 0 .../DevNotes/MusicXML Standard Sounds.xml | 0 {Documents => docs}/DevNotes/MusicXMLSounds.xml | 0 {Documents => docs}/DevNotes/PerformanceNotes.txt | 0 {Documents => docs}/DevNotes/StaffExperiment.xml | 0 {Documents => docs}/DevNotes/TupletsTest.musx | Bin {Documents => docs}/DevNotes/TupletsTest.xml | 0 {Documents => docs}/DevNotes/VoiceExperiment.xml | 0 {Documents => docs}/Licenses/MusicXML_License.html | 0 {Documents => docs}/Licenses/SMuFL_License.txt | 0 .../Licenses/pugixml_Arseny_Kapoulkine_License.txt | 0 {Documents => docs}/OldCode/Enums.old.cpp | 0 {Documents => docs}/OldCode/Enums.old.h | 0 {Documents => docs}/ai/project/AGENTS.md | 0 {Documents => docs}/ai/project/agenda.md | 0 .../ai/project/build-and-ci-design.md | 0 {Documents => docs}/musicxml-3.1.xsd | 0 {Documents => docs}/musicxml.xsd | 0 33 files changed, 7 insertions(+), 7 deletions(-) rename {Documents => docs}/DevNotes/Attribute Group Reference.xml (100%) rename {Documents => docs}/DevNotes/CocoaNotes.txt (100%) rename {Documents => docs}/DevNotes/Elements.h.order.csv (100%) rename {Documents => docs}/DevNotes/FourLayers.musx (100%) rename {Documents => docs}/DevNotes/FourLayers.png (100%) rename {Documents => docs}/DevNotes/FourLayers.xml (100%) rename {Documents => docs}/DevNotes/FourLayersWithBackup.png (100%) rename {Documents => docs}/DevNotes/FourLayersWithBackup.xml (100%) rename {Documents => docs}/DevNotes/GmMapToMusicXML.xml (100%) rename {Documents => docs}/DevNotes/IllogicalVoiceTags.png (100%) rename {Documents => docs}/DevNotes/IllogicalVoiceTags.xml (100%) rename {Documents => docs}/DevNotes/MusicXML Standard Sounds.xml (100%) rename {Documents => docs}/DevNotes/MusicXMLSounds.xml (100%) rename {Documents => docs}/DevNotes/PerformanceNotes.txt (100%) rename {Documents => docs}/DevNotes/StaffExperiment.xml (100%) rename {Documents => docs}/DevNotes/TupletsTest.musx (100%) rename {Documents => docs}/DevNotes/TupletsTest.xml (100%) rename {Documents => docs}/DevNotes/VoiceExperiment.xml (100%) rename {Documents => docs}/Licenses/MusicXML_License.html (100%) rename {Documents => docs}/Licenses/SMuFL_License.txt (100%) rename {Documents => docs}/Licenses/pugixml_Arseny_Kapoulkine_License.txt (100%) rename {Documents => docs}/OldCode/Enums.old.cpp (100%) rename {Documents => docs}/OldCode/Enums.old.h (100%) rename {Documents => docs}/ai/project/AGENTS.md (100%) rename {Documents => docs}/ai/project/agenda.md (100%) rename {Documents => docs}/ai/project/build-and-ci-design.md (100%) rename {Documents => docs}/musicxml-3.1.xsd (100%) rename {Documents => docs}/musicxml.xsd (100%) diff --git a/AGENTS.md b/AGENTS.md index 3ee01f786..a00751709 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,7 @@ Key paths in this repository: - `gen/version-b/` — Rust tool that generates the core element classes from the MusicXML XSD - `gen/version-b/src/` — Generator source: XSD parsing, model, and C++ emission - `Resources/` — MusicXML input files and expected-output suites for round-trip tests -- `Documents/` — MusicXML XSD specifications and developer notes +- `docs/` — MusicXML XSD specifications and developer notes - `DevScripts/` — Ruby and shell scripts for one-off code maintenance - `CMakeLists.txt` — CMake build configuration - `Makefile` — Primary build-and-test entry point (wraps CMake; `make help` lists targets) @@ -63,10 +63,10 @@ design doc.) On `make check` failure, run `make fmt` to fix formatting, then address any remaining warnings manually. -See `Documents/ai/project/build-and-ci-design.md` for full details on the CI pipeline and quality +See `docs/ai/project/build-and-ci-design.md` for full details on the CI pipeline and quality gate design. ## The Project We are working on reverse engineering a new codegen system to regenerate mx/core for MusicXML 4.0. -See the project directory @./Documents/ai/project/AGENTS.md +See the project directory @./docs/ai/project/AGENTS.md diff --git a/CHANGELOG.md b/CHANGELOG.md index ee78313f6..44ccc2db6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,7 @@ tags. ### Repository, Build, and CI - Set up the repository for AI-assisted development: agent guides (`AGENTS.md`, - `Documents/ai/project/`) and a build/CI design document. [#145] + `docs/ai/project/`) and a build/CI design document. [#145] - Replace `build.sh` with a portable `Makefile` wrapping CMake (build modes, run targets, knobs); `make test` and `make test-all` also run the example programs. [#145] - Add a `.clang-format` (Microsoft base) and reformat the entire `Sourcecode/` tree; `make fmt` diff --git a/DevScripts/parseXsd.rb b/DevScripts/parseXsd.rb index fdd310759..9f54dce84 100644 --- a/DevScripts/parseXsd.rb +++ b/DevScripts/parseXsd.rb @@ -1,6 +1,6 @@ require 'rexml/document' require 'rexml/xpath' -doc = REXML::Document.new(File.new('../Documents/musicxml.xsd')) +doc = REXML::Document.new(File.new('../docs/musicxml.xsd')) stuff = doc.elements.to_a diff --git a/Dockerfile b/Dockerfile index 960cf28bb..e72804e04 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ # `docker buildx build --target ...`; inside the container (where # MX_RUNNING_IN_DOCKER=1) the same `make check` runs the tools directly. # -# See Documents/ai/project/build-and-ci-design.md. +# See docs/ai/project/build-and-ci-design.md. FROM ubuntu:24.04 AS base diff --git a/Makefile b/Makefile index a083d1db3..818fb7966 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ # warnings are deterministic on any machine regardless of the floating CI # runner image. The build/test targets (`make test`, `make test-all`, ...) # run natively with the local compiler. -# See Documents/ai/project/build-and-ci-design.md. +# See docs/ai/project/build-and-ci-design.md. # # ---------------------------------------------------------------------------- # Build modes diff --git a/Documents/DevNotes/Attribute Group Reference.xml b/docs/DevNotes/Attribute Group Reference.xml similarity index 100% rename from Documents/DevNotes/Attribute Group Reference.xml rename to docs/DevNotes/Attribute Group Reference.xml diff --git a/Documents/DevNotes/CocoaNotes.txt b/docs/DevNotes/CocoaNotes.txt similarity index 100% rename from Documents/DevNotes/CocoaNotes.txt rename to docs/DevNotes/CocoaNotes.txt diff --git a/Documents/DevNotes/Elements.h.order.csv b/docs/DevNotes/Elements.h.order.csv similarity index 100% rename from Documents/DevNotes/Elements.h.order.csv rename to docs/DevNotes/Elements.h.order.csv diff --git a/Documents/DevNotes/FourLayers.musx b/docs/DevNotes/FourLayers.musx similarity index 100% rename from Documents/DevNotes/FourLayers.musx rename to docs/DevNotes/FourLayers.musx diff --git a/Documents/DevNotes/FourLayers.png b/docs/DevNotes/FourLayers.png similarity index 100% rename from Documents/DevNotes/FourLayers.png rename to docs/DevNotes/FourLayers.png diff --git a/Documents/DevNotes/FourLayers.xml b/docs/DevNotes/FourLayers.xml similarity index 100% rename from Documents/DevNotes/FourLayers.xml rename to docs/DevNotes/FourLayers.xml diff --git a/Documents/DevNotes/FourLayersWithBackup.png b/docs/DevNotes/FourLayersWithBackup.png similarity index 100% rename from Documents/DevNotes/FourLayersWithBackup.png rename to docs/DevNotes/FourLayersWithBackup.png diff --git a/Documents/DevNotes/FourLayersWithBackup.xml b/docs/DevNotes/FourLayersWithBackup.xml similarity index 100% rename from Documents/DevNotes/FourLayersWithBackup.xml rename to docs/DevNotes/FourLayersWithBackup.xml diff --git a/Documents/DevNotes/GmMapToMusicXML.xml b/docs/DevNotes/GmMapToMusicXML.xml similarity index 100% rename from Documents/DevNotes/GmMapToMusicXML.xml rename to docs/DevNotes/GmMapToMusicXML.xml diff --git a/Documents/DevNotes/IllogicalVoiceTags.png b/docs/DevNotes/IllogicalVoiceTags.png similarity index 100% rename from Documents/DevNotes/IllogicalVoiceTags.png rename to docs/DevNotes/IllogicalVoiceTags.png diff --git a/Documents/DevNotes/IllogicalVoiceTags.xml b/docs/DevNotes/IllogicalVoiceTags.xml similarity index 100% rename from Documents/DevNotes/IllogicalVoiceTags.xml rename to docs/DevNotes/IllogicalVoiceTags.xml diff --git a/Documents/DevNotes/MusicXML Standard Sounds.xml b/docs/DevNotes/MusicXML Standard Sounds.xml similarity index 100% rename from Documents/DevNotes/MusicXML Standard Sounds.xml rename to docs/DevNotes/MusicXML Standard Sounds.xml diff --git a/Documents/DevNotes/MusicXMLSounds.xml b/docs/DevNotes/MusicXMLSounds.xml similarity index 100% rename from Documents/DevNotes/MusicXMLSounds.xml rename to docs/DevNotes/MusicXMLSounds.xml diff --git a/Documents/DevNotes/PerformanceNotes.txt b/docs/DevNotes/PerformanceNotes.txt similarity index 100% rename from Documents/DevNotes/PerformanceNotes.txt rename to docs/DevNotes/PerformanceNotes.txt diff --git a/Documents/DevNotes/StaffExperiment.xml b/docs/DevNotes/StaffExperiment.xml similarity index 100% rename from Documents/DevNotes/StaffExperiment.xml rename to docs/DevNotes/StaffExperiment.xml diff --git a/Documents/DevNotes/TupletsTest.musx b/docs/DevNotes/TupletsTest.musx similarity index 100% rename from Documents/DevNotes/TupletsTest.musx rename to docs/DevNotes/TupletsTest.musx diff --git a/Documents/DevNotes/TupletsTest.xml b/docs/DevNotes/TupletsTest.xml similarity index 100% rename from Documents/DevNotes/TupletsTest.xml rename to docs/DevNotes/TupletsTest.xml diff --git a/Documents/DevNotes/VoiceExperiment.xml b/docs/DevNotes/VoiceExperiment.xml similarity index 100% rename from Documents/DevNotes/VoiceExperiment.xml rename to docs/DevNotes/VoiceExperiment.xml diff --git a/Documents/Licenses/MusicXML_License.html b/docs/Licenses/MusicXML_License.html similarity index 100% rename from Documents/Licenses/MusicXML_License.html rename to docs/Licenses/MusicXML_License.html diff --git a/Documents/Licenses/SMuFL_License.txt b/docs/Licenses/SMuFL_License.txt similarity index 100% rename from Documents/Licenses/SMuFL_License.txt rename to docs/Licenses/SMuFL_License.txt diff --git a/Documents/Licenses/pugixml_Arseny_Kapoulkine_License.txt b/docs/Licenses/pugixml_Arseny_Kapoulkine_License.txt similarity index 100% rename from Documents/Licenses/pugixml_Arseny_Kapoulkine_License.txt rename to docs/Licenses/pugixml_Arseny_Kapoulkine_License.txt diff --git a/Documents/OldCode/Enums.old.cpp b/docs/OldCode/Enums.old.cpp similarity index 100% rename from Documents/OldCode/Enums.old.cpp rename to docs/OldCode/Enums.old.cpp diff --git a/Documents/OldCode/Enums.old.h b/docs/OldCode/Enums.old.h similarity index 100% rename from Documents/OldCode/Enums.old.h rename to docs/OldCode/Enums.old.h diff --git a/Documents/ai/project/AGENTS.md b/docs/ai/project/AGENTS.md similarity index 100% rename from Documents/ai/project/AGENTS.md rename to docs/ai/project/AGENTS.md diff --git a/Documents/ai/project/agenda.md b/docs/ai/project/agenda.md similarity index 100% rename from Documents/ai/project/agenda.md rename to docs/ai/project/agenda.md diff --git a/Documents/ai/project/build-and-ci-design.md b/docs/ai/project/build-and-ci-design.md similarity index 100% rename from Documents/ai/project/build-and-ci-design.md rename to docs/ai/project/build-and-ci-design.md diff --git a/Documents/musicxml-3.1.xsd b/docs/musicxml-3.1.xsd similarity index 100% rename from Documents/musicxml-3.1.xsd rename to docs/musicxml-3.1.xsd diff --git a/Documents/musicxml.xsd b/docs/musicxml.xsd similarity index 100% rename from Documents/musicxml.xsd rename to docs/musicxml.xsd From 2fc4fcc3c14229031f3feb5f51a82d2ec9be106e Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:46:31 +0200 Subject: [PATCH 27/34] rename Resources -> data Update all references in AGENTS.md, CHANGELOG.md, and DevScripts/smuflHeader.rb. Fix smuflHeader.rb path from stale S-M-U-F-L to actual smufl subdirectory name. --- AGENTS.md | 2 +- CHANGELOG.md | 8 ++++---- DevScripts/smuflHeader.rb | 2 +- .../custom/musescore-slur-start-stop.musicxml | 0 .../custom/systems-and-pages-original.musx | Bin {Resources => data}/custom/systems-and-pages.xml | 0 {Resources => data}/custom/transposition.musicxml | 0 {Resources => data}/expected/.gitignore | 0 {Resources => data}/foundsuite/12 Horn Duets.xml | 0 {Resources => data}/foundsuite/12 Horn Duets.zip | Bin {Resources => data}/foundsuite/15Inventions.zip | Bin .../foundsuite/ARBEAU Belle qui tiens ma vie.xml | 0 .../Adagio and Fugue in C minor, K.546.xml | 0 .../Adagio and Fugue in C minor, K.546.zip | Bin {Resources => data}/foundsuite/An Chloe.xml | 0 .../foundsuite/Berlioz_Le_Corsaire.xml | Bin .../foundsuite/Berlioz_Le_Corsaire_Finale.pdf | Bin .../foundsuite/Black Note Study Op 10 no 5.xml | Bin .../foundsuite/Deutscher Tanz D.820.1.xml | 0 .../foundsuite/Deutscher Tanz D.820.1.zip | Bin .../foundsuite/IMSLP198109-WIMA.4fb5-PezR44-xml.zip | Bin .../foundsuite/IMSLP273708-PMLP444363-PepAir.zip | Bin .../foundsuite/IMSLP381263-PMLP615890-RonCLun.zip | Bin {Resources => data}/foundsuite/Invention 1.xml | 0 {Resources => data}/foundsuite/Invention 2.xml | 0 {Resources => data}/foundsuite/Invention 3.xml | 0 {Resources => data}/foundsuite/Invention_10.xml | 0 {Resources => data}/foundsuite/Invention_11.xml | 0 {Resources => data}/foundsuite/Invention_12.xml | 0 {Resources => data}/foundsuite/Invention_13.xml | 0 {Resources => data}/foundsuite/Invention_14.xml | 0 {Resources => data}/foundsuite/Invention_15.xml | 0 {Resources => data}/foundsuite/Invention_4.xml | 0 {Resources => data}/foundsuite/Invention_5.xml | 0 {Resources => data}/foundsuite/Invention_6.xml | 0 {Resources => data}/foundsuite/Invention_7.xml | 0 {Resources => data}/foundsuite/Invention_8.xml | 0 {Resources => data}/foundsuite/Invention_9.xml | 0 .../foundsuite/Moments Musicaux Op16 No4.xml | 0 .../foundsuite/O_Holy_Night-Adam-1871.xml | 0 .../foundsuite/O_Holy_Night-Adam-1974.xml | 0 {Resources => data}/foundsuite/O_Holy_Night.xml | 0 {Resources => data}/foundsuite/PepAiraSco.xml | 0 {Resources => data}/foundsuite/PezR44Sco.xml | 0 .../foundsuite/Rimsky-Korsakov Op11 No4.xml | 0 {Resources => data}/foundsuite/RonCLunSco.xml | 0 .../foundsuite/SCHUBERT An die Sonne.xml | 0 .../foundsuite/Schubert_der_Mueller.xml | 0 .../foundsuite/Schubert_der_Mueller_Finale.pdf | Bin .../foundsuite/Schubert_der_Mueller_License.txt | 0 .../foundsuite/Schubert_der_Mueller_MuseScore.pdf | Bin .../foundsuite/Schubert_der_Mueller_Notion.pdf | Bin .../foundsuite/Schubert_der_Mueller_Sibelius.pdf | Bin .../foundsuite/Silent_Night-Hartwig.xml | 0 .../foundsuite/Silent_Night_Young_1.xml | 0 ...204\316\254\316\273\316\271\316\272\316\277.xml" | 0 ...204\316\254\316\273\316\271\316\272\316\277.zip" | Bin {Resources => data}/generalxml/fake.xml | 0 {Resources => data}/ksuite/Bombe.musx | Bin {Resources => data}/ksuite/Bombe.xml | 0 {Resources => data}/ksuite/Bombe_Finale.pdf | Bin .../ksuite/k001a_Articulations _Sibelius.pdf | Bin {Resources => data}/ksuite/k001a_Articulations.xml | 0 .../ksuite/k001a_Articulations_Finale.pdf | Bin .../ksuite/k001a_Articulations_MuseScore.pdf | Bin .../ksuite/k001b_Articulations_Above.xml | 0 .../ksuite/k001b_Articulations_Above_Finale.pdf | Bin .../ksuite/k001b_Articulations_Above_MuseScore.pdf | Bin .../ksuite/k001b_Articulations_Above_Sibelius.pdf | Bin .../ksuite/k001c_Articulations_Below.xml | 0 .../ksuite/k001c_Articulations_Below_Finale.pdf | Bin .../ksuite/k001c_Articulations_Below_MuseScore.pdf | Bin .../ksuite/k001c_Articulations_Below_Sibelius.pdf | Bin {Resources => data}/ksuite/k002a_Fermatas.xml | 0 .../ksuite/k002a_Fermatas_Finale.pdf | Bin .../ksuite/k002a_Fermatas_MuseScore.pdf | Bin .../ksuite/k002a_Fermatas_Sibelius.pdf | Bin {Resources => data}/ksuite/k003a_Ornaments.xml | 0 .../ksuite/k003a_Ornaments_Finale.pdf | Bin .../ksuite/k003a_Ornaments_MuseScore.pdf | Bin .../ksuite/k003a_Ornaments_Sibelius.pdf | Bin {Resources => data}/ksuite/k004a_Technical.xml | 0 .../ksuite/k004a_Technical_Finale.pdf | Bin .../ksuite/k004a_Technical_MuseScore.pdf | Bin .../ksuite/k004a_Technical_Sibelius.pdf | Bin .../ksuite/k005a_Spanners_Slides.xml | 0 .../ksuite/k005a_Spanners_Slides_Finale.pdf | Bin .../ksuite/k005a_Spanners_Slides_MuseScore.pdf | Bin .../ksuite/k005a_Spanners_Slides_Sibelius.pdf | Bin .../k006a_Clefs_sign_G_ln_2_oct_0_Treble.musx | Bin .../ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.xml | 0 .../k006a_Clefs_sign_G_ln_2_oct_0_Treble_Finale.pdf | Bin ...06a_Clefs_sign_G_ln_2_oct_0_Treble_MuseScore.pdf | Bin ...006a_Clefs_sign_G_ln_2_oct_0_Treble_Sibelius.pdf | Bin .../ksuite/k006a_Header_Scaling_Decimals.xml | 0 .../ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.musx | Bin .../ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.xml | 0 .../k006b_Clefs_sign_F_ln_4_oct_0_Bass_Finale.pdf | Bin .../k006b_Clefs_sign_F_ln_4_oct_0_Bass_Sibelius.pdf | Bin .../ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.musx | Bin .../ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.xml | 0 .../k006c_Clefs_sign_C_ln_3_oct_0_Viola_Finale.pdf | Bin ...k006c_Clefs_sign_C_ln_3_oct_0_Viola_Sibelius.pdf | Bin .../ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.musx | Bin .../ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.xml | 0 .../k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Finale.pdf | Bin ...k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Sibelius.pdf | Bin .../k006e_Clefs_sign_C_ln_5_oct_0_Baritone.musx | Bin .../k006e_Clefs_sign_C_ln_5_oct_0_Baritone.xml | 0 ...006e_Clefs_sign_C_ln_5_oct_0_Baritone_Finale.pdf | Bin ...6e_Clefs_sign_C_ln_5_oct_0_Baritone_Sibelius.pdf | Bin .../k006f_Clefs_sign_C_ln_1_oct_0_Soprano.musx | Bin .../k006f_Clefs_sign_C_ln_1_oct_0_Soprano.xml | 0 ...k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Finale.pdf | Bin ...06f_Clefs_sign_C_ln_1_oct_0_Soprano_Sibelius.pdf | Bin ...k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.musx | Bin .../k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.xml | 0 ...Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Finale.pdf | Bin ...efs_sign_C_ln_2_oct_0_Mezzo_Soprano_Sibelius.pdf | Bin .../k006h_Clefs_sign_G_ln_1_oct_0_French.musx | Bin .../ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.xml | 0 .../k006h_Clefs_sign_G_ln_1_oct_0_French_Finale.pdf | Bin ...006h_Clefs_sign_G_ln_1_oct_0_French_Sibelius.pdf | Bin .../k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.musx | Bin .../k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.xml | 0 ...i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Finale.pdf | Bin ...Clefs_sign_F_ln_3_oct_0_Varbaritone_Sibelius.pdf | Bin .../k006j_Clefs_sign_F_ln_5_oct_0_Subbass.musx | Bin .../k006j_Clefs_sign_F_ln_5_oct_0_Subbass.xml | 0 ...k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Finale.pdf | Bin ...06j_Clefs_sign_F_ln_5_oct_0_Subbass_Sibelius.pdf | Bin .../k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.musx | Bin .../k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.xml | 0 ...06k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Finale.pdf | Bin ...k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Sibelius.pdf | Bin .../k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.musx | Bin .../k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.xml | 0 ...006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Finale.pdf | Bin ...6l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Sibelius.pdf | Bin .../ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.musx | Bin .../ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.xml | 0 .../k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Finale.pdf | Bin ...k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Sibelius.pdf | Bin .../k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.musx | Bin .../ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.xml | 0 .../k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Finale.pdf | Bin ...006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Sibelius.pdf | Bin .../k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.musx | Bin .../k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.xml | 0 ...06o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Finale.pdf | Bin ...o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Sibelius.pdf | Bin .../k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.musx | Bin .../k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.xml | 0 ...006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Finale.pdf | Bin ...6p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Sibelius.pdf | Bin .../ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.musx | Bin .../ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.xml | 0 .../k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Finale.pdf | Bin ...k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Sibelius.pdf | Bin .../k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.musx | Bin .../ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.xml | 0 .../k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Finale.pdf | Bin ...006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Sibelius.pdf | Bin ...Clefs_sign_percussion_ln_3_oct_0_Percussion.musx | Bin ..._Clefs_sign_percussion_ln_3_oct_0_Percussion.xml | 0 ...sign_percussion_ln_3_oct_0_Percussion_Finale.pdf | Bin ...gn_percussion_ln_3_oct_0_Percussion_Sibelius.pdf | Bin .../ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.musx | Bin .../ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.xml | 0 .../k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Finale.pdf | Bin ...k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Sibelius.pdf | Bin .../k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.musx | Bin .../k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.xml | 0 ...u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Finale.pdf | Bin ...Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Sibelius.pdf | Bin .../k006v_Clefs_sign_none_ln_3_oct_0_None.musx | Bin .../k006v_Clefs_sign_none_ln_3_oct_0_None.xml | 0 ...k006v_Clefs_sign_none_ln_3_oct_0_None_Finale.pdf | Bin ...06v_Clefs_sign_none_ln_3_oct_0_None_Sibelius.pdf | Bin .../ksuite/k007a_Notations_Dynamics.musx | Bin .../ksuite/k007a_Notations_Dynamics.xml | 0 .../k007a_Notations_Dynamics_Finale - Score.pdf | Bin .../ksuite/k007a_Notations_Dynamics_MuseScore.pdf | Bin .../ksuite/k007a_Notations_Dynamics_Sibelius.pdf | Bin .../ksuite/k007b_Notations_Dynamics_Attributes.pdf | Bin .../ksuite/k007b_Notations_Dynamics_Attributes.xml | 0 .../ksuite/k007c_Directions_Dynamics.xml | 0 .../ksuite/k007d_Directions_Dynamics_Attributes.xml | 0 {Resources => data}/ksuite/k008a_Beaming.musx | Bin {Resources => data}/ksuite/k008a_Beaming.xml | 0 .../ksuite/k008a_Beaming_FinaleOriginal.pdf | Bin .../ksuite/k008a_Beaming_FinaleRoundTrip.pdf | Bin .../ksuite/k008a_Beaming_Sibelius.pdf | Bin {Resources => data}/ksuite/k009a_Slurs.musx | Bin {Resources => data}/ksuite/k009a_Slurs.xml | 0 .../ksuite/k009a_Slurs_FinaleOriginal.pdf | Bin .../ksuite/k009a_Slurs_FinaleRoundtrip.pdf | Bin {Resources => data}/ksuite/k009a_Slurs_Sibelius.pdf | Bin .../ksuite/k009b_Slur_Attributes.xml | 0 {Resources => data}/ksuite/k010a_Ties.musx | Bin {Resources => data}/ksuite/k010a_Ties.xml | 0 .../ksuite/k010a_Ties_FinaleOriginal.pdf | Bin .../ksuite/k010a_Ties_FinaleRoundtrip.pdf | Bin {Resources => data}/ksuite/k010a_Ties_Sibelius.pdf | Bin {Resources => data}/ksuite/k010b_Bad_Ties.pdf | Bin {Resources => data}/ksuite/k010b_Bad_Ties.xml | 0 .../ksuite/k010b_Bad_Ties_Sibelius.pdf | Bin {Resources => data}/ksuite/k011a_Tuplets.musx | Bin {Resources => data}/ksuite/k011a_Tuplets.pdf | Bin {Resources => data}/ksuite/k011a_Tuplets.xml | 0 .../ksuite/k011a_Tuplets_Sibelius.pdf | Bin .../ksuite/k012a_Tempo_Markings.musx | Bin {Resources => data}/ksuite/k012a_Tempo_Markings.xml | 0 .../ksuite/k012a_Tempo_Markings_FinaleOriginal .pdf | Bin .../ksuite/k012a_Tempo_Markings_FinaleRoundTrip.pdf | Bin .../ksuite/k012a_Tempo_Markings_Sibelius.pdf | Bin .../ksuite/k013a_OrchestralScoreFinale.musx | Bin .../ksuite/k013a_OrchestralScoreFinale.xml | 0 .../k013a_OrchestralScoreFinale_FinaleOriginal.pdf | Bin .../k013a_OrchestralScoreFinale_FinaleRoundtrip.pdf | Bin .../ksuite/k013a_OrchestralScoreFinale_Sibelius.pdf | Bin .../ksuite/k013b_OrchestralScoreSibelius.sib | Bin .../ksuite/k013b_OrchestralScoreSibelius.xml | 0 .../k013b_OrchestralScoreSibelius_Sibelius.pdf | Bin ...3b_OrchestralScoreSibelius_SibeliusRoundtrip.pdf | Bin {Resources => data}/ksuite/k014a_Fermatas.xml | 0 .../ksuite/k014a_Fermatas_Dorico.pdf | Bin .../ksuite/k014a_Fermatas_Finale.pdf | Bin .../ksuite/k014a_Fermatas_MuseScore.pdf | Bin .../ksuite/k014a_Fermatas_Sibelius.pdf | Bin {Resources => data}/ksuite/k015a_System_Layout.xml | 0 .../ksuite/k015a_System_Layout_Dorico.pdf | Bin .../ksuite/k015a_System_Layout_Finale.pdf | Bin .../ksuite/k015a_System_Layout_MuseScore.pdf | Bin .../ksuite/k015a_System_Layout_Sibelius.pdf | Bin .../ksuite/k016a_Miscellaneous_Fields.xml | 0 {Resources => data}/ksuite/temp.xml | 0 .../logicpro/logic01a_homoSapiens.xml | 0 .../lysuite/FinaleMusicXMLImportLog.txt | 0 .../Unofficial MusicXML test suite.webarchive | Bin .../lysuite/ly01a_Pitches_Pitches.musx | Bin .../lysuite/ly01a_Pitches_Pitches.xml | 0 .../lysuite/ly01a_Pitches_Pitches_Finale.pdf | Bin .../lysuite/ly01a_Pitches_Pitches_museScore.pdf | Bin .../lysuite/ly01b_Pitches_Intervals.musx | Bin .../lysuite/ly01b_Pitches_Intervals.xml | 0 .../lysuite/ly01b_Pitches_Intervals_Finale.pdf | Bin .../lysuite/ly01b_Pitches_Intervals_museScore.pdf | Bin .../lysuite/ly01c_Pitches_NoVoiceElement.musx | Bin .../lysuite/ly01c_Pitches_NoVoiceElement.xml | 0 .../lysuite/ly01c_Pitches_NoVoiceElement_Finale.pdf | Bin .../ly01c_Pitches_NoVoiceElement_museScore.pdf | Bin .../lysuite/ly01d_Pitches_Microtones.musx | Bin .../lysuite/ly01d_Pitches_Microtones.xml | 0 .../lysuite/ly01d_Pitches_Microtones_Finale.pdf | Bin .../lysuite/ly01d_Pitches_Microtones_museScore.pdf | Bin .../ly01e_Pitches_ParenthesizedAccidentals.musx | Bin .../ly01e_Pitches_ParenthesizedAccidentals.xml | 0 ...y01e_Pitches_ParenthesizedAccidentals_Finale.pdf | Bin ...e_Pitches_ParenthesizedAccidentals_museScore.pdf | Bin ...f_Pitches_ParenthesizedMicrotoneAccidentals.musx | Bin ...1f_Pitches_ParenthesizedMicrotoneAccidentals.xml | 0 ...hes_ParenthesizedMicrotoneAccidentals_Finale.pdf | Bin .../lysuite/ly02a_Rests_Durations.musx | Bin .../lysuite/ly02a_Rests_Durations.xml | 0 .../lysuite/ly02a_Rests_Durations_Finale.pdf | Bin .../lysuite/ly02b_Rests_PitchedRests.musx | Bin .../lysuite/ly02b_Rests_PitchedRests.xml | 0 .../lysuite/ly02b_Rests_PitchedRests_Finale.pdf | Bin .../lysuite/ly02c_Rests_MultiMeasureRests.musx | Bin .../lysuite/ly02c_Rests_MultiMeasureRests.xml | 0 .../ly02c_Rests_MultiMeasureRests_Finale.pdf | Bin .../ly02d_Rests_Multimeasure_TimeSignatures.musx | Bin .../ly02d_Rests_Multimeasure_TimeSignatures.xml | 0 ...02d_Rests_Multimeasure_TimeSignatures_Finale.pdf | Bin {Resources => data}/lysuite/ly02e_Rests_NoType.musx | Bin {Resources => data}/lysuite/ly02e_Rests_NoType.xml | 0 .../lysuite/ly02e_Rests_NoType_Finale.pdf | Bin .../lysuite/ly03a_Rhythm_Durations.musx | Bin .../lysuite/ly03a_Rhythm_Durations.xml | 0 .../lysuite/ly03a_Rhythm_Durations_Finale.pdf | Bin .../lysuite/ly03b_Rhythm_Backup.musx | Bin {Resources => data}/lysuite/ly03b_Rhythm_Backup.xml | 0 .../lysuite/ly03b_Rhythm_Backup_Finale.pdf | Bin .../lysuite/ly03c_Rhythm_DivisionChange.musx | Bin .../lysuite/ly03c_Rhythm_DivisionChange.xml | 0 .../lysuite/ly03c_Rhythm_DivisionChange_Finale.pdf | Bin .../ly03d_Rhythm_DottedDurations_Factors.musx | Bin .../ly03d_Rhythm_DottedDurations_Factors.xml | 0 .../ly03d_Rhythm_DottedDurations_Factors_Finale.pdf | Bin .../lysuite/ly11a_TimeSignatures.dorico | Bin .../lysuite/ly11a_TimeSignatures.musx | Bin .../lysuite/ly11a_TimeSignatures.xml | 0 .../lysuite/ly11a_TimeSignatures_Dorico.pdf | Bin .../lysuite/ly11a_TimeSignatures_Finale.pdf | Bin .../lysuite/ly11b_TimeSignatures_NoTime.musx | Bin .../lysuite/ly11b_TimeSignatures_NoTime.xml | 0 .../lysuite/ly11b_TimeSignatures_NoTime_Finale.pdf | Bin .../ly11c_TimeSignatures_CompoundSimple.musx | Bin .../lysuite/ly11c_TimeSignatures_CompoundSimple.xml | 0 .../ly11c_TimeSignatures_CompoundSimple_Finale.pdf | Bin .../ly11d_TimeSignatures_CompoundMultiple.musx | Bin .../ly11d_TimeSignatures_CompoundMultiple.xml | 0 ...ly11d_TimeSignatures_CompoundMultiple_Finale.pdf | Bin .../lysuite/ly11e_TimeSignatures_CompoundMixed.musx | Bin .../lysuite/ly11e_TimeSignatures_CompoundMixed.xml | 0 .../ly11e_TimeSignatures_CompoundMixed_Finale.pdf | Bin .../lysuite/ly11f_TimeSignatures_SymbolMeaning.musx | Bin .../lysuite/ly11f_TimeSignatures_SymbolMeaning.xml | 0 .../ly11f_TimeSignatures_SymbolMeaning_Finale.pdf | Bin .../lysuite/ly11g_TimeSignatures_SingleNumber.musx | Bin .../lysuite/ly11g_TimeSignatures_SingleNumber.xml | 0 .../ly11g_TimeSignatures_SingleNumber_Finale.pdf | Bin .../lysuite/ly11h_TimeSignatures_SenzaMisura.musx | Bin .../lysuite/ly11h_TimeSignatures_SenzaMisura.xml | 0 .../ly11h_TimeSignatures_SenzaMisura_Finale.pdf | Bin {Resources => data}/lysuite/ly12a_Clefs.musx | Bin {Resources => data}/lysuite/ly12a_Clefs.xml | 0 {Resources => data}/lysuite/ly12a_Clefs_Finale.pdf | Bin .../lysuite/ly12b_Clefs_NoKeyOrClef.musx | Bin .../lysuite/ly12b_Clefs_NoKeyOrClef.xml | 0 .../lysuite/ly12b_Clefs_NoKeyOrClef_Finale.pdf | Bin .../lysuite/ly13a_KeySignatures.musx | Bin {Resources => data}/lysuite/ly13a_KeySignatures.xml | 0 .../lysuite/ly13a_KeySignatures_Finale.pdf | Bin .../lysuite/ly13b_KeySignatures_ChurchModes.musx | Bin .../lysuite/ly13b_KeySignatures_ChurchModes.xml | 0 .../ly13b_KeySignatures_ChurchModes_Finale.pdf | Bin .../lysuite/ly13c_KeySignatures_NonTraditional.musx | Bin .../lysuite/ly13c_KeySignatures_NonTraditional.xml | 0 .../ly13c_KeySignatures_NonTraditional_Finale.pdf | Bin .../lysuite/ly13d_KeySignatures_Microtones.musx | Bin .../lysuite/ly13d_KeySignatures_Microtones.xml | 0 .../ly13d_KeySignatures_Microtones_Finale.pdf | Bin .../lysuite/ly14a_StaffDetails_LineChanges.musx | Bin .../lysuite/ly14a_StaffDetails_LineChanges.xml | 0 .../ly14a_StaffDetails_LineChanges_Finale.pdf | Bin {Resources => data}/lysuite/ly21a_Chord_Basic.musx | Bin {Resources => data}/lysuite/ly21a_Chord_Basic.xml | 0 .../lysuite/ly21a_Chord_Basic_Finale.pdf | Bin .../lysuite/ly21b_Chords_TwoNotes.musx | Bin .../lysuite/ly21b_Chords_TwoNotes.xml | 0 .../lysuite/ly21b_Chords_TwoNotes_Finale.pdf | Bin .../lysuite/ly21c_Chords_ThreeNotesDuration.musx | Bin .../lysuite/ly21c_Chords_ThreeNotesDuration.xml | 0 .../ly21c_Chords_ThreeNotesDuration_Finale.pdf | Bin .../lysuite/ly21d_Chords_SchubertStabatMater.musx | Bin .../lysuite/ly21d_Chords_SchubertStabatMater.xml | 0 .../ly21d_Chords_SchubertStabatMater_Finale.pdf | Bin .../lysuite/ly21e_Chords_PickupMeasures.musx | Bin .../lysuite/ly21e_Chords_PickupMeasures.xml | 0 .../lysuite/ly21e_Chords_PickupMeasures_Finale.pdf | Bin .../lysuite/ly21f_Chord_ElementInBetween.musx | Bin .../lysuite/ly21f_Chord_ElementInBetween.xml | 0 .../lysuite/ly21f_Chord_ElementInBetween_Finale.pdf | Bin {Resources => data}/lysuite/ly22a_Noteheads.musx | Bin {Resources => data}/lysuite/ly22a_Noteheads.xml | 0 .../lysuite/ly22a_Noteheads_Finale.pdf | Bin .../lysuite/ly22b_Staff_Notestyles.musx | Bin .../lysuite/ly22b_Staff_Notestyles.xml | 0 .../lysuite/ly22b_Staff_Notestyles_Finale.pdf | Bin .../lysuite/ly22c_Noteheads_Chords.musx | Bin .../lysuite/ly22c_Noteheads_Chords.xml | 0 .../lysuite/ly22c_Noteheads_Chords_Finale.pdf | Bin .../lysuite/ly22d_Parenthesized_Noteheads.musx | Bin .../lysuite/ly22d_Parenthesized_Noteheads.xml | 0 .../ly22d_Parenthesized_Noteheads_Finale.pdf | Bin {Resources => data}/lysuite/ly23a_Tuplets.musx | Bin {Resources => data}/lysuite/ly23a_Tuplets.xml | 0 .../lysuite/ly23a_Tuplets_Finale.pdf | Bin .../lysuite/ly23b_Tuplets_Styles.musx | Bin .../lysuite/ly23b_Tuplets_Styles.xml | 0 .../lysuite/ly23b_Tuplets_Styles_Finale.pdf | Bin .../lysuite/ly23c_Tuplet_Display_NonStandard.musx | Bin .../lysuite/ly23c_Tuplet_Display_NonStandard.xml | 0 .../ly23c_Tuplet_Display_NonStandard_Finale.pdf | Bin .../lysuite/ly23d_Tuplets_Nested.musx | Bin .../lysuite/ly23d_Tuplets_Nested.xml | 0 .../lysuite/ly23d_Tuplets_Nested_Finale.pdf | Bin .../lysuite/ly23e_Tuplets_Tremolo.musx | Bin .../lysuite/ly23e_Tuplets_Tremolo.xml | 0 .../lysuite/ly23e_Tuplets_Tremolo_Finale.pdf | Bin .../lysuite/ly23f_Tuplets_DurationButNoBracket.musx | Bin .../lysuite/ly23f_Tuplets_DurationButNoBracket.xml | 0 .../ly23f_Tuplets_DurationButNoBracket_Finale.pdf | Bin {Resources => data}/lysuite/ly24a_GraceNotes.musx | Bin {Resources => data}/lysuite/ly24a_GraceNotes.xml | 0 .../lysuite/ly24a_GraceNotes_Finale.pdf | Bin .../lysuite/ly24b_ChordAsGraceNote.musx | Bin .../lysuite/ly24b_ChordAsGraceNote.xml | 0 .../lysuite/ly24b_ChordAsGraceNote_Finale.pdf | Bin .../lysuite/ly24c_GraceNote_MeasureEnd.musx | Bin .../lysuite/ly24c_GraceNote_MeasureEnd.xml | 0 .../lysuite/ly24c_GraceNote_MeasureEnd_Finale.pdf | Bin {Resources => data}/lysuite/ly24d_AfterGrace.musx | Bin {Resources => data}/lysuite/ly24d_AfterGrace.xml | 0 .../lysuite/ly24d_AfterGrace_Finale.pdf | Bin .../lysuite/ly24e_GraceNote_StaffChange.musx | Bin .../lysuite/ly24e_GraceNote_StaffChange.xml | 0 .../lysuite/ly24e_GraceNote_StaffChange_Finale.pdf | Bin .../lysuite/ly24f_GraceNote_Slur.musx | Bin .../lysuite/ly24f_GraceNote_Slur.xml | 0 .../lysuite/ly24f_GraceNote_Slur_Finale.pdf | Bin {Resources => data}/lysuite/ly31a_Directions.musx | Bin {Resources => data}/lysuite/ly31a_Directions.xml | 0 .../lysuite/ly31a_Directions_Finale.pdf | Bin .../lysuite/ly31c_MetronomeMarks.musx | Bin .../lysuite/ly31c_MetronomeMarks.xml | 0 .../lysuite/ly31c_MetronomeMarks_Finale.pdf | Bin {Resources => data}/lysuite/ly32a_Notations.musx | Bin {Resources => data}/lysuite/ly32a_Notations.xml | 0 .../lysuite/ly32a_Notations_Finale.pdf | Bin .../lysuite/ly32b_Articulations_Texts.musx | Bin .../lysuite/ly32b_Articulations_Texts.xml | 0 .../lysuite/ly32b_Articulations_Texts_Finale.pdf | Bin .../lysuite/ly32c_MultipleNotationChildren.musx | Bin .../lysuite/ly32c_MultipleNotationChildren.xml | 0 .../ly32c_MultipleNotationChildren_Finale.pdf | Bin {Resources => data}/lysuite/ly32d_Arpeggio.musx | Bin {Resources => data}/lysuite/ly32d_Arpeggio.xml | 0 .../lysuite/ly32d_Arpeggio_Finale.pdf | Bin {Resources => data}/lysuite/ly33a_Spanners.musx | Bin {Resources => data}/lysuite/ly33a_Spanners.xml | 0 .../lysuite/ly33a_Spanners_Finale.pdf | Bin {Resources => data}/lysuite/ly33b_Spanners_Tie.musx | Bin {Resources => data}/lysuite/ly33b_Spanners_Tie.xml | 0 .../lysuite/ly33b_Spanners_Tie_Finale.pdf | Bin .../lysuite/ly33c_Spanners_Slurs.musx | Bin .../lysuite/ly33c_Spanners_Slurs.xml | 0 .../lysuite/ly33c_Spanners_Slurs_Finale.pdf | Bin .../lysuite/ly33d_Spanners_OctaveShifts.musx | Bin .../lysuite/ly33d_Spanners_OctaveShifts.xml | 0 .../lysuite/ly33d_Spanners_OctaveShifts_Finale.pdf | Bin .../ly33e_Spanners_OctaveShifts_InvalidSize.musx | Bin .../ly33e_Spanners_OctaveShifts_InvalidSize.xml | 0 ...33e_Spanners_OctaveShifts_InvalidSize_Finale.pdf | Bin .../lysuite/ly33f_Trill_EndingOnGraceNote.musx | Bin .../lysuite/ly33f_Trill_EndingOnGraceNote.xml | 0 .../ly33f_Trill_EndingOnGraceNote_Finale.pdf | Bin .../lysuite/ly33g_Slur_ChordedNotes.musx | Bin .../lysuite/ly33g_Slur_ChordedNotes.xml | 0 .../lysuite/ly33g_Slur_ChordedNotes_Finale.pdf | Bin .../lysuite/ly33h_Spanners_Glissando.musx | Bin .../lysuite/ly33h_Spanners_Glissando.xml | 0 .../lysuite/ly33h_Spanners_Glissando_Finale.pdf | Bin .../lysuite/ly33i_Ties_NotEnded.musx | Bin {Resources => data}/lysuite/ly33i_Ties_NotEnded.xml | 0 .../lysuite/ly33i_Ties_NotEnded_Finale.pdf | Bin .../lysuite/ly41a_MultiParts_Partorder.musx | Bin .../lysuite/ly41a_MultiParts_Partorder.xml | 0 .../lysuite/ly41a_MultiParts_Partorder_Finale.pdf | Bin .../lysuite/ly41b_MultiParts_MoreThan10.musx | Bin .../lysuite/ly41b_MultiParts_MoreThan10.xml | 0 .../lysuite/ly41b_MultiParts_MoreThan10_Finale.pdf | Bin {Resources => data}/lysuite/ly41c_StaffGroups.musx | Bin {Resources => data}/lysuite/ly41c_StaffGroups.xml | 0 .../lysuite/ly41c_StaffGroups_Finale.pdf | Bin .../lysuite/ly41d_StaffGroups_Nested.musx | Bin .../lysuite/ly41d_StaffGroups_Nested.xml | 0 .../lysuite/ly41d_StaffGroups_Nested_Finale.pdf | Bin ...y41e_StaffGroups_InstrumentNames_Linebroken.musx | Bin ...ly41e_StaffGroups_InstrumentNames_Linebroken.xml | 0 ...taffGroups_InstrumentNames_Linebroken_Finale.pdf | Bin .../lysuite/ly41f_StaffGroups_Overlapping.musx | Bin .../lysuite/ly41f_StaffGroups_Overlapping.xml | 0 .../ly41f_StaffGroups_Overlapping_Finale.pdf | Bin {Resources => data}/lysuite/ly41g_PartNoId.musx | Bin {Resources => data}/lysuite/ly41g_PartNoId.xml | 0 .../lysuite/ly41g_PartNoId_Finale.pdf | Bin {Resources => data}/lysuite/ly41h_TooManyParts.musx | Bin {Resources => data}/lysuite/ly41h_TooManyParts.xml | 0 .../lysuite/ly41h_TooManyParts_Finale.pdf | Bin .../lysuite/ly41i_PartNameDisplay_Override.musx | Bin .../lysuite/ly41i_PartNameDisplay_Override.xml | 0 .../ly41i_PartNameDisplay_Override_Finale.pdf | Bin .../ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.musx | Bin .../ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.xml | 0 ...2a_MultiVoice_TwoVoicesOnStaff_Lyrics_Finale.pdf | Bin .../ly42b_MultiVoice_MidMeasureClefChange.musx | Bin .../ly42b_MultiVoice_MidMeasureClefChange.xml | 0 ...ly42b_MultiVoice_MidMeasureClefChange_Finale.pdf | Bin {Resources => data}/lysuite/ly43a_PianoStaff.musx | Bin {Resources => data}/lysuite/ly43a_PianoStaff.xml | 0 .../lysuite/ly43a_PianoStaff_Finale.pdf | Bin .../lysuite/ly43a_PianoStaff_museScore.pdf | Bin .../lysuite/ly43b_MultiStaff_DifferentKeys.musx | Bin .../lysuite/ly43b_MultiStaff_DifferentKeys.xml | 0 .../ly43b_MultiStaff_DifferentKeys_Finale.pdf | Bin .../ly43c_MultiStaff_DifferentKeysAfterBackup.musx | Bin .../ly43c_MultiStaff_DifferentKeysAfterBackup.xml | 0 ...c_MultiStaff_DifferentKeysAfterBackup_Finale.pdf | Bin ...ultiStaff_DifferentKeysAfterBackup_museScore.pdf | Bin .../lysuite/ly43d_MultiStaff_StaffChange.musx | Bin .../lysuite/ly43d_MultiStaff_StaffChange.xml | 0 .../lysuite/ly43d_MultiStaff_StaffChange_Finale.pdf | Bin .../ly43d_MultiStaff_StaffChange_museScore.pdf | Bin .../lysuite/ly43e_Multistaff_ClefDynamics.dorico | Bin .../lysuite/ly43e_Multistaff_ClefDynamics.musx | Bin .../lysuite/ly43e_Multistaff_ClefDynamics.xml | 0 .../ly43e_Multistaff_ClefDynamics_Dorico.pdf | Bin .../ly43e_Multistaff_ClefDynamics_Finale.pdf | Bin .../ly43e_Multistaff_ClefDynamics_museScore.pdf | Bin {Resources => data}/lysuite/ly45a_SimpleRepeat.musx | Bin {Resources => data}/lysuite/ly45a_SimpleRepeat.xml | 0 .../lysuite/ly45a_SimpleRepeat_Finale.pdf | Bin .../lysuite/ly45b_RepeatWithAlternatives.musx | Bin .../lysuite/ly45b_RepeatWithAlternatives.xml | 0 .../lysuite/ly45b_RepeatWithAlternatives_Finale.pdf | Bin .../lysuite/ly45c_RepeatMultipleTimes.musx | Bin .../lysuite/ly45c_RepeatMultipleTimes.xml | 0 .../lysuite/ly45c_RepeatMultipleTimes_Finale.pdf | Bin .../lysuite/ly45d_Repeats_Nested_Alternatives.musx | Bin .../lysuite/ly45d_Repeats_Nested_Alternatives.xml | 0 .../ly45d_Repeats_Nested_Alternatives_Finale.pdf | Bin .../lysuite/ly45e_Repeats_Nested_Alternatives.musx | Bin .../lysuite/ly45e_Repeats_Nested_Alternatives.xml | 0 .../ly45e_Repeats_Nested_Alternatives_Finale.pdf | Bin .../lysuite/ly45f_Repeats_InvalidEndings.musx | Bin .../lysuite/ly45f_Repeats_InvalidEndings.xml | 0 .../lysuite/ly45f_Repeats_InvalidEndings_Finale.pdf | Bin .../lysuite/ly45g_Repeats_NotEnded.musx | Bin .../lysuite/ly45g_Repeats_NotEnded.xml | 0 .../lysuite/ly45g_Repeats_NotEnded_Finale.pdf | Bin {Resources => data}/lysuite/ly46a_Barlines.musx | Bin {Resources => data}/lysuite/ly46a_Barlines.xml | 0 .../lysuite/ly46a_Barlines_Finale.pdf | Bin .../lysuite/ly46b_MidmeasureBarline.musx | Bin .../lysuite/ly46b_MidmeasureBarline.xml | 0 .../lysuite/ly46b_MidmeasureBarline_Finale.pdf | Bin .../lysuite/ly46c_Midmeasure_Clef.musx | Bin .../lysuite/ly46c_Midmeasure_Clef.xml | 0 .../lysuite/ly46c_Midmeasure_Clef_Finale.pdf | Bin .../ly46d_PickupMeasure_ImplicitMeasures.musx | Bin .../ly46d_PickupMeasure_ImplicitMeasures.xml | 0 .../ly46d_PickupMeasure_ImplicitMeasures_Finale.pdf | Bin .../ly46e_PickupMeasure_SecondVoiceStartsLater.musx | Bin .../ly46e_PickupMeasure_SecondVoiceStartsLater.xml | 0 ..._PickupMeasure_SecondVoiceStartsLater_Finale.pdf | Bin .../lysuite/ly46f_IncompleteMeasures.musx | Bin .../lysuite/ly46f_IncompleteMeasures.xml | 0 .../lysuite/ly46f_IncompleteMeasures_Finale.pdf | Bin .../ly46g_PickupMeasure_Chordnames_FiguredBass.musx | Bin .../ly46g_PickupMeasure_Chordnames_FiguredBass.xml | 0 ..._PickupMeasure_Chordnames_FiguredBass_Finale.pdf | Bin .../lysuite/ly51b_Header_Quotes.musx | Bin {Resources => data}/lysuite/ly51b_Header_Quotes.xml | 0 .../lysuite/ly51b_Header_Quotes_Finale.pdf | Bin .../lysuite/ly51c_MultipleRights.musx | Bin .../lysuite/ly51c_MultipleRights.xml | 0 .../lysuite/ly51c_MultipleRights_Finale.pdf | Bin {Resources => data}/lysuite/ly51d_EmptyTitle.musx | Bin {Resources => data}/lysuite/ly51d_EmptyTitle.xml | 0 .../lysuite/ly51d_EmptyTitle_Finale.pdf | Bin {Resources => data}/lysuite/ly52a_PageLayout.musx | Bin {Resources => data}/lysuite/ly52a_PageLayout.xml | 0 .../lysuite/ly52a_PageLayout_Finale.pdf | Bin {Resources => data}/lysuite/ly52b_Breaks.musx | Bin {Resources => data}/lysuite/ly52b_Breaks.xml | 0 {Resources => data}/lysuite/ly52b_Breaks_Finale.pdf | Bin {Resources => data}/lysuite/ly61a_Lyrics.musx | Bin {Resources => data}/lysuite/ly61a_Lyrics.xml | 0 {Resources => data}/lysuite/ly61a_Lyrics_Finale.pdf | Bin .../lysuite/ly61b_MultipleLyrics.musx | Bin .../lysuite/ly61b_MultipleLyrics.xml | 0 .../lysuite/ly61b_MultipleLyrics_Finale.pdf | Bin .../lysuite/ly61c_Lyrics_Pianostaff.musx | Bin .../lysuite/ly61c_Lyrics_Pianostaff.xml | 0 .../lysuite/ly61c_Lyrics_Pianostaff_Finale.pdf | Bin .../lysuite/ly61d_Lyrics_Melisma.musx | Bin .../lysuite/ly61d_Lyrics_Melisma.xml | 0 .../lysuite/ly61d_Lyrics_Melisma_Finale.pdf | Bin .../lysuite/ly61e_Lyrics_Chords.musx | Bin {Resources => data}/lysuite/ly61e_Lyrics_Chords.xml | 0 .../lysuite/ly61e_Lyrics_Chords_Finale.pdf | Bin .../lysuite/ly61f_Lyrics_GracedNotes.musx | Bin .../lysuite/ly61f_Lyrics_GracedNotes.xml | 0 .../lysuite/ly61f_Lyrics_GracedNotes_Finale.pdf | Bin .../lysuite/ly61g_Lyrics_NameNumber.musx | Bin .../lysuite/ly61g_Lyrics_NameNumber.xml | 0 .../lysuite/ly61g_Lyrics_NameNumber_Finale.pdf | Bin .../lysuite/ly61h_Lyrics_BeamsMelismata.musx | Bin .../lysuite/ly61h_Lyrics_BeamsMelismata.xml | 0 .../lysuite/ly61h_Lyrics_BeamsMelismata_Finale.pdf | Bin .../lysuite/ly61i_Lyrics_Chords.musx | Bin {Resources => data}/lysuite/ly61i_Lyrics_Chords.xml | 0 .../lysuite/ly61i_Lyrics_Chords_Finale.pdf | Bin .../lysuite/ly61j_Lyrics_Elisions.musx | Bin .../lysuite/ly61j_Lyrics_Elisions.xml | 0 .../lysuite/ly61j_Lyrics_Elisions_Finale.pdf | Bin .../lysuite/ly61k_Lyrics_SpannersExtenders.musx | Bin .../lysuite/ly61k_Lyrics_SpannersExtenders.xml | 0 .../ly61k_Lyrics_SpannersExtenders_Finale.pdf | Bin {Resources => data}/lysuite/ly71a_Chordnames.musx | Bin {Resources => data}/lysuite/ly71a_Chordnames.xml | 0 .../lysuite/ly71a_Chordnames_Finale.pdf | Bin {Resources => data}/lysuite/ly71c_ChordsFrets.musx | Bin {Resources => data}/lysuite/ly71c_ChordsFrets.xml | 0 .../lysuite/ly71c_ChordsFrets_Finale.pdf | Bin .../lysuite/ly71d_ChordsFrets_Multistaff.musx | Bin .../lysuite/ly71d_ChordsFrets_Multistaff.xml | 0 .../lysuite/ly71d_ChordsFrets_Multistaff_Finale.pdf | Bin {Resources => data}/lysuite/ly71e_TabStaves.musx | Bin {Resources => data}/lysuite/ly71e_TabStaves.xml | 0 .../lysuite/ly71e_TabStaves_Finale.pdf | Bin .../lysuite/ly71f_AllChordTypes.musx | Bin {Resources => data}/lysuite/ly71f_AllChordTypes.xml | 0 .../lysuite/ly71f_AllChordTypes_Finale.pdf | Bin .../lysuite/ly71g_MultipleChordnames.musx | Bin .../lysuite/ly71g_MultipleChordnames.xml | 0 .../lysuite/ly71g_MultipleChordnames_Finale.pdf | Bin .../lysuite/ly72a_TransposingInstruments.musx | Bin .../lysuite/ly72a_TransposingInstruments.xml | 0 .../lysuite/ly72a_TransposingInstruments_Finale.pdf | Bin .../lysuite/ly72b_TransposingInstruments_Full.musx | Bin .../lysuite/ly72b_TransposingInstruments_Full.xml | 0 .../ly72b_TransposingInstruments_Full_Finale.pdf | Bin .../ly72c_TransposingInstruments_Change.musx | Bin .../lysuite/ly72c_TransposingInstruments_Change.xml | 0 .../ly72c_TransposingInstruments_Change_Finale.pdf | Bin {Resources => data}/lysuite/ly73a_Percussion.musx | Bin {Resources => data}/lysuite/ly73a_Percussion.xml | 0 .../lysuite/ly73a_Percussion_Finale.pdf | Bin {Resources => data}/lysuite/ly74a_FiguredBass.musx | Bin {Resources => data}/lysuite/ly74a_FiguredBass.xml | 0 .../lysuite/ly74a_FiguredBass_Finale.pdf | Bin .../lysuite/ly75a_AccordionRegistrations.musx | Bin .../lysuite/ly75a_AccordionRegistrations.xml | 0 .../lysuite/ly75a_AccordionRegistrations_Finale.pdf | Bin .../lysuite/ly90a_Compressed_MusicXML.musx | Bin .../lysuite/ly90a_Compressed_MusicXML.mxl | Bin .../lysuite/ly90a_Compressed_MusicXML_Finale.pdf | Bin .../lysuite/ly99a_Sibelius5_IgnoreBeaming.musx | Bin .../lysuite/ly99a_Sibelius5_IgnoreBeaming.xml | 0 .../ly99a_Sibelius5_IgnoreBeaming_Finale.pdf | Bin .../ly99b_Lyrics_BeamsMelismata_IgnoreBeams.musx | Bin .../ly99b_Lyrics_BeamsMelismata_IgnoreBeams.xml | 0 ...99b_Lyrics_BeamsMelismata_IgnoreBeams_Finale.pdf | Bin .../mjbsuite/ChordDirectionPlacement.xml | 0 .../mjbsuite/FreezingSmall _FinaleRoundtrip.pdf | Bin {Resources => data}/mjbsuite/FreezingSmall.musx | Bin {Resources => data}/mjbsuite/FreezingSmall.xml | 0 .../mjbsuite/FreezingSmall_FinaleOriginal.pdf | Bin .../mjbsuite/HasMusicXmlVersionFalse.xml | 0 .../mjbsuite/HasMusicXmlVersionTrue.xml | 0 {Resources => data}/mjbsuite/OctoberXML.musx | Bin {Resources => data}/mjbsuite/OctoberXML.xml | 0 .../mjbsuite/OctoberXML_FinaleOriginal.pdf | Bin .../mjbsuite/OctoberXML_FinaleRoundtrip.pdf | Bin .../mjbsuite/PreserveTimeModificationNormalType.xml | 0 {Resources => data}/mjbsuite/chords_simple.xml | 0 {Resources => data}/mjbsuite/ezinar.xml | 0 {Resources => data}/mjbsuite/freezing.old.xml | 0 {Resources => data}/mjbsuite/freezing.xml | 0 {Resources => data}/mjbsuite/hello_timewise.xml | 0 {Resources => data}/mjbsuite/krz_v40.musx | Bin {Resources => data}/mjbsuite/krz_v40.xml | 0 .../mjbsuite/krz_v40_FinaleOriginal.pdf | Bin .../mjbsuite/krz_v40_FinaleRoundtrip.pdf | Bin {Resources => data}/mjbsuite/lyre_timewise.xml | 0 .../mjbsuite/processing_instructions.xml | 0 .../musuite/A_Walk_through_the_Park.license | 0 .../musuite/A_Walk_through_the_Park.xml | 0 {Resources => data}/musuite/different_keysigs_1.xml | 0 {Resources => data}/musuite/different_keysigs_2.xml | 0 {Resources => data}/musuite/test98.xml | 0 {Resources => data}/musuite/testAccidentals1.pdf | Bin {Resources => data}/musuite/testAccidentals1.xml | 0 {Resources => data}/musuite/testAccidentals2.pdf | Bin {Resources => data}/musuite/testAccidentals2.xml | 0 {Resources => data}/musuite/testArpGliss1.pdf | Bin {Resources => data}/musuite/testArpGliss1.xml | 0 {Resources => data}/musuite/testArpGliss2.pdf | Bin {Resources => data}/musuite/testArpGliss2.xml | 0 {Resources => data}/musuite/testBarStyles.pdf | Bin {Resources => data}/musuite/testBarStyles.xml | 0 {Resources => data}/musuite/testChord.pdf | Bin {Resources => data}/musuite/testChord.xml | 0 {Resources => data}/musuite/testChordDiagrams1.xml | 0 {Resources => data}/musuite/testChordNoVoice.pdf | Bin {Resources => data}/musuite/testChordNoVoice.xml | 0 .../musuite/testChordNoVoice_ref.xml | 0 {Resources => data}/musuite/testClefs1.pdf | Bin {Resources => data}/musuite/testClefs1.xml | 0 .../musuite/testCompleteMeasureRests.xml | 0 {Resources => data}/musuite/testDCalCoda.pdf | Bin {Resources => data}/musuite/testDCalCoda.xml | 0 {Resources => data}/musuite/testDCalFine.pdf | Bin {Resources => data}/musuite/testDCalFine.xml | 0 {Resources => data}/musuite/testDalSegno.pdf | Bin {Resources => data}/musuite/testDalSegno.xml | 0 {Resources => data}/musuite/testDirections1.pdf | Bin {Resources => data}/musuite/testDirections1.xml | 0 {Resources => data}/musuite/testDrumset1.pdf | Bin {Resources => data}/musuite/testDrumset1.xml | 0 {Resources => data}/musuite/testDrumset2.pdf | Bin {Resources => data}/musuite/testDrumset2.xml | 0 .../musuite/testDurationRoundingError.xml | 0 .../musuite/testDurationRoundingError_ref.xml | 0 {Resources => data}/musuite/testDynamics1.pdf | Bin {Resources => data}/musuite/testDynamics1.xml | 0 {Resources => data}/musuite/testDynamics2.pdf | Bin {Resources => data}/musuite/testDynamics2.xml | 0 {Resources => data}/musuite/testDynamics3.pdf | Bin {Resources => data}/musuite/testDynamics3.xml | 0 {Resources => data}/musuite/testDynamics3_ref.xml | 0 {Resources => data}/musuite/testEmptyMeasure.xml | 0 .../musuite/testEmptyMeasure_ref.xml | 0 {Resources => data}/musuite/testEmptyVoice1.xml | 0 {Resources => data}/musuite/testEmptyVoice1_ref.xml | 0 {Resources => data}/musuite/testFiguredBass1.xml | 0 {Resources => data}/musuite/testFiguredBass2.xml | 0 {Resources => data}/musuite/testGrace1.pdf | Bin {Resources => data}/musuite/testGrace1.xml | 0 {Resources => data}/musuite/testGrace2.pdf | Bin {Resources => data}/musuite/testGrace2.xml | 0 {Resources => data}/musuite/testHarmony1.xml | 0 {Resources => data}/musuite/testHarmony2.xml | 0 {Resources => data}/musuite/testHarmony3.xml | 0 {Resources => data}/musuite/testHello.pdf | Bin {Resources => data}/musuite/testHello.xml | 0 .../musuite/testImplicitMeasure1.pdf | Bin .../musuite/testImplicitMeasure1.xml | 0 {Resources => data}/musuite/testInvalid.xml | 0 .../musuite/testInvisibleElements.xml | 0 {Resources => data}/musuite/testKeysig1.pdf | Bin {Resources => data}/musuite/testKeysig1.xml | 0 {Resources => data}/musuite/testLineBreaks.xml | 0 {Resources => data}/musuite/testLines1.pdf | Bin {Resources => data}/musuite/testLines1.xml | 0 {Resources => data}/musuite/testLines1_ref.xml | 0 {Resources => data}/musuite/testLines2.pdf | Bin {Resources => data}/musuite/testLines2.xml | 0 {Resources => data}/musuite/testLines2_ref.xml | 0 {Resources => data}/musuite/testLyricsVoice2a.xml | 0 {Resources => data}/musuite/testLyricsVoice2b.xml | 0 .../musuite/testLyricsVoice2b_ref.xml | 0 {Resources => data}/musuite/testManualBreaks.xml | 0 {Resources => data}/musuite/testMeasureLength.xml | 0 .../musuite/testMeasureLength_ref.xml | 0 {Resources => data}/musuite/testMetaData.xml | 0 .../musuite/testMultiMeasureRest1.pdf | Bin .../musuite/testMultiMeasureRest1.xml | 0 .../musuite/testMultiMeasureRest1_ref.xml | 0 .../musuite/testMultiMeasureRest2.xml | 0 .../musuite/testMultiMeasureRest2_ref.xml | 0 .../musuite/testMultiMeasureRest3.xml | 0 .../musuite/testMultiMeasureRest3_ref.xml | 0 .../musuite/testMultipleNotations.xml | 0 .../musuite/testMultipleNotations_ref.xml | 0 {Resources => data}/musuite/testNonUniqueThings.xml | 0 .../musuite/testNonUniqueThings_ref.xml | 0 {Resources => data}/musuite/testNoteAttributes1.pdf | Bin {Resources => data}/musuite/testNoteAttributes1.xml | 0 {Resources => data}/musuite/testNoteAttributes2.pdf | Bin {Resources => data}/musuite/testNoteAttributes2.xml | 0 .../musuite/testNoteAttributes2_ref.xml | 0 {Resources => data}/musuite/testNoteAttributes3.xml | 0 {Resources => data}/musuite/testNoteheads.xml | 0 {Resources => data}/musuite/testNotesRests1.pdf | Bin {Resources => data}/musuite/testNotesRests1.xml | 0 {Resources => data}/musuite/testNotesRests2.xml | 0 {Resources => data}/musuite/testNumberedLyrics.xml | 0 .../musuite/testNumberedLyrics_ref.xml | 0 .../musuite/testPartsSpecialCases.xml | 0 .../musuite/testPartsSpecialCases_ref.xml | 0 {Resources => data}/musuite/testPiano.xml | 0 {Resources => data}/musuite/testRestsNoType.xml | 0 {Resources => data}/musuite/testRestsNoType_ref.xml | 0 {Resources => data}/musuite/testSlurs.pdf | Bin {Resources => data}/musuite/testSlurs.xml | 0 {Resources => data}/musuite/testStaffTwoKeySigs.xml | 0 {Resources => data}/musuite/testStringVoiceName.xml | 0 .../musuite/testStringVoiceName_ref.xml | 0 {Resources => data}/musuite/testSystemBrackets1.pdf | Bin {Resources => data}/musuite/testSystemBrackets1.xml | 0 {Resources => data}/musuite/testSystemBrackets2.pdf | Bin {Resources => data}/musuite/testSystemBrackets2.xml | 0 {Resources => data}/musuite/testTablature1.pdf | Bin {Resources => data}/musuite/testTablature1.xml | 0 {Resources => data}/musuite/testTablature2.pdf | Bin {Resources => data}/musuite/testTablature2.xml | 0 {Resources => data}/musuite/testTablature3.pdf | Bin {Resources => data}/musuite/testTablature3.xml | 0 {Resources => data}/musuite/testTempo1.xml | 0 {Resources => data}/musuite/testTimesig1.pdf | Bin {Resources => data}/musuite/testTimesig1.xml | 0 {Resources => data}/musuite/testTimesig3.pdf | Bin {Resources => data}/musuite/testTimesig3.xml | 0 {Resources => data}/musuite/testTremolo.xml | 0 {Resources => data}/musuite/testTuplets1.xml | 0 {Resources => data}/musuite/testTuplets1_ref.xml | 0 {Resources => data}/musuite/testTuplets2.xml | 0 {Resources => data}/musuite/testTuplets2_ref.xml | 0 {Resources => data}/musuite/testTuplets3.xml | 0 {Resources => data}/musuite/testTuplets3_ref.xml | 0 {Resources => data}/musuite/testTuplets4.xml | 0 .../musuite/testUnusualDurations.xml | 0 .../musuite/testUnusualDurations_ref.xml | 0 {Resources => data}/musuite/testVoiceMapper1.xml | 0 .../musuite/testVoiceMapper1_ref.xml | 0 {Resources => data}/musuite/testVoiceMapper2.xml | 0 .../musuite/testVoiceMapper2_ref.xml | 0 {Resources => data}/musuite/testVoiceMapper3.xml | 0 .../musuite/testVoiceMapper3_ref.xml | 0 {Resources => data}/musuite/testVoicePiano1.pdf | Bin {Resources => data}/musuite/testVoicePiano1.xml | 0 {Resources => data}/musuite/testVolta1.xml | 0 {Resources => data}/musuite/testWedge1.xml | 0 {Resources => data}/musuite/testWedge2.xml | 0 {Resources => data}/musuite/testWedge2_ref.xml | 0 {Resources => data}/musuite/testWords1.pdf | Bin {Resources => data}/musuite/testWords1.xml | 0 {Resources => data}/musuite/test_harmony.xml | 0 {Resources => data}/mxl/Dichterliebe01.mxl | Bin {Resources => data}/recsuite/ActorPreludeSample.mxl | Bin {Resources => data}/recsuite/ActorPreludeSample.pdf | Bin {Resources => data}/recsuite/ActorPreludeSample.xml | 0 {Resources => data}/recsuite/BeetAnGeSample.mxl | Bin {Resources => data}/recsuite/BeetAnGeSample.pdf | Bin {Resources => data}/recsuite/BeetAnGeSample.xml | 0 {Resources => data}/recsuite/Binchois.mxl | Bin {Resources => data}/recsuite/Binchois.png | Bin {Resources => data}/recsuite/Binchois.xml | 0 {Resources => data}/recsuite/BrahWiMeSample.mxl | Bin {Resources => data}/recsuite/BrahWiMeSample.pdf | Bin {Resources => data}/recsuite/BrahWiMeSample.xml | 0 {Resources => data}/recsuite/BrookeWestSample.mxl | Bin {Resources => data}/recsuite/BrookeWestSample.pdf | Bin {Resources => data}/recsuite/BrookeWestSample.xml | 0 {Resources => data}/recsuite/Chant.mxl | Bin {Resources => data}/recsuite/Chant.png | Bin {Resources => data}/recsuite/Chant.xml | 0 {Resources => data}/recsuite/DebuMandSample.mxl | Bin {Resources => data}/recsuite/DebuMandSample.pdf | Bin {Resources => data}/recsuite/DebuMandSample.xml | 0 {Resources => data}/recsuite/Dichterliebe01.mxl | Bin {Resources => data}/recsuite/Dichterliebe01.pdf | Bin {Resources => data}/recsuite/Dichterliebe01.xml | 0 {Resources => data}/recsuite/Echigo_Jishi.mxl | Bin {Resources => data}/recsuite/Echigo_Jishi.pdf | Bin {Resources => data}/recsuite/Echigo_Jishi.xml | 0 {Resources => data}/recsuite/FaurReveSample.mxl | Bin {Resources => data}/recsuite/FaurReveSample.pdf | Bin {Resources => data}/recsuite/FaurReveSample.xml | 0 {Resources => data}/recsuite/MahlFaGe4Sample.mxl | Bin {Resources => data}/recsuite/MahlFaGe4Sample.pdf | Bin {Resources => data}/recsuite/MahlFaGe4Sample.xml | 0 {Resources => data}/recsuite/MozaChloSample.mxl | Bin {Resources => data}/recsuite/MozaChloSample.pdf | Bin {Resources => data}/recsuite/MozaChloSample.xml | Bin {Resources => data}/recsuite/MozaChloSample2.xml | 0 {Resources => data}/recsuite/MozaVeilSample.mxl | Bin {Resources => data}/recsuite/MozaVeilSample.pdf | Bin {Resources => data}/recsuite/MozaVeilSample.xml | Bin {Resources => data}/recsuite/MozartPianoSonata.mxl | Bin {Resources => data}/recsuite/MozartPianoSonata.png | Bin {Resources => data}/recsuite/MozartPianoSonata.xml | 0 {Resources => data}/recsuite/MozartTrio.mxl | Bin {Resources => data}/recsuite/MozartTrio.png | Bin {Resources => data}/recsuite/MozartTrio.xml | 0 {Resources => data}/recsuite/NonUtf8Files.txt | 0 {Resources => data}/recsuite/Saltarello.mxl | Bin {Resources => data}/recsuite/Saltarello.png | Bin {Resources => data}/recsuite/Saltarello.xml | 0 {Resources => data}/recsuite/SchbAvMaSample.mxl | Bin {Resources => data}/recsuite/SchbAvMaSample.pdf | Bin {Resources => data}/recsuite/SchbAvMaSample.xml | 0 {Resources => data}/recsuite/Telemann.mxl | Bin {Resources => data}/recsuite/Telemann.png | Bin {Resources => data}/recsuite/Telemann.xml | 0 {Resources => data}/smufl/glyphnames.json | 0 {Resources => data}/testOutput/.gitignore | 0 872 files changed, 6 insertions(+), 6 deletions(-) rename {Resources => data}/custom/musescore-slur-start-stop.musicxml (100%) rename {Resources => data}/custom/systems-and-pages-original.musx (100%) rename {Resources => data}/custom/systems-and-pages.xml (100%) rename {Resources => data}/custom/transposition.musicxml (100%) rename {Resources => data}/expected/.gitignore (100%) rename {Resources => data}/foundsuite/12 Horn Duets.xml (100%) rename {Resources => data}/foundsuite/12 Horn Duets.zip (100%) rename {Resources => data}/foundsuite/15Inventions.zip (100%) rename {Resources => data}/foundsuite/ARBEAU Belle qui tiens ma vie.xml (100%) rename {Resources => data}/foundsuite/Adagio and Fugue in C minor, K.546.xml (100%) rename {Resources => data}/foundsuite/Adagio and Fugue in C minor, K.546.zip (100%) rename {Resources => data}/foundsuite/An Chloe.xml (100%) rename {Resources => data}/foundsuite/Berlioz_Le_Corsaire.xml (100%) rename {Resources => data}/foundsuite/Berlioz_Le_Corsaire_Finale.pdf (100%) rename {Resources => data}/foundsuite/Black Note Study Op 10 no 5.xml (100%) rename {Resources => data}/foundsuite/Deutscher Tanz D.820.1.xml (100%) rename {Resources => data}/foundsuite/Deutscher Tanz D.820.1.zip (100%) rename {Resources => data}/foundsuite/IMSLP198109-WIMA.4fb5-PezR44-xml.zip (100%) rename {Resources => data}/foundsuite/IMSLP273708-PMLP444363-PepAir.zip (100%) rename {Resources => data}/foundsuite/IMSLP381263-PMLP615890-RonCLun.zip (100%) rename {Resources => data}/foundsuite/Invention 1.xml (100%) rename {Resources => data}/foundsuite/Invention 2.xml (100%) rename {Resources => data}/foundsuite/Invention 3.xml (100%) rename {Resources => data}/foundsuite/Invention_10.xml (100%) rename {Resources => data}/foundsuite/Invention_11.xml (100%) rename {Resources => data}/foundsuite/Invention_12.xml (100%) rename {Resources => data}/foundsuite/Invention_13.xml (100%) rename {Resources => data}/foundsuite/Invention_14.xml (100%) rename {Resources => data}/foundsuite/Invention_15.xml (100%) rename {Resources => data}/foundsuite/Invention_4.xml (100%) rename {Resources => data}/foundsuite/Invention_5.xml (100%) rename {Resources => data}/foundsuite/Invention_6.xml (100%) rename {Resources => data}/foundsuite/Invention_7.xml (100%) rename {Resources => data}/foundsuite/Invention_8.xml (100%) rename {Resources => data}/foundsuite/Invention_9.xml (100%) rename {Resources => data}/foundsuite/Moments Musicaux Op16 No4.xml (100%) rename {Resources => data}/foundsuite/O_Holy_Night-Adam-1871.xml (100%) rename {Resources => data}/foundsuite/O_Holy_Night-Adam-1974.xml (100%) rename {Resources => data}/foundsuite/O_Holy_Night.xml (100%) rename {Resources => data}/foundsuite/PepAiraSco.xml (100%) rename {Resources => data}/foundsuite/PezR44Sco.xml (100%) rename {Resources => data}/foundsuite/Rimsky-Korsakov Op11 No4.xml (100%) rename {Resources => data}/foundsuite/RonCLunSco.xml (100%) rename {Resources => data}/foundsuite/SCHUBERT An die Sonne.xml (100%) rename {Resources => data}/foundsuite/Schubert_der_Mueller.xml (100%) rename {Resources => data}/foundsuite/Schubert_der_Mueller_Finale.pdf (100%) rename {Resources => data}/foundsuite/Schubert_der_Mueller_License.txt (100%) rename {Resources => data}/foundsuite/Schubert_der_Mueller_MuseScore.pdf (100%) rename {Resources => data}/foundsuite/Schubert_der_Mueller_Notion.pdf (100%) rename {Resources => data}/foundsuite/Schubert_der_Mueller_Sibelius.pdf (100%) rename {Resources => data}/foundsuite/Silent_Night-Hartwig.xml (100%) rename {Resources => data}/foundsuite/Silent_Night_Young_1.xml (100%) rename "Resources/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.xml" => "data/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.xml" (100%) rename "Resources/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.zip" => "data/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.zip" (100%) rename {Resources => data}/generalxml/fake.xml (100%) rename {Resources => data}/ksuite/Bombe.musx (100%) rename {Resources => data}/ksuite/Bombe.xml (100%) rename {Resources => data}/ksuite/Bombe_Finale.pdf (100%) rename {Resources => data}/ksuite/k001a_Articulations _Sibelius.pdf (100%) rename {Resources => data}/ksuite/k001a_Articulations.xml (100%) rename {Resources => data}/ksuite/k001a_Articulations_Finale.pdf (100%) rename {Resources => data}/ksuite/k001a_Articulations_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k001b_Articulations_Above.xml (100%) rename {Resources => data}/ksuite/k001b_Articulations_Above_Finale.pdf (100%) rename {Resources => data}/ksuite/k001b_Articulations_Above_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k001b_Articulations_Above_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k001c_Articulations_Below.xml (100%) rename {Resources => data}/ksuite/k001c_Articulations_Below_Finale.pdf (100%) rename {Resources => data}/ksuite/k001c_Articulations_Below_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k001c_Articulations_Below_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k002a_Fermatas.xml (100%) rename {Resources => data}/ksuite/k002a_Fermatas_Finale.pdf (100%) rename {Resources => data}/ksuite/k002a_Fermatas_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k002a_Fermatas_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k003a_Ornaments.xml (100%) rename {Resources => data}/ksuite/k003a_Ornaments_Finale.pdf (100%) rename {Resources => data}/ksuite/k003a_Ornaments_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k003a_Ornaments_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k004a_Technical.xml (100%) rename {Resources => data}/ksuite/k004a_Technical_Finale.pdf (100%) rename {Resources => data}/ksuite/k004a_Technical_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k004a_Technical_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k005a_Spanners_Slides.xml (100%) rename {Resources => data}/ksuite/k005a_Spanners_Slides_Finale.pdf (100%) rename {Resources => data}/ksuite/k005a_Spanners_Slides_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k005a_Spanners_Slides_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.musx (100%) rename {Resources => data}/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.xml (100%) rename {Resources => data}/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Finale.pdf (100%) rename {Resources => data}/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006a_Header_Scaling_Decimals.xml (100%) rename {Resources => data}/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.musx (100%) rename {Resources => data}/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.xml (100%) rename {Resources => data}/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Finale.pdf (100%) rename {Resources => data}/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.musx (100%) rename {Resources => data}/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.xml (100%) rename {Resources => data}/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Finale.pdf (100%) rename {Resources => data}/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.musx (100%) rename {Resources => data}/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.xml (100%) rename {Resources => data}/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Finale.pdf (100%) rename {Resources => data}/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.musx (100%) rename {Resources => data}/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.xml (100%) rename {Resources => data}/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Finale.pdf (100%) rename {Resources => data}/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.musx (100%) rename {Resources => data}/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.xml (100%) rename {Resources => data}/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Finale.pdf (100%) rename {Resources => data}/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.musx (100%) rename {Resources => data}/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.xml (100%) rename {Resources => data}/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Finale.pdf (100%) rename {Resources => data}/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.musx (100%) rename {Resources => data}/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.xml (100%) rename {Resources => data}/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Finale.pdf (100%) rename {Resources => data}/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.musx (100%) rename {Resources => data}/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.xml (100%) rename {Resources => data}/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Finale.pdf (100%) rename {Resources => data}/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.musx (100%) rename {Resources => data}/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.xml (100%) rename {Resources => data}/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Finale.pdf (100%) rename {Resources => data}/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.musx (100%) rename {Resources => data}/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.xml (100%) rename {Resources => data}/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Finale.pdf (100%) rename {Resources => data}/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.musx (100%) rename {Resources => data}/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.xml (100%) rename {Resources => data}/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Finale.pdf (100%) rename {Resources => data}/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.musx (100%) rename {Resources => data}/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.xml (100%) rename {Resources => data}/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Finale.pdf (100%) rename {Resources => data}/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.musx (100%) rename {Resources => data}/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.xml (100%) rename {Resources => data}/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Finale.pdf (100%) rename {Resources => data}/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.musx (100%) rename {Resources => data}/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.xml (100%) rename {Resources => data}/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Finale.pdf (100%) rename {Resources => data}/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.musx (100%) rename {Resources => data}/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.xml (100%) rename {Resources => data}/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Finale.pdf (100%) rename {Resources => data}/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.musx (100%) rename {Resources => data}/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.xml (100%) rename {Resources => data}/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Finale.pdf (100%) rename {Resources => data}/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.musx (100%) rename {Resources => data}/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.xml (100%) rename {Resources => data}/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Finale.pdf (100%) rename {Resources => data}/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.musx (100%) rename {Resources => data}/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.xml (100%) rename {Resources => data}/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Finale.pdf (100%) rename {Resources => data}/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.musx (100%) rename {Resources => data}/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.xml (100%) rename {Resources => data}/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Finale.pdf (100%) rename {Resources => data}/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.musx (100%) rename {Resources => data}/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.xml (100%) rename {Resources => data}/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Finale.pdf (100%) rename {Resources => data}/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.musx (100%) rename {Resources => data}/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.xml (100%) rename {Resources => data}/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Finale.pdf (100%) rename {Resources => data}/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k007a_Notations_Dynamics.musx (100%) rename {Resources => data}/ksuite/k007a_Notations_Dynamics.xml (100%) rename {Resources => data}/ksuite/k007a_Notations_Dynamics_Finale - Score.pdf (100%) rename {Resources => data}/ksuite/k007a_Notations_Dynamics_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k007a_Notations_Dynamics_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k007b_Notations_Dynamics_Attributes.pdf (100%) rename {Resources => data}/ksuite/k007b_Notations_Dynamics_Attributes.xml (100%) rename {Resources => data}/ksuite/k007c_Directions_Dynamics.xml (100%) rename {Resources => data}/ksuite/k007d_Directions_Dynamics_Attributes.xml (100%) rename {Resources => data}/ksuite/k008a_Beaming.musx (100%) rename {Resources => data}/ksuite/k008a_Beaming.xml (100%) rename {Resources => data}/ksuite/k008a_Beaming_FinaleOriginal.pdf (100%) rename {Resources => data}/ksuite/k008a_Beaming_FinaleRoundTrip.pdf (100%) rename {Resources => data}/ksuite/k008a_Beaming_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k009a_Slurs.musx (100%) rename {Resources => data}/ksuite/k009a_Slurs.xml (100%) rename {Resources => data}/ksuite/k009a_Slurs_FinaleOriginal.pdf (100%) rename {Resources => data}/ksuite/k009a_Slurs_FinaleRoundtrip.pdf (100%) rename {Resources => data}/ksuite/k009a_Slurs_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k009b_Slur_Attributes.xml (100%) rename {Resources => data}/ksuite/k010a_Ties.musx (100%) rename {Resources => data}/ksuite/k010a_Ties.xml (100%) rename {Resources => data}/ksuite/k010a_Ties_FinaleOriginal.pdf (100%) rename {Resources => data}/ksuite/k010a_Ties_FinaleRoundtrip.pdf (100%) rename {Resources => data}/ksuite/k010a_Ties_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k010b_Bad_Ties.pdf (100%) rename {Resources => data}/ksuite/k010b_Bad_Ties.xml (100%) rename {Resources => data}/ksuite/k010b_Bad_Ties_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k011a_Tuplets.musx (100%) rename {Resources => data}/ksuite/k011a_Tuplets.pdf (100%) rename {Resources => data}/ksuite/k011a_Tuplets.xml (100%) rename {Resources => data}/ksuite/k011a_Tuplets_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k012a_Tempo_Markings.musx (100%) rename {Resources => data}/ksuite/k012a_Tempo_Markings.xml (100%) rename {Resources => data}/ksuite/k012a_Tempo_Markings_FinaleOriginal .pdf (100%) rename {Resources => data}/ksuite/k012a_Tempo_Markings_FinaleRoundTrip.pdf (100%) rename {Resources => data}/ksuite/k012a_Tempo_Markings_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k013a_OrchestralScoreFinale.musx (100%) rename {Resources => data}/ksuite/k013a_OrchestralScoreFinale.xml (100%) rename {Resources => data}/ksuite/k013a_OrchestralScoreFinale_FinaleOriginal.pdf (100%) rename {Resources => data}/ksuite/k013a_OrchestralScoreFinale_FinaleRoundtrip.pdf (100%) rename {Resources => data}/ksuite/k013a_OrchestralScoreFinale_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k013b_OrchestralScoreSibelius.sib (100%) rename {Resources => data}/ksuite/k013b_OrchestralScoreSibelius.xml (100%) rename {Resources => data}/ksuite/k013b_OrchestralScoreSibelius_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k013b_OrchestralScoreSibelius_SibeliusRoundtrip.pdf (100%) rename {Resources => data}/ksuite/k014a_Fermatas.xml (100%) rename {Resources => data}/ksuite/k014a_Fermatas_Dorico.pdf (100%) rename {Resources => data}/ksuite/k014a_Fermatas_Finale.pdf (100%) rename {Resources => data}/ksuite/k014a_Fermatas_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k014a_Fermatas_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k015a_System_Layout.xml (100%) rename {Resources => data}/ksuite/k015a_System_Layout_Dorico.pdf (100%) rename {Resources => data}/ksuite/k015a_System_Layout_Finale.pdf (100%) rename {Resources => data}/ksuite/k015a_System_Layout_MuseScore.pdf (100%) rename {Resources => data}/ksuite/k015a_System_Layout_Sibelius.pdf (100%) rename {Resources => data}/ksuite/k016a_Miscellaneous_Fields.xml (100%) rename {Resources => data}/ksuite/temp.xml (100%) rename {Resources => data}/logicpro/logic01a_homoSapiens.xml (100%) rename {Resources => data}/lysuite/FinaleMusicXMLImportLog.txt (100%) rename {Resources => data}/lysuite/Unofficial MusicXML test suite.webarchive (100%) rename {Resources => data}/lysuite/ly01a_Pitches_Pitches.musx (100%) rename {Resources => data}/lysuite/ly01a_Pitches_Pitches.xml (100%) rename {Resources => data}/lysuite/ly01a_Pitches_Pitches_Finale.pdf (100%) rename {Resources => data}/lysuite/ly01a_Pitches_Pitches_museScore.pdf (100%) rename {Resources => data}/lysuite/ly01b_Pitches_Intervals.musx (100%) rename {Resources => data}/lysuite/ly01b_Pitches_Intervals.xml (100%) rename {Resources => data}/lysuite/ly01b_Pitches_Intervals_Finale.pdf (100%) rename {Resources => data}/lysuite/ly01b_Pitches_Intervals_museScore.pdf (100%) rename {Resources => data}/lysuite/ly01c_Pitches_NoVoiceElement.musx (100%) rename {Resources => data}/lysuite/ly01c_Pitches_NoVoiceElement.xml (100%) rename {Resources => data}/lysuite/ly01c_Pitches_NoVoiceElement_Finale.pdf (100%) rename {Resources => data}/lysuite/ly01c_Pitches_NoVoiceElement_museScore.pdf (100%) rename {Resources => data}/lysuite/ly01d_Pitches_Microtones.musx (100%) rename {Resources => data}/lysuite/ly01d_Pitches_Microtones.xml (100%) rename {Resources => data}/lysuite/ly01d_Pitches_Microtones_Finale.pdf (100%) rename {Resources => data}/lysuite/ly01d_Pitches_Microtones_museScore.pdf (100%) rename {Resources => data}/lysuite/ly01e_Pitches_ParenthesizedAccidentals.musx (100%) rename {Resources => data}/lysuite/ly01e_Pitches_ParenthesizedAccidentals.xml (100%) rename {Resources => data}/lysuite/ly01e_Pitches_ParenthesizedAccidentals_Finale.pdf (100%) rename {Resources => data}/lysuite/ly01e_Pitches_ParenthesizedAccidentals_museScore.pdf (100%) rename {Resources => data}/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.musx (100%) rename {Resources => data}/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.xml (100%) rename {Resources => data}/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals_Finale.pdf (100%) rename {Resources => data}/lysuite/ly02a_Rests_Durations.musx (100%) rename {Resources => data}/lysuite/ly02a_Rests_Durations.xml (100%) rename {Resources => data}/lysuite/ly02a_Rests_Durations_Finale.pdf (100%) rename {Resources => data}/lysuite/ly02b_Rests_PitchedRests.musx (100%) rename {Resources => data}/lysuite/ly02b_Rests_PitchedRests.xml (100%) rename {Resources => data}/lysuite/ly02b_Rests_PitchedRests_Finale.pdf (100%) rename {Resources => data}/lysuite/ly02c_Rests_MultiMeasureRests.musx (100%) rename {Resources => data}/lysuite/ly02c_Rests_MultiMeasureRests.xml (100%) rename {Resources => data}/lysuite/ly02c_Rests_MultiMeasureRests_Finale.pdf (100%) rename {Resources => data}/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.musx (100%) rename {Resources => data}/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.xml (100%) rename {Resources => data}/lysuite/ly02d_Rests_Multimeasure_TimeSignatures_Finale.pdf (100%) rename {Resources => data}/lysuite/ly02e_Rests_NoType.musx (100%) rename {Resources => data}/lysuite/ly02e_Rests_NoType.xml (100%) rename {Resources => data}/lysuite/ly02e_Rests_NoType_Finale.pdf (100%) rename {Resources => data}/lysuite/ly03a_Rhythm_Durations.musx (100%) rename {Resources => data}/lysuite/ly03a_Rhythm_Durations.xml (100%) rename {Resources => data}/lysuite/ly03a_Rhythm_Durations_Finale.pdf (100%) rename {Resources => data}/lysuite/ly03b_Rhythm_Backup.musx (100%) rename {Resources => data}/lysuite/ly03b_Rhythm_Backup.xml (100%) rename {Resources => data}/lysuite/ly03b_Rhythm_Backup_Finale.pdf (100%) rename {Resources => data}/lysuite/ly03c_Rhythm_DivisionChange.musx (100%) rename {Resources => data}/lysuite/ly03c_Rhythm_DivisionChange.xml (100%) rename {Resources => data}/lysuite/ly03c_Rhythm_DivisionChange_Finale.pdf (100%) rename {Resources => data}/lysuite/ly03d_Rhythm_DottedDurations_Factors.musx (100%) rename {Resources => data}/lysuite/ly03d_Rhythm_DottedDurations_Factors.xml (100%) rename {Resources => data}/lysuite/ly03d_Rhythm_DottedDurations_Factors_Finale.pdf (100%) rename {Resources => data}/lysuite/ly11a_TimeSignatures.dorico (100%) rename {Resources => data}/lysuite/ly11a_TimeSignatures.musx (100%) rename {Resources => data}/lysuite/ly11a_TimeSignatures.xml (100%) rename {Resources => data}/lysuite/ly11a_TimeSignatures_Dorico.pdf (100%) rename {Resources => data}/lysuite/ly11a_TimeSignatures_Finale.pdf (100%) rename {Resources => data}/lysuite/ly11b_TimeSignatures_NoTime.musx (100%) rename {Resources => data}/lysuite/ly11b_TimeSignatures_NoTime.xml (100%) rename {Resources => data}/lysuite/ly11b_TimeSignatures_NoTime_Finale.pdf (100%) rename {Resources => data}/lysuite/ly11c_TimeSignatures_CompoundSimple.musx (100%) rename {Resources => data}/lysuite/ly11c_TimeSignatures_CompoundSimple.xml (100%) rename {Resources => data}/lysuite/ly11c_TimeSignatures_CompoundSimple_Finale.pdf (100%) rename {Resources => data}/lysuite/ly11d_TimeSignatures_CompoundMultiple.musx (100%) rename {Resources => data}/lysuite/ly11d_TimeSignatures_CompoundMultiple.xml (100%) rename {Resources => data}/lysuite/ly11d_TimeSignatures_CompoundMultiple_Finale.pdf (100%) rename {Resources => data}/lysuite/ly11e_TimeSignatures_CompoundMixed.musx (100%) rename {Resources => data}/lysuite/ly11e_TimeSignatures_CompoundMixed.xml (100%) rename {Resources => data}/lysuite/ly11e_TimeSignatures_CompoundMixed_Finale.pdf (100%) rename {Resources => data}/lysuite/ly11f_TimeSignatures_SymbolMeaning.musx (100%) rename {Resources => data}/lysuite/ly11f_TimeSignatures_SymbolMeaning.xml (100%) rename {Resources => data}/lysuite/ly11f_TimeSignatures_SymbolMeaning_Finale.pdf (100%) rename {Resources => data}/lysuite/ly11g_TimeSignatures_SingleNumber.musx (100%) rename {Resources => data}/lysuite/ly11g_TimeSignatures_SingleNumber.xml (100%) rename {Resources => data}/lysuite/ly11g_TimeSignatures_SingleNumber_Finale.pdf (100%) rename {Resources => data}/lysuite/ly11h_TimeSignatures_SenzaMisura.musx (100%) rename {Resources => data}/lysuite/ly11h_TimeSignatures_SenzaMisura.xml (100%) rename {Resources => data}/lysuite/ly11h_TimeSignatures_SenzaMisura_Finale.pdf (100%) rename {Resources => data}/lysuite/ly12a_Clefs.musx (100%) rename {Resources => data}/lysuite/ly12a_Clefs.xml (100%) rename {Resources => data}/lysuite/ly12a_Clefs_Finale.pdf (100%) rename {Resources => data}/lysuite/ly12b_Clefs_NoKeyOrClef.musx (100%) rename {Resources => data}/lysuite/ly12b_Clefs_NoKeyOrClef.xml (100%) rename {Resources => data}/lysuite/ly12b_Clefs_NoKeyOrClef_Finale.pdf (100%) rename {Resources => data}/lysuite/ly13a_KeySignatures.musx (100%) rename {Resources => data}/lysuite/ly13a_KeySignatures.xml (100%) rename {Resources => data}/lysuite/ly13a_KeySignatures_Finale.pdf (100%) rename {Resources => data}/lysuite/ly13b_KeySignatures_ChurchModes.musx (100%) rename {Resources => data}/lysuite/ly13b_KeySignatures_ChurchModes.xml (100%) rename {Resources => data}/lysuite/ly13b_KeySignatures_ChurchModes_Finale.pdf (100%) rename {Resources => data}/lysuite/ly13c_KeySignatures_NonTraditional.musx (100%) rename {Resources => data}/lysuite/ly13c_KeySignatures_NonTraditional.xml (100%) rename {Resources => data}/lysuite/ly13c_KeySignatures_NonTraditional_Finale.pdf (100%) rename {Resources => data}/lysuite/ly13d_KeySignatures_Microtones.musx (100%) rename {Resources => data}/lysuite/ly13d_KeySignatures_Microtones.xml (100%) rename {Resources => data}/lysuite/ly13d_KeySignatures_Microtones_Finale.pdf (100%) rename {Resources => data}/lysuite/ly14a_StaffDetails_LineChanges.musx (100%) rename {Resources => data}/lysuite/ly14a_StaffDetails_LineChanges.xml (100%) rename {Resources => data}/lysuite/ly14a_StaffDetails_LineChanges_Finale.pdf (100%) rename {Resources => data}/lysuite/ly21a_Chord_Basic.musx (100%) rename {Resources => data}/lysuite/ly21a_Chord_Basic.xml (100%) rename {Resources => data}/lysuite/ly21a_Chord_Basic_Finale.pdf (100%) rename {Resources => data}/lysuite/ly21b_Chords_TwoNotes.musx (100%) rename {Resources => data}/lysuite/ly21b_Chords_TwoNotes.xml (100%) rename {Resources => data}/lysuite/ly21b_Chords_TwoNotes_Finale.pdf (100%) rename {Resources => data}/lysuite/ly21c_Chords_ThreeNotesDuration.musx (100%) rename {Resources => data}/lysuite/ly21c_Chords_ThreeNotesDuration.xml (100%) rename {Resources => data}/lysuite/ly21c_Chords_ThreeNotesDuration_Finale.pdf (100%) rename {Resources => data}/lysuite/ly21d_Chords_SchubertStabatMater.musx (100%) rename {Resources => data}/lysuite/ly21d_Chords_SchubertStabatMater.xml (100%) rename {Resources => data}/lysuite/ly21d_Chords_SchubertStabatMater_Finale.pdf (100%) rename {Resources => data}/lysuite/ly21e_Chords_PickupMeasures.musx (100%) rename {Resources => data}/lysuite/ly21e_Chords_PickupMeasures.xml (100%) rename {Resources => data}/lysuite/ly21e_Chords_PickupMeasures_Finale.pdf (100%) rename {Resources => data}/lysuite/ly21f_Chord_ElementInBetween.musx (100%) rename {Resources => data}/lysuite/ly21f_Chord_ElementInBetween.xml (100%) rename {Resources => data}/lysuite/ly21f_Chord_ElementInBetween_Finale.pdf (100%) rename {Resources => data}/lysuite/ly22a_Noteheads.musx (100%) rename {Resources => data}/lysuite/ly22a_Noteheads.xml (100%) rename {Resources => data}/lysuite/ly22a_Noteheads_Finale.pdf (100%) rename {Resources => data}/lysuite/ly22b_Staff_Notestyles.musx (100%) rename {Resources => data}/lysuite/ly22b_Staff_Notestyles.xml (100%) rename {Resources => data}/lysuite/ly22b_Staff_Notestyles_Finale.pdf (100%) rename {Resources => data}/lysuite/ly22c_Noteheads_Chords.musx (100%) rename {Resources => data}/lysuite/ly22c_Noteheads_Chords.xml (100%) rename {Resources => data}/lysuite/ly22c_Noteheads_Chords_Finale.pdf (100%) rename {Resources => data}/lysuite/ly22d_Parenthesized_Noteheads.musx (100%) rename {Resources => data}/lysuite/ly22d_Parenthesized_Noteheads.xml (100%) rename {Resources => data}/lysuite/ly22d_Parenthesized_Noteheads_Finale.pdf (100%) rename {Resources => data}/lysuite/ly23a_Tuplets.musx (100%) rename {Resources => data}/lysuite/ly23a_Tuplets.xml (100%) rename {Resources => data}/lysuite/ly23a_Tuplets_Finale.pdf (100%) rename {Resources => data}/lysuite/ly23b_Tuplets_Styles.musx (100%) rename {Resources => data}/lysuite/ly23b_Tuplets_Styles.xml (100%) rename {Resources => data}/lysuite/ly23b_Tuplets_Styles_Finale.pdf (100%) rename {Resources => data}/lysuite/ly23c_Tuplet_Display_NonStandard.musx (100%) rename {Resources => data}/lysuite/ly23c_Tuplet_Display_NonStandard.xml (100%) rename {Resources => data}/lysuite/ly23c_Tuplet_Display_NonStandard_Finale.pdf (100%) rename {Resources => data}/lysuite/ly23d_Tuplets_Nested.musx (100%) rename {Resources => data}/lysuite/ly23d_Tuplets_Nested.xml (100%) rename {Resources => data}/lysuite/ly23d_Tuplets_Nested_Finale.pdf (100%) rename {Resources => data}/lysuite/ly23e_Tuplets_Tremolo.musx (100%) rename {Resources => data}/lysuite/ly23e_Tuplets_Tremolo.xml (100%) rename {Resources => data}/lysuite/ly23e_Tuplets_Tremolo_Finale.pdf (100%) rename {Resources => data}/lysuite/ly23f_Tuplets_DurationButNoBracket.musx (100%) rename {Resources => data}/lysuite/ly23f_Tuplets_DurationButNoBracket.xml (100%) rename {Resources => data}/lysuite/ly23f_Tuplets_DurationButNoBracket_Finale.pdf (100%) rename {Resources => data}/lysuite/ly24a_GraceNotes.musx (100%) rename {Resources => data}/lysuite/ly24a_GraceNotes.xml (100%) rename {Resources => data}/lysuite/ly24a_GraceNotes_Finale.pdf (100%) rename {Resources => data}/lysuite/ly24b_ChordAsGraceNote.musx (100%) rename {Resources => data}/lysuite/ly24b_ChordAsGraceNote.xml (100%) rename {Resources => data}/lysuite/ly24b_ChordAsGraceNote_Finale.pdf (100%) rename {Resources => data}/lysuite/ly24c_GraceNote_MeasureEnd.musx (100%) rename {Resources => data}/lysuite/ly24c_GraceNote_MeasureEnd.xml (100%) rename {Resources => data}/lysuite/ly24c_GraceNote_MeasureEnd_Finale.pdf (100%) rename {Resources => data}/lysuite/ly24d_AfterGrace.musx (100%) rename {Resources => data}/lysuite/ly24d_AfterGrace.xml (100%) rename {Resources => data}/lysuite/ly24d_AfterGrace_Finale.pdf (100%) rename {Resources => data}/lysuite/ly24e_GraceNote_StaffChange.musx (100%) rename {Resources => data}/lysuite/ly24e_GraceNote_StaffChange.xml (100%) rename {Resources => data}/lysuite/ly24e_GraceNote_StaffChange_Finale.pdf (100%) rename {Resources => data}/lysuite/ly24f_GraceNote_Slur.musx (100%) rename {Resources => data}/lysuite/ly24f_GraceNote_Slur.xml (100%) rename {Resources => data}/lysuite/ly24f_GraceNote_Slur_Finale.pdf (100%) rename {Resources => data}/lysuite/ly31a_Directions.musx (100%) rename {Resources => data}/lysuite/ly31a_Directions.xml (100%) rename {Resources => data}/lysuite/ly31a_Directions_Finale.pdf (100%) rename {Resources => data}/lysuite/ly31c_MetronomeMarks.musx (100%) rename {Resources => data}/lysuite/ly31c_MetronomeMarks.xml (100%) rename {Resources => data}/lysuite/ly31c_MetronomeMarks_Finale.pdf (100%) rename {Resources => data}/lysuite/ly32a_Notations.musx (100%) rename {Resources => data}/lysuite/ly32a_Notations.xml (100%) rename {Resources => data}/lysuite/ly32a_Notations_Finale.pdf (100%) rename {Resources => data}/lysuite/ly32b_Articulations_Texts.musx (100%) rename {Resources => data}/lysuite/ly32b_Articulations_Texts.xml (100%) rename {Resources => data}/lysuite/ly32b_Articulations_Texts_Finale.pdf (100%) rename {Resources => data}/lysuite/ly32c_MultipleNotationChildren.musx (100%) rename {Resources => data}/lysuite/ly32c_MultipleNotationChildren.xml (100%) rename {Resources => data}/lysuite/ly32c_MultipleNotationChildren_Finale.pdf (100%) rename {Resources => data}/lysuite/ly32d_Arpeggio.musx (100%) rename {Resources => data}/lysuite/ly32d_Arpeggio.xml (100%) rename {Resources => data}/lysuite/ly32d_Arpeggio_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33a_Spanners.musx (100%) rename {Resources => data}/lysuite/ly33a_Spanners.xml (100%) rename {Resources => data}/lysuite/ly33a_Spanners_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33b_Spanners_Tie.musx (100%) rename {Resources => data}/lysuite/ly33b_Spanners_Tie.xml (100%) rename {Resources => data}/lysuite/ly33b_Spanners_Tie_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33c_Spanners_Slurs.musx (100%) rename {Resources => data}/lysuite/ly33c_Spanners_Slurs.xml (100%) rename {Resources => data}/lysuite/ly33c_Spanners_Slurs_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33d_Spanners_OctaveShifts.musx (100%) rename {Resources => data}/lysuite/ly33d_Spanners_OctaveShifts.xml (100%) rename {Resources => data}/lysuite/ly33d_Spanners_OctaveShifts_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.musx (100%) rename {Resources => data}/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.xml (100%) rename {Resources => data}/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33f_Trill_EndingOnGraceNote.musx (100%) rename {Resources => data}/lysuite/ly33f_Trill_EndingOnGraceNote.xml (100%) rename {Resources => data}/lysuite/ly33f_Trill_EndingOnGraceNote_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33g_Slur_ChordedNotes.musx (100%) rename {Resources => data}/lysuite/ly33g_Slur_ChordedNotes.xml (100%) rename {Resources => data}/lysuite/ly33g_Slur_ChordedNotes_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33h_Spanners_Glissando.musx (100%) rename {Resources => data}/lysuite/ly33h_Spanners_Glissando.xml (100%) rename {Resources => data}/lysuite/ly33h_Spanners_Glissando_Finale.pdf (100%) rename {Resources => data}/lysuite/ly33i_Ties_NotEnded.musx (100%) rename {Resources => data}/lysuite/ly33i_Ties_NotEnded.xml (100%) rename {Resources => data}/lysuite/ly33i_Ties_NotEnded_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41a_MultiParts_Partorder.musx (100%) rename {Resources => data}/lysuite/ly41a_MultiParts_Partorder.xml (100%) rename {Resources => data}/lysuite/ly41a_MultiParts_Partorder_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41b_MultiParts_MoreThan10.musx (100%) rename {Resources => data}/lysuite/ly41b_MultiParts_MoreThan10.xml (100%) rename {Resources => data}/lysuite/ly41b_MultiParts_MoreThan10_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41c_StaffGroups.musx (100%) rename {Resources => data}/lysuite/ly41c_StaffGroups.xml (100%) rename {Resources => data}/lysuite/ly41c_StaffGroups_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41d_StaffGroups_Nested.musx (100%) rename {Resources => data}/lysuite/ly41d_StaffGroups_Nested.xml (100%) rename {Resources => data}/lysuite/ly41d_StaffGroups_Nested_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.musx (100%) rename {Resources => data}/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.xml (100%) rename {Resources => data}/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41f_StaffGroups_Overlapping.musx (100%) rename {Resources => data}/lysuite/ly41f_StaffGroups_Overlapping.xml (100%) rename {Resources => data}/lysuite/ly41f_StaffGroups_Overlapping_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41g_PartNoId.musx (100%) rename {Resources => data}/lysuite/ly41g_PartNoId.xml (100%) rename {Resources => data}/lysuite/ly41g_PartNoId_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41h_TooManyParts.musx (100%) rename {Resources => data}/lysuite/ly41h_TooManyParts.xml (100%) rename {Resources => data}/lysuite/ly41h_TooManyParts_Finale.pdf (100%) rename {Resources => data}/lysuite/ly41i_PartNameDisplay_Override.musx (100%) rename {Resources => data}/lysuite/ly41i_PartNameDisplay_Override.xml (100%) rename {Resources => data}/lysuite/ly41i_PartNameDisplay_Override_Finale.pdf (100%) rename {Resources => data}/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.musx (100%) rename {Resources => data}/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.xml (100%) rename {Resources => data}/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics_Finale.pdf (100%) rename {Resources => data}/lysuite/ly42b_MultiVoice_MidMeasureClefChange.musx (100%) rename {Resources => data}/lysuite/ly42b_MultiVoice_MidMeasureClefChange.xml (100%) rename {Resources => data}/lysuite/ly42b_MultiVoice_MidMeasureClefChange_Finale.pdf (100%) rename {Resources => data}/lysuite/ly43a_PianoStaff.musx (100%) rename {Resources => data}/lysuite/ly43a_PianoStaff.xml (100%) rename {Resources => data}/lysuite/ly43a_PianoStaff_Finale.pdf (100%) rename {Resources => data}/lysuite/ly43a_PianoStaff_museScore.pdf (100%) rename {Resources => data}/lysuite/ly43b_MultiStaff_DifferentKeys.musx (100%) rename {Resources => data}/lysuite/ly43b_MultiStaff_DifferentKeys.xml (100%) rename {Resources => data}/lysuite/ly43b_MultiStaff_DifferentKeys_Finale.pdf (100%) rename {Resources => data}/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.musx (100%) rename {Resources => data}/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.xml (100%) rename {Resources => data}/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_Finale.pdf (100%) rename {Resources => data}/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_museScore.pdf (100%) rename {Resources => data}/lysuite/ly43d_MultiStaff_StaffChange.musx (100%) rename {Resources => data}/lysuite/ly43d_MultiStaff_StaffChange.xml (100%) rename {Resources => data}/lysuite/ly43d_MultiStaff_StaffChange_Finale.pdf (100%) rename {Resources => data}/lysuite/ly43d_MultiStaff_StaffChange_museScore.pdf (100%) rename {Resources => data}/lysuite/ly43e_Multistaff_ClefDynamics.dorico (100%) rename {Resources => data}/lysuite/ly43e_Multistaff_ClefDynamics.musx (100%) rename {Resources => data}/lysuite/ly43e_Multistaff_ClefDynamics.xml (100%) rename {Resources => data}/lysuite/ly43e_Multistaff_ClefDynamics_Dorico.pdf (100%) rename {Resources => data}/lysuite/ly43e_Multistaff_ClefDynamics_Finale.pdf (100%) rename {Resources => data}/lysuite/ly43e_Multistaff_ClefDynamics_museScore.pdf (100%) rename {Resources => data}/lysuite/ly45a_SimpleRepeat.musx (100%) rename {Resources => data}/lysuite/ly45a_SimpleRepeat.xml (100%) rename {Resources => data}/lysuite/ly45a_SimpleRepeat_Finale.pdf (100%) rename {Resources => data}/lysuite/ly45b_RepeatWithAlternatives.musx (100%) rename {Resources => data}/lysuite/ly45b_RepeatWithAlternatives.xml (100%) rename {Resources => data}/lysuite/ly45b_RepeatWithAlternatives_Finale.pdf (100%) rename {Resources => data}/lysuite/ly45c_RepeatMultipleTimes.musx (100%) rename {Resources => data}/lysuite/ly45c_RepeatMultipleTimes.xml (100%) rename {Resources => data}/lysuite/ly45c_RepeatMultipleTimes_Finale.pdf (100%) rename {Resources => data}/lysuite/ly45d_Repeats_Nested_Alternatives.musx (100%) rename {Resources => data}/lysuite/ly45d_Repeats_Nested_Alternatives.xml (100%) rename {Resources => data}/lysuite/ly45d_Repeats_Nested_Alternatives_Finale.pdf (100%) rename {Resources => data}/lysuite/ly45e_Repeats_Nested_Alternatives.musx (100%) rename {Resources => data}/lysuite/ly45e_Repeats_Nested_Alternatives.xml (100%) rename {Resources => data}/lysuite/ly45e_Repeats_Nested_Alternatives_Finale.pdf (100%) rename {Resources => data}/lysuite/ly45f_Repeats_InvalidEndings.musx (100%) rename {Resources => data}/lysuite/ly45f_Repeats_InvalidEndings.xml (100%) rename {Resources => data}/lysuite/ly45f_Repeats_InvalidEndings_Finale.pdf (100%) rename {Resources => data}/lysuite/ly45g_Repeats_NotEnded.musx (100%) rename {Resources => data}/lysuite/ly45g_Repeats_NotEnded.xml (100%) rename {Resources => data}/lysuite/ly45g_Repeats_NotEnded_Finale.pdf (100%) rename {Resources => data}/lysuite/ly46a_Barlines.musx (100%) rename {Resources => data}/lysuite/ly46a_Barlines.xml (100%) rename {Resources => data}/lysuite/ly46a_Barlines_Finale.pdf (100%) rename {Resources => data}/lysuite/ly46b_MidmeasureBarline.musx (100%) rename {Resources => data}/lysuite/ly46b_MidmeasureBarline.xml (100%) rename {Resources => data}/lysuite/ly46b_MidmeasureBarline_Finale.pdf (100%) rename {Resources => data}/lysuite/ly46c_Midmeasure_Clef.musx (100%) rename {Resources => data}/lysuite/ly46c_Midmeasure_Clef.xml (100%) rename {Resources => data}/lysuite/ly46c_Midmeasure_Clef_Finale.pdf (100%) rename {Resources => data}/lysuite/ly46d_PickupMeasure_ImplicitMeasures.musx (100%) rename {Resources => data}/lysuite/ly46d_PickupMeasure_ImplicitMeasures.xml (100%) rename {Resources => data}/lysuite/ly46d_PickupMeasure_ImplicitMeasures_Finale.pdf (100%) rename {Resources => data}/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.musx (100%) rename {Resources => data}/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.xml (100%) rename {Resources => data}/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater_Finale.pdf (100%) rename {Resources => data}/lysuite/ly46f_IncompleteMeasures.musx (100%) rename {Resources => data}/lysuite/ly46f_IncompleteMeasures.xml (100%) rename {Resources => data}/lysuite/ly46f_IncompleteMeasures_Finale.pdf (100%) rename {Resources => data}/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.musx (100%) rename {Resources => data}/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.xml (100%) rename {Resources => data}/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass_Finale.pdf (100%) rename {Resources => data}/lysuite/ly51b_Header_Quotes.musx (100%) rename {Resources => data}/lysuite/ly51b_Header_Quotes.xml (100%) rename {Resources => data}/lysuite/ly51b_Header_Quotes_Finale.pdf (100%) rename {Resources => data}/lysuite/ly51c_MultipleRights.musx (100%) rename {Resources => data}/lysuite/ly51c_MultipleRights.xml (100%) rename {Resources => data}/lysuite/ly51c_MultipleRights_Finale.pdf (100%) rename {Resources => data}/lysuite/ly51d_EmptyTitle.musx (100%) rename {Resources => data}/lysuite/ly51d_EmptyTitle.xml (100%) rename {Resources => data}/lysuite/ly51d_EmptyTitle_Finale.pdf (100%) rename {Resources => data}/lysuite/ly52a_PageLayout.musx (100%) rename {Resources => data}/lysuite/ly52a_PageLayout.xml (100%) rename {Resources => data}/lysuite/ly52a_PageLayout_Finale.pdf (100%) rename {Resources => data}/lysuite/ly52b_Breaks.musx (100%) rename {Resources => data}/lysuite/ly52b_Breaks.xml (100%) rename {Resources => data}/lysuite/ly52b_Breaks_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61a_Lyrics.musx (100%) rename {Resources => data}/lysuite/ly61a_Lyrics.xml (100%) rename {Resources => data}/lysuite/ly61a_Lyrics_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61b_MultipleLyrics.musx (100%) rename {Resources => data}/lysuite/ly61b_MultipleLyrics.xml (100%) rename {Resources => data}/lysuite/ly61b_MultipleLyrics_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61c_Lyrics_Pianostaff.musx (100%) rename {Resources => data}/lysuite/ly61c_Lyrics_Pianostaff.xml (100%) rename {Resources => data}/lysuite/ly61c_Lyrics_Pianostaff_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61d_Lyrics_Melisma.musx (100%) rename {Resources => data}/lysuite/ly61d_Lyrics_Melisma.xml (100%) rename {Resources => data}/lysuite/ly61d_Lyrics_Melisma_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61e_Lyrics_Chords.musx (100%) rename {Resources => data}/lysuite/ly61e_Lyrics_Chords.xml (100%) rename {Resources => data}/lysuite/ly61e_Lyrics_Chords_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61f_Lyrics_GracedNotes.musx (100%) rename {Resources => data}/lysuite/ly61f_Lyrics_GracedNotes.xml (100%) rename {Resources => data}/lysuite/ly61f_Lyrics_GracedNotes_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61g_Lyrics_NameNumber.musx (100%) rename {Resources => data}/lysuite/ly61g_Lyrics_NameNumber.xml (100%) rename {Resources => data}/lysuite/ly61g_Lyrics_NameNumber_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61h_Lyrics_BeamsMelismata.musx (100%) rename {Resources => data}/lysuite/ly61h_Lyrics_BeamsMelismata.xml (100%) rename {Resources => data}/lysuite/ly61h_Lyrics_BeamsMelismata_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61i_Lyrics_Chords.musx (100%) rename {Resources => data}/lysuite/ly61i_Lyrics_Chords.xml (100%) rename {Resources => data}/lysuite/ly61i_Lyrics_Chords_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61j_Lyrics_Elisions.musx (100%) rename {Resources => data}/lysuite/ly61j_Lyrics_Elisions.xml (100%) rename {Resources => data}/lysuite/ly61j_Lyrics_Elisions_Finale.pdf (100%) rename {Resources => data}/lysuite/ly61k_Lyrics_SpannersExtenders.musx (100%) rename {Resources => data}/lysuite/ly61k_Lyrics_SpannersExtenders.xml (100%) rename {Resources => data}/lysuite/ly61k_Lyrics_SpannersExtenders_Finale.pdf (100%) rename {Resources => data}/lysuite/ly71a_Chordnames.musx (100%) rename {Resources => data}/lysuite/ly71a_Chordnames.xml (100%) rename {Resources => data}/lysuite/ly71a_Chordnames_Finale.pdf (100%) rename {Resources => data}/lysuite/ly71c_ChordsFrets.musx (100%) rename {Resources => data}/lysuite/ly71c_ChordsFrets.xml (100%) rename {Resources => data}/lysuite/ly71c_ChordsFrets_Finale.pdf (100%) rename {Resources => data}/lysuite/ly71d_ChordsFrets_Multistaff.musx (100%) rename {Resources => data}/lysuite/ly71d_ChordsFrets_Multistaff.xml (100%) rename {Resources => data}/lysuite/ly71d_ChordsFrets_Multistaff_Finale.pdf (100%) rename {Resources => data}/lysuite/ly71e_TabStaves.musx (100%) rename {Resources => data}/lysuite/ly71e_TabStaves.xml (100%) rename {Resources => data}/lysuite/ly71e_TabStaves_Finale.pdf (100%) rename {Resources => data}/lysuite/ly71f_AllChordTypes.musx (100%) rename {Resources => data}/lysuite/ly71f_AllChordTypes.xml (100%) rename {Resources => data}/lysuite/ly71f_AllChordTypes_Finale.pdf (100%) rename {Resources => data}/lysuite/ly71g_MultipleChordnames.musx (100%) rename {Resources => data}/lysuite/ly71g_MultipleChordnames.xml (100%) rename {Resources => data}/lysuite/ly71g_MultipleChordnames_Finale.pdf (100%) rename {Resources => data}/lysuite/ly72a_TransposingInstruments.musx (100%) rename {Resources => data}/lysuite/ly72a_TransposingInstruments.xml (100%) rename {Resources => data}/lysuite/ly72a_TransposingInstruments_Finale.pdf (100%) rename {Resources => data}/lysuite/ly72b_TransposingInstruments_Full.musx (100%) rename {Resources => data}/lysuite/ly72b_TransposingInstruments_Full.xml (100%) rename {Resources => data}/lysuite/ly72b_TransposingInstruments_Full_Finale.pdf (100%) rename {Resources => data}/lysuite/ly72c_TransposingInstruments_Change.musx (100%) rename {Resources => data}/lysuite/ly72c_TransposingInstruments_Change.xml (100%) rename {Resources => data}/lysuite/ly72c_TransposingInstruments_Change_Finale.pdf (100%) rename {Resources => data}/lysuite/ly73a_Percussion.musx (100%) rename {Resources => data}/lysuite/ly73a_Percussion.xml (100%) rename {Resources => data}/lysuite/ly73a_Percussion_Finale.pdf (100%) rename {Resources => data}/lysuite/ly74a_FiguredBass.musx (100%) rename {Resources => data}/lysuite/ly74a_FiguredBass.xml (100%) rename {Resources => data}/lysuite/ly74a_FiguredBass_Finale.pdf (100%) rename {Resources => data}/lysuite/ly75a_AccordionRegistrations.musx (100%) rename {Resources => data}/lysuite/ly75a_AccordionRegistrations.xml (100%) rename {Resources => data}/lysuite/ly75a_AccordionRegistrations_Finale.pdf (100%) rename {Resources => data}/lysuite/ly90a_Compressed_MusicXML.musx (100%) rename {Resources => data}/lysuite/ly90a_Compressed_MusicXML.mxl (100%) rename {Resources => data}/lysuite/ly90a_Compressed_MusicXML_Finale.pdf (100%) rename {Resources => data}/lysuite/ly99a_Sibelius5_IgnoreBeaming.musx (100%) rename {Resources => data}/lysuite/ly99a_Sibelius5_IgnoreBeaming.xml (100%) rename {Resources => data}/lysuite/ly99a_Sibelius5_IgnoreBeaming_Finale.pdf (100%) rename {Resources => data}/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.musx (100%) rename {Resources => data}/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.xml (100%) rename {Resources => data}/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams_Finale.pdf (100%) rename {Resources => data}/mjbsuite/ChordDirectionPlacement.xml (100%) rename {Resources => data}/mjbsuite/FreezingSmall _FinaleRoundtrip.pdf (100%) rename {Resources => data}/mjbsuite/FreezingSmall.musx (100%) rename {Resources => data}/mjbsuite/FreezingSmall.xml (100%) rename {Resources => data}/mjbsuite/FreezingSmall_FinaleOriginal.pdf (100%) rename {Resources => data}/mjbsuite/HasMusicXmlVersionFalse.xml (100%) rename {Resources => data}/mjbsuite/HasMusicXmlVersionTrue.xml (100%) rename {Resources => data}/mjbsuite/OctoberXML.musx (100%) rename {Resources => data}/mjbsuite/OctoberXML.xml (100%) rename {Resources => data}/mjbsuite/OctoberXML_FinaleOriginal.pdf (100%) rename {Resources => data}/mjbsuite/OctoberXML_FinaleRoundtrip.pdf (100%) rename {Resources => data}/mjbsuite/PreserveTimeModificationNormalType.xml (100%) rename {Resources => data}/mjbsuite/chords_simple.xml (100%) rename {Resources => data}/mjbsuite/ezinar.xml (100%) rename {Resources => data}/mjbsuite/freezing.old.xml (100%) rename {Resources => data}/mjbsuite/freezing.xml (100%) rename {Resources => data}/mjbsuite/hello_timewise.xml (100%) rename {Resources => data}/mjbsuite/krz_v40.musx (100%) rename {Resources => data}/mjbsuite/krz_v40.xml (100%) rename {Resources => data}/mjbsuite/krz_v40_FinaleOriginal.pdf (100%) rename {Resources => data}/mjbsuite/krz_v40_FinaleRoundtrip.pdf (100%) rename {Resources => data}/mjbsuite/lyre_timewise.xml (100%) rename {Resources => data}/mjbsuite/processing_instructions.xml (100%) rename {Resources => data}/musuite/A_Walk_through_the_Park.license (100%) rename {Resources => data}/musuite/A_Walk_through_the_Park.xml (100%) rename {Resources => data}/musuite/different_keysigs_1.xml (100%) rename {Resources => data}/musuite/different_keysigs_2.xml (100%) rename {Resources => data}/musuite/test98.xml (100%) rename {Resources => data}/musuite/testAccidentals1.pdf (100%) rename {Resources => data}/musuite/testAccidentals1.xml (100%) rename {Resources => data}/musuite/testAccidentals2.pdf (100%) rename {Resources => data}/musuite/testAccidentals2.xml (100%) rename {Resources => data}/musuite/testArpGliss1.pdf (100%) rename {Resources => data}/musuite/testArpGliss1.xml (100%) rename {Resources => data}/musuite/testArpGliss2.pdf (100%) rename {Resources => data}/musuite/testArpGliss2.xml (100%) rename {Resources => data}/musuite/testBarStyles.pdf (100%) rename {Resources => data}/musuite/testBarStyles.xml (100%) rename {Resources => data}/musuite/testChord.pdf (100%) rename {Resources => data}/musuite/testChord.xml (100%) rename {Resources => data}/musuite/testChordDiagrams1.xml (100%) rename {Resources => data}/musuite/testChordNoVoice.pdf (100%) rename {Resources => data}/musuite/testChordNoVoice.xml (100%) rename {Resources => data}/musuite/testChordNoVoice_ref.xml (100%) rename {Resources => data}/musuite/testClefs1.pdf (100%) rename {Resources => data}/musuite/testClefs1.xml (100%) rename {Resources => data}/musuite/testCompleteMeasureRests.xml (100%) rename {Resources => data}/musuite/testDCalCoda.pdf (100%) rename {Resources => data}/musuite/testDCalCoda.xml (100%) rename {Resources => data}/musuite/testDCalFine.pdf (100%) rename {Resources => data}/musuite/testDCalFine.xml (100%) rename {Resources => data}/musuite/testDalSegno.pdf (100%) rename {Resources => data}/musuite/testDalSegno.xml (100%) rename {Resources => data}/musuite/testDirections1.pdf (100%) rename {Resources => data}/musuite/testDirections1.xml (100%) rename {Resources => data}/musuite/testDrumset1.pdf (100%) rename {Resources => data}/musuite/testDrumset1.xml (100%) rename {Resources => data}/musuite/testDrumset2.pdf (100%) rename {Resources => data}/musuite/testDrumset2.xml (100%) rename {Resources => data}/musuite/testDurationRoundingError.xml (100%) rename {Resources => data}/musuite/testDurationRoundingError_ref.xml (100%) rename {Resources => data}/musuite/testDynamics1.pdf (100%) rename {Resources => data}/musuite/testDynamics1.xml (100%) rename {Resources => data}/musuite/testDynamics2.pdf (100%) rename {Resources => data}/musuite/testDynamics2.xml (100%) rename {Resources => data}/musuite/testDynamics3.pdf (100%) rename {Resources => data}/musuite/testDynamics3.xml (100%) rename {Resources => data}/musuite/testDynamics3_ref.xml (100%) rename {Resources => data}/musuite/testEmptyMeasure.xml (100%) rename {Resources => data}/musuite/testEmptyMeasure_ref.xml (100%) rename {Resources => data}/musuite/testEmptyVoice1.xml (100%) rename {Resources => data}/musuite/testEmptyVoice1_ref.xml (100%) rename {Resources => data}/musuite/testFiguredBass1.xml (100%) rename {Resources => data}/musuite/testFiguredBass2.xml (100%) rename {Resources => data}/musuite/testGrace1.pdf (100%) rename {Resources => data}/musuite/testGrace1.xml (100%) rename {Resources => data}/musuite/testGrace2.pdf (100%) rename {Resources => data}/musuite/testGrace2.xml (100%) rename {Resources => data}/musuite/testHarmony1.xml (100%) rename {Resources => data}/musuite/testHarmony2.xml (100%) rename {Resources => data}/musuite/testHarmony3.xml (100%) rename {Resources => data}/musuite/testHello.pdf (100%) rename {Resources => data}/musuite/testHello.xml (100%) rename {Resources => data}/musuite/testImplicitMeasure1.pdf (100%) rename {Resources => data}/musuite/testImplicitMeasure1.xml (100%) rename {Resources => data}/musuite/testInvalid.xml (100%) rename {Resources => data}/musuite/testInvisibleElements.xml (100%) rename {Resources => data}/musuite/testKeysig1.pdf (100%) rename {Resources => data}/musuite/testKeysig1.xml (100%) rename {Resources => data}/musuite/testLineBreaks.xml (100%) rename {Resources => data}/musuite/testLines1.pdf (100%) rename {Resources => data}/musuite/testLines1.xml (100%) rename {Resources => data}/musuite/testLines1_ref.xml (100%) rename {Resources => data}/musuite/testLines2.pdf (100%) rename {Resources => data}/musuite/testLines2.xml (100%) rename {Resources => data}/musuite/testLines2_ref.xml (100%) rename {Resources => data}/musuite/testLyricsVoice2a.xml (100%) rename {Resources => data}/musuite/testLyricsVoice2b.xml (100%) rename {Resources => data}/musuite/testLyricsVoice2b_ref.xml (100%) rename {Resources => data}/musuite/testManualBreaks.xml (100%) rename {Resources => data}/musuite/testMeasureLength.xml (100%) rename {Resources => data}/musuite/testMeasureLength_ref.xml (100%) rename {Resources => data}/musuite/testMetaData.xml (100%) rename {Resources => data}/musuite/testMultiMeasureRest1.pdf (100%) rename {Resources => data}/musuite/testMultiMeasureRest1.xml (100%) rename {Resources => data}/musuite/testMultiMeasureRest1_ref.xml (100%) rename {Resources => data}/musuite/testMultiMeasureRest2.xml (100%) rename {Resources => data}/musuite/testMultiMeasureRest2_ref.xml (100%) rename {Resources => data}/musuite/testMultiMeasureRest3.xml (100%) rename {Resources => data}/musuite/testMultiMeasureRest3_ref.xml (100%) rename {Resources => data}/musuite/testMultipleNotations.xml (100%) rename {Resources => data}/musuite/testMultipleNotations_ref.xml (100%) rename {Resources => data}/musuite/testNonUniqueThings.xml (100%) rename {Resources => data}/musuite/testNonUniqueThings_ref.xml (100%) rename {Resources => data}/musuite/testNoteAttributes1.pdf (100%) rename {Resources => data}/musuite/testNoteAttributes1.xml (100%) rename {Resources => data}/musuite/testNoteAttributes2.pdf (100%) rename {Resources => data}/musuite/testNoteAttributes2.xml (100%) rename {Resources => data}/musuite/testNoteAttributes2_ref.xml (100%) rename {Resources => data}/musuite/testNoteAttributes3.xml (100%) rename {Resources => data}/musuite/testNoteheads.xml (100%) rename {Resources => data}/musuite/testNotesRests1.pdf (100%) rename {Resources => data}/musuite/testNotesRests1.xml (100%) rename {Resources => data}/musuite/testNotesRests2.xml (100%) rename {Resources => data}/musuite/testNumberedLyrics.xml (100%) rename {Resources => data}/musuite/testNumberedLyrics_ref.xml (100%) rename {Resources => data}/musuite/testPartsSpecialCases.xml (100%) rename {Resources => data}/musuite/testPartsSpecialCases_ref.xml (100%) rename {Resources => data}/musuite/testPiano.xml (100%) rename {Resources => data}/musuite/testRestsNoType.xml (100%) rename {Resources => data}/musuite/testRestsNoType_ref.xml (100%) rename {Resources => data}/musuite/testSlurs.pdf (100%) rename {Resources => data}/musuite/testSlurs.xml (100%) rename {Resources => data}/musuite/testStaffTwoKeySigs.xml (100%) rename {Resources => data}/musuite/testStringVoiceName.xml (100%) rename {Resources => data}/musuite/testStringVoiceName_ref.xml (100%) rename {Resources => data}/musuite/testSystemBrackets1.pdf (100%) rename {Resources => data}/musuite/testSystemBrackets1.xml (100%) rename {Resources => data}/musuite/testSystemBrackets2.pdf (100%) rename {Resources => data}/musuite/testSystemBrackets2.xml (100%) rename {Resources => data}/musuite/testTablature1.pdf (100%) rename {Resources => data}/musuite/testTablature1.xml (100%) rename {Resources => data}/musuite/testTablature2.pdf (100%) rename {Resources => data}/musuite/testTablature2.xml (100%) rename {Resources => data}/musuite/testTablature3.pdf (100%) rename {Resources => data}/musuite/testTablature3.xml (100%) rename {Resources => data}/musuite/testTempo1.xml (100%) rename {Resources => data}/musuite/testTimesig1.pdf (100%) rename {Resources => data}/musuite/testTimesig1.xml (100%) rename {Resources => data}/musuite/testTimesig3.pdf (100%) rename {Resources => data}/musuite/testTimesig3.xml (100%) rename {Resources => data}/musuite/testTremolo.xml (100%) rename {Resources => data}/musuite/testTuplets1.xml (100%) rename {Resources => data}/musuite/testTuplets1_ref.xml (100%) rename {Resources => data}/musuite/testTuplets2.xml (100%) rename {Resources => data}/musuite/testTuplets2_ref.xml (100%) rename {Resources => data}/musuite/testTuplets3.xml (100%) rename {Resources => data}/musuite/testTuplets3_ref.xml (100%) rename {Resources => data}/musuite/testTuplets4.xml (100%) rename {Resources => data}/musuite/testUnusualDurations.xml (100%) rename {Resources => data}/musuite/testUnusualDurations_ref.xml (100%) rename {Resources => data}/musuite/testVoiceMapper1.xml (100%) rename {Resources => data}/musuite/testVoiceMapper1_ref.xml (100%) rename {Resources => data}/musuite/testVoiceMapper2.xml (100%) rename {Resources => data}/musuite/testVoiceMapper2_ref.xml (100%) rename {Resources => data}/musuite/testVoiceMapper3.xml (100%) rename {Resources => data}/musuite/testVoiceMapper3_ref.xml (100%) rename {Resources => data}/musuite/testVoicePiano1.pdf (100%) rename {Resources => data}/musuite/testVoicePiano1.xml (100%) rename {Resources => data}/musuite/testVolta1.xml (100%) rename {Resources => data}/musuite/testWedge1.xml (100%) rename {Resources => data}/musuite/testWedge2.xml (100%) rename {Resources => data}/musuite/testWedge2_ref.xml (100%) rename {Resources => data}/musuite/testWords1.pdf (100%) rename {Resources => data}/musuite/testWords1.xml (100%) rename {Resources => data}/musuite/test_harmony.xml (100%) rename {Resources => data}/mxl/Dichterliebe01.mxl (100%) rename {Resources => data}/recsuite/ActorPreludeSample.mxl (100%) rename {Resources => data}/recsuite/ActorPreludeSample.pdf (100%) rename {Resources => data}/recsuite/ActorPreludeSample.xml (100%) rename {Resources => data}/recsuite/BeetAnGeSample.mxl (100%) rename {Resources => data}/recsuite/BeetAnGeSample.pdf (100%) rename {Resources => data}/recsuite/BeetAnGeSample.xml (100%) rename {Resources => data}/recsuite/Binchois.mxl (100%) rename {Resources => data}/recsuite/Binchois.png (100%) rename {Resources => data}/recsuite/Binchois.xml (100%) rename {Resources => data}/recsuite/BrahWiMeSample.mxl (100%) rename {Resources => data}/recsuite/BrahWiMeSample.pdf (100%) rename {Resources => data}/recsuite/BrahWiMeSample.xml (100%) rename {Resources => data}/recsuite/BrookeWestSample.mxl (100%) rename {Resources => data}/recsuite/BrookeWestSample.pdf (100%) rename {Resources => data}/recsuite/BrookeWestSample.xml (100%) rename {Resources => data}/recsuite/Chant.mxl (100%) rename {Resources => data}/recsuite/Chant.png (100%) rename {Resources => data}/recsuite/Chant.xml (100%) rename {Resources => data}/recsuite/DebuMandSample.mxl (100%) rename {Resources => data}/recsuite/DebuMandSample.pdf (100%) rename {Resources => data}/recsuite/DebuMandSample.xml (100%) rename {Resources => data}/recsuite/Dichterliebe01.mxl (100%) rename {Resources => data}/recsuite/Dichterliebe01.pdf (100%) rename {Resources => data}/recsuite/Dichterliebe01.xml (100%) rename {Resources => data}/recsuite/Echigo_Jishi.mxl (100%) rename {Resources => data}/recsuite/Echigo_Jishi.pdf (100%) rename {Resources => data}/recsuite/Echigo_Jishi.xml (100%) rename {Resources => data}/recsuite/FaurReveSample.mxl (100%) rename {Resources => data}/recsuite/FaurReveSample.pdf (100%) rename {Resources => data}/recsuite/FaurReveSample.xml (100%) rename {Resources => data}/recsuite/MahlFaGe4Sample.mxl (100%) rename {Resources => data}/recsuite/MahlFaGe4Sample.pdf (100%) rename {Resources => data}/recsuite/MahlFaGe4Sample.xml (100%) rename {Resources => data}/recsuite/MozaChloSample.mxl (100%) rename {Resources => data}/recsuite/MozaChloSample.pdf (100%) rename {Resources => data}/recsuite/MozaChloSample.xml (100%) rename {Resources => data}/recsuite/MozaChloSample2.xml (100%) rename {Resources => data}/recsuite/MozaVeilSample.mxl (100%) rename {Resources => data}/recsuite/MozaVeilSample.pdf (100%) rename {Resources => data}/recsuite/MozaVeilSample.xml (100%) rename {Resources => data}/recsuite/MozartPianoSonata.mxl (100%) rename {Resources => data}/recsuite/MozartPianoSonata.png (100%) rename {Resources => data}/recsuite/MozartPianoSonata.xml (100%) rename {Resources => data}/recsuite/MozartTrio.mxl (100%) rename {Resources => data}/recsuite/MozartTrio.png (100%) rename {Resources => data}/recsuite/MozartTrio.xml (100%) rename {Resources => data}/recsuite/NonUtf8Files.txt (100%) rename {Resources => data}/recsuite/Saltarello.mxl (100%) rename {Resources => data}/recsuite/Saltarello.png (100%) rename {Resources => data}/recsuite/Saltarello.xml (100%) rename {Resources => data}/recsuite/SchbAvMaSample.mxl (100%) rename {Resources => data}/recsuite/SchbAvMaSample.pdf (100%) rename {Resources => data}/recsuite/SchbAvMaSample.xml (100%) rename {Resources => data}/recsuite/Telemann.mxl (100%) rename {Resources => data}/recsuite/Telemann.png (100%) rename {Resources => data}/recsuite/Telemann.xml (100%) rename {Resources => data}/smufl/glyphnames.json (100%) rename {Resources => data}/testOutput/.gitignore (100%) diff --git a/AGENTS.md b/AGENTS.md index a00751709..873a91888 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,7 +20,7 @@ Key paths in this repository: - `Sourcecode/private/cpul/` — Catch-based unit-test harness and test runner main - `gen/version-b/` — Rust tool that generates the core element classes from the MusicXML XSD - `gen/version-b/src/` — Generator source: XSD parsing, model, and C++ emission -- `Resources/` — MusicXML input files and expected-output suites for round-trip tests +- `data/` — MusicXML input files and expected-output suites for round-trip tests - `docs/` — MusicXML XSD specifications and developer notes - `DevScripts/` — Ruby and shell scripts for one-off code maintenance - `CMakeLists.txt` — CMake build configuration diff --git a/CHANGELOG.md b/CHANGELOG.md index 44ccc2db6..6d52def05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -176,16 +176,16 @@ items to do on the ximport feature are with most "round-trip" integration tests passing. **Historical Note: June 27, 2016:** An "integration" tester has been added to the MxTest executable. -This exists in ImportTest.cpp, and ImportTestImpl.h/cpp. A top level directory "Resources" has been +This exists in ImportTest.cpp, and ImportTestImpl.h/cpp. A top level directory "data" has been added to hold test input (i.e. "golden") files. The input files are gathered from Recordare, Lilypond and MuseScore and to this I have added a few of my own scores as exported by Finale Dolet. Each of these test input files has been "scrubbed" using the XDoc classes (i.e. it has been round-tripped through pugixml and has been updated to a normalized MusicXML 3.0 header format. The -resultant scrubbed files are in Resources/expected. During the test run, a csv file is written in -Resources/testOutput recording a row for each test (Pass/Fail, duration of test, messages, etc). +resultant scrubbed files are in data/expected. During the test run, a csv file is written in +data/testOutput recording a row for each test (Pass/Fail, duration of test, messages, etc). Each time a test failure is encountered the expected file and the error file will be saved to the -Resources/testOutput directory to allow for visual inspection. +data/testOutput directory to allow for visual inspection. Currently this tester is a "wire-up". All 263 of these round-trip import/export tests fail because the implementation does not yet exist in mx::core. The next body of work will be the mx::core diff --git a/DevScripts/smuflHeader.rb b/DevScripts/smuflHeader.rb index 6f34dc4fd..266cb5275 100644 --- a/DevScripts/smuflHeader.rb +++ b/DevScripts/smuflHeader.rb @@ -1,7 +1,7 @@ require 'json' require 'stringio' -j = JSON.parse( IO.read("../Resources/S-M-U-F-L/glyphnames.json")) +j = JSON.parse( IO.read("../data/smufl/glyphnames.json")) content = StringIO.new diff --git a/Resources/custom/musescore-slur-start-stop.musicxml b/data/custom/musescore-slur-start-stop.musicxml similarity index 100% rename from Resources/custom/musescore-slur-start-stop.musicxml rename to data/custom/musescore-slur-start-stop.musicxml diff --git a/Resources/custom/systems-and-pages-original.musx b/data/custom/systems-and-pages-original.musx similarity index 100% rename from Resources/custom/systems-and-pages-original.musx rename to data/custom/systems-and-pages-original.musx diff --git a/Resources/custom/systems-and-pages.xml b/data/custom/systems-and-pages.xml similarity index 100% rename from Resources/custom/systems-and-pages.xml rename to data/custom/systems-and-pages.xml diff --git a/Resources/custom/transposition.musicxml b/data/custom/transposition.musicxml similarity index 100% rename from Resources/custom/transposition.musicxml rename to data/custom/transposition.musicxml diff --git a/Resources/expected/.gitignore b/data/expected/.gitignore similarity index 100% rename from Resources/expected/.gitignore rename to data/expected/.gitignore diff --git a/Resources/foundsuite/12 Horn Duets.xml b/data/foundsuite/12 Horn Duets.xml similarity index 100% rename from Resources/foundsuite/12 Horn Duets.xml rename to data/foundsuite/12 Horn Duets.xml diff --git a/Resources/foundsuite/12 Horn Duets.zip b/data/foundsuite/12 Horn Duets.zip similarity index 100% rename from Resources/foundsuite/12 Horn Duets.zip rename to data/foundsuite/12 Horn Duets.zip diff --git a/Resources/foundsuite/15Inventions.zip b/data/foundsuite/15Inventions.zip similarity index 100% rename from Resources/foundsuite/15Inventions.zip rename to data/foundsuite/15Inventions.zip diff --git a/Resources/foundsuite/ARBEAU Belle qui tiens ma vie.xml b/data/foundsuite/ARBEAU Belle qui tiens ma vie.xml similarity index 100% rename from Resources/foundsuite/ARBEAU Belle qui tiens ma vie.xml rename to data/foundsuite/ARBEAU Belle qui tiens ma vie.xml diff --git a/Resources/foundsuite/Adagio and Fugue in C minor, K.546.xml b/data/foundsuite/Adagio and Fugue in C minor, K.546.xml similarity index 100% rename from Resources/foundsuite/Adagio and Fugue in C minor, K.546.xml rename to data/foundsuite/Adagio and Fugue in C minor, K.546.xml diff --git a/Resources/foundsuite/Adagio and Fugue in C minor, K.546.zip b/data/foundsuite/Adagio and Fugue in C minor, K.546.zip similarity index 100% rename from Resources/foundsuite/Adagio and Fugue in C minor, K.546.zip rename to data/foundsuite/Adagio and Fugue in C minor, K.546.zip diff --git a/Resources/foundsuite/An Chloe.xml b/data/foundsuite/An Chloe.xml similarity index 100% rename from Resources/foundsuite/An Chloe.xml rename to data/foundsuite/An Chloe.xml diff --git a/Resources/foundsuite/Berlioz_Le_Corsaire.xml b/data/foundsuite/Berlioz_Le_Corsaire.xml similarity index 100% rename from Resources/foundsuite/Berlioz_Le_Corsaire.xml rename to data/foundsuite/Berlioz_Le_Corsaire.xml diff --git a/Resources/foundsuite/Berlioz_Le_Corsaire_Finale.pdf b/data/foundsuite/Berlioz_Le_Corsaire_Finale.pdf similarity index 100% rename from Resources/foundsuite/Berlioz_Le_Corsaire_Finale.pdf rename to data/foundsuite/Berlioz_Le_Corsaire_Finale.pdf diff --git a/Resources/foundsuite/Black Note Study Op 10 no 5.xml b/data/foundsuite/Black Note Study Op 10 no 5.xml similarity index 100% rename from Resources/foundsuite/Black Note Study Op 10 no 5.xml rename to data/foundsuite/Black Note Study Op 10 no 5.xml diff --git a/Resources/foundsuite/Deutscher Tanz D.820.1.xml b/data/foundsuite/Deutscher Tanz D.820.1.xml similarity index 100% rename from Resources/foundsuite/Deutscher Tanz D.820.1.xml rename to data/foundsuite/Deutscher Tanz D.820.1.xml diff --git a/Resources/foundsuite/Deutscher Tanz D.820.1.zip b/data/foundsuite/Deutscher Tanz D.820.1.zip similarity index 100% rename from Resources/foundsuite/Deutscher Tanz D.820.1.zip rename to data/foundsuite/Deutscher Tanz D.820.1.zip diff --git a/Resources/foundsuite/IMSLP198109-WIMA.4fb5-PezR44-xml.zip b/data/foundsuite/IMSLP198109-WIMA.4fb5-PezR44-xml.zip similarity index 100% rename from Resources/foundsuite/IMSLP198109-WIMA.4fb5-PezR44-xml.zip rename to data/foundsuite/IMSLP198109-WIMA.4fb5-PezR44-xml.zip diff --git a/Resources/foundsuite/IMSLP273708-PMLP444363-PepAir.zip b/data/foundsuite/IMSLP273708-PMLP444363-PepAir.zip similarity index 100% rename from Resources/foundsuite/IMSLP273708-PMLP444363-PepAir.zip rename to data/foundsuite/IMSLP273708-PMLP444363-PepAir.zip diff --git a/Resources/foundsuite/IMSLP381263-PMLP615890-RonCLun.zip b/data/foundsuite/IMSLP381263-PMLP615890-RonCLun.zip similarity index 100% rename from Resources/foundsuite/IMSLP381263-PMLP615890-RonCLun.zip rename to data/foundsuite/IMSLP381263-PMLP615890-RonCLun.zip diff --git a/Resources/foundsuite/Invention 1.xml b/data/foundsuite/Invention 1.xml similarity index 100% rename from Resources/foundsuite/Invention 1.xml rename to data/foundsuite/Invention 1.xml diff --git a/Resources/foundsuite/Invention 2.xml b/data/foundsuite/Invention 2.xml similarity index 100% rename from Resources/foundsuite/Invention 2.xml rename to data/foundsuite/Invention 2.xml diff --git a/Resources/foundsuite/Invention 3.xml b/data/foundsuite/Invention 3.xml similarity index 100% rename from Resources/foundsuite/Invention 3.xml rename to data/foundsuite/Invention 3.xml diff --git a/Resources/foundsuite/Invention_10.xml b/data/foundsuite/Invention_10.xml similarity index 100% rename from Resources/foundsuite/Invention_10.xml rename to data/foundsuite/Invention_10.xml diff --git a/Resources/foundsuite/Invention_11.xml b/data/foundsuite/Invention_11.xml similarity index 100% rename from Resources/foundsuite/Invention_11.xml rename to data/foundsuite/Invention_11.xml diff --git a/Resources/foundsuite/Invention_12.xml b/data/foundsuite/Invention_12.xml similarity index 100% rename from Resources/foundsuite/Invention_12.xml rename to data/foundsuite/Invention_12.xml diff --git a/Resources/foundsuite/Invention_13.xml b/data/foundsuite/Invention_13.xml similarity index 100% rename from Resources/foundsuite/Invention_13.xml rename to data/foundsuite/Invention_13.xml diff --git a/Resources/foundsuite/Invention_14.xml b/data/foundsuite/Invention_14.xml similarity index 100% rename from Resources/foundsuite/Invention_14.xml rename to data/foundsuite/Invention_14.xml diff --git a/Resources/foundsuite/Invention_15.xml b/data/foundsuite/Invention_15.xml similarity index 100% rename from Resources/foundsuite/Invention_15.xml rename to data/foundsuite/Invention_15.xml diff --git a/Resources/foundsuite/Invention_4.xml b/data/foundsuite/Invention_4.xml similarity index 100% rename from Resources/foundsuite/Invention_4.xml rename to data/foundsuite/Invention_4.xml diff --git a/Resources/foundsuite/Invention_5.xml b/data/foundsuite/Invention_5.xml similarity index 100% rename from Resources/foundsuite/Invention_5.xml rename to data/foundsuite/Invention_5.xml diff --git a/Resources/foundsuite/Invention_6.xml b/data/foundsuite/Invention_6.xml similarity index 100% rename from Resources/foundsuite/Invention_6.xml rename to data/foundsuite/Invention_6.xml diff --git a/Resources/foundsuite/Invention_7.xml b/data/foundsuite/Invention_7.xml similarity index 100% rename from Resources/foundsuite/Invention_7.xml rename to data/foundsuite/Invention_7.xml diff --git a/Resources/foundsuite/Invention_8.xml b/data/foundsuite/Invention_8.xml similarity index 100% rename from Resources/foundsuite/Invention_8.xml rename to data/foundsuite/Invention_8.xml diff --git a/Resources/foundsuite/Invention_9.xml b/data/foundsuite/Invention_9.xml similarity index 100% rename from Resources/foundsuite/Invention_9.xml rename to data/foundsuite/Invention_9.xml diff --git a/Resources/foundsuite/Moments Musicaux Op16 No4.xml b/data/foundsuite/Moments Musicaux Op16 No4.xml similarity index 100% rename from Resources/foundsuite/Moments Musicaux Op16 No4.xml rename to data/foundsuite/Moments Musicaux Op16 No4.xml diff --git a/Resources/foundsuite/O_Holy_Night-Adam-1871.xml b/data/foundsuite/O_Holy_Night-Adam-1871.xml similarity index 100% rename from Resources/foundsuite/O_Holy_Night-Adam-1871.xml rename to data/foundsuite/O_Holy_Night-Adam-1871.xml diff --git a/Resources/foundsuite/O_Holy_Night-Adam-1974.xml b/data/foundsuite/O_Holy_Night-Adam-1974.xml similarity index 100% rename from Resources/foundsuite/O_Holy_Night-Adam-1974.xml rename to data/foundsuite/O_Holy_Night-Adam-1974.xml diff --git a/Resources/foundsuite/O_Holy_Night.xml b/data/foundsuite/O_Holy_Night.xml similarity index 100% rename from Resources/foundsuite/O_Holy_Night.xml rename to data/foundsuite/O_Holy_Night.xml diff --git a/Resources/foundsuite/PepAiraSco.xml b/data/foundsuite/PepAiraSco.xml similarity index 100% rename from Resources/foundsuite/PepAiraSco.xml rename to data/foundsuite/PepAiraSco.xml diff --git a/Resources/foundsuite/PezR44Sco.xml b/data/foundsuite/PezR44Sco.xml similarity index 100% rename from Resources/foundsuite/PezR44Sco.xml rename to data/foundsuite/PezR44Sco.xml diff --git a/Resources/foundsuite/Rimsky-Korsakov Op11 No4.xml b/data/foundsuite/Rimsky-Korsakov Op11 No4.xml similarity index 100% rename from Resources/foundsuite/Rimsky-Korsakov Op11 No4.xml rename to data/foundsuite/Rimsky-Korsakov Op11 No4.xml diff --git a/Resources/foundsuite/RonCLunSco.xml b/data/foundsuite/RonCLunSco.xml similarity index 100% rename from Resources/foundsuite/RonCLunSco.xml rename to data/foundsuite/RonCLunSco.xml diff --git a/Resources/foundsuite/SCHUBERT An die Sonne.xml b/data/foundsuite/SCHUBERT An die Sonne.xml similarity index 100% rename from Resources/foundsuite/SCHUBERT An die Sonne.xml rename to data/foundsuite/SCHUBERT An die Sonne.xml diff --git a/Resources/foundsuite/Schubert_der_Mueller.xml b/data/foundsuite/Schubert_der_Mueller.xml similarity index 100% rename from Resources/foundsuite/Schubert_der_Mueller.xml rename to data/foundsuite/Schubert_der_Mueller.xml diff --git a/Resources/foundsuite/Schubert_der_Mueller_Finale.pdf b/data/foundsuite/Schubert_der_Mueller_Finale.pdf similarity index 100% rename from Resources/foundsuite/Schubert_der_Mueller_Finale.pdf rename to data/foundsuite/Schubert_der_Mueller_Finale.pdf diff --git a/Resources/foundsuite/Schubert_der_Mueller_License.txt b/data/foundsuite/Schubert_der_Mueller_License.txt similarity index 100% rename from Resources/foundsuite/Schubert_der_Mueller_License.txt rename to data/foundsuite/Schubert_der_Mueller_License.txt diff --git a/Resources/foundsuite/Schubert_der_Mueller_MuseScore.pdf b/data/foundsuite/Schubert_der_Mueller_MuseScore.pdf similarity index 100% rename from Resources/foundsuite/Schubert_der_Mueller_MuseScore.pdf rename to data/foundsuite/Schubert_der_Mueller_MuseScore.pdf diff --git a/Resources/foundsuite/Schubert_der_Mueller_Notion.pdf b/data/foundsuite/Schubert_der_Mueller_Notion.pdf similarity index 100% rename from Resources/foundsuite/Schubert_der_Mueller_Notion.pdf rename to data/foundsuite/Schubert_der_Mueller_Notion.pdf diff --git a/Resources/foundsuite/Schubert_der_Mueller_Sibelius.pdf b/data/foundsuite/Schubert_der_Mueller_Sibelius.pdf similarity index 100% rename from Resources/foundsuite/Schubert_der_Mueller_Sibelius.pdf rename to data/foundsuite/Schubert_der_Mueller_Sibelius.pdf diff --git a/Resources/foundsuite/Silent_Night-Hartwig.xml b/data/foundsuite/Silent_Night-Hartwig.xml similarity index 100% rename from Resources/foundsuite/Silent_Night-Hartwig.xml rename to data/foundsuite/Silent_Night-Hartwig.xml diff --git a/Resources/foundsuite/Silent_Night_Young_1.xml b/data/foundsuite/Silent_Night_Young_1.xml similarity index 100% rename from Resources/foundsuite/Silent_Night_Young_1.xml rename to data/foundsuite/Silent_Night_Young_1.xml diff --git "a/Resources/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.xml" "b/data/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.xml" similarity index 100% rename from "Resources/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.xml" rename to "data/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.xml" diff --git "a/Resources/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.zip" "b/data/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.zip" similarity index 100% rename from "Resources/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.zip" rename to "data/foundsuite/\316\221\317\200\317\204\316\254\316\273\316\271\316\272\316\277.zip" diff --git a/Resources/generalxml/fake.xml b/data/generalxml/fake.xml similarity index 100% rename from Resources/generalxml/fake.xml rename to data/generalxml/fake.xml diff --git a/Resources/ksuite/Bombe.musx b/data/ksuite/Bombe.musx similarity index 100% rename from Resources/ksuite/Bombe.musx rename to data/ksuite/Bombe.musx diff --git a/Resources/ksuite/Bombe.xml b/data/ksuite/Bombe.xml similarity index 100% rename from Resources/ksuite/Bombe.xml rename to data/ksuite/Bombe.xml diff --git a/Resources/ksuite/Bombe_Finale.pdf b/data/ksuite/Bombe_Finale.pdf similarity index 100% rename from Resources/ksuite/Bombe_Finale.pdf rename to data/ksuite/Bombe_Finale.pdf diff --git a/Resources/ksuite/k001a_Articulations _Sibelius.pdf b/data/ksuite/k001a_Articulations _Sibelius.pdf similarity index 100% rename from Resources/ksuite/k001a_Articulations _Sibelius.pdf rename to data/ksuite/k001a_Articulations _Sibelius.pdf diff --git a/Resources/ksuite/k001a_Articulations.xml b/data/ksuite/k001a_Articulations.xml similarity index 100% rename from Resources/ksuite/k001a_Articulations.xml rename to data/ksuite/k001a_Articulations.xml diff --git a/Resources/ksuite/k001a_Articulations_Finale.pdf b/data/ksuite/k001a_Articulations_Finale.pdf similarity index 100% rename from Resources/ksuite/k001a_Articulations_Finale.pdf rename to data/ksuite/k001a_Articulations_Finale.pdf diff --git a/Resources/ksuite/k001a_Articulations_MuseScore.pdf b/data/ksuite/k001a_Articulations_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k001a_Articulations_MuseScore.pdf rename to data/ksuite/k001a_Articulations_MuseScore.pdf diff --git a/Resources/ksuite/k001b_Articulations_Above.xml b/data/ksuite/k001b_Articulations_Above.xml similarity index 100% rename from Resources/ksuite/k001b_Articulations_Above.xml rename to data/ksuite/k001b_Articulations_Above.xml diff --git a/Resources/ksuite/k001b_Articulations_Above_Finale.pdf b/data/ksuite/k001b_Articulations_Above_Finale.pdf similarity index 100% rename from Resources/ksuite/k001b_Articulations_Above_Finale.pdf rename to data/ksuite/k001b_Articulations_Above_Finale.pdf diff --git a/Resources/ksuite/k001b_Articulations_Above_MuseScore.pdf b/data/ksuite/k001b_Articulations_Above_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k001b_Articulations_Above_MuseScore.pdf rename to data/ksuite/k001b_Articulations_Above_MuseScore.pdf diff --git a/Resources/ksuite/k001b_Articulations_Above_Sibelius.pdf b/data/ksuite/k001b_Articulations_Above_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k001b_Articulations_Above_Sibelius.pdf rename to data/ksuite/k001b_Articulations_Above_Sibelius.pdf diff --git a/Resources/ksuite/k001c_Articulations_Below.xml b/data/ksuite/k001c_Articulations_Below.xml similarity index 100% rename from Resources/ksuite/k001c_Articulations_Below.xml rename to data/ksuite/k001c_Articulations_Below.xml diff --git a/Resources/ksuite/k001c_Articulations_Below_Finale.pdf b/data/ksuite/k001c_Articulations_Below_Finale.pdf similarity index 100% rename from Resources/ksuite/k001c_Articulations_Below_Finale.pdf rename to data/ksuite/k001c_Articulations_Below_Finale.pdf diff --git a/Resources/ksuite/k001c_Articulations_Below_MuseScore.pdf b/data/ksuite/k001c_Articulations_Below_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k001c_Articulations_Below_MuseScore.pdf rename to data/ksuite/k001c_Articulations_Below_MuseScore.pdf diff --git a/Resources/ksuite/k001c_Articulations_Below_Sibelius.pdf b/data/ksuite/k001c_Articulations_Below_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k001c_Articulations_Below_Sibelius.pdf rename to data/ksuite/k001c_Articulations_Below_Sibelius.pdf diff --git a/Resources/ksuite/k002a_Fermatas.xml b/data/ksuite/k002a_Fermatas.xml similarity index 100% rename from Resources/ksuite/k002a_Fermatas.xml rename to data/ksuite/k002a_Fermatas.xml diff --git a/Resources/ksuite/k002a_Fermatas_Finale.pdf b/data/ksuite/k002a_Fermatas_Finale.pdf similarity index 100% rename from Resources/ksuite/k002a_Fermatas_Finale.pdf rename to data/ksuite/k002a_Fermatas_Finale.pdf diff --git a/Resources/ksuite/k002a_Fermatas_MuseScore.pdf b/data/ksuite/k002a_Fermatas_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k002a_Fermatas_MuseScore.pdf rename to data/ksuite/k002a_Fermatas_MuseScore.pdf diff --git a/Resources/ksuite/k002a_Fermatas_Sibelius.pdf b/data/ksuite/k002a_Fermatas_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k002a_Fermatas_Sibelius.pdf rename to data/ksuite/k002a_Fermatas_Sibelius.pdf diff --git a/Resources/ksuite/k003a_Ornaments.xml b/data/ksuite/k003a_Ornaments.xml similarity index 100% rename from Resources/ksuite/k003a_Ornaments.xml rename to data/ksuite/k003a_Ornaments.xml diff --git a/Resources/ksuite/k003a_Ornaments_Finale.pdf b/data/ksuite/k003a_Ornaments_Finale.pdf similarity index 100% rename from Resources/ksuite/k003a_Ornaments_Finale.pdf rename to data/ksuite/k003a_Ornaments_Finale.pdf diff --git a/Resources/ksuite/k003a_Ornaments_MuseScore.pdf b/data/ksuite/k003a_Ornaments_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k003a_Ornaments_MuseScore.pdf rename to data/ksuite/k003a_Ornaments_MuseScore.pdf diff --git a/Resources/ksuite/k003a_Ornaments_Sibelius.pdf b/data/ksuite/k003a_Ornaments_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k003a_Ornaments_Sibelius.pdf rename to data/ksuite/k003a_Ornaments_Sibelius.pdf diff --git a/Resources/ksuite/k004a_Technical.xml b/data/ksuite/k004a_Technical.xml similarity index 100% rename from Resources/ksuite/k004a_Technical.xml rename to data/ksuite/k004a_Technical.xml diff --git a/Resources/ksuite/k004a_Technical_Finale.pdf b/data/ksuite/k004a_Technical_Finale.pdf similarity index 100% rename from Resources/ksuite/k004a_Technical_Finale.pdf rename to data/ksuite/k004a_Technical_Finale.pdf diff --git a/Resources/ksuite/k004a_Technical_MuseScore.pdf b/data/ksuite/k004a_Technical_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k004a_Technical_MuseScore.pdf rename to data/ksuite/k004a_Technical_MuseScore.pdf diff --git a/Resources/ksuite/k004a_Technical_Sibelius.pdf b/data/ksuite/k004a_Technical_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k004a_Technical_Sibelius.pdf rename to data/ksuite/k004a_Technical_Sibelius.pdf diff --git a/Resources/ksuite/k005a_Spanners_Slides.xml b/data/ksuite/k005a_Spanners_Slides.xml similarity index 100% rename from Resources/ksuite/k005a_Spanners_Slides.xml rename to data/ksuite/k005a_Spanners_Slides.xml diff --git a/Resources/ksuite/k005a_Spanners_Slides_Finale.pdf b/data/ksuite/k005a_Spanners_Slides_Finale.pdf similarity index 100% rename from Resources/ksuite/k005a_Spanners_Slides_Finale.pdf rename to data/ksuite/k005a_Spanners_Slides_Finale.pdf diff --git a/Resources/ksuite/k005a_Spanners_Slides_MuseScore.pdf b/data/ksuite/k005a_Spanners_Slides_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k005a_Spanners_Slides_MuseScore.pdf rename to data/ksuite/k005a_Spanners_Slides_MuseScore.pdf diff --git a/Resources/ksuite/k005a_Spanners_Slides_Sibelius.pdf b/data/ksuite/k005a_Spanners_Slides_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k005a_Spanners_Slides_Sibelius.pdf rename to data/ksuite/k005a_Spanners_Slides_Sibelius.pdf diff --git a/Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.musx b/data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.musx similarity index 100% rename from Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.musx rename to data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.musx diff --git a/Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.xml b/data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.xml similarity index 100% rename from Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.xml rename to data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble.xml diff --git a/Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Finale.pdf b/data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Finale.pdf similarity index 100% rename from Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Finale.pdf rename to data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Finale.pdf diff --git a/Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_MuseScore.pdf b/data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_MuseScore.pdf rename to data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_MuseScore.pdf diff --git a/Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Sibelius.pdf b/data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Sibelius.pdf rename to data/ksuite/k006a_Clefs_sign_G_ln_2_oct_0_Treble_Sibelius.pdf diff --git a/Resources/ksuite/k006a_Header_Scaling_Decimals.xml b/data/ksuite/k006a_Header_Scaling_Decimals.xml similarity index 100% rename from Resources/ksuite/k006a_Header_Scaling_Decimals.xml rename to data/ksuite/k006a_Header_Scaling_Decimals.xml diff --git a/Resources/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.musx b/data/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.musx similarity index 100% rename from Resources/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.musx rename to data/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.musx diff --git a/Resources/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.xml b/data/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.xml similarity index 100% rename from Resources/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.xml rename to data/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass.xml diff --git a/Resources/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Finale.pdf b/data/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Finale.pdf similarity index 100% rename from Resources/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Finale.pdf rename to data/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Finale.pdf diff --git a/Resources/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Sibelius.pdf b/data/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Sibelius.pdf rename to data/ksuite/k006b_Clefs_sign_F_ln_4_oct_0_Bass_Sibelius.pdf diff --git a/Resources/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.musx b/data/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.musx similarity index 100% rename from Resources/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.musx rename to data/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.musx diff --git a/Resources/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.xml b/data/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.xml similarity index 100% rename from Resources/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.xml rename to data/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola.xml diff --git a/Resources/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Finale.pdf b/data/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Finale.pdf similarity index 100% rename from Resources/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Finale.pdf rename to data/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Finale.pdf diff --git a/Resources/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Sibelius.pdf b/data/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Sibelius.pdf rename to data/ksuite/k006c_Clefs_sign_C_ln_3_oct_0_Viola_Sibelius.pdf diff --git a/Resources/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.musx b/data/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.musx similarity index 100% rename from Resources/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.musx rename to data/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.musx diff --git a/Resources/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.xml b/data/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.xml similarity index 100% rename from Resources/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.xml rename to data/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor.xml diff --git a/Resources/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Finale.pdf b/data/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Finale.pdf similarity index 100% rename from Resources/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Finale.pdf rename to data/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Finale.pdf diff --git a/Resources/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Sibelius.pdf b/data/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Sibelius.pdf rename to data/ksuite/k006d_Clefs_sign_C_ln_4_oct_0_Tenor_Sibelius.pdf diff --git a/Resources/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.musx b/data/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.musx similarity index 100% rename from Resources/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.musx rename to data/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.musx diff --git a/Resources/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.xml b/data/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.xml similarity index 100% rename from Resources/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.xml rename to data/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone.xml diff --git a/Resources/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Finale.pdf b/data/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Finale.pdf similarity index 100% rename from Resources/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Finale.pdf rename to data/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Finale.pdf diff --git a/Resources/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Sibelius.pdf b/data/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Sibelius.pdf rename to data/ksuite/k006e_Clefs_sign_C_ln_5_oct_0_Baritone_Sibelius.pdf diff --git a/Resources/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.musx b/data/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.musx similarity index 100% rename from Resources/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.musx rename to data/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.musx diff --git a/Resources/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.xml b/data/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.xml similarity index 100% rename from Resources/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.xml rename to data/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano.xml diff --git a/Resources/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Finale.pdf b/data/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Finale.pdf similarity index 100% rename from Resources/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Finale.pdf rename to data/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Finale.pdf diff --git a/Resources/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Sibelius.pdf b/data/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Sibelius.pdf rename to data/ksuite/k006f_Clefs_sign_C_ln_1_oct_0_Soprano_Sibelius.pdf diff --git a/Resources/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.musx b/data/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.musx similarity index 100% rename from Resources/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.musx rename to data/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.musx diff --git a/Resources/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.xml b/data/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.xml similarity index 100% rename from Resources/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.xml rename to data/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano.xml diff --git a/Resources/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Finale.pdf b/data/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Finale.pdf similarity index 100% rename from Resources/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Finale.pdf rename to data/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Finale.pdf diff --git a/Resources/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Sibelius.pdf b/data/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Sibelius.pdf rename to data/ksuite/k006g_Clefs_sign_C_ln_2_oct_0_Mezzo_Soprano_Sibelius.pdf diff --git a/Resources/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.musx b/data/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.musx similarity index 100% rename from Resources/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.musx rename to data/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.musx diff --git a/Resources/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.xml b/data/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.xml similarity index 100% rename from Resources/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.xml rename to data/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French.xml diff --git a/Resources/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Finale.pdf b/data/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Finale.pdf similarity index 100% rename from Resources/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Finale.pdf rename to data/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Finale.pdf diff --git a/Resources/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Sibelius.pdf b/data/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Sibelius.pdf rename to data/ksuite/k006h_Clefs_sign_G_ln_1_oct_0_French_Sibelius.pdf diff --git a/Resources/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.musx b/data/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.musx similarity index 100% rename from Resources/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.musx rename to data/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.musx diff --git a/Resources/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.xml b/data/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.xml similarity index 100% rename from Resources/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.xml rename to data/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone.xml diff --git a/Resources/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Finale.pdf b/data/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Finale.pdf similarity index 100% rename from Resources/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Finale.pdf rename to data/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Finale.pdf diff --git a/Resources/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Sibelius.pdf b/data/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Sibelius.pdf rename to data/ksuite/k006i_Clefs_sign_F_ln_3_oct_0_Varbaritone_Sibelius.pdf diff --git a/Resources/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.musx b/data/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.musx similarity index 100% rename from Resources/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.musx rename to data/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.musx diff --git a/Resources/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.xml b/data/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.xml similarity index 100% rename from Resources/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.xml rename to data/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass.xml diff --git a/Resources/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Finale.pdf b/data/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Finale.pdf similarity index 100% rename from Resources/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Finale.pdf rename to data/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Finale.pdf diff --git a/Resources/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Sibelius.pdf b/data/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Sibelius.pdf rename to data/ksuite/k006j_Clefs_sign_F_ln_5_oct_0_Subbass_Sibelius.pdf diff --git a/Resources/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.musx b/data/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.musx similarity index 100% rename from Resources/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.musx rename to data/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.musx diff --git a/Resources/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.xml b/data/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.xml similarity index 100% rename from Resources/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.xml rename to data/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB.xml diff --git a/Resources/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Finale.pdf b/data/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Finale.pdf similarity index 100% rename from Resources/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Finale.pdf rename to data/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Finale.pdf diff --git a/Resources/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Sibelius.pdf b/data/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Sibelius.pdf rename to data/ksuite/k006k_Clefs_sign_G_ln_2_oct_neg2_G_15MB_Sibelius.pdf diff --git a/Resources/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.musx b/data/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.musx similarity index 100% rename from Resources/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.musx rename to data/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.musx diff --git a/Resources/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.xml b/data/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.xml similarity index 100% rename from Resources/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.xml rename to data/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB.xml diff --git a/Resources/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Finale.pdf b/data/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Finale.pdf similarity index 100% rename from Resources/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Finale.pdf rename to data/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Finale.pdf diff --git a/Resources/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Sibelius.pdf b/data/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Sibelius.pdf rename to data/ksuite/k006l_Clefs_sign_G_ln_2_oct_neg1_G_8VB_Sibelius.pdf diff --git a/Resources/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.musx b/data/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.musx similarity index 100% rename from Resources/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.musx rename to data/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.musx diff --git a/Resources/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.xml b/data/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.xml similarity index 100% rename from Resources/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.xml rename to data/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA.xml diff --git a/Resources/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Finale.pdf b/data/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Finale.pdf similarity index 100% rename from Resources/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Finale.pdf rename to data/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Finale.pdf diff --git a/Resources/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Sibelius.pdf b/data/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Sibelius.pdf rename to data/ksuite/k006m_Clefs_sign_G_ln_2_oct_1_G_8VA_Sibelius.pdf diff --git a/Resources/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.musx b/data/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.musx similarity index 100% rename from Resources/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.musx rename to data/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.musx diff --git a/Resources/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.xml b/data/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.xml similarity index 100% rename from Resources/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.xml rename to data/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA.xml diff --git a/Resources/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Finale.pdf b/data/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Finale.pdf similarity index 100% rename from Resources/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Finale.pdf rename to data/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Finale.pdf diff --git a/Resources/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Sibelius.pdf b/data/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Sibelius.pdf rename to data/ksuite/k006n_Clefs_sign_G_ln_2_oct_2_G_15MA_Sibelius.pdf diff --git a/Resources/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.musx b/data/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.musx similarity index 100% rename from Resources/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.musx rename to data/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.musx diff --git a/Resources/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.xml b/data/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.xml similarity index 100% rename from Resources/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.xml rename to data/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB.xml diff --git a/Resources/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Finale.pdf b/data/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Finale.pdf similarity index 100% rename from Resources/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Finale.pdf rename to data/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Finale.pdf diff --git a/Resources/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Sibelius.pdf b/data/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Sibelius.pdf rename to data/ksuite/k006o_Clefs_sign_F_ln_4_oct_neg2_F_15MB_Sibelius.pdf diff --git a/Resources/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.musx b/data/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.musx similarity index 100% rename from Resources/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.musx rename to data/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.musx diff --git a/Resources/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.xml b/data/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.xml similarity index 100% rename from Resources/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.xml rename to data/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB.xml diff --git a/Resources/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Finale.pdf b/data/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Finale.pdf similarity index 100% rename from Resources/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Finale.pdf rename to data/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Finale.pdf diff --git a/Resources/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Sibelius.pdf b/data/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Sibelius.pdf rename to data/ksuite/k006p_Clefs_sign_F_ln_4_oct_neg1_F_8VB_Sibelius.pdf diff --git a/Resources/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.musx b/data/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.musx similarity index 100% rename from Resources/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.musx rename to data/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.musx diff --git a/Resources/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.xml b/data/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.xml similarity index 100% rename from Resources/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.xml rename to data/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA.xml diff --git a/Resources/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Finale.pdf b/data/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Finale.pdf similarity index 100% rename from Resources/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Finale.pdf rename to data/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Finale.pdf diff --git a/Resources/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Sibelius.pdf b/data/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Sibelius.pdf rename to data/ksuite/k006q_Clefs_sign_F_ln_4_oct_1_F_8VA_Sibelius.pdf diff --git a/Resources/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.musx b/data/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.musx similarity index 100% rename from Resources/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.musx rename to data/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.musx diff --git a/Resources/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.xml b/data/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.xml similarity index 100% rename from Resources/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.xml rename to data/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA.xml diff --git a/Resources/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Finale.pdf b/data/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Finale.pdf similarity index 100% rename from Resources/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Finale.pdf rename to data/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Finale.pdf diff --git a/Resources/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Sibelius.pdf b/data/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Sibelius.pdf rename to data/ksuite/k006r_Clefs_sign_F_ln_4_oct_2_F_15MA_Sibelius.pdf diff --git a/Resources/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.musx b/data/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.musx similarity index 100% rename from Resources/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.musx rename to data/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.musx diff --git a/Resources/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.xml b/data/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.xml similarity index 100% rename from Resources/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.xml rename to data/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion.xml diff --git a/Resources/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Finale.pdf b/data/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Finale.pdf similarity index 100% rename from Resources/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Finale.pdf rename to data/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Finale.pdf diff --git a/Resources/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Sibelius.pdf b/data/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Sibelius.pdf rename to data/ksuite/k006s_Clefs_sign_percussion_ln_3_oct_0_Percussion_Sibelius.pdf diff --git a/Resources/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.musx b/data/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.musx similarity index 100% rename from Resources/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.musx rename to data/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.musx diff --git a/Resources/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.xml b/data/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.xml similarity index 100% rename from Resources/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.xml rename to data/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab.xml diff --git a/Resources/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Finale.pdf b/data/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Finale.pdf similarity index 100% rename from Resources/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Finale.pdf rename to data/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Finale.pdf diff --git a/Resources/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Sibelius.pdf b/data/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Sibelius.pdf rename to data/ksuite/k006t_Clefs_sign_TAB_ln_3_oct_0_Tab_Sibelius.pdf diff --git a/Resources/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.musx b/data/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.musx similarity index 100% rename from Resources/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.musx rename to data/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.musx diff --git a/Resources/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.xml b/data/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.xml similarity index 100% rename from Resources/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.xml rename to data/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu.xml diff --git a/Resources/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Finale.pdf b/data/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Finale.pdf similarity index 100% rename from Resources/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Finale.pdf rename to data/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Finale.pdf diff --git a/Resources/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Sibelius.pdf b/data/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Sibelius.pdf rename to data/ksuite/k006u_Clefs_sign_jianpu_ln_3_oct_0_Jianpu_Sibelius.pdf diff --git a/Resources/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.musx b/data/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.musx similarity index 100% rename from Resources/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.musx rename to data/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.musx diff --git a/Resources/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.xml b/data/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.xml similarity index 100% rename from Resources/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.xml rename to data/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None.xml diff --git a/Resources/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Finale.pdf b/data/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Finale.pdf similarity index 100% rename from Resources/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Finale.pdf rename to data/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Finale.pdf diff --git a/Resources/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Sibelius.pdf b/data/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Sibelius.pdf rename to data/ksuite/k006v_Clefs_sign_none_ln_3_oct_0_None_Sibelius.pdf diff --git a/Resources/ksuite/k007a_Notations_Dynamics.musx b/data/ksuite/k007a_Notations_Dynamics.musx similarity index 100% rename from Resources/ksuite/k007a_Notations_Dynamics.musx rename to data/ksuite/k007a_Notations_Dynamics.musx diff --git a/Resources/ksuite/k007a_Notations_Dynamics.xml b/data/ksuite/k007a_Notations_Dynamics.xml similarity index 100% rename from Resources/ksuite/k007a_Notations_Dynamics.xml rename to data/ksuite/k007a_Notations_Dynamics.xml diff --git a/Resources/ksuite/k007a_Notations_Dynamics_Finale - Score.pdf b/data/ksuite/k007a_Notations_Dynamics_Finale - Score.pdf similarity index 100% rename from Resources/ksuite/k007a_Notations_Dynamics_Finale - Score.pdf rename to data/ksuite/k007a_Notations_Dynamics_Finale - Score.pdf diff --git a/Resources/ksuite/k007a_Notations_Dynamics_MuseScore.pdf b/data/ksuite/k007a_Notations_Dynamics_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k007a_Notations_Dynamics_MuseScore.pdf rename to data/ksuite/k007a_Notations_Dynamics_MuseScore.pdf diff --git a/Resources/ksuite/k007a_Notations_Dynamics_Sibelius.pdf b/data/ksuite/k007a_Notations_Dynamics_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k007a_Notations_Dynamics_Sibelius.pdf rename to data/ksuite/k007a_Notations_Dynamics_Sibelius.pdf diff --git a/Resources/ksuite/k007b_Notations_Dynamics_Attributes.pdf b/data/ksuite/k007b_Notations_Dynamics_Attributes.pdf similarity index 100% rename from Resources/ksuite/k007b_Notations_Dynamics_Attributes.pdf rename to data/ksuite/k007b_Notations_Dynamics_Attributes.pdf diff --git a/Resources/ksuite/k007b_Notations_Dynamics_Attributes.xml b/data/ksuite/k007b_Notations_Dynamics_Attributes.xml similarity index 100% rename from Resources/ksuite/k007b_Notations_Dynamics_Attributes.xml rename to data/ksuite/k007b_Notations_Dynamics_Attributes.xml diff --git a/Resources/ksuite/k007c_Directions_Dynamics.xml b/data/ksuite/k007c_Directions_Dynamics.xml similarity index 100% rename from Resources/ksuite/k007c_Directions_Dynamics.xml rename to data/ksuite/k007c_Directions_Dynamics.xml diff --git a/Resources/ksuite/k007d_Directions_Dynamics_Attributes.xml b/data/ksuite/k007d_Directions_Dynamics_Attributes.xml similarity index 100% rename from Resources/ksuite/k007d_Directions_Dynamics_Attributes.xml rename to data/ksuite/k007d_Directions_Dynamics_Attributes.xml diff --git a/Resources/ksuite/k008a_Beaming.musx b/data/ksuite/k008a_Beaming.musx similarity index 100% rename from Resources/ksuite/k008a_Beaming.musx rename to data/ksuite/k008a_Beaming.musx diff --git a/Resources/ksuite/k008a_Beaming.xml b/data/ksuite/k008a_Beaming.xml similarity index 100% rename from Resources/ksuite/k008a_Beaming.xml rename to data/ksuite/k008a_Beaming.xml diff --git a/Resources/ksuite/k008a_Beaming_FinaleOriginal.pdf b/data/ksuite/k008a_Beaming_FinaleOriginal.pdf similarity index 100% rename from Resources/ksuite/k008a_Beaming_FinaleOriginal.pdf rename to data/ksuite/k008a_Beaming_FinaleOriginal.pdf diff --git a/Resources/ksuite/k008a_Beaming_FinaleRoundTrip.pdf b/data/ksuite/k008a_Beaming_FinaleRoundTrip.pdf similarity index 100% rename from Resources/ksuite/k008a_Beaming_FinaleRoundTrip.pdf rename to data/ksuite/k008a_Beaming_FinaleRoundTrip.pdf diff --git a/Resources/ksuite/k008a_Beaming_Sibelius.pdf b/data/ksuite/k008a_Beaming_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k008a_Beaming_Sibelius.pdf rename to data/ksuite/k008a_Beaming_Sibelius.pdf diff --git a/Resources/ksuite/k009a_Slurs.musx b/data/ksuite/k009a_Slurs.musx similarity index 100% rename from Resources/ksuite/k009a_Slurs.musx rename to data/ksuite/k009a_Slurs.musx diff --git a/Resources/ksuite/k009a_Slurs.xml b/data/ksuite/k009a_Slurs.xml similarity index 100% rename from Resources/ksuite/k009a_Slurs.xml rename to data/ksuite/k009a_Slurs.xml diff --git a/Resources/ksuite/k009a_Slurs_FinaleOriginal.pdf b/data/ksuite/k009a_Slurs_FinaleOriginal.pdf similarity index 100% rename from Resources/ksuite/k009a_Slurs_FinaleOriginal.pdf rename to data/ksuite/k009a_Slurs_FinaleOriginal.pdf diff --git a/Resources/ksuite/k009a_Slurs_FinaleRoundtrip.pdf b/data/ksuite/k009a_Slurs_FinaleRoundtrip.pdf similarity index 100% rename from Resources/ksuite/k009a_Slurs_FinaleRoundtrip.pdf rename to data/ksuite/k009a_Slurs_FinaleRoundtrip.pdf diff --git a/Resources/ksuite/k009a_Slurs_Sibelius.pdf b/data/ksuite/k009a_Slurs_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k009a_Slurs_Sibelius.pdf rename to data/ksuite/k009a_Slurs_Sibelius.pdf diff --git a/Resources/ksuite/k009b_Slur_Attributes.xml b/data/ksuite/k009b_Slur_Attributes.xml similarity index 100% rename from Resources/ksuite/k009b_Slur_Attributes.xml rename to data/ksuite/k009b_Slur_Attributes.xml diff --git a/Resources/ksuite/k010a_Ties.musx b/data/ksuite/k010a_Ties.musx similarity index 100% rename from Resources/ksuite/k010a_Ties.musx rename to data/ksuite/k010a_Ties.musx diff --git a/Resources/ksuite/k010a_Ties.xml b/data/ksuite/k010a_Ties.xml similarity index 100% rename from Resources/ksuite/k010a_Ties.xml rename to data/ksuite/k010a_Ties.xml diff --git a/Resources/ksuite/k010a_Ties_FinaleOriginal.pdf b/data/ksuite/k010a_Ties_FinaleOriginal.pdf similarity index 100% rename from Resources/ksuite/k010a_Ties_FinaleOriginal.pdf rename to data/ksuite/k010a_Ties_FinaleOriginal.pdf diff --git a/Resources/ksuite/k010a_Ties_FinaleRoundtrip.pdf b/data/ksuite/k010a_Ties_FinaleRoundtrip.pdf similarity index 100% rename from Resources/ksuite/k010a_Ties_FinaleRoundtrip.pdf rename to data/ksuite/k010a_Ties_FinaleRoundtrip.pdf diff --git a/Resources/ksuite/k010a_Ties_Sibelius.pdf b/data/ksuite/k010a_Ties_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k010a_Ties_Sibelius.pdf rename to data/ksuite/k010a_Ties_Sibelius.pdf diff --git a/Resources/ksuite/k010b_Bad_Ties.pdf b/data/ksuite/k010b_Bad_Ties.pdf similarity index 100% rename from Resources/ksuite/k010b_Bad_Ties.pdf rename to data/ksuite/k010b_Bad_Ties.pdf diff --git a/Resources/ksuite/k010b_Bad_Ties.xml b/data/ksuite/k010b_Bad_Ties.xml similarity index 100% rename from Resources/ksuite/k010b_Bad_Ties.xml rename to data/ksuite/k010b_Bad_Ties.xml diff --git a/Resources/ksuite/k010b_Bad_Ties_Sibelius.pdf b/data/ksuite/k010b_Bad_Ties_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k010b_Bad_Ties_Sibelius.pdf rename to data/ksuite/k010b_Bad_Ties_Sibelius.pdf diff --git a/Resources/ksuite/k011a_Tuplets.musx b/data/ksuite/k011a_Tuplets.musx similarity index 100% rename from Resources/ksuite/k011a_Tuplets.musx rename to data/ksuite/k011a_Tuplets.musx diff --git a/Resources/ksuite/k011a_Tuplets.pdf b/data/ksuite/k011a_Tuplets.pdf similarity index 100% rename from Resources/ksuite/k011a_Tuplets.pdf rename to data/ksuite/k011a_Tuplets.pdf diff --git a/Resources/ksuite/k011a_Tuplets.xml b/data/ksuite/k011a_Tuplets.xml similarity index 100% rename from Resources/ksuite/k011a_Tuplets.xml rename to data/ksuite/k011a_Tuplets.xml diff --git a/Resources/ksuite/k011a_Tuplets_Sibelius.pdf b/data/ksuite/k011a_Tuplets_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k011a_Tuplets_Sibelius.pdf rename to data/ksuite/k011a_Tuplets_Sibelius.pdf diff --git a/Resources/ksuite/k012a_Tempo_Markings.musx b/data/ksuite/k012a_Tempo_Markings.musx similarity index 100% rename from Resources/ksuite/k012a_Tempo_Markings.musx rename to data/ksuite/k012a_Tempo_Markings.musx diff --git a/Resources/ksuite/k012a_Tempo_Markings.xml b/data/ksuite/k012a_Tempo_Markings.xml similarity index 100% rename from Resources/ksuite/k012a_Tempo_Markings.xml rename to data/ksuite/k012a_Tempo_Markings.xml diff --git a/Resources/ksuite/k012a_Tempo_Markings_FinaleOriginal .pdf b/data/ksuite/k012a_Tempo_Markings_FinaleOriginal .pdf similarity index 100% rename from Resources/ksuite/k012a_Tempo_Markings_FinaleOriginal .pdf rename to data/ksuite/k012a_Tempo_Markings_FinaleOriginal .pdf diff --git a/Resources/ksuite/k012a_Tempo_Markings_FinaleRoundTrip.pdf b/data/ksuite/k012a_Tempo_Markings_FinaleRoundTrip.pdf similarity index 100% rename from Resources/ksuite/k012a_Tempo_Markings_FinaleRoundTrip.pdf rename to data/ksuite/k012a_Tempo_Markings_FinaleRoundTrip.pdf diff --git a/Resources/ksuite/k012a_Tempo_Markings_Sibelius.pdf b/data/ksuite/k012a_Tempo_Markings_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k012a_Tempo_Markings_Sibelius.pdf rename to data/ksuite/k012a_Tempo_Markings_Sibelius.pdf diff --git a/Resources/ksuite/k013a_OrchestralScoreFinale.musx b/data/ksuite/k013a_OrchestralScoreFinale.musx similarity index 100% rename from Resources/ksuite/k013a_OrchestralScoreFinale.musx rename to data/ksuite/k013a_OrchestralScoreFinale.musx diff --git a/Resources/ksuite/k013a_OrchestralScoreFinale.xml b/data/ksuite/k013a_OrchestralScoreFinale.xml similarity index 100% rename from Resources/ksuite/k013a_OrchestralScoreFinale.xml rename to data/ksuite/k013a_OrchestralScoreFinale.xml diff --git a/Resources/ksuite/k013a_OrchestralScoreFinale_FinaleOriginal.pdf b/data/ksuite/k013a_OrchestralScoreFinale_FinaleOriginal.pdf similarity index 100% rename from Resources/ksuite/k013a_OrchestralScoreFinale_FinaleOriginal.pdf rename to data/ksuite/k013a_OrchestralScoreFinale_FinaleOriginal.pdf diff --git a/Resources/ksuite/k013a_OrchestralScoreFinale_FinaleRoundtrip.pdf b/data/ksuite/k013a_OrchestralScoreFinale_FinaleRoundtrip.pdf similarity index 100% rename from Resources/ksuite/k013a_OrchestralScoreFinale_FinaleRoundtrip.pdf rename to data/ksuite/k013a_OrchestralScoreFinale_FinaleRoundtrip.pdf diff --git a/Resources/ksuite/k013a_OrchestralScoreFinale_Sibelius.pdf b/data/ksuite/k013a_OrchestralScoreFinale_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k013a_OrchestralScoreFinale_Sibelius.pdf rename to data/ksuite/k013a_OrchestralScoreFinale_Sibelius.pdf diff --git a/Resources/ksuite/k013b_OrchestralScoreSibelius.sib b/data/ksuite/k013b_OrchestralScoreSibelius.sib similarity index 100% rename from Resources/ksuite/k013b_OrchestralScoreSibelius.sib rename to data/ksuite/k013b_OrchestralScoreSibelius.sib diff --git a/Resources/ksuite/k013b_OrchestralScoreSibelius.xml b/data/ksuite/k013b_OrchestralScoreSibelius.xml similarity index 100% rename from Resources/ksuite/k013b_OrchestralScoreSibelius.xml rename to data/ksuite/k013b_OrchestralScoreSibelius.xml diff --git a/Resources/ksuite/k013b_OrchestralScoreSibelius_Sibelius.pdf b/data/ksuite/k013b_OrchestralScoreSibelius_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k013b_OrchestralScoreSibelius_Sibelius.pdf rename to data/ksuite/k013b_OrchestralScoreSibelius_Sibelius.pdf diff --git a/Resources/ksuite/k013b_OrchestralScoreSibelius_SibeliusRoundtrip.pdf b/data/ksuite/k013b_OrchestralScoreSibelius_SibeliusRoundtrip.pdf similarity index 100% rename from Resources/ksuite/k013b_OrchestralScoreSibelius_SibeliusRoundtrip.pdf rename to data/ksuite/k013b_OrchestralScoreSibelius_SibeliusRoundtrip.pdf diff --git a/Resources/ksuite/k014a_Fermatas.xml b/data/ksuite/k014a_Fermatas.xml similarity index 100% rename from Resources/ksuite/k014a_Fermatas.xml rename to data/ksuite/k014a_Fermatas.xml diff --git a/Resources/ksuite/k014a_Fermatas_Dorico.pdf b/data/ksuite/k014a_Fermatas_Dorico.pdf similarity index 100% rename from Resources/ksuite/k014a_Fermatas_Dorico.pdf rename to data/ksuite/k014a_Fermatas_Dorico.pdf diff --git a/Resources/ksuite/k014a_Fermatas_Finale.pdf b/data/ksuite/k014a_Fermatas_Finale.pdf similarity index 100% rename from Resources/ksuite/k014a_Fermatas_Finale.pdf rename to data/ksuite/k014a_Fermatas_Finale.pdf diff --git a/Resources/ksuite/k014a_Fermatas_MuseScore.pdf b/data/ksuite/k014a_Fermatas_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k014a_Fermatas_MuseScore.pdf rename to data/ksuite/k014a_Fermatas_MuseScore.pdf diff --git a/Resources/ksuite/k014a_Fermatas_Sibelius.pdf b/data/ksuite/k014a_Fermatas_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k014a_Fermatas_Sibelius.pdf rename to data/ksuite/k014a_Fermatas_Sibelius.pdf diff --git a/Resources/ksuite/k015a_System_Layout.xml b/data/ksuite/k015a_System_Layout.xml similarity index 100% rename from Resources/ksuite/k015a_System_Layout.xml rename to data/ksuite/k015a_System_Layout.xml diff --git a/Resources/ksuite/k015a_System_Layout_Dorico.pdf b/data/ksuite/k015a_System_Layout_Dorico.pdf similarity index 100% rename from Resources/ksuite/k015a_System_Layout_Dorico.pdf rename to data/ksuite/k015a_System_Layout_Dorico.pdf diff --git a/Resources/ksuite/k015a_System_Layout_Finale.pdf b/data/ksuite/k015a_System_Layout_Finale.pdf similarity index 100% rename from Resources/ksuite/k015a_System_Layout_Finale.pdf rename to data/ksuite/k015a_System_Layout_Finale.pdf diff --git a/Resources/ksuite/k015a_System_Layout_MuseScore.pdf b/data/ksuite/k015a_System_Layout_MuseScore.pdf similarity index 100% rename from Resources/ksuite/k015a_System_Layout_MuseScore.pdf rename to data/ksuite/k015a_System_Layout_MuseScore.pdf diff --git a/Resources/ksuite/k015a_System_Layout_Sibelius.pdf b/data/ksuite/k015a_System_Layout_Sibelius.pdf similarity index 100% rename from Resources/ksuite/k015a_System_Layout_Sibelius.pdf rename to data/ksuite/k015a_System_Layout_Sibelius.pdf diff --git a/Resources/ksuite/k016a_Miscellaneous_Fields.xml b/data/ksuite/k016a_Miscellaneous_Fields.xml similarity index 100% rename from Resources/ksuite/k016a_Miscellaneous_Fields.xml rename to data/ksuite/k016a_Miscellaneous_Fields.xml diff --git a/Resources/ksuite/temp.xml b/data/ksuite/temp.xml similarity index 100% rename from Resources/ksuite/temp.xml rename to data/ksuite/temp.xml diff --git a/Resources/logicpro/logic01a_homoSapiens.xml b/data/logicpro/logic01a_homoSapiens.xml similarity index 100% rename from Resources/logicpro/logic01a_homoSapiens.xml rename to data/logicpro/logic01a_homoSapiens.xml diff --git a/Resources/lysuite/FinaleMusicXMLImportLog.txt b/data/lysuite/FinaleMusicXMLImportLog.txt similarity index 100% rename from Resources/lysuite/FinaleMusicXMLImportLog.txt rename to data/lysuite/FinaleMusicXMLImportLog.txt diff --git a/Resources/lysuite/Unofficial MusicXML test suite.webarchive b/data/lysuite/Unofficial MusicXML test suite.webarchive similarity index 100% rename from Resources/lysuite/Unofficial MusicXML test suite.webarchive rename to data/lysuite/Unofficial MusicXML test suite.webarchive diff --git a/Resources/lysuite/ly01a_Pitches_Pitches.musx b/data/lysuite/ly01a_Pitches_Pitches.musx similarity index 100% rename from Resources/lysuite/ly01a_Pitches_Pitches.musx rename to data/lysuite/ly01a_Pitches_Pitches.musx diff --git a/Resources/lysuite/ly01a_Pitches_Pitches.xml b/data/lysuite/ly01a_Pitches_Pitches.xml similarity index 100% rename from Resources/lysuite/ly01a_Pitches_Pitches.xml rename to data/lysuite/ly01a_Pitches_Pitches.xml diff --git a/Resources/lysuite/ly01a_Pitches_Pitches_Finale.pdf b/data/lysuite/ly01a_Pitches_Pitches_Finale.pdf similarity index 100% rename from Resources/lysuite/ly01a_Pitches_Pitches_Finale.pdf rename to data/lysuite/ly01a_Pitches_Pitches_Finale.pdf diff --git a/Resources/lysuite/ly01a_Pitches_Pitches_museScore.pdf b/data/lysuite/ly01a_Pitches_Pitches_museScore.pdf similarity index 100% rename from Resources/lysuite/ly01a_Pitches_Pitches_museScore.pdf rename to data/lysuite/ly01a_Pitches_Pitches_museScore.pdf diff --git a/Resources/lysuite/ly01b_Pitches_Intervals.musx b/data/lysuite/ly01b_Pitches_Intervals.musx similarity index 100% rename from Resources/lysuite/ly01b_Pitches_Intervals.musx rename to data/lysuite/ly01b_Pitches_Intervals.musx diff --git a/Resources/lysuite/ly01b_Pitches_Intervals.xml b/data/lysuite/ly01b_Pitches_Intervals.xml similarity index 100% rename from Resources/lysuite/ly01b_Pitches_Intervals.xml rename to data/lysuite/ly01b_Pitches_Intervals.xml diff --git a/Resources/lysuite/ly01b_Pitches_Intervals_Finale.pdf b/data/lysuite/ly01b_Pitches_Intervals_Finale.pdf similarity index 100% rename from Resources/lysuite/ly01b_Pitches_Intervals_Finale.pdf rename to data/lysuite/ly01b_Pitches_Intervals_Finale.pdf diff --git a/Resources/lysuite/ly01b_Pitches_Intervals_museScore.pdf b/data/lysuite/ly01b_Pitches_Intervals_museScore.pdf similarity index 100% rename from Resources/lysuite/ly01b_Pitches_Intervals_museScore.pdf rename to data/lysuite/ly01b_Pitches_Intervals_museScore.pdf diff --git a/Resources/lysuite/ly01c_Pitches_NoVoiceElement.musx b/data/lysuite/ly01c_Pitches_NoVoiceElement.musx similarity index 100% rename from Resources/lysuite/ly01c_Pitches_NoVoiceElement.musx rename to data/lysuite/ly01c_Pitches_NoVoiceElement.musx diff --git a/Resources/lysuite/ly01c_Pitches_NoVoiceElement.xml b/data/lysuite/ly01c_Pitches_NoVoiceElement.xml similarity index 100% rename from Resources/lysuite/ly01c_Pitches_NoVoiceElement.xml rename to data/lysuite/ly01c_Pitches_NoVoiceElement.xml diff --git a/Resources/lysuite/ly01c_Pitches_NoVoiceElement_Finale.pdf b/data/lysuite/ly01c_Pitches_NoVoiceElement_Finale.pdf similarity index 100% rename from Resources/lysuite/ly01c_Pitches_NoVoiceElement_Finale.pdf rename to data/lysuite/ly01c_Pitches_NoVoiceElement_Finale.pdf diff --git a/Resources/lysuite/ly01c_Pitches_NoVoiceElement_museScore.pdf b/data/lysuite/ly01c_Pitches_NoVoiceElement_museScore.pdf similarity index 100% rename from Resources/lysuite/ly01c_Pitches_NoVoiceElement_museScore.pdf rename to data/lysuite/ly01c_Pitches_NoVoiceElement_museScore.pdf diff --git a/Resources/lysuite/ly01d_Pitches_Microtones.musx b/data/lysuite/ly01d_Pitches_Microtones.musx similarity index 100% rename from Resources/lysuite/ly01d_Pitches_Microtones.musx rename to data/lysuite/ly01d_Pitches_Microtones.musx diff --git a/Resources/lysuite/ly01d_Pitches_Microtones.xml b/data/lysuite/ly01d_Pitches_Microtones.xml similarity index 100% rename from Resources/lysuite/ly01d_Pitches_Microtones.xml rename to data/lysuite/ly01d_Pitches_Microtones.xml diff --git a/Resources/lysuite/ly01d_Pitches_Microtones_Finale.pdf b/data/lysuite/ly01d_Pitches_Microtones_Finale.pdf similarity index 100% rename from Resources/lysuite/ly01d_Pitches_Microtones_Finale.pdf rename to data/lysuite/ly01d_Pitches_Microtones_Finale.pdf diff --git a/Resources/lysuite/ly01d_Pitches_Microtones_museScore.pdf b/data/lysuite/ly01d_Pitches_Microtones_museScore.pdf similarity index 100% rename from Resources/lysuite/ly01d_Pitches_Microtones_museScore.pdf rename to data/lysuite/ly01d_Pitches_Microtones_museScore.pdf diff --git a/Resources/lysuite/ly01e_Pitches_ParenthesizedAccidentals.musx b/data/lysuite/ly01e_Pitches_ParenthesizedAccidentals.musx similarity index 100% rename from Resources/lysuite/ly01e_Pitches_ParenthesizedAccidentals.musx rename to data/lysuite/ly01e_Pitches_ParenthesizedAccidentals.musx diff --git a/Resources/lysuite/ly01e_Pitches_ParenthesizedAccidentals.xml b/data/lysuite/ly01e_Pitches_ParenthesizedAccidentals.xml similarity index 100% rename from Resources/lysuite/ly01e_Pitches_ParenthesizedAccidentals.xml rename to data/lysuite/ly01e_Pitches_ParenthesizedAccidentals.xml diff --git a/Resources/lysuite/ly01e_Pitches_ParenthesizedAccidentals_Finale.pdf b/data/lysuite/ly01e_Pitches_ParenthesizedAccidentals_Finale.pdf similarity index 100% rename from Resources/lysuite/ly01e_Pitches_ParenthesizedAccidentals_Finale.pdf rename to data/lysuite/ly01e_Pitches_ParenthesizedAccidentals_Finale.pdf diff --git a/Resources/lysuite/ly01e_Pitches_ParenthesizedAccidentals_museScore.pdf b/data/lysuite/ly01e_Pitches_ParenthesizedAccidentals_museScore.pdf similarity index 100% rename from Resources/lysuite/ly01e_Pitches_ParenthesizedAccidentals_museScore.pdf rename to data/lysuite/ly01e_Pitches_ParenthesizedAccidentals_museScore.pdf diff --git a/Resources/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.musx b/data/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.musx similarity index 100% rename from Resources/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.musx rename to data/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.musx diff --git a/Resources/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.xml b/data/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.xml similarity index 100% rename from Resources/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.xml rename to data/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals.xml diff --git a/Resources/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals_Finale.pdf b/data/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals_Finale.pdf similarity index 100% rename from Resources/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals_Finale.pdf rename to data/lysuite/ly01f_Pitches_ParenthesizedMicrotoneAccidentals_Finale.pdf diff --git a/Resources/lysuite/ly02a_Rests_Durations.musx b/data/lysuite/ly02a_Rests_Durations.musx similarity index 100% rename from Resources/lysuite/ly02a_Rests_Durations.musx rename to data/lysuite/ly02a_Rests_Durations.musx diff --git a/Resources/lysuite/ly02a_Rests_Durations.xml b/data/lysuite/ly02a_Rests_Durations.xml similarity index 100% rename from Resources/lysuite/ly02a_Rests_Durations.xml rename to data/lysuite/ly02a_Rests_Durations.xml diff --git a/Resources/lysuite/ly02a_Rests_Durations_Finale.pdf b/data/lysuite/ly02a_Rests_Durations_Finale.pdf similarity index 100% rename from Resources/lysuite/ly02a_Rests_Durations_Finale.pdf rename to data/lysuite/ly02a_Rests_Durations_Finale.pdf diff --git a/Resources/lysuite/ly02b_Rests_PitchedRests.musx b/data/lysuite/ly02b_Rests_PitchedRests.musx similarity index 100% rename from Resources/lysuite/ly02b_Rests_PitchedRests.musx rename to data/lysuite/ly02b_Rests_PitchedRests.musx diff --git a/Resources/lysuite/ly02b_Rests_PitchedRests.xml b/data/lysuite/ly02b_Rests_PitchedRests.xml similarity index 100% rename from Resources/lysuite/ly02b_Rests_PitchedRests.xml rename to data/lysuite/ly02b_Rests_PitchedRests.xml diff --git a/Resources/lysuite/ly02b_Rests_PitchedRests_Finale.pdf b/data/lysuite/ly02b_Rests_PitchedRests_Finale.pdf similarity index 100% rename from Resources/lysuite/ly02b_Rests_PitchedRests_Finale.pdf rename to data/lysuite/ly02b_Rests_PitchedRests_Finale.pdf diff --git a/Resources/lysuite/ly02c_Rests_MultiMeasureRests.musx b/data/lysuite/ly02c_Rests_MultiMeasureRests.musx similarity index 100% rename from Resources/lysuite/ly02c_Rests_MultiMeasureRests.musx rename to data/lysuite/ly02c_Rests_MultiMeasureRests.musx diff --git a/Resources/lysuite/ly02c_Rests_MultiMeasureRests.xml b/data/lysuite/ly02c_Rests_MultiMeasureRests.xml similarity index 100% rename from Resources/lysuite/ly02c_Rests_MultiMeasureRests.xml rename to data/lysuite/ly02c_Rests_MultiMeasureRests.xml diff --git a/Resources/lysuite/ly02c_Rests_MultiMeasureRests_Finale.pdf b/data/lysuite/ly02c_Rests_MultiMeasureRests_Finale.pdf similarity index 100% rename from Resources/lysuite/ly02c_Rests_MultiMeasureRests_Finale.pdf rename to data/lysuite/ly02c_Rests_MultiMeasureRests_Finale.pdf diff --git a/Resources/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.musx b/data/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.musx similarity index 100% rename from Resources/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.musx rename to data/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.musx diff --git a/Resources/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.xml b/data/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.xml similarity index 100% rename from Resources/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.xml rename to data/lysuite/ly02d_Rests_Multimeasure_TimeSignatures.xml diff --git a/Resources/lysuite/ly02d_Rests_Multimeasure_TimeSignatures_Finale.pdf b/data/lysuite/ly02d_Rests_Multimeasure_TimeSignatures_Finale.pdf similarity index 100% rename from Resources/lysuite/ly02d_Rests_Multimeasure_TimeSignatures_Finale.pdf rename to data/lysuite/ly02d_Rests_Multimeasure_TimeSignatures_Finale.pdf diff --git a/Resources/lysuite/ly02e_Rests_NoType.musx b/data/lysuite/ly02e_Rests_NoType.musx similarity index 100% rename from Resources/lysuite/ly02e_Rests_NoType.musx rename to data/lysuite/ly02e_Rests_NoType.musx diff --git a/Resources/lysuite/ly02e_Rests_NoType.xml b/data/lysuite/ly02e_Rests_NoType.xml similarity index 100% rename from Resources/lysuite/ly02e_Rests_NoType.xml rename to data/lysuite/ly02e_Rests_NoType.xml diff --git a/Resources/lysuite/ly02e_Rests_NoType_Finale.pdf b/data/lysuite/ly02e_Rests_NoType_Finale.pdf similarity index 100% rename from Resources/lysuite/ly02e_Rests_NoType_Finale.pdf rename to data/lysuite/ly02e_Rests_NoType_Finale.pdf diff --git a/Resources/lysuite/ly03a_Rhythm_Durations.musx b/data/lysuite/ly03a_Rhythm_Durations.musx similarity index 100% rename from Resources/lysuite/ly03a_Rhythm_Durations.musx rename to data/lysuite/ly03a_Rhythm_Durations.musx diff --git a/Resources/lysuite/ly03a_Rhythm_Durations.xml b/data/lysuite/ly03a_Rhythm_Durations.xml similarity index 100% rename from Resources/lysuite/ly03a_Rhythm_Durations.xml rename to data/lysuite/ly03a_Rhythm_Durations.xml diff --git a/Resources/lysuite/ly03a_Rhythm_Durations_Finale.pdf b/data/lysuite/ly03a_Rhythm_Durations_Finale.pdf similarity index 100% rename from Resources/lysuite/ly03a_Rhythm_Durations_Finale.pdf rename to data/lysuite/ly03a_Rhythm_Durations_Finale.pdf diff --git a/Resources/lysuite/ly03b_Rhythm_Backup.musx b/data/lysuite/ly03b_Rhythm_Backup.musx similarity index 100% rename from Resources/lysuite/ly03b_Rhythm_Backup.musx rename to data/lysuite/ly03b_Rhythm_Backup.musx diff --git a/Resources/lysuite/ly03b_Rhythm_Backup.xml b/data/lysuite/ly03b_Rhythm_Backup.xml similarity index 100% rename from Resources/lysuite/ly03b_Rhythm_Backup.xml rename to data/lysuite/ly03b_Rhythm_Backup.xml diff --git a/Resources/lysuite/ly03b_Rhythm_Backup_Finale.pdf b/data/lysuite/ly03b_Rhythm_Backup_Finale.pdf similarity index 100% rename from Resources/lysuite/ly03b_Rhythm_Backup_Finale.pdf rename to data/lysuite/ly03b_Rhythm_Backup_Finale.pdf diff --git a/Resources/lysuite/ly03c_Rhythm_DivisionChange.musx b/data/lysuite/ly03c_Rhythm_DivisionChange.musx similarity index 100% rename from Resources/lysuite/ly03c_Rhythm_DivisionChange.musx rename to data/lysuite/ly03c_Rhythm_DivisionChange.musx diff --git a/Resources/lysuite/ly03c_Rhythm_DivisionChange.xml b/data/lysuite/ly03c_Rhythm_DivisionChange.xml similarity index 100% rename from Resources/lysuite/ly03c_Rhythm_DivisionChange.xml rename to data/lysuite/ly03c_Rhythm_DivisionChange.xml diff --git a/Resources/lysuite/ly03c_Rhythm_DivisionChange_Finale.pdf b/data/lysuite/ly03c_Rhythm_DivisionChange_Finale.pdf similarity index 100% rename from Resources/lysuite/ly03c_Rhythm_DivisionChange_Finale.pdf rename to data/lysuite/ly03c_Rhythm_DivisionChange_Finale.pdf diff --git a/Resources/lysuite/ly03d_Rhythm_DottedDurations_Factors.musx b/data/lysuite/ly03d_Rhythm_DottedDurations_Factors.musx similarity index 100% rename from Resources/lysuite/ly03d_Rhythm_DottedDurations_Factors.musx rename to data/lysuite/ly03d_Rhythm_DottedDurations_Factors.musx diff --git a/Resources/lysuite/ly03d_Rhythm_DottedDurations_Factors.xml b/data/lysuite/ly03d_Rhythm_DottedDurations_Factors.xml similarity index 100% rename from Resources/lysuite/ly03d_Rhythm_DottedDurations_Factors.xml rename to data/lysuite/ly03d_Rhythm_DottedDurations_Factors.xml diff --git a/Resources/lysuite/ly03d_Rhythm_DottedDurations_Factors_Finale.pdf b/data/lysuite/ly03d_Rhythm_DottedDurations_Factors_Finale.pdf similarity index 100% rename from Resources/lysuite/ly03d_Rhythm_DottedDurations_Factors_Finale.pdf rename to data/lysuite/ly03d_Rhythm_DottedDurations_Factors_Finale.pdf diff --git a/Resources/lysuite/ly11a_TimeSignatures.dorico b/data/lysuite/ly11a_TimeSignatures.dorico similarity index 100% rename from Resources/lysuite/ly11a_TimeSignatures.dorico rename to data/lysuite/ly11a_TimeSignatures.dorico diff --git a/Resources/lysuite/ly11a_TimeSignatures.musx b/data/lysuite/ly11a_TimeSignatures.musx similarity index 100% rename from Resources/lysuite/ly11a_TimeSignatures.musx rename to data/lysuite/ly11a_TimeSignatures.musx diff --git a/Resources/lysuite/ly11a_TimeSignatures.xml b/data/lysuite/ly11a_TimeSignatures.xml similarity index 100% rename from Resources/lysuite/ly11a_TimeSignatures.xml rename to data/lysuite/ly11a_TimeSignatures.xml diff --git a/Resources/lysuite/ly11a_TimeSignatures_Dorico.pdf b/data/lysuite/ly11a_TimeSignatures_Dorico.pdf similarity index 100% rename from Resources/lysuite/ly11a_TimeSignatures_Dorico.pdf rename to data/lysuite/ly11a_TimeSignatures_Dorico.pdf diff --git a/Resources/lysuite/ly11a_TimeSignatures_Finale.pdf b/data/lysuite/ly11a_TimeSignatures_Finale.pdf similarity index 100% rename from Resources/lysuite/ly11a_TimeSignatures_Finale.pdf rename to data/lysuite/ly11a_TimeSignatures_Finale.pdf diff --git a/Resources/lysuite/ly11b_TimeSignatures_NoTime.musx b/data/lysuite/ly11b_TimeSignatures_NoTime.musx similarity index 100% rename from Resources/lysuite/ly11b_TimeSignatures_NoTime.musx rename to data/lysuite/ly11b_TimeSignatures_NoTime.musx diff --git a/Resources/lysuite/ly11b_TimeSignatures_NoTime.xml b/data/lysuite/ly11b_TimeSignatures_NoTime.xml similarity index 100% rename from Resources/lysuite/ly11b_TimeSignatures_NoTime.xml rename to data/lysuite/ly11b_TimeSignatures_NoTime.xml diff --git a/Resources/lysuite/ly11b_TimeSignatures_NoTime_Finale.pdf b/data/lysuite/ly11b_TimeSignatures_NoTime_Finale.pdf similarity index 100% rename from Resources/lysuite/ly11b_TimeSignatures_NoTime_Finale.pdf rename to data/lysuite/ly11b_TimeSignatures_NoTime_Finale.pdf diff --git a/Resources/lysuite/ly11c_TimeSignatures_CompoundSimple.musx b/data/lysuite/ly11c_TimeSignatures_CompoundSimple.musx similarity index 100% rename from Resources/lysuite/ly11c_TimeSignatures_CompoundSimple.musx rename to data/lysuite/ly11c_TimeSignatures_CompoundSimple.musx diff --git a/Resources/lysuite/ly11c_TimeSignatures_CompoundSimple.xml b/data/lysuite/ly11c_TimeSignatures_CompoundSimple.xml similarity index 100% rename from Resources/lysuite/ly11c_TimeSignatures_CompoundSimple.xml rename to data/lysuite/ly11c_TimeSignatures_CompoundSimple.xml diff --git a/Resources/lysuite/ly11c_TimeSignatures_CompoundSimple_Finale.pdf b/data/lysuite/ly11c_TimeSignatures_CompoundSimple_Finale.pdf similarity index 100% rename from Resources/lysuite/ly11c_TimeSignatures_CompoundSimple_Finale.pdf rename to data/lysuite/ly11c_TimeSignatures_CompoundSimple_Finale.pdf diff --git a/Resources/lysuite/ly11d_TimeSignatures_CompoundMultiple.musx b/data/lysuite/ly11d_TimeSignatures_CompoundMultiple.musx similarity index 100% rename from Resources/lysuite/ly11d_TimeSignatures_CompoundMultiple.musx rename to data/lysuite/ly11d_TimeSignatures_CompoundMultiple.musx diff --git a/Resources/lysuite/ly11d_TimeSignatures_CompoundMultiple.xml b/data/lysuite/ly11d_TimeSignatures_CompoundMultiple.xml similarity index 100% rename from Resources/lysuite/ly11d_TimeSignatures_CompoundMultiple.xml rename to data/lysuite/ly11d_TimeSignatures_CompoundMultiple.xml diff --git a/Resources/lysuite/ly11d_TimeSignatures_CompoundMultiple_Finale.pdf b/data/lysuite/ly11d_TimeSignatures_CompoundMultiple_Finale.pdf similarity index 100% rename from Resources/lysuite/ly11d_TimeSignatures_CompoundMultiple_Finale.pdf rename to data/lysuite/ly11d_TimeSignatures_CompoundMultiple_Finale.pdf diff --git a/Resources/lysuite/ly11e_TimeSignatures_CompoundMixed.musx b/data/lysuite/ly11e_TimeSignatures_CompoundMixed.musx similarity index 100% rename from Resources/lysuite/ly11e_TimeSignatures_CompoundMixed.musx rename to data/lysuite/ly11e_TimeSignatures_CompoundMixed.musx diff --git a/Resources/lysuite/ly11e_TimeSignatures_CompoundMixed.xml b/data/lysuite/ly11e_TimeSignatures_CompoundMixed.xml similarity index 100% rename from Resources/lysuite/ly11e_TimeSignatures_CompoundMixed.xml rename to data/lysuite/ly11e_TimeSignatures_CompoundMixed.xml diff --git a/Resources/lysuite/ly11e_TimeSignatures_CompoundMixed_Finale.pdf b/data/lysuite/ly11e_TimeSignatures_CompoundMixed_Finale.pdf similarity index 100% rename from Resources/lysuite/ly11e_TimeSignatures_CompoundMixed_Finale.pdf rename to data/lysuite/ly11e_TimeSignatures_CompoundMixed_Finale.pdf diff --git a/Resources/lysuite/ly11f_TimeSignatures_SymbolMeaning.musx b/data/lysuite/ly11f_TimeSignatures_SymbolMeaning.musx similarity index 100% rename from Resources/lysuite/ly11f_TimeSignatures_SymbolMeaning.musx rename to data/lysuite/ly11f_TimeSignatures_SymbolMeaning.musx diff --git a/Resources/lysuite/ly11f_TimeSignatures_SymbolMeaning.xml b/data/lysuite/ly11f_TimeSignatures_SymbolMeaning.xml similarity index 100% rename from Resources/lysuite/ly11f_TimeSignatures_SymbolMeaning.xml rename to data/lysuite/ly11f_TimeSignatures_SymbolMeaning.xml diff --git a/Resources/lysuite/ly11f_TimeSignatures_SymbolMeaning_Finale.pdf b/data/lysuite/ly11f_TimeSignatures_SymbolMeaning_Finale.pdf similarity index 100% rename from Resources/lysuite/ly11f_TimeSignatures_SymbolMeaning_Finale.pdf rename to data/lysuite/ly11f_TimeSignatures_SymbolMeaning_Finale.pdf diff --git a/Resources/lysuite/ly11g_TimeSignatures_SingleNumber.musx b/data/lysuite/ly11g_TimeSignatures_SingleNumber.musx similarity index 100% rename from Resources/lysuite/ly11g_TimeSignatures_SingleNumber.musx rename to data/lysuite/ly11g_TimeSignatures_SingleNumber.musx diff --git a/Resources/lysuite/ly11g_TimeSignatures_SingleNumber.xml b/data/lysuite/ly11g_TimeSignatures_SingleNumber.xml similarity index 100% rename from Resources/lysuite/ly11g_TimeSignatures_SingleNumber.xml rename to data/lysuite/ly11g_TimeSignatures_SingleNumber.xml diff --git a/Resources/lysuite/ly11g_TimeSignatures_SingleNumber_Finale.pdf b/data/lysuite/ly11g_TimeSignatures_SingleNumber_Finale.pdf similarity index 100% rename from Resources/lysuite/ly11g_TimeSignatures_SingleNumber_Finale.pdf rename to data/lysuite/ly11g_TimeSignatures_SingleNumber_Finale.pdf diff --git a/Resources/lysuite/ly11h_TimeSignatures_SenzaMisura.musx b/data/lysuite/ly11h_TimeSignatures_SenzaMisura.musx similarity index 100% rename from Resources/lysuite/ly11h_TimeSignatures_SenzaMisura.musx rename to data/lysuite/ly11h_TimeSignatures_SenzaMisura.musx diff --git a/Resources/lysuite/ly11h_TimeSignatures_SenzaMisura.xml b/data/lysuite/ly11h_TimeSignatures_SenzaMisura.xml similarity index 100% rename from Resources/lysuite/ly11h_TimeSignatures_SenzaMisura.xml rename to data/lysuite/ly11h_TimeSignatures_SenzaMisura.xml diff --git a/Resources/lysuite/ly11h_TimeSignatures_SenzaMisura_Finale.pdf b/data/lysuite/ly11h_TimeSignatures_SenzaMisura_Finale.pdf similarity index 100% rename from Resources/lysuite/ly11h_TimeSignatures_SenzaMisura_Finale.pdf rename to data/lysuite/ly11h_TimeSignatures_SenzaMisura_Finale.pdf diff --git a/Resources/lysuite/ly12a_Clefs.musx b/data/lysuite/ly12a_Clefs.musx similarity index 100% rename from Resources/lysuite/ly12a_Clefs.musx rename to data/lysuite/ly12a_Clefs.musx diff --git a/Resources/lysuite/ly12a_Clefs.xml b/data/lysuite/ly12a_Clefs.xml similarity index 100% rename from Resources/lysuite/ly12a_Clefs.xml rename to data/lysuite/ly12a_Clefs.xml diff --git a/Resources/lysuite/ly12a_Clefs_Finale.pdf b/data/lysuite/ly12a_Clefs_Finale.pdf similarity index 100% rename from Resources/lysuite/ly12a_Clefs_Finale.pdf rename to data/lysuite/ly12a_Clefs_Finale.pdf diff --git a/Resources/lysuite/ly12b_Clefs_NoKeyOrClef.musx b/data/lysuite/ly12b_Clefs_NoKeyOrClef.musx similarity index 100% rename from Resources/lysuite/ly12b_Clefs_NoKeyOrClef.musx rename to data/lysuite/ly12b_Clefs_NoKeyOrClef.musx diff --git a/Resources/lysuite/ly12b_Clefs_NoKeyOrClef.xml b/data/lysuite/ly12b_Clefs_NoKeyOrClef.xml similarity index 100% rename from Resources/lysuite/ly12b_Clefs_NoKeyOrClef.xml rename to data/lysuite/ly12b_Clefs_NoKeyOrClef.xml diff --git a/Resources/lysuite/ly12b_Clefs_NoKeyOrClef_Finale.pdf b/data/lysuite/ly12b_Clefs_NoKeyOrClef_Finale.pdf similarity index 100% rename from Resources/lysuite/ly12b_Clefs_NoKeyOrClef_Finale.pdf rename to data/lysuite/ly12b_Clefs_NoKeyOrClef_Finale.pdf diff --git a/Resources/lysuite/ly13a_KeySignatures.musx b/data/lysuite/ly13a_KeySignatures.musx similarity index 100% rename from Resources/lysuite/ly13a_KeySignatures.musx rename to data/lysuite/ly13a_KeySignatures.musx diff --git a/Resources/lysuite/ly13a_KeySignatures.xml b/data/lysuite/ly13a_KeySignatures.xml similarity index 100% rename from Resources/lysuite/ly13a_KeySignatures.xml rename to data/lysuite/ly13a_KeySignatures.xml diff --git a/Resources/lysuite/ly13a_KeySignatures_Finale.pdf b/data/lysuite/ly13a_KeySignatures_Finale.pdf similarity index 100% rename from Resources/lysuite/ly13a_KeySignatures_Finale.pdf rename to data/lysuite/ly13a_KeySignatures_Finale.pdf diff --git a/Resources/lysuite/ly13b_KeySignatures_ChurchModes.musx b/data/lysuite/ly13b_KeySignatures_ChurchModes.musx similarity index 100% rename from Resources/lysuite/ly13b_KeySignatures_ChurchModes.musx rename to data/lysuite/ly13b_KeySignatures_ChurchModes.musx diff --git a/Resources/lysuite/ly13b_KeySignatures_ChurchModes.xml b/data/lysuite/ly13b_KeySignatures_ChurchModes.xml similarity index 100% rename from Resources/lysuite/ly13b_KeySignatures_ChurchModes.xml rename to data/lysuite/ly13b_KeySignatures_ChurchModes.xml diff --git a/Resources/lysuite/ly13b_KeySignatures_ChurchModes_Finale.pdf b/data/lysuite/ly13b_KeySignatures_ChurchModes_Finale.pdf similarity index 100% rename from Resources/lysuite/ly13b_KeySignatures_ChurchModes_Finale.pdf rename to data/lysuite/ly13b_KeySignatures_ChurchModes_Finale.pdf diff --git a/Resources/lysuite/ly13c_KeySignatures_NonTraditional.musx b/data/lysuite/ly13c_KeySignatures_NonTraditional.musx similarity index 100% rename from Resources/lysuite/ly13c_KeySignatures_NonTraditional.musx rename to data/lysuite/ly13c_KeySignatures_NonTraditional.musx diff --git a/Resources/lysuite/ly13c_KeySignatures_NonTraditional.xml b/data/lysuite/ly13c_KeySignatures_NonTraditional.xml similarity index 100% rename from Resources/lysuite/ly13c_KeySignatures_NonTraditional.xml rename to data/lysuite/ly13c_KeySignatures_NonTraditional.xml diff --git a/Resources/lysuite/ly13c_KeySignatures_NonTraditional_Finale.pdf b/data/lysuite/ly13c_KeySignatures_NonTraditional_Finale.pdf similarity index 100% rename from Resources/lysuite/ly13c_KeySignatures_NonTraditional_Finale.pdf rename to data/lysuite/ly13c_KeySignatures_NonTraditional_Finale.pdf diff --git a/Resources/lysuite/ly13d_KeySignatures_Microtones.musx b/data/lysuite/ly13d_KeySignatures_Microtones.musx similarity index 100% rename from Resources/lysuite/ly13d_KeySignatures_Microtones.musx rename to data/lysuite/ly13d_KeySignatures_Microtones.musx diff --git a/Resources/lysuite/ly13d_KeySignatures_Microtones.xml b/data/lysuite/ly13d_KeySignatures_Microtones.xml similarity index 100% rename from Resources/lysuite/ly13d_KeySignatures_Microtones.xml rename to data/lysuite/ly13d_KeySignatures_Microtones.xml diff --git a/Resources/lysuite/ly13d_KeySignatures_Microtones_Finale.pdf b/data/lysuite/ly13d_KeySignatures_Microtones_Finale.pdf similarity index 100% rename from Resources/lysuite/ly13d_KeySignatures_Microtones_Finale.pdf rename to data/lysuite/ly13d_KeySignatures_Microtones_Finale.pdf diff --git a/Resources/lysuite/ly14a_StaffDetails_LineChanges.musx b/data/lysuite/ly14a_StaffDetails_LineChanges.musx similarity index 100% rename from Resources/lysuite/ly14a_StaffDetails_LineChanges.musx rename to data/lysuite/ly14a_StaffDetails_LineChanges.musx diff --git a/Resources/lysuite/ly14a_StaffDetails_LineChanges.xml b/data/lysuite/ly14a_StaffDetails_LineChanges.xml similarity index 100% rename from Resources/lysuite/ly14a_StaffDetails_LineChanges.xml rename to data/lysuite/ly14a_StaffDetails_LineChanges.xml diff --git a/Resources/lysuite/ly14a_StaffDetails_LineChanges_Finale.pdf b/data/lysuite/ly14a_StaffDetails_LineChanges_Finale.pdf similarity index 100% rename from Resources/lysuite/ly14a_StaffDetails_LineChanges_Finale.pdf rename to data/lysuite/ly14a_StaffDetails_LineChanges_Finale.pdf diff --git a/Resources/lysuite/ly21a_Chord_Basic.musx b/data/lysuite/ly21a_Chord_Basic.musx similarity index 100% rename from Resources/lysuite/ly21a_Chord_Basic.musx rename to data/lysuite/ly21a_Chord_Basic.musx diff --git a/Resources/lysuite/ly21a_Chord_Basic.xml b/data/lysuite/ly21a_Chord_Basic.xml similarity index 100% rename from Resources/lysuite/ly21a_Chord_Basic.xml rename to data/lysuite/ly21a_Chord_Basic.xml diff --git a/Resources/lysuite/ly21a_Chord_Basic_Finale.pdf b/data/lysuite/ly21a_Chord_Basic_Finale.pdf similarity index 100% rename from Resources/lysuite/ly21a_Chord_Basic_Finale.pdf rename to data/lysuite/ly21a_Chord_Basic_Finale.pdf diff --git a/Resources/lysuite/ly21b_Chords_TwoNotes.musx b/data/lysuite/ly21b_Chords_TwoNotes.musx similarity index 100% rename from Resources/lysuite/ly21b_Chords_TwoNotes.musx rename to data/lysuite/ly21b_Chords_TwoNotes.musx diff --git a/Resources/lysuite/ly21b_Chords_TwoNotes.xml b/data/lysuite/ly21b_Chords_TwoNotes.xml similarity index 100% rename from Resources/lysuite/ly21b_Chords_TwoNotes.xml rename to data/lysuite/ly21b_Chords_TwoNotes.xml diff --git a/Resources/lysuite/ly21b_Chords_TwoNotes_Finale.pdf b/data/lysuite/ly21b_Chords_TwoNotes_Finale.pdf similarity index 100% rename from Resources/lysuite/ly21b_Chords_TwoNotes_Finale.pdf rename to data/lysuite/ly21b_Chords_TwoNotes_Finale.pdf diff --git a/Resources/lysuite/ly21c_Chords_ThreeNotesDuration.musx b/data/lysuite/ly21c_Chords_ThreeNotesDuration.musx similarity index 100% rename from Resources/lysuite/ly21c_Chords_ThreeNotesDuration.musx rename to data/lysuite/ly21c_Chords_ThreeNotesDuration.musx diff --git a/Resources/lysuite/ly21c_Chords_ThreeNotesDuration.xml b/data/lysuite/ly21c_Chords_ThreeNotesDuration.xml similarity index 100% rename from Resources/lysuite/ly21c_Chords_ThreeNotesDuration.xml rename to data/lysuite/ly21c_Chords_ThreeNotesDuration.xml diff --git a/Resources/lysuite/ly21c_Chords_ThreeNotesDuration_Finale.pdf b/data/lysuite/ly21c_Chords_ThreeNotesDuration_Finale.pdf similarity index 100% rename from Resources/lysuite/ly21c_Chords_ThreeNotesDuration_Finale.pdf rename to data/lysuite/ly21c_Chords_ThreeNotesDuration_Finale.pdf diff --git a/Resources/lysuite/ly21d_Chords_SchubertStabatMater.musx b/data/lysuite/ly21d_Chords_SchubertStabatMater.musx similarity index 100% rename from Resources/lysuite/ly21d_Chords_SchubertStabatMater.musx rename to data/lysuite/ly21d_Chords_SchubertStabatMater.musx diff --git a/Resources/lysuite/ly21d_Chords_SchubertStabatMater.xml b/data/lysuite/ly21d_Chords_SchubertStabatMater.xml similarity index 100% rename from Resources/lysuite/ly21d_Chords_SchubertStabatMater.xml rename to data/lysuite/ly21d_Chords_SchubertStabatMater.xml diff --git a/Resources/lysuite/ly21d_Chords_SchubertStabatMater_Finale.pdf b/data/lysuite/ly21d_Chords_SchubertStabatMater_Finale.pdf similarity index 100% rename from Resources/lysuite/ly21d_Chords_SchubertStabatMater_Finale.pdf rename to data/lysuite/ly21d_Chords_SchubertStabatMater_Finale.pdf diff --git a/Resources/lysuite/ly21e_Chords_PickupMeasures.musx b/data/lysuite/ly21e_Chords_PickupMeasures.musx similarity index 100% rename from Resources/lysuite/ly21e_Chords_PickupMeasures.musx rename to data/lysuite/ly21e_Chords_PickupMeasures.musx diff --git a/Resources/lysuite/ly21e_Chords_PickupMeasures.xml b/data/lysuite/ly21e_Chords_PickupMeasures.xml similarity index 100% rename from Resources/lysuite/ly21e_Chords_PickupMeasures.xml rename to data/lysuite/ly21e_Chords_PickupMeasures.xml diff --git a/Resources/lysuite/ly21e_Chords_PickupMeasures_Finale.pdf b/data/lysuite/ly21e_Chords_PickupMeasures_Finale.pdf similarity index 100% rename from Resources/lysuite/ly21e_Chords_PickupMeasures_Finale.pdf rename to data/lysuite/ly21e_Chords_PickupMeasures_Finale.pdf diff --git a/Resources/lysuite/ly21f_Chord_ElementInBetween.musx b/data/lysuite/ly21f_Chord_ElementInBetween.musx similarity index 100% rename from Resources/lysuite/ly21f_Chord_ElementInBetween.musx rename to data/lysuite/ly21f_Chord_ElementInBetween.musx diff --git a/Resources/lysuite/ly21f_Chord_ElementInBetween.xml b/data/lysuite/ly21f_Chord_ElementInBetween.xml similarity index 100% rename from Resources/lysuite/ly21f_Chord_ElementInBetween.xml rename to data/lysuite/ly21f_Chord_ElementInBetween.xml diff --git a/Resources/lysuite/ly21f_Chord_ElementInBetween_Finale.pdf b/data/lysuite/ly21f_Chord_ElementInBetween_Finale.pdf similarity index 100% rename from Resources/lysuite/ly21f_Chord_ElementInBetween_Finale.pdf rename to data/lysuite/ly21f_Chord_ElementInBetween_Finale.pdf diff --git a/Resources/lysuite/ly22a_Noteheads.musx b/data/lysuite/ly22a_Noteheads.musx similarity index 100% rename from Resources/lysuite/ly22a_Noteheads.musx rename to data/lysuite/ly22a_Noteheads.musx diff --git a/Resources/lysuite/ly22a_Noteheads.xml b/data/lysuite/ly22a_Noteheads.xml similarity index 100% rename from Resources/lysuite/ly22a_Noteheads.xml rename to data/lysuite/ly22a_Noteheads.xml diff --git a/Resources/lysuite/ly22a_Noteheads_Finale.pdf b/data/lysuite/ly22a_Noteheads_Finale.pdf similarity index 100% rename from Resources/lysuite/ly22a_Noteheads_Finale.pdf rename to data/lysuite/ly22a_Noteheads_Finale.pdf diff --git a/Resources/lysuite/ly22b_Staff_Notestyles.musx b/data/lysuite/ly22b_Staff_Notestyles.musx similarity index 100% rename from Resources/lysuite/ly22b_Staff_Notestyles.musx rename to data/lysuite/ly22b_Staff_Notestyles.musx diff --git a/Resources/lysuite/ly22b_Staff_Notestyles.xml b/data/lysuite/ly22b_Staff_Notestyles.xml similarity index 100% rename from Resources/lysuite/ly22b_Staff_Notestyles.xml rename to data/lysuite/ly22b_Staff_Notestyles.xml diff --git a/Resources/lysuite/ly22b_Staff_Notestyles_Finale.pdf b/data/lysuite/ly22b_Staff_Notestyles_Finale.pdf similarity index 100% rename from Resources/lysuite/ly22b_Staff_Notestyles_Finale.pdf rename to data/lysuite/ly22b_Staff_Notestyles_Finale.pdf diff --git a/Resources/lysuite/ly22c_Noteheads_Chords.musx b/data/lysuite/ly22c_Noteheads_Chords.musx similarity index 100% rename from Resources/lysuite/ly22c_Noteheads_Chords.musx rename to data/lysuite/ly22c_Noteheads_Chords.musx diff --git a/Resources/lysuite/ly22c_Noteheads_Chords.xml b/data/lysuite/ly22c_Noteheads_Chords.xml similarity index 100% rename from Resources/lysuite/ly22c_Noteheads_Chords.xml rename to data/lysuite/ly22c_Noteheads_Chords.xml diff --git a/Resources/lysuite/ly22c_Noteheads_Chords_Finale.pdf b/data/lysuite/ly22c_Noteheads_Chords_Finale.pdf similarity index 100% rename from Resources/lysuite/ly22c_Noteheads_Chords_Finale.pdf rename to data/lysuite/ly22c_Noteheads_Chords_Finale.pdf diff --git a/Resources/lysuite/ly22d_Parenthesized_Noteheads.musx b/data/lysuite/ly22d_Parenthesized_Noteheads.musx similarity index 100% rename from Resources/lysuite/ly22d_Parenthesized_Noteheads.musx rename to data/lysuite/ly22d_Parenthesized_Noteheads.musx diff --git a/Resources/lysuite/ly22d_Parenthesized_Noteheads.xml b/data/lysuite/ly22d_Parenthesized_Noteheads.xml similarity index 100% rename from Resources/lysuite/ly22d_Parenthesized_Noteheads.xml rename to data/lysuite/ly22d_Parenthesized_Noteheads.xml diff --git a/Resources/lysuite/ly22d_Parenthesized_Noteheads_Finale.pdf b/data/lysuite/ly22d_Parenthesized_Noteheads_Finale.pdf similarity index 100% rename from Resources/lysuite/ly22d_Parenthesized_Noteheads_Finale.pdf rename to data/lysuite/ly22d_Parenthesized_Noteheads_Finale.pdf diff --git a/Resources/lysuite/ly23a_Tuplets.musx b/data/lysuite/ly23a_Tuplets.musx similarity index 100% rename from Resources/lysuite/ly23a_Tuplets.musx rename to data/lysuite/ly23a_Tuplets.musx diff --git a/Resources/lysuite/ly23a_Tuplets.xml b/data/lysuite/ly23a_Tuplets.xml similarity index 100% rename from Resources/lysuite/ly23a_Tuplets.xml rename to data/lysuite/ly23a_Tuplets.xml diff --git a/Resources/lysuite/ly23a_Tuplets_Finale.pdf b/data/lysuite/ly23a_Tuplets_Finale.pdf similarity index 100% rename from Resources/lysuite/ly23a_Tuplets_Finale.pdf rename to data/lysuite/ly23a_Tuplets_Finale.pdf diff --git a/Resources/lysuite/ly23b_Tuplets_Styles.musx b/data/lysuite/ly23b_Tuplets_Styles.musx similarity index 100% rename from Resources/lysuite/ly23b_Tuplets_Styles.musx rename to data/lysuite/ly23b_Tuplets_Styles.musx diff --git a/Resources/lysuite/ly23b_Tuplets_Styles.xml b/data/lysuite/ly23b_Tuplets_Styles.xml similarity index 100% rename from Resources/lysuite/ly23b_Tuplets_Styles.xml rename to data/lysuite/ly23b_Tuplets_Styles.xml diff --git a/Resources/lysuite/ly23b_Tuplets_Styles_Finale.pdf b/data/lysuite/ly23b_Tuplets_Styles_Finale.pdf similarity index 100% rename from Resources/lysuite/ly23b_Tuplets_Styles_Finale.pdf rename to data/lysuite/ly23b_Tuplets_Styles_Finale.pdf diff --git a/Resources/lysuite/ly23c_Tuplet_Display_NonStandard.musx b/data/lysuite/ly23c_Tuplet_Display_NonStandard.musx similarity index 100% rename from Resources/lysuite/ly23c_Tuplet_Display_NonStandard.musx rename to data/lysuite/ly23c_Tuplet_Display_NonStandard.musx diff --git a/Resources/lysuite/ly23c_Tuplet_Display_NonStandard.xml b/data/lysuite/ly23c_Tuplet_Display_NonStandard.xml similarity index 100% rename from Resources/lysuite/ly23c_Tuplet_Display_NonStandard.xml rename to data/lysuite/ly23c_Tuplet_Display_NonStandard.xml diff --git a/Resources/lysuite/ly23c_Tuplet_Display_NonStandard_Finale.pdf b/data/lysuite/ly23c_Tuplet_Display_NonStandard_Finale.pdf similarity index 100% rename from Resources/lysuite/ly23c_Tuplet_Display_NonStandard_Finale.pdf rename to data/lysuite/ly23c_Tuplet_Display_NonStandard_Finale.pdf diff --git a/Resources/lysuite/ly23d_Tuplets_Nested.musx b/data/lysuite/ly23d_Tuplets_Nested.musx similarity index 100% rename from Resources/lysuite/ly23d_Tuplets_Nested.musx rename to data/lysuite/ly23d_Tuplets_Nested.musx diff --git a/Resources/lysuite/ly23d_Tuplets_Nested.xml b/data/lysuite/ly23d_Tuplets_Nested.xml similarity index 100% rename from Resources/lysuite/ly23d_Tuplets_Nested.xml rename to data/lysuite/ly23d_Tuplets_Nested.xml diff --git a/Resources/lysuite/ly23d_Tuplets_Nested_Finale.pdf b/data/lysuite/ly23d_Tuplets_Nested_Finale.pdf similarity index 100% rename from Resources/lysuite/ly23d_Tuplets_Nested_Finale.pdf rename to data/lysuite/ly23d_Tuplets_Nested_Finale.pdf diff --git a/Resources/lysuite/ly23e_Tuplets_Tremolo.musx b/data/lysuite/ly23e_Tuplets_Tremolo.musx similarity index 100% rename from Resources/lysuite/ly23e_Tuplets_Tremolo.musx rename to data/lysuite/ly23e_Tuplets_Tremolo.musx diff --git a/Resources/lysuite/ly23e_Tuplets_Tremolo.xml b/data/lysuite/ly23e_Tuplets_Tremolo.xml similarity index 100% rename from Resources/lysuite/ly23e_Tuplets_Tremolo.xml rename to data/lysuite/ly23e_Tuplets_Tremolo.xml diff --git a/Resources/lysuite/ly23e_Tuplets_Tremolo_Finale.pdf b/data/lysuite/ly23e_Tuplets_Tremolo_Finale.pdf similarity index 100% rename from Resources/lysuite/ly23e_Tuplets_Tremolo_Finale.pdf rename to data/lysuite/ly23e_Tuplets_Tremolo_Finale.pdf diff --git a/Resources/lysuite/ly23f_Tuplets_DurationButNoBracket.musx b/data/lysuite/ly23f_Tuplets_DurationButNoBracket.musx similarity index 100% rename from Resources/lysuite/ly23f_Tuplets_DurationButNoBracket.musx rename to data/lysuite/ly23f_Tuplets_DurationButNoBracket.musx diff --git a/Resources/lysuite/ly23f_Tuplets_DurationButNoBracket.xml b/data/lysuite/ly23f_Tuplets_DurationButNoBracket.xml similarity index 100% rename from Resources/lysuite/ly23f_Tuplets_DurationButNoBracket.xml rename to data/lysuite/ly23f_Tuplets_DurationButNoBracket.xml diff --git a/Resources/lysuite/ly23f_Tuplets_DurationButNoBracket_Finale.pdf b/data/lysuite/ly23f_Tuplets_DurationButNoBracket_Finale.pdf similarity index 100% rename from Resources/lysuite/ly23f_Tuplets_DurationButNoBracket_Finale.pdf rename to data/lysuite/ly23f_Tuplets_DurationButNoBracket_Finale.pdf diff --git a/Resources/lysuite/ly24a_GraceNotes.musx b/data/lysuite/ly24a_GraceNotes.musx similarity index 100% rename from Resources/lysuite/ly24a_GraceNotes.musx rename to data/lysuite/ly24a_GraceNotes.musx diff --git a/Resources/lysuite/ly24a_GraceNotes.xml b/data/lysuite/ly24a_GraceNotes.xml similarity index 100% rename from Resources/lysuite/ly24a_GraceNotes.xml rename to data/lysuite/ly24a_GraceNotes.xml diff --git a/Resources/lysuite/ly24a_GraceNotes_Finale.pdf b/data/lysuite/ly24a_GraceNotes_Finale.pdf similarity index 100% rename from Resources/lysuite/ly24a_GraceNotes_Finale.pdf rename to data/lysuite/ly24a_GraceNotes_Finale.pdf diff --git a/Resources/lysuite/ly24b_ChordAsGraceNote.musx b/data/lysuite/ly24b_ChordAsGraceNote.musx similarity index 100% rename from Resources/lysuite/ly24b_ChordAsGraceNote.musx rename to data/lysuite/ly24b_ChordAsGraceNote.musx diff --git a/Resources/lysuite/ly24b_ChordAsGraceNote.xml b/data/lysuite/ly24b_ChordAsGraceNote.xml similarity index 100% rename from Resources/lysuite/ly24b_ChordAsGraceNote.xml rename to data/lysuite/ly24b_ChordAsGraceNote.xml diff --git a/Resources/lysuite/ly24b_ChordAsGraceNote_Finale.pdf b/data/lysuite/ly24b_ChordAsGraceNote_Finale.pdf similarity index 100% rename from Resources/lysuite/ly24b_ChordAsGraceNote_Finale.pdf rename to data/lysuite/ly24b_ChordAsGraceNote_Finale.pdf diff --git a/Resources/lysuite/ly24c_GraceNote_MeasureEnd.musx b/data/lysuite/ly24c_GraceNote_MeasureEnd.musx similarity index 100% rename from Resources/lysuite/ly24c_GraceNote_MeasureEnd.musx rename to data/lysuite/ly24c_GraceNote_MeasureEnd.musx diff --git a/Resources/lysuite/ly24c_GraceNote_MeasureEnd.xml b/data/lysuite/ly24c_GraceNote_MeasureEnd.xml similarity index 100% rename from Resources/lysuite/ly24c_GraceNote_MeasureEnd.xml rename to data/lysuite/ly24c_GraceNote_MeasureEnd.xml diff --git a/Resources/lysuite/ly24c_GraceNote_MeasureEnd_Finale.pdf b/data/lysuite/ly24c_GraceNote_MeasureEnd_Finale.pdf similarity index 100% rename from Resources/lysuite/ly24c_GraceNote_MeasureEnd_Finale.pdf rename to data/lysuite/ly24c_GraceNote_MeasureEnd_Finale.pdf diff --git a/Resources/lysuite/ly24d_AfterGrace.musx b/data/lysuite/ly24d_AfterGrace.musx similarity index 100% rename from Resources/lysuite/ly24d_AfterGrace.musx rename to data/lysuite/ly24d_AfterGrace.musx diff --git a/Resources/lysuite/ly24d_AfterGrace.xml b/data/lysuite/ly24d_AfterGrace.xml similarity index 100% rename from Resources/lysuite/ly24d_AfterGrace.xml rename to data/lysuite/ly24d_AfterGrace.xml diff --git a/Resources/lysuite/ly24d_AfterGrace_Finale.pdf b/data/lysuite/ly24d_AfterGrace_Finale.pdf similarity index 100% rename from Resources/lysuite/ly24d_AfterGrace_Finale.pdf rename to data/lysuite/ly24d_AfterGrace_Finale.pdf diff --git a/Resources/lysuite/ly24e_GraceNote_StaffChange.musx b/data/lysuite/ly24e_GraceNote_StaffChange.musx similarity index 100% rename from Resources/lysuite/ly24e_GraceNote_StaffChange.musx rename to data/lysuite/ly24e_GraceNote_StaffChange.musx diff --git a/Resources/lysuite/ly24e_GraceNote_StaffChange.xml b/data/lysuite/ly24e_GraceNote_StaffChange.xml similarity index 100% rename from Resources/lysuite/ly24e_GraceNote_StaffChange.xml rename to data/lysuite/ly24e_GraceNote_StaffChange.xml diff --git a/Resources/lysuite/ly24e_GraceNote_StaffChange_Finale.pdf b/data/lysuite/ly24e_GraceNote_StaffChange_Finale.pdf similarity index 100% rename from Resources/lysuite/ly24e_GraceNote_StaffChange_Finale.pdf rename to data/lysuite/ly24e_GraceNote_StaffChange_Finale.pdf diff --git a/Resources/lysuite/ly24f_GraceNote_Slur.musx b/data/lysuite/ly24f_GraceNote_Slur.musx similarity index 100% rename from Resources/lysuite/ly24f_GraceNote_Slur.musx rename to data/lysuite/ly24f_GraceNote_Slur.musx diff --git a/Resources/lysuite/ly24f_GraceNote_Slur.xml b/data/lysuite/ly24f_GraceNote_Slur.xml similarity index 100% rename from Resources/lysuite/ly24f_GraceNote_Slur.xml rename to data/lysuite/ly24f_GraceNote_Slur.xml diff --git a/Resources/lysuite/ly24f_GraceNote_Slur_Finale.pdf b/data/lysuite/ly24f_GraceNote_Slur_Finale.pdf similarity index 100% rename from Resources/lysuite/ly24f_GraceNote_Slur_Finale.pdf rename to data/lysuite/ly24f_GraceNote_Slur_Finale.pdf diff --git a/Resources/lysuite/ly31a_Directions.musx b/data/lysuite/ly31a_Directions.musx similarity index 100% rename from Resources/lysuite/ly31a_Directions.musx rename to data/lysuite/ly31a_Directions.musx diff --git a/Resources/lysuite/ly31a_Directions.xml b/data/lysuite/ly31a_Directions.xml similarity index 100% rename from Resources/lysuite/ly31a_Directions.xml rename to data/lysuite/ly31a_Directions.xml diff --git a/Resources/lysuite/ly31a_Directions_Finale.pdf b/data/lysuite/ly31a_Directions_Finale.pdf similarity index 100% rename from Resources/lysuite/ly31a_Directions_Finale.pdf rename to data/lysuite/ly31a_Directions_Finale.pdf diff --git a/Resources/lysuite/ly31c_MetronomeMarks.musx b/data/lysuite/ly31c_MetronomeMarks.musx similarity index 100% rename from Resources/lysuite/ly31c_MetronomeMarks.musx rename to data/lysuite/ly31c_MetronomeMarks.musx diff --git a/Resources/lysuite/ly31c_MetronomeMarks.xml b/data/lysuite/ly31c_MetronomeMarks.xml similarity index 100% rename from Resources/lysuite/ly31c_MetronomeMarks.xml rename to data/lysuite/ly31c_MetronomeMarks.xml diff --git a/Resources/lysuite/ly31c_MetronomeMarks_Finale.pdf b/data/lysuite/ly31c_MetronomeMarks_Finale.pdf similarity index 100% rename from Resources/lysuite/ly31c_MetronomeMarks_Finale.pdf rename to data/lysuite/ly31c_MetronomeMarks_Finale.pdf diff --git a/Resources/lysuite/ly32a_Notations.musx b/data/lysuite/ly32a_Notations.musx similarity index 100% rename from Resources/lysuite/ly32a_Notations.musx rename to data/lysuite/ly32a_Notations.musx diff --git a/Resources/lysuite/ly32a_Notations.xml b/data/lysuite/ly32a_Notations.xml similarity index 100% rename from Resources/lysuite/ly32a_Notations.xml rename to data/lysuite/ly32a_Notations.xml diff --git a/Resources/lysuite/ly32a_Notations_Finale.pdf b/data/lysuite/ly32a_Notations_Finale.pdf similarity index 100% rename from Resources/lysuite/ly32a_Notations_Finale.pdf rename to data/lysuite/ly32a_Notations_Finale.pdf diff --git a/Resources/lysuite/ly32b_Articulations_Texts.musx b/data/lysuite/ly32b_Articulations_Texts.musx similarity index 100% rename from Resources/lysuite/ly32b_Articulations_Texts.musx rename to data/lysuite/ly32b_Articulations_Texts.musx diff --git a/Resources/lysuite/ly32b_Articulations_Texts.xml b/data/lysuite/ly32b_Articulations_Texts.xml similarity index 100% rename from Resources/lysuite/ly32b_Articulations_Texts.xml rename to data/lysuite/ly32b_Articulations_Texts.xml diff --git a/Resources/lysuite/ly32b_Articulations_Texts_Finale.pdf b/data/lysuite/ly32b_Articulations_Texts_Finale.pdf similarity index 100% rename from Resources/lysuite/ly32b_Articulations_Texts_Finale.pdf rename to data/lysuite/ly32b_Articulations_Texts_Finale.pdf diff --git a/Resources/lysuite/ly32c_MultipleNotationChildren.musx b/data/lysuite/ly32c_MultipleNotationChildren.musx similarity index 100% rename from Resources/lysuite/ly32c_MultipleNotationChildren.musx rename to data/lysuite/ly32c_MultipleNotationChildren.musx diff --git a/Resources/lysuite/ly32c_MultipleNotationChildren.xml b/data/lysuite/ly32c_MultipleNotationChildren.xml similarity index 100% rename from Resources/lysuite/ly32c_MultipleNotationChildren.xml rename to data/lysuite/ly32c_MultipleNotationChildren.xml diff --git a/Resources/lysuite/ly32c_MultipleNotationChildren_Finale.pdf b/data/lysuite/ly32c_MultipleNotationChildren_Finale.pdf similarity index 100% rename from Resources/lysuite/ly32c_MultipleNotationChildren_Finale.pdf rename to data/lysuite/ly32c_MultipleNotationChildren_Finale.pdf diff --git a/Resources/lysuite/ly32d_Arpeggio.musx b/data/lysuite/ly32d_Arpeggio.musx similarity index 100% rename from Resources/lysuite/ly32d_Arpeggio.musx rename to data/lysuite/ly32d_Arpeggio.musx diff --git a/Resources/lysuite/ly32d_Arpeggio.xml b/data/lysuite/ly32d_Arpeggio.xml similarity index 100% rename from Resources/lysuite/ly32d_Arpeggio.xml rename to data/lysuite/ly32d_Arpeggio.xml diff --git a/Resources/lysuite/ly32d_Arpeggio_Finale.pdf b/data/lysuite/ly32d_Arpeggio_Finale.pdf similarity index 100% rename from Resources/lysuite/ly32d_Arpeggio_Finale.pdf rename to data/lysuite/ly32d_Arpeggio_Finale.pdf diff --git a/Resources/lysuite/ly33a_Spanners.musx b/data/lysuite/ly33a_Spanners.musx similarity index 100% rename from Resources/lysuite/ly33a_Spanners.musx rename to data/lysuite/ly33a_Spanners.musx diff --git a/Resources/lysuite/ly33a_Spanners.xml b/data/lysuite/ly33a_Spanners.xml similarity index 100% rename from Resources/lysuite/ly33a_Spanners.xml rename to data/lysuite/ly33a_Spanners.xml diff --git a/Resources/lysuite/ly33a_Spanners_Finale.pdf b/data/lysuite/ly33a_Spanners_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33a_Spanners_Finale.pdf rename to data/lysuite/ly33a_Spanners_Finale.pdf diff --git a/Resources/lysuite/ly33b_Spanners_Tie.musx b/data/lysuite/ly33b_Spanners_Tie.musx similarity index 100% rename from Resources/lysuite/ly33b_Spanners_Tie.musx rename to data/lysuite/ly33b_Spanners_Tie.musx diff --git a/Resources/lysuite/ly33b_Spanners_Tie.xml b/data/lysuite/ly33b_Spanners_Tie.xml similarity index 100% rename from Resources/lysuite/ly33b_Spanners_Tie.xml rename to data/lysuite/ly33b_Spanners_Tie.xml diff --git a/Resources/lysuite/ly33b_Spanners_Tie_Finale.pdf b/data/lysuite/ly33b_Spanners_Tie_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33b_Spanners_Tie_Finale.pdf rename to data/lysuite/ly33b_Spanners_Tie_Finale.pdf diff --git a/Resources/lysuite/ly33c_Spanners_Slurs.musx b/data/lysuite/ly33c_Spanners_Slurs.musx similarity index 100% rename from Resources/lysuite/ly33c_Spanners_Slurs.musx rename to data/lysuite/ly33c_Spanners_Slurs.musx diff --git a/Resources/lysuite/ly33c_Spanners_Slurs.xml b/data/lysuite/ly33c_Spanners_Slurs.xml similarity index 100% rename from Resources/lysuite/ly33c_Spanners_Slurs.xml rename to data/lysuite/ly33c_Spanners_Slurs.xml diff --git a/Resources/lysuite/ly33c_Spanners_Slurs_Finale.pdf b/data/lysuite/ly33c_Spanners_Slurs_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33c_Spanners_Slurs_Finale.pdf rename to data/lysuite/ly33c_Spanners_Slurs_Finale.pdf diff --git a/Resources/lysuite/ly33d_Spanners_OctaveShifts.musx b/data/lysuite/ly33d_Spanners_OctaveShifts.musx similarity index 100% rename from Resources/lysuite/ly33d_Spanners_OctaveShifts.musx rename to data/lysuite/ly33d_Spanners_OctaveShifts.musx diff --git a/Resources/lysuite/ly33d_Spanners_OctaveShifts.xml b/data/lysuite/ly33d_Spanners_OctaveShifts.xml similarity index 100% rename from Resources/lysuite/ly33d_Spanners_OctaveShifts.xml rename to data/lysuite/ly33d_Spanners_OctaveShifts.xml diff --git a/Resources/lysuite/ly33d_Spanners_OctaveShifts_Finale.pdf b/data/lysuite/ly33d_Spanners_OctaveShifts_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33d_Spanners_OctaveShifts_Finale.pdf rename to data/lysuite/ly33d_Spanners_OctaveShifts_Finale.pdf diff --git a/Resources/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.musx b/data/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.musx similarity index 100% rename from Resources/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.musx rename to data/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.musx diff --git a/Resources/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.xml b/data/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.xml similarity index 100% rename from Resources/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.xml rename to data/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize.xml diff --git a/Resources/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize_Finale.pdf b/data/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize_Finale.pdf rename to data/lysuite/ly33e_Spanners_OctaveShifts_InvalidSize_Finale.pdf diff --git a/Resources/lysuite/ly33f_Trill_EndingOnGraceNote.musx b/data/lysuite/ly33f_Trill_EndingOnGraceNote.musx similarity index 100% rename from Resources/lysuite/ly33f_Trill_EndingOnGraceNote.musx rename to data/lysuite/ly33f_Trill_EndingOnGraceNote.musx diff --git a/Resources/lysuite/ly33f_Trill_EndingOnGraceNote.xml b/data/lysuite/ly33f_Trill_EndingOnGraceNote.xml similarity index 100% rename from Resources/lysuite/ly33f_Trill_EndingOnGraceNote.xml rename to data/lysuite/ly33f_Trill_EndingOnGraceNote.xml diff --git a/Resources/lysuite/ly33f_Trill_EndingOnGraceNote_Finale.pdf b/data/lysuite/ly33f_Trill_EndingOnGraceNote_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33f_Trill_EndingOnGraceNote_Finale.pdf rename to data/lysuite/ly33f_Trill_EndingOnGraceNote_Finale.pdf diff --git a/Resources/lysuite/ly33g_Slur_ChordedNotes.musx b/data/lysuite/ly33g_Slur_ChordedNotes.musx similarity index 100% rename from Resources/lysuite/ly33g_Slur_ChordedNotes.musx rename to data/lysuite/ly33g_Slur_ChordedNotes.musx diff --git a/Resources/lysuite/ly33g_Slur_ChordedNotes.xml b/data/lysuite/ly33g_Slur_ChordedNotes.xml similarity index 100% rename from Resources/lysuite/ly33g_Slur_ChordedNotes.xml rename to data/lysuite/ly33g_Slur_ChordedNotes.xml diff --git a/Resources/lysuite/ly33g_Slur_ChordedNotes_Finale.pdf b/data/lysuite/ly33g_Slur_ChordedNotes_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33g_Slur_ChordedNotes_Finale.pdf rename to data/lysuite/ly33g_Slur_ChordedNotes_Finale.pdf diff --git a/Resources/lysuite/ly33h_Spanners_Glissando.musx b/data/lysuite/ly33h_Spanners_Glissando.musx similarity index 100% rename from Resources/lysuite/ly33h_Spanners_Glissando.musx rename to data/lysuite/ly33h_Spanners_Glissando.musx diff --git a/Resources/lysuite/ly33h_Spanners_Glissando.xml b/data/lysuite/ly33h_Spanners_Glissando.xml similarity index 100% rename from Resources/lysuite/ly33h_Spanners_Glissando.xml rename to data/lysuite/ly33h_Spanners_Glissando.xml diff --git a/Resources/lysuite/ly33h_Spanners_Glissando_Finale.pdf b/data/lysuite/ly33h_Spanners_Glissando_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33h_Spanners_Glissando_Finale.pdf rename to data/lysuite/ly33h_Spanners_Glissando_Finale.pdf diff --git a/Resources/lysuite/ly33i_Ties_NotEnded.musx b/data/lysuite/ly33i_Ties_NotEnded.musx similarity index 100% rename from Resources/lysuite/ly33i_Ties_NotEnded.musx rename to data/lysuite/ly33i_Ties_NotEnded.musx diff --git a/Resources/lysuite/ly33i_Ties_NotEnded.xml b/data/lysuite/ly33i_Ties_NotEnded.xml similarity index 100% rename from Resources/lysuite/ly33i_Ties_NotEnded.xml rename to data/lysuite/ly33i_Ties_NotEnded.xml diff --git a/Resources/lysuite/ly33i_Ties_NotEnded_Finale.pdf b/data/lysuite/ly33i_Ties_NotEnded_Finale.pdf similarity index 100% rename from Resources/lysuite/ly33i_Ties_NotEnded_Finale.pdf rename to data/lysuite/ly33i_Ties_NotEnded_Finale.pdf diff --git a/Resources/lysuite/ly41a_MultiParts_Partorder.musx b/data/lysuite/ly41a_MultiParts_Partorder.musx similarity index 100% rename from Resources/lysuite/ly41a_MultiParts_Partorder.musx rename to data/lysuite/ly41a_MultiParts_Partorder.musx diff --git a/Resources/lysuite/ly41a_MultiParts_Partorder.xml b/data/lysuite/ly41a_MultiParts_Partorder.xml similarity index 100% rename from Resources/lysuite/ly41a_MultiParts_Partorder.xml rename to data/lysuite/ly41a_MultiParts_Partorder.xml diff --git a/Resources/lysuite/ly41a_MultiParts_Partorder_Finale.pdf b/data/lysuite/ly41a_MultiParts_Partorder_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41a_MultiParts_Partorder_Finale.pdf rename to data/lysuite/ly41a_MultiParts_Partorder_Finale.pdf diff --git a/Resources/lysuite/ly41b_MultiParts_MoreThan10.musx b/data/lysuite/ly41b_MultiParts_MoreThan10.musx similarity index 100% rename from Resources/lysuite/ly41b_MultiParts_MoreThan10.musx rename to data/lysuite/ly41b_MultiParts_MoreThan10.musx diff --git a/Resources/lysuite/ly41b_MultiParts_MoreThan10.xml b/data/lysuite/ly41b_MultiParts_MoreThan10.xml similarity index 100% rename from Resources/lysuite/ly41b_MultiParts_MoreThan10.xml rename to data/lysuite/ly41b_MultiParts_MoreThan10.xml diff --git a/Resources/lysuite/ly41b_MultiParts_MoreThan10_Finale.pdf b/data/lysuite/ly41b_MultiParts_MoreThan10_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41b_MultiParts_MoreThan10_Finale.pdf rename to data/lysuite/ly41b_MultiParts_MoreThan10_Finale.pdf diff --git a/Resources/lysuite/ly41c_StaffGroups.musx b/data/lysuite/ly41c_StaffGroups.musx similarity index 100% rename from Resources/lysuite/ly41c_StaffGroups.musx rename to data/lysuite/ly41c_StaffGroups.musx diff --git a/Resources/lysuite/ly41c_StaffGroups.xml b/data/lysuite/ly41c_StaffGroups.xml similarity index 100% rename from Resources/lysuite/ly41c_StaffGroups.xml rename to data/lysuite/ly41c_StaffGroups.xml diff --git a/Resources/lysuite/ly41c_StaffGroups_Finale.pdf b/data/lysuite/ly41c_StaffGroups_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41c_StaffGroups_Finale.pdf rename to data/lysuite/ly41c_StaffGroups_Finale.pdf diff --git a/Resources/lysuite/ly41d_StaffGroups_Nested.musx b/data/lysuite/ly41d_StaffGroups_Nested.musx similarity index 100% rename from Resources/lysuite/ly41d_StaffGroups_Nested.musx rename to data/lysuite/ly41d_StaffGroups_Nested.musx diff --git a/Resources/lysuite/ly41d_StaffGroups_Nested.xml b/data/lysuite/ly41d_StaffGroups_Nested.xml similarity index 100% rename from Resources/lysuite/ly41d_StaffGroups_Nested.xml rename to data/lysuite/ly41d_StaffGroups_Nested.xml diff --git a/Resources/lysuite/ly41d_StaffGroups_Nested_Finale.pdf b/data/lysuite/ly41d_StaffGroups_Nested_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41d_StaffGroups_Nested_Finale.pdf rename to data/lysuite/ly41d_StaffGroups_Nested_Finale.pdf diff --git a/Resources/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.musx b/data/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.musx similarity index 100% rename from Resources/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.musx rename to data/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.musx diff --git a/Resources/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.xml b/data/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.xml similarity index 100% rename from Resources/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.xml rename to data/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken.xml diff --git a/Resources/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken_Finale.pdf b/data/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken_Finale.pdf rename to data/lysuite/ly41e_StaffGroups_InstrumentNames_Linebroken_Finale.pdf diff --git a/Resources/lysuite/ly41f_StaffGroups_Overlapping.musx b/data/lysuite/ly41f_StaffGroups_Overlapping.musx similarity index 100% rename from Resources/lysuite/ly41f_StaffGroups_Overlapping.musx rename to data/lysuite/ly41f_StaffGroups_Overlapping.musx diff --git a/Resources/lysuite/ly41f_StaffGroups_Overlapping.xml b/data/lysuite/ly41f_StaffGroups_Overlapping.xml similarity index 100% rename from Resources/lysuite/ly41f_StaffGroups_Overlapping.xml rename to data/lysuite/ly41f_StaffGroups_Overlapping.xml diff --git a/Resources/lysuite/ly41f_StaffGroups_Overlapping_Finale.pdf b/data/lysuite/ly41f_StaffGroups_Overlapping_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41f_StaffGroups_Overlapping_Finale.pdf rename to data/lysuite/ly41f_StaffGroups_Overlapping_Finale.pdf diff --git a/Resources/lysuite/ly41g_PartNoId.musx b/data/lysuite/ly41g_PartNoId.musx similarity index 100% rename from Resources/lysuite/ly41g_PartNoId.musx rename to data/lysuite/ly41g_PartNoId.musx diff --git a/Resources/lysuite/ly41g_PartNoId.xml b/data/lysuite/ly41g_PartNoId.xml similarity index 100% rename from Resources/lysuite/ly41g_PartNoId.xml rename to data/lysuite/ly41g_PartNoId.xml diff --git a/Resources/lysuite/ly41g_PartNoId_Finale.pdf b/data/lysuite/ly41g_PartNoId_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41g_PartNoId_Finale.pdf rename to data/lysuite/ly41g_PartNoId_Finale.pdf diff --git a/Resources/lysuite/ly41h_TooManyParts.musx b/data/lysuite/ly41h_TooManyParts.musx similarity index 100% rename from Resources/lysuite/ly41h_TooManyParts.musx rename to data/lysuite/ly41h_TooManyParts.musx diff --git a/Resources/lysuite/ly41h_TooManyParts.xml b/data/lysuite/ly41h_TooManyParts.xml similarity index 100% rename from Resources/lysuite/ly41h_TooManyParts.xml rename to data/lysuite/ly41h_TooManyParts.xml diff --git a/Resources/lysuite/ly41h_TooManyParts_Finale.pdf b/data/lysuite/ly41h_TooManyParts_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41h_TooManyParts_Finale.pdf rename to data/lysuite/ly41h_TooManyParts_Finale.pdf diff --git a/Resources/lysuite/ly41i_PartNameDisplay_Override.musx b/data/lysuite/ly41i_PartNameDisplay_Override.musx similarity index 100% rename from Resources/lysuite/ly41i_PartNameDisplay_Override.musx rename to data/lysuite/ly41i_PartNameDisplay_Override.musx diff --git a/Resources/lysuite/ly41i_PartNameDisplay_Override.xml b/data/lysuite/ly41i_PartNameDisplay_Override.xml similarity index 100% rename from Resources/lysuite/ly41i_PartNameDisplay_Override.xml rename to data/lysuite/ly41i_PartNameDisplay_Override.xml diff --git a/Resources/lysuite/ly41i_PartNameDisplay_Override_Finale.pdf b/data/lysuite/ly41i_PartNameDisplay_Override_Finale.pdf similarity index 100% rename from Resources/lysuite/ly41i_PartNameDisplay_Override_Finale.pdf rename to data/lysuite/ly41i_PartNameDisplay_Override_Finale.pdf diff --git a/Resources/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.musx b/data/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.musx similarity index 100% rename from Resources/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.musx rename to data/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.musx diff --git a/Resources/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.xml b/data/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.xml similarity index 100% rename from Resources/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.xml rename to data/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics.xml diff --git a/Resources/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics_Finale.pdf b/data/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics_Finale.pdf similarity index 100% rename from Resources/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics_Finale.pdf rename to data/lysuite/ly42a_MultiVoice_TwoVoicesOnStaff_Lyrics_Finale.pdf diff --git a/Resources/lysuite/ly42b_MultiVoice_MidMeasureClefChange.musx b/data/lysuite/ly42b_MultiVoice_MidMeasureClefChange.musx similarity index 100% rename from Resources/lysuite/ly42b_MultiVoice_MidMeasureClefChange.musx rename to data/lysuite/ly42b_MultiVoice_MidMeasureClefChange.musx diff --git a/Resources/lysuite/ly42b_MultiVoice_MidMeasureClefChange.xml b/data/lysuite/ly42b_MultiVoice_MidMeasureClefChange.xml similarity index 100% rename from Resources/lysuite/ly42b_MultiVoice_MidMeasureClefChange.xml rename to data/lysuite/ly42b_MultiVoice_MidMeasureClefChange.xml diff --git a/Resources/lysuite/ly42b_MultiVoice_MidMeasureClefChange_Finale.pdf b/data/lysuite/ly42b_MultiVoice_MidMeasureClefChange_Finale.pdf similarity index 100% rename from Resources/lysuite/ly42b_MultiVoice_MidMeasureClefChange_Finale.pdf rename to data/lysuite/ly42b_MultiVoice_MidMeasureClefChange_Finale.pdf diff --git a/Resources/lysuite/ly43a_PianoStaff.musx b/data/lysuite/ly43a_PianoStaff.musx similarity index 100% rename from Resources/lysuite/ly43a_PianoStaff.musx rename to data/lysuite/ly43a_PianoStaff.musx diff --git a/Resources/lysuite/ly43a_PianoStaff.xml b/data/lysuite/ly43a_PianoStaff.xml similarity index 100% rename from Resources/lysuite/ly43a_PianoStaff.xml rename to data/lysuite/ly43a_PianoStaff.xml diff --git a/Resources/lysuite/ly43a_PianoStaff_Finale.pdf b/data/lysuite/ly43a_PianoStaff_Finale.pdf similarity index 100% rename from Resources/lysuite/ly43a_PianoStaff_Finale.pdf rename to data/lysuite/ly43a_PianoStaff_Finale.pdf diff --git a/Resources/lysuite/ly43a_PianoStaff_museScore.pdf b/data/lysuite/ly43a_PianoStaff_museScore.pdf similarity index 100% rename from Resources/lysuite/ly43a_PianoStaff_museScore.pdf rename to data/lysuite/ly43a_PianoStaff_museScore.pdf diff --git a/Resources/lysuite/ly43b_MultiStaff_DifferentKeys.musx b/data/lysuite/ly43b_MultiStaff_DifferentKeys.musx similarity index 100% rename from Resources/lysuite/ly43b_MultiStaff_DifferentKeys.musx rename to data/lysuite/ly43b_MultiStaff_DifferentKeys.musx diff --git a/Resources/lysuite/ly43b_MultiStaff_DifferentKeys.xml b/data/lysuite/ly43b_MultiStaff_DifferentKeys.xml similarity index 100% rename from Resources/lysuite/ly43b_MultiStaff_DifferentKeys.xml rename to data/lysuite/ly43b_MultiStaff_DifferentKeys.xml diff --git a/Resources/lysuite/ly43b_MultiStaff_DifferentKeys_Finale.pdf b/data/lysuite/ly43b_MultiStaff_DifferentKeys_Finale.pdf similarity index 100% rename from Resources/lysuite/ly43b_MultiStaff_DifferentKeys_Finale.pdf rename to data/lysuite/ly43b_MultiStaff_DifferentKeys_Finale.pdf diff --git a/Resources/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.musx b/data/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.musx similarity index 100% rename from Resources/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.musx rename to data/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.musx diff --git a/Resources/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.xml b/data/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.xml similarity index 100% rename from Resources/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.xml rename to data/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup.xml diff --git a/Resources/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_Finale.pdf b/data/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_Finale.pdf similarity index 100% rename from Resources/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_Finale.pdf rename to data/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_Finale.pdf diff --git a/Resources/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_museScore.pdf b/data/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_museScore.pdf similarity index 100% rename from Resources/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_museScore.pdf rename to data/lysuite/ly43c_MultiStaff_DifferentKeysAfterBackup_museScore.pdf diff --git a/Resources/lysuite/ly43d_MultiStaff_StaffChange.musx b/data/lysuite/ly43d_MultiStaff_StaffChange.musx similarity index 100% rename from Resources/lysuite/ly43d_MultiStaff_StaffChange.musx rename to data/lysuite/ly43d_MultiStaff_StaffChange.musx diff --git a/Resources/lysuite/ly43d_MultiStaff_StaffChange.xml b/data/lysuite/ly43d_MultiStaff_StaffChange.xml similarity index 100% rename from Resources/lysuite/ly43d_MultiStaff_StaffChange.xml rename to data/lysuite/ly43d_MultiStaff_StaffChange.xml diff --git a/Resources/lysuite/ly43d_MultiStaff_StaffChange_Finale.pdf b/data/lysuite/ly43d_MultiStaff_StaffChange_Finale.pdf similarity index 100% rename from Resources/lysuite/ly43d_MultiStaff_StaffChange_Finale.pdf rename to data/lysuite/ly43d_MultiStaff_StaffChange_Finale.pdf diff --git a/Resources/lysuite/ly43d_MultiStaff_StaffChange_museScore.pdf b/data/lysuite/ly43d_MultiStaff_StaffChange_museScore.pdf similarity index 100% rename from Resources/lysuite/ly43d_MultiStaff_StaffChange_museScore.pdf rename to data/lysuite/ly43d_MultiStaff_StaffChange_museScore.pdf diff --git a/Resources/lysuite/ly43e_Multistaff_ClefDynamics.dorico b/data/lysuite/ly43e_Multistaff_ClefDynamics.dorico similarity index 100% rename from Resources/lysuite/ly43e_Multistaff_ClefDynamics.dorico rename to data/lysuite/ly43e_Multistaff_ClefDynamics.dorico diff --git a/Resources/lysuite/ly43e_Multistaff_ClefDynamics.musx b/data/lysuite/ly43e_Multistaff_ClefDynamics.musx similarity index 100% rename from Resources/lysuite/ly43e_Multistaff_ClefDynamics.musx rename to data/lysuite/ly43e_Multistaff_ClefDynamics.musx diff --git a/Resources/lysuite/ly43e_Multistaff_ClefDynamics.xml b/data/lysuite/ly43e_Multistaff_ClefDynamics.xml similarity index 100% rename from Resources/lysuite/ly43e_Multistaff_ClefDynamics.xml rename to data/lysuite/ly43e_Multistaff_ClefDynamics.xml diff --git a/Resources/lysuite/ly43e_Multistaff_ClefDynamics_Dorico.pdf b/data/lysuite/ly43e_Multistaff_ClefDynamics_Dorico.pdf similarity index 100% rename from Resources/lysuite/ly43e_Multistaff_ClefDynamics_Dorico.pdf rename to data/lysuite/ly43e_Multistaff_ClefDynamics_Dorico.pdf diff --git a/Resources/lysuite/ly43e_Multistaff_ClefDynamics_Finale.pdf b/data/lysuite/ly43e_Multistaff_ClefDynamics_Finale.pdf similarity index 100% rename from Resources/lysuite/ly43e_Multistaff_ClefDynamics_Finale.pdf rename to data/lysuite/ly43e_Multistaff_ClefDynamics_Finale.pdf diff --git a/Resources/lysuite/ly43e_Multistaff_ClefDynamics_museScore.pdf b/data/lysuite/ly43e_Multistaff_ClefDynamics_museScore.pdf similarity index 100% rename from Resources/lysuite/ly43e_Multistaff_ClefDynamics_museScore.pdf rename to data/lysuite/ly43e_Multistaff_ClefDynamics_museScore.pdf diff --git a/Resources/lysuite/ly45a_SimpleRepeat.musx b/data/lysuite/ly45a_SimpleRepeat.musx similarity index 100% rename from Resources/lysuite/ly45a_SimpleRepeat.musx rename to data/lysuite/ly45a_SimpleRepeat.musx diff --git a/Resources/lysuite/ly45a_SimpleRepeat.xml b/data/lysuite/ly45a_SimpleRepeat.xml similarity index 100% rename from Resources/lysuite/ly45a_SimpleRepeat.xml rename to data/lysuite/ly45a_SimpleRepeat.xml diff --git a/Resources/lysuite/ly45a_SimpleRepeat_Finale.pdf b/data/lysuite/ly45a_SimpleRepeat_Finale.pdf similarity index 100% rename from Resources/lysuite/ly45a_SimpleRepeat_Finale.pdf rename to data/lysuite/ly45a_SimpleRepeat_Finale.pdf diff --git a/Resources/lysuite/ly45b_RepeatWithAlternatives.musx b/data/lysuite/ly45b_RepeatWithAlternatives.musx similarity index 100% rename from Resources/lysuite/ly45b_RepeatWithAlternatives.musx rename to data/lysuite/ly45b_RepeatWithAlternatives.musx diff --git a/Resources/lysuite/ly45b_RepeatWithAlternatives.xml b/data/lysuite/ly45b_RepeatWithAlternatives.xml similarity index 100% rename from Resources/lysuite/ly45b_RepeatWithAlternatives.xml rename to data/lysuite/ly45b_RepeatWithAlternatives.xml diff --git a/Resources/lysuite/ly45b_RepeatWithAlternatives_Finale.pdf b/data/lysuite/ly45b_RepeatWithAlternatives_Finale.pdf similarity index 100% rename from Resources/lysuite/ly45b_RepeatWithAlternatives_Finale.pdf rename to data/lysuite/ly45b_RepeatWithAlternatives_Finale.pdf diff --git a/Resources/lysuite/ly45c_RepeatMultipleTimes.musx b/data/lysuite/ly45c_RepeatMultipleTimes.musx similarity index 100% rename from Resources/lysuite/ly45c_RepeatMultipleTimes.musx rename to data/lysuite/ly45c_RepeatMultipleTimes.musx diff --git a/Resources/lysuite/ly45c_RepeatMultipleTimes.xml b/data/lysuite/ly45c_RepeatMultipleTimes.xml similarity index 100% rename from Resources/lysuite/ly45c_RepeatMultipleTimes.xml rename to data/lysuite/ly45c_RepeatMultipleTimes.xml diff --git a/Resources/lysuite/ly45c_RepeatMultipleTimes_Finale.pdf b/data/lysuite/ly45c_RepeatMultipleTimes_Finale.pdf similarity index 100% rename from Resources/lysuite/ly45c_RepeatMultipleTimes_Finale.pdf rename to data/lysuite/ly45c_RepeatMultipleTimes_Finale.pdf diff --git a/Resources/lysuite/ly45d_Repeats_Nested_Alternatives.musx b/data/lysuite/ly45d_Repeats_Nested_Alternatives.musx similarity index 100% rename from Resources/lysuite/ly45d_Repeats_Nested_Alternatives.musx rename to data/lysuite/ly45d_Repeats_Nested_Alternatives.musx diff --git a/Resources/lysuite/ly45d_Repeats_Nested_Alternatives.xml b/data/lysuite/ly45d_Repeats_Nested_Alternatives.xml similarity index 100% rename from Resources/lysuite/ly45d_Repeats_Nested_Alternatives.xml rename to data/lysuite/ly45d_Repeats_Nested_Alternatives.xml diff --git a/Resources/lysuite/ly45d_Repeats_Nested_Alternatives_Finale.pdf b/data/lysuite/ly45d_Repeats_Nested_Alternatives_Finale.pdf similarity index 100% rename from Resources/lysuite/ly45d_Repeats_Nested_Alternatives_Finale.pdf rename to data/lysuite/ly45d_Repeats_Nested_Alternatives_Finale.pdf diff --git a/Resources/lysuite/ly45e_Repeats_Nested_Alternatives.musx b/data/lysuite/ly45e_Repeats_Nested_Alternatives.musx similarity index 100% rename from Resources/lysuite/ly45e_Repeats_Nested_Alternatives.musx rename to data/lysuite/ly45e_Repeats_Nested_Alternatives.musx diff --git a/Resources/lysuite/ly45e_Repeats_Nested_Alternatives.xml b/data/lysuite/ly45e_Repeats_Nested_Alternatives.xml similarity index 100% rename from Resources/lysuite/ly45e_Repeats_Nested_Alternatives.xml rename to data/lysuite/ly45e_Repeats_Nested_Alternatives.xml diff --git a/Resources/lysuite/ly45e_Repeats_Nested_Alternatives_Finale.pdf b/data/lysuite/ly45e_Repeats_Nested_Alternatives_Finale.pdf similarity index 100% rename from Resources/lysuite/ly45e_Repeats_Nested_Alternatives_Finale.pdf rename to data/lysuite/ly45e_Repeats_Nested_Alternatives_Finale.pdf diff --git a/Resources/lysuite/ly45f_Repeats_InvalidEndings.musx b/data/lysuite/ly45f_Repeats_InvalidEndings.musx similarity index 100% rename from Resources/lysuite/ly45f_Repeats_InvalidEndings.musx rename to data/lysuite/ly45f_Repeats_InvalidEndings.musx diff --git a/Resources/lysuite/ly45f_Repeats_InvalidEndings.xml b/data/lysuite/ly45f_Repeats_InvalidEndings.xml similarity index 100% rename from Resources/lysuite/ly45f_Repeats_InvalidEndings.xml rename to data/lysuite/ly45f_Repeats_InvalidEndings.xml diff --git a/Resources/lysuite/ly45f_Repeats_InvalidEndings_Finale.pdf b/data/lysuite/ly45f_Repeats_InvalidEndings_Finale.pdf similarity index 100% rename from Resources/lysuite/ly45f_Repeats_InvalidEndings_Finale.pdf rename to data/lysuite/ly45f_Repeats_InvalidEndings_Finale.pdf diff --git a/Resources/lysuite/ly45g_Repeats_NotEnded.musx b/data/lysuite/ly45g_Repeats_NotEnded.musx similarity index 100% rename from Resources/lysuite/ly45g_Repeats_NotEnded.musx rename to data/lysuite/ly45g_Repeats_NotEnded.musx diff --git a/Resources/lysuite/ly45g_Repeats_NotEnded.xml b/data/lysuite/ly45g_Repeats_NotEnded.xml similarity index 100% rename from Resources/lysuite/ly45g_Repeats_NotEnded.xml rename to data/lysuite/ly45g_Repeats_NotEnded.xml diff --git a/Resources/lysuite/ly45g_Repeats_NotEnded_Finale.pdf b/data/lysuite/ly45g_Repeats_NotEnded_Finale.pdf similarity index 100% rename from Resources/lysuite/ly45g_Repeats_NotEnded_Finale.pdf rename to data/lysuite/ly45g_Repeats_NotEnded_Finale.pdf diff --git a/Resources/lysuite/ly46a_Barlines.musx b/data/lysuite/ly46a_Barlines.musx similarity index 100% rename from Resources/lysuite/ly46a_Barlines.musx rename to data/lysuite/ly46a_Barlines.musx diff --git a/Resources/lysuite/ly46a_Barlines.xml b/data/lysuite/ly46a_Barlines.xml similarity index 100% rename from Resources/lysuite/ly46a_Barlines.xml rename to data/lysuite/ly46a_Barlines.xml diff --git a/Resources/lysuite/ly46a_Barlines_Finale.pdf b/data/lysuite/ly46a_Barlines_Finale.pdf similarity index 100% rename from Resources/lysuite/ly46a_Barlines_Finale.pdf rename to data/lysuite/ly46a_Barlines_Finale.pdf diff --git a/Resources/lysuite/ly46b_MidmeasureBarline.musx b/data/lysuite/ly46b_MidmeasureBarline.musx similarity index 100% rename from Resources/lysuite/ly46b_MidmeasureBarline.musx rename to data/lysuite/ly46b_MidmeasureBarline.musx diff --git a/Resources/lysuite/ly46b_MidmeasureBarline.xml b/data/lysuite/ly46b_MidmeasureBarline.xml similarity index 100% rename from Resources/lysuite/ly46b_MidmeasureBarline.xml rename to data/lysuite/ly46b_MidmeasureBarline.xml diff --git a/Resources/lysuite/ly46b_MidmeasureBarline_Finale.pdf b/data/lysuite/ly46b_MidmeasureBarline_Finale.pdf similarity index 100% rename from Resources/lysuite/ly46b_MidmeasureBarline_Finale.pdf rename to data/lysuite/ly46b_MidmeasureBarline_Finale.pdf diff --git a/Resources/lysuite/ly46c_Midmeasure_Clef.musx b/data/lysuite/ly46c_Midmeasure_Clef.musx similarity index 100% rename from Resources/lysuite/ly46c_Midmeasure_Clef.musx rename to data/lysuite/ly46c_Midmeasure_Clef.musx diff --git a/Resources/lysuite/ly46c_Midmeasure_Clef.xml b/data/lysuite/ly46c_Midmeasure_Clef.xml similarity index 100% rename from Resources/lysuite/ly46c_Midmeasure_Clef.xml rename to data/lysuite/ly46c_Midmeasure_Clef.xml diff --git a/Resources/lysuite/ly46c_Midmeasure_Clef_Finale.pdf b/data/lysuite/ly46c_Midmeasure_Clef_Finale.pdf similarity index 100% rename from Resources/lysuite/ly46c_Midmeasure_Clef_Finale.pdf rename to data/lysuite/ly46c_Midmeasure_Clef_Finale.pdf diff --git a/Resources/lysuite/ly46d_PickupMeasure_ImplicitMeasures.musx b/data/lysuite/ly46d_PickupMeasure_ImplicitMeasures.musx similarity index 100% rename from Resources/lysuite/ly46d_PickupMeasure_ImplicitMeasures.musx rename to data/lysuite/ly46d_PickupMeasure_ImplicitMeasures.musx diff --git a/Resources/lysuite/ly46d_PickupMeasure_ImplicitMeasures.xml b/data/lysuite/ly46d_PickupMeasure_ImplicitMeasures.xml similarity index 100% rename from Resources/lysuite/ly46d_PickupMeasure_ImplicitMeasures.xml rename to data/lysuite/ly46d_PickupMeasure_ImplicitMeasures.xml diff --git a/Resources/lysuite/ly46d_PickupMeasure_ImplicitMeasures_Finale.pdf b/data/lysuite/ly46d_PickupMeasure_ImplicitMeasures_Finale.pdf similarity index 100% rename from Resources/lysuite/ly46d_PickupMeasure_ImplicitMeasures_Finale.pdf rename to data/lysuite/ly46d_PickupMeasure_ImplicitMeasures_Finale.pdf diff --git a/Resources/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.musx b/data/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.musx similarity index 100% rename from Resources/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.musx rename to data/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.musx diff --git a/Resources/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.xml b/data/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.xml similarity index 100% rename from Resources/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.xml rename to data/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater.xml diff --git a/Resources/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater_Finale.pdf b/data/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater_Finale.pdf similarity index 100% rename from Resources/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater_Finale.pdf rename to data/lysuite/ly46e_PickupMeasure_SecondVoiceStartsLater_Finale.pdf diff --git a/Resources/lysuite/ly46f_IncompleteMeasures.musx b/data/lysuite/ly46f_IncompleteMeasures.musx similarity index 100% rename from Resources/lysuite/ly46f_IncompleteMeasures.musx rename to data/lysuite/ly46f_IncompleteMeasures.musx diff --git a/Resources/lysuite/ly46f_IncompleteMeasures.xml b/data/lysuite/ly46f_IncompleteMeasures.xml similarity index 100% rename from Resources/lysuite/ly46f_IncompleteMeasures.xml rename to data/lysuite/ly46f_IncompleteMeasures.xml diff --git a/Resources/lysuite/ly46f_IncompleteMeasures_Finale.pdf b/data/lysuite/ly46f_IncompleteMeasures_Finale.pdf similarity index 100% rename from Resources/lysuite/ly46f_IncompleteMeasures_Finale.pdf rename to data/lysuite/ly46f_IncompleteMeasures_Finale.pdf diff --git a/Resources/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.musx b/data/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.musx similarity index 100% rename from Resources/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.musx rename to data/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.musx diff --git a/Resources/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.xml b/data/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.xml similarity index 100% rename from Resources/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.xml rename to data/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass.xml diff --git a/Resources/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass_Finale.pdf b/data/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass_Finale.pdf similarity index 100% rename from Resources/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass_Finale.pdf rename to data/lysuite/ly46g_PickupMeasure_Chordnames_FiguredBass_Finale.pdf diff --git a/Resources/lysuite/ly51b_Header_Quotes.musx b/data/lysuite/ly51b_Header_Quotes.musx similarity index 100% rename from Resources/lysuite/ly51b_Header_Quotes.musx rename to data/lysuite/ly51b_Header_Quotes.musx diff --git a/Resources/lysuite/ly51b_Header_Quotes.xml b/data/lysuite/ly51b_Header_Quotes.xml similarity index 100% rename from Resources/lysuite/ly51b_Header_Quotes.xml rename to data/lysuite/ly51b_Header_Quotes.xml diff --git a/Resources/lysuite/ly51b_Header_Quotes_Finale.pdf b/data/lysuite/ly51b_Header_Quotes_Finale.pdf similarity index 100% rename from Resources/lysuite/ly51b_Header_Quotes_Finale.pdf rename to data/lysuite/ly51b_Header_Quotes_Finale.pdf diff --git a/Resources/lysuite/ly51c_MultipleRights.musx b/data/lysuite/ly51c_MultipleRights.musx similarity index 100% rename from Resources/lysuite/ly51c_MultipleRights.musx rename to data/lysuite/ly51c_MultipleRights.musx diff --git a/Resources/lysuite/ly51c_MultipleRights.xml b/data/lysuite/ly51c_MultipleRights.xml similarity index 100% rename from Resources/lysuite/ly51c_MultipleRights.xml rename to data/lysuite/ly51c_MultipleRights.xml diff --git a/Resources/lysuite/ly51c_MultipleRights_Finale.pdf b/data/lysuite/ly51c_MultipleRights_Finale.pdf similarity index 100% rename from Resources/lysuite/ly51c_MultipleRights_Finale.pdf rename to data/lysuite/ly51c_MultipleRights_Finale.pdf diff --git a/Resources/lysuite/ly51d_EmptyTitle.musx b/data/lysuite/ly51d_EmptyTitle.musx similarity index 100% rename from Resources/lysuite/ly51d_EmptyTitle.musx rename to data/lysuite/ly51d_EmptyTitle.musx diff --git a/Resources/lysuite/ly51d_EmptyTitle.xml b/data/lysuite/ly51d_EmptyTitle.xml similarity index 100% rename from Resources/lysuite/ly51d_EmptyTitle.xml rename to data/lysuite/ly51d_EmptyTitle.xml diff --git a/Resources/lysuite/ly51d_EmptyTitle_Finale.pdf b/data/lysuite/ly51d_EmptyTitle_Finale.pdf similarity index 100% rename from Resources/lysuite/ly51d_EmptyTitle_Finale.pdf rename to data/lysuite/ly51d_EmptyTitle_Finale.pdf diff --git a/Resources/lysuite/ly52a_PageLayout.musx b/data/lysuite/ly52a_PageLayout.musx similarity index 100% rename from Resources/lysuite/ly52a_PageLayout.musx rename to data/lysuite/ly52a_PageLayout.musx diff --git a/Resources/lysuite/ly52a_PageLayout.xml b/data/lysuite/ly52a_PageLayout.xml similarity index 100% rename from Resources/lysuite/ly52a_PageLayout.xml rename to data/lysuite/ly52a_PageLayout.xml diff --git a/Resources/lysuite/ly52a_PageLayout_Finale.pdf b/data/lysuite/ly52a_PageLayout_Finale.pdf similarity index 100% rename from Resources/lysuite/ly52a_PageLayout_Finale.pdf rename to data/lysuite/ly52a_PageLayout_Finale.pdf diff --git a/Resources/lysuite/ly52b_Breaks.musx b/data/lysuite/ly52b_Breaks.musx similarity index 100% rename from Resources/lysuite/ly52b_Breaks.musx rename to data/lysuite/ly52b_Breaks.musx diff --git a/Resources/lysuite/ly52b_Breaks.xml b/data/lysuite/ly52b_Breaks.xml similarity index 100% rename from Resources/lysuite/ly52b_Breaks.xml rename to data/lysuite/ly52b_Breaks.xml diff --git a/Resources/lysuite/ly52b_Breaks_Finale.pdf b/data/lysuite/ly52b_Breaks_Finale.pdf similarity index 100% rename from Resources/lysuite/ly52b_Breaks_Finale.pdf rename to data/lysuite/ly52b_Breaks_Finale.pdf diff --git a/Resources/lysuite/ly61a_Lyrics.musx b/data/lysuite/ly61a_Lyrics.musx similarity index 100% rename from Resources/lysuite/ly61a_Lyrics.musx rename to data/lysuite/ly61a_Lyrics.musx diff --git a/Resources/lysuite/ly61a_Lyrics.xml b/data/lysuite/ly61a_Lyrics.xml similarity index 100% rename from Resources/lysuite/ly61a_Lyrics.xml rename to data/lysuite/ly61a_Lyrics.xml diff --git a/Resources/lysuite/ly61a_Lyrics_Finale.pdf b/data/lysuite/ly61a_Lyrics_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61a_Lyrics_Finale.pdf rename to data/lysuite/ly61a_Lyrics_Finale.pdf diff --git a/Resources/lysuite/ly61b_MultipleLyrics.musx b/data/lysuite/ly61b_MultipleLyrics.musx similarity index 100% rename from Resources/lysuite/ly61b_MultipleLyrics.musx rename to data/lysuite/ly61b_MultipleLyrics.musx diff --git a/Resources/lysuite/ly61b_MultipleLyrics.xml b/data/lysuite/ly61b_MultipleLyrics.xml similarity index 100% rename from Resources/lysuite/ly61b_MultipleLyrics.xml rename to data/lysuite/ly61b_MultipleLyrics.xml diff --git a/Resources/lysuite/ly61b_MultipleLyrics_Finale.pdf b/data/lysuite/ly61b_MultipleLyrics_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61b_MultipleLyrics_Finale.pdf rename to data/lysuite/ly61b_MultipleLyrics_Finale.pdf diff --git a/Resources/lysuite/ly61c_Lyrics_Pianostaff.musx b/data/lysuite/ly61c_Lyrics_Pianostaff.musx similarity index 100% rename from Resources/lysuite/ly61c_Lyrics_Pianostaff.musx rename to data/lysuite/ly61c_Lyrics_Pianostaff.musx diff --git a/Resources/lysuite/ly61c_Lyrics_Pianostaff.xml b/data/lysuite/ly61c_Lyrics_Pianostaff.xml similarity index 100% rename from Resources/lysuite/ly61c_Lyrics_Pianostaff.xml rename to data/lysuite/ly61c_Lyrics_Pianostaff.xml diff --git a/Resources/lysuite/ly61c_Lyrics_Pianostaff_Finale.pdf b/data/lysuite/ly61c_Lyrics_Pianostaff_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61c_Lyrics_Pianostaff_Finale.pdf rename to data/lysuite/ly61c_Lyrics_Pianostaff_Finale.pdf diff --git a/Resources/lysuite/ly61d_Lyrics_Melisma.musx b/data/lysuite/ly61d_Lyrics_Melisma.musx similarity index 100% rename from Resources/lysuite/ly61d_Lyrics_Melisma.musx rename to data/lysuite/ly61d_Lyrics_Melisma.musx diff --git a/Resources/lysuite/ly61d_Lyrics_Melisma.xml b/data/lysuite/ly61d_Lyrics_Melisma.xml similarity index 100% rename from Resources/lysuite/ly61d_Lyrics_Melisma.xml rename to data/lysuite/ly61d_Lyrics_Melisma.xml diff --git a/Resources/lysuite/ly61d_Lyrics_Melisma_Finale.pdf b/data/lysuite/ly61d_Lyrics_Melisma_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61d_Lyrics_Melisma_Finale.pdf rename to data/lysuite/ly61d_Lyrics_Melisma_Finale.pdf diff --git a/Resources/lysuite/ly61e_Lyrics_Chords.musx b/data/lysuite/ly61e_Lyrics_Chords.musx similarity index 100% rename from Resources/lysuite/ly61e_Lyrics_Chords.musx rename to data/lysuite/ly61e_Lyrics_Chords.musx diff --git a/Resources/lysuite/ly61e_Lyrics_Chords.xml b/data/lysuite/ly61e_Lyrics_Chords.xml similarity index 100% rename from Resources/lysuite/ly61e_Lyrics_Chords.xml rename to data/lysuite/ly61e_Lyrics_Chords.xml diff --git a/Resources/lysuite/ly61e_Lyrics_Chords_Finale.pdf b/data/lysuite/ly61e_Lyrics_Chords_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61e_Lyrics_Chords_Finale.pdf rename to data/lysuite/ly61e_Lyrics_Chords_Finale.pdf diff --git a/Resources/lysuite/ly61f_Lyrics_GracedNotes.musx b/data/lysuite/ly61f_Lyrics_GracedNotes.musx similarity index 100% rename from Resources/lysuite/ly61f_Lyrics_GracedNotes.musx rename to data/lysuite/ly61f_Lyrics_GracedNotes.musx diff --git a/Resources/lysuite/ly61f_Lyrics_GracedNotes.xml b/data/lysuite/ly61f_Lyrics_GracedNotes.xml similarity index 100% rename from Resources/lysuite/ly61f_Lyrics_GracedNotes.xml rename to data/lysuite/ly61f_Lyrics_GracedNotes.xml diff --git a/Resources/lysuite/ly61f_Lyrics_GracedNotes_Finale.pdf b/data/lysuite/ly61f_Lyrics_GracedNotes_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61f_Lyrics_GracedNotes_Finale.pdf rename to data/lysuite/ly61f_Lyrics_GracedNotes_Finale.pdf diff --git a/Resources/lysuite/ly61g_Lyrics_NameNumber.musx b/data/lysuite/ly61g_Lyrics_NameNumber.musx similarity index 100% rename from Resources/lysuite/ly61g_Lyrics_NameNumber.musx rename to data/lysuite/ly61g_Lyrics_NameNumber.musx diff --git a/Resources/lysuite/ly61g_Lyrics_NameNumber.xml b/data/lysuite/ly61g_Lyrics_NameNumber.xml similarity index 100% rename from Resources/lysuite/ly61g_Lyrics_NameNumber.xml rename to data/lysuite/ly61g_Lyrics_NameNumber.xml diff --git a/Resources/lysuite/ly61g_Lyrics_NameNumber_Finale.pdf b/data/lysuite/ly61g_Lyrics_NameNumber_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61g_Lyrics_NameNumber_Finale.pdf rename to data/lysuite/ly61g_Lyrics_NameNumber_Finale.pdf diff --git a/Resources/lysuite/ly61h_Lyrics_BeamsMelismata.musx b/data/lysuite/ly61h_Lyrics_BeamsMelismata.musx similarity index 100% rename from Resources/lysuite/ly61h_Lyrics_BeamsMelismata.musx rename to data/lysuite/ly61h_Lyrics_BeamsMelismata.musx diff --git a/Resources/lysuite/ly61h_Lyrics_BeamsMelismata.xml b/data/lysuite/ly61h_Lyrics_BeamsMelismata.xml similarity index 100% rename from Resources/lysuite/ly61h_Lyrics_BeamsMelismata.xml rename to data/lysuite/ly61h_Lyrics_BeamsMelismata.xml diff --git a/Resources/lysuite/ly61h_Lyrics_BeamsMelismata_Finale.pdf b/data/lysuite/ly61h_Lyrics_BeamsMelismata_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61h_Lyrics_BeamsMelismata_Finale.pdf rename to data/lysuite/ly61h_Lyrics_BeamsMelismata_Finale.pdf diff --git a/Resources/lysuite/ly61i_Lyrics_Chords.musx b/data/lysuite/ly61i_Lyrics_Chords.musx similarity index 100% rename from Resources/lysuite/ly61i_Lyrics_Chords.musx rename to data/lysuite/ly61i_Lyrics_Chords.musx diff --git a/Resources/lysuite/ly61i_Lyrics_Chords.xml b/data/lysuite/ly61i_Lyrics_Chords.xml similarity index 100% rename from Resources/lysuite/ly61i_Lyrics_Chords.xml rename to data/lysuite/ly61i_Lyrics_Chords.xml diff --git a/Resources/lysuite/ly61i_Lyrics_Chords_Finale.pdf b/data/lysuite/ly61i_Lyrics_Chords_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61i_Lyrics_Chords_Finale.pdf rename to data/lysuite/ly61i_Lyrics_Chords_Finale.pdf diff --git a/Resources/lysuite/ly61j_Lyrics_Elisions.musx b/data/lysuite/ly61j_Lyrics_Elisions.musx similarity index 100% rename from Resources/lysuite/ly61j_Lyrics_Elisions.musx rename to data/lysuite/ly61j_Lyrics_Elisions.musx diff --git a/Resources/lysuite/ly61j_Lyrics_Elisions.xml b/data/lysuite/ly61j_Lyrics_Elisions.xml similarity index 100% rename from Resources/lysuite/ly61j_Lyrics_Elisions.xml rename to data/lysuite/ly61j_Lyrics_Elisions.xml diff --git a/Resources/lysuite/ly61j_Lyrics_Elisions_Finale.pdf b/data/lysuite/ly61j_Lyrics_Elisions_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61j_Lyrics_Elisions_Finale.pdf rename to data/lysuite/ly61j_Lyrics_Elisions_Finale.pdf diff --git a/Resources/lysuite/ly61k_Lyrics_SpannersExtenders.musx b/data/lysuite/ly61k_Lyrics_SpannersExtenders.musx similarity index 100% rename from Resources/lysuite/ly61k_Lyrics_SpannersExtenders.musx rename to data/lysuite/ly61k_Lyrics_SpannersExtenders.musx diff --git a/Resources/lysuite/ly61k_Lyrics_SpannersExtenders.xml b/data/lysuite/ly61k_Lyrics_SpannersExtenders.xml similarity index 100% rename from Resources/lysuite/ly61k_Lyrics_SpannersExtenders.xml rename to data/lysuite/ly61k_Lyrics_SpannersExtenders.xml diff --git a/Resources/lysuite/ly61k_Lyrics_SpannersExtenders_Finale.pdf b/data/lysuite/ly61k_Lyrics_SpannersExtenders_Finale.pdf similarity index 100% rename from Resources/lysuite/ly61k_Lyrics_SpannersExtenders_Finale.pdf rename to data/lysuite/ly61k_Lyrics_SpannersExtenders_Finale.pdf diff --git a/Resources/lysuite/ly71a_Chordnames.musx b/data/lysuite/ly71a_Chordnames.musx similarity index 100% rename from Resources/lysuite/ly71a_Chordnames.musx rename to data/lysuite/ly71a_Chordnames.musx diff --git a/Resources/lysuite/ly71a_Chordnames.xml b/data/lysuite/ly71a_Chordnames.xml similarity index 100% rename from Resources/lysuite/ly71a_Chordnames.xml rename to data/lysuite/ly71a_Chordnames.xml diff --git a/Resources/lysuite/ly71a_Chordnames_Finale.pdf b/data/lysuite/ly71a_Chordnames_Finale.pdf similarity index 100% rename from Resources/lysuite/ly71a_Chordnames_Finale.pdf rename to data/lysuite/ly71a_Chordnames_Finale.pdf diff --git a/Resources/lysuite/ly71c_ChordsFrets.musx b/data/lysuite/ly71c_ChordsFrets.musx similarity index 100% rename from Resources/lysuite/ly71c_ChordsFrets.musx rename to data/lysuite/ly71c_ChordsFrets.musx diff --git a/Resources/lysuite/ly71c_ChordsFrets.xml b/data/lysuite/ly71c_ChordsFrets.xml similarity index 100% rename from Resources/lysuite/ly71c_ChordsFrets.xml rename to data/lysuite/ly71c_ChordsFrets.xml diff --git a/Resources/lysuite/ly71c_ChordsFrets_Finale.pdf b/data/lysuite/ly71c_ChordsFrets_Finale.pdf similarity index 100% rename from Resources/lysuite/ly71c_ChordsFrets_Finale.pdf rename to data/lysuite/ly71c_ChordsFrets_Finale.pdf diff --git a/Resources/lysuite/ly71d_ChordsFrets_Multistaff.musx b/data/lysuite/ly71d_ChordsFrets_Multistaff.musx similarity index 100% rename from Resources/lysuite/ly71d_ChordsFrets_Multistaff.musx rename to data/lysuite/ly71d_ChordsFrets_Multistaff.musx diff --git a/Resources/lysuite/ly71d_ChordsFrets_Multistaff.xml b/data/lysuite/ly71d_ChordsFrets_Multistaff.xml similarity index 100% rename from Resources/lysuite/ly71d_ChordsFrets_Multistaff.xml rename to data/lysuite/ly71d_ChordsFrets_Multistaff.xml diff --git a/Resources/lysuite/ly71d_ChordsFrets_Multistaff_Finale.pdf b/data/lysuite/ly71d_ChordsFrets_Multistaff_Finale.pdf similarity index 100% rename from Resources/lysuite/ly71d_ChordsFrets_Multistaff_Finale.pdf rename to data/lysuite/ly71d_ChordsFrets_Multistaff_Finale.pdf diff --git a/Resources/lysuite/ly71e_TabStaves.musx b/data/lysuite/ly71e_TabStaves.musx similarity index 100% rename from Resources/lysuite/ly71e_TabStaves.musx rename to data/lysuite/ly71e_TabStaves.musx diff --git a/Resources/lysuite/ly71e_TabStaves.xml b/data/lysuite/ly71e_TabStaves.xml similarity index 100% rename from Resources/lysuite/ly71e_TabStaves.xml rename to data/lysuite/ly71e_TabStaves.xml diff --git a/Resources/lysuite/ly71e_TabStaves_Finale.pdf b/data/lysuite/ly71e_TabStaves_Finale.pdf similarity index 100% rename from Resources/lysuite/ly71e_TabStaves_Finale.pdf rename to data/lysuite/ly71e_TabStaves_Finale.pdf diff --git a/Resources/lysuite/ly71f_AllChordTypes.musx b/data/lysuite/ly71f_AllChordTypes.musx similarity index 100% rename from Resources/lysuite/ly71f_AllChordTypes.musx rename to data/lysuite/ly71f_AllChordTypes.musx diff --git a/Resources/lysuite/ly71f_AllChordTypes.xml b/data/lysuite/ly71f_AllChordTypes.xml similarity index 100% rename from Resources/lysuite/ly71f_AllChordTypes.xml rename to data/lysuite/ly71f_AllChordTypes.xml diff --git a/Resources/lysuite/ly71f_AllChordTypes_Finale.pdf b/data/lysuite/ly71f_AllChordTypes_Finale.pdf similarity index 100% rename from Resources/lysuite/ly71f_AllChordTypes_Finale.pdf rename to data/lysuite/ly71f_AllChordTypes_Finale.pdf diff --git a/Resources/lysuite/ly71g_MultipleChordnames.musx b/data/lysuite/ly71g_MultipleChordnames.musx similarity index 100% rename from Resources/lysuite/ly71g_MultipleChordnames.musx rename to data/lysuite/ly71g_MultipleChordnames.musx diff --git a/Resources/lysuite/ly71g_MultipleChordnames.xml b/data/lysuite/ly71g_MultipleChordnames.xml similarity index 100% rename from Resources/lysuite/ly71g_MultipleChordnames.xml rename to data/lysuite/ly71g_MultipleChordnames.xml diff --git a/Resources/lysuite/ly71g_MultipleChordnames_Finale.pdf b/data/lysuite/ly71g_MultipleChordnames_Finale.pdf similarity index 100% rename from Resources/lysuite/ly71g_MultipleChordnames_Finale.pdf rename to data/lysuite/ly71g_MultipleChordnames_Finale.pdf diff --git a/Resources/lysuite/ly72a_TransposingInstruments.musx b/data/lysuite/ly72a_TransposingInstruments.musx similarity index 100% rename from Resources/lysuite/ly72a_TransposingInstruments.musx rename to data/lysuite/ly72a_TransposingInstruments.musx diff --git a/Resources/lysuite/ly72a_TransposingInstruments.xml b/data/lysuite/ly72a_TransposingInstruments.xml similarity index 100% rename from Resources/lysuite/ly72a_TransposingInstruments.xml rename to data/lysuite/ly72a_TransposingInstruments.xml diff --git a/Resources/lysuite/ly72a_TransposingInstruments_Finale.pdf b/data/lysuite/ly72a_TransposingInstruments_Finale.pdf similarity index 100% rename from Resources/lysuite/ly72a_TransposingInstruments_Finale.pdf rename to data/lysuite/ly72a_TransposingInstruments_Finale.pdf diff --git a/Resources/lysuite/ly72b_TransposingInstruments_Full.musx b/data/lysuite/ly72b_TransposingInstruments_Full.musx similarity index 100% rename from Resources/lysuite/ly72b_TransposingInstruments_Full.musx rename to data/lysuite/ly72b_TransposingInstruments_Full.musx diff --git a/Resources/lysuite/ly72b_TransposingInstruments_Full.xml b/data/lysuite/ly72b_TransposingInstruments_Full.xml similarity index 100% rename from Resources/lysuite/ly72b_TransposingInstruments_Full.xml rename to data/lysuite/ly72b_TransposingInstruments_Full.xml diff --git a/Resources/lysuite/ly72b_TransposingInstruments_Full_Finale.pdf b/data/lysuite/ly72b_TransposingInstruments_Full_Finale.pdf similarity index 100% rename from Resources/lysuite/ly72b_TransposingInstruments_Full_Finale.pdf rename to data/lysuite/ly72b_TransposingInstruments_Full_Finale.pdf diff --git a/Resources/lysuite/ly72c_TransposingInstruments_Change.musx b/data/lysuite/ly72c_TransposingInstruments_Change.musx similarity index 100% rename from Resources/lysuite/ly72c_TransposingInstruments_Change.musx rename to data/lysuite/ly72c_TransposingInstruments_Change.musx diff --git a/Resources/lysuite/ly72c_TransposingInstruments_Change.xml b/data/lysuite/ly72c_TransposingInstruments_Change.xml similarity index 100% rename from Resources/lysuite/ly72c_TransposingInstruments_Change.xml rename to data/lysuite/ly72c_TransposingInstruments_Change.xml diff --git a/Resources/lysuite/ly72c_TransposingInstruments_Change_Finale.pdf b/data/lysuite/ly72c_TransposingInstruments_Change_Finale.pdf similarity index 100% rename from Resources/lysuite/ly72c_TransposingInstruments_Change_Finale.pdf rename to data/lysuite/ly72c_TransposingInstruments_Change_Finale.pdf diff --git a/Resources/lysuite/ly73a_Percussion.musx b/data/lysuite/ly73a_Percussion.musx similarity index 100% rename from Resources/lysuite/ly73a_Percussion.musx rename to data/lysuite/ly73a_Percussion.musx diff --git a/Resources/lysuite/ly73a_Percussion.xml b/data/lysuite/ly73a_Percussion.xml similarity index 100% rename from Resources/lysuite/ly73a_Percussion.xml rename to data/lysuite/ly73a_Percussion.xml diff --git a/Resources/lysuite/ly73a_Percussion_Finale.pdf b/data/lysuite/ly73a_Percussion_Finale.pdf similarity index 100% rename from Resources/lysuite/ly73a_Percussion_Finale.pdf rename to data/lysuite/ly73a_Percussion_Finale.pdf diff --git a/Resources/lysuite/ly74a_FiguredBass.musx b/data/lysuite/ly74a_FiguredBass.musx similarity index 100% rename from Resources/lysuite/ly74a_FiguredBass.musx rename to data/lysuite/ly74a_FiguredBass.musx diff --git a/Resources/lysuite/ly74a_FiguredBass.xml b/data/lysuite/ly74a_FiguredBass.xml similarity index 100% rename from Resources/lysuite/ly74a_FiguredBass.xml rename to data/lysuite/ly74a_FiguredBass.xml diff --git a/Resources/lysuite/ly74a_FiguredBass_Finale.pdf b/data/lysuite/ly74a_FiguredBass_Finale.pdf similarity index 100% rename from Resources/lysuite/ly74a_FiguredBass_Finale.pdf rename to data/lysuite/ly74a_FiguredBass_Finale.pdf diff --git a/Resources/lysuite/ly75a_AccordionRegistrations.musx b/data/lysuite/ly75a_AccordionRegistrations.musx similarity index 100% rename from Resources/lysuite/ly75a_AccordionRegistrations.musx rename to data/lysuite/ly75a_AccordionRegistrations.musx diff --git a/Resources/lysuite/ly75a_AccordionRegistrations.xml b/data/lysuite/ly75a_AccordionRegistrations.xml similarity index 100% rename from Resources/lysuite/ly75a_AccordionRegistrations.xml rename to data/lysuite/ly75a_AccordionRegistrations.xml diff --git a/Resources/lysuite/ly75a_AccordionRegistrations_Finale.pdf b/data/lysuite/ly75a_AccordionRegistrations_Finale.pdf similarity index 100% rename from Resources/lysuite/ly75a_AccordionRegistrations_Finale.pdf rename to data/lysuite/ly75a_AccordionRegistrations_Finale.pdf diff --git a/Resources/lysuite/ly90a_Compressed_MusicXML.musx b/data/lysuite/ly90a_Compressed_MusicXML.musx similarity index 100% rename from Resources/lysuite/ly90a_Compressed_MusicXML.musx rename to data/lysuite/ly90a_Compressed_MusicXML.musx diff --git a/Resources/lysuite/ly90a_Compressed_MusicXML.mxl b/data/lysuite/ly90a_Compressed_MusicXML.mxl similarity index 100% rename from Resources/lysuite/ly90a_Compressed_MusicXML.mxl rename to data/lysuite/ly90a_Compressed_MusicXML.mxl diff --git a/Resources/lysuite/ly90a_Compressed_MusicXML_Finale.pdf b/data/lysuite/ly90a_Compressed_MusicXML_Finale.pdf similarity index 100% rename from Resources/lysuite/ly90a_Compressed_MusicXML_Finale.pdf rename to data/lysuite/ly90a_Compressed_MusicXML_Finale.pdf diff --git a/Resources/lysuite/ly99a_Sibelius5_IgnoreBeaming.musx b/data/lysuite/ly99a_Sibelius5_IgnoreBeaming.musx similarity index 100% rename from Resources/lysuite/ly99a_Sibelius5_IgnoreBeaming.musx rename to data/lysuite/ly99a_Sibelius5_IgnoreBeaming.musx diff --git a/Resources/lysuite/ly99a_Sibelius5_IgnoreBeaming.xml b/data/lysuite/ly99a_Sibelius5_IgnoreBeaming.xml similarity index 100% rename from Resources/lysuite/ly99a_Sibelius5_IgnoreBeaming.xml rename to data/lysuite/ly99a_Sibelius5_IgnoreBeaming.xml diff --git a/Resources/lysuite/ly99a_Sibelius5_IgnoreBeaming_Finale.pdf b/data/lysuite/ly99a_Sibelius5_IgnoreBeaming_Finale.pdf similarity index 100% rename from Resources/lysuite/ly99a_Sibelius5_IgnoreBeaming_Finale.pdf rename to data/lysuite/ly99a_Sibelius5_IgnoreBeaming_Finale.pdf diff --git a/Resources/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.musx b/data/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.musx similarity index 100% rename from Resources/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.musx rename to data/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.musx diff --git a/Resources/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.xml b/data/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.xml similarity index 100% rename from Resources/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.xml rename to data/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams.xml diff --git a/Resources/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams_Finale.pdf b/data/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams_Finale.pdf similarity index 100% rename from Resources/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams_Finale.pdf rename to data/lysuite/ly99b_Lyrics_BeamsMelismata_IgnoreBeams_Finale.pdf diff --git a/Resources/mjbsuite/ChordDirectionPlacement.xml b/data/mjbsuite/ChordDirectionPlacement.xml similarity index 100% rename from Resources/mjbsuite/ChordDirectionPlacement.xml rename to data/mjbsuite/ChordDirectionPlacement.xml diff --git a/Resources/mjbsuite/FreezingSmall _FinaleRoundtrip.pdf b/data/mjbsuite/FreezingSmall _FinaleRoundtrip.pdf similarity index 100% rename from Resources/mjbsuite/FreezingSmall _FinaleRoundtrip.pdf rename to data/mjbsuite/FreezingSmall _FinaleRoundtrip.pdf diff --git a/Resources/mjbsuite/FreezingSmall.musx b/data/mjbsuite/FreezingSmall.musx similarity index 100% rename from Resources/mjbsuite/FreezingSmall.musx rename to data/mjbsuite/FreezingSmall.musx diff --git a/Resources/mjbsuite/FreezingSmall.xml b/data/mjbsuite/FreezingSmall.xml similarity index 100% rename from Resources/mjbsuite/FreezingSmall.xml rename to data/mjbsuite/FreezingSmall.xml diff --git a/Resources/mjbsuite/FreezingSmall_FinaleOriginal.pdf b/data/mjbsuite/FreezingSmall_FinaleOriginal.pdf similarity index 100% rename from Resources/mjbsuite/FreezingSmall_FinaleOriginal.pdf rename to data/mjbsuite/FreezingSmall_FinaleOriginal.pdf diff --git a/Resources/mjbsuite/HasMusicXmlVersionFalse.xml b/data/mjbsuite/HasMusicXmlVersionFalse.xml similarity index 100% rename from Resources/mjbsuite/HasMusicXmlVersionFalse.xml rename to data/mjbsuite/HasMusicXmlVersionFalse.xml diff --git a/Resources/mjbsuite/HasMusicXmlVersionTrue.xml b/data/mjbsuite/HasMusicXmlVersionTrue.xml similarity index 100% rename from Resources/mjbsuite/HasMusicXmlVersionTrue.xml rename to data/mjbsuite/HasMusicXmlVersionTrue.xml diff --git a/Resources/mjbsuite/OctoberXML.musx b/data/mjbsuite/OctoberXML.musx similarity index 100% rename from Resources/mjbsuite/OctoberXML.musx rename to data/mjbsuite/OctoberXML.musx diff --git a/Resources/mjbsuite/OctoberXML.xml b/data/mjbsuite/OctoberXML.xml similarity index 100% rename from Resources/mjbsuite/OctoberXML.xml rename to data/mjbsuite/OctoberXML.xml diff --git a/Resources/mjbsuite/OctoberXML_FinaleOriginal.pdf b/data/mjbsuite/OctoberXML_FinaleOriginal.pdf similarity index 100% rename from Resources/mjbsuite/OctoberXML_FinaleOriginal.pdf rename to data/mjbsuite/OctoberXML_FinaleOriginal.pdf diff --git a/Resources/mjbsuite/OctoberXML_FinaleRoundtrip.pdf b/data/mjbsuite/OctoberXML_FinaleRoundtrip.pdf similarity index 100% rename from Resources/mjbsuite/OctoberXML_FinaleRoundtrip.pdf rename to data/mjbsuite/OctoberXML_FinaleRoundtrip.pdf diff --git a/Resources/mjbsuite/PreserveTimeModificationNormalType.xml b/data/mjbsuite/PreserveTimeModificationNormalType.xml similarity index 100% rename from Resources/mjbsuite/PreserveTimeModificationNormalType.xml rename to data/mjbsuite/PreserveTimeModificationNormalType.xml diff --git a/Resources/mjbsuite/chords_simple.xml b/data/mjbsuite/chords_simple.xml similarity index 100% rename from Resources/mjbsuite/chords_simple.xml rename to data/mjbsuite/chords_simple.xml diff --git a/Resources/mjbsuite/ezinar.xml b/data/mjbsuite/ezinar.xml similarity index 100% rename from Resources/mjbsuite/ezinar.xml rename to data/mjbsuite/ezinar.xml diff --git a/Resources/mjbsuite/freezing.old.xml b/data/mjbsuite/freezing.old.xml similarity index 100% rename from Resources/mjbsuite/freezing.old.xml rename to data/mjbsuite/freezing.old.xml diff --git a/Resources/mjbsuite/freezing.xml b/data/mjbsuite/freezing.xml similarity index 100% rename from Resources/mjbsuite/freezing.xml rename to data/mjbsuite/freezing.xml diff --git a/Resources/mjbsuite/hello_timewise.xml b/data/mjbsuite/hello_timewise.xml similarity index 100% rename from Resources/mjbsuite/hello_timewise.xml rename to data/mjbsuite/hello_timewise.xml diff --git a/Resources/mjbsuite/krz_v40.musx b/data/mjbsuite/krz_v40.musx similarity index 100% rename from Resources/mjbsuite/krz_v40.musx rename to data/mjbsuite/krz_v40.musx diff --git a/Resources/mjbsuite/krz_v40.xml b/data/mjbsuite/krz_v40.xml similarity index 100% rename from Resources/mjbsuite/krz_v40.xml rename to data/mjbsuite/krz_v40.xml diff --git a/Resources/mjbsuite/krz_v40_FinaleOriginal.pdf b/data/mjbsuite/krz_v40_FinaleOriginal.pdf similarity index 100% rename from Resources/mjbsuite/krz_v40_FinaleOriginal.pdf rename to data/mjbsuite/krz_v40_FinaleOriginal.pdf diff --git a/Resources/mjbsuite/krz_v40_FinaleRoundtrip.pdf b/data/mjbsuite/krz_v40_FinaleRoundtrip.pdf similarity index 100% rename from Resources/mjbsuite/krz_v40_FinaleRoundtrip.pdf rename to data/mjbsuite/krz_v40_FinaleRoundtrip.pdf diff --git a/Resources/mjbsuite/lyre_timewise.xml b/data/mjbsuite/lyre_timewise.xml similarity index 100% rename from Resources/mjbsuite/lyre_timewise.xml rename to data/mjbsuite/lyre_timewise.xml diff --git a/Resources/mjbsuite/processing_instructions.xml b/data/mjbsuite/processing_instructions.xml similarity index 100% rename from Resources/mjbsuite/processing_instructions.xml rename to data/mjbsuite/processing_instructions.xml diff --git a/Resources/musuite/A_Walk_through_the_Park.license b/data/musuite/A_Walk_through_the_Park.license similarity index 100% rename from Resources/musuite/A_Walk_through_the_Park.license rename to data/musuite/A_Walk_through_the_Park.license diff --git a/Resources/musuite/A_Walk_through_the_Park.xml b/data/musuite/A_Walk_through_the_Park.xml similarity index 100% rename from Resources/musuite/A_Walk_through_the_Park.xml rename to data/musuite/A_Walk_through_the_Park.xml diff --git a/Resources/musuite/different_keysigs_1.xml b/data/musuite/different_keysigs_1.xml similarity index 100% rename from Resources/musuite/different_keysigs_1.xml rename to data/musuite/different_keysigs_1.xml diff --git a/Resources/musuite/different_keysigs_2.xml b/data/musuite/different_keysigs_2.xml similarity index 100% rename from Resources/musuite/different_keysigs_2.xml rename to data/musuite/different_keysigs_2.xml diff --git a/Resources/musuite/test98.xml b/data/musuite/test98.xml similarity index 100% rename from Resources/musuite/test98.xml rename to data/musuite/test98.xml diff --git a/Resources/musuite/testAccidentals1.pdf b/data/musuite/testAccidentals1.pdf similarity index 100% rename from Resources/musuite/testAccidentals1.pdf rename to data/musuite/testAccidentals1.pdf diff --git a/Resources/musuite/testAccidentals1.xml b/data/musuite/testAccidentals1.xml similarity index 100% rename from Resources/musuite/testAccidentals1.xml rename to data/musuite/testAccidentals1.xml diff --git a/Resources/musuite/testAccidentals2.pdf b/data/musuite/testAccidentals2.pdf similarity index 100% rename from Resources/musuite/testAccidentals2.pdf rename to data/musuite/testAccidentals2.pdf diff --git a/Resources/musuite/testAccidentals2.xml b/data/musuite/testAccidentals2.xml similarity index 100% rename from Resources/musuite/testAccidentals2.xml rename to data/musuite/testAccidentals2.xml diff --git a/Resources/musuite/testArpGliss1.pdf b/data/musuite/testArpGliss1.pdf similarity index 100% rename from Resources/musuite/testArpGliss1.pdf rename to data/musuite/testArpGliss1.pdf diff --git a/Resources/musuite/testArpGliss1.xml b/data/musuite/testArpGliss1.xml similarity index 100% rename from Resources/musuite/testArpGliss1.xml rename to data/musuite/testArpGliss1.xml diff --git a/Resources/musuite/testArpGliss2.pdf b/data/musuite/testArpGliss2.pdf similarity index 100% rename from Resources/musuite/testArpGliss2.pdf rename to data/musuite/testArpGliss2.pdf diff --git a/Resources/musuite/testArpGliss2.xml b/data/musuite/testArpGliss2.xml similarity index 100% rename from Resources/musuite/testArpGliss2.xml rename to data/musuite/testArpGliss2.xml diff --git a/Resources/musuite/testBarStyles.pdf b/data/musuite/testBarStyles.pdf similarity index 100% rename from Resources/musuite/testBarStyles.pdf rename to data/musuite/testBarStyles.pdf diff --git a/Resources/musuite/testBarStyles.xml b/data/musuite/testBarStyles.xml similarity index 100% rename from Resources/musuite/testBarStyles.xml rename to data/musuite/testBarStyles.xml diff --git a/Resources/musuite/testChord.pdf b/data/musuite/testChord.pdf similarity index 100% rename from Resources/musuite/testChord.pdf rename to data/musuite/testChord.pdf diff --git a/Resources/musuite/testChord.xml b/data/musuite/testChord.xml similarity index 100% rename from Resources/musuite/testChord.xml rename to data/musuite/testChord.xml diff --git a/Resources/musuite/testChordDiagrams1.xml b/data/musuite/testChordDiagrams1.xml similarity index 100% rename from Resources/musuite/testChordDiagrams1.xml rename to data/musuite/testChordDiagrams1.xml diff --git a/Resources/musuite/testChordNoVoice.pdf b/data/musuite/testChordNoVoice.pdf similarity index 100% rename from Resources/musuite/testChordNoVoice.pdf rename to data/musuite/testChordNoVoice.pdf diff --git a/Resources/musuite/testChordNoVoice.xml b/data/musuite/testChordNoVoice.xml similarity index 100% rename from Resources/musuite/testChordNoVoice.xml rename to data/musuite/testChordNoVoice.xml diff --git a/Resources/musuite/testChordNoVoice_ref.xml b/data/musuite/testChordNoVoice_ref.xml similarity index 100% rename from Resources/musuite/testChordNoVoice_ref.xml rename to data/musuite/testChordNoVoice_ref.xml diff --git a/Resources/musuite/testClefs1.pdf b/data/musuite/testClefs1.pdf similarity index 100% rename from Resources/musuite/testClefs1.pdf rename to data/musuite/testClefs1.pdf diff --git a/Resources/musuite/testClefs1.xml b/data/musuite/testClefs1.xml similarity index 100% rename from Resources/musuite/testClefs1.xml rename to data/musuite/testClefs1.xml diff --git a/Resources/musuite/testCompleteMeasureRests.xml b/data/musuite/testCompleteMeasureRests.xml similarity index 100% rename from Resources/musuite/testCompleteMeasureRests.xml rename to data/musuite/testCompleteMeasureRests.xml diff --git a/Resources/musuite/testDCalCoda.pdf b/data/musuite/testDCalCoda.pdf similarity index 100% rename from Resources/musuite/testDCalCoda.pdf rename to data/musuite/testDCalCoda.pdf diff --git a/Resources/musuite/testDCalCoda.xml b/data/musuite/testDCalCoda.xml similarity index 100% rename from Resources/musuite/testDCalCoda.xml rename to data/musuite/testDCalCoda.xml diff --git a/Resources/musuite/testDCalFine.pdf b/data/musuite/testDCalFine.pdf similarity index 100% rename from Resources/musuite/testDCalFine.pdf rename to data/musuite/testDCalFine.pdf diff --git a/Resources/musuite/testDCalFine.xml b/data/musuite/testDCalFine.xml similarity index 100% rename from Resources/musuite/testDCalFine.xml rename to data/musuite/testDCalFine.xml diff --git a/Resources/musuite/testDalSegno.pdf b/data/musuite/testDalSegno.pdf similarity index 100% rename from Resources/musuite/testDalSegno.pdf rename to data/musuite/testDalSegno.pdf diff --git a/Resources/musuite/testDalSegno.xml b/data/musuite/testDalSegno.xml similarity index 100% rename from Resources/musuite/testDalSegno.xml rename to data/musuite/testDalSegno.xml diff --git a/Resources/musuite/testDirections1.pdf b/data/musuite/testDirections1.pdf similarity index 100% rename from Resources/musuite/testDirections1.pdf rename to data/musuite/testDirections1.pdf diff --git a/Resources/musuite/testDirections1.xml b/data/musuite/testDirections1.xml similarity index 100% rename from Resources/musuite/testDirections1.xml rename to data/musuite/testDirections1.xml diff --git a/Resources/musuite/testDrumset1.pdf b/data/musuite/testDrumset1.pdf similarity index 100% rename from Resources/musuite/testDrumset1.pdf rename to data/musuite/testDrumset1.pdf diff --git a/Resources/musuite/testDrumset1.xml b/data/musuite/testDrumset1.xml similarity index 100% rename from Resources/musuite/testDrumset1.xml rename to data/musuite/testDrumset1.xml diff --git a/Resources/musuite/testDrumset2.pdf b/data/musuite/testDrumset2.pdf similarity index 100% rename from Resources/musuite/testDrumset2.pdf rename to data/musuite/testDrumset2.pdf diff --git a/Resources/musuite/testDrumset2.xml b/data/musuite/testDrumset2.xml similarity index 100% rename from Resources/musuite/testDrumset2.xml rename to data/musuite/testDrumset2.xml diff --git a/Resources/musuite/testDurationRoundingError.xml b/data/musuite/testDurationRoundingError.xml similarity index 100% rename from Resources/musuite/testDurationRoundingError.xml rename to data/musuite/testDurationRoundingError.xml diff --git a/Resources/musuite/testDurationRoundingError_ref.xml b/data/musuite/testDurationRoundingError_ref.xml similarity index 100% rename from Resources/musuite/testDurationRoundingError_ref.xml rename to data/musuite/testDurationRoundingError_ref.xml diff --git a/Resources/musuite/testDynamics1.pdf b/data/musuite/testDynamics1.pdf similarity index 100% rename from Resources/musuite/testDynamics1.pdf rename to data/musuite/testDynamics1.pdf diff --git a/Resources/musuite/testDynamics1.xml b/data/musuite/testDynamics1.xml similarity index 100% rename from Resources/musuite/testDynamics1.xml rename to data/musuite/testDynamics1.xml diff --git a/Resources/musuite/testDynamics2.pdf b/data/musuite/testDynamics2.pdf similarity index 100% rename from Resources/musuite/testDynamics2.pdf rename to data/musuite/testDynamics2.pdf diff --git a/Resources/musuite/testDynamics2.xml b/data/musuite/testDynamics2.xml similarity index 100% rename from Resources/musuite/testDynamics2.xml rename to data/musuite/testDynamics2.xml diff --git a/Resources/musuite/testDynamics3.pdf b/data/musuite/testDynamics3.pdf similarity index 100% rename from Resources/musuite/testDynamics3.pdf rename to data/musuite/testDynamics3.pdf diff --git a/Resources/musuite/testDynamics3.xml b/data/musuite/testDynamics3.xml similarity index 100% rename from Resources/musuite/testDynamics3.xml rename to data/musuite/testDynamics3.xml diff --git a/Resources/musuite/testDynamics3_ref.xml b/data/musuite/testDynamics3_ref.xml similarity index 100% rename from Resources/musuite/testDynamics3_ref.xml rename to data/musuite/testDynamics3_ref.xml diff --git a/Resources/musuite/testEmptyMeasure.xml b/data/musuite/testEmptyMeasure.xml similarity index 100% rename from Resources/musuite/testEmptyMeasure.xml rename to data/musuite/testEmptyMeasure.xml diff --git a/Resources/musuite/testEmptyMeasure_ref.xml b/data/musuite/testEmptyMeasure_ref.xml similarity index 100% rename from Resources/musuite/testEmptyMeasure_ref.xml rename to data/musuite/testEmptyMeasure_ref.xml diff --git a/Resources/musuite/testEmptyVoice1.xml b/data/musuite/testEmptyVoice1.xml similarity index 100% rename from Resources/musuite/testEmptyVoice1.xml rename to data/musuite/testEmptyVoice1.xml diff --git a/Resources/musuite/testEmptyVoice1_ref.xml b/data/musuite/testEmptyVoice1_ref.xml similarity index 100% rename from Resources/musuite/testEmptyVoice1_ref.xml rename to data/musuite/testEmptyVoice1_ref.xml diff --git a/Resources/musuite/testFiguredBass1.xml b/data/musuite/testFiguredBass1.xml similarity index 100% rename from Resources/musuite/testFiguredBass1.xml rename to data/musuite/testFiguredBass1.xml diff --git a/Resources/musuite/testFiguredBass2.xml b/data/musuite/testFiguredBass2.xml similarity index 100% rename from Resources/musuite/testFiguredBass2.xml rename to data/musuite/testFiguredBass2.xml diff --git a/Resources/musuite/testGrace1.pdf b/data/musuite/testGrace1.pdf similarity index 100% rename from Resources/musuite/testGrace1.pdf rename to data/musuite/testGrace1.pdf diff --git a/Resources/musuite/testGrace1.xml b/data/musuite/testGrace1.xml similarity index 100% rename from Resources/musuite/testGrace1.xml rename to data/musuite/testGrace1.xml diff --git a/Resources/musuite/testGrace2.pdf b/data/musuite/testGrace2.pdf similarity index 100% rename from Resources/musuite/testGrace2.pdf rename to data/musuite/testGrace2.pdf diff --git a/Resources/musuite/testGrace2.xml b/data/musuite/testGrace2.xml similarity index 100% rename from Resources/musuite/testGrace2.xml rename to data/musuite/testGrace2.xml diff --git a/Resources/musuite/testHarmony1.xml b/data/musuite/testHarmony1.xml similarity index 100% rename from Resources/musuite/testHarmony1.xml rename to data/musuite/testHarmony1.xml diff --git a/Resources/musuite/testHarmony2.xml b/data/musuite/testHarmony2.xml similarity index 100% rename from Resources/musuite/testHarmony2.xml rename to data/musuite/testHarmony2.xml diff --git a/Resources/musuite/testHarmony3.xml b/data/musuite/testHarmony3.xml similarity index 100% rename from Resources/musuite/testHarmony3.xml rename to data/musuite/testHarmony3.xml diff --git a/Resources/musuite/testHello.pdf b/data/musuite/testHello.pdf similarity index 100% rename from Resources/musuite/testHello.pdf rename to data/musuite/testHello.pdf diff --git a/Resources/musuite/testHello.xml b/data/musuite/testHello.xml similarity index 100% rename from Resources/musuite/testHello.xml rename to data/musuite/testHello.xml diff --git a/Resources/musuite/testImplicitMeasure1.pdf b/data/musuite/testImplicitMeasure1.pdf similarity index 100% rename from Resources/musuite/testImplicitMeasure1.pdf rename to data/musuite/testImplicitMeasure1.pdf diff --git a/Resources/musuite/testImplicitMeasure1.xml b/data/musuite/testImplicitMeasure1.xml similarity index 100% rename from Resources/musuite/testImplicitMeasure1.xml rename to data/musuite/testImplicitMeasure1.xml diff --git a/Resources/musuite/testInvalid.xml b/data/musuite/testInvalid.xml similarity index 100% rename from Resources/musuite/testInvalid.xml rename to data/musuite/testInvalid.xml diff --git a/Resources/musuite/testInvisibleElements.xml b/data/musuite/testInvisibleElements.xml similarity index 100% rename from Resources/musuite/testInvisibleElements.xml rename to data/musuite/testInvisibleElements.xml diff --git a/Resources/musuite/testKeysig1.pdf b/data/musuite/testKeysig1.pdf similarity index 100% rename from Resources/musuite/testKeysig1.pdf rename to data/musuite/testKeysig1.pdf diff --git a/Resources/musuite/testKeysig1.xml b/data/musuite/testKeysig1.xml similarity index 100% rename from Resources/musuite/testKeysig1.xml rename to data/musuite/testKeysig1.xml diff --git a/Resources/musuite/testLineBreaks.xml b/data/musuite/testLineBreaks.xml similarity index 100% rename from Resources/musuite/testLineBreaks.xml rename to data/musuite/testLineBreaks.xml diff --git a/Resources/musuite/testLines1.pdf b/data/musuite/testLines1.pdf similarity index 100% rename from Resources/musuite/testLines1.pdf rename to data/musuite/testLines1.pdf diff --git a/Resources/musuite/testLines1.xml b/data/musuite/testLines1.xml similarity index 100% rename from Resources/musuite/testLines1.xml rename to data/musuite/testLines1.xml diff --git a/Resources/musuite/testLines1_ref.xml b/data/musuite/testLines1_ref.xml similarity index 100% rename from Resources/musuite/testLines1_ref.xml rename to data/musuite/testLines1_ref.xml diff --git a/Resources/musuite/testLines2.pdf b/data/musuite/testLines2.pdf similarity index 100% rename from Resources/musuite/testLines2.pdf rename to data/musuite/testLines2.pdf diff --git a/Resources/musuite/testLines2.xml b/data/musuite/testLines2.xml similarity index 100% rename from Resources/musuite/testLines2.xml rename to data/musuite/testLines2.xml diff --git a/Resources/musuite/testLines2_ref.xml b/data/musuite/testLines2_ref.xml similarity index 100% rename from Resources/musuite/testLines2_ref.xml rename to data/musuite/testLines2_ref.xml diff --git a/Resources/musuite/testLyricsVoice2a.xml b/data/musuite/testLyricsVoice2a.xml similarity index 100% rename from Resources/musuite/testLyricsVoice2a.xml rename to data/musuite/testLyricsVoice2a.xml diff --git a/Resources/musuite/testLyricsVoice2b.xml b/data/musuite/testLyricsVoice2b.xml similarity index 100% rename from Resources/musuite/testLyricsVoice2b.xml rename to data/musuite/testLyricsVoice2b.xml diff --git a/Resources/musuite/testLyricsVoice2b_ref.xml b/data/musuite/testLyricsVoice2b_ref.xml similarity index 100% rename from Resources/musuite/testLyricsVoice2b_ref.xml rename to data/musuite/testLyricsVoice2b_ref.xml diff --git a/Resources/musuite/testManualBreaks.xml b/data/musuite/testManualBreaks.xml similarity index 100% rename from Resources/musuite/testManualBreaks.xml rename to data/musuite/testManualBreaks.xml diff --git a/Resources/musuite/testMeasureLength.xml b/data/musuite/testMeasureLength.xml similarity index 100% rename from Resources/musuite/testMeasureLength.xml rename to data/musuite/testMeasureLength.xml diff --git a/Resources/musuite/testMeasureLength_ref.xml b/data/musuite/testMeasureLength_ref.xml similarity index 100% rename from Resources/musuite/testMeasureLength_ref.xml rename to data/musuite/testMeasureLength_ref.xml diff --git a/Resources/musuite/testMetaData.xml b/data/musuite/testMetaData.xml similarity index 100% rename from Resources/musuite/testMetaData.xml rename to data/musuite/testMetaData.xml diff --git a/Resources/musuite/testMultiMeasureRest1.pdf b/data/musuite/testMultiMeasureRest1.pdf similarity index 100% rename from Resources/musuite/testMultiMeasureRest1.pdf rename to data/musuite/testMultiMeasureRest1.pdf diff --git a/Resources/musuite/testMultiMeasureRest1.xml b/data/musuite/testMultiMeasureRest1.xml similarity index 100% rename from Resources/musuite/testMultiMeasureRest1.xml rename to data/musuite/testMultiMeasureRest1.xml diff --git a/Resources/musuite/testMultiMeasureRest1_ref.xml b/data/musuite/testMultiMeasureRest1_ref.xml similarity index 100% rename from Resources/musuite/testMultiMeasureRest1_ref.xml rename to data/musuite/testMultiMeasureRest1_ref.xml diff --git a/Resources/musuite/testMultiMeasureRest2.xml b/data/musuite/testMultiMeasureRest2.xml similarity index 100% rename from Resources/musuite/testMultiMeasureRest2.xml rename to data/musuite/testMultiMeasureRest2.xml diff --git a/Resources/musuite/testMultiMeasureRest2_ref.xml b/data/musuite/testMultiMeasureRest2_ref.xml similarity index 100% rename from Resources/musuite/testMultiMeasureRest2_ref.xml rename to data/musuite/testMultiMeasureRest2_ref.xml diff --git a/Resources/musuite/testMultiMeasureRest3.xml b/data/musuite/testMultiMeasureRest3.xml similarity index 100% rename from Resources/musuite/testMultiMeasureRest3.xml rename to data/musuite/testMultiMeasureRest3.xml diff --git a/Resources/musuite/testMultiMeasureRest3_ref.xml b/data/musuite/testMultiMeasureRest3_ref.xml similarity index 100% rename from Resources/musuite/testMultiMeasureRest3_ref.xml rename to data/musuite/testMultiMeasureRest3_ref.xml diff --git a/Resources/musuite/testMultipleNotations.xml b/data/musuite/testMultipleNotations.xml similarity index 100% rename from Resources/musuite/testMultipleNotations.xml rename to data/musuite/testMultipleNotations.xml diff --git a/Resources/musuite/testMultipleNotations_ref.xml b/data/musuite/testMultipleNotations_ref.xml similarity index 100% rename from Resources/musuite/testMultipleNotations_ref.xml rename to data/musuite/testMultipleNotations_ref.xml diff --git a/Resources/musuite/testNonUniqueThings.xml b/data/musuite/testNonUniqueThings.xml similarity index 100% rename from Resources/musuite/testNonUniqueThings.xml rename to data/musuite/testNonUniqueThings.xml diff --git a/Resources/musuite/testNonUniqueThings_ref.xml b/data/musuite/testNonUniqueThings_ref.xml similarity index 100% rename from Resources/musuite/testNonUniqueThings_ref.xml rename to data/musuite/testNonUniqueThings_ref.xml diff --git a/Resources/musuite/testNoteAttributes1.pdf b/data/musuite/testNoteAttributes1.pdf similarity index 100% rename from Resources/musuite/testNoteAttributes1.pdf rename to data/musuite/testNoteAttributes1.pdf diff --git a/Resources/musuite/testNoteAttributes1.xml b/data/musuite/testNoteAttributes1.xml similarity index 100% rename from Resources/musuite/testNoteAttributes1.xml rename to data/musuite/testNoteAttributes1.xml diff --git a/Resources/musuite/testNoteAttributes2.pdf b/data/musuite/testNoteAttributes2.pdf similarity index 100% rename from Resources/musuite/testNoteAttributes2.pdf rename to data/musuite/testNoteAttributes2.pdf diff --git a/Resources/musuite/testNoteAttributes2.xml b/data/musuite/testNoteAttributes2.xml similarity index 100% rename from Resources/musuite/testNoteAttributes2.xml rename to data/musuite/testNoteAttributes2.xml diff --git a/Resources/musuite/testNoteAttributes2_ref.xml b/data/musuite/testNoteAttributes2_ref.xml similarity index 100% rename from Resources/musuite/testNoteAttributes2_ref.xml rename to data/musuite/testNoteAttributes2_ref.xml diff --git a/Resources/musuite/testNoteAttributes3.xml b/data/musuite/testNoteAttributes3.xml similarity index 100% rename from Resources/musuite/testNoteAttributes3.xml rename to data/musuite/testNoteAttributes3.xml diff --git a/Resources/musuite/testNoteheads.xml b/data/musuite/testNoteheads.xml similarity index 100% rename from Resources/musuite/testNoteheads.xml rename to data/musuite/testNoteheads.xml diff --git a/Resources/musuite/testNotesRests1.pdf b/data/musuite/testNotesRests1.pdf similarity index 100% rename from Resources/musuite/testNotesRests1.pdf rename to data/musuite/testNotesRests1.pdf diff --git a/Resources/musuite/testNotesRests1.xml b/data/musuite/testNotesRests1.xml similarity index 100% rename from Resources/musuite/testNotesRests1.xml rename to data/musuite/testNotesRests1.xml diff --git a/Resources/musuite/testNotesRests2.xml b/data/musuite/testNotesRests2.xml similarity index 100% rename from Resources/musuite/testNotesRests2.xml rename to data/musuite/testNotesRests2.xml diff --git a/Resources/musuite/testNumberedLyrics.xml b/data/musuite/testNumberedLyrics.xml similarity index 100% rename from Resources/musuite/testNumberedLyrics.xml rename to data/musuite/testNumberedLyrics.xml diff --git a/Resources/musuite/testNumberedLyrics_ref.xml b/data/musuite/testNumberedLyrics_ref.xml similarity index 100% rename from Resources/musuite/testNumberedLyrics_ref.xml rename to data/musuite/testNumberedLyrics_ref.xml diff --git a/Resources/musuite/testPartsSpecialCases.xml b/data/musuite/testPartsSpecialCases.xml similarity index 100% rename from Resources/musuite/testPartsSpecialCases.xml rename to data/musuite/testPartsSpecialCases.xml diff --git a/Resources/musuite/testPartsSpecialCases_ref.xml b/data/musuite/testPartsSpecialCases_ref.xml similarity index 100% rename from Resources/musuite/testPartsSpecialCases_ref.xml rename to data/musuite/testPartsSpecialCases_ref.xml diff --git a/Resources/musuite/testPiano.xml b/data/musuite/testPiano.xml similarity index 100% rename from Resources/musuite/testPiano.xml rename to data/musuite/testPiano.xml diff --git a/Resources/musuite/testRestsNoType.xml b/data/musuite/testRestsNoType.xml similarity index 100% rename from Resources/musuite/testRestsNoType.xml rename to data/musuite/testRestsNoType.xml diff --git a/Resources/musuite/testRestsNoType_ref.xml b/data/musuite/testRestsNoType_ref.xml similarity index 100% rename from Resources/musuite/testRestsNoType_ref.xml rename to data/musuite/testRestsNoType_ref.xml diff --git a/Resources/musuite/testSlurs.pdf b/data/musuite/testSlurs.pdf similarity index 100% rename from Resources/musuite/testSlurs.pdf rename to data/musuite/testSlurs.pdf diff --git a/Resources/musuite/testSlurs.xml b/data/musuite/testSlurs.xml similarity index 100% rename from Resources/musuite/testSlurs.xml rename to data/musuite/testSlurs.xml diff --git a/Resources/musuite/testStaffTwoKeySigs.xml b/data/musuite/testStaffTwoKeySigs.xml similarity index 100% rename from Resources/musuite/testStaffTwoKeySigs.xml rename to data/musuite/testStaffTwoKeySigs.xml diff --git a/Resources/musuite/testStringVoiceName.xml b/data/musuite/testStringVoiceName.xml similarity index 100% rename from Resources/musuite/testStringVoiceName.xml rename to data/musuite/testStringVoiceName.xml diff --git a/Resources/musuite/testStringVoiceName_ref.xml b/data/musuite/testStringVoiceName_ref.xml similarity index 100% rename from Resources/musuite/testStringVoiceName_ref.xml rename to data/musuite/testStringVoiceName_ref.xml diff --git a/Resources/musuite/testSystemBrackets1.pdf b/data/musuite/testSystemBrackets1.pdf similarity index 100% rename from Resources/musuite/testSystemBrackets1.pdf rename to data/musuite/testSystemBrackets1.pdf diff --git a/Resources/musuite/testSystemBrackets1.xml b/data/musuite/testSystemBrackets1.xml similarity index 100% rename from Resources/musuite/testSystemBrackets1.xml rename to data/musuite/testSystemBrackets1.xml diff --git a/Resources/musuite/testSystemBrackets2.pdf b/data/musuite/testSystemBrackets2.pdf similarity index 100% rename from Resources/musuite/testSystemBrackets2.pdf rename to data/musuite/testSystemBrackets2.pdf diff --git a/Resources/musuite/testSystemBrackets2.xml b/data/musuite/testSystemBrackets2.xml similarity index 100% rename from Resources/musuite/testSystemBrackets2.xml rename to data/musuite/testSystemBrackets2.xml diff --git a/Resources/musuite/testTablature1.pdf b/data/musuite/testTablature1.pdf similarity index 100% rename from Resources/musuite/testTablature1.pdf rename to data/musuite/testTablature1.pdf diff --git a/Resources/musuite/testTablature1.xml b/data/musuite/testTablature1.xml similarity index 100% rename from Resources/musuite/testTablature1.xml rename to data/musuite/testTablature1.xml diff --git a/Resources/musuite/testTablature2.pdf b/data/musuite/testTablature2.pdf similarity index 100% rename from Resources/musuite/testTablature2.pdf rename to data/musuite/testTablature2.pdf diff --git a/Resources/musuite/testTablature2.xml b/data/musuite/testTablature2.xml similarity index 100% rename from Resources/musuite/testTablature2.xml rename to data/musuite/testTablature2.xml diff --git a/Resources/musuite/testTablature3.pdf b/data/musuite/testTablature3.pdf similarity index 100% rename from Resources/musuite/testTablature3.pdf rename to data/musuite/testTablature3.pdf diff --git a/Resources/musuite/testTablature3.xml b/data/musuite/testTablature3.xml similarity index 100% rename from Resources/musuite/testTablature3.xml rename to data/musuite/testTablature3.xml diff --git a/Resources/musuite/testTempo1.xml b/data/musuite/testTempo1.xml similarity index 100% rename from Resources/musuite/testTempo1.xml rename to data/musuite/testTempo1.xml diff --git a/Resources/musuite/testTimesig1.pdf b/data/musuite/testTimesig1.pdf similarity index 100% rename from Resources/musuite/testTimesig1.pdf rename to data/musuite/testTimesig1.pdf diff --git a/Resources/musuite/testTimesig1.xml b/data/musuite/testTimesig1.xml similarity index 100% rename from Resources/musuite/testTimesig1.xml rename to data/musuite/testTimesig1.xml diff --git a/Resources/musuite/testTimesig3.pdf b/data/musuite/testTimesig3.pdf similarity index 100% rename from Resources/musuite/testTimesig3.pdf rename to data/musuite/testTimesig3.pdf diff --git a/Resources/musuite/testTimesig3.xml b/data/musuite/testTimesig3.xml similarity index 100% rename from Resources/musuite/testTimesig3.xml rename to data/musuite/testTimesig3.xml diff --git a/Resources/musuite/testTremolo.xml b/data/musuite/testTremolo.xml similarity index 100% rename from Resources/musuite/testTremolo.xml rename to data/musuite/testTremolo.xml diff --git a/Resources/musuite/testTuplets1.xml b/data/musuite/testTuplets1.xml similarity index 100% rename from Resources/musuite/testTuplets1.xml rename to data/musuite/testTuplets1.xml diff --git a/Resources/musuite/testTuplets1_ref.xml b/data/musuite/testTuplets1_ref.xml similarity index 100% rename from Resources/musuite/testTuplets1_ref.xml rename to data/musuite/testTuplets1_ref.xml diff --git a/Resources/musuite/testTuplets2.xml b/data/musuite/testTuplets2.xml similarity index 100% rename from Resources/musuite/testTuplets2.xml rename to data/musuite/testTuplets2.xml diff --git a/Resources/musuite/testTuplets2_ref.xml b/data/musuite/testTuplets2_ref.xml similarity index 100% rename from Resources/musuite/testTuplets2_ref.xml rename to data/musuite/testTuplets2_ref.xml diff --git a/Resources/musuite/testTuplets3.xml b/data/musuite/testTuplets3.xml similarity index 100% rename from Resources/musuite/testTuplets3.xml rename to data/musuite/testTuplets3.xml diff --git a/Resources/musuite/testTuplets3_ref.xml b/data/musuite/testTuplets3_ref.xml similarity index 100% rename from Resources/musuite/testTuplets3_ref.xml rename to data/musuite/testTuplets3_ref.xml diff --git a/Resources/musuite/testTuplets4.xml b/data/musuite/testTuplets4.xml similarity index 100% rename from Resources/musuite/testTuplets4.xml rename to data/musuite/testTuplets4.xml diff --git a/Resources/musuite/testUnusualDurations.xml b/data/musuite/testUnusualDurations.xml similarity index 100% rename from Resources/musuite/testUnusualDurations.xml rename to data/musuite/testUnusualDurations.xml diff --git a/Resources/musuite/testUnusualDurations_ref.xml b/data/musuite/testUnusualDurations_ref.xml similarity index 100% rename from Resources/musuite/testUnusualDurations_ref.xml rename to data/musuite/testUnusualDurations_ref.xml diff --git a/Resources/musuite/testVoiceMapper1.xml b/data/musuite/testVoiceMapper1.xml similarity index 100% rename from Resources/musuite/testVoiceMapper1.xml rename to data/musuite/testVoiceMapper1.xml diff --git a/Resources/musuite/testVoiceMapper1_ref.xml b/data/musuite/testVoiceMapper1_ref.xml similarity index 100% rename from Resources/musuite/testVoiceMapper1_ref.xml rename to data/musuite/testVoiceMapper1_ref.xml diff --git a/Resources/musuite/testVoiceMapper2.xml b/data/musuite/testVoiceMapper2.xml similarity index 100% rename from Resources/musuite/testVoiceMapper2.xml rename to data/musuite/testVoiceMapper2.xml diff --git a/Resources/musuite/testVoiceMapper2_ref.xml b/data/musuite/testVoiceMapper2_ref.xml similarity index 100% rename from Resources/musuite/testVoiceMapper2_ref.xml rename to data/musuite/testVoiceMapper2_ref.xml diff --git a/Resources/musuite/testVoiceMapper3.xml b/data/musuite/testVoiceMapper3.xml similarity index 100% rename from Resources/musuite/testVoiceMapper3.xml rename to data/musuite/testVoiceMapper3.xml diff --git a/Resources/musuite/testVoiceMapper3_ref.xml b/data/musuite/testVoiceMapper3_ref.xml similarity index 100% rename from Resources/musuite/testVoiceMapper3_ref.xml rename to data/musuite/testVoiceMapper3_ref.xml diff --git a/Resources/musuite/testVoicePiano1.pdf b/data/musuite/testVoicePiano1.pdf similarity index 100% rename from Resources/musuite/testVoicePiano1.pdf rename to data/musuite/testVoicePiano1.pdf diff --git a/Resources/musuite/testVoicePiano1.xml b/data/musuite/testVoicePiano1.xml similarity index 100% rename from Resources/musuite/testVoicePiano1.xml rename to data/musuite/testVoicePiano1.xml diff --git a/Resources/musuite/testVolta1.xml b/data/musuite/testVolta1.xml similarity index 100% rename from Resources/musuite/testVolta1.xml rename to data/musuite/testVolta1.xml diff --git a/Resources/musuite/testWedge1.xml b/data/musuite/testWedge1.xml similarity index 100% rename from Resources/musuite/testWedge1.xml rename to data/musuite/testWedge1.xml diff --git a/Resources/musuite/testWedge2.xml b/data/musuite/testWedge2.xml similarity index 100% rename from Resources/musuite/testWedge2.xml rename to data/musuite/testWedge2.xml diff --git a/Resources/musuite/testWedge2_ref.xml b/data/musuite/testWedge2_ref.xml similarity index 100% rename from Resources/musuite/testWedge2_ref.xml rename to data/musuite/testWedge2_ref.xml diff --git a/Resources/musuite/testWords1.pdf b/data/musuite/testWords1.pdf similarity index 100% rename from Resources/musuite/testWords1.pdf rename to data/musuite/testWords1.pdf diff --git a/Resources/musuite/testWords1.xml b/data/musuite/testWords1.xml similarity index 100% rename from Resources/musuite/testWords1.xml rename to data/musuite/testWords1.xml diff --git a/Resources/musuite/test_harmony.xml b/data/musuite/test_harmony.xml similarity index 100% rename from Resources/musuite/test_harmony.xml rename to data/musuite/test_harmony.xml diff --git a/Resources/mxl/Dichterliebe01.mxl b/data/mxl/Dichterliebe01.mxl similarity index 100% rename from Resources/mxl/Dichterliebe01.mxl rename to data/mxl/Dichterliebe01.mxl diff --git a/Resources/recsuite/ActorPreludeSample.mxl b/data/recsuite/ActorPreludeSample.mxl similarity index 100% rename from Resources/recsuite/ActorPreludeSample.mxl rename to data/recsuite/ActorPreludeSample.mxl diff --git a/Resources/recsuite/ActorPreludeSample.pdf b/data/recsuite/ActorPreludeSample.pdf similarity index 100% rename from Resources/recsuite/ActorPreludeSample.pdf rename to data/recsuite/ActorPreludeSample.pdf diff --git a/Resources/recsuite/ActorPreludeSample.xml b/data/recsuite/ActorPreludeSample.xml similarity index 100% rename from Resources/recsuite/ActorPreludeSample.xml rename to data/recsuite/ActorPreludeSample.xml diff --git a/Resources/recsuite/BeetAnGeSample.mxl b/data/recsuite/BeetAnGeSample.mxl similarity index 100% rename from Resources/recsuite/BeetAnGeSample.mxl rename to data/recsuite/BeetAnGeSample.mxl diff --git a/Resources/recsuite/BeetAnGeSample.pdf b/data/recsuite/BeetAnGeSample.pdf similarity index 100% rename from Resources/recsuite/BeetAnGeSample.pdf rename to data/recsuite/BeetAnGeSample.pdf diff --git a/Resources/recsuite/BeetAnGeSample.xml b/data/recsuite/BeetAnGeSample.xml similarity index 100% rename from Resources/recsuite/BeetAnGeSample.xml rename to data/recsuite/BeetAnGeSample.xml diff --git a/Resources/recsuite/Binchois.mxl b/data/recsuite/Binchois.mxl similarity index 100% rename from Resources/recsuite/Binchois.mxl rename to data/recsuite/Binchois.mxl diff --git a/Resources/recsuite/Binchois.png b/data/recsuite/Binchois.png similarity index 100% rename from Resources/recsuite/Binchois.png rename to data/recsuite/Binchois.png diff --git a/Resources/recsuite/Binchois.xml b/data/recsuite/Binchois.xml similarity index 100% rename from Resources/recsuite/Binchois.xml rename to data/recsuite/Binchois.xml diff --git a/Resources/recsuite/BrahWiMeSample.mxl b/data/recsuite/BrahWiMeSample.mxl similarity index 100% rename from Resources/recsuite/BrahWiMeSample.mxl rename to data/recsuite/BrahWiMeSample.mxl diff --git a/Resources/recsuite/BrahWiMeSample.pdf b/data/recsuite/BrahWiMeSample.pdf similarity index 100% rename from Resources/recsuite/BrahWiMeSample.pdf rename to data/recsuite/BrahWiMeSample.pdf diff --git a/Resources/recsuite/BrahWiMeSample.xml b/data/recsuite/BrahWiMeSample.xml similarity index 100% rename from Resources/recsuite/BrahWiMeSample.xml rename to data/recsuite/BrahWiMeSample.xml diff --git a/Resources/recsuite/BrookeWestSample.mxl b/data/recsuite/BrookeWestSample.mxl similarity index 100% rename from Resources/recsuite/BrookeWestSample.mxl rename to data/recsuite/BrookeWestSample.mxl diff --git a/Resources/recsuite/BrookeWestSample.pdf b/data/recsuite/BrookeWestSample.pdf similarity index 100% rename from Resources/recsuite/BrookeWestSample.pdf rename to data/recsuite/BrookeWestSample.pdf diff --git a/Resources/recsuite/BrookeWestSample.xml b/data/recsuite/BrookeWestSample.xml similarity index 100% rename from Resources/recsuite/BrookeWestSample.xml rename to data/recsuite/BrookeWestSample.xml diff --git a/Resources/recsuite/Chant.mxl b/data/recsuite/Chant.mxl similarity index 100% rename from Resources/recsuite/Chant.mxl rename to data/recsuite/Chant.mxl diff --git a/Resources/recsuite/Chant.png b/data/recsuite/Chant.png similarity index 100% rename from Resources/recsuite/Chant.png rename to data/recsuite/Chant.png diff --git a/Resources/recsuite/Chant.xml b/data/recsuite/Chant.xml similarity index 100% rename from Resources/recsuite/Chant.xml rename to data/recsuite/Chant.xml diff --git a/Resources/recsuite/DebuMandSample.mxl b/data/recsuite/DebuMandSample.mxl similarity index 100% rename from Resources/recsuite/DebuMandSample.mxl rename to data/recsuite/DebuMandSample.mxl diff --git a/Resources/recsuite/DebuMandSample.pdf b/data/recsuite/DebuMandSample.pdf similarity index 100% rename from Resources/recsuite/DebuMandSample.pdf rename to data/recsuite/DebuMandSample.pdf diff --git a/Resources/recsuite/DebuMandSample.xml b/data/recsuite/DebuMandSample.xml similarity index 100% rename from Resources/recsuite/DebuMandSample.xml rename to data/recsuite/DebuMandSample.xml diff --git a/Resources/recsuite/Dichterliebe01.mxl b/data/recsuite/Dichterliebe01.mxl similarity index 100% rename from Resources/recsuite/Dichterliebe01.mxl rename to data/recsuite/Dichterliebe01.mxl diff --git a/Resources/recsuite/Dichterliebe01.pdf b/data/recsuite/Dichterliebe01.pdf similarity index 100% rename from Resources/recsuite/Dichterliebe01.pdf rename to data/recsuite/Dichterliebe01.pdf diff --git a/Resources/recsuite/Dichterliebe01.xml b/data/recsuite/Dichterliebe01.xml similarity index 100% rename from Resources/recsuite/Dichterliebe01.xml rename to data/recsuite/Dichterliebe01.xml diff --git a/Resources/recsuite/Echigo_Jishi.mxl b/data/recsuite/Echigo_Jishi.mxl similarity index 100% rename from Resources/recsuite/Echigo_Jishi.mxl rename to data/recsuite/Echigo_Jishi.mxl diff --git a/Resources/recsuite/Echigo_Jishi.pdf b/data/recsuite/Echigo_Jishi.pdf similarity index 100% rename from Resources/recsuite/Echigo_Jishi.pdf rename to data/recsuite/Echigo_Jishi.pdf diff --git a/Resources/recsuite/Echigo_Jishi.xml b/data/recsuite/Echigo_Jishi.xml similarity index 100% rename from Resources/recsuite/Echigo_Jishi.xml rename to data/recsuite/Echigo_Jishi.xml diff --git a/Resources/recsuite/FaurReveSample.mxl b/data/recsuite/FaurReveSample.mxl similarity index 100% rename from Resources/recsuite/FaurReveSample.mxl rename to data/recsuite/FaurReveSample.mxl diff --git a/Resources/recsuite/FaurReveSample.pdf b/data/recsuite/FaurReveSample.pdf similarity index 100% rename from Resources/recsuite/FaurReveSample.pdf rename to data/recsuite/FaurReveSample.pdf diff --git a/Resources/recsuite/FaurReveSample.xml b/data/recsuite/FaurReveSample.xml similarity index 100% rename from Resources/recsuite/FaurReveSample.xml rename to data/recsuite/FaurReveSample.xml diff --git a/Resources/recsuite/MahlFaGe4Sample.mxl b/data/recsuite/MahlFaGe4Sample.mxl similarity index 100% rename from Resources/recsuite/MahlFaGe4Sample.mxl rename to data/recsuite/MahlFaGe4Sample.mxl diff --git a/Resources/recsuite/MahlFaGe4Sample.pdf b/data/recsuite/MahlFaGe4Sample.pdf similarity index 100% rename from Resources/recsuite/MahlFaGe4Sample.pdf rename to data/recsuite/MahlFaGe4Sample.pdf diff --git a/Resources/recsuite/MahlFaGe4Sample.xml b/data/recsuite/MahlFaGe4Sample.xml similarity index 100% rename from Resources/recsuite/MahlFaGe4Sample.xml rename to data/recsuite/MahlFaGe4Sample.xml diff --git a/Resources/recsuite/MozaChloSample.mxl b/data/recsuite/MozaChloSample.mxl similarity index 100% rename from Resources/recsuite/MozaChloSample.mxl rename to data/recsuite/MozaChloSample.mxl diff --git a/Resources/recsuite/MozaChloSample.pdf b/data/recsuite/MozaChloSample.pdf similarity index 100% rename from Resources/recsuite/MozaChloSample.pdf rename to data/recsuite/MozaChloSample.pdf diff --git a/Resources/recsuite/MozaChloSample.xml b/data/recsuite/MozaChloSample.xml similarity index 100% rename from Resources/recsuite/MozaChloSample.xml rename to data/recsuite/MozaChloSample.xml diff --git a/Resources/recsuite/MozaChloSample2.xml b/data/recsuite/MozaChloSample2.xml similarity index 100% rename from Resources/recsuite/MozaChloSample2.xml rename to data/recsuite/MozaChloSample2.xml diff --git a/Resources/recsuite/MozaVeilSample.mxl b/data/recsuite/MozaVeilSample.mxl similarity index 100% rename from Resources/recsuite/MozaVeilSample.mxl rename to data/recsuite/MozaVeilSample.mxl diff --git a/Resources/recsuite/MozaVeilSample.pdf b/data/recsuite/MozaVeilSample.pdf similarity index 100% rename from Resources/recsuite/MozaVeilSample.pdf rename to data/recsuite/MozaVeilSample.pdf diff --git a/Resources/recsuite/MozaVeilSample.xml b/data/recsuite/MozaVeilSample.xml similarity index 100% rename from Resources/recsuite/MozaVeilSample.xml rename to data/recsuite/MozaVeilSample.xml diff --git a/Resources/recsuite/MozartPianoSonata.mxl b/data/recsuite/MozartPianoSonata.mxl similarity index 100% rename from Resources/recsuite/MozartPianoSonata.mxl rename to data/recsuite/MozartPianoSonata.mxl diff --git a/Resources/recsuite/MozartPianoSonata.png b/data/recsuite/MozartPianoSonata.png similarity index 100% rename from Resources/recsuite/MozartPianoSonata.png rename to data/recsuite/MozartPianoSonata.png diff --git a/Resources/recsuite/MozartPianoSonata.xml b/data/recsuite/MozartPianoSonata.xml similarity index 100% rename from Resources/recsuite/MozartPianoSonata.xml rename to data/recsuite/MozartPianoSonata.xml diff --git a/Resources/recsuite/MozartTrio.mxl b/data/recsuite/MozartTrio.mxl similarity index 100% rename from Resources/recsuite/MozartTrio.mxl rename to data/recsuite/MozartTrio.mxl diff --git a/Resources/recsuite/MozartTrio.png b/data/recsuite/MozartTrio.png similarity index 100% rename from Resources/recsuite/MozartTrio.png rename to data/recsuite/MozartTrio.png diff --git a/Resources/recsuite/MozartTrio.xml b/data/recsuite/MozartTrio.xml similarity index 100% rename from Resources/recsuite/MozartTrio.xml rename to data/recsuite/MozartTrio.xml diff --git a/Resources/recsuite/NonUtf8Files.txt b/data/recsuite/NonUtf8Files.txt similarity index 100% rename from Resources/recsuite/NonUtf8Files.txt rename to data/recsuite/NonUtf8Files.txt diff --git a/Resources/recsuite/Saltarello.mxl b/data/recsuite/Saltarello.mxl similarity index 100% rename from Resources/recsuite/Saltarello.mxl rename to data/recsuite/Saltarello.mxl diff --git a/Resources/recsuite/Saltarello.png b/data/recsuite/Saltarello.png similarity index 100% rename from Resources/recsuite/Saltarello.png rename to data/recsuite/Saltarello.png diff --git a/Resources/recsuite/Saltarello.xml b/data/recsuite/Saltarello.xml similarity index 100% rename from Resources/recsuite/Saltarello.xml rename to data/recsuite/Saltarello.xml diff --git a/Resources/recsuite/SchbAvMaSample.mxl b/data/recsuite/SchbAvMaSample.mxl similarity index 100% rename from Resources/recsuite/SchbAvMaSample.mxl rename to data/recsuite/SchbAvMaSample.mxl diff --git a/Resources/recsuite/SchbAvMaSample.pdf b/data/recsuite/SchbAvMaSample.pdf similarity index 100% rename from Resources/recsuite/SchbAvMaSample.pdf rename to data/recsuite/SchbAvMaSample.pdf diff --git a/Resources/recsuite/SchbAvMaSample.xml b/data/recsuite/SchbAvMaSample.xml similarity index 100% rename from Resources/recsuite/SchbAvMaSample.xml rename to data/recsuite/SchbAvMaSample.xml diff --git a/Resources/recsuite/Telemann.mxl b/data/recsuite/Telemann.mxl similarity index 100% rename from Resources/recsuite/Telemann.mxl rename to data/recsuite/Telemann.mxl diff --git a/Resources/recsuite/Telemann.png b/data/recsuite/Telemann.png similarity index 100% rename from Resources/recsuite/Telemann.png rename to data/recsuite/Telemann.png diff --git a/Resources/recsuite/Telemann.xml b/data/recsuite/Telemann.xml similarity index 100% rename from Resources/recsuite/Telemann.xml rename to data/recsuite/Telemann.xml diff --git a/Resources/smufl/glyphnames.json b/data/smufl/glyphnames.json similarity index 100% rename from Resources/smufl/glyphnames.json rename to data/smufl/glyphnames.json diff --git a/Resources/testOutput/.gitignore b/data/testOutput/.gitignore similarity index 100% rename from Resources/testOutput/.gitignore rename to data/testOutput/.gitignore From bf23be472bfd716d85833c1b7d534f51ffc82d7c Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:48:22 +0200 Subject: [PATCH 28/34] rename Sourcecode -> src Update all references: CMakeLists.txt, Makefile, Dockerfile, .dockerignore, .gitignore, ci.yaml, README.md, CHANGELOG.md, AGENTS.md, docs/ai/project/*.md, DevScripts/*.rb, and Xcode/Mx.xcodeproj/project.pbxproj. --- .dockerignore | 2 +- .github/workflows/ci.yaml | 4 +-- .gitignore | 2 +- AGENTS.md | 28 +++++++++---------- CHANGELOG.md | 2 +- CMakeLists.txt | 2 +- DevScripts/adjustElementsCpp.rb | 4 +-- DevScripts/adjustElementsH.rb | 4 +-- DevScripts/attributes.rb | 8 +++--- DevScripts/attributesLoop.rb | 2 +- DevScripts/elementsHUsingFile.rb | 2 +- DevScripts/findFilesWithBadCopyright.rb | 18 ++++++------ DevScripts/fromXElement.rb | 8 +++--- DevScripts/includeAlot.rb | 2 +- DevScripts/lineInstructionsH.rb | 2 +- DevScripts/listClassesInEnumsH.rb | 2 +- DevScripts/listDecimals.rb | 2 +- DevScripts/listEnums.rb | 2 +- DevScripts/listIntegers.rb | 2 +- DevScripts/listStrings.rb | 2 +- DevScripts/mxdeploy-v01.rb | 4 +-- DevScripts/mxdeploy-v02.rb | 2 +- DevScripts/mxdeploy.rb | 10 +++---- DevScripts/parseElementsCpp.rb | 2 +- DevScripts/parseElementsH.rb | 2 +- DevScripts/parseElementsHOrder.rb | 4 +-- DevScripts/smuflHeader.rb | 2 +- DevScripts/version.rb | 2 +- DevScripts/writeElementsCppFiles.rb | 6 ++-- DevScripts/writeHFiles.rb | 4 +-- Dockerfile | 4 +-- Makefile | 10 +++---- README.md | 6 ++-- Xcode/Mx.xcodeproj/project.pbxproj | 8 +++--- docs/ai/project/AGENTS.md | 2 +- docs/ai/project/build-and-ci-design.md | 28 +++++++++---------- .../include/mx/api/ApiCommon.h | 0 .../include/mx/api/ApiEquality.h | 0 .../include/mx/api/AppearanceData.h | 0 .../include/mx/api/BarlineData.h | 0 .../include/mx/api/ChordData.h | 0 {Sourcecode => src}/include/mx/api/ClefData.h | 0 {Sourcecode => src}/include/mx/api/CodaData.h | 0 .../include/mx/api/ColorData.h | 0 .../include/mx/api/CurveData.h | 0 .../include/mx/api/DefaultsData.h | 0 .../include/mx/api/DirectionData.h | 0 .../include/mx/api/DocumentManager.h | 0 .../include/mx/api/DurationData.h | 0 .../include/mx/api/EncodingData.h | 0 {Sourcecode => src}/include/mx/api/FontData.h | 0 .../include/mx/api/KeyComponent.h | 0 {Sourcecode => src}/include/mx/api/KeyData.h | 0 .../include/mx/api/LayoutData.h | 0 .../include/mx/api/LeftRight.h | 0 {Sourcecode => src}/include/mx/api/LineData.h | 0 .../include/mx/api/LyricData.h | 0 .../include/mx/api/MarginsData.h | 0 {Sourcecode => src}/include/mx/api/MarkData.h | 0 .../include/mx/api/MeasureData.h | 0 .../include/mx/api/MeasureLocation.h | 0 {Sourcecode => src}/include/mx/api/MiscData.h | 0 .../include/mx/api/NoteAttachmentData.h | 0 {Sourcecode => src}/include/mx/api/NoteData.h | 0 .../include/mx/api/OttavaData.h | 0 {Sourcecode => src}/include/mx/api/PageData.h | 0 .../include/mx/api/PageLayoutData.h | 0 .../include/mx/api/PageMarginsData.h | 0 .../include/mx/api/PageTextData.h | 0 {Sourcecode => src}/include/mx/api/PartData.h | 0 .../include/mx/api/PartGroupData.h | 0 .../include/mx/api/PitchData.h | 0 .../include/mx/api/PositionData.h | 0 .../include/mx/api/PrintData.h | 0 .../include/mx/api/RehearsalData.h | 0 .../include/mx/api/ScoreData.h | 0 .../include/mx/api/SegnoData.h | 0 {Sourcecode => src}/include/mx/api/SizeData.h | 0 {Sourcecode => src}/include/mx/api/SoundID.h | 0 .../include/mx/api/SpannerData.h | 0 .../include/mx/api/StaffData.h | 0 .../include/mx/api/SystemData.h | 0 .../include/mx/api/SystemLayoutData.h | 0 .../include/mx/api/TempoData.h | 0 .../include/mx/api/TimeSignatureData.h | 0 .../include/mx/api/TransposeData.h | 0 .../include/mx/api/TupletData.h | 0 {Sourcecode => src}/include/mx/api/Version.h | 0 .../include/mx/api/VoiceData.h | 0 .../include/mx/api/WedgeData.h | 0 .../include/mx/api/WordsData.h | 0 {Sourcecode => src}/private/cpul/catch.cpp | 0 {Sourcecode => src}/private/cpul/catch.h | 0 .../private/cpul/catchDefines.h | 0 {Sourcecode => src}/private/cpul/cpulRun.h | 0 .../private/cpul/cpulTestHarness.h | 0 .../private/cpul/cpulTestTimer.h | 0 {Sourcecode => src}/private/cpul/cpulVsTest.h | 0 {Sourcecode => src}/private/cpul/main.cpp | 0 .../private/cpul/msNoexceptHack.h | 0 .../private/cpul/unusedParameter.h | 0 .../private/mx/api/AppearanceData.cpp | 0 .../private/mx/api/ChordData.cpp | 0 .../private/mx/api/ClefData.cpp | 0 .../private/mx/api/DocumentManager.cpp | 0 .../private/mx/api/DurationData.cpp | 0 .../private/mx/api/EncodingData.cpp | 0 .../private/mx/api/MarkData.cpp | 0 .../private/mx/api/MeasureLocation.cpp | 0 .../private/mx/api/NoteData.cpp | 0 .../private/mx/api/PitchData.cpp | 0 .../private/mx/api/ScoreData.cpp | 0 .../private/mx/api/SoundID.cpp | 0 .../private/mx/api/Version.cpp | 0 .../private/mx/core/AttributesInterface.cpp | 0 .../private/mx/core/AttributesInterface.h | 0 {Sourcecode => src}/private/mx/core/Color.cpp | 0 {Sourcecode => src}/private/mx/core/Color.h | 0 .../core/CommaSeparatedPositiveIntegers.cpp | 0 .../mx/core/CommaSeparatedPositiveIntegers.h | 0 .../private/mx/core/CommaSeparatedText.cpp | 0 .../private/mx/core/CommaSeparatedText.h | 0 {Sourcecode => src}/private/mx/core/Date.cpp | 0 {Sourcecode => src}/private/mx/core/Date.h | 0 .../private/mx/core/Decimals.cpp | 0 .../private/mx/core/Decimals.h | 0 .../private/mx/core/Document.cpp | 0 .../private/mx/core/Document.h | 0 .../private/mx/core/DocumentHeader.cpp | 0 .../private/mx/core/DocumentHeader.h | 0 .../private/mx/core/DocumentSpec.cpp | 0 .../private/mx/core/DocumentSpec.h | 0 .../private/mx/core/ElementInterface.cpp | 0 .../private/mx/core/ElementInterface.h | 0 .../private/mx/core/Elements.h | 0 .../EmptyPrintObjectStyleAlignAttributes.cpp | 0 .../EmptyPrintObjectStyleAlignAttributes.h | 0 .../private/mx/core/EndingNumber.h | 0 {Sourcecode => src}/private/mx/core/Enums.cpp | 0 {Sourcecode => src}/private/mx/core/Enums.h | 0 .../private/mx/core/EnumsBuiltin.cpp | 0 .../private/mx/core/EnumsBuiltin.h | 0 .../private/mx/core/FontSize.cpp | 0 .../private/mx/core/FontSize.h | 0 .../private/mx/core/ForwardDeclare.h | 0 .../private/mx/core/FromString.h | 0 .../private/mx/core/FromXElement.cpp | 0 .../private/mx/core/FromXElement.h | 0 .../private/mx/core/Integers.cpp | 0 .../private/mx/core/Integers.h | 0 .../private/mx/core/NumberOrNormal.cpp | 0 .../private/mx/core/NumberOrNormal.h | 0 .../private/mx/core/PlaybackSound.h | 0 .../mx/core/PositiveIntegerOrEmpty.cpp | 0 .../private/mx/core/PositiveIntegerOrEmpty.h | 0 .../private/mx/core/ProcessingInstruction.cpp | 0 .../private/mx/core/ProcessingInstruction.h | 0 .../private/mx/core/ScoreConversions.cpp | 0 .../private/mx/core/ScoreConversions.h | 0 .../private/mx/core/StringUtils.h | 0 .../private/mx/core/TimeOnly.h | 0 .../private/mx/core/UnusedParameter.h | 0 .../private/mx/core/XlinkHref.h | 0 .../private/mx/core/XlinkRole.h | 0 .../private/mx/core/XlinkTitle.h | 0 {Sourcecode => src}/private/mx/core/XmlLang.h | 0 .../private/mx/core/XsAnyUri.h | 0 {Sourcecode => src}/private/mx/core/XsID.cpp | 0 {Sourcecode => src}/private/mx/core/XsID.h | 0 {Sourcecode => src}/private/mx/core/XsIDREF.h | 0 .../private/mx/core/XsNMToken.h | 0 .../private/mx/core/XsString.cpp | 0 .../private/mx/core/XsString.h | 0 .../private/mx/core/XsToken.cpp | 0 {Sourcecode => src}/private/mx/core/XsToken.h | 0 .../private/mx/core/YesNoNumber.cpp | 0 .../private/mx/core/YesNoNumber.h | 0 .../private/mx/core/elements/Accent.cpp | 0 .../private/mx/core/elements/Accent.h | 0 .../private/mx/core/elements/Accidental.cpp | 0 .../private/mx/core/elements/Accidental.h | 0 .../mx/core/elements/AccidentalAttributes.cpp | 0 .../mx/core/elements/AccidentalAttributes.h | 0 .../mx/core/elements/AccidentalMark.cpp | 0 .../private/mx/core/elements/AccidentalMark.h | 0 .../elements/AccidentalMarkAttributes.cpp | 0 .../core/elements/AccidentalMarkAttributes.h | 0 .../mx/core/elements/AccidentalText.cpp | 0 .../private/mx/core/elements/AccidentalText.h | 0 .../elements/AccidentalTextAttributes.cpp | 0 .../core/elements/AccidentalTextAttributes.h | 0 .../private/mx/core/elements/Accord.cpp | 0 .../private/mx/core/elements/Accord.h | 0 .../mx/core/elements/AccordAttributes.cpp | 0 .../mx/core/elements/AccordAttributes.h | 0 .../mx/core/elements/AccordionHigh.cpp | 0 .../private/mx/core/elements/AccordionHigh.h | 0 .../private/mx/core/elements/AccordionLow.cpp | 0 .../private/mx/core/elements/AccordionLow.h | 0 .../mx/core/elements/AccordionMiddle.cpp | 0 .../mx/core/elements/AccordionMiddle.h | 0 .../core/elements/AccordionRegistration.cpp | 0 .../mx/core/elements/AccordionRegistration.h | 0 .../AccordionRegistrationAttributes.cpp | 0 .../AccordionRegistrationAttributes.h | 0 .../private/mx/core/elements/ActualNotes.cpp | 0 .../private/mx/core/elements/ActualNotes.h | 0 .../private/mx/core/elements/Alter.cpp | 0 .../private/mx/core/elements/Alter.h | 0 .../private/mx/core/elements/Appearance.cpp | 0 .../private/mx/core/elements/Appearance.h | 0 .../private/mx/core/elements/Arpeggiate.cpp | 0 .../private/mx/core/elements/Arpeggiate.h | 0 .../mx/core/elements/ArpeggiateAttributes.cpp | 0 .../mx/core/elements/ArpeggiateAttributes.h | 0 .../private/mx/core/elements/Arrow.cpp | 0 .../private/mx/core/elements/Arrow.h | 0 .../mx/core/elements/ArrowAttributes.cpp | 0 .../mx/core/elements/ArrowAttributes.h | 0 .../mx/core/elements/ArrowDirection.cpp | 0 .../private/mx/core/elements/ArrowDirection.h | 0 .../private/mx/core/elements/ArrowGroup.cpp | 0 .../private/mx/core/elements/ArrowGroup.h | 0 .../private/mx/core/elements/ArrowStyle.cpp | 0 .../private/mx/core/elements/ArrowStyle.h | 0 .../mx/core/elements/Articulations.cpp | 0 .../private/mx/core/elements/Articulations.h | 0 .../mx/core/elements/ArticulationsChoice.cpp | 0 .../mx/core/elements/ArticulationsChoice.h | 0 .../private/mx/core/elements/Artificial.cpp | 0 .../private/mx/core/elements/Artificial.h | 0 .../mx/core/elements/AttributesIterface.h | 0 .../private/mx/core/elements/Backup.cpp | 0 .../private/mx/core/elements/Backup.h | 0 .../private/mx/core/elements/BarStyle.cpp | 0 .../private/mx/core/elements/BarStyle.h | 0 .../mx/core/elements/BarStyleAttributes.cpp | 0 .../mx/core/elements/BarStyleAttributes.h | 0 .../private/mx/core/elements/Barline.cpp | 0 .../private/mx/core/elements/Barline.h | 0 .../mx/core/elements/BarlineAttributes.cpp | 0 .../mx/core/elements/BarlineAttributes.h | 0 .../private/mx/core/elements/Barre.cpp | 0 .../private/mx/core/elements/Barre.h | 0 .../mx/core/elements/BarreAttributes.cpp | 0 .../mx/core/elements/BarreAttributes.h | 0 .../private/mx/core/elements/BasePitch.cpp | 0 .../private/mx/core/elements/BasePitch.h | 0 .../private/mx/core/elements/Bass.cpp | 0 .../private/mx/core/elements/Bass.h | 0 .../private/mx/core/elements/BassAlter.cpp | 0 .../private/mx/core/elements/BassAlter.h | 0 .../mx/core/elements/BassAlterAttributes.cpp | 0 .../mx/core/elements/BassAlterAttributes.h | 0 .../private/mx/core/elements/BassStep.cpp | 0 .../private/mx/core/elements/BassStep.h | 0 .../mx/core/elements/BassStepAttributes.cpp | 0 .../mx/core/elements/BassStepAttributes.h | 0 .../private/mx/core/elements/Beam.cpp | 0 .../private/mx/core/elements/Beam.h | 0 .../mx/core/elements/BeamAttributes.cpp | 0 .../private/mx/core/elements/BeamAttributes.h | 0 .../private/mx/core/elements/BeatRepeat.cpp | 0 .../private/mx/core/elements/BeatRepeat.h | 0 .../mx/core/elements/BeatRepeatAttributes.cpp | 0 .../mx/core/elements/BeatRepeatAttributes.h | 0 .../private/mx/core/elements/BeatType.cpp | 0 .../private/mx/core/elements/BeatType.h | 0 .../private/mx/core/elements/BeatUnit.cpp | 0 .../private/mx/core/elements/BeatUnit.h | 0 .../private/mx/core/elements/BeatUnitDot.cpp | 0 .../private/mx/core/elements/BeatUnitDot.h | 0 .../mx/core/elements/BeatUnitGroup.cpp | 0 .../private/mx/core/elements/BeatUnitGroup.h | 0 .../private/mx/core/elements/BeatUnitPer.cpp | 0 .../private/mx/core/elements/BeatUnitPer.h | 0 .../BeatUnitPerOrNoteRelationNoteChoice.cpp | 0 .../BeatUnitPerOrNoteRelationNoteChoice.h | 0 .../private/mx/core/elements/Beater.cpp | 0 .../private/mx/core/elements/Beater.h | 0 .../mx/core/elements/BeaterAttributes.cpp | 0 .../mx/core/elements/BeaterAttributes.h | 0 .../private/mx/core/elements/Beats.cpp | 0 .../private/mx/core/elements/Beats.h | 0 .../private/mx/core/elements/Bend.cpp | 0 .../private/mx/core/elements/Bend.h | 0 .../private/mx/core/elements/BendAlter.cpp | 0 .../private/mx/core/elements/BendAlter.h | 0 .../mx/core/elements/BendAttributes.cpp | 0 .../private/mx/core/elements/BendAttributes.h | 0 .../private/mx/core/elements/BendChoice.cpp | 0 .../private/mx/core/elements/BendChoice.h | 0 .../private/mx/core/elements/Bookmark.cpp | 0 .../private/mx/core/elements/Bookmark.h | 0 .../mx/core/elements/BookmarkAttributes.cpp | 0 .../mx/core/elements/BookmarkAttributes.h | 0 .../private/mx/core/elements/BottomMargin.cpp | 0 .../private/mx/core/elements/BottomMargin.h | 0 .../private/mx/core/elements/Bracket.cpp | 0 .../private/mx/core/elements/Bracket.h | 0 .../mx/core/elements/BracketAttributes.cpp | 0 .../mx/core/elements/BracketAttributes.h | 0 .../private/mx/core/elements/BreathMark.cpp | 0 .../private/mx/core/elements/BreathMark.h | 0 .../mx/core/elements/BreathMarkAttributes.cpp | 0 .../mx/core/elements/BreathMarkAttributes.h | 0 .../private/mx/core/elements/Caesura.cpp | 0 .../private/mx/core/elements/Caesura.h | 0 .../private/mx/core/elements/Cancel.cpp | 0 .../private/mx/core/elements/Cancel.h | 0 .../mx/core/elements/CancelAttributes.cpp | 0 .../mx/core/elements/CancelAttributes.h | 0 .../private/mx/core/elements/Capo.cpp | 0 .../private/mx/core/elements/Capo.h | 0 .../private/mx/core/elements/Chord.cpp | 0 .../private/mx/core/elements/Chord.h | 0 .../private/mx/core/elements/Chromatic.cpp | 0 .../private/mx/core/elements/Chromatic.h | 0 .../mx/core/elements/CircularArrow.cpp | 0 .../private/mx/core/elements/CircularArrow.h | 0 .../private/mx/core/elements/Clef.cpp | 0 .../private/mx/core/elements/Clef.h | 0 .../mx/core/elements/ClefAttributes.cpp | 0 .../private/mx/core/elements/ClefAttributes.h | 0 .../mx/core/elements/ClefOctaveChange.cpp | 0 .../mx/core/elements/ClefOctaveChange.h | 0 .../private/mx/core/elements/Coda.cpp | 0 .../private/mx/core/elements/Coda.h | 0 .../private/mx/core/elements/Creator.cpp | 0 .../private/mx/core/elements/Creator.h | 0 .../mx/core/elements/CreatorAttributes.cpp | 0 .../mx/core/elements/CreatorAttributes.h | 0 .../private/mx/core/elements/Credit.cpp | 0 .../private/mx/core/elements/Credit.h | 0 .../mx/core/elements/CreditAttributes.cpp | 0 .../mx/core/elements/CreditAttributes.h | 0 .../private/mx/core/elements/CreditChoice.cpp | 0 .../private/mx/core/elements/CreditChoice.h | 0 .../private/mx/core/elements/CreditImage.cpp | 0 .../private/mx/core/elements/CreditImage.h | 0 .../core/elements/CreditImageAttributes.cpp | 0 .../mx/core/elements/CreditImageAttributes.h | 0 .../private/mx/core/elements/CreditType.cpp | 0 .../private/mx/core/elements/CreditType.h | 0 .../private/mx/core/elements/CreditWords.cpp | 0 .../private/mx/core/elements/CreditWords.h | 0 .../core/elements/CreditWordsAttributes.cpp | 0 .../mx/core/elements/CreditWordsAttributes.h | 0 .../mx/core/elements/CreditWordsGroup.cpp | 0 .../mx/core/elements/CreditWordsGroup.h | 0 .../private/mx/core/elements/Cue.cpp | 0 .../private/mx/core/elements/Cue.h | 0 .../private/mx/core/elements/CueNoteGroup.cpp | 0 .../private/mx/core/elements/CueNoteGroup.h | 0 .../private/mx/core/elements/Damp.cpp | 0 .../private/mx/core/elements/Damp.h | 0 .../private/mx/core/elements/DampAll.cpp | 0 .../private/mx/core/elements/DampAll.h | 0 .../private/mx/core/elements/Dashes.cpp | 0 .../private/mx/core/elements/Dashes.h | 0 .../mx/core/elements/DashesAttributes.cpp | 0 .../mx/core/elements/DashesAttributes.h | 0 .../private/mx/core/elements/Defaults.cpp | 0 .../private/mx/core/elements/Defaults.h | 0 .../private/mx/core/elements/Degree.cpp | 0 .../private/mx/core/elements/Degree.h | 0 .../private/mx/core/elements/DegreeAlter.cpp | 0 .../private/mx/core/elements/DegreeAlter.h | 0 .../core/elements/DegreeAlterAttributes.cpp | 0 .../mx/core/elements/DegreeAlterAttributes.h | 0 .../mx/core/elements/DegreeAttributes.cpp | 0 .../mx/core/elements/DegreeAttributes.h | 0 .../private/mx/core/elements/DegreeType.cpp | 0 .../private/mx/core/elements/DegreeType.h | 0 .../mx/core/elements/DegreeTypeAttributes.cpp | 0 .../mx/core/elements/DegreeTypeAttributes.h | 0 .../private/mx/core/elements/DegreeValue.cpp | 0 .../private/mx/core/elements/DegreeValue.h | 0 .../core/elements/DegreeValueAttributes.cpp | 0 .../mx/core/elements/DegreeValueAttributes.h | 0 .../mx/core/elements/DelayedInvertedTurn.cpp | 0 .../mx/core/elements/DelayedInvertedTurn.h | 0 .../DelayedInvertedTurnAttributes.cpp | 0 .../elements/DelayedInvertedTurnAttributes.h | 0 .../private/mx/core/elements/DelayedTurn.cpp | 0 .../private/mx/core/elements/DelayedTurn.h | 0 .../core/elements/DelayedTurnAttributes.cpp | 0 .../mx/core/elements/DelayedTurnAttributes.h | 0 .../mx/core/elements/DetachedLegato.cpp | 0 .../private/mx/core/elements/DetachedLegato.h | 0 .../private/mx/core/elements/Diatonic.cpp | 0 .../private/mx/core/elements/Diatonic.h | 0 .../private/mx/core/elements/Direction.cpp | 0 .../private/mx/core/elements/Direction.h | 0 .../mx/core/elements/DirectionAttributes.cpp | 0 .../mx/core/elements/DirectionAttributes.h | 0 .../mx/core/elements/DirectionType.cpp | 0 .../private/mx/core/elements/DirectionType.h | 0 .../private/mx/core/elements/Directive.cpp | 0 .../private/mx/core/elements/Directive.h | 0 .../mx/core/elements/DirectiveAttributes.cpp | 0 .../mx/core/elements/DirectiveAttributes.h | 0 .../mx/core/elements/DisplayOctave.cpp | 0 .../private/mx/core/elements/DisplayOctave.h | 0 .../private/mx/core/elements/DisplayStep.cpp | 0 .../private/mx/core/elements/DisplayStep.h | 0 .../core/elements/DisplayStepOctaveGroup.cpp | 0 .../mx/core/elements/DisplayStepOctaveGroup.h | 0 .../private/mx/core/elements/DisplayText.cpp | 0 .../private/mx/core/elements/DisplayText.h | 0 .../core/elements/DisplayTextAttributes.cpp | 0 .../mx/core/elements/DisplayTextAttributes.h | 0 .../elements/DisplayTextOrAccidentalText.cpp | 0 .../elements/DisplayTextOrAccidentalText.h | 0 .../private/mx/core/elements/Distance.cpp | 0 .../private/mx/core/elements/Distance.h | 0 .../mx/core/elements/DistanceAttributes.cpp | 0 .../mx/core/elements/DistanceAttributes.h | 0 .../private/mx/core/elements/Divisions.cpp | 0 .../private/mx/core/elements/Divisions.h | 0 .../private/mx/core/elements/Doit.cpp | 0 .../private/mx/core/elements/Doit.h | 0 .../private/mx/core/elements/Dot.cpp | 0 .../private/mx/core/elements/Dot.h | 0 .../private/mx/core/elements/Double.cpp | 0 .../private/mx/core/elements/Double.h | 0 .../private/mx/core/elements/DoubleTongue.cpp | 0 .../private/mx/core/elements/DoubleTongue.h | 0 .../private/mx/core/elements/DownBow.cpp | 0 .../private/mx/core/elements/DownBow.h | 0 .../private/mx/core/elements/Duration.cpp | 0 .../private/mx/core/elements/Duration.h | 0 .../private/mx/core/elements/Dynamics.cpp | 0 .../private/mx/core/elements/Dynamics.h | 0 .../mx/core/elements/DynamicsAttributes.cpp | 0 .../mx/core/elements/DynamicsAttributes.h | 0 .../mx/core/elements/EditorialGroup.cpp | 0 .../private/mx/core/elements/EditorialGroup.h | 0 .../elements/EditorialVoiceDirectionGroup.cpp | 0 .../elements/EditorialVoiceDirectionGroup.h | 0 .../mx/core/elements/EditorialVoiceGroup.cpp | 0 .../mx/core/elements/EditorialVoiceGroup.h | 0 .../private/mx/core/elements/Effect.cpp | 0 .../private/mx/core/elements/Effect.h | 0 .../private/mx/core/elements/Elevation.cpp | 0 .../private/mx/core/elements/Elevation.h | 0 .../private/mx/core/elements/Elision.cpp | 0 .../private/mx/core/elements/Elision.h | 0 .../mx/core/elements/ElisionAttributes.cpp | 0 .../mx/core/elements/ElisionAttributes.h | 0 .../mx/core/elements/ElisionSyllabicGroup.cpp | 0 .../mx/core/elements/ElisionSyllabicGroup.h | 0 .../elements/ElisionSyllabicTextGroup.cpp | 0 .../core/elements/ElisionSyllabicTextGroup.h | 0 .../mx/core/elements/EmptyFontAttributes.cpp | 0 .../mx/core/elements/EmptyFontAttributes.h | 0 .../mx/core/elements/EmptyLineAttributes.cpp | 0 .../mx/core/elements/EmptyLineAttributes.h | 0 .../elements/EmptyPlacementAttributes.cpp | 0 .../core/elements/EmptyPlacementAttributes.h | 0 .../elements/EmptyTrillSoundAttributes.cpp | 0 .../core/elements/EmptyTrillSoundAttributes.h | 0 .../private/mx/core/elements/Encoder.cpp | 0 .../private/mx/core/elements/Encoder.h | 0 .../mx/core/elements/EncoderAttributes.cpp | 0 .../mx/core/elements/EncoderAttributes.h | 0 .../private/mx/core/elements/Encoding.cpp | 0 .../private/mx/core/elements/Encoding.h | 0 .../mx/core/elements/EncodingChoice.cpp | 0 .../private/mx/core/elements/EncodingChoice.h | 0 .../private/mx/core/elements/EncodingDate.cpp | 0 .../private/mx/core/elements/EncodingDate.h | 0 .../mx/core/elements/EncodingDescription.cpp | 0 .../mx/core/elements/EncodingDescription.h | 0 .../private/mx/core/elements/EndLine.cpp | 0 .../private/mx/core/elements/EndLine.h | 0 .../private/mx/core/elements/EndParagraph.cpp | 0 .../private/mx/core/elements/EndParagraph.h | 0 .../private/mx/core/elements/Ending.cpp | 0 .../private/mx/core/elements/Ending.h | 0 .../mx/core/elements/EndingAttributes.cpp | 0 .../mx/core/elements/EndingAttributes.h | 0 .../private/mx/core/elements/Ensemble.cpp | 0 .../private/mx/core/elements/Ensemble.h | 0 .../private/mx/core/elements/Extend.cpp | 0 .../private/mx/core/elements/Extend.h | 0 .../mx/core/elements/ExtendAttributes.cpp | 0 .../mx/core/elements/ExtendAttributes.h | 0 .../private/mx/core/elements/Eyeglasses.cpp | 0 .../private/mx/core/elements/Eyeglasses.h | 0 .../private/mx/core/elements/Falloff.cpp | 0 .../private/mx/core/elements/Falloff.h | 0 .../private/mx/core/elements/Feature.cpp | 0 .../private/mx/core/elements/Feature.h | 0 .../mx/core/elements/FeatureAttributes.cpp | 0 .../mx/core/elements/FeatureAttributes.h | 0 .../private/mx/core/elements/Fermata.cpp | 0 .../private/mx/core/elements/Fermata.h | 0 .../mx/core/elements/FermataAttributes.cpp | 0 .../mx/core/elements/FermataAttributes.h | 0 .../private/mx/core/elements/Fifths.cpp | 0 .../private/mx/core/elements/Fifths.h | 0 .../private/mx/core/elements/Figure.cpp | 0 .../private/mx/core/elements/Figure.h | 0 .../private/mx/core/elements/FigureNumber.cpp | 0 .../private/mx/core/elements/FigureNumber.h | 0 .../core/elements/FigureNumberAttributes.cpp | 0 .../mx/core/elements/FigureNumberAttributes.h | 0 .../private/mx/core/elements/FiguredBass.cpp | 0 .../private/mx/core/elements/FiguredBass.h | 0 .../core/elements/FiguredBassAttributes.cpp | 0 .../mx/core/elements/FiguredBassAttributes.h | 0 .../private/mx/core/elements/Fingering.cpp | 0 .../private/mx/core/elements/Fingering.h | 0 .../mx/core/elements/FingeringAttributes.cpp | 0 .../mx/core/elements/FingeringAttributes.h | 0 .../private/mx/core/elements/Fingernails.cpp | 0 .../private/mx/core/elements/Fingernails.h | 0 .../private/mx/core/elements/FirstFret.cpp | 0 .../private/mx/core/elements/FirstFret.h | 0 .../mx/core/elements/FirstFretAttributes.cpp | 0 .../mx/core/elements/FirstFretAttributes.h | 0 .../private/mx/core/elements/Footnote.cpp | 0 .../private/mx/core/elements/Footnote.h | 0 .../mx/core/elements/FootnoteAttributes.cpp | 0 .../mx/core/elements/FootnoteAttributes.h | 0 .../private/mx/core/elements/Forward.cpp | 0 .../private/mx/core/elements/Forward.h | 0 .../private/mx/core/elements/Frame.cpp | 0 .../private/mx/core/elements/Frame.h | 0 .../mx/core/elements/FrameAttributes.cpp | 0 .../mx/core/elements/FrameAttributes.h | 0 .../private/mx/core/elements/FrameFrets.cpp | 0 .../private/mx/core/elements/FrameFrets.h | 0 .../private/mx/core/elements/FrameNote.cpp | 0 .../private/mx/core/elements/FrameNote.h | 0 .../private/mx/core/elements/FrameStrings.cpp | 0 .../private/mx/core/elements/FrameStrings.h | 0 .../private/mx/core/elements/Fret.cpp | 0 .../private/mx/core/elements/Fret.h | 0 .../mx/core/elements/FretAttributes.cpp | 0 .../private/mx/core/elements/FretAttributes.h | 0 .../mx/core/elements/FullNoteGroup.cpp | 0 .../private/mx/core/elements/FullNoteGroup.h | 0 .../mx/core/elements/FullNoteTypeChoice.cpp | 0 .../mx/core/elements/FullNoteTypeChoice.h | 0 .../private/mx/core/elements/Function.cpp | 0 .../private/mx/core/elements/Function.h | 0 .../mx/core/elements/FunctionAttributes.cpp | 0 .../mx/core/elements/FunctionAttributes.h | 0 .../private/mx/core/elements/Glass.cpp | 0 .../private/mx/core/elements/Glass.h | 0 .../private/mx/core/elements/Glissando.cpp | 0 .../private/mx/core/elements/Glissando.h | 0 .../mx/core/elements/GlissandoAttributes.cpp | 0 .../mx/core/elements/GlissandoAttributes.h | 0 .../private/mx/core/elements/Grace.cpp | 0 .../private/mx/core/elements/Grace.h | 0 .../mx/core/elements/GraceAttributes.cpp | 0 .../mx/core/elements/GraceAttributes.h | 0 .../mx/core/elements/GraceNoteGroup.cpp | 0 .../private/mx/core/elements/GraceNoteGroup.h | 0 .../private/mx/core/elements/Group.cpp | 0 .../private/mx/core/elements/Group.h | 0 .../mx/core/elements/GroupAbbreviation.cpp | 0 .../mx/core/elements/GroupAbbreviation.h | 0 .../elements/GroupAbbreviationAttributes.cpp | 0 .../elements/GroupAbbreviationAttributes.h | 0 .../elements/GroupAbbreviationDisplay.cpp | 0 .../core/elements/GroupAbbreviationDisplay.h | 0 .../GroupAbbreviationDisplayAttributes.cpp | 0 .../GroupAbbreviationDisplayAttributes.h | 0 .../private/mx/core/elements/GroupBarline.cpp | 0 .../private/mx/core/elements/GroupBarline.h | 0 .../core/elements/GroupBarlineAttributes.cpp | 0 .../mx/core/elements/GroupBarlineAttributes.h | 0 .../private/mx/core/elements/GroupName.cpp | 0 .../private/mx/core/elements/GroupName.h | 0 .../mx/core/elements/GroupNameAttributes.cpp | 0 .../mx/core/elements/GroupNameAttributes.h | 0 .../mx/core/elements/GroupNameDisplay.cpp | 0 .../mx/core/elements/GroupNameDisplay.h | 0 .../elements/GroupNameDisplayAttributes.cpp | 0 .../elements/GroupNameDisplayAttributes.h | 0 .../private/mx/core/elements/GroupSymbol.cpp | 0 .../private/mx/core/elements/GroupSymbol.h | 0 .../core/elements/GroupSymbolAttributes.cpp | 0 .../mx/core/elements/GroupSymbolAttributes.h | 0 .../private/mx/core/elements/GroupTime.cpp | 0 .../private/mx/core/elements/GroupTime.h | 0 .../private/mx/core/elements/Grouping.cpp | 0 .../private/mx/core/elements/Grouping.h | 0 .../mx/core/elements/GroupingAttributes.cpp | 0 .../mx/core/elements/GroupingAttributes.h | 0 .../private/mx/core/elements/HammerOn.cpp | 0 .../private/mx/core/elements/HammerOn.h | 0 .../mx/core/elements/HammerOnAttributes.cpp | 0 .../mx/core/elements/HammerOnAttributes.h | 0 .../private/mx/core/elements/Handbell.cpp | 0 .../private/mx/core/elements/Handbell.h | 0 .../mx/core/elements/HandbellAttributes.cpp | 0 .../mx/core/elements/HandbellAttributes.h | 0 .../private/mx/core/elements/Harmonic.cpp | 0 .../private/mx/core/elements/Harmonic.h | 0 .../mx/core/elements/HarmonicAttributes.cpp | 0 .../mx/core/elements/HarmonicAttributes.h | 0 .../mx/core/elements/HarmonicInfoChoice.cpp | 0 .../mx/core/elements/HarmonicInfoChoice.h | 0 .../mx/core/elements/HarmonicTypeChoice.cpp | 0 .../mx/core/elements/HarmonicTypeChoice.h | 0 .../private/mx/core/elements/Harmony.cpp | 0 .../private/mx/core/elements/Harmony.h | 0 .../mx/core/elements/HarmonyAttributes.cpp | 0 .../mx/core/elements/HarmonyAttributes.h | 0 .../mx/core/elements/HarmonyChordGroup.cpp | 0 .../mx/core/elements/HarmonyChordGroup.h | 0 .../private/mx/core/elements/HarpPedals.cpp | 0 .../private/mx/core/elements/HarpPedals.h | 0 .../mx/core/elements/HarpPedalsAttributes.cpp | 0 .../mx/core/elements/HarpPedalsAttributes.h | 0 .../private/mx/core/elements/Heel.cpp | 0 .../private/mx/core/elements/Heel.h | 0 .../mx/core/elements/HeelAttributes.cpp | 0 .../private/mx/core/elements/HeelAttributes.h | 0 .../private/mx/core/elements/Hole.cpp | 0 .../private/mx/core/elements/Hole.h | 0 .../mx/core/elements/HoleAttributes.cpp | 0 .../private/mx/core/elements/HoleAttributes.h | 0 .../private/mx/core/elements/HoleClosed.cpp | 0 .../private/mx/core/elements/HoleClosed.h | 0 .../mx/core/elements/HoleClosedAttributes.cpp | 0 .../mx/core/elements/HoleClosedAttributes.h | 0 .../private/mx/core/elements/HoleShape.cpp | 0 .../private/mx/core/elements/HoleShape.h | 0 .../private/mx/core/elements/HoleType.cpp | 0 .../private/mx/core/elements/HoleType.h | 0 .../private/mx/core/elements/Humming.cpp | 0 .../private/mx/core/elements/Humming.h | 0 .../mx/core/elements/Identification.cpp | 0 .../private/mx/core/elements/Identification.h | 0 .../private/mx/core/elements/Image.cpp | 0 .../private/mx/core/elements/Image.h | 0 .../mx/core/elements/ImageAttributes.cpp | 0 .../mx/core/elements/ImageAttributes.h | 0 .../private/mx/core/elements/Instrument.cpp | 0 .../private/mx/core/elements/Instrument.h | 0 .../core/elements/InstrumentAbbreviation.cpp | 0 .../mx/core/elements/InstrumentAbbreviation.h | 0 .../mx/core/elements/InstrumentAttributes.cpp | 0 .../mx/core/elements/InstrumentAttributes.h | 0 .../mx/core/elements/InstrumentName.cpp | 0 .../private/mx/core/elements/InstrumentName.h | 0 .../mx/core/elements/InstrumentSound.cpp | 0 .../mx/core/elements/InstrumentSound.h | 0 .../private/mx/core/elements/Instruments.cpp | 0 .../private/mx/core/elements/Instruments.h | 0 .../mx/core/elements/Interchangeable.cpp | 0 .../mx/core/elements/Interchangeable.h | 0 .../elements/InterchangeableAttributes.cpp | 0 .../core/elements/InterchangeableAttributes.h | 0 .../private/mx/core/elements/Inversion.cpp | 0 .../private/mx/core/elements/Inversion.h | 0 .../mx/core/elements/InversionAttributes.cpp | 0 .../mx/core/elements/InversionAttributes.h | 0 .../mx/core/elements/InvertedMordent.cpp | 0 .../mx/core/elements/InvertedMordent.h | 0 .../elements/InvertedMordentAttributes.cpp | 0 .../core/elements/InvertedMordentAttributes.h | 0 .../private/mx/core/elements/InvertedTurn.cpp | 0 .../private/mx/core/elements/InvertedTurn.h | 0 .../core/elements/InvertedTurnAttributes.cpp | 0 .../mx/core/elements/InvertedTurnAttributes.h | 0 .../private/mx/core/elements/Ipa.cpp | 0 .../private/mx/core/elements/Ipa.h | 0 .../private/mx/core/elements/Key.cpp | 0 .../private/mx/core/elements/Key.h | 0 .../mx/core/elements/KeyAccidental.cpp | 0 .../private/mx/core/elements/KeyAccidental.h | 0 .../private/mx/core/elements/KeyAlter.cpp | 0 .../private/mx/core/elements/KeyAlter.h | 0 .../mx/core/elements/KeyAttributes.cpp | 0 .../private/mx/core/elements/KeyAttributes.h | 0 .../private/mx/core/elements/KeyChoice.cpp | 0 .../private/mx/core/elements/KeyChoice.h | 0 .../private/mx/core/elements/KeyOctave.cpp | 0 .../private/mx/core/elements/KeyOctave.h | 0 .../mx/core/elements/KeyOctaveAttributes.cpp | 0 .../mx/core/elements/KeyOctaveAttributes.h | 0 .../private/mx/core/elements/KeyStep.cpp | 0 .../private/mx/core/elements/KeyStep.h | 0 .../private/mx/core/elements/Kind.cpp | 0 .../private/mx/core/elements/Kind.h | 0 .../mx/core/elements/KindAttributes.cpp | 0 .../private/mx/core/elements/KindAttributes.h | 0 .../private/mx/core/elements/Laughing.cpp | 0 .../private/mx/core/elements/Laughing.h | 0 .../private/mx/core/elements/LayoutGroup.cpp | 0 .../private/mx/core/elements/LayoutGroup.h | 0 .../private/mx/core/elements/LeftDivider.cpp | 0 .../private/mx/core/elements/LeftDivider.h | 0 .../private/mx/core/elements/LeftMargin.cpp | 0 .../private/mx/core/elements/LeftMargin.h | 0 .../private/mx/core/elements/Level.cpp | 0 .../private/mx/core/elements/Level.h | 0 .../mx/core/elements/LevelAttributes.cpp | 0 .../mx/core/elements/LevelAttributes.h | 0 .../private/mx/core/elements/Line.cpp | 0 .../private/mx/core/elements/Line.h | 0 .../private/mx/core/elements/LineWidth.cpp | 0 .../private/mx/core/elements/LineWidth.h | 0 .../mx/core/elements/LineWidthAttributes.cpp | 0 .../mx/core/elements/LineWidthAttributes.h | 0 .../private/mx/core/elements/Link.cpp | 0 .../private/mx/core/elements/Link.h | 0 .../mx/core/elements/LinkAttributes.cpp | 0 .../private/mx/core/elements/LinkAttributes.h | 0 .../private/mx/core/elements/Lyric.cpp | 0 .../private/mx/core/elements/Lyric.h | 0 .../mx/core/elements/LyricAttributes.cpp | 0 .../mx/core/elements/LyricAttributes.h | 0 .../private/mx/core/elements/LyricFont.cpp | 0 .../private/mx/core/elements/LyricFont.h | 0 .../mx/core/elements/LyricFontAttributes.cpp | 0 .../mx/core/elements/LyricFontAttributes.h | 0 .../mx/core/elements/LyricLanguage.cpp | 0 .../private/mx/core/elements/LyricLanguage.h | 0 .../core/elements/LyricLanguageAttributes.cpp | 0 .../core/elements/LyricLanguageAttributes.h | 0 .../mx/core/elements/LyricTextChoice.cpp | 0 .../mx/core/elements/LyricTextChoice.h | 0 .../mx/core/elements/MeasureAttributes.cpp | 0 .../mx/core/elements/MeasureAttributes.h | 0 .../mx/core/elements/MeasureDistance.cpp | 0 .../mx/core/elements/MeasureDistance.h | 0 .../mx/core/elements/MeasureLayout.cpp | 0 .../private/mx/core/elements/MeasureLayout.h | 0 .../mx/core/elements/MeasureNumbering.cpp | 0 .../mx/core/elements/MeasureNumbering.h | 0 .../elements/MeasureNumberingAttributes.cpp | 0 .../elements/MeasureNumberingAttributes.h | 0 .../mx/core/elements/MeasureRepeat.cpp | 0 .../private/mx/core/elements/MeasureRepeat.h | 0 .../core/elements/MeasureRepeatAttributes.cpp | 0 .../core/elements/MeasureRepeatAttributes.h | 0 .../private/mx/core/elements/MeasureStyle.cpp | 0 .../private/mx/core/elements/MeasureStyle.h | 0 .../core/elements/MeasureStyleAttributes.cpp | 0 .../mx/core/elements/MeasureStyleAttributes.h | 0 .../mx/core/elements/MeasureStyleChoice.cpp | 0 .../mx/core/elements/MeasureStyleChoice.h | 0 .../private/mx/core/elements/Membrane.cpp | 0 .../private/mx/core/elements/Membrane.h | 0 .../private/mx/core/elements/Metal.cpp | 0 .../private/mx/core/elements/Metal.h | 0 .../private/mx/core/elements/Metronome.cpp | 0 .../private/mx/core/elements/Metronome.h | 0 .../mx/core/elements/MetronomeAttributes.cpp | 0 .../mx/core/elements/MetronomeAttributes.h | 0 .../mx/core/elements/MetronomeBeam.cpp | 0 .../private/mx/core/elements/MetronomeBeam.h | 0 .../core/elements/MetronomeBeamAttributes.cpp | 0 .../core/elements/MetronomeBeamAttributes.h | 0 .../private/mx/core/elements/MetronomeDot.cpp | 0 .../private/mx/core/elements/MetronomeDot.h | 0 .../mx/core/elements/MetronomeNote.cpp | 0 .../private/mx/core/elements/MetronomeNote.h | 0 .../mx/core/elements/MetronomeRelation.cpp | 0 .../mx/core/elements/MetronomeRelation.h | 0 .../core/elements/MetronomeRelationGroup.cpp | 0 .../mx/core/elements/MetronomeRelationGroup.h | 0 .../mx/core/elements/MetronomeTuplet.cpp | 0 .../mx/core/elements/MetronomeTuplet.h | 0 .../elements/MetronomeTupletAttributes.cpp | 0 .../core/elements/MetronomeTupletAttributes.h | 0 .../mx/core/elements/MetronomeType.cpp | 0 .../private/mx/core/elements/MetronomeType.h | 0 .../private/mx/core/elements/MidiBank.cpp | 0 .../private/mx/core/elements/MidiBank.h | 0 .../private/mx/core/elements/MidiChannel.cpp | 0 .../private/mx/core/elements/MidiChannel.h | 0 .../private/mx/core/elements/MidiDevice.cpp | 0 .../private/mx/core/elements/MidiDevice.h | 0 .../mx/core/elements/MidiDeviceAttributes.cpp | 0 .../mx/core/elements/MidiDeviceAttributes.h | 0 .../elements/MidiDeviceInstrumentGroup.cpp | 0 .../core/elements/MidiDeviceInstrumentGroup.h | 0 .../mx/core/elements/MidiInstrument.cpp | 0 .../private/mx/core/elements/MidiInstrument.h | 0 .../elements/MidiInstrumentAttributes.cpp | 0 .../core/elements/MidiInstrumentAttributes.h | 0 .../private/mx/core/elements/MidiName.cpp | 0 .../private/mx/core/elements/MidiName.h | 0 .../private/mx/core/elements/MidiProgram.cpp | 0 .../private/mx/core/elements/MidiProgram.h | 0 .../mx/core/elements/MidiUnpitched.cpp | 0 .../private/mx/core/elements/MidiUnpitched.h | 0 .../private/mx/core/elements/Millimeters.cpp | 0 .../private/mx/core/elements/Millimeters.h | 0 .../mx/core/elements/Miscellaneous.cpp | 0 .../private/mx/core/elements/Miscellaneous.h | 0 .../mx/core/elements/MiscellaneousField.cpp | 0 .../mx/core/elements/MiscellaneousField.h | 0 .../elements/MiscellaneousFieldAttributes.cpp | 0 .../elements/MiscellaneousFieldAttributes.h | 0 .../private/mx/core/elements/Mode.cpp | 0 .../private/mx/core/elements/Mode.h | 0 .../private/mx/core/elements/Mordent.cpp | 0 .../private/mx/core/elements/Mordent.h | 0 .../mx/core/elements/MordentAttributes.cpp | 0 .../mx/core/elements/MordentAttributes.h | 0 .../mx/core/elements/MovementNumber.cpp | 0 .../private/mx/core/elements/MovementNumber.h | 0 .../mx/core/elements/MovementTitle.cpp | 0 .../private/mx/core/elements/MovementTitle.h | 0 .../private/mx/core/elements/MultipleRest.cpp | 0 .../private/mx/core/elements/MultipleRest.h | 0 .../core/elements/MultipleRestAttributes.cpp | 0 .../mx/core/elements/MultipleRestAttributes.h | 0 .../mx/core/elements/MusicDataChoice.cpp | 0 .../mx/core/elements/MusicDataChoice.h | 0 .../mx/core/elements/MusicDataGroup.cpp | 0 .../private/mx/core/elements/MusicDataGroup.h | 0 .../private/mx/core/elements/MusicFont.cpp | 0 .../private/mx/core/elements/MusicFont.h | 0 .../private/mx/core/elements/Mute.cpp | 0 .../private/mx/core/elements/Mute.h | 0 .../private/mx/core/elements/Natural.cpp | 0 .../private/mx/core/elements/Natural.h | 0 .../mx/core/elements/NonArpeggiate.cpp | 0 .../private/mx/core/elements/NonArpeggiate.h | 0 .../core/elements/NonArpeggiateAttributes.cpp | 0 .../core/elements/NonArpeggiateAttributes.h | 0 .../mx/core/elements/NonTraditionalKey.cpp | 0 .../mx/core/elements/NonTraditionalKey.h | 0 .../private/mx/core/elements/NormalDot.cpp | 0 .../private/mx/core/elements/NormalDot.h | 0 .../mx/core/elements/NormalNoteGroup.cpp | 0 .../mx/core/elements/NormalNoteGroup.h | 0 .../private/mx/core/elements/NormalNotes.cpp | 0 .../private/mx/core/elements/NormalNotes.h | 0 .../private/mx/core/elements/NormalType.cpp | 0 .../private/mx/core/elements/NormalType.h | 0 .../elements/NormalTypeNormalDotGroup.cpp | 0 .../core/elements/NormalTypeNormalDotGroup.h | 0 .../private/mx/core/elements/Notations.cpp | 0 .../private/mx/core/elements/Notations.h | 0 .../mx/core/elements/NotationsAttributes.cpp | 0 .../mx/core/elements/NotationsAttributes.h | 0 .../mx/core/elements/NotationsChoice.cpp | 0 .../mx/core/elements/NotationsChoice.h | 0 .../private/mx/core/elements/Note.cpp | 0 .../private/mx/core/elements/Note.h | 0 .../mx/core/elements/NoteAttributes.cpp | 0 .../private/mx/core/elements/NoteAttributes.h | 0 .../private/mx/core/elements/NoteChoice.cpp | 0 .../private/mx/core/elements/NoteChoice.h | 0 .../mx/core/elements/NoteRelationNote.cpp | 0 .../mx/core/elements/NoteRelationNote.h | 0 .../private/mx/core/elements/NoteSize.cpp | 0 .../private/mx/core/elements/NoteSize.h | 0 .../mx/core/elements/NoteSizeAttributes.cpp | 0 .../mx/core/elements/NoteSizeAttributes.h | 0 .../private/mx/core/elements/Notehead.cpp | 0 .../private/mx/core/elements/Notehead.h | 0 .../mx/core/elements/NoteheadAttributes.cpp | 0 .../mx/core/elements/NoteheadAttributes.h | 0 .../private/mx/core/elements/NoteheadText.cpp | 0 .../private/mx/core/elements/NoteheadText.h | 0 .../mx/core/elements/NoteheadTextChoice.cpp | 0 .../mx/core/elements/NoteheadTextChoice.h | 0 .../private/mx/core/elements/Octave.cpp | 0 .../private/mx/core/elements/Octave.h | 0 .../private/mx/core/elements/OctaveChange.cpp | 0 .../private/mx/core/elements/OctaveChange.h | 0 .../private/mx/core/elements/OctaveShift.cpp | 0 .../private/mx/core/elements/OctaveShift.h | 0 .../core/elements/OctaveShiftAttributes.cpp | 0 .../mx/core/elements/OctaveShiftAttributes.h | 0 .../private/mx/core/elements/Offset.cpp | 0 .../private/mx/core/elements/Offset.h | 0 .../mx/core/elements/OffsetAttributes.cpp | 0 .../mx/core/elements/OffsetAttributes.h | 0 .../private/mx/core/elements/OpenString.cpp | 0 .../private/mx/core/elements/OpenString.h | 0 .../private/mx/core/elements/Opus.cpp | 0 .../private/mx/core/elements/Opus.h | 0 .../mx/core/elements/OpusAttributes.cpp | 0 .../private/mx/core/elements/OpusAttributes.h | 0 .../private/mx/core/elements/Ornaments.cpp | 0 .../private/mx/core/elements/Ornaments.h | 0 .../mx/core/elements/OrnamentsChoice.cpp | 0 .../mx/core/elements/OrnamentsChoice.h | 0 .../mx/core/elements/OtherAppearance.cpp | 0 .../mx/core/elements/OtherAppearance.h | 0 .../elements/OtherAppearanceAttributes.cpp | 0 .../core/elements/OtherAppearanceAttributes.h | 0 .../mx/core/elements/OtherArticulation.cpp | 0 .../mx/core/elements/OtherArticulation.h | 0 .../elements/OtherArticulationAttributes.cpp | 0 .../elements/OtherArticulationAttributes.h | 0 .../mx/core/elements/OtherDirection.cpp | 0 .../private/mx/core/elements/OtherDirection.h | 0 .../elements/OtherDirectionAttributes.cpp | 0 .../core/elements/OtherDirectionAttributes.h | 0 .../mx/core/elements/OtherNotation.cpp | 0 .../private/mx/core/elements/OtherNotation.h | 0 .../core/elements/OtherNotationAttributes.cpp | 0 .../core/elements/OtherNotationAttributes.h | 0 .../mx/core/elements/OtherOrnament.cpp | 0 .../private/mx/core/elements/OtherOrnament.h | 0 .../core/elements/OtherOrnamentAttributes.cpp | 0 .../core/elements/OtherOrnamentAttributes.h | 0 .../mx/core/elements/OtherPercussion.cpp | 0 .../mx/core/elements/OtherPercussion.h | 0 .../private/mx/core/elements/OtherPlay.cpp | 0 .../private/mx/core/elements/OtherPlay.h | 0 .../mx/core/elements/OtherPlayAttributes.cpp | 0 .../mx/core/elements/OtherPlayAttributes.h | 0 .../mx/core/elements/OtherTechnical.cpp | 0 .../private/mx/core/elements/OtherTechnical.h | 0 .../elements/OtherTechnicalAttributes.cpp | 0 .../core/elements/OtherTechnicalAttributes.h | 0 .../private/mx/core/elements/PageHeight.cpp | 0 .../private/mx/core/elements/PageHeight.h | 0 .../private/mx/core/elements/PageLayout.cpp | 0 .../private/mx/core/elements/PageLayout.h | 0 .../private/mx/core/elements/PageMargins.cpp | 0 .../private/mx/core/elements/PageMargins.h | 0 .../core/elements/PageMarginsAttributes.cpp | 0 .../mx/core/elements/PageMarginsAttributes.h | 0 .../private/mx/core/elements/PageWidth.cpp | 0 .../private/mx/core/elements/PageWidth.h | 0 .../private/mx/core/elements/Pan.cpp | 0 .../private/mx/core/elements/Pan.h | 0 .../mx/core/elements/PartAbbreviation.cpp | 0 .../mx/core/elements/PartAbbreviation.h | 0 .../elements/PartAbbreviationAttributes.cpp | 0 .../elements/PartAbbreviationAttributes.h | 0 .../core/elements/PartAbbreviationDisplay.cpp | 0 .../core/elements/PartAbbreviationDisplay.h | 0 .../PartAbbreviationDisplayAttributes.cpp | 0 .../PartAbbreviationDisplayAttributes.h | 0 .../mx/core/elements/PartAttributes.cpp | 0 .../private/mx/core/elements/PartAttributes.h | 0 .../private/mx/core/elements/PartGroup.cpp | 0 .../private/mx/core/elements/PartGroup.h | 0 .../mx/core/elements/PartGroupAttributes.cpp | 0 .../mx/core/elements/PartGroupAttributes.h | 0 .../mx/core/elements/PartGroupOrScorePart.cpp | 0 .../mx/core/elements/PartGroupOrScorePart.h | 0 .../private/mx/core/elements/PartList.cpp | 0 .../private/mx/core/elements/PartList.h | 0 .../private/mx/core/elements/PartName.cpp | 0 .../private/mx/core/elements/PartName.h | 0 .../mx/core/elements/PartNameAttributes.cpp | 0 .../mx/core/elements/PartNameAttributes.h | 0 .../mx/core/elements/PartNameDisplay.cpp | 0 .../mx/core/elements/PartNameDisplay.h | 0 .../elements/PartNameDisplayAttributes.cpp | 0 .../core/elements/PartNameDisplayAttributes.h | 0 .../private/mx/core/elements/PartSymbol.cpp | 0 .../private/mx/core/elements/PartSymbol.h | 0 .../mx/core/elements/PartSymbolAttributes.cpp | 0 .../mx/core/elements/PartSymbolAttributes.h | 0 .../mx/core/elements/PartwiseMeasure.cpp | 0 .../mx/core/elements/PartwiseMeasure.h | 0 .../private/mx/core/elements/PartwisePart.cpp | 0 .../private/mx/core/elements/PartwisePart.h | 0 .../private/mx/core/elements/Pedal.cpp | 0 .../private/mx/core/elements/Pedal.h | 0 .../private/mx/core/elements/PedalAlter.cpp | 0 .../private/mx/core/elements/PedalAlter.h | 0 .../mx/core/elements/PedalAttributes.cpp | 0 .../mx/core/elements/PedalAttributes.h | 0 .../private/mx/core/elements/PedalStep.cpp | 0 .../private/mx/core/elements/PedalStep.h | 0 .../private/mx/core/elements/PedalTuning.cpp | 0 .../private/mx/core/elements/PedalTuning.h | 0 .../private/mx/core/elements/PerMinute.cpp | 0 .../private/mx/core/elements/PerMinute.h | 0 .../mx/core/elements/PerMinuteAttributes.cpp | 0 .../mx/core/elements/PerMinuteAttributes.h | 0 .../elements/PerMinuteOrBeatUnitChoice.cpp | 0 .../core/elements/PerMinuteOrBeatUnitChoice.h | 0 .../private/mx/core/elements/Percussion.cpp | 0 .../private/mx/core/elements/Percussion.h | 0 .../mx/core/elements/PercussionAttributes.cpp | 0 .../mx/core/elements/PercussionAttributes.h | 0 .../mx/core/elements/PercussionChoice.cpp | 0 .../mx/core/elements/PercussionChoice.h | 0 .../private/mx/core/elements/Pitch.cpp | 0 .../private/mx/core/elements/Pitch.h | 0 .../private/mx/core/elements/Pitched.cpp | 0 .../private/mx/core/elements/Pitched.h | 0 .../private/mx/core/elements/Play.cpp | 0 .../private/mx/core/elements/Play.h | 0 .../mx/core/elements/PlayAttributes.cpp | 0 .../private/mx/core/elements/PlayAttributes.h | 0 .../private/mx/core/elements/Plop.cpp | 0 .../private/mx/core/elements/Plop.h | 0 .../private/mx/core/elements/Pluck.cpp | 0 .../private/mx/core/elements/Pluck.h | 0 .../mx/core/elements/PluckAttributes.cpp | 0 .../mx/core/elements/PluckAttributes.h | 0 .../private/mx/core/elements/PreBend.cpp | 0 .../private/mx/core/elements/PreBend.h | 0 .../private/mx/core/elements/Prefix.cpp | 0 .../private/mx/core/elements/Prefix.h | 0 .../mx/core/elements/PrefixAttributes.cpp | 0 .../mx/core/elements/PrefixAttributes.h | 0 .../mx/core/elements/PrincipalVoice.cpp | 0 .../private/mx/core/elements/PrincipalVoice.h | 0 .../elements/PrincipalVoiceAttributes.cpp | 0 .../core/elements/PrincipalVoiceAttributes.h | 0 .../private/mx/core/elements/Print.cpp | 0 .../private/mx/core/elements/Print.h | 0 .../mx/core/elements/PrintAttributes.cpp | 0 .../mx/core/elements/PrintAttributes.h | 0 .../private/mx/core/elements/Properties.cpp | 0 .../private/mx/core/elements/Properties.h | 0 .../private/mx/core/elements/PullOff.cpp | 0 .../private/mx/core/elements/PullOff.h | 0 .../mx/core/elements/PullOffAttributes.cpp | 0 .../mx/core/elements/PullOffAttributes.h | 0 .../private/mx/core/elements/Rehearsal.cpp | 0 .../private/mx/core/elements/Rehearsal.h | 0 .../mx/core/elements/RehearsalAttributes.cpp | 0 .../mx/core/elements/RehearsalAttributes.h | 0 .../private/mx/core/elements/Relation.cpp | 0 .../private/mx/core/elements/Relation.h | 0 .../mx/core/elements/RelationAttributes.cpp | 0 .../mx/core/elements/RelationAttributes.h | 0 .../private/mx/core/elements/Release.cpp | 0 .../private/mx/core/elements/Release.h | 0 .../private/mx/core/elements/Repeat.cpp | 0 .../private/mx/core/elements/Repeat.h | 0 .../mx/core/elements/RepeatAttributes.cpp | 0 .../mx/core/elements/RepeatAttributes.h | 0 .../private/mx/core/elements/Rest.cpp | 0 .../private/mx/core/elements/Rest.h | 0 .../mx/core/elements/RestAttributes.cpp | 0 .../private/mx/core/elements/RestAttributes.h | 0 .../private/mx/core/elements/RightDivider.cpp | 0 .../private/mx/core/elements/RightDivider.h | 0 .../private/mx/core/elements/RightMargin.cpp | 0 .../private/mx/core/elements/RightMargin.h | 0 .../private/mx/core/elements/Rights.cpp | 0 .../private/mx/core/elements/Rights.h | 0 .../mx/core/elements/RightsAttributes.cpp | 0 .../mx/core/elements/RightsAttributes.h | 0 .../private/mx/core/elements/Root.cpp | 0 .../private/mx/core/elements/Root.h | 0 .../private/mx/core/elements/RootAlter.cpp | 0 .../private/mx/core/elements/RootAlter.h | 0 .../mx/core/elements/RootAlterAttributes.cpp | 0 .../mx/core/elements/RootAlterAttributes.h | 0 .../private/mx/core/elements/RootStep.cpp | 0 .../private/mx/core/elements/RootStep.h | 0 .../mx/core/elements/RootStepAttributes.cpp | 0 .../mx/core/elements/RootStepAttributes.h | 0 .../private/mx/core/elements/Scaling.cpp | 0 .../private/mx/core/elements/Scaling.h | 0 .../private/mx/core/elements/Schleifer.cpp | 0 .../private/mx/core/elements/Schleifer.h | 0 .../private/mx/core/elements/Scoop.cpp | 0 .../private/mx/core/elements/Scoop.h | 0 .../private/mx/core/elements/Scordatura.cpp | 0 .../private/mx/core/elements/Scordatura.h | 0 .../mx/core/elements/ScoreHeaderGroup.cpp | 0 .../mx/core/elements/ScoreHeaderGroup.h | 0 .../mx/core/elements/ScoreInstrument.cpp | 0 .../mx/core/elements/ScoreInstrument.h | 0 .../elements/ScoreInstrumentAttributes.cpp | 0 .../core/elements/ScoreInstrumentAttributes.h | 0 .../private/mx/core/elements/ScorePart.cpp | 0 .../private/mx/core/elements/ScorePart.h | 0 .../mx/core/elements/ScorePartAttributes.cpp | 0 .../mx/core/elements/ScorePartAttributes.h | 0 .../mx/core/elements/ScorePartwise.cpp | 0 .../private/mx/core/elements/ScorePartwise.h | 0 .../core/elements/ScorePartwiseAttributes.cpp | 0 .../core/elements/ScorePartwiseAttributes.h | 0 .../mx/core/elements/ScoreTimewise.cpp | 0 .../private/mx/core/elements/ScoreTimewise.h | 0 .../core/elements/ScoreTimewiseAttributes.cpp | 0 .../core/elements/ScoreTimewiseAttributes.h | 0 .../private/mx/core/elements/Segno.cpp | 0 .../private/mx/core/elements/Segno.h | 0 .../private/mx/core/elements/SemiPitched.cpp | 0 .../private/mx/core/elements/SemiPitched.h | 0 .../private/mx/core/elements/SenzaMisura.cpp | 0 .../private/mx/core/elements/SenzaMisura.h | 0 .../private/mx/core/elements/Shake.cpp | 0 .../private/mx/core/elements/Shake.h | 0 .../private/mx/core/elements/Sign.cpp | 0 .../private/mx/core/elements/Sign.h | 0 .../private/mx/core/elements/Slash.cpp | 0 .../private/mx/core/elements/Slash.h | 0 .../mx/core/elements/SlashAttributes.cpp | 0 .../mx/core/elements/SlashAttributes.h | 0 .../private/mx/core/elements/SlashDot.cpp | 0 .../private/mx/core/elements/SlashDot.h | 0 .../private/mx/core/elements/SlashType.cpp | 0 .../private/mx/core/elements/SlashType.h | 0 .../private/mx/core/elements/Slide.cpp | 0 .../private/mx/core/elements/Slide.h | 0 .../mx/core/elements/SlideAttributes.cpp | 0 .../mx/core/elements/SlideAttributes.h | 0 .../private/mx/core/elements/Slur.cpp | 0 .../private/mx/core/elements/Slur.h | 0 .../mx/core/elements/SlurAttributes.cpp | 0 .../private/mx/core/elements/SlurAttributes.h | 0 .../mx/core/elements/SnapPizzicato.cpp | 0 .../private/mx/core/elements/SnapPizzicato.h | 0 .../private/mx/core/elements/Software.cpp | 0 .../private/mx/core/elements/Software.h | 0 .../private/mx/core/elements/Solo.cpp | 0 .../private/mx/core/elements/Solo.h | 0 .../mx/core/elements/SoloOrEnsembleChoice.cpp | 0 .../mx/core/elements/SoloOrEnsembleChoice.h | 0 .../private/mx/core/elements/Sound.cpp | 0 .../private/mx/core/elements/Sound.h | 0 .../mx/core/elements/SoundAttributes.cpp | 0 .../mx/core/elements/SoundAttributes.h | 0 .../mx/core/elements/SoundingPitch.cpp | 0 .../private/mx/core/elements/SoundingPitch.h | 0 .../private/mx/core/elements/Source.cpp | 0 .../private/mx/core/elements/Source.h | 0 .../private/mx/core/elements/Spiccato.cpp | 0 .../private/mx/core/elements/Spiccato.h | 0 .../mx/core/elements/Staccatissimo.cpp | 0 .../private/mx/core/elements/Staccatissimo.h | 0 .../private/mx/core/elements/Staccato.cpp | 0 .../private/mx/core/elements/Staccato.h | 0 .../private/mx/core/elements/Staff.cpp | 0 .../private/mx/core/elements/Staff.h | 0 .../private/mx/core/elements/StaffDetails.cpp | 0 .../private/mx/core/elements/StaffDetails.h | 0 .../core/elements/StaffDetailsAttributes.cpp | 0 .../mx/core/elements/StaffDetailsAttributes.h | 0 .../mx/core/elements/StaffDistance.cpp | 0 .../private/mx/core/elements/StaffDistance.h | 0 .../private/mx/core/elements/StaffLayout.cpp | 0 .../private/mx/core/elements/StaffLayout.h | 0 .../core/elements/StaffLayoutAttributes.cpp | 0 .../mx/core/elements/StaffLayoutAttributes.h | 0 .../private/mx/core/elements/StaffLines.cpp | 0 .../private/mx/core/elements/StaffLines.h | 0 .../private/mx/core/elements/StaffSize.cpp | 0 .../private/mx/core/elements/StaffSize.h | 0 .../private/mx/core/elements/StaffTuning.cpp | 0 .../private/mx/core/elements/StaffTuning.h | 0 .../core/elements/StaffTuningAttributes.cpp | 0 .../mx/core/elements/StaffTuningAttributes.h | 0 .../private/mx/core/elements/StaffType.cpp | 0 .../private/mx/core/elements/StaffType.h | 0 .../private/mx/core/elements/Staves.cpp | 0 .../private/mx/core/elements/Staves.h | 0 .../private/mx/core/elements/Stem.cpp | 0 .../private/mx/core/elements/Stem.h | 0 .../mx/core/elements/StemAttributes.cpp | 0 .../private/mx/core/elements/StemAttributes.h | 0 .../private/mx/core/elements/Step.cpp | 0 .../private/mx/core/elements/Step.h | 0 .../private/mx/core/elements/Stick.cpp | 0 .../private/mx/core/elements/Stick.h | 0 .../mx/core/elements/StickAttributes.cpp | 0 .../mx/core/elements/StickAttributes.h | 0 .../mx/core/elements/StickLocation.cpp | 0 .../private/mx/core/elements/StickLocation.h | 0 .../mx/core/elements/StickMaterial.cpp | 0 .../private/mx/core/elements/StickMaterial.h | 0 .../private/mx/core/elements/StickType.cpp | 0 .../private/mx/core/elements/StickType.h | 0 .../private/mx/core/elements/Stopped.cpp | 0 .../private/mx/core/elements/Stopped.h | 0 .../private/mx/core/elements/Stress.cpp | 0 .../private/mx/core/elements/Stress.h | 0 .../private/mx/core/elements/String.cpp | 0 .../private/mx/core/elements/String.h | 0 .../mx/core/elements/StringAttributes.cpp | 0 .../mx/core/elements/StringAttributes.h | 0 .../private/mx/core/elements/StringMute.cpp | 0 .../private/mx/core/elements/StringMute.h | 0 .../mx/core/elements/StringMuteAttributes.cpp | 0 .../mx/core/elements/StringMuteAttributes.h | 0 .../private/mx/core/elements/StrongAccent.cpp | 0 .../private/mx/core/elements/StrongAccent.h | 0 .../core/elements/StrongAccentAttributes.cpp | 0 .../mx/core/elements/StrongAccentAttributes.h | 0 .../private/mx/core/elements/Suffix.cpp | 0 .../private/mx/core/elements/Suffix.h | 0 .../mx/core/elements/SuffixAttributes.cpp | 0 .../mx/core/elements/SuffixAttributes.h | 0 .../private/mx/core/elements/Supports.cpp | 0 .../private/mx/core/elements/Supports.h | 0 .../mx/core/elements/SupportsAttributes.cpp | 0 .../mx/core/elements/SupportsAttributes.h | 0 .../private/mx/core/elements/Syllabic.cpp | 0 .../private/mx/core/elements/Syllabic.h | 0 .../mx/core/elements/SyllabicTextGroup.cpp | 0 .../mx/core/elements/SyllabicTextGroup.h | 0 .../mx/core/elements/SystemDistance.cpp | 0 .../private/mx/core/elements/SystemDistance.h | 0 .../mx/core/elements/SystemDividers.cpp | 0 .../private/mx/core/elements/SystemDividers.h | 0 .../private/mx/core/elements/SystemLayout.cpp | 0 .../private/mx/core/elements/SystemLayout.h | 0 .../mx/core/elements/SystemMargins.cpp | 0 .../private/mx/core/elements/SystemMargins.h | 0 .../private/mx/core/elements/Tap.cpp | 0 .../private/mx/core/elements/Tap.h | 0 .../mx/core/elements/TapAttributes.cpp | 0 .../private/mx/core/elements/TapAttributes.h | 0 .../private/mx/core/elements/Technical.cpp | 0 .../private/mx/core/elements/Technical.h | 0 .../mx/core/elements/TechnicalChoice.cpp | 0 .../mx/core/elements/TechnicalChoice.h | 0 .../private/mx/core/elements/Tenths.cpp | 0 .../private/mx/core/elements/Tenths.h | 0 .../private/mx/core/elements/Tenuto.cpp | 0 .../private/mx/core/elements/Tenuto.h | 0 .../private/mx/core/elements/Text.cpp | 0 .../private/mx/core/elements/Text.h | 0 .../mx/core/elements/TextAttributes.cpp | 0 .../private/mx/core/elements/TextAttributes.h | 0 .../mx/core/elements/ThumbPosition.cpp | 0 .../private/mx/core/elements/ThumbPosition.h | 0 .../private/mx/core/elements/Tie.cpp | 0 .../private/mx/core/elements/Tie.h | 0 .../mx/core/elements/TieAttributes.cpp | 0 .../private/mx/core/elements/TieAttributes.h | 0 .../private/mx/core/elements/Tied.cpp | 0 .../private/mx/core/elements/Tied.h | 0 .../mx/core/elements/TiedAttributes.cpp | 0 .../private/mx/core/elements/TiedAttributes.h | 0 .../private/mx/core/elements/Time.cpp | 0 .../private/mx/core/elements/Time.h | 0 .../mx/core/elements/TimeAttributes.cpp | 0 .../private/mx/core/elements/TimeAttributes.h | 0 .../private/mx/core/elements/TimeChoice.cpp | 0 .../private/mx/core/elements/TimeChoice.h | 0 .../mx/core/elements/TimeModification.cpp | 0 .../mx/core/elements/TimeModification.h | 0 .../TimeModificationNormalTypeNormalDot.cpp | 0 .../TimeModificationNormalTypeNormalDot.h | 0 .../private/mx/core/elements/TimeRelation.cpp | 0 .../private/mx/core/elements/TimeRelation.h | 0 .../mx/core/elements/TimeSignatureGroup.cpp | 0 .../mx/core/elements/TimeSignatureGroup.h | 0 .../mx/core/elements/TimewiseMeasure.cpp | 0 .../mx/core/elements/TimewiseMeasure.h | 0 .../private/mx/core/elements/TimewisePart.cpp | 0 .../private/mx/core/elements/TimewisePart.h | 0 .../private/mx/core/elements/Timpani.cpp | 0 .../private/mx/core/elements/Timpani.h | 0 .../private/mx/core/elements/Toe.cpp | 0 .../private/mx/core/elements/Toe.h | 0 .../mx/core/elements/ToeAttributes.cpp | 0 .../private/mx/core/elements/ToeAttributes.h | 0 .../private/mx/core/elements/TopMargin.cpp | 0 .../private/mx/core/elements/TopMargin.h | 0 .../mx/core/elements/TopSystemDistance.cpp | 0 .../mx/core/elements/TopSystemDistance.h | 0 .../mx/core/elements/TouchingPitch.cpp | 0 .../private/mx/core/elements/TouchingPitch.h | 0 .../mx/core/elements/TraditionalKey.cpp | 0 .../private/mx/core/elements/TraditionalKey.h | 0 .../private/mx/core/elements/Transpose.cpp | 0 .../private/mx/core/elements/Transpose.h | 0 .../mx/core/elements/TransposeAttributes.cpp | 0 .../mx/core/elements/TransposeAttributes.h | 0 .../private/mx/core/elements/Tremolo.cpp | 0 .../private/mx/core/elements/Tremolo.h | 0 .../mx/core/elements/TremoloAttributes.cpp | 0 .../mx/core/elements/TremoloAttributes.h | 0 .../private/mx/core/elements/TrillMark.cpp | 0 .../private/mx/core/elements/TrillMark.h | 0 .../private/mx/core/elements/TripleTongue.cpp | 0 .../private/mx/core/elements/TripleTongue.h | 0 .../private/mx/core/elements/TuningAlter.cpp | 0 .../private/mx/core/elements/TuningAlter.h | 0 .../private/mx/core/elements/TuningOctave.cpp | 0 .../private/mx/core/elements/TuningOctave.h | 0 .../private/mx/core/elements/TuningStep.cpp | 0 .../private/mx/core/elements/TuningStep.h | 0 .../private/mx/core/elements/Tuplet.cpp | 0 .../private/mx/core/elements/Tuplet.h | 0 .../private/mx/core/elements/TupletActual.cpp | 0 .../private/mx/core/elements/TupletActual.h | 0 .../mx/core/elements/TupletAttributes.cpp | 0 .../mx/core/elements/TupletAttributes.h | 0 .../private/mx/core/elements/TupletDot.cpp | 0 .../private/mx/core/elements/TupletDot.h | 0 .../mx/core/elements/TupletDotAttributes.cpp | 0 .../mx/core/elements/TupletDotAttributes.h | 0 .../private/mx/core/elements/TupletNormal.cpp | 0 .../private/mx/core/elements/TupletNormal.h | 0 .../private/mx/core/elements/TupletNumber.cpp | 0 .../private/mx/core/elements/TupletNumber.h | 0 .../core/elements/TupletNumberAttributes.cpp | 0 .../mx/core/elements/TupletNumberAttributes.h | 0 .../private/mx/core/elements/TupletReader.h | 0 .../private/mx/core/elements/TupletType.cpp | 0 .../private/mx/core/elements/TupletType.h | 0 .../mx/core/elements/TupletTypeAttributes.cpp | 0 .../mx/core/elements/TupletTypeAttributes.h | 0 .../private/mx/core/elements/Turn.cpp | 0 .../private/mx/core/elements/Turn.h | 0 .../mx/core/elements/TurnAttributes.cpp | 0 .../private/mx/core/elements/TurnAttributes.h | 0 .../private/mx/core/elements/Type.cpp | 0 .../private/mx/core/elements/Type.h | 0 .../mx/core/elements/TypeAttributes.cpp | 0 .../private/mx/core/elements/TypeAttributes.h | 0 .../private/mx/core/elements/Unpitched.cpp | 0 .../private/mx/core/elements/Unpitched.h | 0 .../private/mx/core/elements/Unstress.cpp | 0 .../private/mx/core/elements/Unstress.h | 0 .../private/mx/core/elements/UpBow.cpp | 0 .../private/mx/core/elements/UpBow.h | 0 .../private/mx/core/elements/VerticalTurn.cpp | 0 .../private/mx/core/elements/VerticalTurn.h | 0 .../mx/core/elements/VirtualInstrument.cpp | 0 .../mx/core/elements/VirtualInstrument.h | 0 .../mx/core/elements/VirtualLibrary.cpp | 0 .../private/mx/core/elements/VirtualLibrary.h | 0 .../private/mx/core/elements/VirtualName.cpp | 0 .../private/mx/core/elements/VirtualName.h | 0 .../private/mx/core/elements/Voice.cpp | 0 .../private/mx/core/elements/Voice.h | 0 .../private/mx/core/elements/Volume.cpp | 0 .../private/mx/core/elements/Volume.h | 0 .../private/mx/core/elements/WavyLine.cpp | 0 .../private/mx/core/elements/WavyLine.h | 0 .../mx/core/elements/WavyLineAttributes.cpp | 0 .../mx/core/elements/WavyLineAttributes.h | 0 .../private/mx/core/elements/Wedge.cpp | 0 .../private/mx/core/elements/Wedge.h | 0 .../mx/core/elements/WedgeAttributes.cpp | 0 .../mx/core/elements/WedgeAttributes.h | 0 .../private/mx/core/elements/WithBar.cpp | 0 .../private/mx/core/elements/WithBar.h | 0 .../mx/core/elements/WithBarAttributes.cpp | 0 .../mx/core/elements/WithBarAttributes.h | 0 .../private/mx/core/elements/Wood.cpp | 0 .../private/mx/core/elements/Wood.h | 0 .../private/mx/core/elements/WordFont.cpp | 0 .../private/mx/core/elements/WordFont.h | 0 .../private/mx/core/elements/Words.cpp | 0 .../private/mx/core/elements/Words.h | 0 .../mx/core/elements/WordsAttributes.cpp | 0 .../mx/core/elements/WordsAttributes.h | 0 .../private/mx/core/elements/Work.cpp | 0 .../private/mx/core/elements/Work.h | 0 .../private/mx/core/elements/WorkNumber.cpp | 0 .../private/mx/core/elements/WorkNumber.h | 0 .../private/mx/core/elements/WorkTitle.cpp | 0 .../private/mx/core/elements/WorkTitle.h | 0 .../private/mx/examples/Hide.cpp | 0 .../private/mx/examples/Read.cpp | 0 .../private/mx/examples/Write.cpp | 0 .../private/mx/ezxml/.gitattributes | 0 .../private/mx/ezxml/license.txt | 0 .../mx/ezxml/other/ezxml.sublime-project | 0 .../ezxml.sublime-workspace.example copy | 0 .../mx/ezxml/src/include/ezxml/XAttribute.h | 0 .../src/include/ezxml/XAttributeIterImpl.h | 0 .../src/include/ezxml/XAttributeIterator.h | 0 .../private/mx/ezxml/src/include/ezxml/XDoc.h | 0 .../mx/ezxml/src/include/ezxml/XDocSpec.h | 0 .../mx/ezxml/src/include/ezxml/XElement.h | 0 .../src/include/ezxml/XElementIterImpl.h | 0 .../src/include/ezxml/XElementIterator.h | 0 .../mx/ezxml/src/include/ezxml/XFactory.h | 0 .../ezxml/src/include/ezxml/XForwardDeclare.h | 0 .../mx/ezxml/src/include/ezxml/ezxml.h | 0 .../mx/ezxml/src/private/private/Parse.h | 0 .../src/private/private/PugiAttribute.cpp | 0 .../ezxml/src/private/private/PugiAttribute.h | 0 .../private/private/PugiAttributeIterImpl.cpp | 0 .../private/private/PugiAttributeIterImpl.h | 0 .../mx/ezxml/src/private/private/PugiDoc.cpp | 0 .../mx/ezxml/src/private/private/PugiDoc.h | 0 .../ezxml/src/private/private/PugiElement.cpp | 0 .../ezxml/src/private/private/PugiElement.h | 0 .../private/private/PugiElementIterImpl.cpp | 0 .../src/private/private/PugiElementIterImpl.h | 0 .../mx/ezxml/src/private/private/Throw.h | 0 .../private/private/XAttributeIterator.cpp | 0 .../src/private/private/XElementIterator.cpp | 0 .../mx/ezxml/src/private/private/XFactory.cpp | 0 .../mx/ezxml/src/private/private/XThrow.h | 0 .../ezxml/src/private/private/pugiconfig.hpp | 0 .../ezxml/src/private/private/pugilicense.txt | 0 .../mx/ezxml/src/private/private/pugixml.cpp | 0 .../mx/ezxml/src/private/private/pugixml.hpp | 0 .../mx/impl/AccidentalMarkFunctions.cpp | 0 .../private/mx/impl/AccidentalMarkFunctions.h | 0 .../private/mx/impl/ArpeggiateFunctions.cpp | 0 .../private/mx/impl/ArpeggiateFunctions.h | 0 .../mx/impl/ArticulationsFunctions.cpp | 0 .../private/mx/impl/ArticulationsFunctions.h | 0 .../private/mx/impl/Converter.cpp | 0 .../private/mx/impl/Converter.h | 0 .../private/mx/impl/Cursor.cpp | 0 {Sourcecode => src}/private/mx/impl/Cursor.h | 0 .../private/mx/impl/CurveFunctions.h | 0 .../private/mx/impl/DirectionReader.cpp | 0 .../private/mx/impl/DirectionReader.h | 0 .../private/mx/impl/DirectionWriter.cpp | 0 .../private/mx/impl/DirectionWriter.h | 0 .../private/mx/impl/DynamicsReader.cpp | 0 .../private/mx/impl/DynamicsReader.h | 0 .../private/mx/impl/DynamicsWriter.cpp | 0 .../private/mx/impl/DynamicsWriter.h | 0 .../private/mx/impl/EncodingFunctions.cpp | 0 .../private/mx/impl/EncodingFunctions.h | 0 .../private/mx/impl/FermataFunctions.cpp | 0 .../private/mx/impl/FermataFunctions.h | 0 .../private/mx/impl/FontFunctions.h | 0 .../private/mx/impl/LayoutFunctions.cpp | 0 .../private/mx/impl/LayoutFunctions.h | 0 .../private/mx/impl/LcmGcd.cpp | 0 {Sourcecode => src}/private/mx/impl/LcmGcd.h | 0 .../private/mx/impl/LineFunctions.h | 0 .../private/mx/impl/LyricType.cpp | 0 .../private/mx/impl/LyricType.h | 0 .../private/mx/impl/MarkDataFunctions.h | 0 .../private/mx/impl/MeasureCursor.h | 0 .../private/mx/impl/MeasureReader.cpp | 0 .../private/mx/impl/MeasureReader.h | 0 .../private/mx/impl/MeasureWriter.cpp | 0 .../private/mx/impl/MeasureWriter.h | 0 .../private/mx/impl/MetronomeReader.cpp | 0 .../private/mx/impl/MetronomeReader.h | 0 .../private/mx/impl/MxVersionDefines.h | 0 .../mx/impl/NonArpeggiateFunctions.cpp | 0 .../private/mx/impl/NonArpeggiateFunctions.h | 0 .../private/mx/impl/NotationsWriter.cpp | 0 .../private/mx/impl/NotationsWriter.h | 0 .../private/mx/impl/NoteFunctions.cpp | 0 .../private/mx/impl/NoteFunctions.h | 0 .../private/mx/impl/NoteReader.cpp | 0 .../private/mx/impl/NoteReader.h | 0 .../private/mx/impl/NoteWriter.cpp | 0 .../private/mx/impl/NoteWriter.h | 0 .../private/mx/impl/OrnamentsFunctions.cpp | 0 .../private/mx/impl/OrnamentsFunctions.h | 0 .../private/mx/impl/PageTextFunctions.cpp | 0 .../private/mx/impl/PageTextFunctions.h | 0 .../private/mx/impl/PartReader.cpp | 0 .../private/mx/impl/PartReader.h | 0 .../private/mx/impl/PartWriter.cpp | 0 .../private/mx/impl/PartWriter.h | 0 .../private/mx/impl/PositionFunctions.h | 0 .../private/mx/impl/PrintFunctions.h | 0 .../private/mx/impl/PropertiesWriter.cpp | 0 .../private/mx/impl/PropertiesWriter.h | 0 .../private/mx/impl/ScoreReader.cpp | 0 .../private/mx/impl/ScoreReader.h | 0 .../private/mx/impl/ScoreWriter.cpp | 0 .../private/mx/impl/ScoreWriter.h | 0 .../private/mx/impl/SlideFunctions.cpp | 0 .../private/mx/impl/SlideFunctions.h | 0 .../private/mx/impl/SpannerFunctions.h | 0 .../private/mx/impl/StaffFunctions.cpp | 0 .../private/mx/impl/StaffFunctions.h | 0 .../private/mx/impl/TechnicalFunctions.cpp | 0 .../private/mx/impl/TechnicalFunctions.h | 0 .../private/mx/impl/TimeReader.cpp | 0 .../private/mx/impl/TimeReader.h | 0 .../private/mx/impl/TupletReader.cpp | 0 .../private/mx/impl/TupletReader.h | 0 {Sourcecode => src}/private/mx/utility/Enum.h | 0 .../private/mx/utility/EnumWithString.h | 0 .../private/mx/utility/JitAllocate.h | 0 {Sourcecode => src}/private/mx/utility/Lock.h | 0 .../private/mx/utility/OptionalMembers.h | 0 .../private/mx/utility/Parse.h | 0 .../private/mx/utility/Round.h | 0 .../private/mx/utility/StringToInt.h | 0 .../private/mx/utility/Throw.h | 0 .../mxtest/api/ApiChordSimpleScoreData.h | 0 .../private/mxtest/api/ApiChordSimpleTest.cpp | 0 .../private/mxtest/api/ApiK007aScoreData.h | 0 .../private/mxtest/api/ApiK007aTest.cpp | 0 .../private/mxtest/api/ApiK007cScoreData.h | 0 .../private/mxtest/api/ApiK007cTest.cpp | 0 .../mxtest/api/ApiK009bSlurScoreData.h | 0 .../private/mxtest/api/ApiK009bSlurTest.cpp | 0 .../mxtest/api/ApiK014aFermatasScoreData.h | 0 .../mxtest/api/ApiK014aFermatasTest.cpp | 0 .../mxtest/api/ApiK015aLayoutScoreData.h | 0 .../private/mxtest/api/ApiK015aLayoutTest.cpp | 0 .../mxtest/api/ApiK016aMiscScoreData.h | 0 .../private/mxtest/api/ApiK016aMiscTest.cpp | 0 .../mxtest/api/ApiLoadSurvivalTest.cpp | 0 .../private/mxtest/api/ApiLy43eScoreData.h | 0 .../private/mxtest/api/ApiLy43eTest.cpp | 0 .../mxtest/api/ApiMuAccidentals1ScoreData.h | 0 .../mxtest/api/ApiMuAccidentals1Test.cpp | 0 .../private/mxtest/api/ApiTester.cpp | 0 .../private/mxtest/api/ApiTester.h | 0 .../private/mxtest/api/BombeTest.cpp | 0 .../private/mxtest/api/ChordApiTest.cpp | 0 .../mxtest/api/ChordDataSaveAndLoadTest.cpp | 0 .../private/mxtest/api/ChordTimeTest.cpp | 0 .../private/mxtest/api/DirectionDataTest.cpp | 0 .../mxtest/api/DocumentManagerTest.cpp | 0 .../private/mxtest/api/FreezingRoundTrip.cpp | 0 .../private/mxtest/api/FreezingTest.cpp | 0 .../private/mxtest/api/KeyDataTest.cpp | 0 .../private/mxtest/api/MeasureDataTest.cpp | 0 .../private/mxtest/api/MetronomeApiTest.cpp | 0 .../private/mxtest/api/MxlTest.cpp | 0 .../private/mxtest/api/NewSystemTest.cpp | 0 .../private/mxtest/api/NoteDataTest.cpp | 0 .../private/mxtest/api/PageDataTest.cpp | 0 .../private/mxtest/api/PitchDataTest.cpp | 0 .../private/mxtest/api/RoundTrip.h | 0 .../private/mxtest/api/ScoreDataCreator.h | 0 .../private/mxtest/api/SlurTest.cpp | 0 .../private/mxtest/api/TestHelpers.h | 0 .../mxtest/api/TimeSignatureApiTest.cpp | 0 .../private/mxtest/api/TranspositionTest.cpp | 0 .../private/mxtest/control/CompileControl.h | 0 .../private/mxtest/core/AccentTest.cpp | 0 .../mxtest/core/AccidentalMarkTest.cpp | 0 .../private/mxtest/core/AccidentalTest.cpp | 0 .../mxtest/core/AccidentalTextTest.cpp | 0 .../private/mxtest/core/AccordTest.cpp | 0 .../private/mxtest/core/AccordTest.h | 0 .../private/mxtest/core/AccordionHighTest.cpp | 0 .../private/mxtest/core/AccordionLowTest.cpp | 0 .../mxtest/core/AccordionMiddleTest.cpp | 0 .../mxtest/core/AccordionRegistrationTest.cpp | 0 .../private/mxtest/core/ActualNotesTest.cpp | 0 .../private/mxtest/core/AlterTest.cpp | 0 .../private/mxtest/core/AppearanceTest.cpp | 0 .../private/mxtest/core/AppearanceTest.h | 0 .../private/mxtest/core/ArpeggiateTest.cpp | 0 .../mxtest/core/ArrowDirectionTest.cpp | 0 .../private/mxtest/core/ArrowStyleTest.cpp | 0 .../private/mxtest/core/ArrowTest.cpp | 0 .../private/mxtest/core/ArrowTest.h | 0 .../private/mxtest/core/ArticulationsTest.cpp | 0 .../private/mxtest/core/ArticulationsTest.h | 0 .../private/mxtest/core/ArtificialTest.cpp | 0 .../private/mxtest/core/BackupTest.cpp | 0 .../private/mxtest/core/BackupTest.h | 0 .../private/mxtest/core/BarStyleTest.cpp | 0 .../private/mxtest/core/BarlineTest.cpp | 0 .../private/mxtest/core/BarlineTest.h | 0 .../private/mxtest/core/BarreTest.cpp | 0 .../private/mxtest/core/BasePitchTest.cpp | 0 .../private/mxtest/core/BassAlterTest.cpp | 0 .../private/mxtest/core/BassStepTest.cpp | 0 .../private/mxtest/core/BassTest.cpp | 0 .../private/mxtest/core/BassTest.h | 0 .../private/mxtest/core/BeamTest.cpp | 0 .../private/mxtest/core/BeatRepeatTest.cpp | 0 .../private/mxtest/core/BeatTypeTest.cpp | 0 .../private/mxtest/core/BeatUnitDotTest.cpp | 0 .../private/mxtest/core/BeatUnitTest.cpp | 0 .../private/mxtest/core/BeaterTest.cpp | 0 .../private/mxtest/core/BeatsTest.cpp | 0 .../private/mxtest/core/BendAlterTest.cpp | 0 .../private/mxtest/core/BendChoiceTest.cpp | 0 .../private/mxtest/core/BendChoiceTest.h | 0 .../private/mxtest/core/BendTest.cpp | 0 .../private/mxtest/core/BendTest.h | 0 .../private/mxtest/core/BookmarkTest.cpp | 0 .../private/mxtest/core/BottomMarginTest.cpp | 0 .../private/mxtest/core/BracketTest.cpp | 0 .../private/mxtest/core/BreathMarkTest.cpp | 0 .../private/mxtest/core/CaesuraTest.cpp | 0 .../private/mxtest/core/CancelTest.cpp | 0 .../private/mxtest/core/CapoTest.cpp | 0 .../private/mxtest/core/ChordTest.cpp | 0 .../private/mxtest/core/ChromaticTest.cpp | 0 .../private/mxtest/core/CircularArrowTest.cpp | 0 .../mxtest/core/ClefOctaveChangeTest.cpp | 0 .../private/mxtest/core/ClefTest.cpp | 0 .../private/mxtest/core/CodaTest.cpp | 0 .../private/mxtest/core/ColorTest.cpp | 0 .../private/mxtest/core/CreatorTest.cpp | 0 .../private/mxtest/core/CreditChoiceTest.cpp | 0 .../private/mxtest/core/CreditChoiceTest.h | 0 .../private/mxtest/core/CreditImageTest.cpp | 0 .../private/mxtest/core/CreditTest.cpp | 0 .../private/mxtest/core/CreditTest.h | 0 .../private/mxtest/core/CreditTypeTest.cpp | 0 .../mxtest/core/CreditWordsGroupTest.cpp | 0 .../mxtest/core/CreditWordsGroupTest.h | 0 .../private/mxtest/core/CreditWordsTest.cpp | 0 .../private/mxtest/core/CueNoteGroupTest.cpp | 0 .../private/mxtest/core/CueNoteGroupTest.h | 0 .../private/mxtest/core/CueTest.cpp | 0 .../private/mxtest/core/DampAllTest.cpp | 0 .../private/mxtest/core/DampTest.cpp | 0 .../private/mxtest/core/DashesTest.cpp | 0 .../private/mxtest/core/DateTest.cpp | 0 .../private/mxtest/core/DecimalsTest.cpp | 0 .../private/mxtest/core/DefaultsTest.cpp | 0 .../private/mxtest/core/DefaultsTest.h | 0 .../private/mxtest/core/DegreeAlterTest.cpp | 0 .../private/mxtest/core/DegreeTest.cpp | 0 .../private/mxtest/core/DegreeTest.h | 0 .../private/mxtest/core/DegreeTypeTest.cpp | 0 .../private/mxtest/core/DegreeValueTest.cpp | 0 .../mxtest/core/DelayedInvertedTurnTest.cpp | 0 .../private/mxtest/core/DelayedTurnTest.cpp | 0 .../mxtest/core/DetachedLegatoTest.cpp | 0 .../private/mxtest/core/DiatonicTest.cpp | 0 .../private/mxtest/core/DirectionTest.cpp | 0 .../private/mxtest/core/DirectionTest.h | 0 .../private/mxtest/core/DirectionTypeTest.cpp | 0 .../private/mxtest/core/DirectionTypeTest.h | 0 .../private/mxtest/core/DirectiveTest.cpp | 0 .../private/mxtest/core/DisplayOctaveTest.cpp | 0 .../core/DisplayStepOctaveGroupTest.cpp | 0 .../mxtest/core/DisplayStepOctaveGroupTest.h | 0 .../private/mxtest/core/DisplayStepTest.cpp | 0 .../private/mxtest/core/DisplayTextTest.cpp | 0 .../private/mxtest/core/DistanceTest.cpp | 0 .../private/mxtest/core/DivisionsTest.cpp | 0 .../mxtest/core/DocumentHeaderTest.cpp | 0 .../private/mxtest/core/DocumentHeaderTest.h | 0 .../core/DocumentPartwiseConvertTest.cpp | 0 .../mxtest/core/DocumentPartwiseCreate.cpp | 0 .../mxtest/core/DocumentPartwiseCreate.h | 0 .../mxtest/core/DocumentPartwiseTest.cpp | 0 .../mxtest/core/DocumentPartwiseTest.h | 0 .../core/DocumentTimewiseConvertTest.cpp | 0 .../mxtest/core/DocumentTimewiseCreate.cpp | 0 .../mxtest/core/DocumentTimewiseCreate.h | 0 .../mxtest/core/DocumentTimewiseTest.cpp | 0 .../mxtest/core/DocumentTimewiseTest.h | 0 .../private/mxtest/core/DoitTest.cpp | 0 .../private/mxtest/core/DotTest.cpp | 0 .../private/mxtest/core/DoubleTest.cpp | 0 .../private/mxtest/core/DoubleTongueTest.cpp | 0 .../private/mxtest/core/DownBowTest.cpp | 0 .../private/mxtest/core/DurationTest.cpp | 0 .../private/mxtest/core/DynamicsTest.cpp | 0 .../mxtest/core/EditorialGroupTest.cpp | 0 .../private/mxtest/core/EditorialGroupTest.h | 0 .../mxtest/core/EditorialVoiceGroupTest.cpp | 0 .../mxtest/core/EditorialVoiceGroupTest.h | 0 .../private/mxtest/core/EffectTest.cpp | 0 .../private/mxtest/core/ElevationTest.cpp | 0 .../mxtest/core/ElisionSyllabicGroupTest.cpp | 0 .../mxtest/core/ElisionSyllabicGroupTest.h | 0 .../core/ElisionSyllabicTextGroupTest.cpp | 0 .../core/ElisionSyllabicTextGroupTest.h | 0 .../private/mxtest/core/ElisionTest.cpp | 0 .../private/mxtest/core/EncoderTest.cpp | 0 .../private/mxtest/core/EncodingDateTest.cpp | 0 .../mxtest/core/EncodingDescriptionTest.cpp | 0 .../private/mxtest/core/EncodingTest.cpp | 0 .../private/mxtest/core/EncodingTest.h | 0 .../private/mxtest/core/EndLineTest.cpp | 0 .../private/mxtest/core/EndParagraphTest.cpp | 0 .../private/mxtest/core/EndingTest.cpp | 0 .../private/mxtest/core/EnsembleTest.cpp | 0 .../private/mxtest/core/EnumsTest.cpp | 0 .../private/mxtest/core/ExtendTest.cpp | 0 .../private/mxtest/core/EyeglassesTest.cpp | 0 .../private/mxtest/core/FalloffTest.cpp | 0 .../private/mxtest/core/FeatureTest.cpp | 0 .../private/mxtest/core/FermataTest.cpp | 0 .../private/mxtest/core/FifthsTest.cpp | 0 .../private/mxtest/core/FigureNumberTest.cpp | 0 .../private/mxtest/core/FigureTest.cpp | 0 .../private/mxtest/core/FigureTest.h | 0 .../private/mxtest/core/FiguredBassTest.cpp | 0 .../private/mxtest/core/FiguredBassTest.h | 0 .../private/mxtest/core/FingeringTest.cpp | 0 .../private/mxtest/core/FingernailsTest.cpp | 0 .../private/mxtest/core/FirstFretTest.cpp | 0 .../private/mxtest/core/FontSizeTest.cpp | 0 .../private/mxtest/core/FootnoteTest.cpp | 0 .../private/mxtest/core/ForwardTest.cpp | 0 .../private/mxtest/core/ForwardTest.h | 0 .../private/mxtest/core/FrameFretsTest.cpp | 0 .../private/mxtest/core/FrameNoteTest.cpp | 0 .../private/mxtest/core/FrameStringsTest.cpp | 0 .../private/mxtest/core/FrameTest.cpp | 0 .../private/mxtest/core/FretTest.cpp | 0 .../private/mxtest/core/FullNoteGroupTest.cpp | 0 .../private/mxtest/core/FullNoteGroupTest.h | 0 .../mxtest/core/FullNoteTypeChoiceTest.cpp | 0 .../mxtest/core/FullNoteTypeChoiceTest.h | 0 .../private/mxtest/core/FunctionTest.cpp | 0 .../private/mxtest/core/GlassTest.cpp | 0 .../private/mxtest/core/GlissandoTest.cpp | 0 .../mxtest/core/GraceNoteGroupTest.cpp | 0 .../private/mxtest/core/GraceNoteGroupTest.h | 0 .../private/mxtest/core/GraceTest.cpp | 0 .../core/GroupAbbreviationDisplayTest.cpp | 0 .../core/GroupAbbreviationDisplayTest.h | 0 .../mxtest/core/GroupAbbreviationTest.cpp | 0 .../private/mxtest/core/GroupBarlineTest.cpp | 0 .../mxtest/core/GroupNameDisplayTest.cpp | 0 .../mxtest/core/GroupNameDisplayTest.h | 0 .../private/mxtest/core/GroupNameTest.cpp | 0 .../private/mxtest/core/GroupSymbolTest.cpp | 0 .../private/mxtest/core/GroupTest.cpp | 0 .../private/mxtest/core/GroupTimeTest.cpp | 0 .../private/mxtest/core/GroupingTest.cpp | 0 .../private/mxtest/core/GroupingTest.h | 0 .../private/mxtest/core/HammerOnTest.cpp | 0 .../private/mxtest/core/HandbellTest.cpp | 0 .../mxtest/core/HarmonicInfoChoiceTest.cpp | 0 .../mxtest/core/HarmonicInfoChoiceTest.h | 0 .../private/mxtest/core/HarmonicTest.cpp | 0 .../private/mxtest/core/HarmonicTest.h | 0 .../mxtest/core/HarmonicTypeChoiceTest.cpp | 0 .../mxtest/core/HarmonicTypeChoiceTest.h | 0 .../mxtest/core/HarmonyChordGroupTest.cpp | 0 .../mxtest/core/HarmonyChordGroupTest.h | 0 .../private/mxtest/core/HarmonyTest.cpp | 0 .../private/mxtest/core/HarmonyTest.h | 0 .../private/mxtest/core/HarpPedalsTest.cpp | 0 .../private/mxtest/core/HeelTest.cpp | 0 .../private/mxtest/core/HeelTest.h | 0 .../private/mxtest/core/HelloWorldExpected.h | 0 .../private/mxtest/core/HelloWorldTest.cpp | 0 .../private/mxtest/core/HelloWorldTest.h | 0 .../private/mxtest/core/HelperFunctions.h | 0 .../private/mxtest/core/HoleClosedTest.cpp | 0 .../private/mxtest/core/HoleShapeTest.cpp | 0 .../private/mxtest/core/HoleTest.cpp | 0 .../private/mxtest/core/HoleTest.h | 0 .../private/mxtest/core/HoleTypeTest.cpp | 0 .../private/mxtest/core/HummingTest.cpp | 0 .../mxtest/core/IdentificationTest.cpp | 0 .../private/mxtest/core/IdentificationTest.h | 0 .../private/mxtest/core/ImageTest.cpp | 0 .../core/InstrumentAbbreviationTest.cpp | 0 .../mxtest/core/InstrumentNameTest.cpp | 0 .../mxtest/core/InstrumentSoundTest.cpp | 0 .../private/mxtest/core/InstrumentTest.cpp | 0 .../private/mxtest/core/InstrumentsTest.cpp | 0 .../private/mxtest/core/IntegersTest.cpp | 0 .../mxtest/core/InterchangeableTest.cpp | 0 .../private/mxtest/core/InversionTest.cpp | 0 .../mxtest/core/InvertedMordentTest.cpp | 0 .../private/mxtest/core/InvertedMordentTest.h | 0 .../private/mxtest/core/InvertedTurnTest.cpp | 0 .../private/mxtest/core/IpaTest.cpp | 0 .../private/mxtest/core/KeyAccidentalTest.cpp | 0 .../private/mxtest/core/KeyAlterTest.cpp | 0 .../private/mxtest/core/KeyOctaveTest.cpp | 0 .../private/mxtest/core/KeyStepTest.cpp | 0 .../private/mxtest/core/KeyTest.cpp | 0 .../private/mxtest/core/KindTest.cpp | 0 .../private/mxtest/core/LaughingTest.cpp | 0 .../private/mxtest/core/LayoutGroupTest.cpp | 0 .../private/mxtest/core/LayoutGroupTest.h | 0 .../private/mxtest/core/LeftDividerTest.cpp | 0 .../private/mxtest/core/LeftMarginTest.cpp | 0 .../private/mxtest/core/LevelTest.cpp | 0 .../private/mxtest/core/LineTest.cpp | 0 .../private/mxtest/core/LineWidthTest.cpp | 0 .../private/mxtest/core/LinkTest.cpp | 0 .../private/mxtest/core/LyricFontTest.cpp | 0 .../private/mxtest/core/LyricLanguageTest.cpp | 0 .../private/mxtest/core/LyricTest.cpp | 0 .../private/mxtest/core/LyricTest.h | 0 .../private/mxtest/core/LyricTextChoiceTest.h | 0 .../mxtest/core/LyricTextCoiceTest.cpp | 0 .../private/mxtest/core/MakeFunctionsTest.cpp | 0 .../mxtest/core/MeasureDistanceTest.cpp | 0 .../private/mxtest/core/MeasureLayoutTest.cpp | 0 .../private/mxtest/core/MeasureLayoutTest.h | 0 .../mxtest/core/MeasureNumberingTest.cpp | 0 .../private/mxtest/core/MeasureRepeatTest.cpp | 0 .../private/mxtest/core/MeasureStyleTest.cpp | 0 .../private/mxtest/core/MembraneTest.cpp | 0 .../private/mxtest/core/MetalTest.cpp | 0 .../private/mxtest/core/MetronomeBeamTest.cpp | 0 .../private/mxtest/core/MetronomeDotTest.cpp | 0 .../private/mxtest/core/MetronomeNoteTest.cpp | 0 .../mxtest/core/MetronomeRelationTest.cpp | 0 .../private/mxtest/core/MetronomeTest.cpp | 0 .../private/mxtest/core/MetronomeTest.h | 0 .../mxtest/core/MetronomeTupletTest.cpp | 0 .../private/mxtest/core/MetronomeTypeTest.cpp | 0 .../private/mxtest/core/MidiBankTest.cpp | 0 .../private/mxtest/core/MidiChannelTest.cpp | 0 .../private/mxtest/core/MidiDeviceTest.cpp | 0 .../mxtest/core/MidiInstrumentTest.cpp | 0 .../private/mxtest/core/MidiInstrumentTest.h | 0 .../private/mxtest/core/MidiNameTest.cpp | 0 .../private/mxtest/core/MidiProgramTest.cpp | 0 .../private/mxtest/core/MidiUnpitchedTest.cpp | 0 .../private/mxtest/core/MillimetersTest.cpp | 0 .../mxtest/core/MiscellaneousFieldTest.cpp | 0 .../private/mxtest/core/MiscellaneousTest.cpp | 0 .../private/mxtest/core/MiscellaneousTest.h | 0 .../private/mxtest/core/ModeTest.cpp | 0 .../private/mxtest/core/MordentTest.cpp | 0 .../private/mxtest/core/MordentTest.h | 0 .../mxtest/core/MovementNumberTest.cpp | 0 .../private/mxtest/core/MovementTitleTest.cpp | 0 .../private/mxtest/core/MultipleRestTest.cpp | 0 .../mxtest/core/MusicDataChoiceTest.cpp | 0 .../private/mxtest/core/MusicDataChoiceTest.h | 0 .../mxtest/core/MusicDataGroupTest.cpp | 0 .../private/mxtest/core/MusicDataGroupTest.h | 0 .../private/mxtest/core/MusicFontTest.cpp | 0 .../private/mxtest/core/MuteTest.cpp | 0 .../private/mxtest/core/NaturalTest.cpp | 0 .../private/mxtest/core/NonArpeggiateTest.cpp | 0 .../private/mxtest/core/NormalDotTest.cpp | 0 .../mxtest/core/NormalNoteGroupTest.cpp | 0 .../private/mxtest/core/NormalNoteGroupTest.h | 0 .../private/mxtest/core/NormalNotesTest.cpp | 0 .../private/mxtest/core/NormalTypeTest.cpp | 0 .../mxtest/core/NotationsChoiceTest.cpp | 0 .../private/mxtest/core/NotationsChoiceTest.h | 0 .../private/mxtest/core/NotationsTest.cpp | 0 .../private/mxtest/core/NotationsTest.h | 0 .../private/mxtest/core/NoteChoiceTest.cpp | 0 .../private/mxtest/core/NoteChoiceTest.h | 0 .../private/mxtest/core/NoteSizeTest.cpp | 0 .../private/mxtest/core/NoteTest.cpp | 0 .../private/mxtest/core/NoteTest.h | 0 .../private/mxtest/core/NoteheadTest.cpp | 0 .../private/mxtest/core/NoteheadTextTest.cpp | 0 .../private/mxtest/core/NoteheadTextTest.h | 0 .../private/mxtest/core/NumberOrNormal.cpp | 0 .../private/mxtest/core/OctaveChangeTest.cpp | 0 .../private/mxtest/core/OctaveShiftTest.cpp | 0 .../private/mxtest/core/OctaveTest.cpp | 0 .../private/mxtest/core/OffsetTest.cpp | 0 .../private/mxtest/core/OpenStringTest.cpp | 0 .../private/mxtest/core/OpusTest.cpp | 0 .../mxtest/core/OrnamentsChoiceTest.cpp | 0 .../private/mxtest/core/OrnamentsChoiceTest.h | 0 .../private/mxtest/core/OrnamentsTest.cpp | 0 .../private/mxtest/core/OrnamentsTest.h | 0 .../mxtest/core/OtherAppearanceTest.cpp | 0 .../mxtest/core/OtherArticulationTest.cpp | 0 .../mxtest/core/OtherDirectionTest.cpp | 0 .../private/mxtest/core/OtherNotationTest.cpp | 0 .../private/mxtest/core/OtherOrnamentTest.cpp | 0 .../mxtest/core/OtherPercussionTest.cpp | 0 .../private/mxtest/core/OtherPlayTest.cpp | 0 .../mxtest/core/OtherTechnicalTest.cpp | 0 .../private/mxtest/core/PageHeightTest.cpp | 0 .../private/mxtest/core/PageLayoutTest.cpp | 0 .../private/mxtest/core/PageLayoutTest.h | 0 .../private/mxtest/core/PageMarginsTest.cpp | 0 .../private/mxtest/core/PageMarginsTest.h | 0 .../private/mxtest/core/PageWidthTest.cpp | 0 .../private/mxtest/core/PanTest.cpp | 0 .../core/PartAbbreviationDisplayTest.cpp | 0 .../mxtest/core/PartAbbreviationDisplayTest.h | 0 .../mxtest/core/PartAbbreviationTest.cpp | 0 .../mxtest/core/PartGroupOrScorePartTest.cpp | 0 .../mxtest/core/PartGroupOrScorePartTest.h | 0 .../private/mxtest/core/PartGroupTest.cpp | 0 .../private/mxtest/core/PartGroupTest.h | 0 .../private/mxtest/core/PartListTest.cpp | 0 .../private/mxtest/core/PartListTest.h | 0 .../mxtest/core/PartNameDisplayTest.cpp | 0 .../private/mxtest/core/PartNameDisplayTest.h | 0 .../private/mxtest/core/PartNameTest.cpp | 0 .../private/mxtest/core/PartSymbolTest.cpp | 0 .../mxtest/core/PartwiseMeasureTest.cpp | 0 .../private/mxtest/core/PartwiseMeasureTest.h | 0 .../private/mxtest/core/PartwisePartTest.cpp | 0 .../private/mxtest/core/PartwisePartTest.h | 0 .../private/mxtest/core/PedalAlterTest.cpp | 0 .../private/mxtest/core/PedalStepTest.cpp | 0 .../private/mxtest/core/PedalTest.cpp | 0 .../private/mxtest/core/PedalTuningTest.cpp | 0 .../private/mxtest/core/PerMinuteTest.cpp | 0 .../private/mxtest/core/PercussionTest.cpp | 0 .../private/mxtest/core/PercussionTest.h | 0 .../private/mxtest/core/PitchTest.cpp | 0 .../private/mxtest/core/PitchTest.h | 0 .../private/mxtest/core/PitchedTest.cpp | 0 .../private/mxtest/core/PlayTest.cpp | 0 .../private/mxtest/core/PlayTest.h | 0 .../private/mxtest/core/PlopTest.cpp | 0 .../private/mxtest/core/PluckTest.cpp | 0 .../core/PositiveIntegerOrEmptyTest.cpp | 0 .../private/mxtest/core/PreBendTest.cpp | 0 .../mxtest/core/PreciseDecimalTest.cpp | 0 .../private/mxtest/core/PrefixTest.cpp | 0 .../mxtest/core/PrincipalVoiceTest.cpp | 0 .../private/mxtest/core/PrintTest.cpp | 0 .../private/mxtest/core/PrintTest.h | 0 .../private/mxtest/core/PropertiesTest.cpp | 0 .../private/mxtest/core/PropertiesTest.h | 0 .../private/mxtest/core/PullOffTest.cpp | 0 .../private/mxtest/core/RehearsalTest.cpp | 0 .../private/mxtest/core/RelationTest.cpp | 0 .../private/mxtest/core/ReleaseTest.cpp | 0 .../private/mxtest/core/RepeatTest.cpp | 0 .../private/mxtest/core/RestTest.cpp | 0 .../private/mxtest/core/RestTest.h | 0 .../private/mxtest/core/RightDividerTest.cpp | 0 .../private/mxtest/core/RightMarginTest.cpp | 0 .../private/mxtest/core/RightsTest.cpp | 0 .../private/mxtest/core/RootAlterTest.cpp | 0 .../private/mxtest/core/RootStepTest.cpp | 0 .../private/mxtest/core/RootTest.cpp | 0 .../private/mxtest/core/RootTest.h | 0 .../private/mxtest/core/ScalingTest.cpp | 0 .../private/mxtest/core/ScalingTest.h | 0 .../private/mxtest/core/SchleiferTest.cpp | 0 .../private/mxtest/core/ScoopTest.cpp | 0 .../private/mxtest/core/ScordaturaTest.cpp | 0 .../private/mxtest/core/ScordaturaTest.h | 0 .../mxtest/core/ScoreHeaderGroupTest.cpp | 0 .../mxtest/core/ScoreHeaderGroupTest.h | 0 .../mxtest/core/ScoreInstrumentTest.cpp | 0 .../private/mxtest/core/ScoreInstrumentTest.h | 0 .../private/mxtest/core/ScorePartTest.cpp | 0 .../private/mxtest/core/ScorePartTest.h | 0 .../private/mxtest/core/ScorePartwiseTest.cpp | 0 .../private/mxtest/core/ScorePartwiseTest.h | 0 .../private/mxtest/core/ScoreTimewiseTest.cpp | 0 .../private/mxtest/core/ScoreTimewiseTest.h | 0 .../private/mxtest/core/SegnoTest.cpp | 0 .../private/mxtest/core/SemiPitchedTest.cpp | 0 .../private/mxtest/core/SenzaMisuraTest.cpp | 0 .../private/mxtest/core/ShakeTest.cpp | 0 .../private/mxtest/core/SignTest.cpp | 0 .../private/mxtest/core/SlashDotTest.cpp | 0 .../private/mxtest/core/SlashTest.cpp | 0 .../private/mxtest/core/SlashTypeTest.cpp | 0 .../private/mxtest/core/SlideTest.cpp | 0 .../private/mxtest/core/SlurTest.cpp | 0 .../private/mxtest/core/SnapPizzicatoTest.cpp | 0 .../private/mxtest/core/SoftwareTest.cpp | 0 .../private/mxtest/core/SoloTest.cpp | 0 .../private/mxtest/core/SoundTest.cpp | 0 .../private/mxtest/core/SoundTest.h | 0 .../private/mxtest/core/SoundingPitchTest.cpp | 0 .../private/mxtest/core/SourceTest.cpp | 0 .../private/mxtest/core/SpiccatoTest.cpp | 0 .../private/mxtest/core/StaccatissimoTest.cpp | 0 .../private/mxtest/core/StaccatoTest.cpp | 0 .../private/mxtest/core/StaffDetailsTest.cpp | 0 .../private/mxtest/core/StaffDistanceTest.cpp | 0 .../private/mxtest/core/StaffLayoutTest.cpp | 0 .../private/mxtest/core/StaffLayoutTest.h | 0 .../private/mxtest/core/StaffLinesTest.cpp | 0 .../private/mxtest/core/StaffSizeTest.cpp | 0 .../private/mxtest/core/StaffTest.cpp | 0 .../private/mxtest/core/StaffTuningTest.cpp | 0 .../private/mxtest/core/StaffTypeTest.cpp | 0 .../private/mxtest/core/StavesTest.cpp | 0 .../private/mxtest/core/StemTest.cpp | 0 .../private/mxtest/core/StepTest.cpp | 0 .../private/mxtest/core/StickLocationTest.cpp | 0 .../private/mxtest/core/StickMaterialTest.cpp | 0 .../private/mxtest/core/StickTest.cpp | 0 .../private/mxtest/core/StickTest.h | 0 .../private/mxtest/core/StickTypeTest.cpp | 0 .../private/mxtest/core/StoppedTest.cpp | 0 .../private/mxtest/core/StressTest.cpp | 0 .../private/mxtest/core/StringMuteTest.cpp | 0 .../private/mxtest/core/StringTest.cpp | 0 .../private/mxtest/core/StringsTest.cpp | 0 .../private/mxtest/core/StrongAccentTest.cpp | 0 .../private/mxtest/core/StrongAccentTest.h | 0 .../private/mxtest/core/SuffixTest.cpp | 0 .../private/mxtest/core/SupportsTest.cpp | 0 .../private/mxtest/core/SyllabicTest.cpp | 0 .../mxtest/core/SyllabicTextGroupTest.cpp | 0 .../mxtest/core/SyllabicTextGroupTest.h | 0 .../mxtest/core/SystemDistanceTest.cpp | 0 .../mxtest/core/SystemDividersTest.cpp | 0 .../private/mxtest/core/SystemDividersTest.h | 0 .../private/mxtest/core/SystemLayoutTest.cpp | 0 .../private/mxtest/core/SystemLayoutTest.h | 0 .../private/mxtest/core/SystemMarginsTest.cpp | 0 .../private/mxtest/core/SystemMarginsTest.h | 0 .../private/mxtest/core/TapTest.cpp | 0 .../mxtest/core/TechnicalChoiceTest.cpp | 0 .../private/mxtest/core/TechnicalChoiceTest.h | 0 .../private/mxtest/core/TechnicalTest.cpp | 0 .../private/mxtest/core/TechnicalTest.h | 0 .../private/mxtest/core/TenthsTest.cpp | 0 .../private/mxtest/core/TenutoTest.cpp | 0 .../private/mxtest/core/TextTest.cpp | 0 .../private/mxtest/core/ThumbPositionTest.cpp | 0 .../private/mxtest/core/TieTest.cpp | 0 .../private/mxtest/core/TiedTest.cpp | 0 .../mxtest/core/TimeModificationTest.cpp | 0 .../mxtest/core/TimeModificationTest.h | 0 .../private/mxtest/core/TimeRelationTest.cpp | 0 .../private/mxtest/core/TimeTest.cpp | 0 .../mxtest/core/TimewiseMeasureTest.cpp | 0 .../private/mxtest/core/TimewiseMeasureTest.h | 0 .../private/mxtest/core/TimewisePartTest.cpp | 0 .../private/mxtest/core/TimewisePartTest.h | 0 .../private/mxtest/core/TimpaniTest.cpp | 0 .../private/mxtest/core/ToeTest.cpp | 0 .../private/mxtest/core/ToeTest.h | 0 .../private/mxtest/core/TopMarginTest.cpp | 0 .../mxtest/core/TopSystemDistanceTest.cpp | 0 .../private/mxtest/core/TouchingPitchTest.cpp | 0 .../private/mxtest/core/TransposeTest.cpp | 0 .../private/mxtest/core/TremoloTest.cpp | 0 .../private/mxtest/core/TrillMarkTest.cpp | 0 .../private/mxtest/core/TripleTongueTest.cpp | 0 .../private/mxtest/core/TuningAlterTest.cpp | 0 .../private/mxtest/core/TuningOctaveTest.cpp | 0 .../private/mxtest/core/TuningStepTest.cpp | 0 .../private/mxtest/core/TupletActualTest.cpp | 0 .../private/mxtest/core/TupletActualTest.h | 0 .../private/mxtest/core/TupletDotTest.cpp | 0 .../private/mxtest/core/TupletNormalTest.cpp | 0 .../private/mxtest/core/TupletNormalTest.h | 0 .../private/mxtest/core/TupletTest.cpp | 0 .../private/mxtest/core/TupletTest.h | 0 .../private/mxtest/core/TupletTypeTest.cpp | 0 .../private/mxtest/core/TurnTest.cpp | 0 .../private/mxtest/core/TypeTest.cpp | 0 .../private/mxtest/core/UnpitchedTest.cpp | 0 .../private/mxtest/core/UnpitchedTest.h | 0 .../private/mxtest/core/UnstressTest.cpp | 0 .../private/mxtest/core/UpBowTest.cpp | 0 .../private/mxtest/core/VerticalTurnTest.cpp | 0 .../mxtest/core/VirtualInstrumentTest.cpp | 0 .../mxtest/core/VirtualInstrumentTest.h | 0 .../mxtest/core/VirtualLibraryTest.cpp | 0 .../private/mxtest/core/VirtualNameTest.cpp | 0 .../private/mxtest/core/VoiceTest.cpp | 0 .../private/mxtest/core/VolumeTest.cpp | 0 .../private/mxtest/core/WavyLineTest.cpp | 0 .../private/mxtest/core/WedgeTest.cpp | 0 .../private/mxtest/core/WithBarTest.cpp | 0 .../private/mxtest/core/WoodTest.cpp | 0 .../private/mxtest/core/WordFontTest.cpp | 0 .../private/mxtest/core/WordsTest.cpp | 0 .../private/mxtest/core/WorkNumberTest.cpp | 0 .../private/mxtest/core/WorkTest.cpp | 0 .../private/mxtest/core/WorkTest.h | 0 .../private/mxtest/core/WorkTitleTest.cpp | 0 .../private/mxtest/core/YesNoNumberTest.cpp | 0 .../private/mxtest/file/MxFile.h | 0 .../private/mxtest/file/MxFileRepository.h | 0 .../private/mxtest/file/MxFileRepositoy.cpp | 0 .../private/mxtest/file/MxFileTest.cpp | 0 .../private/mxtest/file/MxFileTest.h | 0 .../private/mxtest/file/MxFileTestGroup.cpp | 0 .../private/mxtest/file/MxFileTestGroup.h | 0 .../private/mxtest/file/Path.h | 0 .../mxtest/file/StupidFileFunctions.cpp | 0 .../private/mxtest/file/StupidFileFunctions.h | 0 .../mxtest/impl/CurveFunctionsTest.cpp | 0 .../mxtest/impl/DirectionReaderTest.cpp | 0 .../mxtest/impl/DirectionWriterTest.cpp | 0 .../mxtest/impl/MagicTemplatesTest.cpp | 0 .../private/mxtest/impl/MeasureWriterTest.cpp | 0 .../mxtest/impl/PositionFunctionsTest.cpp | 0 .../mxtest/impl/PrintFunctionsTest.cpp | 0 .../private/mxtest/impl/ScoreWriterTest.cpp | 0 .../private/mxtest/import/ChangeValues.cpp | 0 .../private/mxtest/import/ChangeValues.h | 0 .../private/mxtest/import/DecimalFields.h | 0 .../private/mxtest/import/ExpectedFiles.cpp | 0 .../private/mxtest/import/ExpectedFiles.h | 0 .../private/mxtest/import/ImportTest.cpp | 0 .../private/mxtest/import/ImportTestImpl.cpp | 0 .../private/mxtest/import/ImportTestImpl.h | 0 .../private/mxtest/import/SortAttributes.cpp | 0 .../private/mxtest/import/SortAttributes.h | 0 2077 files changed, 98 insertions(+), 98 deletions(-) rename {Sourcecode => src}/include/mx/api/ApiCommon.h (100%) rename {Sourcecode => src}/include/mx/api/ApiEquality.h (100%) rename {Sourcecode => src}/include/mx/api/AppearanceData.h (100%) rename {Sourcecode => src}/include/mx/api/BarlineData.h (100%) rename {Sourcecode => src}/include/mx/api/ChordData.h (100%) rename {Sourcecode => src}/include/mx/api/ClefData.h (100%) rename {Sourcecode => src}/include/mx/api/CodaData.h (100%) rename {Sourcecode => src}/include/mx/api/ColorData.h (100%) rename {Sourcecode => src}/include/mx/api/CurveData.h (100%) rename {Sourcecode => src}/include/mx/api/DefaultsData.h (100%) rename {Sourcecode => src}/include/mx/api/DirectionData.h (100%) rename {Sourcecode => src}/include/mx/api/DocumentManager.h (100%) rename {Sourcecode => src}/include/mx/api/DurationData.h (100%) rename {Sourcecode => src}/include/mx/api/EncodingData.h (100%) rename {Sourcecode => src}/include/mx/api/FontData.h (100%) rename {Sourcecode => src}/include/mx/api/KeyComponent.h (100%) rename {Sourcecode => src}/include/mx/api/KeyData.h (100%) rename {Sourcecode => src}/include/mx/api/LayoutData.h (100%) rename {Sourcecode => src}/include/mx/api/LeftRight.h (100%) rename {Sourcecode => src}/include/mx/api/LineData.h (100%) rename {Sourcecode => src}/include/mx/api/LyricData.h (100%) rename {Sourcecode => src}/include/mx/api/MarginsData.h (100%) rename {Sourcecode => src}/include/mx/api/MarkData.h (100%) rename {Sourcecode => src}/include/mx/api/MeasureData.h (100%) rename {Sourcecode => src}/include/mx/api/MeasureLocation.h (100%) rename {Sourcecode => src}/include/mx/api/MiscData.h (100%) rename {Sourcecode => src}/include/mx/api/NoteAttachmentData.h (100%) rename {Sourcecode => src}/include/mx/api/NoteData.h (100%) rename {Sourcecode => src}/include/mx/api/OttavaData.h (100%) rename {Sourcecode => src}/include/mx/api/PageData.h (100%) rename {Sourcecode => src}/include/mx/api/PageLayoutData.h (100%) rename {Sourcecode => src}/include/mx/api/PageMarginsData.h (100%) rename {Sourcecode => src}/include/mx/api/PageTextData.h (100%) rename {Sourcecode => src}/include/mx/api/PartData.h (100%) rename {Sourcecode => src}/include/mx/api/PartGroupData.h (100%) rename {Sourcecode => src}/include/mx/api/PitchData.h (100%) rename {Sourcecode => src}/include/mx/api/PositionData.h (100%) rename {Sourcecode => src}/include/mx/api/PrintData.h (100%) rename {Sourcecode => src}/include/mx/api/RehearsalData.h (100%) rename {Sourcecode => src}/include/mx/api/ScoreData.h (100%) rename {Sourcecode => src}/include/mx/api/SegnoData.h (100%) rename {Sourcecode => src}/include/mx/api/SizeData.h (100%) rename {Sourcecode => src}/include/mx/api/SoundID.h (100%) rename {Sourcecode => src}/include/mx/api/SpannerData.h (100%) rename {Sourcecode => src}/include/mx/api/StaffData.h (100%) rename {Sourcecode => src}/include/mx/api/SystemData.h (100%) rename {Sourcecode => src}/include/mx/api/SystemLayoutData.h (100%) rename {Sourcecode => src}/include/mx/api/TempoData.h (100%) rename {Sourcecode => src}/include/mx/api/TimeSignatureData.h (100%) rename {Sourcecode => src}/include/mx/api/TransposeData.h (100%) rename {Sourcecode => src}/include/mx/api/TupletData.h (100%) rename {Sourcecode => src}/include/mx/api/Version.h (100%) rename {Sourcecode => src}/include/mx/api/VoiceData.h (100%) rename {Sourcecode => src}/include/mx/api/WedgeData.h (100%) rename {Sourcecode => src}/include/mx/api/WordsData.h (100%) rename {Sourcecode => src}/private/cpul/catch.cpp (100%) rename {Sourcecode => src}/private/cpul/catch.h (100%) rename {Sourcecode => src}/private/cpul/catchDefines.h (100%) rename {Sourcecode => src}/private/cpul/cpulRun.h (100%) rename {Sourcecode => src}/private/cpul/cpulTestHarness.h (100%) rename {Sourcecode => src}/private/cpul/cpulTestTimer.h (100%) rename {Sourcecode => src}/private/cpul/cpulVsTest.h (100%) rename {Sourcecode => src}/private/cpul/main.cpp (100%) rename {Sourcecode => src}/private/cpul/msNoexceptHack.h (100%) rename {Sourcecode => src}/private/cpul/unusedParameter.h (100%) rename {Sourcecode => src}/private/mx/api/AppearanceData.cpp (100%) rename {Sourcecode => src}/private/mx/api/ChordData.cpp (100%) rename {Sourcecode => src}/private/mx/api/ClefData.cpp (100%) rename {Sourcecode => src}/private/mx/api/DocumentManager.cpp (100%) rename {Sourcecode => src}/private/mx/api/DurationData.cpp (100%) rename {Sourcecode => src}/private/mx/api/EncodingData.cpp (100%) rename {Sourcecode => src}/private/mx/api/MarkData.cpp (100%) rename {Sourcecode => src}/private/mx/api/MeasureLocation.cpp (100%) rename {Sourcecode => src}/private/mx/api/NoteData.cpp (100%) rename {Sourcecode => src}/private/mx/api/PitchData.cpp (100%) rename {Sourcecode => src}/private/mx/api/ScoreData.cpp (100%) rename {Sourcecode => src}/private/mx/api/SoundID.cpp (100%) rename {Sourcecode => src}/private/mx/api/Version.cpp (100%) rename {Sourcecode => src}/private/mx/core/AttributesInterface.cpp (100%) rename {Sourcecode => src}/private/mx/core/AttributesInterface.h (100%) rename {Sourcecode => src}/private/mx/core/Color.cpp (100%) rename {Sourcecode => src}/private/mx/core/Color.h (100%) rename {Sourcecode => src}/private/mx/core/CommaSeparatedPositiveIntegers.cpp (100%) rename {Sourcecode => src}/private/mx/core/CommaSeparatedPositiveIntegers.h (100%) rename {Sourcecode => src}/private/mx/core/CommaSeparatedText.cpp (100%) rename {Sourcecode => src}/private/mx/core/CommaSeparatedText.h (100%) rename {Sourcecode => src}/private/mx/core/Date.cpp (100%) rename {Sourcecode => src}/private/mx/core/Date.h (100%) rename {Sourcecode => src}/private/mx/core/Decimals.cpp (100%) rename {Sourcecode => src}/private/mx/core/Decimals.h (100%) rename {Sourcecode => src}/private/mx/core/Document.cpp (100%) rename {Sourcecode => src}/private/mx/core/Document.h (100%) rename {Sourcecode => src}/private/mx/core/DocumentHeader.cpp (100%) rename {Sourcecode => src}/private/mx/core/DocumentHeader.h (100%) rename {Sourcecode => src}/private/mx/core/DocumentSpec.cpp (100%) rename {Sourcecode => src}/private/mx/core/DocumentSpec.h (100%) rename {Sourcecode => src}/private/mx/core/ElementInterface.cpp (100%) rename {Sourcecode => src}/private/mx/core/ElementInterface.h (100%) rename {Sourcecode => src}/private/mx/core/Elements.h (100%) rename {Sourcecode => src}/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/EndingNumber.h (100%) rename {Sourcecode => src}/private/mx/core/Enums.cpp (100%) rename {Sourcecode => src}/private/mx/core/Enums.h (100%) rename {Sourcecode => src}/private/mx/core/EnumsBuiltin.cpp (100%) rename {Sourcecode => src}/private/mx/core/EnumsBuiltin.h (100%) rename {Sourcecode => src}/private/mx/core/FontSize.cpp (100%) rename {Sourcecode => src}/private/mx/core/FontSize.h (100%) rename {Sourcecode => src}/private/mx/core/ForwardDeclare.h (100%) rename {Sourcecode => src}/private/mx/core/FromString.h (100%) rename {Sourcecode => src}/private/mx/core/FromXElement.cpp (100%) rename {Sourcecode => src}/private/mx/core/FromXElement.h (100%) rename {Sourcecode => src}/private/mx/core/Integers.cpp (100%) rename {Sourcecode => src}/private/mx/core/Integers.h (100%) rename {Sourcecode => src}/private/mx/core/NumberOrNormal.cpp (100%) rename {Sourcecode => src}/private/mx/core/NumberOrNormal.h (100%) rename {Sourcecode => src}/private/mx/core/PlaybackSound.h (100%) rename {Sourcecode => src}/private/mx/core/PositiveIntegerOrEmpty.cpp (100%) rename {Sourcecode => src}/private/mx/core/PositiveIntegerOrEmpty.h (100%) rename {Sourcecode => src}/private/mx/core/ProcessingInstruction.cpp (100%) rename {Sourcecode => src}/private/mx/core/ProcessingInstruction.h (100%) rename {Sourcecode => src}/private/mx/core/ScoreConversions.cpp (100%) rename {Sourcecode => src}/private/mx/core/ScoreConversions.h (100%) rename {Sourcecode => src}/private/mx/core/StringUtils.h (100%) rename {Sourcecode => src}/private/mx/core/TimeOnly.h (100%) rename {Sourcecode => src}/private/mx/core/UnusedParameter.h (100%) rename {Sourcecode => src}/private/mx/core/XlinkHref.h (100%) rename {Sourcecode => src}/private/mx/core/XlinkRole.h (100%) rename {Sourcecode => src}/private/mx/core/XlinkTitle.h (100%) rename {Sourcecode => src}/private/mx/core/XmlLang.h (100%) rename {Sourcecode => src}/private/mx/core/XsAnyUri.h (100%) rename {Sourcecode => src}/private/mx/core/XsID.cpp (100%) rename {Sourcecode => src}/private/mx/core/XsID.h (100%) rename {Sourcecode => src}/private/mx/core/XsIDREF.h (100%) rename {Sourcecode => src}/private/mx/core/XsNMToken.h (100%) rename {Sourcecode => src}/private/mx/core/XsString.cpp (100%) rename {Sourcecode => src}/private/mx/core/XsString.h (100%) rename {Sourcecode => src}/private/mx/core/XsToken.cpp (100%) rename {Sourcecode => src}/private/mx/core/XsToken.h (100%) rename {Sourcecode => src}/private/mx/core/YesNoNumber.cpp (100%) rename {Sourcecode => src}/private/mx/core/YesNoNumber.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Accent.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Accent.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Accidental.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Accidental.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalMark.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalMark.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalMarkAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalMarkAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalText.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalText.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalTextAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccidentalTextAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Accord.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Accord.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionHigh.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionHigh.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionLow.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionLow.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionMiddle.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionMiddle.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionRegistration.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionRegistration.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionRegistrationAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/AccordionRegistrationAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ActualNotes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ActualNotes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Alter.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Alter.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Appearance.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Appearance.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Arpeggiate.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Arpeggiate.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ArpeggiateAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ArpeggiateAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Arrow.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Arrow.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ArrowAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ArrowAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ArrowDirection.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ArrowDirection.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ArrowGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ArrowGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ArrowStyle.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ArrowStyle.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Articulations.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Articulations.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ArticulationsChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ArticulationsChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Artificial.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Artificial.h (100%) rename {Sourcecode => src}/private/mx/core/elements/AttributesIterface.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Backup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Backup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BarStyle.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BarStyle.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BarStyleAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BarStyleAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Barline.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Barline.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BarlineAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BarlineAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Barre.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Barre.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BarreAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BarreAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BasePitch.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BasePitch.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Bass.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Bass.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BassAlter.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BassAlter.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BassAlterAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BassAlterAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BassStep.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BassStep.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BassStepAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BassStepAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Beam.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Beam.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeamAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeamAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatRepeat.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatRepeat.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatRepeatAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatRepeatAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnit.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnit.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnitDot.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnitDot.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnitGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnitGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnitPer.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnitPer.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Beater.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Beater.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BeaterAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BeaterAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Beats.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Beats.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Bend.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Bend.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BendAlter.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BendAlter.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BendAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BendAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BendChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BendChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Bookmark.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Bookmark.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BookmarkAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BookmarkAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BottomMargin.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BottomMargin.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Bracket.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Bracket.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BracketAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BracketAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BreathMark.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BreathMark.h (100%) rename {Sourcecode => src}/private/mx/core/elements/BreathMarkAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/BreathMarkAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Caesura.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Caesura.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Cancel.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Cancel.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CancelAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CancelAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Capo.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Capo.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Chord.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Chord.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Chromatic.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Chromatic.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CircularArrow.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CircularArrow.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Clef.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Clef.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ClefAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ClefAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ClefOctaveChange.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ClefOctaveChange.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Coda.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Coda.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Creator.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Creator.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreatorAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreatorAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Credit.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Credit.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditImage.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditImage.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditImageAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditImageAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditWords.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditWords.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditWordsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditWordsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditWordsGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CreditWordsGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Cue.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Cue.h (100%) rename {Sourcecode => src}/private/mx/core/elements/CueNoteGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/CueNoteGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Damp.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Damp.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DampAll.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DampAll.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Dashes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Dashes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DashesAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DashesAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Defaults.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Defaults.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Degree.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Degree.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeAlter.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeAlter.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeAlterAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeAlterAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeTypeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeTypeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeValue.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeValue.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeValueAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DegreeValueAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DelayedInvertedTurn.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DelayedInvertedTurn.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DelayedInvertedTurnAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DelayedTurn.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DelayedTurn.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DelayedTurnAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DelayedTurnAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DetachedLegato.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DetachedLegato.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Diatonic.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Diatonic.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Direction.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Direction.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DirectionAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DirectionAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DirectionType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DirectionType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Directive.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Directive.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DirectiveAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DirectiveAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayOctave.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayOctave.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayStep.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayStep.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayStepOctaveGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayStepOctaveGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayText.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayText.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayTextAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayTextAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayTextOrAccidentalText.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DisplayTextOrAccidentalText.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Distance.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Distance.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DistanceAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DistanceAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Divisions.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Divisions.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Doit.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Doit.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Dot.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Dot.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Double.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Double.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DoubleTongue.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DoubleTongue.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DownBow.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DownBow.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Duration.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Duration.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Dynamics.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Dynamics.h (100%) rename {Sourcecode => src}/private/mx/core/elements/DynamicsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/DynamicsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EditorialGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EditorialGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EditorialVoiceDirectionGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EditorialVoiceGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EditorialVoiceGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Effect.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Effect.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Elevation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Elevation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Elision.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Elision.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ElisionAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ElisionAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ElisionSyllabicGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ElisionSyllabicGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ElisionSyllabicTextGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ElisionSyllabicTextGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EmptyFontAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EmptyFontAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EmptyLineAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EmptyLineAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EmptyPlacementAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EmptyPlacementAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EmptyTrillSoundAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EmptyTrillSoundAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Encoder.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Encoder.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EncoderAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EncoderAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Encoding.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Encoding.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EncodingChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EncodingChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EncodingDate.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EncodingDate.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EncodingDescription.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EncodingDescription.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EndLine.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EndLine.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EndParagraph.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EndParagraph.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Ending.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Ending.h (100%) rename {Sourcecode => src}/private/mx/core/elements/EndingAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/EndingAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Ensemble.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Ensemble.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Extend.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Extend.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ExtendAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ExtendAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Eyeglasses.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Eyeglasses.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Falloff.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Falloff.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Feature.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Feature.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FeatureAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FeatureAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Fermata.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Fermata.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FermataAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FermataAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Fifths.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Fifths.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Figure.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Figure.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FigureNumber.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FigureNumber.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FigureNumberAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FigureNumberAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FiguredBass.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FiguredBass.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FiguredBassAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FiguredBassAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Fingering.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Fingering.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FingeringAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FingeringAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Fingernails.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Fingernails.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FirstFret.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FirstFret.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FirstFretAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FirstFretAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Footnote.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Footnote.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FootnoteAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FootnoteAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Forward.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Forward.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Frame.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Frame.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FrameAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FrameAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FrameFrets.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FrameFrets.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FrameNote.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FrameNote.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FrameStrings.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FrameStrings.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Fret.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Fret.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FretAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FretAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FullNoteGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FullNoteGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FullNoteTypeChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FullNoteTypeChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Function.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Function.h (100%) rename {Sourcecode => src}/private/mx/core/elements/FunctionAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/FunctionAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Glass.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Glass.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Glissando.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Glissando.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GlissandoAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GlissandoAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Grace.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Grace.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GraceAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GraceAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GraceNoteGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GraceNoteGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Group.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Group.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupAbbreviation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupAbbreviation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupAbbreviationAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupAbbreviationAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupAbbreviationDisplay.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupAbbreviationDisplay.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupBarline.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupBarline.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupBarlineAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupBarlineAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupName.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupName.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupNameAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupNameAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupNameDisplay.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupNameDisplay.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupNameDisplayAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupNameDisplayAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupSymbol.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupSymbol.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupSymbolAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupSymbolAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupTime.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupTime.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Grouping.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Grouping.h (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupingAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/GroupingAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HammerOn.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HammerOn.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HammerOnAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HammerOnAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Handbell.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Handbell.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HandbellAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HandbellAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Harmonic.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Harmonic.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonicAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonicAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonicInfoChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonicInfoChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonicTypeChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonicTypeChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Harmony.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Harmony.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonyAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonyAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonyChordGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HarmonyChordGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HarpPedals.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HarpPedals.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HarpPedalsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HarpPedalsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Heel.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Heel.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HeelAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HeelAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Hole.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Hole.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleClosed.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleClosed.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleClosedAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleClosedAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleShape.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleShape.h (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/HoleType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Humming.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Humming.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Identification.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Identification.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Image.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Image.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ImageAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ImageAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Instrument.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Instrument.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InstrumentAbbreviation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InstrumentAbbreviation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InstrumentAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InstrumentAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InstrumentName.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InstrumentName.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InstrumentSound.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InstrumentSound.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Instruments.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Instruments.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Interchangeable.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Interchangeable.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InterchangeableAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InterchangeableAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Inversion.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Inversion.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InversionAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InversionAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InvertedMordent.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InvertedMordent.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InvertedMordentAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InvertedMordentAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InvertedTurn.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InvertedTurn.h (100%) rename {Sourcecode => src}/private/mx/core/elements/InvertedTurnAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/InvertedTurnAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Ipa.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Ipa.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Key.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Key.h (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyAccidental.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyAccidental.h (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyAlter.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyAlter.h (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyOctave.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyOctave.h (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyOctaveAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyOctaveAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyStep.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/KeyStep.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Kind.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Kind.h (100%) rename {Sourcecode => src}/private/mx/core/elements/KindAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/KindAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Laughing.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Laughing.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LayoutGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LayoutGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LeftDivider.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LeftDivider.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LeftMargin.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LeftMargin.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Level.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Level.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LevelAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LevelAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Line.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Line.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LineWidth.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LineWidth.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LineWidthAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LineWidthAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Link.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Link.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LinkAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LinkAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Lyric.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Lyric.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricFont.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricFont.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricFontAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricFontAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricLanguage.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricLanguage.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricLanguageAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricLanguageAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricTextChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/LyricTextChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureDistance.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureDistance.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureLayout.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureLayout.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureNumbering.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureNumbering.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureNumberingAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureNumberingAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureRepeat.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureRepeat.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureRepeatAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureRepeatAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureStyle.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureStyle.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureStyleAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureStyleAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureStyleChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MeasureStyleChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Membrane.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Membrane.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Metal.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Metal.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Metronome.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Metronome.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeBeam.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeBeam.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeBeamAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeBeamAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeDot.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeDot.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeNote.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeNote.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeRelation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeRelation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeRelationGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeRelationGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeTuplet.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeTuplet.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeTupletAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeTupletAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MetronomeType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiBank.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiBank.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiChannel.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiChannel.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiDevice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiDevice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiDeviceAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiDeviceAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiDeviceInstrumentGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiInstrument.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiInstrument.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiInstrumentAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiInstrumentAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiName.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiName.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiProgram.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiProgram.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiUnpitched.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MidiUnpitched.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Millimeters.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Millimeters.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Miscellaneous.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Miscellaneous.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MiscellaneousField.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MiscellaneousField.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MiscellaneousFieldAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MiscellaneousFieldAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Mode.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Mode.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Mordent.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Mordent.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MordentAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MordentAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MovementNumber.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MovementNumber.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MovementTitle.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MovementTitle.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MultipleRest.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MultipleRest.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MultipleRestAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MultipleRestAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MusicDataChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MusicDataChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MusicDataGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MusicDataGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/MusicFont.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/MusicFont.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Mute.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Mute.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Natural.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Natural.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NonArpeggiate.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NonArpeggiate.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NonArpeggiateAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NonArpeggiateAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NonTraditionalKey.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NonTraditionalKey.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalDot.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalDot.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalNoteGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalNoteGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalNotes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalNotes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalTypeNormalDotGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NormalTypeNormalDotGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Notations.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Notations.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NotationsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NotationsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NotationsChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NotationsChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Note.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Note.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteRelationNote.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteRelationNote.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteSize.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteSize.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteSizeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteSizeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Notehead.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Notehead.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteheadAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteheadAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteheadText.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteheadText.h (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteheadTextChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/NoteheadTextChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Octave.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Octave.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OctaveChange.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OctaveChange.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OctaveShift.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OctaveShift.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OctaveShiftAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OctaveShiftAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Offset.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Offset.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OffsetAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OffsetAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OpenString.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OpenString.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Opus.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Opus.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OpusAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OpusAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Ornaments.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Ornaments.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OrnamentsChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OrnamentsChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherAppearance.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherAppearance.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherAppearanceAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherAppearanceAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherArticulation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherArticulation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherArticulationAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherArticulationAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherDirection.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherDirection.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherDirectionAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherDirectionAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherNotation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherNotation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherNotationAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherNotationAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherOrnament.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherOrnament.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherOrnamentAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherOrnamentAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherPercussion.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherPercussion.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherPlay.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherPlay.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherPlayAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherPlayAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherTechnical.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherTechnical.h (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherTechnicalAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/OtherTechnicalAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PageHeight.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PageHeight.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PageLayout.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PageLayout.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PageMargins.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PageMargins.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PageMarginsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PageMarginsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PageWidth.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PageWidth.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Pan.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Pan.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAbbreviation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAbbreviation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAbbreviationAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAbbreviationAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAbbreviationDisplay.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAbbreviationDisplay.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAbbreviationDisplayAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartGroupAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartGroupAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartGroupOrScorePart.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartGroupOrScorePart.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartList.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartList.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartName.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartName.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartNameAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartNameAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartNameDisplay.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartNameDisplay.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartNameDisplayAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartNameDisplayAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartSymbol.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartSymbol.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartSymbolAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartSymbolAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartwiseMeasure.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartwiseMeasure.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PartwisePart.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PartwisePart.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Pedal.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Pedal.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PedalAlter.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PedalAlter.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PedalAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PedalAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PedalStep.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PedalStep.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PedalTuning.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PedalTuning.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PerMinute.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PerMinute.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PerMinuteAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PerMinuteAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Percussion.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Percussion.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PercussionAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PercussionAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PercussionChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PercussionChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Pitch.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Pitch.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Pitched.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Pitched.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Play.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Play.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PlayAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PlayAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Plop.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Plop.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Pluck.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Pluck.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PluckAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PluckAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PreBend.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PreBend.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Prefix.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Prefix.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PrefixAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PrefixAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PrincipalVoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PrincipalVoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PrincipalVoiceAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PrincipalVoiceAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Print.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Print.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PrintAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PrintAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Properties.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Properties.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PullOff.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PullOff.h (100%) rename {Sourcecode => src}/private/mx/core/elements/PullOffAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/PullOffAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Rehearsal.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Rehearsal.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RehearsalAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RehearsalAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Relation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Relation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RelationAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RelationAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Release.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Release.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Repeat.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Repeat.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RepeatAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RepeatAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Rest.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Rest.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RestAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RestAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RightDivider.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RightDivider.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RightMargin.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RightMargin.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Rights.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Rights.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RightsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RightsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Root.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Root.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RootAlter.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RootAlter.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RootAlterAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RootAlterAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RootStep.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RootStep.h (100%) rename {Sourcecode => src}/private/mx/core/elements/RootStepAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/RootStepAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Scaling.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Scaling.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Schleifer.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Schleifer.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Scoop.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Scoop.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Scordatura.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Scordatura.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreHeaderGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreHeaderGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreInstrument.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreInstrument.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreInstrumentAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreInstrumentAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScorePart.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScorePart.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScorePartAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScorePartAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScorePartwise.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScorePartwise.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScorePartwiseAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScorePartwiseAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreTimewise.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreTimewise.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreTimewiseAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ScoreTimewiseAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Segno.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Segno.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SemiPitched.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SemiPitched.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SenzaMisura.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SenzaMisura.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Shake.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Shake.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Sign.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Sign.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Slash.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Slash.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SlashAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SlashAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SlashDot.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SlashDot.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SlashType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SlashType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Slide.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Slide.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SlideAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SlideAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Slur.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Slur.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SlurAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SlurAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SnapPizzicato.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SnapPizzicato.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Software.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Software.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Solo.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Solo.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SoloOrEnsembleChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SoloOrEnsembleChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Sound.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Sound.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SoundAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SoundAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SoundingPitch.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SoundingPitch.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Source.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Source.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Spiccato.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Spiccato.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Staccatissimo.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Staccatissimo.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Staccato.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Staccato.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Staff.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Staff.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffDetails.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffDetails.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffDetailsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffDetailsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffDistance.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffDistance.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffLayout.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffLayout.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffLayoutAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffLayoutAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffLines.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffLines.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffSize.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffSize.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffTuning.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffTuning.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffTuningAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffTuningAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StaffType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Staves.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Staves.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Stem.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Stem.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StemAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StemAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Step.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Step.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Stick.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Stick.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StickAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StickAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StickLocation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StickLocation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StickMaterial.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StickMaterial.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StickType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StickType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Stopped.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Stopped.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Stress.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Stress.h (100%) rename {Sourcecode => src}/private/mx/core/elements/String.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/String.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StringAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StringAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StringMute.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StringMute.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StringMuteAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StringMuteAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StrongAccent.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StrongAccent.h (100%) rename {Sourcecode => src}/private/mx/core/elements/StrongAccentAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/StrongAccentAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Suffix.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Suffix.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SuffixAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SuffixAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Supports.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Supports.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SupportsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SupportsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Syllabic.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Syllabic.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SyllabicTextGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SyllabicTextGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SystemDistance.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SystemDistance.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SystemDividers.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SystemDividers.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SystemLayout.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SystemLayout.h (100%) rename {Sourcecode => src}/private/mx/core/elements/SystemMargins.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/SystemMargins.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Tap.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Tap.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TapAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TapAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Technical.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Technical.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TechnicalChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TechnicalChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Tenths.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Tenths.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Tenuto.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Tenuto.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Text.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Text.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TextAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TextAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ThumbPosition.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ThumbPosition.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Tie.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Tie.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TieAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TieAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Tied.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Tied.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TiedAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TiedAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Time.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Time.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeChoice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeChoice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeModification.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeModification.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeModificationNormalTypeNormalDot.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeModificationNormalTypeNormalDot.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeRelation.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeRelation.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeSignatureGroup.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TimeSignatureGroup.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TimewiseMeasure.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TimewiseMeasure.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TimewisePart.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TimewisePart.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Timpani.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Timpani.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Toe.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Toe.h (100%) rename {Sourcecode => src}/private/mx/core/elements/ToeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/ToeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TopMargin.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TopMargin.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TopSystemDistance.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TopSystemDistance.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TouchingPitch.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TouchingPitch.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TraditionalKey.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TraditionalKey.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Transpose.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Transpose.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TransposeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TransposeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Tremolo.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Tremolo.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TremoloAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TremoloAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TrillMark.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TrillMark.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TripleTongue.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TripleTongue.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TuningAlter.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TuningAlter.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TuningOctave.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TuningOctave.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TuningStep.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TuningStep.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Tuplet.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Tuplet.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletActual.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletActual.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletDot.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletDot.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletDotAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletDotAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletNormal.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletNormal.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletNumber.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletNumber.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletNumberAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletNumberAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletReader.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletType.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletType.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletTypeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TupletTypeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Turn.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Turn.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TurnAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TurnAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Type.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Type.h (100%) rename {Sourcecode => src}/private/mx/core/elements/TypeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/TypeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Unpitched.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Unpitched.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Unstress.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Unstress.h (100%) rename {Sourcecode => src}/private/mx/core/elements/UpBow.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/UpBow.h (100%) rename {Sourcecode => src}/private/mx/core/elements/VerticalTurn.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/VerticalTurn.h (100%) rename {Sourcecode => src}/private/mx/core/elements/VirtualInstrument.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/VirtualInstrument.h (100%) rename {Sourcecode => src}/private/mx/core/elements/VirtualLibrary.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/VirtualLibrary.h (100%) rename {Sourcecode => src}/private/mx/core/elements/VirtualName.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/VirtualName.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Voice.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Voice.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Volume.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Volume.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WavyLine.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WavyLine.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WavyLineAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WavyLineAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Wedge.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Wedge.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WedgeAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WedgeAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WithBar.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WithBar.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WithBarAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WithBarAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Wood.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Wood.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WordFont.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WordFont.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Words.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Words.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WordsAttributes.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WordsAttributes.h (100%) rename {Sourcecode => src}/private/mx/core/elements/Work.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/Work.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WorkNumber.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WorkNumber.h (100%) rename {Sourcecode => src}/private/mx/core/elements/WorkTitle.cpp (100%) rename {Sourcecode => src}/private/mx/core/elements/WorkTitle.h (100%) rename {Sourcecode => src}/private/mx/examples/Hide.cpp (100%) rename {Sourcecode => src}/private/mx/examples/Read.cpp (100%) rename {Sourcecode => src}/private/mx/examples/Write.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/.gitattributes (100%) rename {Sourcecode => src}/private/mx/ezxml/license.txt (100%) rename {Sourcecode => src}/private/mx/ezxml/other/ezxml.sublime-project (100%) rename {Sourcecode => src}/private/mx/ezxml/other/ezxml.sublime-workspace.example copy (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XAttribute.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XAttributeIterImpl.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XAttributeIterator.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XDoc.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XDocSpec.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XElement.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XElementIterator.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XFactory.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/XForwardDeclare.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/include/ezxml/ezxml.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/Parse.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiAttribute.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiAttribute.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiDoc.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiDoc.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiElement.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiElement.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiElementIterImpl.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/PugiElementIterImpl.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/Throw.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/XAttributeIterator.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/XElementIterator.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/XFactory.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/XThrow.h (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/pugiconfig.hpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/pugilicense.txt (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/pugixml.cpp (100%) rename {Sourcecode => src}/private/mx/ezxml/src/private/private/pugixml.hpp (100%) rename {Sourcecode => src}/private/mx/impl/AccidentalMarkFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/AccidentalMarkFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/ArpeggiateFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/ArpeggiateFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/ArticulationsFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/ArticulationsFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/Converter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/Converter.h (100%) rename {Sourcecode => src}/private/mx/impl/Cursor.cpp (100%) rename {Sourcecode => src}/private/mx/impl/Cursor.h (100%) rename {Sourcecode => src}/private/mx/impl/CurveFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/DirectionReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/DirectionReader.h (100%) rename {Sourcecode => src}/private/mx/impl/DirectionWriter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/DirectionWriter.h (100%) rename {Sourcecode => src}/private/mx/impl/DynamicsReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/DynamicsReader.h (100%) rename {Sourcecode => src}/private/mx/impl/DynamicsWriter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/DynamicsWriter.h (100%) rename {Sourcecode => src}/private/mx/impl/EncodingFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/EncodingFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/FermataFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/FermataFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/FontFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/LayoutFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/LayoutFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/LcmGcd.cpp (100%) rename {Sourcecode => src}/private/mx/impl/LcmGcd.h (100%) rename {Sourcecode => src}/private/mx/impl/LineFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/LyricType.cpp (100%) rename {Sourcecode => src}/private/mx/impl/LyricType.h (100%) rename {Sourcecode => src}/private/mx/impl/MarkDataFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/MeasureCursor.h (100%) rename {Sourcecode => src}/private/mx/impl/MeasureReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/MeasureReader.h (100%) rename {Sourcecode => src}/private/mx/impl/MeasureWriter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/MeasureWriter.h (100%) rename {Sourcecode => src}/private/mx/impl/MetronomeReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/MetronomeReader.h (100%) rename {Sourcecode => src}/private/mx/impl/MxVersionDefines.h (100%) rename {Sourcecode => src}/private/mx/impl/NonArpeggiateFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/NonArpeggiateFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/NotationsWriter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/NotationsWriter.h (100%) rename {Sourcecode => src}/private/mx/impl/NoteFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/NoteFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/NoteReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/NoteReader.h (100%) rename {Sourcecode => src}/private/mx/impl/NoteWriter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/NoteWriter.h (100%) rename {Sourcecode => src}/private/mx/impl/OrnamentsFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/OrnamentsFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/PageTextFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/PageTextFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/PartReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/PartReader.h (100%) rename {Sourcecode => src}/private/mx/impl/PartWriter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/PartWriter.h (100%) rename {Sourcecode => src}/private/mx/impl/PositionFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/PrintFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/PropertiesWriter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/PropertiesWriter.h (100%) rename {Sourcecode => src}/private/mx/impl/ScoreReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/ScoreReader.h (100%) rename {Sourcecode => src}/private/mx/impl/ScoreWriter.cpp (100%) rename {Sourcecode => src}/private/mx/impl/ScoreWriter.h (100%) rename {Sourcecode => src}/private/mx/impl/SlideFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/SlideFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/SpannerFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/StaffFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/StaffFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/TechnicalFunctions.cpp (100%) rename {Sourcecode => src}/private/mx/impl/TechnicalFunctions.h (100%) rename {Sourcecode => src}/private/mx/impl/TimeReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/TimeReader.h (100%) rename {Sourcecode => src}/private/mx/impl/TupletReader.cpp (100%) rename {Sourcecode => src}/private/mx/impl/TupletReader.h (100%) rename {Sourcecode => src}/private/mx/utility/Enum.h (100%) rename {Sourcecode => src}/private/mx/utility/EnumWithString.h (100%) rename {Sourcecode => src}/private/mx/utility/JitAllocate.h (100%) rename {Sourcecode => src}/private/mx/utility/Lock.h (100%) rename {Sourcecode => src}/private/mx/utility/OptionalMembers.h (100%) rename {Sourcecode => src}/private/mx/utility/Parse.h (100%) rename {Sourcecode => src}/private/mx/utility/Round.h (100%) rename {Sourcecode => src}/private/mx/utility/StringToInt.h (100%) rename {Sourcecode => src}/private/mx/utility/Throw.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiChordSimpleScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiChordSimpleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK007aScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK007aTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK007cScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK007cTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK009bSlurScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK009bSlurTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK014aFermatasScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK014aFermatasTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK015aLayoutScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK015aLayoutTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK016aMiscScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiK016aMiscTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiLoadSurvivalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiLy43eScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiLy43eTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiMuAccidentals1ScoreData.h (100%) rename {Sourcecode => src}/private/mxtest/api/ApiMuAccidentals1Test.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiTester.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ApiTester.h (100%) rename {Sourcecode => src}/private/mxtest/api/BombeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ChordApiTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ChordDataSaveAndLoadTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/ChordTimeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/DirectionDataTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/DocumentManagerTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/FreezingRoundTrip.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/FreezingTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/KeyDataTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/MeasureDataTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/MetronomeApiTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/MxlTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/NewSystemTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/NoteDataTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/PageDataTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/PitchDataTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/RoundTrip.h (100%) rename {Sourcecode => src}/private/mxtest/api/ScoreDataCreator.h (100%) rename {Sourcecode => src}/private/mxtest/api/SlurTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/TestHelpers.h (100%) rename {Sourcecode => src}/private/mxtest/api/TimeSignatureApiTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/api/TranspositionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/control/CompileControl.h (100%) rename {Sourcecode => src}/private/mxtest/core/AccentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AccidentalMarkTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AccidentalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AccidentalTextTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AccordTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AccordTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/AccordionHighTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AccordionLowTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AccordionMiddleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AccordionRegistrationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ActualNotesTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AlterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AppearanceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/AppearanceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ArpeggiateTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ArrowDirectionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ArrowStyleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ArrowTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ArrowTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ArticulationsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ArticulationsTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ArtificialTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BackupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BackupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/BarStyleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BarlineTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BarlineTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/BarreTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BasePitchTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BassAlterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BassStepTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BassTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BassTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/BeamTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BeatRepeatTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BeatTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BeatUnitDotTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BeatUnitTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BeaterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BeatsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BendAlterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BendChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BendChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/BendTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BendTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/BookmarkTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BottomMarginTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BracketTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/BreathMarkTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CaesuraTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CancelTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CapoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ChordTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ChromaticTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CircularArrowTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ClefOctaveChangeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ClefTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CodaTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ColorTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CreatorTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CreditChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CreditChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/CreditImageTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CreditTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CreditTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/CreditTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CreditWordsGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CreditWordsGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/CreditWordsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CueNoteGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/CueNoteGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/CueTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DampAllTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DampTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DashesTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DateTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DecimalsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DefaultsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DefaultsTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/DegreeAlterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DegreeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DegreeTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/DegreeTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DegreeValueTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DelayedInvertedTurnTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DelayedTurnTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DetachedLegatoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DiatonicTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DirectionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DirectionTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/DirectionTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DirectionTypeTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/DirectiveTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DisplayOctaveTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DisplayStepOctaveGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DisplayStepOctaveGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/DisplayStepTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DisplayTextTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DistanceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DivisionsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentHeaderTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentHeaderTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentPartwiseConvertTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentPartwiseCreate.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentPartwiseCreate.h (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentPartwiseTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentPartwiseTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentTimewiseConvertTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentTimewiseCreate.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentTimewiseCreate.h (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentTimewiseTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DocumentTimewiseTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/DoitTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DotTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DoubleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DoubleTongueTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DownBowTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DurationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/DynamicsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EditorialGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EditorialGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/EditorialVoiceGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EditorialVoiceGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/EffectTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ElevationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ElisionSyllabicGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ElisionSyllabicGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ElisionSyllabicTextGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ElisionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EncoderTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EncodingDateTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EncodingDescriptionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EncodingTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EncodingTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/EndLineTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EndParagraphTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EndingTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EnsembleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EnumsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ExtendTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/EyeglassesTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FalloffTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FeatureTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FermataTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FifthsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FigureNumberTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FigureTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FigureTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/FiguredBassTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FiguredBassTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/FingeringTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FingernailsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FirstFretTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FontSizeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FootnoteTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ForwardTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ForwardTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/FrameFretsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FrameNoteTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FrameStringsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FrameTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FretTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FullNoteGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FullNoteGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/FullNoteTypeChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/FullNoteTypeChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/FunctionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GlassTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GlissandoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GraceNoteGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GraceNoteGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/GraceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupAbbreviationDisplayTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupAbbreviationDisplayTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/GroupAbbreviationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupBarlineTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupNameDisplayTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupNameDisplayTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/GroupNameTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupSymbolTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupTimeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupingTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/GroupingTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HammerOnTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HandbellTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonicInfoChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonicInfoChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonicTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonicTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonicTypeChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonicTypeChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonyChordGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonyChordGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonyTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HarmonyTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HarpPedalsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HeelTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HeelTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HelloWorldExpected.h (100%) rename {Sourcecode => src}/private/mxtest/core/HelloWorldTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HelloWorldTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HelperFunctions.h (100%) rename {Sourcecode => src}/private/mxtest/core/HoleClosedTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HoleShapeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HoleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HoleTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/HoleTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/HummingTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/IdentificationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/IdentificationTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ImageTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InstrumentAbbreviationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InstrumentNameTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InstrumentSoundTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InstrumentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InstrumentsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/IntegersTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InterchangeableTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InversionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InvertedMordentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/InvertedMordentTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/InvertedTurnTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/IpaTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/KeyAccidentalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/KeyAlterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/KeyOctaveTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/KeyStepTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/KeyTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/KindTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LaughingTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LayoutGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LayoutGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/LeftDividerTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LeftMarginTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LevelTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LineTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LineWidthTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LinkTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LyricFontTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LyricLanguageTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LyricTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/LyricTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/LyricTextChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/LyricTextCoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MakeFunctionsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MeasureDistanceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MeasureLayoutTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MeasureLayoutTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/MeasureNumberingTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MeasureRepeatTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MeasureStyleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MembraneTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MetalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MetronomeBeamTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MetronomeDotTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MetronomeNoteTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MetronomeRelationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MetronomeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MetronomeTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/MetronomeTupletTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MetronomeTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MidiBankTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MidiChannelTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MidiDeviceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MidiInstrumentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MidiInstrumentTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/MidiNameTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MidiProgramTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MidiUnpitchedTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MillimetersTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MiscellaneousFieldTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MiscellaneousTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MiscellaneousTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ModeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MordentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MordentTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/MovementNumberTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MovementTitleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MultipleRestTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MusicDataChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MusicDataChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/MusicDataGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MusicDataGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/MusicFontTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/MuteTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NaturalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NonArpeggiateTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NormalDotTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NormalNoteGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NormalNoteGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/NormalNotesTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NormalTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NotationsChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NotationsChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/NotationsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NotationsTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/NoteChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NoteChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/NoteSizeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NoteTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NoteTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/NoteheadTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NoteheadTextTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/NoteheadTextTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/NumberOrNormal.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OctaveChangeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OctaveShiftTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OctaveTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OffsetTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OpenStringTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OpusTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OrnamentsChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OrnamentsChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/OrnamentsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OrnamentsTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/OtherAppearanceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OtherArticulationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OtherDirectionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OtherNotationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OtherOrnamentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OtherPercussionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OtherPlayTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/OtherTechnicalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PageHeightTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PageLayoutTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PageLayoutTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PageMarginsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PageMarginsTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PageWidthTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PanTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartAbbreviationDisplayTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartAbbreviationDisplayTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PartAbbreviationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartGroupOrScorePartTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartGroupOrScorePartTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PartGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PartListTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartListTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PartNameDisplayTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartNameDisplayTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PartNameTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartSymbolTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartwiseMeasureTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartwiseMeasureTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PartwisePartTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PartwisePartTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PedalAlterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PedalStepTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PedalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PedalTuningTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PerMinuteTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PercussionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PercussionTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PitchTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PitchTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PitchedTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PlayTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PlayTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PlopTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PluckTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PreBendTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PreciseDecimalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PrefixTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PrincipalVoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PrintTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PrintTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PropertiesTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/PropertiesTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/PullOffTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RehearsalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RelationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ReleaseTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RepeatTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RestTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RestTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/RightDividerTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RightMarginTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RightsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RootAlterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RootStepTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RootTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/RootTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ScalingTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScalingTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/SchleiferTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScoopTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScordaturaTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScordaturaTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ScoreHeaderGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScoreHeaderGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ScoreInstrumentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScoreInstrumentTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ScorePartTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScorePartTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ScorePartwiseTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScorePartwiseTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/ScoreTimewiseTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ScoreTimewiseTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/SegnoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SemiPitchedTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SenzaMisuraTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ShakeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SignTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SlashDotTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SlashTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SlashTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SlideTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SlurTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SnapPizzicatoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SoftwareTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SoloTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SoundTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SoundTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/SoundingPitchTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SourceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SpiccatoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaccatissimoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaccatoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaffDetailsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaffDistanceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaffLayoutTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaffLayoutTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/StaffLinesTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaffSizeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaffTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaffTuningTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StaffTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StavesTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StemTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StepTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StickLocationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StickMaterialTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StickTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StickTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/StickTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StoppedTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StressTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StringMuteTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StringTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StringsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StrongAccentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/StrongAccentTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/SuffixTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SupportsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SyllabicTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SyllabicTextGroupTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SyllabicTextGroupTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/SystemDistanceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SystemDividersTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SystemDividersTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/SystemLayoutTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SystemLayoutTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/SystemMarginsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/SystemMarginsTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TapTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TechnicalChoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TechnicalChoiceTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TechnicalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TechnicalTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TenthsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TenutoTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TextTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ThumbPositionTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TieTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TiedTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TimeModificationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TimeModificationTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TimeRelationTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TimeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TimewiseMeasureTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TimewiseMeasureTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TimewisePartTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TimewisePartTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TimpaniTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ToeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/ToeTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TopMarginTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TopSystemDistanceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TouchingPitchTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TransposeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TremoloTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TrillMarkTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TripleTongueTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TuningAlterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TuningOctaveTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TuningStepTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TupletActualTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TupletActualTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TupletDotTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TupletNormalTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TupletNormalTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TupletTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TupletTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/TupletTypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TurnTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/TypeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/UnpitchedTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/UnpitchedTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/UnstressTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/UpBowTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/VerticalTurnTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/VirtualInstrumentTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/VirtualInstrumentTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/VirtualLibraryTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/VirtualNameTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/VoiceTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/VolumeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WavyLineTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WedgeTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WithBarTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WoodTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WordFontTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WordsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WorkNumberTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WorkTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/WorkTest.h (100%) rename {Sourcecode => src}/private/mxtest/core/WorkTitleTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/core/YesNoNumberTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/file/MxFile.h (100%) rename {Sourcecode => src}/private/mxtest/file/MxFileRepository.h (100%) rename {Sourcecode => src}/private/mxtest/file/MxFileRepositoy.cpp (100%) rename {Sourcecode => src}/private/mxtest/file/MxFileTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/file/MxFileTest.h (100%) rename {Sourcecode => src}/private/mxtest/file/MxFileTestGroup.cpp (100%) rename {Sourcecode => src}/private/mxtest/file/MxFileTestGroup.h (100%) rename {Sourcecode => src}/private/mxtest/file/Path.h (100%) rename {Sourcecode => src}/private/mxtest/file/StupidFileFunctions.cpp (100%) rename {Sourcecode => src}/private/mxtest/file/StupidFileFunctions.h (100%) rename {Sourcecode => src}/private/mxtest/impl/CurveFunctionsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/impl/DirectionReaderTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/impl/DirectionWriterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/impl/MagicTemplatesTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/impl/MeasureWriterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/impl/PositionFunctionsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/impl/PrintFunctionsTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/impl/ScoreWriterTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/import/ChangeValues.cpp (100%) rename {Sourcecode => src}/private/mxtest/import/ChangeValues.h (100%) rename {Sourcecode => src}/private/mxtest/import/DecimalFields.h (100%) rename {Sourcecode => src}/private/mxtest/import/ExpectedFiles.cpp (100%) rename {Sourcecode => src}/private/mxtest/import/ExpectedFiles.h (100%) rename {Sourcecode => src}/private/mxtest/import/ImportTest.cpp (100%) rename {Sourcecode => src}/private/mxtest/import/ImportTestImpl.cpp (100%) rename {Sourcecode => src}/private/mxtest/import/ImportTestImpl.h (100%) rename {Sourcecode => src}/private/mxtest/import/SortAttributes.cpp (100%) rename {Sourcecode => src}/private/mxtest/import/SortAttributes.h (100%) diff --git a/.dockerignore b/.dockerignore index 23d0e2874..b6d3f5466 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,7 +5,7 @@ # stray build dirs (CLion's cmake-build-debug, etc.) appear at the repo root. * -!Sourcecode +!src !CMakeLists.txt !Makefile !.clang-format diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ab4a0fc86..57fd9952c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: uses: actions/cache@v4 with: path: build/ - key: ${{ runner.os }}-core-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }} + key: ${{ runner.os }}-core-${{ hashFiles('CMakeLists.txt', 'src/**') }} restore-keys: | ${{ runner.os }}-core- @@ -56,7 +56,7 @@ jobs: uses: actions/cache@v4 with: path: build/ - key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }} + key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'src/**') }} restore-keys: | ${{ runner.os }}-build- diff --git a/.gitignore b/.gitignore index e74c9b14c..0c12c09a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ build/ cmake-build-* -Sourcecode/private/mxtest/file/PathRoot.h +src/private/mxtest/file/PathRoot.h **/Mx.xcframework **/xcuserdata/ **/xcshareddata/ diff --git a/AGENTS.md b/AGENTS.md index 873a91888..9ee0ed93b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,18 +6,18 @@ A library for serializing and deserializing MusicXML in C++. The ./README.md fil Key paths in this repository: -- `Sourcecode/` — Main C++ source tree (public API, core elements, implementation, tests) -- `Sourcecode/include/mx/api/` — Public API headers: `*Data` structs and `DocumentManager` entry +- `src/` — Main C++ source tree (public API, core elements, implementation, tests) +- `src/include/mx/api/` — Public API headers: `*Data` structs and `DocumentManager` entry point -- `Sourcecode/private/mx/api/` — Public API implementation backing the `include/mx/api` headers -- `Sourcecode/private/mx/core/` — Strongly-typed MusicXML element classes (mostly code-generated) -- `Sourcecode/private/mx/core/elements/` — Generated element classes, one pair per MusicXML element +- `src/private/mx/api/` — Public API implementation backing the `include/mx/api` headers +- `src/private/mx/core/` — Strongly-typed MusicXML element classes (mostly code-generated) +- `src/private/mx/core/elements/` — Generated element classes, one pair per MusicXML element (1182 files) -- `Sourcecode/private/mx/impl/` — Conversion layer mapping the core DOM to the public API -- `Sourcecode/private/mx/ezxml/` — Embedded lightweight XML reader/writer used by the core -- `Sourcecode/private/mx/utility/` — Shared helpers (string, parsing, file system utilities) -- `Sourcecode/private/mxtest/` — Test suite (api, core, file, import, impl, control) -- `Sourcecode/private/cpul/` — Catch-based unit-test harness and test runner main +- `src/private/mx/impl/` — Conversion layer mapping the core DOM to the public API +- `src/private/mx/ezxml/` — Embedded lightweight XML reader/writer used by the core +- `src/private/mx/utility/` — Shared helpers (string, parsing, file system utilities) +- `src/private/mxtest/` — Test suite (api, core, file, import, impl, control) +- `src/private/cpul/` — Catch-based unit-test harness and test runner main - `gen/version-b/` — Rust tool that generates the core element classes from the MusicXML XSD - `gen/version-b/src/` — Generator source: XSD parsing, model, and C++ emission - `data/` — MusicXML input files and expected-output suites for round-trip tests @@ -30,7 +30,7 @@ Key paths in this repository: ## Historical Context -`Sourcecode/private/mx/core/` and `Sourcecode/private/mx/core/elements/` was originally +`src/private/mx/core/` and `src/private/mx/core/elements/` was originally "hand-generated" by human brute-force using Ruby scripts which can still be found in `./DevScripts`. This was never a one-shot solution to generating the code from the XSD spec. Rather, it was an iterative process, solving problems encountered one-at-a-time until the XSD spec was entirely @@ -42,18 +42,18 @@ historical nature of how the types were first generated. We are stuck somewhere around MusicXML 3.1 (or maybe 3.0) because we cannot reliably re-generate the types from a newer version of the specification. MusicxML 4.0 has been out for a long time, and we want to support it. But we need to write new code-gen tooling to reproduce the emission of the core -types and then expose the new features in `Sourcecode/include/mx/api/`. +types and then expose the new features in `src/include/mx/api/`. ## Quality Gates -When modifying any file under `Sourcecode/`, run: +When modifying any file under `src/`, run: ``` make fmt && make check && make test ``` before considering the change complete. If the changes include anything under -`Sourcecode/private/mx/core/`, use `make test-all` instead of `make test`. +`src/private/mx/core/`, use `make test-all` instead of `make test`. `make fmt` and `make check` run inside Docker (requires Docker on the host). No other tool installation is needed. `make check` enforces formatting (clang-format) and zero compiler warnings diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d52def05..006eb7649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ tags. `docs/ai/project/`) and a build/CI design document. [#145] - Replace `build.sh` with a portable `Makefile` wrapping CMake (build modes, run targets, knobs); `make test` and `make test-all` also run the example programs. [#145] -- Add a `.clang-format` (Microsoft base) and reformat the entire `Sourcecode/` tree; `make fmt` +- Add a `.clang-format` (Microsoft base) and reformat the entire `src/` tree; `make fmt` formats in place. [#145] - Add a pinned-toolchain Docker quality gate: `make check` runs a format check plus a warning-free `g++-14` build, reproducible regardless of the floating CI runner images. [#145] diff --git a/CMakeLists.txt b/CMakeLists.txt index 37eea9d83..70a860f80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ option( set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -set(SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/Sourcecode") +set(SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/src") set(PRIVATE_DIR "${SOURCE_ROOT}/private") set(PUBLIC_DIR "${SOURCE_ROOT}/include") diff --git a/DevScripts/adjustElementsCpp.rb b/DevScripts/adjustElementsCpp.rb index aad14a7d4..b96857fa4 100755 --- a/DevScripts/adjustElementsCpp.rb +++ b/DevScripts/adjustElementsCpp.rb @@ -1,12 +1,12 @@ lines = [] -File.open("../Sourcecode/mx/core/Elements.cpp", "r") do |input_file| +File.open("../src/mx/core/Elements.cpp", "r") do |input_file| input_file.each_line do |line| lines << line end end -File.open("../Sourcecode/mx/core/Elements.cpp.replace", "w") do |f| +File.open("../src/mx/core/Elements.cpp.replace", "w") do |f| write_line = true lines.each do |line| diff --git a/DevScripts/adjustElementsH.rb b/DevScripts/adjustElementsH.rb index 65e75fdf6..1605432b6 100755 --- a/DevScripts/adjustElementsH.rb +++ b/DevScripts/adjustElementsH.rb @@ -1,12 +1,12 @@ lines = [] -File.open("../Sourcecode/mx/core/Elements.h", "r") do |input_file| +File.open("../src/mx/core/Elements.h", "r") do |input_file| input_file.each_line do |line| lines << line end end -File.open("../Sourcecode/mx/core/Elements.h.replace", "w") do |f| +File.open("../src/mx/core/Elements.h.replace", "w") do |f| write_line = true lines.each do |line| diff --git a/DevScripts/attributes.rb b/DevScripts/attributes.rb index c61dae834..17fef1a4a 100755 --- a/DevScripts/attributes.rb +++ b/DevScripts/attributes.rb @@ -138,7 +138,7 @@ def implementAttributeImport class_name cline_first_include = -1 cline_last_function_close = -1 - File.open("../Sourcecode/mx/core/elements/#{class_name}.cpp", "r") do |f| + File.open("../src/mx/core/elements/#{class_name}.cpp", "r") do |f| is_first_include_found = false rx_first_include = /\#include/ rx_function_close = / \}/ @@ -163,7 +163,7 @@ def implementAttributeImport class_name hintermediates = [] - File.open("../Sourcecode/mx/core/elements/#{class_name}.h", "r") do |f| + File.open("../src/mx/core/elements/#{class_name}.h", "r") do |f| #puts caller.first rx_public = / public\:/ is_member_list = false @@ -276,7 +276,7 @@ def implementAttributeImport class_name - File.open("../Sourcecode/mx/core/elements/#{class_name}.h", "w") do |f| + File.open("../src/mx/core/elements/#{class_name}.h", "w") do |f| hlines.each_with_index do |line, index| if( index == hlines_last_member ) f << "\n" @@ -287,7 +287,7 @@ def implementAttributeImport class_name end - File.open("../Sourcecode/mx/core/elements/#{class_name}.cpp", "w") do |f| + File.open("../src/mx/core/elements/#{class_name}.cpp", "w") do |f| clines.each_with_index do |line, index| if( index == cline_first_include ) f << line diff --git a/DevScripts/attributesLoop.rb b/DevScripts/attributesLoop.rb index b908134e8..66229567a 100755 --- a/DevScripts/attributesLoop.rb +++ b/DevScripts/attributesLoop.rb @@ -1,6 +1,6 @@ require_relative 'attributes.rb' require 'pathname' -paths = Dir["../Sourcecode/mx/core/elements/*.h"] +paths = Dir["../src/mx/core/elements/*.h"] names = [] diff --git a/DevScripts/elementsHUsingFile.rb b/DevScripts/elementsHUsingFile.rb index 8d3ef7da3..6a752f320 100755 --- a/DevScripts/elementsHUsingFile.rb +++ b/DevScripts/elementsHUsingFile.rb @@ -2,7 +2,7 @@ def elementsHUsingFile( alias_symbol, actual_symbol ) # one off stupid files for using statements - File.open("../Sourcecode/mx/core/elements/#{alias_symbol}.h", "w") do |stupid_one_off_file| + File.open("../src/mx/core/elements/#{alias_symbol}.h", "w") do |stupid_one_off_file| stupid_one_off_file << "// MusicXML Class Library v0.1.1" << "\n" stupid_one_off_file << "// Copyright (c) 2015 - 2016 by Matthew James Briggs" << "\n" stupid_one_off_file << "" << "\n" diff --git a/DevScripts/findFilesWithBadCopyright.rb b/DevScripts/findFilesWithBadCopyright.rb index 33e1fb917..833845ab3 100755 --- a/DevScripts/findFilesWithBadCopyright.rb +++ b/DevScripts/findFilesWithBadCopyright.rb @@ -18,15 +18,15 @@ def regexify input_string regexify expected_copyright directories = [ - "../Sourcecode/mx/core", - "../Sourcecode/mx/core/elements", - "../Sourcecode/mx/xml", - "../Sourcecode/mx/utility", - "../Sourcecode/mxtest/utility", - "../Sourcecode/mxtest/core", - "../Sourcecode/mxtest/xml", - "../Sourcecode/mxtest/control", - "../Sourcecode/mxtest/import" + "../src/mx/core", + "../src/mx/core/elements", + "../src/mx/xml", + "../src/mx/utility", + "../src/mxtest/utility", + "../src/mxtest/core", + "../src/mxtest/xml", + "../src/mxtest/control", + "../src/mxtest/import" ] bad_files = [] diff --git a/DevScripts/fromXElement.rb b/DevScripts/fromXElement.rb index 1effda9ad..bf33b6810 100755 --- a/DevScripts/fromXElement.rb +++ b/DevScripts/fromXElement.rb @@ -18,7 +18,7 @@ def to_s end end -File.open("../Sourcecode/mx/core/elements/#{class_name}.h", "r") do |f| +File.open("../src/mx/core/elements/#{class_name}.h", "r") do |f| rx_private = / private\:/ f.each_with_index do |line, index| @@ -261,7 +261,7 @@ def guts_value_without_attributes io, members io << " return true;\n" end -File.open("../Sourcecode/mx/core/elements/#{class_name}.cpp", "r") do |f| +File.open("../src/mx/core/elements/#{class_name}.cpp", "r") do |f| is_first_include_found = false rx_first_include = /\#include/ rx_function_close = / \}/ @@ -283,7 +283,7 @@ def guts_value_without_attributes io, members end -File.open("../Sourcecode/mx/core/elements/#{class_name}.h", "w") do |f| +File.open("../src/mx/core/elements/#{class_name}.h", "w") do |f| hlines.each_with_index do |line, index| if( index == hline_private ) f << " bool fromXElement( std::ostream& message, xml::XElement& xelement );" << "\n" @@ -294,7 +294,7 @@ def guts_value_without_attributes io, members end -File.open("../Sourcecode/mx/core/elements/#{class_name}.cpp", "w") do |f| +File.open("../src/mx/core/elements/#{class_name}.cpp", "w") do |f| clines.each_with_index do |line, index| if( index == cline_first_include ) f << line diff --git a/DevScripts/includeAlot.rb b/DevScripts/includeAlot.rb index a7a40027d..c9b3a7252 100755 --- a/DevScripts/includeAlot.rb +++ b/DevScripts/includeAlot.rb @@ -1,6 +1,6 @@ require 'pathname' -filepaths = Dir["../Sourcecode/mx/core/elements/*"] +filepaths = Dir["../src/mx/core/elements/*"] filepaths.each do |fp| filename = Pathname.new(fp).basename diff --git a/DevScripts/lineInstructionsH.rb b/DevScripts/lineInstructionsH.rb index 51652259e..6cc27f6e0 100755 --- a/DevScripts/lineInstructionsH.rb +++ b/DevScripts/lineInstructionsH.rb @@ -63,7 +63,7 @@ def lineInstructionsH lines = [] - File.open("../Sourcecode/mx/core/Elements.h", "r") do |f| + File.open("../src/mx/core/Elements.h", "r") do |f| f.each_line do |line| lines << line end diff --git a/DevScripts/listClassesInEnumsH.rb b/DevScripts/listClassesInEnumsH.rb index a1d8d5d90..f28f498b1 100755 --- a/DevScripts/listClassesInEnumsH.rb +++ b/DevScripts/listClassesInEnumsH.rb @@ -4,7 +4,7 @@ def listClassesInEnumsH enum_list = SortedSet.new - File.open("../Sourcecode/mx/core/Enums.h", "r") do |f| + File.open("../src/mx/core/Enums.h", "r") do |f| f.each_line do |line| rx = /^\s+class\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/listDecimals.rb b/DevScripts/listDecimals.rb index 226099b18..f9eb59e3c 100755 --- a/DevScripts/listDecimals.rb +++ b/DevScripts/listDecimals.rb @@ -4,7 +4,7 @@ def listDecimals item_list = SortedSet.new - File.open("../Sourcecode/mx/core/Decimals.h", "r") do |f| + File.open("../src/mx/core/Decimals.h", "r") do |f| f.each_line do |line| rx = /^\s+class\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/listEnums.rb b/DevScripts/listEnums.rb index cfb0259ed..2494b3c4a 100755 --- a/DevScripts/listEnums.rb +++ b/DevScripts/listEnums.rb @@ -4,7 +4,7 @@ def listEnums enum_list = SortedSet.new - File.open("../Sourcecode/mx/core/Enums.h", "r") do |f| + File.open("../src/mx/core/Enums.h", "r") do |f| f.each_line do |line| rx = /^\s+enum\sclass\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/listIntegers.rb b/DevScripts/listIntegers.rb index 6b69b3fb9..68b686c67 100755 --- a/DevScripts/listIntegers.rb +++ b/DevScripts/listIntegers.rb @@ -4,7 +4,7 @@ def listIntegers item_list = SortedSet.new - File.open("../Sourcecode/mx/core/Integers.h", "r") do |f| + File.open("../src/mx/core/Integers.h", "r") do |f| f.each_line do |line| rx = /^\s+class\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/listStrings.rb b/DevScripts/listStrings.rb index c10fdff17..1ec57a46f 100755 --- a/DevScripts/listStrings.rb +++ b/DevScripts/listStrings.rb @@ -4,7 +4,7 @@ def listStrings item_list = SortedSet.new - File.open("../Sourcecode/mx/core/Strings.h", "r") do |f| + File.open("../src/mx/core/Strings.h", "r") do |f| f.each_line do |line| rx = /^\s+class\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/mxdeploy-v01.rb b/DevScripts/mxdeploy-v01.rb index de188734d..816c5fdd8 100644 --- a/DevScripts/mxdeploy-v01.rb +++ b/DevScripts/mxdeploy-v01.rb @@ -9,7 +9,7 @@ komp_repo_root = "Users/mjb/komp" lib_ios = "libMx-iOS.a" lib_macOS = "libMx-macOS.a" -mx_version_defines_h = "#{mx_repo_root}/Sourcecode/mx/impl/MxVersionDefines.h" +mx_version_defines_h = "#{mx_repo_root}/src/mx/impl/MxVersionDefines.h" upload_dir = "/Users/mjb/Dropbox/Programming/MxKompDeploy" version_major = 0 @@ -119,7 +119,7 @@ header_output_dir = "#{final_output_dir}/include/mx/api" FileUtils::mkdir_p header_output_dir -FileUtils.copy_entry "#{mx_repo_root}/Sourcecode/mx/api", "#{header_output_dir}" +FileUtils.copy_entry "#{mx_repo_root}/src/mx/api", "#{header_output_dir}" system( "cd \"#{build_root}\" && tar -zcvf \"#{final_name}.tar.gz\" \"#{final_name}\"" ) diff --git a/DevScripts/mxdeploy-v02.rb b/DevScripts/mxdeploy-v02.rb index 79ccde036..ae6eae524 100644 --- a/DevScripts/mxdeploy-v02.rb +++ b/DevScripts/mxdeploy-v02.rb @@ -8,7 +8,7 @@ ########################################################################### name_mx_pkg = "mx-src-pkg" -name_mx_src = "Sourcecode" +name_mx_src = "src" name_mx_proj = "Xcode" dir_this_ruby_script = File.dirname(File.realpath(__FILE__)) diff --git a/DevScripts/mxdeploy.rb b/DevScripts/mxdeploy.rb index 6ea0a52f4..1d1ca5c10 100644 --- a/DevScripts/mxdeploy.rb +++ b/DevScripts/mxdeploy.rb @@ -10,7 +10,7 @@ configuration = "Release" name_mx_pkg = "mx-version" -name_mx_src = "Sourcecode" +name_mx_src = "src" name_mx_proj = "Xcode" name_versioning_file = "current.txt" name_ios_target = "MxiOS" @@ -24,7 +24,7 @@ dir_this_ruby_script = File.dirname(File.realpath(__FILE__)) dir_mx_root = File.expand_path("#{dir_this_ruby_script}/..") file_mx_xcode_workspace = "#{dir_mx_root}/Xcode/mx.xcworkspace" -file_mx_version_defines_h = "#{dir_mx_root}/Sourcecode/mx/impl/MxVersionDefines.h" +file_mx_version_defines_h = "#{dir_mx_root}/src/mx/impl/MxVersionDefines.h" dir_komp_root = "/Users/mjb/repos/komp" dir_komp_mx = "#{dir_komp_root}/Frameworks/mx" @@ -179,7 +179,7 @@ FileUtils.rm_rf(dir_komp_mx_headers) FileUtils::mkdir_p "#{dir_komp_mx_headers}/mx/api" -file_header_list = Dir["#{dir_mx_root}/Sourcecode/mx/api/*.h"] +file_header_list = Dir["#{dir_mx_root}/src/mx/api/*.h"] file_header_list.each do |file_current_header| FileUtils.cp(file_current_header, "#{dir_komp_mx_headers}/mx/api") @@ -220,8 +220,8 @@ dir_code_copy_before_zipping = "#{dir_build}/#{name_mx_pkg}" name_zipped_filename = "#{name_mx_pkg}.tar.gz" file_zipped_source = "#{dir_build}/#{name_zipped_filename}" -FileUtils.mkdir_p "#{dir_code_copy_before_zipping}/Sourcecode" -FileUtils.cp_r "#{dir_mx_root}/Sourcecode", "#{dir_code_copy_before_zipping}/Sourcecode" +FileUtils.mkdir_p "#{dir_code_copy_before_zipping}/src" +FileUtils.cp_r "#{dir_mx_root}/src", "#{dir_code_copy_before_zipping}/src" FileUtils.mkdir_p "#{dir_code_copy_before_zipping}/Xcode" FileUtils.cp_r "#{dir_mx_root}/Xcode", "#{dir_code_copy_before_zipping}/Xcode" system( "cd \"#{dir_build}\" && tar -zcvf \"#{name_zipped_filename}\" \"#{name_mx_pkg}\"" ) diff --git a/DevScripts/parseElementsCpp.rb b/DevScripts/parseElementsCpp.rb index a1a04e2eb..f8ff7e144 100755 --- a/DevScripts/parseElementsCpp.rb +++ b/DevScripts/parseElementsCpp.rb @@ -29,7 +29,7 @@ def parseElementsCpp cpp_functions = [] - File.open("../Sourcecode/mx/core/Elements.cpp", "r") do |f| + File.open("../src/mx/core/Elements.cpp", "r") do |f| f.each_with_index do |line, index| rx_scope_operator = /([a-zA-Z0-9]+)\:\:([a-zA-Z0-9]+)/ diff --git a/DevScripts/parseElementsH.rb b/DevScripts/parseElementsH.rb index 4ff44076c..6dc8c4dfe 100755 --- a/DevScripts/parseElementsH.rb +++ b/DevScripts/parseElementsH.rb @@ -21,7 +21,7 @@ def to_s def parseElementsH declarations_found = [] - File.open("../Sourcecode/mx/core/Elements.h", "r") do |f| + File.open("../src/mx/core/Elements.h", "r") do |f| f.each_with_index do |line, index| rx = /^\s*class\s[^\s\;]+/ is_class = ( line =~ rx ) != nil diff --git a/DevScripts/parseElementsHOrder.rb b/DevScripts/parseElementsHOrder.rb index ffdce594b..23fa14b88 100755 --- a/DevScripts/parseElementsHOrder.rb +++ b/DevScripts/parseElementsHOrder.rb @@ -1,13 +1,13 @@ lines = [] -File.open("../Sourcecode/mx/core/Elements.h", "r") do |input_file| +File.open("../src/mx/core/Elements.h", "r") do |input_file| input_file.each_line do |line| lines << line end end i = 1 -#File.open("../Sourcecode/mx/core/Elements.h.order.csv", "w") do |f| +#File.open("../src/mx/core/Elements.h.order.csv", "w") do |f| write_line = true lines.each do |line| diff --git a/DevScripts/smuflHeader.rb b/DevScripts/smuflHeader.rb index 266cb5275..ba53f3e69 100644 --- a/DevScripts/smuflHeader.rb +++ b/DevScripts/smuflHeader.rb @@ -43,7 +43,7 @@ content << "}\n" begin - file = File.open("../Sourcecode/mx/impl/S-M-U-F-LGlyphMap.h", "w") + file = File.open("../src/mx/impl/S-M-U-F-LGlyphMap.h", "w") file.write(content.string) rescue IOError => e #some error occur, dir not writable etc. diff --git a/DevScripts/version.rb b/DevScripts/version.rb index cbc9603d0..68b8172da 100755 --- a/DevScripts/version.rb +++ b/DevScripts/version.rb @@ -1,6 +1,6 @@ lines = [] -File.open("../Sourcecode/mx/core/AttributesInterface.h", "r") do |input_file| +File.open("../src/mx/core/AttributesInterface.h", "r") do |input_file| input_file.each_line do |line| lines << line end diff --git a/DevScripts/writeElementsCppFiles.rb b/DevScripts/writeElementsCppFiles.rb index e30634378..e1a9ec26f 100755 --- a/DevScripts/writeElementsCppFiles.rb +++ b/DevScripts/writeElementsCppFiles.rb @@ -15,7 +15,7 @@ def doIncludes io_object, line_info_object element_classes = listElementClasses lines = [] - File.open("../Sourcecode/mx/core/Elements.h", "r") do |f| + File.open("../src/mx/core/Elements.h", "r") do |f| f.each_line do |line| lines << line end @@ -73,7 +73,7 @@ def writeCppFile class_name, original_file_lines, function_objects line_info = line_info_selected[0] - File.open("../Sourcecode/mx/core/elements/#{class_name}.cpp", "w") do |f| + File.open("../src/mx/core/elements/#{class_name}.cpp", "w") do |f| copywrite f emptyLine f includeH( f, class_name ) @@ -98,7 +98,7 @@ def writeCppFile class_name, original_file_lines, function_objects lines = [] -File.open("../Sourcecode/mx/core/Elements.cpp", "r") do |f| +File.open("../src/mx/core/Elements.cpp", "r") do |f| f.each_line do |line| lines << line end diff --git a/DevScripts/writeHFiles.rb b/DevScripts/writeHFiles.rb index d8ea00c52..5c9bbb322 100755 --- a/DevScripts/writeHFiles.rb +++ b/DevScripts/writeHFiles.rb @@ -73,7 +73,7 @@ def getCodeAsString line_instruction, h_file_code_lines lines = [] -File.open("../Sourcecode/mx/core/Elements.h", "r") do |f| +File.open("../src/mx/core/Elements.h", "r") do |f| f.each_line do |line| lines << line end @@ -83,7 +83,7 @@ def getCodeAsString line_instruction, h_file_code_lines lineInstructionsH.each do |li| - File.open("../Sourcecode/mx/core/elements/#{li.name}.h", "w") do |f| + File.open("../src/mx/core/elements/#{li.name}.h", "w") do |f| f << "// MusicXML Class Library v0.1.1" << "\n" f << "// Copyright (c) 2015 - 2016 by Matthew James Briggs" << "\n" f << "" << "\n" diff --git a/Dockerfile b/Dockerfile index e72804e04..8375b9e1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,9 +46,9 @@ COPY . . FROM base AS run RUN --mount=type=cache,target=/workspace/build make check -# --- fmt stage: format in place, then export only the Sourcecode tree ------- +# --- fmt stage: format in place, then export only the src tree ------- FROM base AS fmt RUN --mount=type=cache,target=/workspace/build make fmt FROM scratch AS fmt-out -COPY --from=fmt /workspace/Sourcecode /Sourcecode +COPY --from=fmt /workspace/src /src diff --git a/Makefile b/Makefile index 818fb7966..5f6ab1e9c 100644 --- a/Makefile +++ b/Makefile @@ -141,7 +141,7 @@ help: @echo ' (use make test-all instead of make test if you touched mx/core)' @echo '' @echo 'Quality gates (run in Docker, pinned toolchain):' - @echo ' make fmt Format all C++ files under Sourcecode/.' + @echo ' make fmt Format all C++ files under src/.' @echo ' make check fmt-check + warning-free build.' @echo '' @echo 'Build (native):' @@ -212,8 +212,8 @@ clean-docker: # the tools directly; outside it builds the image and runs the target inside # it via `docker buildx build`. -FIND_CPP := find Sourcecode \ - -path 'Sourcecode/private/cpul' -prune -o \ +FIND_CPP := find src \ + -path 'src/private/cpul' -prune -o \ -name 'pugixml.cpp' -prune -o \ -name 'pugixml.hpp' -prune -o \ -name 'pugiconfig.hpp' -prune -o \ @@ -232,7 +232,7 @@ ifdef MX_RUNNING_IN_DOCKER fmt: @$(FIND_CPP) | xargs clang-format -i - @echo "Formatted all C++ files under Sourcecode/" + @echo "Formatted all C++ files under src/" check: @echo "=== fmt-check ===" @@ -265,7 +265,7 @@ else fmt: check-docker $(DOCKER) buildx build --target fmt-out \ --output type=local,dest=. $(DOCKER_CACHE) . - @echo "Formatted all C++ files under Sourcecode/" + @echo "Formatted all C++ files under src/" check: check-docker $(DOCKER) buildx build --target run \ diff --git a/README.md b/README.md index c553d0e54..0df51be2a 100644 --- a/README.md +++ b/README.md @@ -91,12 +91,12 @@ git clone https://github.com/webern/mx.git mxtemp # cmake file, the license, and the .gitignore file (helpful since there # is one generated file.) mkdir mx -mv mxtemp/Sourcecode mx/Sourcecode +mv mxtemp/src mx/src mv mxtemp/.gitignore mx/.gitignore mv mxtemp/LICENSE.txt mx/LICENSE.txt mv mxtemp/CMakeLists.txt mx/CMakeLists.txt # we don't need the test code, either -rm -rf mx/Sourcecode/private/mxtest +rm -rf mx/src/private/mxtest rm -rf mxtemp # commit the mx sourcecode to our project repo @@ -141,7 +141,7 @@ set(CPP_VERSION 17) add_executable(my-musicxml-proj main.cpp) add_subdirectory(mx) target_link_libraries(my-musicxml-proj mx) -target_include_directories(my-musicxml-proj PRIVATE mx/Sourcecode/include) +target_include_directories(my-musicxml-proj PRIVATE mx/src/include) EOF # create a .gitignore file to ignore a build directory diff --git a/Xcode/Mx.xcodeproj/project.pbxproj b/Xcode/Mx.xcodeproj/project.pbxproj index 29c667893..588b68a78 100755 --- a/Xcode/Mx.xcodeproj/project.pbxproj +++ b/Xcode/Mx.xcodeproj/project.pbxproj @@ -5222,7 +5222,7 @@ 29A8E29E1EF0476300AD2478 /* utility */, ); name = mx; - path = ../Sourcecode/private/mx; + path = ../src/private/mx; sourceTree = ""; }; 29A8DD581EF0475D00AD2478 /* api */ = { @@ -6748,7 +6748,7 @@ 9CD50C9F238A3D0A00ED7DD8 /* XForwardDeclare.h */, ); name = ezxml; - path = ../Sourcecode/private/mx/ezxml/src/include/ezxml; + path = ../src/private/mx/ezxml/src/include/ezxml; sourceTree = ""; }; /* End PBXGroup section */ @@ -10543,7 +10543,7 @@ ); OTHER_LDFLAGS = ""; SDKROOT = ""; - USER_HEADER_SEARCH_PATHS = "$PROJECT_DIR/../Sourcecode/private $PROJECT_DIR/../Sourcecode/include $PROJECT_DIR/../Sourcecode/private/mx/ezxml/src/include $PROJECT_DIR/../Sourcecode/private/mx/ezxml/src/private"; + USER_HEADER_SEARCH_PATHS = "$PROJECT_DIR/../src/private $PROJECT_DIR/../src/include $PROJECT_DIR/../src/private/mx/ezxml/src/include $PROJECT_DIR/../src/private/mx/ezxml/src/private"; VALID_ARCHS = "$(ARCHS_STANDARD)"; }; name = Debug; @@ -10619,7 +10619,7 @@ ); OTHER_LDFLAGS = ""; SDKROOT = ""; - USER_HEADER_SEARCH_PATHS = "$PROJECT_DIR/../Sourcecode/private $PROJECT_DIR/../Sourcecode/include $PROJECT_DIR/../Sourcecode/private/mx/ezxml/src/include $PROJECT_DIR/../Sourcecode/private/mx/ezxml/src/private"; + USER_HEADER_SEARCH_PATHS = "$PROJECT_DIR/../src/private $PROJECT_DIR/../src/include $PROJECT_DIR/../src/private/mx/ezxml/src/include $PROJECT_DIR/../src/private/mx/ezxml/src/private"; VALID_ARCHS = "$(ARCHS_STANDARD)"; }; name = Release; diff --git a/docs/ai/project/AGENTS.md b/docs/ai/project/AGENTS.md index 6bfadbbcd..4ccaf9605 100644 --- a/docs/ai/project/AGENTS.md +++ b/docs/ai/project/AGENTS.md @@ -7,7 +7,7 @@ and CI targets will lint, build, test and fmt the code. ## Note on mx/core/ -The files in `Sourcecode/private/mx/core/` were originally machine-generated from the MusicXML XSD. +The files in `src/private/mx/core/` were originally machine-generated from the MusicXML XSD. The codegen program no longer exists. These files are normal hand-edited source now and must pass all quality gates. A future codegen rewrite will re-own them. Do not treat them as generated or read-only. diff --git a/docs/ai/project/build-and-ci-design.md b/docs/ai/project/build-and-ci-design.md index 58bb90279..c1b5f02aa 100644 --- a/docs/ai/project/build-and-ci-design.md +++ b/docs/ai/project/build-and-ci-design.md @@ -3,11 +3,11 @@ ## Overview This document describes the formatting, compiler-warning enforcement, and CI pipeline for mx. It -also defines the quality gates that coding agents must satisfy when modifying `Sourcecode/`. +also defines the quality gates that coding agents must satisfy when modifying `src/`. ### Note on `mx/core/` -The files in `Sourcecode/private/mx/core/` were originally machine-generated from the MusicXML XSD. +The files in `src/private/mx/core/` were originally machine-generated from the MusicXML XSD. The codegen program no longer exists. These files are treated as normal hand-edited source for the current gates (formatting and compiler warnings) and must pass them like any other code. They are not linted (see Future Work). A future codegen rewrite will re-own these files and emit code that @@ -43,7 +43,7 @@ Style base: **Microsoft**. This is the closest standard clang-format style to th The one visible change from the historical style is the removal of spaces inside parentheses (`func( arg )` becomes `func(arg)`). -A `.clang-format` file at the repo root encodes this style. All C++ files under `Sourcecode/` are +A `.clang-format` file at the repo root encodes this style. All C++ files under `src/` are formatted, including generated files in `mx/core/`. ### Linting (deferred) @@ -94,8 +94,8 @@ The Makefile detects `MX_RUNNING_IN_DOCKER`: target inside it. For `make fmt`, which needs to write formatted files back to the host, the Makefile uses -`docker buildx build --output type=local,dest=.` to extract the formatted `Sourcecode/` tree from a -`scratch` export stage (only `Sourcecode/` is written back). +`docker buildx build --output type=local,dest=.` to extract the formatted `src/` tree from a +`scratch` export stage (only `src/` is written back). For `make check`, only the exit code matters - the build runs with `--output type=cacheonly`. @@ -105,13 +105,13 @@ For `make check`, only the exit code matters - the build runs with `--output typ ### Developer Workflow -The standard workflow for any code change under `Sourcecode/`: +The standard workflow for any code change under `src/`: ``` make fmt && make check && make test ``` -If the change touches files under `Sourcecode/private/mx/core/`: +If the change touches files under `src/private/mx/core/`: ``` make fmt && make check && make test-all @@ -125,7 +125,7 @@ natively with the local compiler. | Target | What it does | |---------------------|---------------------------------------------------------------| -| `make fmt` | Formats all C++ files under `Sourcecode/` in-place via Docker | +| `make fmt` | Formats all C++ files under `src/` in-place via Docker | | `make check` | Quality gate: fmt-check + warning-free build (Docker) | | `make clean-docker` | Removes the Docker buildx cache | @@ -266,7 +266,7 @@ layers change rarely, source code layers change frequently. Build-and-test jobs (linux-core, macos, windows) cache their `build/` directory: ``` -${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'Sourcecode/**') }} +${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'src/**') }} ``` ### Branch Protection @@ -278,13 +278,13 @@ before merge. The **xcode** job is advisory. Merge strategy: regular merge commi ## Quality Gates for Coding Agents -When modifying any file under `Sourcecode/`, an agent must run: +When modifying any file under `src/`, an agent must run: ``` make fmt && make check && make test ``` -If the change touches `Sourcecode/private/mx/core/`, run `make test-all` instead of `make test`. +If the change touches `src/private/mx/core/`, run `make test-all` instead of `make test`. `make check` enforces: @@ -301,15 +301,15 @@ other tool installation is needed for quality gates. clang-tidy is not currently a quality gate. It was evaluated and removed because running it across the whole tree is not viable: -- `Sourcecode/private/mx/core/` holds ~1131 generated element `.cpp` files. clang-tidy over all of +- `src/private/mx/core/` holds ~1131 generated element `.cpp` files. clang-tidy over all of them measured at roughly 8 s/file (~2.6 hours total). -- With a `Sourcecode/.*` header filter, clang-tidy re-parses shared headers once per translation +- With a `src/.*` header filter, clang-tidy re-parses shared headers once per translation unit and reports millions of duplicated diagnostics. - The generated `mx/core` code is slated for replacement by a future codegen rewrite, so linting it now has little value. The intended future direction is to reintroduce clang-tidy **scoped to the hand-written public API -and implementation** - starting with `Sourcecode/include/mx/api/` (`mx/api`) - and explicitly +and implementation** - starting with `src/include/mx/api/` (`mx/api`) - and explicitly **excluding generated `mx/core`**. Scoped that way the file count and header-filter scope are small enough to be a fast, useful gate. This is deferred and is not part of the current pipeline; the future codegen rewrite is expected to emit `mx/core` that would itself pass such a scoped lint. diff --git a/Sourcecode/include/mx/api/ApiCommon.h b/src/include/mx/api/ApiCommon.h similarity index 100% rename from Sourcecode/include/mx/api/ApiCommon.h rename to src/include/mx/api/ApiCommon.h diff --git a/Sourcecode/include/mx/api/ApiEquality.h b/src/include/mx/api/ApiEquality.h similarity index 100% rename from Sourcecode/include/mx/api/ApiEquality.h rename to src/include/mx/api/ApiEquality.h diff --git a/Sourcecode/include/mx/api/AppearanceData.h b/src/include/mx/api/AppearanceData.h similarity index 100% rename from Sourcecode/include/mx/api/AppearanceData.h rename to src/include/mx/api/AppearanceData.h diff --git a/Sourcecode/include/mx/api/BarlineData.h b/src/include/mx/api/BarlineData.h similarity index 100% rename from Sourcecode/include/mx/api/BarlineData.h rename to src/include/mx/api/BarlineData.h diff --git a/Sourcecode/include/mx/api/ChordData.h b/src/include/mx/api/ChordData.h similarity index 100% rename from Sourcecode/include/mx/api/ChordData.h rename to src/include/mx/api/ChordData.h diff --git a/Sourcecode/include/mx/api/ClefData.h b/src/include/mx/api/ClefData.h similarity index 100% rename from Sourcecode/include/mx/api/ClefData.h rename to src/include/mx/api/ClefData.h diff --git a/Sourcecode/include/mx/api/CodaData.h b/src/include/mx/api/CodaData.h similarity index 100% rename from Sourcecode/include/mx/api/CodaData.h rename to src/include/mx/api/CodaData.h diff --git a/Sourcecode/include/mx/api/ColorData.h b/src/include/mx/api/ColorData.h similarity index 100% rename from Sourcecode/include/mx/api/ColorData.h rename to src/include/mx/api/ColorData.h diff --git a/Sourcecode/include/mx/api/CurveData.h b/src/include/mx/api/CurveData.h similarity index 100% rename from Sourcecode/include/mx/api/CurveData.h rename to src/include/mx/api/CurveData.h diff --git a/Sourcecode/include/mx/api/DefaultsData.h b/src/include/mx/api/DefaultsData.h similarity index 100% rename from Sourcecode/include/mx/api/DefaultsData.h rename to src/include/mx/api/DefaultsData.h diff --git a/Sourcecode/include/mx/api/DirectionData.h b/src/include/mx/api/DirectionData.h similarity index 100% rename from Sourcecode/include/mx/api/DirectionData.h rename to src/include/mx/api/DirectionData.h diff --git a/Sourcecode/include/mx/api/DocumentManager.h b/src/include/mx/api/DocumentManager.h similarity index 100% rename from Sourcecode/include/mx/api/DocumentManager.h rename to src/include/mx/api/DocumentManager.h diff --git a/Sourcecode/include/mx/api/DurationData.h b/src/include/mx/api/DurationData.h similarity index 100% rename from Sourcecode/include/mx/api/DurationData.h rename to src/include/mx/api/DurationData.h diff --git a/Sourcecode/include/mx/api/EncodingData.h b/src/include/mx/api/EncodingData.h similarity index 100% rename from Sourcecode/include/mx/api/EncodingData.h rename to src/include/mx/api/EncodingData.h diff --git a/Sourcecode/include/mx/api/FontData.h b/src/include/mx/api/FontData.h similarity index 100% rename from Sourcecode/include/mx/api/FontData.h rename to src/include/mx/api/FontData.h diff --git a/Sourcecode/include/mx/api/KeyComponent.h b/src/include/mx/api/KeyComponent.h similarity index 100% rename from Sourcecode/include/mx/api/KeyComponent.h rename to src/include/mx/api/KeyComponent.h diff --git a/Sourcecode/include/mx/api/KeyData.h b/src/include/mx/api/KeyData.h similarity index 100% rename from Sourcecode/include/mx/api/KeyData.h rename to src/include/mx/api/KeyData.h diff --git a/Sourcecode/include/mx/api/LayoutData.h b/src/include/mx/api/LayoutData.h similarity index 100% rename from Sourcecode/include/mx/api/LayoutData.h rename to src/include/mx/api/LayoutData.h diff --git a/Sourcecode/include/mx/api/LeftRight.h b/src/include/mx/api/LeftRight.h similarity index 100% rename from Sourcecode/include/mx/api/LeftRight.h rename to src/include/mx/api/LeftRight.h diff --git a/Sourcecode/include/mx/api/LineData.h b/src/include/mx/api/LineData.h similarity index 100% rename from Sourcecode/include/mx/api/LineData.h rename to src/include/mx/api/LineData.h diff --git a/Sourcecode/include/mx/api/LyricData.h b/src/include/mx/api/LyricData.h similarity index 100% rename from Sourcecode/include/mx/api/LyricData.h rename to src/include/mx/api/LyricData.h diff --git a/Sourcecode/include/mx/api/MarginsData.h b/src/include/mx/api/MarginsData.h similarity index 100% rename from Sourcecode/include/mx/api/MarginsData.h rename to src/include/mx/api/MarginsData.h diff --git a/Sourcecode/include/mx/api/MarkData.h b/src/include/mx/api/MarkData.h similarity index 100% rename from Sourcecode/include/mx/api/MarkData.h rename to src/include/mx/api/MarkData.h diff --git a/Sourcecode/include/mx/api/MeasureData.h b/src/include/mx/api/MeasureData.h similarity index 100% rename from Sourcecode/include/mx/api/MeasureData.h rename to src/include/mx/api/MeasureData.h diff --git a/Sourcecode/include/mx/api/MeasureLocation.h b/src/include/mx/api/MeasureLocation.h similarity index 100% rename from Sourcecode/include/mx/api/MeasureLocation.h rename to src/include/mx/api/MeasureLocation.h diff --git a/Sourcecode/include/mx/api/MiscData.h b/src/include/mx/api/MiscData.h similarity index 100% rename from Sourcecode/include/mx/api/MiscData.h rename to src/include/mx/api/MiscData.h diff --git a/Sourcecode/include/mx/api/NoteAttachmentData.h b/src/include/mx/api/NoteAttachmentData.h similarity index 100% rename from Sourcecode/include/mx/api/NoteAttachmentData.h rename to src/include/mx/api/NoteAttachmentData.h diff --git a/Sourcecode/include/mx/api/NoteData.h b/src/include/mx/api/NoteData.h similarity index 100% rename from Sourcecode/include/mx/api/NoteData.h rename to src/include/mx/api/NoteData.h diff --git a/Sourcecode/include/mx/api/OttavaData.h b/src/include/mx/api/OttavaData.h similarity index 100% rename from Sourcecode/include/mx/api/OttavaData.h rename to src/include/mx/api/OttavaData.h diff --git a/Sourcecode/include/mx/api/PageData.h b/src/include/mx/api/PageData.h similarity index 100% rename from Sourcecode/include/mx/api/PageData.h rename to src/include/mx/api/PageData.h diff --git a/Sourcecode/include/mx/api/PageLayoutData.h b/src/include/mx/api/PageLayoutData.h similarity index 100% rename from Sourcecode/include/mx/api/PageLayoutData.h rename to src/include/mx/api/PageLayoutData.h diff --git a/Sourcecode/include/mx/api/PageMarginsData.h b/src/include/mx/api/PageMarginsData.h similarity index 100% rename from Sourcecode/include/mx/api/PageMarginsData.h rename to src/include/mx/api/PageMarginsData.h diff --git a/Sourcecode/include/mx/api/PageTextData.h b/src/include/mx/api/PageTextData.h similarity index 100% rename from Sourcecode/include/mx/api/PageTextData.h rename to src/include/mx/api/PageTextData.h diff --git a/Sourcecode/include/mx/api/PartData.h b/src/include/mx/api/PartData.h similarity index 100% rename from Sourcecode/include/mx/api/PartData.h rename to src/include/mx/api/PartData.h diff --git a/Sourcecode/include/mx/api/PartGroupData.h b/src/include/mx/api/PartGroupData.h similarity index 100% rename from Sourcecode/include/mx/api/PartGroupData.h rename to src/include/mx/api/PartGroupData.h diff --git a/Sourcecode/include/mx/api/PitchData.h b/src/include/mx/api/PitchData.h similarity index 100% rename from Sourcecode/include/mx/api/PitchData.h rename to src/include/mx/api/PitchData.h diff --git a/Sourcecode/include/mx/api/PositionData.h b/src/include/mx/api/PositionData.h similarity index 100% rename from Sourcecode/include/mx/api/PositionData.h rename to src/include/mx/api/PositionData.h diff --git a/Sourcecode/include/mx/api/PrintData.h b/src/include/mx/api/PrintData.h similarity index 100% rename from Sourcecode/include/mx/api/PrintData.h rename to src/include/mx/api/PrintData.h diff --git a/Sourcecode/include/mx/api/RehearsalData.h b/src/include/mx/api/RehearsalData.h similarity index 100% rename from Sourcecode/include/mx/api/RehearsalData.h rename to src/include/mx/api/RehearsalData.h diff --git a/Sourcecode/include/mx/api/ScoreData.h b/src/include/mx/api/ScoreData.h similarity index 100% rename from Sourcecode/include/mx/api/ScoreData.h rename to src/include/mx/api/ScoreData.h diff --git a/Sourcecode/include/mx/api/SegnoData.h b/src/include/mx/api/SegnoData.h similarity index 100% rename from Sourcecode/include/mx/api/SegnoData.h rename to src/include/mx/api/SegnoData.h diff --git a/Sourcecode/include/mx/api/SizeData.h b/src/include/mx/api/SizeData.h similarity index 100% rename from Sourcecode/include/mx/api/SizeData.h rename to src/include/mx/api/SizeData.h diff --git a/Sourcecode/include/mx/api/SoundID.h b/src/include/mx/api/SoundID.h similarity index 100% rename from Sourcecode/include/mx/api/SoundID.h rename to src/include/mx/api/SoundID.h diff --git a/Sourcecode/include/mx/api/SpannerData.h b/src/include/mx/api/SpannerData.h similarity index 100% rename from Sourcecode/include/mx/api/SpannerData.h rename to src/include/mx/api/SpannerData.h diff --git a/Sourcecode/include/mx/api/StaffData.h b/src/include/mx/api/StaffData.h similarity index 100% rename from Sourcecode/include/mx/api/StaffData.h rename to src/include/mx/api/StaffData.h diff --git a/Sourcecode/include/mx/api/SystemData.h b/src/include/mx/api/SystemData.h similarity index 100% rename from Sourcecode/include/mx/api/SystemData.h rename to src/include/mx/api/SystemData.h diff --git a/Sourcecode/include/mx/api/SystemLayoutData.h b/src/include/mx/api/SystemLayoutData.h similarity index 100% rename from Sourcecode/include/mx/api/SystemLayoutData.h rename to src/include/mx/api/SystemLayoutData.h diff --git a/Sourcecode/include/mx/api/TempoData.h b/src/include/mx/api/TempoData.h similarity index 100% rename from Sourcecode/include/mx/api/TempoData.h rename to src/include/mx/api/TempoData.h diff --git a/Sourcecode/include/mx/api/TimeSignatureData.h b/src/include/mx/api/TimeSignatureData.h similarity index 100% rename from Sourcecode/include/mx/api/TimeSignatureData.h rename to src/include/mx/api/TimeSignatureData.h diff --git a/Sourcecode/include/mx/api/TransposeData.h b/src/include/mx/api/TransposeData.h similarity index 100% rename from Sourcecode/include/mx/api/TransposeData.h rename to src/include/mx/api/TransposeData.h diff --git a/Sourcecode/include/mx/api/TupletData.h b/src/include/mx/api/TupletData.h similarity index 100% rename from Sourcecode/include/mx/api/TupletData.h rename to src/include/mx/api/TupletData.h diff --git a/Sourcecode/include/mx/api/Version.h b/src/include/mx/api/Version.h similarity index 100% rename from Sourcecode/include/mx/api/Version.h rename to src/include/mx/api/Version.h diff --git a/Sourcecode/include/mx/api/VoiceData.h b/src/include/mx/api/VoiceData.h similarity index 100% rename from Sourcecode/include/mx/api/VoiceData.h rename to src/include/mx/api/VoiceData.h diff --git a/Sourcecode/include/mx/api/WedgeData.h b/src/include/mx/api/WedgeData.h similarity index 100% rename from Sourcecode/include/mx/api/WedgeData.h rename to src/include/mx/api/WedgeData.h diff --git a/Sourcecode/include/mx/api/WordsData.h b/src/include/mx/api/WordsData.h similarity index 100% rename from Sourcecode/include/mx/api/WordsData.h rename to src/include/mx/api/WordsData.h diff --git a/Sourcecode/private/cpul/catch.cpp b/src/private/cpul/catch.cpp similarity index 100% rename from Sourcecode/private/cpul/catch.cpp rename to src/private/cpul/catch.cpp diff --git a/Sourcecode/private/cpul/catch.h b/src/private/cpul/catch.h similarity index 100% rename from Sourcecode/private/cpul/catch.h rename to src/private/cpul/catch.h diff --git a/Sourcecode/private/cpul/catchDefines.h b/src/private/cpul/catchDefines.h similarity index 100% rename from Sourcecode/private/cpul/catchDefines.h rename to src/private/cpul/catchDefines.h diff --git a/Sourcecode/private/cpul/cpulRun.h b/src/private/cpul/cpulRun.h similarity index 100% rename from Sourcecode/private/cpul/cpulRun.h rename to src/private/cpul/cpulRun.h diff --git a/Sourcecode/private/cpul/cpulTestHarness.h b/src/private/cpul/cpulTestHarness.h similarity index 100% rename from Sourcecode/private/cpul/cpulTestHarness.h rename to src/private/cpul/cpulTestHarness.h diff --git a/Sourcecode/private/cpul/cpulTestTimer.h b/src/private/cpul/cpulTestTimer.h similarity index 100% rename from Sourcecode/private/cpul/cpulTestTimer.h rename to src/private/cpul/cpulTestTimer.h diff --git a/Sourcecode/private/cpul/cpulVsTest.h b/src/private/cpul/cpulVsTest.h similarity index 100% rename from Sourcecode/private/cpul/cpulVsTest.h rename to src/private/cpul/cpulVsTest.h diff --git a/Sourcecode/private/cpul/main.cpp b/src/private/cpul/main.cpp similarity index 100% rename from Sourcecode/private/cpul/main.cpp rename to src/private/cpul/main.cpp diff --git a/Sourcecode/private/cpul/msNoexceptHack.h b/src/private/cpul/msNoexceptHack.h similarity index 100% rename from Sourcecode/private/cpul/msNoexceptHack.h rename to src/private/cpul/msNoexceptHack.h diff --git a/Sourcecode/private/cpul/unusedParameter.h b/src/private/cpul/unusedParameter.h similarity index 100% rename from Sourcecode/private/cpul/unusedParameter.h rename to src/private/cpul/unusedParameter.h diff --git a/Sourcecode/private/mx/api/AppearanceData.cpp b/src/private/mx/api/AppearanceData.cpp similarity index 100% rename from Sourcecode/private/mx/api/AppearanceData.cpp rename to src/private/mx/api/AppearanceData.cpp diff --git a/Sourcecode/private/mx/api/ChordData.cpp b/src/private/mx/api/ChordData.cpp similarity index 100% rename from Sourcecode/private/mx/api/ChordData.cpp rename to src/private/mx/api/ChordData.cpp diff --git a/Sourcecode/private/mx/api/ClefData.cpp b/src/private/mx/api/ClefData.cpp similarity index 100% rename from Sourcecode/private/mx/api/ClefData.cpp rename to src/private/mx/api/ClefData.cpp diff --git a/Sourcecode/private/mx/api/DocumentManager.cpp b/src/private/mx/api/DocumentManager.cpp similarity index 100% rename from Sourcecode/private/mx/api/DocumentManager.cpp rename to src/private/mx/api/DocumentManager.cpp diff --git a/Sourcecode/private/mx/api/DurationData.cpp b/src/private/mx/api/DurationData.cpp similarity index 100% rename from Sourcecode/private/mx/api/DurationData.cpp rename to src/private/mx/api/DurationData.cpp diff --git a/Sourcecode/private/mx/api/EncodingData.cpp b/src/private/mx/api/EncodingData.cpp similarity index 100% rename from Sourcecode/private/mx/api/EncodingData.cpp rename to src/private/mx/api/EncodingData.cpp diff --git a/Sourcecode/private/mx/api/MarkData.cpp b/src/private/mx/api/MarkData.cpp similarity index 100% rename from Sourcecode/private/mx/api/MarkData.cpp rename to src/private/mx/api/MarkData.cpp diff --git a/Sourcecode/private/mx/api/MeasureLocation.cpp b/src/private/mx/api/MeasureLocation.cpp similarity index 100% rename from Sourcecode/private/mx/api/MeasureLocation.cpp rename to src/private/mx/api/MeasureLocation.cpp diff --git a/Sourcecode/private/mx/api/NoteData.cpp b/src/private/mx/api/NoteData.cpp similarity index 100% rename from Sourcecode/private/mx/api/NoteData.cpp rename to src/private/mx/api/NoteData.cpp diff --git a/Sourcecode/private/mx/api/PitchData.cpp b/src/private/mx/api/PitchData.cpp similarity index 100% rename from Sourcecode/private/mx/api/PitchData.cpp rename to src/private/mx/api/PitchData.cpp diff --git a/Sourcecode/private/mx/api/ScoreData.cpp b/src/private/mx/api/ScoreData.cpp similarity index 100% rename from Sourcecode/private/mx/api/ScoreData.cpp rename to src/private/mx/api/ScoreData.cpp diff --git a/Sourcecode/private/mx/api/SoundID.cpp b/src/private/mx/api/SoundID.cpp similarity index 100% rename from Sourcecode/private/mx/api/SoundID.cpp rename to src/private/mx/api/SoundID.cpp diff --git a/Sourcecode/private/mx/api/Version.cpp b/src/private/mx/api/Version.cpp similarity index 100% rename from Sourcecode/private/mx/api/Version.cpp rename to src/private/mx/api/Version.cpp diff --git a/Sourcecode/private/mx/core/AttributesInterface.cpp b/src/private/mx/core/AttributesInterface.cpp similarity index 100% rename from Sourcecode/private/mx/core/AttributesInterface.cpp rename to src/private/mx/core/AttributesInterface.cpp diff --git a/Sourcecode/private/mx/core/AttributesInterface.h b/src/private/mx/core/AttributesInterface.h similarity index 100% rename from Sourcecode/private/mx/core/AttributesInterface.h rename to src/private/mx/core/AttributesInterface.h diff --git a/Sourcecode/private/mx/core/Color.cpp b/src/private/mx/core/Color.cpp similarity index 100% rename from Sourcecode/private/mx/core/Color.cpp rename to src/private/mx/core/Color.cpp diff --git a/Sourcecode/private/mx/core/Color.h b/src/private/mx/core/Color.h similarity index 100% rename from Sourcecode/private/mx/core/Color.h rename to src/private/mx/core/Color.h diff --git a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp b/src/private/mx/core/CommaSeparatedPositiveIntegers.cpp similarity index 100% rename from Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp rename to src/private/mx/core/CommaSeparatedPositiveIntegers.cpp diff --git a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h b/src/private/mx/core/CommaSeparatedPositiveIntegers.h similarity index 100% rename from Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h rename to src/private/mx/core/CommaSeparatedPositiveIntegers.h diff --git a/Sourcecode/private/mx/core/CommaSeparatedText.cpp b/src/private/mx/core/CommaSeparatedText.cpp similarity index 100% rename from Sourcecode/private/mx/core/CommaSeparatedText.cpp rename to src/private/mx/core/CommaSeparatedText.cpp diff --git a/Sourcecode/private/mx/core/CommaSeparatedText.h b/src/private/mx/core/CommaSeparatedText.h similarity index 100% rename from Sourcecode/private/mx/core/CommaSeparatedText.h rename to src/private/mx/core/CommaSeparatedText.h diff --git a/Sourcecode/private/mx/core/Date.cpp b/src/private/mx/core/Date.cpp similarity index 100% rename from Sourcecode/private/mx/core/Date.cpp rename to src/private/mx/core/Date.cpp diff --git a/Sourcecode/private/mx/core/Date.h b/src/private/mx/core/Date.h similarity index 100% rename from Sourcecode/private/mx/core/Date.h rename to src/private/mx/core/Date.h diff --git a/Sourcecode/private/mx/core/Decimals.cpp b/src/private/mx/core/Decimals.cpp similarity index 100% rename from Sourcecode/private/mx/core/Decimals.cpp rename to src/private/mx/core/Decimals.cpp diff --git a/Sourcecode/private/mx/core/Decimals.h b/src/private/mx/core/Decimals.h similarity index 100% rename from Sourcecode/private/mx/core/Decimals.h rename to src/private/mx/core/Decimals.h diff --git a/Sourcecode/private/mx/core/Document.cpp b/src/private/mx/core/Document.cpp similarity index 100% rename from Sourcecode/private/mx/core/Document.cpp rename to src/private/mx/core/Document.cpp diff --git a/Sourcecode/private/mx/core/Document.h b/src/private/mx/core/Document.h similarity index 100% rename from Sourcecode/private/mx/core/Document.h rename to src/private/mx/core/Document.h diff --git a/Sourcecode/private/mx/core/DocumentHeader.cpp b/src/private/mx/core/DocumentHeader.cpp similarity index 100% rename from Sourcecode/private/mx/core/DocumentHeader.cpp rename to src/private/mx/core/DocumentHeader.cpp diff --git a/Sourcecode/private/mx/core/DocumentHeader.h b/src/private/mx/core/DocumentHeader.h similarity index 100% rename from Sourcecode/private/mx/core/DocumentHeader.h rename to src/private/mx/core/DocumentHeader.h diff --git a/Sourcecode/private/mx/core/DocumentSpec.cpp b/src/private/mx/core/DocumentSpec.cpp similarity index 100% rename from Sourcecode/private/mx/core/DocumentSpec.cpp rename to src/private/mx/core/DocumentSpec.cpp diff --git a/Sourcecode/private/mx/core/DocumentSpec.h b/src/private/mx/core/DocumentSpec.h similarity index 100% rename from Sourcecode/private/mx/core/DocumentSpec.h rename to src/private/mx/core/DocumentSpec.h diff --git a/Sourcecode/private/mx/core/ElementInterface.cpp b/src/private/mx/core/ElementInterface.cpp similarity index 100% rename from Sourcecode/private/mx/core/ElementInterface.cpp rename to src/private/mx/core/ElementInterface.cpp diff --git a/Sourcecode/private/mx/core/ElementInterface.h b/src/private/mx/core/ElementInterface.h similarity index 100% rename from Sourcecode/private/mx/core/ElementInterface.h rename to src/private/mx/core/ElementInterface.h diff --git a/Sourcecode/private/mx/core/Elements.h b/src/private/mx/core/Elements.h similarity index 100% rename from Sourcecode/private/mx/core/Elements.h rename to src/private/mx/core/Elements.h diff --git a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp b/src/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp rename to src/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp diff --git a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h b/src/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h rename to src/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h diff --git a/Sourcecode/private/mx/core/EndingNumber.h b/src/private/mx/core/EndingNumber.h similarity index 100% rename from Sourcecode/private/mx/core/EndingNumber.h rename to src/private/mx/core/EndingNumber.h diff --git a/Sourcecode/private/mx/core/Enums.cpp b/src/private/mx/core/Enums.cpp similarity index 100% rename from Sourcecode/private/mx/core/Enums.cpp rename to src/private/mx/core/Enums.cpp diff --git a/Sourcecode/private/mx/core/Enums.h b/src/private/mx/core/Enums.h similarity index 100% rename from Sourcecode/private/mx/core/Enums.h rename to src/private/mx/core/Enums.h diff --git a/Sourcecode/private/mx/core/EnumsBuiltin.cpp b/src/private/mx/core/EnumsBuiltin.cpp similarity index 100% rename from Sourcecode/private/mx/core/EnumsBuiltin.cpp rename to src/private/mx/core/EnumsBuiltin.cpp diff --git a/Sourcecode/private/mx/core/EnumsBuiltin.h b/src/private/mx/core/EnumsBuiltin.h similarity index 100% rename from Sourcecode/private/mx/core/EnumsBuiltin.h rename to src/private/mx/core/EnumsBuiltin.h diff --git a/Sourcecode/private/mx/core/FontSize.cpp b/src/private/mx/core/FontSize.cpp similarity index 100% rename from Sourcecode/private/mx/core/FontSize.cpp rename to src/private/mx/core/FontSize.cpp diff --git a/Sourcecode/private/mx/core/FontSize.h b/src/private/mx/core/FontSize.h similarity index 100% rename from Sourcecode/private/mx/core/FontSize.h rename to src/private/mx/core/FontSize.h diff --git a/Sourcecode/private/mx/core/ForwardDeclare.h b/src/private/mx/core/ForwardDeclare.h similarity index 100% rename from Sourcecode/private/mx/core/ForwardDeclare.h rename to src/private/mx/core/ForwardDeclare.h diff --git a/Sourcecode/private/mx/core/FromString.h b/src/private/mx/core/FromString.h similarity index 100% rename from Sourcecode/private/mx/core/FromString.h rename to src/private/mx/core/FromString.h diff --git a/Sourcecode/private/mx/core/FromXElement.cpp b/src/private/mx/core/FromXElement.cpp similarity index 100% rename from Sourcecode/private/mx/core/FromXElement.cpp rename to src/private/mx/core/FromXElement.cpp diff --git a/Sourcecode/private/mx/core/FromXElement.h b/src/private/mx/core/FromXElement.h similarity index 100% rename from Sourcecode/private/mx/core/FromXElement.h rename to src/private/mx/core/FromXElement.h diff --git a/Sourcecode/private/mx/core/Integers.cpp b/src/private/mx/core/Integers.cpp similarity index 100% rename from Sourcecode/private/mx/core/Integers.cpp rename to src/private/mx/core/Integers.cpp diff --git a/Sourcecode/private/mx/core/Integers.h b/src/private/mx/core/Integers.h similarity index 100% rename from Sourcecode/private/mx/core/Integers.h rename to src/private/mx/core/Integers.h diff --git a/Sourcecode/private/mx/core/NumberOrNormal.cpp b/src/private/mx/core/NumberOrNormal.cpp similarity index 100% rename from Sourcecode/private/mx/core/NumberOrNormal.cpp rename to src/private/mx/core/NumberOrNormal.cpp diff --git a/Sourcecode/private/mx/core/NumberOrNormal.h b/src/private/mx/core/NumberOrNormal.h similarity index 100% rename from Sourcecode/private/mx/core/NumberOrNormal.h rename to src/private/mx/core/NumberOrNormal.h diff --git a/Sourcecode/private/mx/core/PlaybackSound.h b/src/private/mx/core/PlaybackSound.h similarity index 100% rename from Sourcecode/private/mx/core/PlaybackSound.h rename to src/private/mx/core/PlaybackSound.h diff --git a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp b/src/private/mx/core/PositiveIntegerOrEmpty.cpp similarity index 100% rename from Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp rename to src/private/mx/core/PositiveIntegerOrEmpty.cpp diff --git a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h b/src/private/mx/core/PositiveIntegerOrEmpty.h similarity index 100% rename from Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h rename to src/private/mx/core/PositiveIntegerOrEmpty.h diff --git a/Sourcecode/private/mx/core/ProcessingInstruction.cpp b/src/private/mx/core/ProcessingInstruction.cpp similarity index 100% rename from Sourcecode/private/mx/core/ProcessingInstruction.cpp rename to src/private/mx/core/ProcessingInstruction.cpp diff --git a/Sourcecode/private/mx/core/ProcessingInstruction.h b/src/private/mx/core/ProcessingInstruction.h similarity index 100% rename from Sourcecode/private/mx/core/ProcessingInstruction.h rename to src/private/mx/core/ProcessingInstruction.h diff --git a/Sourcecode/private/mx/core/ScoreConversions.cpp b/src/private/mx/core/ScoreConversions.cpp similarity index 100% rename from Sourcecode/private/mx/core/ScoreConversions.cpp rename to src/private/mx/core/ScoreConversions.cpp diff --git a/Sourcecode/private/mx/core/ScoreConversions.h b/src/private/mx/core/ScoreConversions.h similarity index 100% rename from Sourcecode/private/mx/core/ScoreConversions.h rename to src/private/mx/core/ScoreConversions.h diff --git a/Sourcecode/private/mx/core/StringUtils.h b/src/private/mx/core/StringUtils.h similarity index 100% rename from Sourcecode/private/mx/core/StringUtils.h rename to src/private/mx/core/StringUtils.h diff --git a/Sourcecode/private/mx/core/TimeOnly.h b/src/private/mx/core/TimeOnly.h similarity index 100% rename from Sourcecode/private/mx/core/TimeOnly.h rename to src/private/mx/core/TimeOnly.h diff --git a/Sourcecode/private/mx/core/UnusedParameter.h b/src/private/mx/core/UnusedParameter.h similarity index 100% rename from Sourcecode/private/mx/core/UnusedParameter.h rename to src/private/mx/core/UnusedParameter.h diff --git a/Sourcecode/private/mx/core/XlinkHref.h b/src/private/mx/core/XlinkHref.h similarity index 100% rename from Sourcecode/private/mx/core/XlinkHref.h rename to src/private/mx/core/XlinkHref.h diff --git a/Sourcecode/private/mx/core/XlinkRole.h b/src/private/mx/core/XlinkRole.h similarity index 100% rename from Sourcecode/private/mx/core/XlinkRole.h rename to src/private/mx/core/XlinkRole.h diff --git a/Sourcecode/private/mx/core/XlinkTitle.h b/src/private/mx/core/XlinkTitle.h similarity index 100% rename from Sourcecode/private/mx/core/XlinkTitle.h rename to src/private/mx/core/XlinkTitle.h diff --git a/Sourcecode/private/mx/core/XmlLang.h b/src/private/mx/core/XmlLang.h similarity index 100% rename from Sourcecode/private/mx/core/XmlLang.h rename to src/private/mx/core/XmlLang.h diff --git a/Sourcecode/private/mx/core/XsAnyUri.h b/src/private/mx/core/XsAnyUri.h similarity index 100% rename from Sourcecode/private/mx/core/XsAnyUri.h rename to src/private/mx/core/XsAnyUri.h diff --git a/Sourcecode/private/mx/core/XsID.cpp b/src/private/mx/core/XsID.cpp similarity index 100% rename from Sourcecode/private/mx/core/XsID.cpp rename to src/private/mx/core/XsID.cpp diff --git a/Sourcecode/private/mx/core/XsID.h b/src/private/mx/core/XsID.h similarity index 100% rename from Sourcecode/private/mx/core/XsID.h rename to src/private/mx/core/XsID.h diff --git a/Sourcecode/private/mx/core/XsIDREF.h b/src/private/mx/core/XsIDREF.h similarity index 100% rename from Sourcecode/private/mx/core/XsIDREF.h rename to src/private/mx/core/XsIDREF.h diff --git a/Sourcecode/private/mx/core/XsNMToken.h b/src/private/mx/core/XsNMToken.h similarity index 100% rename from Sourcecode/private/mx/core/XsNMToken.h rename to src/private/mx/core/XsNMToken.h diff --git a/Sourcecode/private/mx/core/XsString.cpp b/src/private/mx/core/XsString.cpp similarity index 100% rename from Sourcecode/private/mx/core/XsString.cpp rename to src/private/mx/core/XsString.cpp diff --git a/Sourcecode/private/mx/core/XsString.h b/src/private/mx/core/XsString.h similarity index 100% rename from Sourcecode/private/mx/core/XsString.h rename to src/private/mx/core/XsString.h diff --git a/Sourcecode/private/mx/core/XsToken.cpp b/src/private/mx/core/XsToken.cpp similarity index 100% rename from Sourcecode/private/mx/core/XsToken.cpp rename to src/private/mx/core/XsToken.cpp diff --git a/Sourcecode/private/mx/core/XsToken.h b/src/private/mx/core/XsToken.h similarity index 100% rename from Sourcecode/private/mx/core/XsToken.h rename to src/private/mx/core/XsToken.h diff --git a/Sourcecode/private/mx/core/YesNoNumber.cpp b/src/private/mx/core/YesNoNumber.cpp similarity index 100% rename from Sourcecode/private/mx/core/YesNoNumber.cpp rename to src/private/mx/core/YesNoNumber.cpp diff --git a/Sourcecode/private/mx/core/YesNoNumber.h b/src/private/mx/core/YesNoNumber.h similarity index 100% rename from Sourcecode/private/mx/core/YesNoNumber.h rename to src/private/mx/core/YesNoNumber.h diff --git a/Sourcecode/private/mx/core/elements/Accent.cpp b/src/private/mx/core/elements/Accent.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Accent.cpp rename to src/private/mx/core/elements/Accent.cpp diff --git a/Sourcecode/private/mx/core/elements/Accent.h b/src/private/mx/core/elements/Accent.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Accent.h rename to src/private/mx/core/elements/Accent.h diff --git a/Sourcecode/private/mx/core/elements/Accidental.cpp b/src/private/mx/core/elements/Accidental.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Accidental.cpp rename to src/private/mx/core/elements/Accidental.cpp diff --git a/Sourcecode/private/mx/core/elements/Accidental.h b/src/private/mx/core/elements/Accidental.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Accidental.h rename to src/private/mx/core/elements/Accidental.h diff --git a/Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp b/src/private/mx/core/elements/AccidentalAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp rename to src/private/mx/core/elements/AccidentalAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/AccidentalAttributes.h b/src/private/mx/core/elements/AccidentalAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalAttributes.h rename to src/private/mx/core/elements/AccidentalAttributes.h diff --git a/Sourcecode/private/mx/core/elements/AccidentalMark.cpp b/src/private/mx/core/elements/AccidentalMark.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalMark.cpp rename to src/private/mx/core/elements/AccidentalMark.cpp diff --git a/Sourcecode/private/mx/core/elements/AccidentalMark.h b/src/private/mx/core/elements/AccidentalMark.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalMark.h rename to src/private/mx/core/elements/AccidentalMark.h diff --git a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp b/src/private/mx/core/elements/AccidentalMarkAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp rename to src/private/mx/core/elements/AccidentalMarkAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h b/src/private/mx/core/elements/AccidentalMarkAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h rename to src/private/mx/core/elements/AccidentalMarkAttributes.h diff --git a/Sourcecode/private/mx/core/elements/AccidentalText.cpp b/src/private/mx/core/elements/AccidentalText.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalText.cpp rename to src/private/mx/core/elements/AccidentalText.cpp diff --git a/Sourcecode/private/mx/core/elements/AccidentalText.h b/src/private/mx/core/elements/AccidentalText.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalText.h rename to src/private/mx/core/elements/AccidentalText.h diff --git a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp b/src/private/mx/core/elements/AccidentalTextAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp rename to src/private/mx/core/elements/AccidentalTextAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h b/src/private/mx/core/elements/AccidentalTextAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h rename to src/private/mx/core/elements/AccidentalTextAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Accord.cpp b/src/private/mx/core/elements/Accord.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Accord.cpp rename to src/private/mx/core/elements/Accord.cpp diff --git a/Sourcecode/private/mx/core/elements/Accord.h b/src/private/mx/core/elements/Accord.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Accord.h rename to src/private/mx/core/elements/Accord.h diff --git a/Sourcecode/private/mx/core/elements/AccordAttributes.cpp b/src/private/mx/core/elements/AccordAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordAttributes.cpp rename to src/private/mx/core/elements/AccordAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/AccordAttributes.h b/src/private/mx/core/elements/AccordAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordAttributes.h rename to src/private/mx/core/elements/AccordAttributes.h diff --git a/Sourcecode/private/mx/core/elements/AccordionHigh.cpp b/src/private/mx/core/elements/AccordionHigh.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionHigh.cpp rename to src/private/mx/core/elements/AccordionHigh.cpp diff --git a/Sourcecode/private/mx/core/elements/AccordionHigh.h b/src/private/mx/core/elements/AccordionHigh.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionHigh.h rename to src/private/mx/core/elements/AccordionHigh.h diff --git a/Sourcecode/private/mx/core/elements/AccordionLow.cpp b/src/private/mx/core/elements/AccordionLow.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionLow.cpp rename to src/private/mx/core/elements/AccordionLow.cpp diff --git a/Sourcecode/private/mx/core/elements/AccordionLow.h b/src/private/mx/core/elements/AccordionLow.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionLow.h rename to src/private/mx/core/elements/AccordionLow.h diff --git a/Sourcecode/private/mx/core/elements/AccordionMiddle.cpp b/src/private/mx/core/elements/AccordionMiddle.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionMiddle.cpp rename to src/private/mx/core/elements/AccordionMiddle.cpp diff --git a/Sourcecode/private/mx/core/elements/AccordionMiddle.h b/src/private/mx/core/elements/AccordionMiddle.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionMiddle.h rename to src/private/mx/core/elements/AccordionMiddle.h diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistration.cpp b/src/private/mx/core/elements/AccordionRegistration.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionRegistration.cpp rename to src/private/mx/core/elements/AccordionRegistration.cpp diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistration.h b/src/private/mx/core/elements/AccordionRegistration.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionRegistration.h rename to src/private/mx/core/elements/AccordionRegistration.h diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp b/src/private/mx/core/elements/AccordionRegistrationAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp rename to src/private/mx/core/elements/AccordionRegistrationAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h b/src/private/mx/core/elements/AccordionRegistrationAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h rename to src/private/mx/core/elements/AccordionRegistrationAttributes.h diff --git a/Sourcecode/private/mx/core/elements/ActualNotes.cpp b/src/private/mx/core/elements/ActualNotes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ActualNotes.cpp rename to src/private/mx/core/elements/ActualNotes.cpp diff --git a/Sourcecode/private/mx/core/elements/ActualNotes.h b/src/private/mx/core/elements/ActualNotes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ActualNotes.h rename to src/private/mx/core/elements/ActualNotes.h diff --git a/Sourcecode/private/mx/core/elements/Alter.cpp b/src/private/mx/core/elements/Alter.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Alter.cpp rename to src/private/mx/core/elements/Alter.cpp diff --git a/Sourcecode/private/mx/core/elements/Alter.h b/src/private/mx/core/elements/Alter.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Alter.h rename to src/private/mx/core/elements/Alter.h diff --git a/Sourcecode/private/mx/core/elements/Appearance.cpp b/src/private/mx/core/elements/Appearance.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Appearance.cpp rename to src/private/mx/core/elements/Appearance.cpp diff --git a/Sourcecode/private/mx/core/elements/Appearance.h b/src/private/mx/core/elements/Appearance.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Appearance.h rename to src/private/mx/core/elements/Appearance.h diff --git a/Sourcecode/private/mx/core/elements/Arpeggiate.cpp b/src/private/mx/core/elements/Arpeggiate.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Arpeggiate.cpp rename to src/private/mx/core/elements/Arpeggiate.cpp diff --git a/Sourcecode/private/mx/core/elements/Arpeggiate.h b/src/private/mx/core/elements/Arpeggiate.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Arpeggiate.h rename to src/private/mx/core/elements/Arpeggiate.h diff --git a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp b/src/private/mx/core/elements/ArpeggiateAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp rename to src/private/mx/core/elements/ArpeggiateAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h b/src/private/mx/core/elements/ArpeggiateAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h rename to src/private/mx/core/elements/ArpeggiateAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Arrow.cpp b/src/private/mx/core/elements/Arrow.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Arrow.cpp rename to src/private/mx/core/elements/Arrow.cpp diff --git a/Sourcecode/private/mx/core/elements/Arrow.h b/src/private/mx/core/elements/Arrow.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Arrow.h rename to src/private/mx/core/elements/Arrow.h diff --git a/Sourcecode/private/mx/core/elements/ArrowAttributes.cpp b/src/private/mx/core/elements/ArrowAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ArrowAttributes.cpp rename to src/private/mx/core/elements/ArrowAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ArrowAttributes.h b/src/private/mx/core/elements/ArrowAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ArrowAttributes.h rename to src/private/mx/core/elements/ArrowAttributes.h diff --git a/Sourcecode/private/mx/core/elements/ArrowDirection.cpp b/src/private/mx/core/elements/ArrowDirection.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ArrowDirection.cpp rename to src/private/mx/core/elements/ArrowDirection.cpp diff --git a/Sourcecode/private/mx/core/elements/ArrowDirection.h b/src/private/mx/core/elements/ArrowDirection.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ArrowDirection.h rename to src/private/mx/core/elements/ArrowDirection.h diff --git a/Sourcecode/private/mx/core/elements/ArrowGroup.cpp b/src/private/mx/core/elements/ArrowGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ArrowGroup.cpp rename to src/private/mx/core/elements/ArrowGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/ArrowGroup.h b/src/private/mx/core/elements/ArrowGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ArrowGroup.h rename to src/private/mx/core/elements/ArrowGroup.h diff --git a/Sourcecode/private/mx/core/elements/ArrowStyle.cpp b/src/private/mx/core/elements/ArrowStyle.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ArrowStyle.cpp rename to src/private/mx/core/elements/ArrowStyle.cpp diff --git a/Sourcecode/private/mx/core/elements/ArrowStyle.h b/src/private/mx/core/elements/ArrowStyle.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ArrowStyle.h rename to src/private/mx/core/elements/ArrowStyle.h diff --git a/Sourcecode/private/mx/core/elements/Articulations.cpp b/src/private/mx/core/elements/Articulations.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Articulations.cpp rename to src/private/mx/core/elements/Articulations.cpp diff --git a/Sourcecode/private/mx/core/elements/Articulations.h b/src/private/mx/core/elements/Articulations.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Articulations.h rename to src/private/mx/core/elements/Articulations.h diff --git a/Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp b/src/private/mx/core/elements/ArticulationsChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp rename to src/private/mx/core/elements/ArticulationsChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/ArticulationsChoice.h b/src/private/mx/core/elements/ArticulationsChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ArticulationsChoice.h rename to src/private/mx/core/elements/ArticulationsChoice.h diff --git a/Sourcecode/private/mx/core/elements/Artificial.cpp b/src/private/mx/core/elements/Artificial.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Artificial.cpp rename to src/private/mx/core/elements/Artificial.cpp diff --git a/Sourcecode/private/mx/core/elements/Artificial.h b/src/private/mx/core/elements/Artificial.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Artificial.h rename to src/private/mx/core/elements/Artificial.h diff --git a/Sourcecode/private/mx/core/elements/AttributesIterface.h b/src/private/mx/core/elements/AttributesIterface.h similarity index 100% rename from Sourcecode/private/mx/core/elements/AttributesIterface.h rename to src/private/mx/core/elements/AttributesIterface.h diff --git a/Sourcecode/private/mx/core/elements/Backup.cpp b/src/private/mx/core/elements/Backup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Backup.cpp rename to src/private/mx/core/elements/Backup.cpp diff --git a/Sourcecode/private/mx/core/elements/Backup.h b/src/private/mx/core/elements/Backup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Backup.h rename to src/private/mx/core/elements/Backup.h diff --git a/Sourcecode/private/mx/core/elements/BarStyle.cpp b/src/private/mx/core/elements/BarStyle.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BarStyle.cpp rename to src/private/mx/core/elements/BarStyle.cpp diff --git a/Sourcecode/private/mx/core/elements/BarStyle.h b/src/private/mx/core/elements/BarStyle.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BarStyle.h rename to src/private/mx/core/elements/BarStyle.h diff --git a/Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp b/src/private/mx/core/elements/BarStyleAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp rename to src/private/mx/core/elements/BarStyleAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BarStyleAttributes.h b/src/private/mx/core/elements/BarStyleAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BarStyleAttributes.h rename to src/private/mx/core/elements/BarStyleAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Barline.cpp b/src/private/mx/core/elements/Barline.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Barline.cpp rename to src/private/mx/core/elements/Barline.cpp diff --git a/Sourcecode/private/mx/core/elements/Barline.h b/src/private/mx/core/elements/Barline.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Barline.h rename to src/private/mx/core/elements/Barline.h diff --git a/Sourcecode/private/mx/core/elements/BarlineAttributes.cpp b/src/private/mx/core/elements/BarlineAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BarlineAttributes.cpp rename to src/private/mx/core/elements/BarlineAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BarlineAttributes.h b/src/private/mx/core/elements/BarlineAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BarlineAttributes.h rename to src/private/mx/core/elements/BarlineAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Barre.cpp b/src/private/mx/core/elements/Barre.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Barre.cpp rename to src/private/mx/core/elements/Barre.cpp diff --git a/Sourcecode/private/mx/core/elements/Barre.h b/src/private/mx/core/elements/Barre.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Barre.h rename to src/private/mx/core/elements/Barre.h diff --git a/Sourcecode/private/mx/core/elements/BarreAttributes.cpp b/src/private/mx/core/elements/BarreAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BarreAttributes.cpp rename to src/private/mx/core/elements/BarreAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BarreAttributes.h b/src/private/mx/core/elements/BarreAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BarreAttributes.h rename to src/private/mx/core/elements/BarreAttributes.h diff --git a/Sourcecode/private/mx/core/elements/BasePitch.cpp b/src/private/mx/core/elements/BasePitch.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BasePitch.cpp rename to src/private/mx/core/elements/BasePitch.cpp diff --git a/Sourcecode/private/mx/core/elements/BasePitch.h b/src/private/mx/core/elements/BasePitch.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BasePitch.h rename to src/private/mx/core/elements/BasePitch.h diff --git a/Sourcecode/private/mx/core/elements/Bass.cpp b/src/private/mx/core/elements/Bass.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Bass.cpp rename to src/private/mx/core/elements/Bass.cpp diff --git a/Sourcecode/private/mx/core/elements/Bass.h b/src/private/mx/core/elements/Bass.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Bass.h rename to src/private/mx/core/elements/Bass.h diff --git a/Sourcecode/private/mx/core/elements/BassAlter.cpp b/src/private/mx/core/elements/BassAlter.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BassAlter.cpp rename to src/private/mx/core/elements/BassAlter.cpp diff --git a/Sourcecode/private/mx/core/elements/BassAlter.h b/src/private/mx/core/elements/BassAlter.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BassAlter.h rename to src/private/mx/core/elements/BassAlter.h diff --git a/Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp b/src/private/mx/core/elements/BassAlterAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp rename to src/private/mx/core/elements/BassAlterAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BassAlterAttributes.h b/src/private/mx/core/elements/BassAlterAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BassAlterAttributes.h rename to src/private/mx/core/elements/BassAlterAttributes.h diff --git a/Sourcecode/private/mx/core/elements/BassStep.cpp b/src/private/mx/core/elements/BassStep.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BassStep.cpp rename to src/private/mx/core/elements/BassStep.cpp diff --git a/Sourcecode/private/mx/core/elements/BassStep.h b/src/private/mx/core/elements/BassStep.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BassStep.h rename to src/private/mx/core/elements/BassStep.h diff --git a/Sourcecode/private/mx/core/elements/BassStepAttributes.cpp b/src/private/mx/core/elements/BassStepAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BassStepAttributes.cpp rename to src/private/mx/core/elements/BassStepAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BassStepAttributes.h b/src/private/mx/core/elements/BassStepAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BassStepAttributes.h rename to src/private/mx/core/elements/BassStepAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Beam.cpp b/src/private/mx/core/elements/Beam.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Beam.cpp rename to src/private/mx/core/elements/Beam.cpp diff --git a/Sourcecode/private/mx/core/elements/Beam.h b/src/private/mx/core/elements/Beam.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Beam.h rename to src/private/mx/core/elements/Beam.h diff --git a/Sourcecode/private/mx/core/elements/BeamAttributes.cpp b/src/private/mx/core/elements/BeamAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeamAttributes.cpp rename to src/private/mx/core/elements/BeamAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BeamAttributes.h b/src/private/mx/core/elements/BeamAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeamAttributes.h rename to src/private/mx/core/elements/BeamAttributes.h diff --git a/Sourcecode/private/mx/core/elements/BeatRepeat.cpp b/src/private/mx/core/elements/BeatRepeat.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatRepeat.cpp rename to src/private/mx/core/elements/BeatRepeat.cpp diff --git a/Sourcecode/private/mx/core/elements/BeatRepeat.h b/src/private/mx/core/elements/BeatRepeat.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatRepeat.h rename to src/private/mx/core/elements/BeatRepeat.h diff --git a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp b/src/private/mx/core/elements/BeatRepeatAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp rename to src/private/mx/core/elements/BeatRepeatAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h b/src/private/mx/core/elements/BeatRepeatAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h rename to src/private/mx/core/elements/BeatRepeatAttributes.h diff --git a/Sourcecode/private/mx/core/elements/BeatType.cpp b/src/private/mx/core/elements/BeatType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatType.cpp rename to src/private/mx/core/elements/BeatType.cpp diff --git a/Sourcecode/private/mx/core/elements/BeatType.h b/src/private/mx/core/elements/BeatType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatType.h rename to src/private/mx/core/elements/BeatType.h diff --git a/Sourcecode/private/mx/core/elements/BeatUnit.cpp b/src/private/mx/core/elements/BeatUnit.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnit.cpp rename to src/private/mx/core/elements/BeatUnit.cpp diff --git a/Sourcecode/private/mx/core/elements/BeatUnit.h b/src/private/mx/core/elements/BeatUnit.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnit.h rename to src/private/mx/core/elements/BeatUnit.h diff --git a/Sourcecode/private/mx/core/elements/BeatUnitDot.cpp b/src/private/mx/core/elements/BeatUnitDot.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnitDot.cpp rename to src/private/mx/core/elements/BeatUnitDot.cpp diff --git a/Sourcecode/private/mx/core/elements/BeatUnitDot.h b/src/private/mx/core/elements/BeatUnitDot.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnitDot.h rename to src/private/mx/core/elements/BeatUnitDot.h diff --git a/Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp b/src/private/mx/core/elements/BeatUnitGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp rename to src/private/mx/core/elements/BeatUnitGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/BeatUnitGroup.h b/src/private/mx/core/elements/BeatUnitGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnitGroup.h rename to src/private/mx/core/elements/BeatUnitGroup.h diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPer.cpp b/src/private/mx/core/elements/BeatUnitPer.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnitPer.cpp rename to src/private/mx/core/elements/BeatUnitPer.cpp diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPer.h b/src/private/mx/core/elements/BeatUnitPer.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnitPer.h rename to src/private/mx/core/elements/BeatUnitPer.h diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp b/src/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp rename to src/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h b/src/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h rename to src/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h diff --git a/Sourcecode/private/mx/core/elements/Beater.cpp b/src/private/mx/core/elements/Beater.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Beater.cpp rename to src/private/mx/core/elements/Beater.cpp diff --git a/Sourcecode/private/mx/core/elements/Beater.h b/src/private/mx/core/elements/Beater.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Beater.h rename to src/private/mx/core/elements/Beater.h diff --git a/Sourcecode/private/mx/core/elements/BeaterAttributes.cpp b/src/private/mx/core/elements/BeaterAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BeaterAttributes.cpp rename to src/private/mx/core/elements/BeaterAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BeaterAttributes.h b/src/private/mx/core/elements/BeaterAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BeaterAttributes.h rename to src/private/mx/core/elements/BeaterAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Beats.cpp b/src/private/mx/core/elements/Beats.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Beats.cpp rename to src/private/mx/core/elements/Beats.cpp diff --git a/Sourcecode/private/mx/core/elements/Beats.h b/src/private/mx/core/elements/Beats.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Beats.h rename to src/private/mx/core/elements/Beats.h diff --git a/Sourcecode/private/mx/core/elements/Bend.cpp b/src/private/mx/core/elements/Bend.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Bend.cpp rename to src/private/mx/core/elements/Bend.cpp diff --git a/Sourcecode/private/mx/core/elements/Bend.h b/src/private/mx/core/elements/Bend.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Bend.h rename to src/private/mx/core/elements/Bend.h diff --git a/Sourcecode/private/mx/core/elements/BendAlter.cpp b/src/private/mx/core/elements/BendAlter.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BendAlter.cpp rename to src/private/mx/core/elements/BendAlter.cpp diff --git a/Sourcecode/private/mx/core/elements/BendAlter.h b/src/private/mx/core/elements/BendAlter.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BendAlter.h rename to src/private/mx/core/elements/BendAlter.h diff --git a/Sourcecode/private/mx/core/elements/BendAttributes.cpp b/src/private/mx/core/elements/BendAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BendAttributes.cpp rename to src/private/mx/core/elements/BendAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BendAttributes.h b/src/private/mx/core/elements/BendAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BendAttributes.h rename to src/private/mx/core/elements/BendAttributes.h diff --git a/Sourcecode/private/mx/core/elements/BendChoice.cpp b/src/private/mx/core/elements/BendChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BendChoice.cpp rename to src/private/mx/core/elements/BendChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/BendChoice.h b/src/private/mx/core/elements/BendChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BendChoice.h rename to src/private/mx/core/elements/BendChoice.h diff --git a/Sourcecode/private/mx/core/elements/Bookmark.cpp b/src/private/mx/core/elements/Bookmark.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Bookmark.cpp rename to src/private/mx/core/elements/Bookmark.cpp diff --git a/Sourcecode/private/mx/core/elements/Bookmark.h b/src/private/mx/core/elements/Bookmark.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Bookmark.h rename to src/private/mx/core/elements/Bookmark.h diff --git a/Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp b/src/private/mx/core/elements/BookmarkAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp rename to src/private/mx/core/elements/BookmarkAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BookmarkAttributes.h b/src/private/mx/core/elements/BookmarkAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BookmarkAttributes.h rename to src/private/mx/core/elements/BookmarkAttributes.h diff --git a/Sourcecode/private/mx/core/elements/BottomMargin.cpp b/src/private/mx/core/elements/BottomMargin.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BottomMargin.cpp rename to src/private/mx/core/elements/BottomMargin.cpp diff --git a/Sourcecode/private/mx/core/elements/BottomMargin.h b/src/private/mx/core/elements/BottomMargin.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BottomMargin.h rename to src/private/mx/core/elements/BottomMargin.h diff --git a/Sourcecode/private/mx/core/elements/Bracket.cpp b/src/private/mx/core/elements/Bracket.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Bracket.cpp rename to src/private/mx/core/elements/Bracket.cpp diff --git a/Sourcecode/private/mx/core/elements/Bracket.h b/src/private/mx/core/elements/Bracket.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Bracket.h rename to src/private/mx/core/elements/Bracket.h diff --git a/Sourcecode/private/mx/core/elements/BracketAttributes.cpp b/src/private/mx/core/elements/BracketAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BracketAttributes.cpp rename to src/private/mx/core/elements/BracketAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BracketAttributes.h b/src/private/mx/core/elements/BracketAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BracketAttributes.h rename to src/private/mx/core/elements/BracketAttributes.h diff --git a/Sourcecode/private/mx/core/elements/BreathMark.cpp b/src/private/mx/core/elements/BreathMark.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BreathMark.cpp rename to src/private/mx/core/elements/BreathMark.cpp diff --git a/Sourcecode/private/mx/core/elements/BreathMark.h b/src/private/mx/core/elements/BreathMark.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BreathMark.h rename to src/private/mx/core/elements/BreathMark.h diff --git a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp b/src/private/mx/core/elements/BreathMarkAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp rename to src/private/mx/core/elements/BreathMarkAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.h b/src/private/mx/core/elements/BreathMarkAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/BreathMarkAttributes.h rename to src/private/mx/core/elements/BreathMarkAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Caesura.cpp b/src/private/mx/core/elements/Caesura.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Caesura.cpp rename to src/private/mx/core/elements/Caesura.cpp diff --git a/Sourcecode/private/mx/core/elements/Caesura.h b/src/private/mx/core/elements/Caesura.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Caesura.h rename to src/private/mx/core/elements/Caesura.h diff --git a/Sourcecode/private/mx/core/elements/Cancel.cpp b/src/private/mx/core/elements/Cancel.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Cancel.cpp rename to src/private/mx/core/elements/Cancel.cpp diff --git a/Sourcecode/private/mx/core/elements/Cancel.h b/src/private/mx/core/elements/Cancel.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Cancel.h rename to src/private/mx/core/elements/Cancel.h diff --git a/Sourcecode/private/mx/core/elements/CancelAttributes.cpp b/src/private/mx/core/elements/CancelAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CancelAttributes.cpp rename to src/private/mx/core/elements/CancelAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/CancelAttributes.h b/src/private/mx/core/elements/CancelAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CancelAttributes.h rename to src/private/mx/core/elements/CancelAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Capo.cpp b/src/private/mx/core/elements/Capo.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Capo.cpp rename to src/private/mx/core/elements/Capo.cpp diff --git a/Sourcecode/private/mx/core/elements/Capo.h b/src/private/mx/core/elements/Capo.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Capo.h rename to src/private/mx/core/elements/Capo.h diff --git a/Sourcecode/private/mx/core/elements/Chord.cpp b/src/private/mx/core/elements/Chord.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Chord.cpp rename to src/private/mx/core/elements/Chord.cpp diff --git a/Sourcecode/private/mx/core/elements/Chord.h b/src/private/mx/core/elements/Chord.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Chord.h rename to src/private/mx/core/elements/Chord.h diff --git a/Sourcecode/private/mx/core/elements/Chromatic.cpp b/src/private/mx/core/elements/Chromatic.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Chromatic.cpp rename to src/private/mx/core/elements/Chromatic.cpp diff --git a/Sourcecode/private/mx/core/elements/Chromatic.h b/src/private/mx/core/elements/Chromatic.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Chromatic.h rename to src/private/mx/core/elements/Chromatic.h diff --git a/Sourcecode/private/mx/core/elements/CircularArrow.cpp b/src/private/mx/core/elements/CircularArrow.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CircularArrow.cpp rename to src/private/mx/core/elements/CircularArrow.cpp diff --git a/Sourcecode/private/mx/core/elements/CircularArrow.h b/src/private/mx/core/elements/CircularArrow.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CircularArrow.h rename to src/private/mx/core/elements/CircularArrow.h diff --git a/Sourcecode/private/mx/core/elements/Clef.cpp b/src/private/mx/core/elements/Clef.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Clef.cpp rename to src/private/mx/core/elements/Clef.cpp diff --git a/Sourcecode/private/mx/core/elements/Clef.h b/src/private/mx/core/elements/Clef.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Clef.h rename to src/private/mx/core/elements/Clef.h diff --git a/Sourcecode/private/mx/core/elements/ClefAttributes.cpp b/src/private/mx/core/elements/ClefAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ClefAttributes.cpp rename to src/private/mx/core/elements/ClefAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ClefAttributes.h b/src/private/mx/core/elements/ClefAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ClefAttributes.h rename to src/private/mx/core/elements/ClefAttributes.h diff --git a/Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp b/src/private/mx/core/elements/ClefOctaveChange.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp rename to src/private/mx/core/elements/ClefOctaveChange.cpp diff --git a/Sourcecode/private/mx/core/elements/ClefOctaveChange.h b/src/private/mx/core/elements/ClefOctaveChange.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ClefOctaveChange.h rename to src/private/mx/core/elements/ClefOctaveChange.h diff --git a/Sourcecode/private/mx/core/elements/Coda.cpp b/src/private/mx/core/elements/Coda.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Coda.cpp rename to src/private/mx/core/elements/Coda.cpp diff --git a/Sourcecode/private/mx/core/elements/Coda.h b/src/private/mx/core/elements/Coda.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Coda.h rename to src/private/mx/core/elements/Coda.h diff --git a/Sourcecode/private/mx/core/elements/Creator.cpp b/src/private/mx/core/elements/Creator.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Creator.cpp rename to src/private/mx/core/elements/Creator.cpp diff --git a/Sourcecode/private/mx/core/elements/Creator.h b/src/private/mx/core/elements/Creator.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Creator.h rename to src/private/mx/core/elements/Creator.h diff --git a/Sourcecode/private/mx/core/elements/CreatorAttributes.cpp b/src/private/mx/core/elements/CreatorAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreatorAttributes.cpp rename to src/private/mx/core/elements/CreatorAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/CreatorAttributes.h b/src/private/mx/core/elements/CreatorAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreatorAttributes.h rename to src/private/mx/core/elements/CreatorAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Credit.cpp b/src/private/mx/core/elements/Credit.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Credit.cpp rename to src/private/mx/core/elements/Credit.cpp diff --git a/Sourcecode/private/mx/core/elements/Credit.h b/src/private/mx/core/elements/Credit.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Credit.h rename to src/private/mx/core/elements/Credit.h diff --git a/Sourcecode/private/mx/core/elements/CreditAttributes.cpp b/src/private/mx/core/elements/CreditAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditAttributes.cpp rename to src/private/mx/core/elements/CreditAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/CreditAttributes.h b/src/private/mx/core/elements/CreditAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditAttributes.h rename to src/private/mx/core/elements/CreditAttributes.h diff --git a/Sourcecode/private/mx/core/elements/CreditChoice.cpp b/src/private/mx/core/elements/CreditChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditChoice.cpp rename to src/private/mx/core/elements/CreditChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/CreditChoice.h b/src/private/mx/core/elements/CreditChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditChoice.h rename to src/private/mx/core/elements/CreditChoice.h diff --git a/Sourcecode/private/mx/core/elements/CreditImage.cpp b/src/private/mx/core/elements/CreditImage.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditImage.cpp rename to src/private/mx/core/elements/CreditImage.cpp diff --git a/Sourcecode/private/mx/core/elements/CreditImage.h b/src/private/mx/core/elements/CreditImage.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditImage.h rename to src/private/mx/core/elements/CreditImage.h diff --git a/Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp b/src/private/mx/core/elements/CreditImageAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp rename to src/private/mx/core/elements/CreditImageAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/CreditImageAttributes.h b/src/private/mx/core/elements/CreditImageAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditImageAttributes.h rename to src/private/mx/core/elements/CreditImageAttributes.h diff --git a/Sourcecode/private/mx/core/elements/CreditType.cpp b/src/private/mx/core/elements/CreditType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditType.cpp rename to src/private/mx/core/elements/CreditType.cpp diff --git a/Sourcecode/private/mx/core/elements/CreditType.h b/src/private/mx/core/elements/CreditType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditType.h rename to src/private/mx/core/elements/CreditType.h diff --git a/Sourcecode/private/mx/core/elements/CreditWords.cpp b/src/private/mx/core/elements/CreditWords.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditWords.cpp rename to src/private/mx/core/elements/CreditWords.cpp diff --git a/Sourcecode/private/mx/core/elements/CreditWords.h b/src/private/mx/core/elements/CreditWords.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditWords.h rename to src/private/mx/core/elements/CreditWords.h diff --git a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp b/src/private/mx/core/elements/CreditWordsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp rename to src/private/mx/core/elements/CreditWordsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.h b/src/private/mx/core/elements/CreditWordsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditWordsAttributes.h rename to src/private/mx/core/elements/CreditWordsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp b/src/private/mx/core/elements/CreditWordsGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp rename to src/private/mx/core/elements/CreditWordsGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/CreditWordsGroup.h b/src/private/mx/core/elements/CreditWordsGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CreditWordsGroup.h rename to src/private/mx/core/elements/CreditWordsGroup.h diff --git a/Sourcecode/private/mx/core/elements/Cue.cpp b/src/private/mx/core/elements/Cue.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Cue.cpp rename to src/private/mx/core/elements/Cue.cpp diff --git a/Sourcecode/private/mx/core/elements/Cue.h b/src/private/mx/core/elements/Cue.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Cue.h rename to src/private/mx/core/elements/Cue.h diff --git a/Sourcecode/private/mx/core/elements/CueNoteGroup.cpp b/src/private/mx/core/elements/CueNoteGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/CueNoteGroup.cpp rename to src/private/mx/core/elements/CueNoteGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/CueNoteGroup.h b/src/private/mx/core/elements/CueNoteGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/CueNoteGroup.h rename to src/private/mx/core/elements/CueNoteGroup.h diff --git a/Sourcecode/private/mx/core/elements/Damp.cpp b/src/private/mx/core/elements/Damp.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Damp.cpp rename to src/private/mx/core/elements/Damp.cpp diff --git a/Sourcecode/private/mx/core/elements/Damp.h b/src/private/mx/core/elements/Damp.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Damp.h rename to src/private/mx/core/elements/Damp.h diff --git a/Sourcecode/private/mx/core/elements/DampAll.cpp b/src/private/mx/core/elements/DampAll.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DampAll.cpp rename to src/private/mx/core/elements/DampAll.cpp diff --git a/Sourcecode/private/mx/core/elements/DampAll.h b/src/private/mx/core/elements/DampAll.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DampAll.h rename to src/private/mx/core/elements/DampAll.h diff --git a/Sourcecode/private/mx/core/elements/Dashes.cpp b/src/private/mx/core/elements/Dashes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Dashes.cpp rename to src/private/mx/core/elements/Dashes.cpp diff --git a/Sourcecode/private/mx/core/elements/Dashes.h b/src/private/mx/core/elements/Dashes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Dashes.h rename to src/private/mx/core/elements/Dashes.h diff --git a/Sourcecode/private/mx/core/elements/DashesAttributes.cpp b/src/private/mx/core/elements/DashesAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DashesAttributes.cpp rename to src/private/mx/core/elements/DashesAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DashesAttributes.h b/src/private/mx/core/elements/DashesAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DashesAttributes.h rename to src/private/mx/core/elements/DashesAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Defaults.cpp b/src/private/mx/core/elements/Defaults.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Defaults.cpp rename to src/private/mx/core/elements/Defaults.cpp diff --git a/Sourcecode/private/mx/core/elements/Defaults.h b/src/private/mx/core/elements/Defaults.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Defaults.h rename to src/private/mx/core/elements/Defaults.h diff --git a/Sourcecode/private/mx/core/elements/Degree.cpp b/src/private/mx/core/elements/Degree.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Degree.cpp rename to src/private/mx/core/elements/Degree.cpp diff --git a/Sourcecode/private/mx/core/elements/Degree.h b/src/private/mx/core/elements/Degree.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Degree.h rename to src/private/mx/core/elements/Degree.h diff --git a/Sourcecode/private/mx/core/elements/DegreeAlter.cpp b/src/private/mx/core/elements/DegreeAlter.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeAlter.cpp rename to src/private/mx/core/elements/DegreeAlter.cpp diff --git a/Sourcecode/private/mx/core/elements/DegreeAlter.h b/src/private/mx/core/elements/DegreeAlter.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeAlter.h rename to src/private/mx/core/elements/DegreeAlter.h diff --git a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp b/src/private/mx/core/elements/DegreeAlterAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp rename to src/private/mx/core/elements/DegreeAlterAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h b/src/private/mx/core/elements/DegreeAlterAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h rename to src/private/mx/core/elements/DegreeAlterAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DegreeAttributes.cpp b/src/private/mx/core/elements/DegreeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeAttributes.cpp rename to src/private/mx/core/elements/DegreeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DegreeAttributes.h b/src/private/mx/core/elements/DegreeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeAttributes.h rename to src/private/mx/core/elements/DegreeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DegreeType.cpp b/src/private/mx/core/elements/DegreeType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeType.cpp rename to src/private/mx/core/elements/DegreeType.cpp diff --git a/Sourcecode/private/mx/core/elements/DegreeType.h b/src/private/mx/core/elements/DegreeType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeType.h rename to src/private/mx/core/elements/DegreeType.h diff --git a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp b/src/private/mx/core/elements/DegreeTypeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp rename to src/private/mx/core/elements/DegreeTypeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h b/src/private/mx/core/elements/DegreeTypeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h rename to src/private/mx/core/elements/DegreeTypeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DegreeValue.cpp b/src/private/mx/core/elements/DegreeValue.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeValue.cpp rename to src/private/mx/core/elements/DegreeValue.cpp diff --git a/Sourcecode/private/mx/core/elements/DegreeValue.h b/src/private/mx/core/elements/DegreeValue.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeValue.h rename to src/private/mx/core/elements/DegreeValue.h diff --git a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp b/src/private/mx/core/elements/DegreeValueAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp rename to src/private/mx/core/elements/DegreeValueAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.h b/src/private/mx/core/elements/DegreeValueAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DegreeValueAttributes.h rename to src/private/mx/core/elements/DegreeValueAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp b/src/private/mx/core/elements/DelayedInvertedTurn.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp rename to src/private/mx/core/elements/DelayedInvertedTurn.cpp diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h b/src/private/mx/core/elements/DelayedInvertedTurn.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h rename to src/private/mx/core/elements/DelayedInvertedTurn.h diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp b/src/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp rename to src/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h b/src/private/mx/core/elements/DelayedInvertedTurnAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h rename to src/private/mx/core/elements/DelayedInvertedTurnAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DelayedTurn.cpp b/src/private/mx/core/elements/DelayedTurn.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DelayedTurn.cpp rename to src/private/mx/core/elements/DelayedTurn.cpp diff --git a/Sourcecode/private/mx/core/elements/DelayedTurn.h b/src/private/mx/core/elements/DelayedTurn.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DelayedTurn.h rename to src/private/mx/core/elements/DelayedTurn.h diff --git a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp b/src/private/mx/core/elements/DelayedTurnAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp rename to src/private/mx/core/elements/DelayedTurnAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h b/src/private/mx/core/elements/DelayedTurnAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h rename to src/private/mx/core/elements/DelayedTurnAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DetachedLegato.cpp b/src/private/mx/core/elements/DetachedLegato.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DetachedLegato.cpp rename to src/private/mx/core/elements/DetachedLegato.cpp diff --git a/Sourcecode/private/mx/core/elements/DetachedLegato.h b/src/private/mx/core/elements/DetachedLegato.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DetachedLegato.h rename to src/private/mx/core/elements/DetachedLegato.h diff --git a/Sourcecode/private/mx/core/elements/Diatonic.cpp b/src/private/mx/core/elements/Diatonic.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Diatonic.cpp rename to src/private/mx/core/elements/Diatonic.cpp diff --git a/Sourcecode/private/mx/core/elements/Diatonic.h b/src/private/mx/core/elements/Diatonic.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Diatonic.h rename to src/private/mx/core/elements/Diatonic.h diff --git a/Sourcecode/private/mx/core/elements/Direction.cpp b/src/private/mx/core/elements/Direction.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Direction.cpp rename to src/private/mx/core/elements/Direction.cpp diff --git a/Sourcecode/private/mx/core/elements/Direction.h b/src/private/mx/core/elements/Direction.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Direction.h rename to src/private/mx/core/elements/Direction.h diff --git a/Sourcecode/private/mx/core/elements/DirectionAttributes.cpp b/src/private/mx/core/elements/DirectionAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DirectionAttributes.cpp rename to src/private/mx/core/elements/DirectionAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DirectionAttributes.h b/src/private/mx/core/elements/DirectionAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DirectionAttributes.h rename to src/private/mx/core/elements/DirectionAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DirectionType.cpp b/src/private/mx/core/elements/DirectionType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DirectionType.cpp rename to src/private/mx/core/elements/DirectionType.cpp diff --git a/Sourcecode/private/mx/core/elements/DirectionType.h b/src/private/mx/core/elements/DirectionType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DirectionType.h rename to src/private/mx/core/elements/DirectionType.h diff --git a/Sourcecode/private/mx/core/elements/Directive.cpp b/src/private/mx/core/elements/Directive.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Directive.cpp rename to src/private/mx/core/elements/Directive.cpp diff --git a/Sourcecode/private/mx/core/elements/Directive.h b/src/private/mx/core/elements/Directive.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Directive.h rename to src/private/mx/core/elements/Directive.h diff --git a/Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp b/src/private/mx/core/elements/DirectiveAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp rename to src/private/mx/core/elements/DirectiveAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DirectiveAttributes.h b/src/private/mx/core/elements/DirectiveAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DirectiveAttributes.h rename to src/private/mx/core/elements/DirectiveAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DisplayOctave.cpp b/src/private/mx/core/elements/DisplayOctave.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayOctave.cpp rename to src/private/mx/core/elements/DisplayOctave.cpp diff --git a/Sourcecode/private/mx/core/elements/DisplayOctave.h b/src/private/mx/core/elements/DisplayOctave.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayOctave.h rename to src/private/mx/core/elements/DisplayOctave.h diff --git a/Sourcecode/private/mx/core/elements/DisplayStep.cpp b/src/private/mx/core/elements/DisplayStep.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayStep.cpp rename to src/private/mx/core/elements/DisplayStep.cpp diff --git a/Sourcecode/private/mx/core/elements/DisplayStep.h b/src/private/mx/core/elements/DisplayStep.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayStep.h rename to src/private/mx/core/elements/DisplayStep.h diff --git a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp b/src/private/mx/core/elements/DisplayStepOctaveGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp rename to src/private/mx/core/elements/DisplayStepOctaveGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h b/src/private/mx/core/elements/DisplayStepOctaveGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h rename to src/private/mx/core/elements/DisplayStepOctaveGroup.h diff --git a/Sourcecode/private/mx/core/elements/DisplayText.cpp b/src/private/mx/core/elements/DisplayText.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayText.cpp rename to src/private/mx/core/elements/DisplayText.cpp diff --git a/Sourcecode/private/mx/core/elements/DisplayText.h b/src/private/mx/core/elements/DisplayText.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayText.h rename to src/private/mx/core/elements/DisplayText.h diff --git a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp b/src/private/mx/core/elements/DisplayTextAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp rename to src/private/mx/core/elements/DisplayTextAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.h b/src/private/mx/core/elements/DisplayTextAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayTextAttributes.h rename to src/private/mx/core/elements/DisplayTextAttributes.h diff --git a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp b/src/private/mx/core/elements/DisplayTextOrAccidentalText.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp rename to src/private/mx/core/elements/DisplayTextOrAccidentalText.cpp diff --git a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h b/src/private/mx/core/elements/DisplayTextOrAccidentalText.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h rename to src/private/mx/core/elements/DisplayTextOrAccidentalText.h diff --git a/Sourcecode/private/mx/core/elements/Distance.cpp b/src/private/mx/core/elements/Distance.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Distance.cpp rename to src/private/mx/core/elements/Distance.cpp diff --git a/Sourcecode/private/mx/core/elements/Distance.h b/src/private/mx/core/elements/Distance.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Distance.h rename to src/private/mx/core/elements/Distance.h diff --git a/Sourcecode/private/mx/core/elements/DistanceAttributes.cpp b/src/private/mx/core/elements/DistanceAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DistanceAttributes.cpp rename to src/private/mx/core/elements/DistanceAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DistanceAttributes.h b/src/private/mx/core/elements/DistanceAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DistanceAttributes.h rename to src/private/mx/core/elements/DistanceAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Divisions.cpp b/src/private/mx/core/elements/Divisions.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Divisions.cpp rename to src/private/mx/core/elements/Divisions.cpp diff --git a/Sourcecode/private/mx/core/elements/Divisions.h b/src/private/mx/core/elements/Divisions.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Divisions.h rename to src/private/mx/core/elements/Divisions.h diff --git a/Sourcecode/private/mx/core/elements/Doit.cpp b/src/private/mx/core/elements/Doit.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Doit.cpp rename to src/private/mx/core/elements/Doit.cpp diff --git a/Sourcecode/private/mx/core/elements/Doit.h b/src/private/mx/core/elements/Doit.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Doit.h rename to src/private/mx/core/elements/Doit.h diff --git a/Sourcecode/private/mx/core/elements/Dot.cpp b/src/private/mx/core/elements/Dot.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Dot.cpp rename to src/private/mx/core/elements/Dot.cpp diff --git a/Sourcecode/private/mx/core/elements/Dot.h b/src/private/mx/core/elements/Dot.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Dot.h rename to src/private/mx/core/elements/Dot.h diff --git a/Sourcecode/private/mx/core/elements/Double.cpp b/src/private/mx/core/elements/Double.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Double.cpp rename to src/private/mx/core/elements/Double.cpp diff --git a/Sourcecode/private/mx/core/elements/Double.h b/src/private/mx/core/elements/Double.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Double.h rename to src/private/mx/core/elements/Double.h diff --git a/Sourcecode/private/mx/core/elements/DoubleTongue.cpp b/src/private/mx/core/elements/DoubleTongue.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DoubleTongue.cpp rename to src/private/mx/core/elements/DoubleTongue.cpp diff --git a/Sourcecode/private/mx/core/elements/DoubleTongue.h b/src/private/mx/core/elements/DoubleTongue.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DoubleTongue.h rename to src/private/mx/core/elements/DoubleTongue.h diff --git a/Sourcecode/private/mx/core/elements/DownBow.cpp b/src/private/mx/core/elements/DownBow.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DownBow.cpp rename to src/private/mx/core/elements/DownBow.cpp diff --git a/Sourcecode/private/mx/core/elements/DownBow.h b/src/private/mx/core/elements/DownBow.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DownBow.h rename to src/private/mx/core/elements/DownBow.h diff --git a/Sourcecode/private/mx/core/elements/Duration.cpp b/src/private/mx/core/elements/Duration.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Duration.cpp rename to src/private/mx/core/elements/Duration.cpp diff --git a/Sourcecode/private/mx/core/elements/Duration.h b/src/private/mx/core/elements/Duration.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Duration.h rename to src/private/mx/core/elements/Duration.h diff --git a/Sourcecode/private/mx/core/elements/Dynamics.cpp b/src/private/mx/core/elements/Dynamics.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Dynamics.cpp rename to src/private/mx/core/elements/Dynamics.cpp diff --git a/Sourcecode/private/mx/core/elements/Dynamics.h b/src/private/mx/core/elements/Dynamics.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Dynamics.h rename to src/private/mx/core/elements/Dynamics.h diff --git a/Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp b/src/private/mx/core/elements/DynamicsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp rename to src/private/mx/core/elements/DynamicsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/DynamicsAttributes.h b/src/private/mx/core/elements/DynamicsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/DynamicsAttributes.h rename to src/private/mx/core/elements/DynamicsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/EditorialGroup.cpp b/src/private/mx/core/elements/EditorialGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EditorialGroup.cpp rename to src/private/mx/core/elements/EditorialGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/EditorialGroup.h b/src/private/mx/core/elements/EditorialGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EditorialGroup.h rename to src/private/mx/core/elements/EditorialGroup.h diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp b/src/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp rename to src/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h b/src/private/mx/core/elements/EditorialVoiceDirectionGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h rename to src/private/mx/core/elements/EditorialVoiceDirectionGroup.h diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp b/src/private/mx/core/elements/EditorialVoiceGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp rename to src/private/mx/core/elements/EditorialVoiceGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h b/src/private/mx/core/elements/EditorialVoiceGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h rename to src/private/mx/core/elements/EditorialVoiceGroup.h diff --git a/Sourcecode/private/mx/core/elements/Effect.cpp b/src/private/mx/core/elements/Effect.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Effect.cpp rename to src/private/mx/core/elements/Effect.cpp diff --git a/Sourcecode/private/mx/core/elements/Effect.h b/src/private/mx/core/elements/Effect.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Effect.h rename to src/private/mx/core/elements/Effect.h diff --git a/Sourcecode/private/mx/core/elements/Elevation.cpp b/src/private/mx/core/elements/Elevation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Elevation.cpp rename to src/private/mx/core/elements/Elevation.cpp diff --git a/Sourcecode/private/mx/core/elements/Elevation.h b/src/private/mx/core/elements/Elevation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Elevation.h rename to src/private/mx/core/elements/Elevation.h diff --git a/Sourcecode/private/mx/core/elements/Elision.cpp b/src/private/mx/core/elements/Elision.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Elision.cpp rename to src/private/mx/core/elements/Elision.cpp diff --git a/Sourcecode/private/mx/core/elements/Elision.h b/src/private/mx/core/elements/Elision.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Elision.h rename to src/private/mx/core/elements/Elision.h diff --git a/Sourcecode/private/mx/core/elements/ElisionAttributes.cpp b/src/private/mx/core/elements/ElisionAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ElisionAttributes.cpp rename to src/private/mx/core/elements/ElisionAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ElisionAttributes.h b/src/private/mx/core/elements/ElisionAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ElisionAttributes.h rename to src/private/mx/core/elements/ElisionAttributes.h diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp b/src/private/mx/core/elements/ElisionSyllabicGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp rename to src/private/mx/core/elements/ElisionSyllabicGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h b/src/private/mx/core/elements/ElisionSyllabicGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h rename to src/private/mx/core/elements/ElisionSyllabicGroup.h diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp b/src/private/mx/core/elements/ElisionSyllabicTextGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp rename to src/private/mx/core/elements/ElisionSyllabicTextGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h b/src/private/mx/core/elements/ElisionSyllabicTextGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h rename to src/private/mx/core/elements/ElisionSyllabicTextGroup.h diff --git a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp b/src/private/mx/core/elements/EmptyFontAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp rename to src/private/mx/core/elements/EmptyFontAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.h b/src/private/mx/core/elements/EmptyFontAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EmptyFontAttributes.h rename to src/private/mx/core/elements/EmptyFontAttributes.h diff --git a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp b/src/private/mx/core/elements/EmptyLineAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp rename to src/private/mx/core/elements/EmptyLineAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.h b/src/private/mx/core/elements/EmptyLineAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EmptyLineAttributes.h rename to src/private/mx/core/elements/EmptyLineAttributes.h diff --git a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp b/src/private/mx/core/elements/EmptyPlacementAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp rename to src/private/mx/core/elements/EmptyPlacementAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h b/src/private/mx/core/elements/EmptyPlacementAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h rename to src/private/mx/core/elements/EmptyPlacementAttributes.h diff --git a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp b/src/private/mx/core/elements/EmptyTrillSoundAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp rename to src/private/mx/core/elements/EmptyTrillSoundAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h b/src/private/mx/core/elements/EmptyTrillSoundAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h rename to src/private/mx/core/elements/EmptyTrillSoundAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Encoder.cpp b/src/private/mx/core/elements/Encoder.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Encoder.cpp rename to src/private/mx/core/elements/Encoder.cpp diff --git a/Sourcecode/private/mx/core/elements/Encoder.h b/src/private/mx/core/elements/Encoder.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Encoder.h rename to src/private/mx/core/elements/Encoder.h diff --git a/Sourcecode/private/mx/core/elements/EncoderAttributes.cpp b/src/private/mx/core/elements/EncoderAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EncoderAttributes.cpp rename to src/private/mx/core/elements/EncoderAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/EncoderAttributes.h b/src/private/mx/core/elements/EncoderAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EncoderAttributes.h rename to src/private/mx/core/elements/EncoderAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Encoding.cpp b/src/private/mx/core/elements/Encoding.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Encoding.cpp rename to src/private/mx/core/elements/Encoding.cpp diff --git a/Sourcecode/private/mx/core/elements/Encoding.h b/src/private/mx/core/elements/Encoding.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Encoding.h rename to src/private/mx/core/elements/Encoding.h diff --git a/Sourcecode/private/mx/core/elements/EncodingChoice.cpp b/src/private/mx/core/elements/EncodingChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EncodingChoice.cpp rename to src/private/mx/core/elements/EncodingChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/EncodingChoice.h b/src/private/mx/core/elements/EncodingChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EncodingChoice.h rename to src/private/mx/core/elements/EncodingChoice.h diff --git a/Sourcecode/private/mx/core/elements/EncodingDate.cpp b/src/private/mx/core/elements/EncodingDate.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EncodingDate.cpp rename to src/private/mx/core/elements/EncodingDate.cpp diff --git a/Sourcecode/private/mx/core/elements/EncodingDate.h b/src/private/mx/core/elements/EncodingDate.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EncodingDate.h rename to src/private/mx/core/elements/EncodingDate.h diff --git a/Sourcecode/private/mx/core/elements/EncodingDescription.cpp b/src/private/mx/core/elements/EncodingDescription.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EncodingDescription.cpp rename to src/private/mx/core/elements/EncodingDescription.cpp diff --git a/Sourcecode/private/mx/core/elements/EncodingDescription.h b/src/private/mx/core/elements/EncodingDescription.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EncodingDescription.h rename to src/private/mx/core/elements/EncodingDescription.h diff --git a/Sourcecode/private/mx/core/elements/EndLine.cpp b/src/private/mx/core/elements/EndLine.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EndLine.cpp rename to src/private/mx/core/elements/EndLine.cpp diff --git a/Sourcecode/private/mx/core/elements/EndLine.h b/src/private/mx/core/elements/EndLine.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EndLine.h rename to src/private/mx/core/elements/EndLine.h diff --git a/Sourcecode/private/mx/core/elements/EndParagraph.cpp b/src/private/mx/core/elements/EndParagraph.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EndParagraph.cpp rename to src/private/mx/core/elements/EndParagraph.cpp diff --git a/Sourcecode/private/mx/core/elements/EndParagraph.h b/src/private/mx/core/elements/EndParagraph.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EndParagraph.h rename to src/private/mx/core/elements/EndParagraph.h diff --git a/Sourcecode/private/mx/core/elements/Ending.cpp b/src/private/mx/core/elements/Ending.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Ending.cpp rename to src/private/mx/core/elements/Ending.cpp diff --git a/Sourcecode/private/mx/core/elements/Ending.h b/src/private/mx/core/elements/Ending.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Ending.h rename to src/private/mx/core/elements/Ending.h diff --git a/Sourcecode/private/mx/core/elements/EndingAttributes.cpp b/src/private/mx/core/elements/EndingAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/EndingAttributes.cpp rename to src/private/mx/core/elements/EndingAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/EndingAttributes.h b/src/private/mx/core/elements/EndingAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/EndingAttributes.h rename to src/private/mx/core/elements/EndingAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Ensemble.cpp b/src/private/mx/core/elements/Ensemble.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Ensemble.cpp rename to src/private/mx/core/elements/Ensemble.cpp diff --git a/Sourcecode/private/mx/core/elements/Ensemble.h b/src/private/mx/core/elements/Ensemble.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Ensemble.h rename to src/private/mx/core/elements/Ensemble.h diff --git a/Sourcecode/private/mx/core/elements/Extend.cpp b/src/private/mx/core/elements/Extend.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Extend.cpp rename to src/private/mx/core/elements/Extend.cpp diff --git a/Sourcecode/private/mx/core/elements/Extend.h b/src/private/mx/core/elements/Extend.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Extend.h rename to src/private/mx/core/elements/Extend.h diff --git a/Sourcecode/private/mx/core/elements/ExtendAttributes.cpp b/src/private/mx/core/elements/ExtendAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ExtendAttributes.cpp rename to src/private/mx/core/elements/ExtendAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ExtendAttributes.h b/src/private/mx/core/elements/ExtendAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ExtendAttributes.h rename to src/private/mx/core/elements/ExtendAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Eyeglasses.cpp b/src/private/mx/core/elements/Eyeglasses.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Eyeglasses.cpp rename to src/private/mx/core/elements/Eyeglasses.cpp diff --git a/Sourcecode/private/mx/core/elements/Eyeglasses.h b/src/private/mx/core/elements/Eyeglasses.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Eyeglasses.h rename to src/private/mx/core/elements/Eyeglasses.h diff --git a/Sourcecode/private/mx/core/elements/Falloff.cpp b/src/private/mx/core/elements/Falloff.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Falloff.cpp rename to src/private/mx/core/elements/Falloff.cpp diff --git a/Sourcecode/private/mx/core/elements/Falloff.h b/src/private/mx/core/elements/Falloff.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Falloff.h rename to src/private/mx/core/elements/Falloff.h diff --git a/Sourcecode/private/mx/core/elements/Feature.cpp b/src/private/mx/core/elements/Feature.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Feature.cpp rename to src/private/mx/core/elements/Feature.cpp diff --git a/Sourcecode/private/mx/core/elements/Feature.h b/src/private/mx/core/elements/Feature.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Feature.h rename to src/private/mx/core/elements/Feature.h diff --git a/Sourcecode/private/mx/core/elements/FeatureAttributes.cpp b/src/private/mx/core/elements/FeatureAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FeatureAttributes.cpp rename to src/private/mx/core/elements/FeatureAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FeatureAttributes.h b/src/private/mx/core/elements/FeatureAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FeatureAttributes.h rename to src/private/mx/core/elements/FeatureAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Fermata.cpp b/src/private/mx/core/elements/Fermata.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Fermata.cpp rename to src/private/mx/core/elements/Fermata.cpp diff --git a/Sourcecode/private/mx/core/elements/Fermata.h b/src/private/mx/core/elements/Fermata.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Fermata.h rename to src/private/mx/core/elements/Fermata.h diff --git a/Sourcecode/private/mx/core/elements/FermataAttributes.cpp b/src/private/mx/core/elements/FermataAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FermataAttributes.cpp rename to src/private/mx/core/elements/FermataAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FermataAttributes.h b/src/private/mx/core/elements/FermataAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FermataAttributes.h rename to src/private/mx/core/elements/FermataAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Fifths.cpp b/src/private/mx/core/elements/Fifths.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Fifths.cpp rename to src/private/mx/core/elements/Fifths.cpp diff --git a/Sourcecode/private/mx/core/elements/Fifths.h b/src/private/mx/core/elements/Fifths.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Fifths.h rename to src/private/mx/core/elements/Fifths.h diff --git a/Sourcecode/private/mx/core/elements/Figure.cpp b/src/private/mx/core/elements/Figure.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Figure.cpp rename to src/private/mx/core/elements/Figure.cpp diff --git a/Sourcecode/private/mx/core/elements/Figure.h b/src/private/mx/core/elements/Figure.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Figure.h rename to src/private/mx/core/elements/Figure.h diff --git a/Sourcecode/private/mx/core/elements/FigureNumber.cpp b/src/private/mx/core/elements/FigureNumber.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FigureNumber.cpp rename to src/private/mx/core/elements/FigureNumber.cpp diff --git a/Sourcecode/private/mx/core/elements/FigureNumber.h b/src/private/mx/core/elements/FigureNumber.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FigureNumber.h rename to src/private/mx/core/elements/FigureNumber.h diff --git a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp b/src/private/mx/core/elements/FigureNumberAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp rename to src/private/mx/core/elements/FigureNumberAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.h b/src/private/mx/core/elements/FigureNumberAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FigureNumberAttributes.h rename to src/private/mx/core/elements/FigureNumberAttributes.h diff --git a/Sourcecode/private/mx/core/elements/FiguredBass.cpp b/src/private/mx/core/elements/FiguredBass.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FiguredBass.cpp rename to src/private/mx/core/elements/FiguredBass.cpp diff --git a/Sourcecode/private/mx/core/elements/FiguredBass.h b/src/private/mx/core/elements/FiguredBass.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FiguredBass.h rename to src/private/mx/core/elements/FiguredBass.h diff --git a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp b/src/private/mx/core/elements/FiguredBassAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp rename to src/private/mx/core/elements/FiguredBassAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.h b/src/private/mx/core/elements/FiguredBassAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FiguredBassAttributes.h rename to src/private/mx/core/elements/FiguredBassAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Fingering.cpp b/src/private/mx/core/elements/Fingering.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Fingering.cpp rename to src/private/mx/core/elements/Fingering.cpp diff --git a/Sourcecode/private/mx/core/elements/Fingering.h b/src/private/mx/core/elements/Fingering.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Fingering.h rename to src/private/mx/core/elements/Fingering.h diff --git a/Sourcecode/private/mx/core/elements/FingeringAttributes.cpp b/src/private/mx/core/elements/FingeringAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FingeringAttributes.cpp rename to src/private/mx/core/elements/FingeringAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FingeringAttributes.h b/src/private/mx/core/elements/FingeringAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FingeringAttributes.h rename to src/private/mx/core/elements/FingeringAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Fingernails.cpp b/src/private/mx/core/elements/Fingernails.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Fingernails.cpp rename to src/private/mx/core/elements/Fingernails.cpp diff --git a/Sourcecode/private/mx/core/elements/Fingernails.h b/src/private/mx/core/elements/Fingernails.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Fingernails.h rename to src/private/mx/core/elements/Fingernails.h diff --git a/Sourcecode/private/mx/core/elements/FirstFret.cpp b/src/private/mx/core/elements/FirstFret.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FirstFret.cpp rename to src/private/mx/core/elements/FirstFret.cpp diff --git a/Sourcecode/private/mx/core/elements/FirstFret.h b/src/private/mx/core/elements/FirstFret.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FirstFret.h rename to src/private/mx/core/elements/FirstFret.h diff --git a/Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp b/src/private/mx/core/elements/FirstFretAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp rename to src/private/mx/core/elements/FirstFretAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FirstFretAttributes.h b/src/private/mx/core/elements/FirstFretAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FirstFretAttributes.h rename to src/private/mx/core/elements/FirstFretAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Footnote.cpp b/src/private/mx/core/elements/Footnote.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Footnote.cpp rename to src/private/mx/core/elements/Footnote.cpp diff --git a/Sourcecode/private/mx/core/elements/Footnote.h b/src/private/mx/core/elements/Footnote.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Footnote.h rename to src/private/mx/core/elements/Footnote.h diff --git a/Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp b/src/private/mx/core/elements/FootnoteAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp rename to src/private/mx/core/elements/FootnoteAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FootnoteAttributes.h b/src/private/mx/core/elements/FootnoteAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FootnoteAttributes.h rename to src/private/mx/core/elements/FootnoteAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Forward.cpp b/src/private/mx/core/elements/Forward.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Forward.cpp rename to src/private/mx/core/elements/Forward.cpp diff --git a/Sourcecode/private/mx/core/elements/Forward.h b/src/private/mx/core/elements/Forward.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Forward.h rename to src/private/mx/core/elements/Forward.h diff --git a/Sourcecode/private/mx/core/elements/Frame.cpp b/src/private/mx/core/elements/Frame.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Frame.cpp rename to src/private/mx/core/elements/Frame.cpp diff --git a/Sourcecode/private/mx/core/elements/Frame.h b/src/private/mx/core/elements/Frame.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Frame.h rename to src/private/mx/core/elements/Frame.h diff --git a/Sourcecode/private/mx/core/elements/FrameAttributes.cpp b/src/private/mx/core/elements/FrameAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FrameAttributes.cpp rename to src/private/mx/core/elements/FrameAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FrameAttributes.h b/src/private/mx/core/elements/FrameAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FrameAttributes.h rename to src/private/mx/core/elements/FrameAttributes.h diff --git a/Sourcecode/private/mx/core/elements/FrameFrets.cpp b/src/private/mx/core/elements/FrameFrets.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FrameFrets.cpp rename to src/private/mx/core/elements/FrameFrets.cpp diff --git a/Sourcecode/private/mx/core/elements/FrameFrets.h b/src/private/mx/core/elements/FrameFrets.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FrameFrets.h rename to src/private/mx/core/elements/FrameFrets.h diff --git a/Sourcecode/private/mx/core/elements/FrameNote.cpp b/src/private/mx/core/elements/FrameNote.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FrameNote.cpp rename to src/private/mx/core/elements/FrameNote.cpp diff --git a/Sourcecode/private/mx/core/elements/FrameNote.h b/src/private/mx/core/elements/FrameNote.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FrameNote.h rename to src/private/mx/core/elements/FrameNote.h diff --git a/Sourcecode/private/mx/core/elements/FrameStrings.cpp b/src/private/mx/core/elements/FrameStrings.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FrameStrings.cpp rename to src/private/mx/core/elements/FrameStrings.cpp diff --git a/Sourcecode/private/mx/core/elements/FrameStrings.h b/src/private/mx/core/elements/FrameStrings.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FrameStrings.h rename to src/private/mx/core/elements/FrameStrings.h diff --git a/Sourcecode/private/mx/core/elements/Fret.cpp b/src/private/mx/core/elements/Fret.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Fret.cpp rename to src/private/mx/core/elements/Fret.cpp diff --git a/Sourcecode/private/mx/core/elements/Fret.h b/src/private/mx/core/elements/Fret.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Fret.h rename to src/private/mx/core/elements/Fret.h diff --git a/Sourcecode/private/mx/core/elements/FretAttributes.cpp b/src/private/mx/core/elements/FretAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FretAttributes.cpp rename to src/private/mx/core/elements/FretAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FretAttributes.h b/src/private/mx/core/elements/FretAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FretAttributes.h rename to src/private/mx/core/elements/FretAttributes.h diff --git a/Sourcecode/private/mx/core/elements/FullNoteGroup.cpp b/src/private/mx/core/elements/FullNoteGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FullNoteGroup.cpp rename to src/private/mx/core/elements/FullNoteGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/FullNoteGroup.h b/src/private/mx/core/elements/FullNoteGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FullNoteGroup.h rename to src/private/mx/core/elements/FullNoteGroup.h diff --git a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp b/src/private/mx/core/elements/FullNoteTypeChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp rename to src/private/mx/core/elements/FullNoteTypeChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h b/src/private/mx/core/elements/FullNoteTypeChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h rename to src/private/mx/core/elements/FullNoteTypeChoice.h diff --git a/Sourcecode/private/mx/core/elements/Function.cpp b/src/private/mx/core/elements/Function.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Function.cpp rename to src/private/mx/core/elements/Function.cpp diff --git a/Sourcecode/private/mx/core/elements/Function.h b/src/private/mx/core/elements/Function.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Function.h rename to src/private/mx/core/elements/Function.h diff --git a/Sourcecode/private/mx/core/elements/FunctionAttributes.cpp b/src/private/mx/core/elements/FunctionAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/FunctionAttributes.cpp rename to src/private/mx/core/elements/FunctionAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/FunctionAttributes.h b/src/private/mx/core/elements/FunctionAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/FunctionAttributes.h rename to src/private/mx/core/elements/FunctionAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Glass.cpp b/src/private/mx/core/elements/Glass.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Glass.cpp rename to src/private/mx/core/elements/Glass.cpp diff --git a/Sourcecode/private/mx/core/elements/Glass.h b/src/private/mx/core/elements/Glass.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Glass.h rename to src/private/mx/core/elements/Glass.h diff --git a/Sourcecode/private/mx/core/elements/Glissando.cpp b/src/private/mx/core/elements/Glissando.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Glissando.cpp rename to src/private/mx/core/elements/Glissando.cpp diff --git a/Sourcecode/private/mx/core/elements/Glissando.h b/src/private/mx/core/elements/Glissando.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Glissando.h rename to src/private/mx/core/elements/Glissando.h diff --git a/Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp b/src/private/mx/core/elements/GlissandoAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp rename to src/private/mx/core/elements/GlissandoAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GlissandoAttributes.h b/src/private/mx/core/elements/GlissandoAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GlissandoAttributes.h rename to src/private/mx/core/elements/GlissandoAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Grace.cpp b/src/private/mx/core/elements/Grace.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Grace.cpp rename to src/private/mx/core/elements/Grace.cpp diff --git a/Sourcecode/private/mx/core/elements/Grace.h b/src/private/mx/core/elements/Grace.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Grace.h rename to src/private/mx/core/elements/Grace.h diff --git a/Sourcecode/private/mx/core/elements/GraceAttributes.cpp b/src/private/mx/core/elements/GraceAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GraceAttributes.cpp rename to src/private/mx/core/elements/GraceAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GraceAttributes.h b/src/private/mx/core/elements/GraceAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GraceAttributes.h rename to src/private/mx/core/elements/GraceAttributes.h diff --git a/Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp b/src/private/mx/core/elements/GraceNoteGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp rename to src/private/mx/core/elements/GraceNoteGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/GraceNoteGroup.h b/src/private/mx/core/elements/GraceNoteGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GraceNoteGroup.h rename to src/private/mx/core/elements/GraceNoteGroup.h diff --git a/Sourcecode/private/mx/core/elements/Group.cpp b/src/private/mx/core/elements/Group.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Group.cpp rename to src/private/mx/core/elements/Group.cpp diff --git a/Sourcecode/private/mx/core/elements/Group.h b/src/private/mx/core/elements/Group.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Group.h rename to src/private/mx/core/elements/Group.h diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp b/src/private/mx/core/elements/GroupAbbreviation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp rename to src/private/mx/core/elements/GroupAbbreviation.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviation.h b/src/private/mx/core/elements/GroupAbbreviation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupAbbreviation.h rename to src/private/mx/core/elements/GroupAbbreviation.h diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp b/src/private/mx/core/elements/GroupAbbreviationAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp rename to src/private/mx/core/elements/GroupAbbreviationAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h b/src/private/mx/core/elements/GroupAbbreviationAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h rename to src/private/mx/core/elements/GroupAbbreviationAttributes.h diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp b/src/private/mx/core/elements/GroupAbbreviationDisplay.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp rename to src/private/mx/core/elements/GroupAbbreviationDisplay.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h b/src/private/mx/core/elements/GroupAbbreviationDisplay.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h rename to src/private/mx/core/elements/GroupAbbreviationDisplay.h diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp b/src/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp rename to src/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h b/src/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h rename to src/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h diff --git a/Sourcecode/private/mx/core/elements/GroupBarline.cpp b/src/private/mx/core/elements/GroupBarline.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupBarline.cpp rename to src/private/mx/core/elements/GroupBarline.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupBarline.h b/src/private/mx/core/elements/GroupBarline.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupBarline.h rename to src/private/mx/core/elements/GroupBarline.h diff --git a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp b/src/private/mx/core/elements/GroupBarlineAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp rename to src/private/mx/core/elements/GroupBarlineAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h b/src/private/mx/core/elements/GroupBarlineAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h rename to src/private/mx/core/elements/GroupBarlineAttributes.h diff --git a/Sourcecode/private/mx/core/elements/GroupName.cpp b/src/private/mx/core/elements/GroupName.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupName.cpp rename to src/private/mx/core/elements/GroupName.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupName.h b/src/private/mx/core/elements/GroupName.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupName.h rename to src/private/mx/core/elements/GroupName.h diff --git a/Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp b/src/private/mx/core/elements/GroupNameAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp rename to src/private/mx/core/elements/GroupNameAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupNameAttributes.h b/src/private/mx/core/elements/GroupNameAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupNameAttributes.h rename to src/private/mx/core/elements/GroupNameAttributes.h diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp b/src/private/mx/core/elements/GroupNameDisplay.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp rename to src/private/mx/core/elements/GroupNameDisplay.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplay.h b/src/private/mx/core/elements/GroupNameDisplay.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupNameDisplay.h rename to src/private/mx/core/elements/GroupNameDisplay.h diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp b/src/private/mx/core/elements/GroupNameDisplayAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp rename to src/private/mx/core/elements/GroupNameDisplayAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h b/src/private/mx/core/elements/GroupNameDisplayAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h rename to src/private/mx/core/elements/GroupNameDisplayAttributes.h diff --git a/Sourcecode/private/mx/core/elements/GroupSymbol.cpp b/src/private/mx/core/elements/GroupSymbol.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupSymbol.cpp rename to src/private/mx/core/elements/GroupSymbol.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupSymbol.h b/src/private/mx/core/elements/GroupSymbol.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupSymbol.h rename to src/private/mx/core/elements/GroupSymbol.h diff --git a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp b/src/private/mx/core/elements/GroupSymbolAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp rename to src/private/mx/core/elements/GroupSymbolAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h b/src/private/mx/core/elements/GroupSymbolAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h rename to src/private/mx/core/elements/GroupSymbolAttributes.h diff --git a/Sourcecode/private/mx/core/elements/GroupTime.cpp b/src/private/mx/core/elements/GroupTime.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupTime.cpp rename to src/private/mx/core/elements/GroupTime.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupTime.h b/src/private/mx/core/elements/GroupTime.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupTime.h rename to src/private/mx/core/elements/GroupTime.h diff --git a/Sourcecode/private/mx/core/elements/Grouping.cpp b/src/private/mx/core/elements/Grouping.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Grouping.cpp rename to src/private/mx/core/elements/Grouping.cpp diff --git a/Sourcecode/private/mx/core/elements/Grouping.h b/src/private/mx/core/elements/Grouping.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Grouping.h rename to src/private/mx/core/elements/Grouping.h diff --git a/Sourcecode/private/mx/core/elements/GroupingAttributes.cpp b/src/private/mx/core/elements/GroupingAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupingAttributes.cpp rename to src/private/mx/core/elements/GroupingAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/GroupingAttributes.h b/src/private/mx/core/elements/GroupingAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/GroupingAttributes.h rename to src/private/mx/core/elements/GroupingAttributes.h diff --git a/Sourcecode/private/mx/core/elements/HammerOn.cpp b/src/private/mx/core/elements/HammerOn.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HammerOn.cpp rename to src/private/mx/core/elements/HammerOn.cpp diff --git a/Sourcecode/private/mx/core/elements/HammerOn.h b/src/private/mx/core/elements/HammerOn.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HammerOn.h rename to src/private/mx/core/elements/HammerOn.h diff --git a/Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp b/src/private/mx/core/elements/HammerOnAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp rename to src/private/mx/core/elements/HammerOnAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/HammerOnAttributes.h b/src/private/mx/core/elements/HammerOnAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HammerOnAttributes.h rename to src/private/mx/core/elements/HammerOnAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Handbell.cpp b/src/private/mx/core/elements/Handbell.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Handbell.cpp rename to src/private/mx/core/elements/Handbell.cpp diff --git a/Sourcecode/private/mx/core/elements/Handbell.h b/src/private/mx/core/elements/Handbell.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Handbell.h rename to src/private/mx/core/elements/Handbell.h diff --git a/Sourcecode/private/mx/core/elements/HandbellAttributes.cpp b/src/private/mx/core/elements/HandbellAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HandbellAttributes.cpp rename to src/private/mx/core/elements/HandbellAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/HandbellAttributes.h b/src/private/mx/core/elements/HandbellAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HandbellAttributes.h rename to src/private/mx/core/elements/HandbellAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Harmonic.cpp b/src/private/mx/core/elements/Harmonic.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Harmonic.cpp rename to src/private/mx/core/elements/Harmonic.cpp diff --git a/Sourcecode/private/mx/core/elements/Harmonic.h b/src/private/mx/core/elements/Harmonic.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Harmonic.h rename to src/private/mx/core/elements/Harmonic.h diff --git a/Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp b/src/private/mx/core/elements/HarmonicAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp rename to src/private/mx/core/elements/HarmonicAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/HarmonicAttributes.h b/src/private/mx/core/elements/HarmonicAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonicAttributes.h rename to src/private/mx/core/elements/HarmonicAttributes.h diff --git a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp b/src/private/mx/core/elements/HarmonicInfoChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp rename to src/private/mx/core/elements/HarmonicInfoChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h b/src/private/mx/core/elements/HarmonicInfoChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h rename to src/private/mx/core/elements/HarmonicInfoChoice.h diff --git a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp b/src/private/mx/core/elements/HarmonicTypeChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp rename to src/private/mx/core/elements/HarmonicTypeChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h b/src/private/mx/core/elements/HarmonicTypeChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h rename to src/private/mx/core/elements/HarmonicTypeChoice.h diff --git a/Sourcecode/private/mx/core/elements/Harmony.cpp b/src/private/mx/core/elements/Harmony.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Harmony.cpp rename to src/private/mx/core/elements/Harmony.cpp diff --git a/Sourcecode/private/mx/core/elements/Harmony.h b/src/private/mx/core/elements/Harmony.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Harmony.h rename to src/private/mx/core/elements/Harmony.h diff --git a/Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp b/src/private/mx/core/elements/HarmonyAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp rename to src/private/mx/core/elements/HarmonyAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/HarmonyAttributes.h b/src/private/mx/core/elements/HarmonyAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonyAttributes.h rename to src/private/mx/core/elements/HarmonyAttributes.h diff --git a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp b/src/private/mx/core/elements/HarmonyChordGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp rename to src/private/mx/core/elements/HarmonyChordGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.h b/src/private/mx/core/elements/HarmonyChordGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HarmonyChordGroup.h rename to src/private/mx/core/elements/HarmonyChordGroup.h diff --git a/Sourcecode/private/mx/core/elements/HarpPedals.cpp b/src/private/mx/core/elements/HarpPedals.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HarpPedals.cpp rename to src/private/mx/core/elements/HarpPedals.cpp diff --git a/Sourcecode/private/mx/core/elements/HarpPedals.h b/src/private/mx/core/elements/HarpPedals.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HarpPedals.h rename to src/private/mx/core/elements/HarpPedals.h diff --git a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp b/src/private/mx/core/elements/HarpPedalsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp rename to src/private/mx/core/elements/HarpPedalsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h b/src/private/mx/core/elements/HarpPedalsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h rename to src/private/mx/core/elements/HarpPedalsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Heel.cpp b/src/private/mx/core/elements/Heel.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Heel.cpp rename to src/private/mx/core/elements/Heel.cpp diff --git a/Sourcecode/private/mx/core/elements/Heel.h b/src/private/mx/core/elements/Heel.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Heel.h rename to src/private/mx/core/elements/Heel.h diff --git a/Sourcecode/private/mx/core/elements/HeelAttributes.cpp b/src/private/mx/core/elements/HeelAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HeelAttributes.cpp rename to src/private/mx/core/elements/HeelAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/HeelAttributes.h b/src/private/mx/core/elements/HeelAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HeelAttributes.h rename to src/private/mx/core/elements/HeelAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Hole.cpp b/src/private/mx/core/elements/Hole.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Hole.cpp rename to src/private/mx/core/elements/Hole.cpp diff --git a/Sourcecode/private/mx/core/elements/Hole.h b/src/private/mx/core/elements/Hole.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Hole.h rename to src/private/mx/core/elements/Hole.h diff --git a/Sourcecode/private/mx/core/elements/HoleAttributes.cpp b/src/private/mx/core/elements/HoleAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleAttributes.cpp rename to src/private/mx/core/elements/HoleAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/HoleAttributes.h b/src/private/mx/core/elements/HoleAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleAttributes.h rename to src/private/mx/core/elements/HoleAttributes.h diff --git a/Sourcecode/private/mx/core/elements/HoleClosed.cpp b/src/private/mx/core/elements/HoleClosed.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleClosed.cpp rename to src/private/mx/core/elements/HoleClosed.cpp diff --git a/Sourcecode/private/mx/core/elements/HoleClosed.h b/src/private/mx/core/elements/HoleClosed.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleClosed.h rename to src/private/mx/core/elements/HoleClosed.h diff --git a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp b/src/private/mx/core/elements/HoleClosedAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp rename to src/private/mx/core/elements/HoleClosedAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.h b/src/private/mx/core/elements/HoleClosedAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleClosedAttributes.h rename to src/private/mx/core/elements/HoleClosedAttributes.h diff --git a/Sourcecode/private/mx/core/elements/HoleShape.cpp b/src/private/mx/core/elements/HoleShape.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleShape.cpp rename to src/private/mx/core/elements/HoleShape.cpp diff --git a/Sourcecode/private/mx/core/elements/HoleShape.h b/src/private/mx/core/elements/HoleShape.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleShape.h rename to src/private/mx/core/elements/HoleShape.h diff --git a/Sourcecode/private/mx/core/elements/HoleType.cpp b/src/private/mx/core/elements/HoleType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleType.cpp rename to src/private/mx/core/elements/HoleType.cpp diff --git a/Sourcecode/private/mx/core/elements/HoleType.h b/src/private/mx/core/elements/HoleType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/HoleType.h rename to src/private/mx/core/elements/HoleType.h diff --git a/Sourcecode/private/mx/core/elements/Humming.cpp b/src/private/mx/core/elements/Humming.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Humming.cpp rename to src/private/mx/core/elements/Humming.cpp diff --git a/Sourcecode/private/mx/core/elements/Humming.h b/src/private/mx/core/elements/Humming.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Humming.h rename to src/private/mx/core/elements/Humming.h diff --git a/Sourcecode/private/mx/core/elements/Identification.cpp b/src/private/mx/core/elements/Identification.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Identification.cpp rename to src/private/mx/core/elements/Identification.cpp diff --git a/Sourcecode/private/mx/core/elements/Identification.h b/src/private/mx/core/elements/Identification.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Identification.h rename to src/private/mx/core/elements/Identification.h diff --git a/Sourcecode/private/mx/core/elements/Image.cpp b/src/private/mx/core/elements/Image.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Image.cpp rename to src/private/mx/core/elements/Image.cpp diff --git a/Sourcecode/private/mx/core/elements/Image.h b/src/private/mx/core/elements/Image.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Image.h rename to src/private/mx/core/elements/Image.h diff --git a/Sourcecode/private/mx/core/elements/ImageAttributes.cpp b/src/private/mx/core/elements/ImageAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ImageAttributes.cpp rename to src/private/mx/core/elements/ImageAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ImageAttributes.h b/src/private/mx/core/elements/ImageAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ImageAttributes.h rename to src/private/mx/core/elements/ImageAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Instrument.cpp b/src/private/mx/core/elements/Instrument.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Instrument.cpp rename to src/private/mx/core/elements/Instrument.cpp diff --git a/Sourcecode/private/mx/core/elements/Instrument.h b/src/private/mx/core/elements/Instrument.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Instrument.h rename to src/private/mx/core/elements/Instrument.h diff --git a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp b/src/private/mx/core/elements/InstrumentAbbreviation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp rename to src/private/mx/core/elements/InstrumentAbbreviation.cpp diff --git a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h b/src/private/mx/core/elements/InstrumentAbbreviation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h rename to src/private/mx/core/elements/InstrumentAbbreviation.h diff --git a/Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp b/src/private/mx/core/elements/InstrumentAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp rename to src/private/mx/core/elements/InstrumentAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/InstrumentAttributes.h b/src/private/mx/core/elements/InstrumentAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InstrumentAttributes.h rename to src/private/mx/core/elements/InstrumentAttributes.h diff --git a/Sourcecode/private/mx/core/elements/InstrumentName.cpp b/src/private/mx/core/elements/InstrumentName.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InstrumentName.cpp rename to src/private/mx/core/elements/InstrumentName.cpp diff --git a/Sourcecode/private/mx/core/elements/InstrumentName.h b/src/private/mx/core/elements/InstrumentName.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InstrumentName.h rename to src/private/mx/core/elements/InstrumentName.h diff --git a/Sourcecode/private/mx/core/elements/InstrumentSound.cpp b/src/private/mx/core/elements/InstrumentSound.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InstrumentSound.cpp rename to src/private/mx/core/elements/InstrumentSound.cpp diff --git a/Sourcecode/private/mx/core/elements/InstrumentSound.h b/src/private/mx/core/elements/InstrumentSound.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InstrumentSound.h rename to src/private/mx/core/elements/InstrumentSound.h diff --git a/Sourcecode/private/mx/core/elements/Instruments.cpp b/src/private/mx/core/elements/Instruments.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Instruments.cpp rename to src/private/mx/core/elements/Instruments.cpp diff --git a/Sourcecode/private/mx/core/elements/Instruments.h b/src/private/mx/core/elements/Instruments.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Instruments.h rename to src/private/mx/core/elements/Instruments.h diff --git a/Sourcecode/private/mx/core/elements/Interchangeable.cpp b/src/private/mx/core/elements/Interchangeable.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Interchangeable.cpp rename to src/private/mx/core/elements/Interchangeable.cpp diff --git a/Sourcecode/private/mx/core/elements/Interchangeable.h b/src/private/mx/core/elements/Interchangeable.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Interchangeable.h rename to src/private/mx/core/elements/Interchangeable.h diff --git a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp b/src/private/mx/core/elements/InterchangeableAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp rename to src/private/mx/core/elements/InterchangeableAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.h b/src/private/mx/core/elements/InterchangeableAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InterchangeableAttributes.h rename to src/private/mx/core/elements/InterchangeableAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Inversion.cpp b/src/private/mx/core/elements/Inversion.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Inversion.cpp rename to src/private/mx/core/elements/Inversion.cpp diff --git a/Sourcecode/private/mx/core/elements/Inversion.h b/src/private/mx/core/elements/Inversion.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Inversion.h rename to src/private/mx/core/elements/Inversion.h diff --git a/Sourcecode/private/mx/core/elements/InversionAttributes.cpp b/src/private/mx/core/elements/InversionAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InversionAttributes.cpp rename to src/private/mx/core/elements/InversionAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/InversionAttributes.h b/src/private/mx/core/elements/InversionAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InversionAttributes.h rename to src/private/mx/core/elements/InversionAttributes.h diff --git a/Sourcecode/private/mx/core/elements/InvertedMordent.cpp b/src/private/mx/core/elements/InvertedMordent.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InvertedMordent.cpp rename to src/private/mx/core/elements/InvertedMordent.cpp diff --git a/Sourcecode/private/mx/core/elements/InvertedMordent.h b/src/private/mx/core/elements/InvertedMordent.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InvertedMordent.h rename to src/private/mx/core/elements/InvertedMordent.h diff --git a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp b/src/private/mx/core/elements/InvertedMordentAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp rename to src/private/mx/core/elements/InvertedMordentAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h b/src/private/mx/core/elements/InvertedMordentAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h rename to src/private/mx/core/elements/InvertedMordentAttributes.h diff --git a/Sourcecode/private/mx/core/elements/InvertedTurn.cpp b/src/private/mx/core/elements/InvertedTurn.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InvertedTurn.cpp rename to src/private/mx/core/elements/InvertedTurn.cpp diff --git a/Sourcecode/private/mx/core/elements/InvertedTurn.h b/src/private/mx/core/elements/InvertedTurn.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InvertedTurn.h rename to src/private/mx/core/elements/InvertedTurn.h diff --git a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp b/src/private/mx/core/elements/InvertedTurnAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp rename to src/private/mx/core/elements/InvertedTurnAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h b/src/private/mx/core/elements/InvertedTurnAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h rename to src/private/mx/core/elements/InvertedTurnAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Ipa.cpp b/src/private/mx/core/elements/Ipa.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Ipa.cpp rename to src/private/mx/core/elements/Ipa.cpp diff --git a/Sourcecode/private/mx/core/elements/Ipa.h b/src/private/mx/core/elements/Ipa.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Ipa.h rename to src/private/mx/core/elements/Ipa.h diff --git a/Sourcecode/private/mx/core/elements/Key.cpp b/src/private/mx/core/elements/Key.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Key.cpp rename to src/private/mx/core/elements/Key.cpp diff --git a/Sourcecode/private/mx/core/elements/Key.h b/src/private/mx/core/elements/Key.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Key.h rename to src/private/mx/core/elements/Key.h diff --git a/Sourcecode/private/mx/core/elements/KeyAccidental.cpp b/src/private/mx/core/elements/KeyAccidental.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyAccidental.cpp rename to src/private/mx/core/elements/KeyAccidental.cpp diff --git a/Sourcecode/private/mx/core/elements/KeyAccidental.h b/src/private/mx/core/elements/KeyAccidental.h similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyAccidental.h rename to src/private/mx/core/elements/KeyAccidental.h diff --git a/Sourcecode/private/mx/core/elements/KeyAlter.cpp b/src/private/mx/core/elements/KeyAlter.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyAlter.cpp rename to src/private/mx/core/elements/KeyAlter.cpp diff --git a/Sourcecode/private/mx/core/elements/KeyAlter.h b/src/private/mx/core/elements/KeyAlter.h similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyAlter.h rename to src/private/mx/core/elements/KeyAlter.h diff --git a/Sourcecode/private/mx/core/elements/KeyAttributes.cpp b/src/private/mx/core/elements/KeyAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyAttributes.cpp rename to src/private/mx/core/elements/KeyAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/KeyAttributes.h b/src/private/mx/core/elements/KeyAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyAttributes.h rename to src/private/mx/core/elements/KeyAttributes.h diff --git a/Sourcecode/private/mx/core/elements/KeyChoice.cpp b/src/private/mx/core/elements/KeyChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyChoice.cpp rename to src/private/mx/core/elements/KeyChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/KeyChoice.h b/src/private/mx/core/elements/KeyChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyChoice.h rename to src/private/mx/core/elements/KeyChoice.h diff --git a/Sourcecode/private/mx/core/elements/KeyOctave.cpp b/src/private/mx/core/elements/KeyOctave.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyOctave.cpp rename to src/private/mx/core/elements/KeyOctave.cpp diff --git a/Sourcecode/private/mx/core/elements/KeyOctave.h b/src/private/mx/core/elements/KeyOctave.h similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyOctave.h rename to src/private/mx/core/elements/KeyOctave.h diff --git a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp b/src/private/mx/core/elements/KeyOctaveAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp rename to src/private/mx/core/elements/KeyOctaveAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h b/src/private/mx/core/elements/KeyOctaveAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h rename to src/private/mx/core/elements/KeyOctaveAttributes.h diff --git a/Sourcecode/private/mx/core/elements/KeyStep.cpp b/src/private/mx/core/elements/KeyStep.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyStep.cpp rename to src/private/mx/core/elements/KeyStep.cpp diff --git a/Sourcecode/private/mx/core/elements/KeyStep.h b/src/private/mx/core/elements/KeyStep.h similarity index 100% rename from Sourcecode/private/mx/core/elements/KeyStep.h rename to src/private/mx/core/elements/KeyStep.h diff --git a/Sourcecode/private/mx/core/elements/Kind.cpp b/src/private/mx/core/elements/Kind.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Kind.cpp rename to src/private/mx/core/elements/Kind.cpp diff --git a/Sourcecode/private/mx/core/elements/Kind.h b/src/private/mx/core/elements/Kind.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Kind.h rename to src/private/mx/core/elements/Kind.h diff --git a/Sourcecode/private/mx/core/elements/KindAttributes.cpp b/src/private/mx/core/elements/KindAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/KindAttributes.cpp rename to src/private/mx/core/elements/KindAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/KindAttributes.h b/src/private/mx/core/elements/KindAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/KindAttributes.h rename to src/private/mx/core/elements/KindAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Laughing.cpp b/src/private/mx/core/elements/Laughing.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Laughing.cpp rename to src/private/mx/core/elements/Laughing.cpp diff --git a/Sourcecode/private/mx/core/elements/Laughing.h b/src/private/mx/core/elements/Laughing.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Laughing.h rename to src/private/mx/core/elements/Laughing.h diff --git a/Sourcecode/private/mx/core/elements/LayoutGroup.cpp b/src/private/mx/core/elements/LayoutGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LayoutGroup.cpp rename to src/private/mx/core/elements/LayoutGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/LayoutGroup.h b/src/private/mx/core/elements/LayoutGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LayoutGroup.h rename to src/private/mx/core/elements/LayoutGroup.h diff --git a/Sourcecode/private/mx/core/elements/LeftDivider.cpp b/src/private/mx/core/elements/LeftDivider.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LeftDivider.cpp rename to src/private/mx/core/elements/LeftDivider.cpp diff --git a/Sourcecode/private/mx/core/elements/LeftDivider.h b/src/private/mx/core/elements/LeftDivider.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LeftDivider.h rename to src/private/mx/core/elements/LeftDivider.h diff --git a/Sourcecode/private/mx/core/elements/LeftMargin.cpp b/src/private/mx/core/elements/LeftMargin.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LeftMargin.cpp rename to src/private/mx/core/elements/LeftMargin.cpp diff --git a/Sourcecode/private/mx/core/elements/LeftMargin.h b/src/private/mx/core/elements/LeftMargin.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LeftMargin.h rename to src/private/mx/core/elements/LeftMargin.h diff --git a/Sourcecode/private/mx/core/elements/Level.cpp b/src/private/mx/core/elements/Level.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Level.cpp rename to src/private/mx/core/elements/Level.cpp diff --git a/Sourcecode/private/mx/core/elements/Level.h b/src/private/mx/core/elements/Level.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Level.h rename to src/private/mx/core/elements/Level.h diff --git a/Sourcecode/private/mx/core/elements/LevelAttributes.cpp b/src/private/mx/core/elements/LevelAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LevelAttributes.cpp rename to src/private/mx/core/elements/LevelAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/LevelAttributes.h b/src/private/mx/core/elements/LevelAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LevelAttributes.h rename to src/private/mx/core/elements/LevelAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Line.cpp b/src/private/mx/core/elements/Line.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Line.cpp rename to src/private/mx/core/elements/Line.cpp diff --git a/Sourcecode/private/mx/core/elements/Line.h b/src/private/mx/core/elements/Line.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Line.h rename to src/private/mx/core/elements/Line.h diff --git a/Sourcecode/private/mx/core/elements/LineWidth.cpp b/src/private/mx/core/elements/LineWidth.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LineWidth.cpp rename to src/private/mx/core/elements/LineWidth.cpp diff --git a/Sourcecode/private/mx/core/elements/LineWidth.h b/src/private/mx/core/elements/LineWidth.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LineWidth.h rename to src/private/mx/core/elements/LineWidth.h diff --git a/Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp b/src/private/mx/core/elements/LineWidthAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp rename to src/private/mx/core/elements/LineWidthAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/LineWidthAttributes.h b/src/private/mx/core/elements/LineWidthAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LineWidthAttributes.h rename to src/private/mx/core/elements/LineWidthAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Link.cpp b/src/private/mx/core/elements/Link.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Link.cpp rename to src/private/mx/core/elements/Link.cpp diff --git a/Sourcecode/private/mx/core/elements/Link.h b/src/private/mx/core/elements/Link.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Link.h rename to src/private/mx/core/elements/Link.h diff --git a/Sourcecode/private/mx/core/elements/LinkAttributes.cpp b/src/private/mx/core/elements/LinkAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LinkAttributes.cpp rename to src/private/mx/core/elements/LinkAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/LinkAttributes.h b/src/private/mx/core/elements/LinkAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LinkAttributes.h rename to src/private/mx/core/elements/LinkAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Lyric.cpp b/src/private/mx/core/elements/Lyric.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Lyric.cpp rename to src/private/mx/core/elements/Lyric.cpp diff --git a/Sourcecode/private/mx/core/elements/Lyric.h b/src/private/mx/core/elements/Lyric.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Lyric.h rename to src/private/mx/core/elements/Lyric.h diff --git a/Sourcecode/private/mx/core/elements/LyricAttributes.cpp b/src/private/mx/core/elements/LyricAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricAttributes.cpp rename to src/private/mx/core/elements/LyricAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/LyricAttributes.h b/src/private/mx/core/elements/LyricAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricAttributes.h rename to src/private/mx/core/elements/LyricAttributes.h diff --git a/Sourcecode/private/mx/core/elements/LyricFont.cpp b/src/private/mx/core/elements/LyricFont.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricFont.cpp rename to src/private/mx/core/elements/LyricFont.cpp diff --git a/Sourcecode/private/mx/core/elements/LyricFont.h b/src/private/mx/core/elements/LyricFont.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricFont.h rename to src/private/mx/core/elements/LyricFont.h diff --git a/Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp b/src/private/mx/core/elements/LyricFontAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp rename to src/private/mx/core/elements/LyricFontAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/LyricFontAttributes.h b/src/private/mx/core/elements/LyricFontAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricFontAttributes.h rename to src/private/mx/core/elements/LyricFontAttributes.h diff --git a/Sourcecode/private/mx/core/elements/LyricLanguage.cpp b/src/private/mx/core/elements/LyricLanguage.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricLanguage.cpp rename to src/private/mx/core/elements/LyricLanguage.cpp diff --git a/Sourcecode/private/mx/core/elements/LyricLanguage.h b/src/private/mx/core/elements/LyricLanguage.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricLanguage.h rename to src/private/mx/core/elements/LyricLanguage.h diff --git a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp b/src/private/mx/core/elements/LyricLanguageAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp rename to src/private/mx/core/elements/LyricLanguageAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h b/src/private/mx/core/elements/LyricLanguageAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h rename to src/private/mx/core/elements/LyricLanguageAttributes.h diff --git a/Sourcecode/private/mx/core/elements/LyricTextChoice.cpp b/src/private/mx/core/elements/LyricTextChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricTextChoice.cpp rename to src/private/mx/core/elements/LyricTextChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/LyricTextChoice.h b/src/private/mx/core/elements/LyricTextChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/LyricTextChoice.h rename to src/private/mx/core/elements/LyricTextChoice.h diff --git a/Sourcecode/private/mx/core/elements/MeasureAttributes.cpp b/src/private/mx/core/elements/MeasureAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureAttributes.cpp rename to src/private/mx/core/elements/MeasureAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureAttributes.h b/src/private/mx/core/elements/MeasureAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureAttributes.h rename to src/private/mx/core/elements/MeasureAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MeasureDistance.cpp b/src/private/mx/core/elements/MeasureDistance.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureDistance.cpp rename to src/private/mx/core/elements/MeasureDistance.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureDistance.h b/src/private/mx/core/elements/MeasureDistance.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureDistance.h rename to src/private/mx/core/elements/MeasureDistance.h diff --git a/Sourcecode/private/mx/core/elements/MeasureLayout.cpp b/src/private/mx/core/elements/MeasureLayout.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureLayout.cpp rename to src/private/mx/core/elements/MeasureLayout.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureLayout.h b/src/private/mx/core/elements/MeasureLayout.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureLayout.h rename to src/private/mx/core/elements/MeasureLayout.h diff --git a/Sourcecode/private/mx/core/elements/MeasureNumbering.cpp b/src/private/mx/core/elements/MeasureNumbering.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureNumbering.cpp rename to src/private/mx/core/elements/MeasureNumbering.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureNumbering.h b/src/private/mx/core/elements/MeasureNumbering.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureNumbering.h rename to src/private/mx/core/elements/MeasureNumbering.h diff --git a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp b/src/private/mx/core/elements/MeasureNumberingAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp rename to src/private/mx/core/elements/MeasureNumberingAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h b/src/private/mx/core/elements/MeasureNumberingAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h rename to src/private/mx/core/elements/MeasureNumberingAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeat.cpp b/src/private/mx/core/elements/MeasureRepeat.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureRepeat.cpp rename to src/private/mx/core/elements/MeasureRepeat.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeat.h b/src/private/mx/core/elements/MeasureRepeat.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureRepeat.h rename to src/private/mx/core/elements/MeasureRepeat.h diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp b/src/private/mx/core/elements/MeasureRepeatAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp rename to src/private/mx/core/elements/MeasureRepeatAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h b/src/private/mx/core/elements/MeasureRepeatAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h rename to src/private/mx/core/elements/MeasureRepeatAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MeasureStyle.cpp b/src/private/mx/core/elements/MeasureStyle.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureStyle.cpp rename to src/private/mx/core/elements/MeasureStyle.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureStyle.h b/src/private/mx/core/elements/MeasureStyle.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureStyle.h rename to src/private/mx/core/elements/MeasureStyle.h diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp b/src/private/mx/core/elements/MeasureStyleAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp rename to src/private/mx/core/elements/MeasureStyleAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h b/src/private/mx/core/elements/MeasureStyleAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h rename to src/private/mx/core/elements/MeasureStyleAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp b/src/private/mx/core/elements/MeasureStyleChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp rename to src/private/mx/core/elements/MeasureStyleChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.h b/src/private/mx/core/elements/MeasureStyleChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MeasureStyleChoice.h rename to src/private/mx/core/elements/MeasureStyleChoice.h diff --git a/Sourcecode/private/mx/core/elements/Membrane.cpp b/src/private/mx/core/elements/Membrane.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Membrane.cpp rename to src/private/mx/core/elements/Membrane.cpp diff --git a/Sourcecode/private/mx/core/elements/Membrane.h b/src/private/mx/core/elements/Membrane.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Membrane.h rename to src/private/mx/core/elements/Membrane.h diff --git a/Sourcecode/private/mx/core/elements/Metal.cpp b/src/private/mx/core/elements/Metal.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Metal.cpp rename to src/private/mx/core/elements/Metal.cpp diff --git a/Sourcecode/private/mx/core/elements/Metal.h b/src/private/mx/core/elements/Metal.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Metal.h rename to src/private/mx/core/elements/Metal.h diff --git a/Sourcecode/private/mx/core/elements/Metronome.cpp b/src/private/mx/core/elements/Metronome.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Metronome.cpp rename to src/private/mx/core/elements/Metronome.cpp diff --git a/Sourcecode/private/mx/core/elements/Metronome.h b/src/private/mx/core/elements/Metronome.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Metronome.h rename to src/private/mx/core/elements/Metronome.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp b/src/private/mx/core/elements/MetronomeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp rename to src/private/mx/core/elements/MetronomeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeAttributes.h b/src/private/mx/core/elements/MetronomeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeAttributes.h rename to src/private/mx/core/elements/MetronomeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeam.cpp b/src/private/mx/core/elements/MetronomeBeam.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeBeam.cpp rename to src/private/mx/core/elements/MetronomeBeam.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeam.h b/src/private/mx/core/elements/MetronomeBeam.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeBeam.h rename to src/private/mx/core/elements/MetronomeBeam.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp b/src/private/mx/core/elements/MetronomeBeamAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp rename to src/private/mx/core/elements/MetronomeBeamAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h b/src/private/mx/core/elements/MetronomeBeamAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h rename to src/private/mx/core/elements/MetronomeBeamAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeDot.cpp b/src/private/mx/core/elements/MetronomeDot.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeDot.cpp rename to src/private/mx/core/elements/MetronomeDot.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeDot.h b/src/private/mx/core/elements/MetronomeDot.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeDot.h rename to src/private/mx/core/elements/MetronomeDot.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeNote.cpp b/src/private/mx/core/elements/MetronomeNote.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeNote.cpp rename to src/private/mx/core/elements/MetronomeNote.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeNote.h b/src/private/mx/core/elements/MetronomeNote.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeNote.h rename to src/private/mx/core/elements/MetronomeNote.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelation.cpp b/src/private/mx/core/elements/MetronomeRelation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeRelation.cpp rename to src/private/mx/core/elements/MetronomeRelation.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelation.h b/src/private/mx/core/elements/MetronomeRelation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeRelation.h rename to src/private/mx/core/elements/MetronomeRelation.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp b/src/private/mx/core/elements/MetronomeRelationGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp rename to src/private/mx/core/elements/MetronomeRelationGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h b/src/private/mx/core/elements/MetronomeRelationGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h rename to src/private/mx/core/elements/MetronomeRelationGroup.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp b/src/private/mx/core/elements/MetronomeTuplet.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp rename to src/private/mx/core/elements/MetronomeTuplet.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeTuplet.h b/src/private/mx/core/elements/MetronomeTuplet.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeTuplet.h rename to src/private/mx/core/elements/MetronomeTuplet.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp b/src/private/mx/core/elements/MetronomeTupletAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp rename to src/private/mx/core/elements/MetronomeTupletAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h b/src/private/mx/core/elements/MetronomeTupletAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h rename to src/private/mx/core/elements/MetronomeTupletAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MetronomeType.cpp b/src/private/mx/core/elements/MetronomeType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeType.cpp rename to src/private/mx/core/elements/MetronomeType.cpp diff --git a/Sourcecode/private/mx/core/elements/MetronomeType.h b/src/private/mx/core/elements/MetronomeType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MetronomeType.h rename to src/private/mx/core/elements/MetronomeType.h diff --git a/Sourcecode/private/mx/core/elements/MidiBank.cpp b/src/private/mx/core/elements/MidiBank.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiBank.cpp rename to src/private/mx/core/elements/MidiBank.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiBank.h b/src/private/mx/core/elements/MidiBank.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiBank.h rename to src/private/mx/core/elements/MidiBank.h diff --git a/Sourcecode/private/mx/core/elements/MidiChannel.cpp b/src/private/mx/core/elements/MidiChannel.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiChannel.cpp rename to src/private/mx/core/elements/MidiChannel.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiChannel.h b/src/private/mx/core/elements/MidiChannel.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiChannel.h rename to src/private/mx/core/elements/MidiChannel.h diff --git a/Sourcecode/private/mx/core/elements/MidiDevice.cpp b/src/private/mx/core/elements/MidiDevice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiDevice.cpp rename to src/private/mx/core/elements/MidiDevice.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiDevice.h b/src/private/mx/core/elements/MidiDevice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiDevice.h rename to src/private/mx/core/elements/MidiDevice.h diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp b/src/private/mx/core/elements/MidiDeviceAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp rename to src/private/mx/core/elements/MidiDeviceAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h b/src/private/mx/core/elements/MidiDeviceAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h rename to src/private/mx/core/elements/MidiDeviceAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp b/src/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp rename to src/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h b/src/private/mx/core/elements/MidiDeviceInstrumentGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h rename to src/private/mx/core/elements/MidiDeviceInstrumentGroup.h diff --git a/Sourcecode/private/mx/core/elements/MidiInstrument.cpp b/src/private/mx/core/elements/MidiInstrument.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiInstrument.cpp rename to src/private/mx/core/elements/MidiInstrument.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiInstrument.h b/src/private/mx/core/elements/MidiInstrument.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiInstrument.h rename to src/private/mx/core/elements/MidiInstrument.h diff --git a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp b/src/private/mx/core/elements/MidiInstrumentAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp rename to src/private/mx/core/elements/MidiInstrumentAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h b/src/private/mx/core/elements/MidiInstrumentAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h rename to src/private/mx/core/elements/MidiInstrumentAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MidiName.cpp b/src/private/mx/core/elements/MidiName.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiName.cpp rename to src/private/mx/core/elements/MidiName.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiName.h b/src/private/mx/core/elements/MidiName.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiName.h rename to src/private/mx/core/elements/MidiName.h diff --git a/Sourcecode/private/mx/core/elements/MidiProgram.cpp b/src/private/mx/core/elements/MidiProgram.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiProgram.cpp rename to src/private/mx/core/elements/MidiProgram.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiProgram.h b/src/private/mx/core/elements/MidiProgram.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiProgram.h rename to src/private/mx/core/elements/MidiProgram.h diff --git a/Sourcecode/private/mx/core/elements/MidiUnpitched.cpp b/src/private/mx/core/elements/MidiUnpitched.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiUnpitched.cpp rename to src/private/mx/core/elements/MidiUnpitched.cpp diff --git a/Sourcecode/private/mx/core/elements/MidiUnpitched.h b/src/private/mx/core/elements/MidiUnpitched.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MidiUnpitched.h rename to src/private/mx/core/elements/MidiUnpitched.h diff --git a/Sourcecode/private/mx/core/elements/Millimeters.cpp b/src/private/mx/core/elements/Millimeters.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Millimeters.cpp rename to src/private/mx/core/elements/Millimeters.cpp diff --git a/Sourcecode/private/mx/core/elements/Millimeters.h b/src/private/mx/core/elements/Millimeters.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Millimeters.h rename to src/private/mx/core/elements/Millimeters.h diff --git a/Sourcecode/private/mx/core/elements/Miscellaneous.cpp b/src/private/mx/core/elements/Miscellaneous.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Miscellaneous.cpp rename to src/private/mx/core/elements/Miscellaneous.cpp diff --git a/Sourcecode/private/mx/core/elements/Miscellaneous.h b/src/private/mx/core/elements/Miscellaneous.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Miscellaneous.h rename to src/private/mx/core/elements/Miscellaneous.h diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousField.cpp b/src/private/mx/core/elements/MiscellaneousField.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MiscellaneousField.cpp rename to src/private/mx/core/elements/MiscellaneousField.cpp diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousField.h b/src/private/mx/core/elements/MiscellaneousField.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MiscellaneousField.h rename to src/private/mx/core/elements/MiscellaneousField.h diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp b/src/private/mx/core/elements/MiscellaneousFieldAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp rename to src/private/mx/core/elements/MiscellaneousFieldAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h b/src/private/mx/core/elements/MiscellaneousFieldAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h rename to src/private/mx/core/elements/MiscellaneousFieldAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Mode.cpp b/src/private/mx/core/elements/Mode.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Mode.cpp rename to src/private/mx/core/elements/Mode.cpp diff --git a/Sourcecode/private/mx/core/elements/Mode.h b/src/private/mx/core/elements/Mode.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Mode.h rename to src/private/mx/core/elements/Mode.h diff --git a/Sourcecode/private/mx/core/elements/Mordent.cpp b/src/private/mx/core/elements/Mordent.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Mordent.cpp rename to src/private/mx/core/elements/Mordent.cpp diff --git a/Sourcecode/private/mx/core/elements/Mordent.h b/src/private/mx/core/elements/Mordent.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Mordent.h rename to src/private/mx/core/elements/Mordent.h diff --git a/Sourcecode/private/mx/core/elements/MordentAttributes.cpp b/src/private/mx/core/elements/MordentAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MordentAttributes.cpp rename to src/private/mx/core/elements/MordentAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MordentAttributes.h b/src/private/mx/core/elements/MordentAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MordentAttributes.h rename to src/private/mx/core/elements/MordentAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MovementNumber.cpp b/src/private/mx/core/elements/MovementNumber.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MovementNumber.cpp rename to src/private/mx/core/elements/MovementNumber.cpp diff --git a/Sourcecode/private/mx/core/elements/MovementNumber.h b/src/private/mx/core/elements/MovementNumber.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MovementNumber.h rename to src/private/mx/core/elements/MovementNumber.h diff --git a/Sourcecode/private/mx/core/elements/MovementTitle.cpp b/src/private/mx/core/elements/MovementTitle.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MovementTitle.cpp rename to src/private/mx/core/elements/MovementTitle.cpp diff --git a/Sourcecode/private/mx/core/elements/MovementTitle.h b/src/private/mx/core/elements/MovementTitle.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MovementTitle.h rename to src/private/mx/core/elements/MovementTitle.h diff --git a/Sourcecode/private/mx/core/elements/MultipleRest.cpp b/src/private/mx/core/elements/MultipleRest.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MultipleRest.cpp rename to src/private/mx/core/elements/MultipleRest.cpp diff --git a/Sourcecode/private/mx/core/elements/MultipleRest.h b/src/private/mx/core/elements/MultipleRest.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MultipleRest.h rename to src/private/mx/core/elements/MultipleRest.h diff --git a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp b/src/private/mx/core/elements/MultipleRestAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp rename to src/private/mx/core/elements/MultipleRestAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.h b/src/private/mx/core/elements/MultipleRestAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MultipleRestAttributes.h rename to src/private/mx/core/elements/MultipleRestAttributes.h diff --git a/Sourcecode/private/mx/core/elements/MusicDataChoice.cpp b/src/private/mx/core/elements/MusicDataChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MusicDataChoice.cpp rename to src/private/mx/core/elements/MusicDataChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/MusicDataChoice.h b/src/private/mx/core/elements/MusicDataChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MusicDataChoice.h rename to src/private/mx/core/elements/MusicDataChoice.h diff --git a/Sourcecode/private/mx/core/elements/MusicDataGroup.cpp b/src/private/mx/core/elements/MusicDataGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MusicDataGroup.cpp rename to src/private/mx/core/elements/MusicDataGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/MusicDataGroup.h b/src/private/mx/core/elements/MusicDataGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MusicDataGroup.h rename to src/private/mx/core/elements/MusicDataGroup.h diff --git a/Sourcecode/private/mx/core/elements/MusicFont.cpp b/src/private/mx/core/elements/MusicFont.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/MusicFont.cpp rename to src/private/mx/core/elements/MusicFont.cpp diff --git a/Sourcecode/private/mx/core/elements/MusicFont.h b/src/private/mx/core/elements/MusicFont.h similarity index 100% rename from Sourcecode/private/mx/core/elements/MusicFont.h rename to src/private/mx/core/elements/MusicFont.h diff --git a/Sourcecode/private/mx/core/elements/Mute.cpp b/src/private/mx/core/elements/Mute.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Mute.cpp rename to src/private/mx/core/elements/Mute.cpp diff --git a/Sourcecode/private/mx/core/elements/Mute.h b/src/private/mx/core/elements/Mute.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Mute.h rename to src/private/mx/core/elements/Mute.h diff --git a/Sourcecode/private/mx/core/elements/Natural.cpp b/src/private/mx/core/elements/Natural.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Natural.cpp rename to src/private/mx/core/elements/Natural.cpp diff --git a/Sourcecode/private/mx/core/elements/Natural.h b/src/private/mx/core/elements/Natural.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Natural.h rename to src/private/mx/core/elements/Natural.h diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiate.cpp b/src/private/mx/core/elements/NonArpeggiate.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NonArpeggiate.cpp rename to src/private/mx/core/elements/NonArpeggiate.cpp diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiate.h b/src/private/mx/core/elements/NonArpeggiate.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NonArpeggiate.h rename to src/private/mx/core/elements/NonArpeggiate.h diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp b/src/private/mx/core/elements/NonArpeggiateAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp rename to src/private/mx/core/elements/NonArpeggiateAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h b/src/private/mx/core/elements/NonArpeggiateAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h rename to src/private/mx/core/elements/NonArpeggiateAttributes.h diff --git a/Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp b/src/private/mx/core/elements/NonTraditionalKey.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp rename to src/private/mx/core/elements/NonTraditionalKey.cpp diff --git a/Sourcecode/private/mx/core/elements/NonTraditionalKey.h b/src/private/mx/core/elements/NonTraditionalKey.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NonTraditionalKey.h rename to src/private/mx/core/elements/NonTraditionalKey.h diff --git a/Sourcecode/private/mx/core/elements/NormalDot.cpp b/src/private/mx/core/elements/NormalDot.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalDot.cpp rename to src/private/mx/core/elements/NormalDot.cpp diff --git a/Sourcecode/private/mx/core/elements/NormalDot.h b/src/private/mx/core/elements/NormalDot.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalDot.h rename to src/private/mx/core/elements/NormalDot.h diff --git a/Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp b/src/private/mx/core/elements/NormalNoteGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp rename to src/private/mx/core/elements/NormalNoteGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/NormalNoteGroup.h b/src/private/mx/core/elements/NormalNoteGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalNoteGroup.h rename to src/private/mx/core/elements/NormalNoteGroup.h diff --git a/Sourcecode/private/mx/core/elements/NormalNotes.cpp b/src/private/mx/core/elements/NormalNotes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalNotes.cpp rename to src/private/mx/core/elements/NormalNotes.cpp diff --git a/Sourcecode/private/mx/core/elements/NormalNotes.h b/src/private/mx/core/elements/NormalNotes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalNotes.h rename to src/private/mx/core/elements/NormalNotes.h diff --git a/Sourcecode/private/mx/core/elements/NormalType.cpp b/src/private/mx/core/elements/NormalType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalType.cpp rename to src/private/mx/core/elements/NormalType.cpp diff --git a/Sourcecode/private/mx/core/elements/NormalType.h b/src/private/mx/core/elements/NormalType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalType.h rename to src/private/mx/core/elements/NormalType.h diff --git a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp b/src/private/mx/core/elements/NormalTypeNormalDotGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp rename to src/private/mx/core/elements/NormalTypeNormalDotGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h b/src/private/mx/core/elements/NormalTypeNormalDotGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h rename to src/private/mx/core/elements/NormalTypeNormalDotGroup.h diff --git a/Sourcecode/private/mx/core/elements/Notations.cpp b/src/private/mx/core/elements/Notations.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Notations.cpp rename to src/private/mx/core/elements/Notations.cpp diff --git a/Sourcecode/private/mx/core/elements/Notations.h b/src/private/mx/core/elements/Notations.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Notations.h rename to src/private/mx/core/elements/Notations.h diff --git a/Sourcecode/private/mx/core/elements/NotationsAttributes.cpp b/src/private/mx/core/elements/NotationsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NotationsAttributes.cpp rename to src/private/mx/core/elements/NotationsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/NotationsAttributes.h b/src/private/mx/core/elements/NotationsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NotationsAttributes.h rename to src/private/mx/core/elements/NotationsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/NotationsChoice.cpp b/src/private/mx/core/elements/NotationsChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NotationsChoice.cpp rename to src/private/mx/core/elements/NotationsChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/NotationsChoice.h b/src/private/mx/core/elements/NotationsChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NotationsChoice.h rename to src/private/mx/core/elements/NotationsChoice.h diff --git a/Sourcecode/private/mx/core/elements/Note.cpp b/src/private/mx/core/elements/Note.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Note.cpp rename to src/private/mx/core/elements/Note.cpp diff --git a/Sourcecode/private/mx/core/elements/Note.h b/src/private/mx/core/elements/Note.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Note.h rename to src/private/mx/core/elements/Note.h diff --git a/Sourcecode/private/mx/core/elements/NoteAttributes.cpp b/src/private/mx/core/elements/NoteAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteAttributes.cpp rename to src/private/mx/core/elements/NoteAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/NoteAttributes.h b/src/private/mx/core/elements/NoteAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteAttributes.h rename to src/private/mx/core/elements/NoteAttributes.h diff --git a/Sourcecode/private/mx/core/elements/NoteChoice.cpp b/src/private/mx/core/elements/NoteChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteChoice.cpp rename to src/private/mx/core/elements/NoteChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/NoteChoice.h b/src/private/mx/core/elements/NoteChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteChoice.h rename to src/private/mx/core/elements/NoteChoice.h diff --git a/Sourcecode/private/mx/core/elements/NoteRelationNote.cpp b/src/private/mx/core/elements/NoteRelationNote.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteRelationNote.cpp rename to src/private/mx/core/elements/NoteRelationNote.cpp diff --git a/Sourcecode/private/mx/core/elements/NoteRelationNote.h b/src/private/mx/core/elements/NoteRelationNote.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteRelationNote.h rename to src/private/mx/core/elements/NoteRelationNote.h diff --git a/Sourcecode/private/mx/core/elements/NoteSize.cpp b/src/private/mx/core/elements/NoteSize.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteSize.cpp rename to src/private/mx/core/elements/NoteSize.cpp diff --git a/Sourcecode/private/mx/core/elements/NoteSize.h b/src/private/mx/core/elements/NoteSize.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteSize.h rename to src/private/mx/core/elements/NoteSize.h diff --git a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp b/src/private/mx/core/elements/NoteSizeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp rename to src/private/mx/core/elements/NoteSizeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.h b/src/private/mx/core/elements/NoteSizeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteSizeAttributes.h rename to src/private/mx/core/elements/NoteSizeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Notehead.cpp b/src/private/mx/core/elements/Notehead.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Notehead.cpp rename to src/private/mx/core/elements/Notehead.cpp diff --git a/Sourcecode/private/mx/core/elements/Notehead.h b/src/private/mx/core/elements/Notehead.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Notehead.h rename to src/private/mx/core/elements/Notehead.h diff --git a/Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp b/src/private/mx/core/elements/NoteheadAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp rename to src/private/mx/core/elements/NoteheadAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/NoteheadAttributes.h b/src/private/mx/core/elements/NoteheadAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteheadAttributes.h rename to src/private/mx/core/elements/NoteheadAttributes.h diff --git a/Sourcecode/private/mx/core/elements/NoteheadText.cpp b/src/private/mx/core/elements/NoteheadText.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteheadText.cpp rename to src/private/mx/core/elements/NoteheadText.cpp diff --git a/Sourcecode/private/mx/core/elements/NoteheadText.h b/src/private/mx/core/elements/NoteheadText.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteheadText.h rename to src/private/mx/core/elements/NoteheadText.h diff --git a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp b/src/private/mx/core/elements/NoteheadTextChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp rename to src/private/mx/core/elements/NoteheadTextChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.h b/src/private/mx/core/elements/NoteheadTextChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/NoteheadTextChoice.h rename to src/private/mx/core/elements/NoteheadTextChoice.h diff --git a/Sourcecode/private/mx/core/elements/Octave.cpp b/src/private/mx/core/elements/Octave.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Octave.cpp rename to src/private/mx/core/elements/Octave.cpp diff --git a/Sourcecode/private/mx/core/elements/Octave.h b/src/private/mx/core/elements/Octave.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Octave.h rename to src/private/mx/core/elements/Octave.h diff --git a/Sourcecode/private/mx/core/elements/OctaveChange.cpp b/src/private/mx/core/elements/OctaveChange.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OctaveChange.cpp rename to src/private/mx/core/elements/OctaveChange.cpp diff --git a/Sourcecode/private/mx/core/elements/OctaveChange.h b/src/private/mx/core/elements/OctaveChange.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OctaveChange.h rename to src/private/mx/core/elements/OctaveChange.h diff --git a/Sourcecode/private/mx/core/elements/OctaveShift.cpp b/src/private/mx/core/elements/OctaveShift.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OctaveShift.cpp rename to src/private/mx/core/elements/OctaveShift.cpp diff --git a/Sourcecode/private/mx/core/elements/OctaveShift.h b/src/private/mx/core/elements/OctaveShift.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OctaveShift.h rename to src/private/mx/core/elements/OctaveShift.h diff --git a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp b/src/private/mx/core/elements/OctaveShiftAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp rename to src/private/mx/core/elements/OctaveShiftAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h b/src/private/mx/core/elements/OctaveShiftAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h rename to src/private/mx/core/elements/OctaveShiftAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Offset.cpp b/src/private/mx/core/elements/Offset.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Offset.cpp rename to src/private/mx/core/elements/Offset.cpp diff --git a/Sourcecode/private/mx/core/elements/Offset.h b/src/private/mx/core/elements/Offset.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Offset.h rename to src/private/mx/core/elements/Offset.h diff --git a/Sourcecode/private/mx/core/elements/OffsetAttributes.cpp b/src/private/mx/core/elements/OffsetAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OffsetAttributes.cpp rename to src/private/mx/core/elements/OffsetAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OffsetAttributes.h b/src/private/mx/core/elements/OffsetAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OffsetAttributes.h rename to src/private/mx/core/elements/OffsetAttributes.h diff --git a/Sourcecode/private/mx/core/elements/OpenString.cpp b/src/private/mx/core/elements/OpenString.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OpenString.cpp rename to src/private/mx/core/elements/OpenString.cpp diff --git a/Sourcecode/private/mx/core/elements/OpenString.h b/src/private/mx/core/elements/OpenString.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OpenString.h rename to src/private/mx/core/elements/OpenString.h diff --git a/Sourcecode/private/mx/core/elements/Opus.cpp b/src/private/mx/core/elements/Opus.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Opus.cpp rename to src/private/mx/core/elements/Opus.cpp diff --git a/Sourcecode/private/mx/core/elements/Opus.h b/src/private/mx/core/elements/Opus.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Opus.h rename to src/private/mx/core/elements/Opus.h diff --git a/Sourcecode/private/mx/core/elements/OpusAttributes.cpp b/src/private/mx/core/elements/OpusAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OpusAttributes.cpp rename to src/private/mx/core/elements/OpusAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OpusAttributes.h b/src/private/mx/core/elements/OpusAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OpusAttributes.h rename to src/private/mx/core/elements/OpusAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Ornaments.cpp b/src/private/mx/core/elements/Ornaments.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Ornaments.cpp rename to src/private/mx/core/elements/Ornaments.cpp diff --git a/Sourcecode/private/mx/core/elements/Ornaments.h b/src/private/mx/core/elements/Ornaments.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Ornaments.h rename to src/private/mx/core/elements/Ornaments.h diff --git a/Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp b/src/private/mx/core/elements/OrnamentsChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp rename to src/private/mx/core/elements/OrnamentsChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/OrnamentsChoice.h b/src/private/mx/core/elements/OrnamentsChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OrnamentsChoice.h rename to src/private/mx/core/elements/OrnamentsChoice.h diff --git a/Sourcecode/private/mx/core/elements/OtherAppearance.cpp b/src/private/mx/core/elements/OtherAppearance.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherAppearance.cpp rename to src/private/mx/core/elements/OtherAppearance.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherAppearance.h b/src/private/mx/core/elements/OtherAppearance.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherAppearance.h rename to src/private/mx/core/elements/OtherAppearance.h diff --git a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp b/src/private/mx/core/elements/OtherAppearanceAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp rename to src/private/mx/core/elements/OtherAppearanceAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h b/src/private/mx/core/elements/OtherAppearanceAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h rename to src/private/mx/core/elements/OtherAppearanceAttributes.h diff --git a/Sourcecode/private/mx/core/elements/OtherArticulation.cpp b/src/private/mx/core/elements/OtherArticulation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherArticulation.cpp rename to src/private/mx/core/elements/OtherArticulation.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherArticulation.h b/src/private/mx/core/elements/OtherArticulation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherArticulation.h rename to src/private/mx/core/elements/OtherArticulation.h diff --git a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp b/src/private/mx/core/elements/OtherArticulationAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp rename to src/private/mx/core/elements/OtherArticulationAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h b/src/private/mx/core/elements/OtherArticulationAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h rename to src/private/mx/core/elements/OtherArticulationAttributes.h diff --git a/Sourcecode/private/mx/core/elements/OtherDirection.cpp b/src/private/mx/core/elements/OtherDirection.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherDirection.cpp rename to src/private/mx/core/elements/OtherDirection.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherDirection.h b/src/private/mx/core/elements/OtherDirection.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherDirection.h rename to src/private/mx/core/elements/OtherDirection.h diff --git a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp b/src/private/mx/core/elements/OtherDirectionAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp rename to src/private/mx/core/elements/OtherDirectionAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h b/src/private/mx/core/elements/OtherDirectionAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h rename to src/private/mx/core/elements/OtherDirectionAttributes.h diff --git a/Sourcecode/private/mx/core/elements/OtherNotation.cpp b/src/private/mx/core/elements/OtherNotation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherNotation.cpp rename to src/private/mx/core/elements/OtherNotation.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherNotation.h b/src/private/mx/core/elements/OtherNotation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherNotation.h rename to src/private/mx/core/elements/OtherNotation.h diff --git a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp b/src/private/mx/core/elements/OtherNotationAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp rename to src/private/mx/core/elements/OtherNotationAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.h b/src/private/mx/core/elements/OtherNotationAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherNotationAttributes.h rename to src/private/mx/core/elements/OtherNotationAttributes.h diff --git a/Sourcecode/private/mx/core/elements/OtherOrnament.cpp b/src/private/mx/core/elements/OtherOrnament.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherOrnament.cpp rename to src/private/mx/core/elements/OtherOrnament.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherOrnament.h b/src/private/mx/core/elements/OtherOrnament.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherOrnament.h rename to src/private/mx/core/elements/OtherOrnament.h diff --git a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp b/src/private/mx/core/elements/OtherOrnamentAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp rename to src/private/mx/core/elements/OtherOrnamentAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h b/src/private/mx/core/elements/OtherOrnamentAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h rename to src/private/mx/core/elements/OtherOrnamentAttributes.h diff --git a/Sourcecode/private/mx/core/elements/OtherPercussion.cpp b/src/private/mx/core/elements/OtherPercussion.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherPercussion.cpp rename to src/private/mx/core/elements/OtherPercussion.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherPercussion.h b/src/private/mx/core/elements/OtherPercussion.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherPercussion.h rename to src/private/mx/core/elements/OtherPercussion.h diff --git a/Sourcecode/private/mx/core/elements/OtherPlay.cpp b/src/private/mx/core/elements/OtherPlay.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherPlay.cpp rename to src/private/mx/core/elements/OtherPlay.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherPlay.h b/src/private/mx/core/elements/OtherPlay.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherPlay.h rename to src/private/mx/core/elements/OtherPlay.h diff --git a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp b/src/private/mx/core/elements/OtherPlayAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp rename to src/private/mx/core/elements/OtherPlayAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.h b/src/private/mx/core/elements/OtherPlayAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherPlayAttributes.h rename to src/private/mx/core/elements/OtherPlayAttributes.h diff --git a/Sourcecode/private/mx/core/elements/OtherTechnical.cpp b/src/private/mx/core/elements/OtherTechnical.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherTechnical.cpp rename to src/private/mx/core/elements/OtherTechnical.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherTechnical.h b/src/private/mx/core/elements/OtherTechnical.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherTechnical.h rename to src/private/mx/core/elements/OtherTechnical.h diff --git a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp b/src/private/mx/core/elements/OtherTechnicalAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp rename to src/private/mx/core/elements/OtherTechnicalAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h b/src/private/mx/core/elements/OtherTechnicalAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h rename to src/private/mx/core/elements/OtherTechnicalAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PageHeight.cpp b/src/private/mx/core/elements/PageHeight.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PageHeight.cpp rename to src/private/mx/core/elements/PageHeight.cpp diff --git a/Sourcecode/private/mx/core/elements/PageHeight.h b/src/private/mx/core/elements/PageHeight.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PageHeight.h rename to src/private/mx/core/elements/PageHeight.h diff --git a/Sourcecode/private/mx/core/elements/PageLayout.cpp b/src/private/mx/core/elements/PageLayout.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PageLayout.cpp rename to src/private/mx/core/elements/PageLayout.cpp diff --git a/Sourcecode/private/mx/core/elements/PageLayout.h b/src/private/mx/core/elements/PageLayout.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PageLayout.h rename to src/private/mx/core/elements/PageLayout.h diff --git a/Sourcecode/private/mx/core/elements/PageMargins.cpp b/src/private/mx/core/elements/PageMargins.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PageMargins.cpp rename to src/private/mx/core/elements/PageMargins.cpp diff --git a/Sourcecode/private/mx/core/elements/PageMargins.h b/src/private/mx/core/elements/PageMargins.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PageMargins.h rename to src/private/mx/core/elements/PageMargins.h diff --git a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp b/src/private/mx/core/elements/PageMarginsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp rename to src/private/mx/core/elements/PageMarginsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.h b/src/private/mx/core/elements/PageMarginsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PageMarginsAttributes.h rename to src/private/mx/core/elements/PageMarginsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PageWidth.cpp b/src/private/mx/core/elements/PageWidth.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PageWidth.cpp rename to src/private/mx/core/elements/PageWidth.cpp diff --git a/Sourcecode/private/mx/core/elements/PageWidth.h b/src/private/mx/core/elements/PageWidth.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PageWidth.h rename to src/private/mx/core/elements/PageWidth.h diff --git a/Sourcecode/private/mx/core/elements/Pan.cpp b/src/private/mx/core/elements/Pan.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Pan.cpp rename to src/private/mx/core/elements/Pan.cpp diff --git a/Sourcecode/private/mx/core/elements/Pan.h b/src/private/mx/core/elements/Pan.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Pan.h rename to src/private/mx/core/elements/Pan.h diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviation.cpp b/src/private/mx/core/elements/PartAbbreviation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAbbreviation.cpp rename to src/private/mx/core/elements/PartAbbreviation.cpp diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviation.h b/src/private/mx/core/elements/PartAbbreviation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAbbreviation.h rename to src/private/mx/core/elements/PartAbbreviation.h diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp b/src/private/mx/core/elements/PartAbbreviationAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp rename to src/private/mx/core/elements/PartAbbreviationAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h b/src/private/mx/core/elements/PartAbbreviationAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h rename to src/private/mx/core/elements/PartAbbreviationAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp b/src/private/mx/core/elements/PartAbbreviationDisplay.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp rename to src/private/mx/core/elements/PartAbbreviationDisplay.cpp diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h b/src/private/mx/core/elements/PartAbbreviationDisplay.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h rename to src/private/mx/core/elements/PartAbbreviationDisplay.h diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp b/src/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp rename to src/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h b/src/private/mx/core/elements/PartAbbreviationDisplayAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h rename to src/private/mx/core/elements/PartAbbreviationDisplayAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PartAttributes.cpp b/src/private/mx/core/elements/PartAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAttributes.cpp rename to src/private/mx/core/elements/PartAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PartAttributes.h b/src/private/mx/core/elements/PartAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartAttributes.h rename to src/private/mx/core/elements/PartAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PartGroup.cpp b/src/private/mx/core/elements/PartGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartGroup.cpp rename to src/private/mx/core/elements/PartGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/PartGroup.h b/src/private/mx/core/elements/PartGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartGroup.h rename to src/private/mx/core/elements/PartGroup.h diff --git a/Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp b/src/private/mx/core/elements/PartGroupAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp rename to src/private/mx/core/elements/PartGroupAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PartGroupAttributes.h b/src/private/mx/core/elements/PartGroupAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartGroupAttributes.h rename to src/private/mx/core/elements/PartGroupAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp b/src/private/mx/core/elements/PartGroupOrScorePart.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp rename to src/private/mx/core/elements/PartGroupOrScorePart.cpp diff --git a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h b/src/private/mx/core/elements/PartGroupOrScorePart.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h rename to src/private/mx/core/elements/PartGroupOrScorePart.h diff --git a/Sourcecode/private/mx/core/elements/PartList.cpp b/src/private/mx/core/elements/PartList.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartList.cpp rename to src/private/mx/core/elements/PartList.cpp diff --git a/Sourcecode/private/mx/core/elements/PartList.h b/src/private/mx/core/elements/PartList.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartList.h rename to src/private/mx/core/elements/PartList.h diff --git a/Sourcecode/private/mx/core/elements/PartName.cpp b/src/private/mx/core/elements/PartName.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartName.cpp rename to src/private/mx/core/elements/PartName.cpp diff --git a/Sourcecode/private/mx/core/elements/PartName.h b/src/private/mx/core/elements/PartName.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartName.h rename to src/private/mx/core/elements/PartName.h diff --git a/Sourcecode/private/mx/core/elements/PartNameAttributes.cpp b/src/private/mx/core/elements/PartNameAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartNameAttributes.cpp rename to src/private/mx/core/elements/PartNameAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PartNameAttributes.h b/src/private/mx/core/elements/PartNameAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartNameAttributes.h rename to src/private/mx/core/elements/PartNameAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplay.cpp b/src/private/mx/core/elements/PartNameDisplay.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartNameDisplay.cpp rename to src/private/mx/core/elements/PartNameDisplay.cpp diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplay.h b/src/private/mx/core/elements/PartNameDisplay.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartNameDisplay.h rename to src/private/mx/core/elements/PartNameDisplay.h diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp b/src/private/mx/core/elements/PartNameDisplayAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp rename to src/private/mx/core/elements/PartNameDisplayAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h b/src/private/mx/core/elements/PartNameDisplayAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h rename to src/private/mx/core/elements/PartNameDisplayAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PartSymbol.cpp b/src/private/mx/core/elements/PartSymbol.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartSymbol.cpp rename to src/private/mx/core/elements/PartSymbol.cpp diff --git a/Sourcecode/private/mx/core/elements/PartSymbol.h b/src/private/mx/core/elements/PartSymbol.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartSymbol.h rename to src/private/mx/core/elements/PartSymbol.h diff --git a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp b/src/private/mx/core/elements/PartSymbolAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp rename to src/private/mx/core/elements/PartSymbolAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.h b/src/private/mx/core/elements/PartSymbolAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartSymbolAttributes.h rename to src/private/mx/core/elements/PartSymbolAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp b/src/private/mx/core/elements/PartwiseMeasure.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp rename to src/private/mx/core/elements/PartwiseMeasure.cpp diff --git a/Sourcecode/private/mx/core/elements/PartwiseMeasure.h b/src/private/mx/core/elements/PartwiseMeasure.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartwiseMeasure.h rename to src/private/mx/core/elements/PartwiseMeasure.h diff --git a/Sourcecode/private/mx/core/elements/PartwisePart.cpp b/src/private/mx/core/elements/PartwisePart.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PartwisePart.cpp rename to src/private/mx/core/elements/PartwisePart.cpp diff --git a/Sourcecode/private/mx/core/elements/PartwisePart.h b/src/private/mx/core/elements/PartwisePart.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PartwisePart.h rename to src/private/mx/core/elements/PartwisePart.h diff --git a/Sourcecode/private/mx/core/elements/Pedal.cpp b/src/private/mx/core/elements/Pedal.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Pedal.cpp rename to src/private/mx/core/elements/Pedal.cpp diff --git a/Sourcecode/private/mx/core/elements/Pedal.h b/src/private/mx/core/elements/Pedal.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Pedal.h rename to src/private/mx/core/elements/Pedal.h diff --git a/Sourcecode/private/mx/core/elements/PedalAlter.cpp b/src/private/mx/core/elements/PedalAlter.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PedalAlter.cpp rename to src/private/mx/core/elements/PedalAlter.cpp diff --git a/Sourcecode/private/mx/core/elements/PedalAlter.h b/src/private/mx/core/elements/PedalAlter.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PedalAlter.h rename to src/private/mx/core/elements/PedalAlter.h diff --git a/Sourcecode/private/mx/core/elements/PedalAttributes.cpp b/src/private/mx/core/elements/PedalAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PedalAttributes.cpp rename to src/private/mx/core/elements/PedalAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PedalAttributes.h b/src/private/mx/core/elements/PedalAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PedalAttributes.h rename to src/private/mx/core/elements/PedalAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PedalStep.cpp b/src/private/mx/core/elements/PedalStep.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PedalStep.cpp rename to src/private/mx/core/elements/PedalStep.cpp diff --git a/Sourcecode/private/mx/core/elements/PedalStep.h b/src/private/mx/core/elements/PedalStep.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PedalStep.h rename to src/private/mx/core/elements/PedalStep.h diff --git a/Sourcecode/private/mx/core/elements/PedalTuning.cpp b/src/private/mx/core/elements/PedalTuning.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PedalTuning.cpp rename to src/private/mx/core/elements/PedalTuning.cpp diff --git a/Sourcecode/private/mx/core/elements/PedalTuning.h b/src/private/mx/core/elements/PedalTuning.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PedalTuning.h rename to src/private/mx/core/elements/PedalTuning.h diff --git a/Sourcecode/private/mx/core/elements/PerMinute.cpp b/src/private/mx/core/elements/PerMinute.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PerMinute.cpp rename to src/private/mx/core/elements/PerMinute.cpp diff --git a/Sourcecode/private/mx/core/elements/PerMinute.h b/src/private/mx/core/elements/PerMinute.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PerMinute.h rename to src/private/mx/core/elements/PerMinute.h diff --git a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp b/src/private/mx/core/elements/PerMinuteAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp rename to src/private/mx/core/elements/PerMinuteAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.h b/src/private/mx/core/elements/PerMinuteAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PerMinuteAttributes.h rename to src/private/mx/core/elements/PerMinuteAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp b/src/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp rename to src/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h b/src/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h rename to src/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h diff --git a/Sourcecode/private/mx/core/elements/Percussion.cpp b/src/private/mx/core/elements/Percussion.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Percussion.cpp rename to src/private/mx/core/elements/Percussion.cpp diff --git a/Sourcecode/private/mx/core/elements/Percussion.h b/src/private/mx/core/elements/Percussion.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Percussion.h rename to src/private/mx/core/elements/Percussion.h diff --git a/Sourcecode/private/mx/core/elements/PercussionAttributes.cpp b/src/private/mx/core/elements/PercussionAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PercussionAttributes.cpp rename to src/private/mx/core/elements/PercussionAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PercussionAttributes.h b/src/private/mx/core/elements/PercussionAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PercussionAttributes.h rename to src/private/mx/core/elements/PercussionAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PercussionChoice.cpp b/src/private/mx/core/elements/PercussionChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PercussionChoice.cpp rename to src/private/mx/core/elements/PercussionChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/PercussionChoice.h b/src/private/mx/core/elements/PercussionChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PercussionChoice.h rename to src/private/mx/core/elements/PercussionChoice.h diff --git a/Sourcecode/private/mx/core/elements/Pitch.cpp b/src/private/mx/core/elements/Pitch.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Pitch.cpp rename to src/private/mx/core/elements/Pitch.cpp diff --git a/Sourcecode/private/mx/core/elements/Pitch.h b/src/private/mx/core/elements/Pitch.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Pitch.h rename to src/private/mx/core/elements/Pitch.h diff --git a/Sourcecode/private/mx/core/elements/Pitched.cpp b/src/private/mx/core/elements/Pitched.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Pitched.cpp rename to src/private/mx/core/elements/Pitched.cpp diff --git a/Sourcecode/private/mx/core/elements/Pitched.h b/src/private/mx/core/elements/Pitched.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Pitched.h rename to src/private/mx/core/elements/Pitched.h diff --git a/Sourcecode/private/mx/core/elements/Play.cpp b/src/private/mx/core/elements/Play.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Play.cpp rename to src/private/mx/core/elements/Play.cpp diff --git a/Sourcecode/private/mx/core/elements/Play.h b/src/private/mx/core/elements/Play.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Play.h rename to src/private/mx/core/elements/Play.h diff --git a/Sourcecode/private/mx/core/elements/PlayAttributes.cpp b/src/private/mx/core/elements/PlayAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PlayAttributes.cpp rename to src/private/mx/core/elements/PlayAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PlayAttributes.h b/src/private/mx/core/elements/PlayAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PlayAttributes.h rename to src/private/mx/core/elements/PlayAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Plop.cpp b/src/private/mx/core/elements/Plop.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Plop.cpp rename to src/private/mx/core/elements/Plop.cpp diff --git a/Sourcecode/private/mx/core/elements/Plop.h b/src/private/mx/core/elements/Plop.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Plop.h rename to src/private/mx/core/elements/Plop.h diff --git a/Sourcecode/private/mx/core/elements/Pluck.cpp b/src/private/mx/core/elements/Pluck.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Pluck.cpp rename to src/private/mx/core/elements/Pluck.cpp diff --git a/Sourcecode/private/mx/core/elements/Pluck.h b/src/private/mx/core/elements/Pluck.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Pluck.h rename to src/private/mx/core/elements/Pluck.h diff --git a/Sourcecode/private/mx/core/elements/PluckAttributes.cpp b/src/private/mx/core/elements/PluckAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PluckAttributes.cpp rename to src/private/mx/core/elements/PluckAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PluckAttributes.h b/src/private/mx/core/elements/PluckAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PluckAttributes.h rename to src/private/mx/core/elements/PluckAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PreBend.cpp b/src/private/mx/core/elements/PreBend.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PreBend.cpp rename to src/private/mx/core/elements/PreBend.cpp diff --git a/Sourcecode/private/mx/core/elements/PreBend.h b/src/private/mx/core/elements/PreBend.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PreBend.h rename to src/private/mx/core/elements/PreBend.h diff --git a/Sourcecode/private/mx/core/elements/Prefix.cpp b/src/private/mx/core/elements/Prefix.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Prefix.cpp rename to src/private/mx/core/elements/Prefix.cpp diff --git a/Sourcecode/private/mx/core/elements/Prefix.h b/src/private/mx/core/elements/Prefix.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Prefix.h rename to src/private/mx/core/elements/Prefix.h diff --git a/Sourcecode/private/mx/core/elements/PrefixAttributes.cpp b/src/private/mx/core/elements/PrefixAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PrefixAttributes.cpp rename to src/private/mx/core/elements/PrefixAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PrefixAttributes.h b/src/private/mx/core/elements/PrefixAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PrefixAttributes.h rename to src/private/mx/core/elements/PrefixAttributes.h diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoice.cpp b/src/private/mx/core/elements/PrincipalVoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PrincipalVoice.cpp rename to src/private/mx/core/elements/PrincipalVoice.cpp diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoice.h b/src/private/mx/core/elements/PrincipalVoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PrincipalVoice.h rename to src/private/mx/core/elements/PrincipalVoice.h diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp b/src/private/mx/core/elements/PrincipalVoiceAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp rename to src/private/mx/core/elements/PrincipalVoiceAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h b/src/private/mx/core/elements/PrincipalVoiceAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h rename to src/private/mx/core/elements/PrincipalVoiceAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Print.cpp b/src/private/mx/core/elements/Print.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Print.cpp rename to src/private/mx/core/elements/Print.cpp diff --git a/Sourcecode/private/mx/core/elements/Print.h b/src/private/mx/core/elements/Print.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Print.h rename to src/private/mx/core/elements/Print.h diff --git a/Sourcecode/private/mx/core/elements/PrintAttributes.cpp b/src/private/mx/core/elements/PrintAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PrintAttributes.cpp rename to src/private/mx/core/elements/PrintAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PrintAttributes.h b/src/private/mx/core/elements/PrintAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PrintAttributes.h rename to src/private/mx/core/elements/PrintAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Properties.cpp b/src/private/mx/core/elements/Properties.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Properties.cpp rename to src/private/mx/core/elements/Properties.cpp diff --git a/Sourcecode/private/mx/core/elements/Properties.h b/src/private/mx/core/elements/Properties.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Properties.h rename to src/private/mx/core/elements/Properties.h diff --git a/Sourcecode/private/mx/core/elements/PullOff.cpp b/src/private/mx/core/elements/PullOff.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PullOff.cpp rename to src/private/mx/core/elements/PullOff.cpp diff --git a/Sourcecode/private/mx/core/elements/PullOff.h b/src/private/mx/core/elements/PullOff.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PullOff.h rename to src/private/mx/core/elements/PullOff.h diff --git a/Sourcecode/private/mx/core/elements/PullOffAttributes.cpp b/src/private/mx/core/elements/PullOffAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/PullOffAttributes.cpp rename to src/private/mx/core/elements/PullOffAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/PullOffAttributes.h b/src/private/mx/core/elements/PullOffAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/PullOffAttributes.h rename to src/private/mx/core/elements/PullOffAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Rehearsal.cpp b/src/private/mx/core/elements/Rehearsal.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Rehearsal.cpp rename to src/private/mx/core/elements/Rehearsal.cpp diff --git a/Sourcecode/private/mx/core/elements/Rehearsal.h b/src/private/mx/core/elements/Rehearsal.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Rehearsal.h rename to src/private/mx/core/elements/Rehearsal.h diff --git a/Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp b/src/private/mx/core/elements/RehearsalAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp rename to src/private/mx/core/elements/RehearsalAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/RehearsalAttributes.h b/src/private/mx/core/elements/RehearsalAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RehearsalAttributes.h rename to src/private/mx/core/elements/RehearsalAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Relation.cpp b/src/private/mx/core/elements/Relation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Relation.cpp rename to src/private/mx/core/elements/Relation.cpp diff --git a/Sourcecode/private/mx/core/elements/Relation.h b/src/private/mx/core/elements/Relation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Relation.h rename to src/private/mx/core/elements/Relation.h diff --git a/Sourcecode/private/mx/core/elements/RelationAttributes.cpp b/src/private/mx/core/elements/RelationAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RelationAttributes.cpp rename to src/private/mx/core/elements/RelationAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/RelationAttributes.h b/src/private/mx/core/elements/RelationAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RelationAttributes.h rename to src/private/mx/core/elements/RelationAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Release.cpp b/src/private/mx/core/elements/Release.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Release.cpp rename to src/private/mx/core/elements/Release.cpp diff --git a/Sourcecode/private/mx/core/elements/Release.h b/src/private/mx/core/elements/Release.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Release.h rename to src/private/mx/core/elements/Release.h diff --git a/Sourcecode/private/mx/core/elements/Repeat.cpp b/src/private/mx/core/elements/Repeat.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Repeat.cpp rename to src/private/mx/core/elements/Repeat.cpp diff --git a/Sourcecode/private/mx/core/elements/Repeat.h b/src/private/mx/core/elements/Repeat.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Repeat.h rename to src/private/mx/core/elements/Repeat.h diff --git a/Sourcecode/private/mx/core/elements/RepeatAttributes.cpp b/src/private/mx/core/elements/RepeatAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RepeatAttributes.cpp rename to src/private/mx/core/elements/RepeatAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/RepeatAttributes.h b/src/private/mx/core/elements/RepeatAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RepeatAttributes.h rename to src/private/mx/core/elements/RepeatAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Rest.cpp b/src/private/mx/core/elements/Rest.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Rest.cpp rename to src/private/mx/core/elements/Rest.cpp diff --git a/Sourcecode/private/mx/core/elements/Rest.h b/src/private/mx/core/elements/Rest.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Rest.h rename to src/private/mx/core/elements/Rest.h diff --git a/Sourcecode/private/mx/core/elements/RestAttributes.cpp b/src/private/mx/core/elements/RestAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RestAttributes.cpp rename to src/private/mx/core/elements/RestAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/RestAttributes.h b/src/private/mx/core/elements/RestAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RestAttributes.h rename to src/private/mx/core/elements/RestAttributes.h diff --git a/Sourcecode/private/mx/core/elements/RightDivider.cpp b/src/private/mx/core/elements/RightDivider.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RightDivider.cpp rename to src/private/mx/core/elements/RightDivider.cpp diff --git a/Sourcecode/private/mx/core/elements/RightDivider.h b/src/private/mx/core/elements/RightDivider.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RightDivider.h rename to src/private/mx/core/elements/RightDivider.h diff --git a/Sourcecode/private/mx/core/elements/RightMargin.cpp b/src/private/mx/core/elements/RightMargin.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RightMargin.cpp rename to src/private/mx/core/elements/RightMargin.cpp diff --git a/Sourcecode/private/mx/core/elements/RightMargin.h b/src/private/mx/core/elements/RightMargin.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RightMargin.h rename to src/private/mx/core/elements/RightMargin.h diff --git a/Sourcecode/private/mx/core/elements/Rights.cpp b/src/private/mx/core/elements/Rights.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Rights.cpp rename to src/private/mx/core/elements/Rights.cpp diff --git a/Sourcecode/private/mx/core/elements/Rights.h b/src/private/mx/core/elements/Rights.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Rights.h rename to src/private/mx/core/elements/Rights.h diff --git a/Sourcecode/private/mx/core/elements/RightsAttributes.cpp b/src/private/mx/core/elements/RightsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RightsAttributes.cpp rename to src/private/mx/core/elements/RightsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/RightsAttributes.h b/src/private/mx/core/elements/RightsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RightsAttributes.h rename to src/private/mx/core/elements/RightsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Root.cpp b/src/private/mx/core/elements/Root.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Root.cpp rename to src/private/mx/core/elements/Root.cpp diff --git a/Sourcecode/private/mx/core/elements/Root.h b/src/private/mx/core/elements/Root.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Root.h rename to src/private/mx/core/elements/Root.h diff --git a/Sourcecode/private/mx/core/elements/RootAlter.cpp b/src/private/mx/core/elements/RootAlter.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RootAlter.cpp rename to src/private/mx/core/elements/RootAlter.cpp diff --git a/Sourcecode/private/mx/core/elements/RootAlter.h b/src/private/mx/core/elements/RootAlter.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RootAlter.h rename to src/private/mx/core/elements/RootAlter.h diff --git a/Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp b/src/private/mx/core/elements/RootAlterAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp rename to src/private/mx/core/elements/RootAlterAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/RootAlterAttributes.h b/src/private/mx/core/elements/RootAlterAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RootAlterAttributes.h rename to src/private/mx/core/elements/RootAlterAttributes.h diff --git a/Sourcecode/private/mx/core/elements/RootStep.cpp b/src/private/mx/core/elements/RootStep.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RootStep.cpp rename to src/private/mx/core/elements/RootStep.cpp diff --git a/Sourcecode/private/mx/core/elements/RootStep.h b/src/private/mx/core/elements/RootStep.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RootStep.h rename to src/private/mx/core/elements/RootStep.h diff --git a/Sourcecode/private/mx/core/elements/RootStepAttributes.cpp b/src/private/mx/core/elements/RootStepAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/RootStepAttributes.cpp rename to src/private/mx/core/elements/RootStepAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/RootStepAttributes.h b/src/private/mx/core/elements/RootStepAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/RootStepAttributes.h rename to src/private/mx/core/elements/RootStepAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Scaling.cpp b/src/private/mx/core/elements/Scaling.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Scaling.cpp rename to src/private/mx/core/elements/Scaling.cpp diff --git a/Sourcecode/private/mx/core/elements/Scaling.h b/src/private/mx/core/elements/Scaling.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Scaling.h rename to src/private/mx/core/elements/Scaling.h diff --git a/Sourcecode/private/mx/core/elements/Schleifer.cpp b/src/private/mx/core/elements/Schleifer.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Schleifer.cpp rename to src/private/mx/core/elements/Schleifer.cpp diff --git a/Sourcecode/private/mx/core/elements/Schleifer.h b/src/private/mx/core/elements/Schleifer.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Schleifer.h rename to src/private/mx/core/elements/Schleifer.h diff --git a/Sourcecode/private/mx/core/elements/Scoop.cpp b/src/private/mx/core/elements/Scoop.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Scoop.cpp rename to src/private/mx/core/elements/Scoop.cpp diff --git a/Sourcecode/private/mx/core/elements/Scoop.h b/src/private/mx/core/elements/Scoop.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Scoop.h rename to src/private/mx/core/elements/Scoop.h diff --git a/Sourcecode/private/mx/core/elements/Scordatura.cpp b/src/private/mx/core/elements/Scordatura.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Scordatura.cpp rename to src/private/mx/core/elements/Scordatura.cpp diff --git a/Sourcecode/private/mx/core/elements/Scordatura.h b/src/private/mx/core/elements/Scordatura.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Scordatura.h rename to src/private/mx/core/elements/Scordatura.h diff --git a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp b/src/private/mx/core/elements/ScoreHeaderGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp rename to src/private/mx/core/elements/ScoreHeaderGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h b/src/private/mx/core/elements/ScoreHeaderGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h rename to src/private/mx/core/elements/ScoreHeaderGroup.h diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrument.cpp b/src/private/mx/core/elements/ScoreInstrument.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreInstrument.cpp rename to src/private/mx/core/elements/ScoreInstrument.cpp diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrument.h b/src/private/mx/core/elements/ScoreInstrument.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreInstrument.h rename to src/private/mx/core/elements/ScoreInstrument.h diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp b/src/private/mx/core/elements/ScoreInstrumentAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp rename to src/private/mx/core/elements/ScoreInstrumentAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h b/src/private/mx/core/elements/ScoreInstrumentAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h rename to src/private/mx/core/elements/ScoreInstrumentAttributes.h diff --git a/Sourcecode/private/mx/core/elements/ScorePart.cpp b/src/private/mx/core/elements/ScorePart.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScorePart.cpp rename to src/private/mx/core/elements/ScorePart.cpp diff --git a/Sourcecode/private/mx/core/elements/ScorePart.h b/src/private/mx/core/elements/ScorePart.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScorePart.h rename to src/private/mx/core/elements/ScorePart.h diff --git a/Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp b/src/private/mx/core/elements/ScorePartAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp rename to src/private/mx/core/elements/ScorePartAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ScorePartAttributes.h b/src/private/mx/core/elements/ScorePartAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScorePartAttributes.h rename to src/private/mx/core/elements/ScorePartAttributes.h diff --git a/Sourcecode/private/mx/core/elements/ScorePartwise.cpp b/src/private/mx/core/elements/ScorePartwise.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScorePartwise.cpp rename to src/private/mx/core/elements/ScorePartwise.cpp diff --git a/Sourcecode/private/mx/core/elements/ScorePartwise.h b/src/private/mx/core/elements/ScorePartwise.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScorePartwise.h rename to src/private/mx/core/elements/ScorePartwise.h diff --git a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp b/src/private/mx/core/elements/ScorePartwiseAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp rename to src/private/mx/core/elements/ScorePartwiseAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h b/src/private/mx/core/elements/ScorePartwiseAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h rename to src/private/mx/core/elements/ScorePartwiseAttributes.h diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewise.cpp b/src/private/mx/core/elements/ScoreTimewise.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreTimewise.cpp rename to src/private/mx/core/elements/ScoreTimewise.cpp diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewise.h b/src/private/mx/core/elements/ScoreTimewise.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreTimewise.h rename to src/private/mx/core/elements/ScoreTimewise.h diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp b/src/private/mx/core/elements/ScoreTimewiseAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp rename to src/private/mx/core/elements/ScoreTimewiseAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h b/src/private/mx/core/elements/ScoreTimewiseAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h rename to src/private/mx/core/elements/ScoreTimewiseAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Segno.cpp b/src/private/mx/core/elements/Segno.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Segno.cpp rename to src/private/mx/core/elements/Segno.cpp diff --git a/Sourcecode/private/mx/core/elements/Segno.h b/src/private/mx/core/elements/Segno.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Segno.h rename to src/private/mx/core/elements/Segno.h diff --git a/Sourcecode/private/mx/core/elements/SemiPitched.cpp b/src/private/mx/core/elements/SemiPitched.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SemiPitched.cpp rename to src/private/mx/core/elements/SemiPitched.cpp diff --git a/Sourcecode/private/mx/core/elements/SemiPitched.h b/src/private/mx/core/elements/SemiPitched.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SemiPitched.h rename to src/private/mx/core/elements/SemiPitched.h diff --git a/Sourcecode/private/mx/core/elements/SenzaMisura.cpp b/src/private/mx/core/elements/SenzaMisura.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SenzaMisura.cpp rename to src/private/mx/core/elements/SenzaMisura.cpp diff --git a/Sourcecode/private/mx/core/elements/SenzaMisura.h b/src/private/mx/core/elements/SenzaMisura.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SenzaMisura.h rename to src/private/mx/core/elements/SenzaMisura.h diff --git a/Sourcecode/private/mx/core/elements/Shake.cpp b/src/private/mx/core/elements/Shake.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Shake.cpp rename to src/private/mx/core/elements/Shake.cpp diff --git a/Sourcecode/private/mx/core/elements/Shake.h b/src/private/mx/core/elements/Shake.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Shake.h rename to src/private/mx/core/elements/Shake.h diff --git a/Sourcecode/private/mx/core/elements/Sign.cpp b/src/private/mx/core/elements/Sign.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Sign.cpp rename to src/private/mx/core/elements/Sign.cpp diff --git a/Sourcecode/private/mx/core/elements/Sign.h b/src/private/mx/core/elements/Sign.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Sign.h rename to src/private/mx/core/elements/Sign.h diff --git a/Sourcecode/private/mx/core/elements/Slash.cpp b/src/private/mx/core/elements/Slash.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Slash.cpp rename to src/private/mx/core/elements/Slash.cpp diff --git a/Sourcecode/private/mx/core/elements/Slash.h b/src/private/mx/core/elements/Slash.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Slash.h rename to src/private/mx/core/elements/Slash.h diff --git a/Sourcecode/private/mx/core/elements/SlashAttributes.cpp b/src/private/mx/core/elements/SlashAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SlashAttributes.cpp rename to src/private/mx/core/elements/SlashAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/SlashAttributes.h b/src/private/mx/core/elements/SlashAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SlashAttributes.h rename to src/private/mx/core/elements/SlashAttributes.h diff --git a/Sourcecode/private/mx/core/elements/SlashDot.cpp b/src/private/mx/core/elements/SlashDot.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SlashDot.cpp rename to src/private/mx/core/elements/SlashDot.cpp diff --git a/Sourcecode/private/mx/core/elements/SlashDot.h b/src/private/mx/core/elements/SlashDot.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SlashDot.h rename to src/private/mx/core/elements/SlashDot.h diff --git a/Sourcecode/private/mx/core/elements/SlashType.cpp b/src/private/mx/core/elements/SlashType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SlashType.cpp rename to src/private/mx/core/elements/SlashType.cpp diff --git a/Sourcecode/private/mx/core/elements/SlashType.h b/src/private/mx/core/elements/SlashType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SlashType.h rename to src/private/mx/core/elements/SlashType.h diff --git a/Sourcecode/private/mx/core/elements/Slide.cpp b/src/private/mx/core/elements/Slide.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Slide.cpp rename to src/private/mx/core/elements/Slide.cpp diff --git a/Sourcecode/private/mx/core/elements/Slide.h b/src/private/mx/core/elements/Slide.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Slide.h rename to src/private/mx/core/elements/Slide.h diff --git a/Sourcecode/private/mx/core/elements/SlideAttributes.cpp b/src/private/mx/core/elements/SlideAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SlideAttributes.cpp rename to src/private/mx/core/elements/SlideAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/SlideAttributes.h b/src/private/mx/core/elements/SlideAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SlideAttributes.h rename to src/private/mx/core/elements/SlideAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Slur.cpp b/src/private/mx/core/elements/Slur.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Slur.cpp rename to src/private/mx/core/elements/Slur.cpp diff --git a/Sourcecode/private/mx/core/elements/Slur.h b/src/private/mx/core/elements/Slur.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Slur.h rename to src/private/mx/core/elements/Slur.h diff --git a/Sourcecode/private/mx/core/elements/SlurAttributes.cpp b/src/private/mx/core/elements/SlurAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SlurAttributes.cpp rename to src/private/mx/core/elements/SlurAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/SlurAttributes.h b/src/private/mx/core/elements/SlurAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SlurAttributes.h rename to src/private/mx/core/elements/SlurAttributes.h diff --git a/Sourcecode/private/mx/core/elements/SnapPizzicato.cpp b/src/private/mx/core/elements/SnapPizzicato.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SnapPizzicato.cpp rename to src/private/mx/core/elements/SnapPizzicato.cpp diff --git a/Sourcecode/private/mx/core/elements/SnapPizzicato.h b/src/private/mx/core/elements/SnapPizzicato.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SnapPizzicato.h rename to src/private/mx/core/elements/SnapPizzicato.h diff --git a/Sourcecode/private/mx/core/elements/Software.cpp b/src/private/mx/core/elements/Software.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Software.cpp rename to src/private/mx/core/elements/Software.cpp diff --git a/Sourcecode/private/mx/core/elements/Software.h b/src/private/mx/core/elements/Software.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Software.h rename to src/private/mx/core/elements/Software.h diff --git a/Sourcecode/private/mx/core/elements/Solo.cpp b/src/private/mx/core/elements/Solo.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Solo.cpp rename to src/private/mx/core/elements/Solo.cpp diff --git a/Sourcecode/private/mx/core/elements/Solo.h b/src/private/mx/core/elements/Solo.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Solo.h rename to src/private/mx/core/elements/Solo.h diff --git a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp b/src/private/mx/core/elements/SoloOrEnsembleChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp rename to src/private/mx/core/elements/SoloOrEnsembleChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h b/src/private/mx/core/elements/SoloOrEnsembleChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h rename to src/private/mx/core/elements/SoloOrEnsembleChoice.h diff --git a/Sourcecode/private/mx/core/elements/Sound.cpp b/src/private/mx/core/elements/Sound.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Sound.cpp rename to src/private/mx/core/elements/Sound.cpp diff --git a/Sourcecode/private/mx/core/elements/Sound.h b/src/private/mx/core/elements/Sound.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Sound.h rename to src/private/mx/core/elements/Sound.h diff --git a/Sourcecode/private/mx/core/elements/SoundAttributes.cpp b/src/private/mx/core/elements/SoundAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SoundAttributes.cpp rename to src/private/mx/core/elements/SoundAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/SoundAttributes.h b/src/private/mx/core/elements/SoundAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SoundAttributes.h rename to src/private/mx/core/elements/SoundAttributes.h diff --git a/Sourcecode/private/mx/core/elements/SoundingPitch.cpp b/src/private/mx/core/elements/SoundingPitch.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SoundingPitch.cpp rename to src/private/mx/core/elements/SoundingPitch.cpp diff --git a/Sourcecode/private/mx/core/elements/SoundingPitch.h b/src/private/mx/core/elements/SoundingPitch.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SoundingPitch.h rename to src/private/mx/core/elements/SoundingPitch.h diff --git a/Sourcecode/private/mx/core/elements/Source.cpp b/src/private/mx/core/elements/Source.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Source.cpp rename to src/private/mx/core/elements/Source.cpp diff --git a/Sourcecode/private/mx/core/elements/Source.h b/src/private/mx/core/elements/Source.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Source.h rename to src/private/mx/core/elements/Source.h diff --git a/Sourcecode/private/mx/core/elements/Spiccato.cpp b/src/private/mx/core/elements/Spiccato.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Spiccato.cpp rename to src/private/mx/core/elements/Spiccato.cpp diff --git a/Sourcecode/private/mx/core/elements/Spiccato.h b/src/private/mx/core/elements/Spiccato.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Spiccato.h rename to src/private/mx/core/elements/Spiccato.h diff --git a/Sourcecode/private/mx/core/elements/Staccatissimo.cpp b/src/private/mx/core/elements/Staccatissimo.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Staccatissimo.cpp rename to src/private/mx/core/elements/Staccatissimo.cpp diff --git a/Sourcecode/private/mx/core/elements/Staccatissimo.h b/src/private/mx/core/elements/Staccatissimo.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Staccatissimo.h rename to src/private/mx/core/elements/Staccatissimo.h diff --git a/Sourcecode/private/mx/core/elements/Staccato.cpp b/src/private/mx/core/elements/Staccato.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Staccato.cpp rename to src/private/mx/core/elements/Staccato.cpp diff --git a/Sourcecode/private/mx/core/elements/Staccato.h b/src/private/mx/core/elements/Staccato.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Staccato.h rename to src/private/mx/core/elements/Staccato.h diff --git a/Sourcecode/private/mx/core/elements/Staff.cpp b/src/private/mx/core/elements/Staff.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Staff.cpp rename to src/private/mx/core/elements/Staff.cpp diff --git a/Sourcecode/private/mx/core/elements/Staff.h b/src/private/mx/core/elements/Staff.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Staff.h rename to src/private/mx/core/elements/Staff.h diff --git a/Sourcecode/private/mx/core/elements/StaffDetails.cpp b/src/private/mx/core/elements/StaffDetails.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffDetails.cpp rename to src/private/mx/core/elements/StaffDetails.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffDetails.h b/src/private/mx/core/elements/StaffDetails.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffDetails.h rename to src/private/mx/core/elements/StaffDetails.h diff --git a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp b/src/private/mx/core/elements/StaffDetailsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp rename to src/private/mx/core/elements/StaffDetailsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h b/src/private/mx/core/elements/StaffDetailsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h rename to src/private/mx/core/elements/StaffDetailsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/StaffDistance.cpp b/src/private/mx/core/elements/StaffDistance.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffDistance.cpp rename to src/private/mx/core/elements/StaffDistance.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffDistance.h b/src/private/mx/core/elements/StaffDistance.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffDistance.h rename to src/private/mx/core/elements/StaffDistance.h diff --git a/Sourcecode/private/mx/core/elements/StaffLayout.cpp b/src/private/mx/core/elements/StaffLayout.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffLayout.cpp rename to src/private/mx/core/elements/StaffLayout.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffLayout.h b/src/private/mx/core/elements/StaffLayout.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffLayout.h rename to src/private/mx/core/elements/StaffLayout.h diff --git a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp b/src/private/mx/core/elements/StaffLayoutAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp rename to src/private/mx/core/elements/StaffLayoutAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h b/src/private/mx/core/elements/StaffLayoutAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h rename to src/private/mx/core/elements/StaffLayoutAttributes.h diff --git a/Sourcecode/private/mx/core/elements/StaffLines.cpp b/src/private/mx/core/elements/StaffLines.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffLines.cpp rename to src/private/mx/core/elements/StaffLines.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffLines.h b/src/private/mx/core/elements/StaffLines.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffLines.h rename to src/private/mx/core/elements/StaffLines.h diff --git a/Sourcecode/private/mx/core/elements/StaffSize.cpp b/src/private/mx/core/elements/StaffSize.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffSize.cpp rename to src/private/mx/core/elements/StaffSize.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffSize.h b/src/private/mx/core/elements/StaffSize.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffSize.h rename to src/private/mx/core/elements/StaffSize.h diff --git a/Sourcecode/private/mx/core/elements/StaffTuning.cpp b/src/private/mx/core/elements/StaffTuning.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffTuning.cpp rename to src/private/mx/core/elements/StaffTuning.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffTuning.h b/src/private/mx/core/elements/StaffTuning.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffTuning.h rename to src/private/mx/core/elements/StaffTuning.h diff --git a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp b/src/private/mx/core/elements/StaffTuningAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp rename to src/private/mx/core/elements/StaffTuningAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.h b/src/private/mx/core/elements/StaffTuningAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffTuningAttributes.h rename to src/private/mx/core/elements/StaffTuningAttributes.h diff --git a/Sourcecode/private/mx/core/elements/StaffType.cpp b/src/private/mx/core/elements/StaffType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffType.cpp rename to src/private/mx/core/elements/StaffType.cpp diff --git a/Sourcecode/private/mx/core/elements/StaffType.h b/src/private/mx/core/elements/StaffType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StaffType.h rename to src/private/mx/core/elements/StaffType.h diff --git a/Sourcecode/private/mx/core/elements/Staves.cpp b/src/private/mx/core/elements/Staves.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Staves.cpp rename to src/private/mx/core/elements/Staves.cpp diff --git a/Sourcecode/private/mx/core/elements/Staves.h b/src/private/mx/core/elements/Staves.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Staves.h rename to src/private/mx/core/elements/Staves.h diff --git a/Sourcecode/private/mx/core/elements/Stem.cpp b/src/private/mx/core/elements/Stem.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Stem.cpp rename to src/private/mx/core/elements/Stem.cpp diff --git a/Sourcecode/private/mx/core/elements/Stem.h b/src/private/mx/core/elements/Stem.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Stem.h rename to src/private/mx/core/elements/Stem.h diff --git a/Sourcecode/private/mx/core/elements/StemAttributes.cpp b/src/private/mx/core/elements/StemAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StemAttributes.cpp rename to src/private/mx/core/elements/StemAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/StemAttributes.h b/src/private/mx/core/elements/StemAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StemAttributes.h rename to src/private/mx/core/elements/StemAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Step.cpp b/src/private/mx/core/elements/Step.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Step.cpp rename to src/private/mx/core/elements/Step.cpp diff --git a/Sourcecode/private/mx/core/elements/Step.h b/src/private/mx/core/elements/Step.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Step.h rename to src/private/mx/core/elements/Step.h diff --git a/Sourcecode/private/mx/core/elements/Stick.cpp b/src/private/mx/core/elements/Stick.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Stick.cpp rename to src/private/mx/core/elements/Stick.cpp diff --git a/Sourcecode/private/mx/core/elements/Stick.h b/src/private/mx/core/elements/Stick.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Stick.h rename to src/private/mx/core/elements/Stick.h diff --git a/Sourcecode/private/mx/core/elements/StickAttributes.cpp b/src/private/mx/core/elements/StickAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StickAttributes.cpp rename to src/private/mx/core/elements/StickAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/StickAttributes.h b/src/private/mx/core/elements/StickAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StickAttributes.h rename to src/private/mx/core/elements/StickAttributes.h diff --git a/Sourcecode/private/mx/core/elements/StickLocation.cpp b/src/private/mx/core/elements/StickLocation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StickLocation.cpp rename to src/private/mx/core/elements/StickLocation.cpp diff --git a/Sourcecode/private/mx/core/elements/StickLocation.h b/src/private/mx/core/elements/StickLocation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StickLocation.h rename to src/private/mx/core/elements/StickLocation.h diff --git a/Sourcecode/private/mx/core/elements/StickMaterial.cpp b/src/private/mx/core/elements/StickMaterial.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StickMaterial.cpp rename to src/private/mx/core/elements/StickMaterial.cpp diff --git a/Sourcecode/private/mx/core/elements/StickMaterial.h b/src/private/mx/core/elements/StickMaterial.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StickMaterial.h rename to src/private/mx/core/elements/StickMaterial.h diff --git a/Sourcecode/private/mx/core/elements/StickType.cpp b/src/private/mx/core/elements/StickType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StickType.cpp rename to src/private/mx/core/elements/StickType.cpp diff --git a/Sourcecode/private/mx/core/elements/StickType.h b/src/private/mx/core/elements/StickType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StickType.h rename to src/private/mx/core/elements/StickType.h diff --git a/Sourcecode/private/mx/core/elements/Stopped.cpp b/src/private/mx/core/elements/Stopped.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Stopped.cpp rename to src/private/mx/core/elements/Stopped.cpp diff --git a/Sourcecode/private/mx/core/elements/Stopped.h b/src/private/mx/core/elements/Stopped.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Stopped.h rename to src/private/mx/core/elements/Stopped.h diff --git a/Sourcecode/private/mx/core/elements/Stress.cpp b/src/private/mx/core/elements/Stress.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Stress.cpp rename to src/private/mx/core/elements/Stress.cpp diff --git a/Sourcecode/private/mx/core/elements/Stress.h b/src/private/mx/core/elements/Stress.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Stress.h rename to src/private/mx/core/elements/Stress.h diff --git a/Sourcecode/private/mx/core/elements/String.cpp b/src/private/mx/core/elements/String.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/String.cpp rename to src/private/mx/core/elements/String.cpp diff --git a/Sourcecode/private/mx/core/elements/String.h b/src/private/mx/core/elements/String.h similarity index 100% rename from Sourcecode/private/mx/core/elements/String.h rename to src/private/mx/core/elements/String.h diff --git a/Sourcecode/private/mx/core/elements/StringAttributes.cpp b/src/private/mx/core/elements/StringAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StringAttributes.cpp rename to src/private/mx/core/elements/StringAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/StringAttributes.h b/src/private/mx/core/elements/StringAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StringAttributes.h rename to src/private/mx/core/elements/StringAttributes.h diff --git a/Sourcecode/private/mx/core/elements/StringMute.cpp b/src/private/mx/core/elements/StringMute.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StringMute.cpp rename to src/private/mx/core/elements/StringMute.cpp diff --git a/Sourcecode/private/mx/core/elements/StringMute.h b/src/private/mx/core/elements/StringMute.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StringMute.h rename to src/private/mx/core/elements/StringMute.h diff --git a/Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp b/src/private/mx/core/elements/StringMuteAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp rename to src/private/mx/core/elements/StringMuteAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/StringMuteAttributes.h b/src/private/mx/core/elements/StringMuteAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StringMuteAttributes.h rename to src/private/mx/core/elements/StringMuteAttributes.h diff --git a/Sourcecode/private/mx/core/elements/StrongAccent.cpp b/src/private/mx/core/elements/StrongAccent.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StrongAccent.cpp rename to src/private/mx/core/elements/StrongAccent.cpp diff --git a/Sourcecode/private/mx/core/elements/StrongAccent.h b/src/private/mx/core/elements/StrongAccent.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StrongAccent.h rename to src/private/mx/core/elements/StrongAccent.h diff --git a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp b/src/private/mx/core/elements/StrongAccentAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp rename to src/private/mx/core/elements/StrongAccentAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.h b/src/private/mx/core/elements/StrongAccentAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/StrongAccentAttributes.h rename to src/private/mx/core/elements/StrongAccentAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Suffix.cpp b/src/private/mx/core/elements/Suffix.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Suffix.cpp rename to src/private/mx/core/elements/Suffix.cpp diff --git a/Sourcecode/private/mx/core/elements/Suffix.h b/src/private/mx/core/elements/Suffix.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Suffix.h rename to src/private/mx/core/elements/Suffix.h diff --git a/Sourcecode/private/mx/core/elements/SuffixAttributes.cpp b/src/private/mx/core/elements/SuffixAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SuffixAttributes.cpp rename to src/private/mx/core/elements/SuffixAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/SuffixAttributes.h b/src/private/mx/core/elements/SuffixAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SuffixAttributes.h rename to src/private/mx/core/elements/SuffixAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Supports.cpp b/src/private/mx/core/elements/Supports.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Supports.cpp rename to src/private/mx/core/elements/Supports.cpp diff --git a/Sourcecode/private/mx/core/elements/Supports.h b/src/private/mx/core/elements/Supports.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Supports.h rename to src/private/mx/core/elements/Supports.h diff --git a/Sourcecode/private/mx/core/elements/SupportsAttributes.cpp b/src/private/mx/core/elements/SupportsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SupportsAttributes.cpp rename to src/private/mx/core/elements/SupportsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/SupportsAttributes.h b/src/private/mx/core/elements/SupportsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SupportsAttributes.h rename to src/private/mx/core/elements/SupportsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Syllabic.cpp b/src/private/mx/core/elements/Syllabic.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Syllabic.cpp rename to src/private/mx/core/elements/Syllabic.cpp diff --git a/Sourcecode/private/mx/core/elements/Syllabic.h b/src/private/mx/core/elements/Syllabic.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Syllabic.h rename to src/private/mx/core/elements/Syllabic.h diff --git a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp b/src/private/mx/core/elements/SyllabicTextGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp rename to src/private/mx/core/elements/SyllabicTextGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.h b/src/private/mx/core/elements/SyllabicTextGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SyllabicTextGroup.h rename to src/private/mx/core/elements/SyllabicTextGroup.h diff --git a/Sourcecode/private/mx/core/elements/SystemDistance.cpp b/src/private/mx/core/elements/SystemDistance.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SystemDistance.cpp rename to src/private/mx/core/elements/SystemDistance.cpp diff --git a/Sourcecode/private/mx/core/elements/SystemDistance.h b/src/private/mx/core/elements/SystemDistance.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SystemDistance.h rename to src/private/mx/core/elements/SystemDistance.h diff --git a/Sourcecode/private/mx/core/elements/SystemDividers.cpp b/src/private/mx/core/elements/SystemDividers.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SystemDividers.cpp rename to src/private/mx/core/elements/SystemDividers.cpp diff --git a/Sourcecode/private/mx/core/elements/SystemDividers.h b/src/private/mx/core/elements/SystemDividers.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SystemDividers.h rename to src/private/mx/core/elements/SystemDividers.h diff --git a/Sourcecode/private/mx/core/elements/SystemLayout.cpp b/src/private/mx/core/elements/SystemLayout.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SystemLayout.cpp rename to src/private/mx/core/elements/SystemLayout.cpp diff --git a/Sourcecode/private/mx/core/elements/SystemLayout.h b/src/private/mx/core/elements/SystemLayout.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SystemLayout.h rename to src/private/mx/core/elements/SystemLayout.h diff --git a/Sourcecode/private/mx/core/elements/SystemMargins.cpp b/src/private/mx/core/elements/SystemMargins.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/SystemMargins.cpp rename to src/private/mx/core/elements/SystemMargins.cpp diff --git a/Sourcecode/private/mx/core/elements/SystemMargins.h b/src/private/mx/core/elements/SystemMargins.h similarity index 100% rename from Sourcecode/private/mx/core/elements/SystemMargins.h rename to src/private/mx/core/elements/SystemMargins.h diff --git a/Sourcecode/private/mx/core/elements/Tap.cpp b/src/private/mx/core/elements/Tap.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Tap.cpp rename to src/private/mx/core/elements/Tap.cpp diff --git a/Sourcecode/private/mx/core/elements/Tap.h b/src/private/mx/core/elements/Tap.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Tap.h rename to src/private/mx/core/elements/Tap.h diff --git a/Sourcecode/private/mx/core/elements/TapAttributes.cpp b/src/private/mx/core/elements/TapAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TapAttributes.cpp rename to src/private/mx/core/elements/TapAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TapAttributes.h b/src/private/mx/core/elements/TapAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TapAttributes.h rename to src/private/mx/core/elements/TapAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Technical.cpp b/src/private/mx/core/elements/Technical.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Technical.cpp rename to src/private/mx/core/elements/Technical.cpp diff --git a/Sourcecode/private/mx/core/elements/Technical.h b/src/private/mx/core/elements/Technical.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Technical.h rename to src/private/mx/core/elements/Technical.h diff --git a/Sourcecode/private/mx/core/elements/TechnicalChoice.cpp b/src/private/mx/core/elements/TechnicalChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TechnicalChoice.cpp rename to src/private/mx/core/elements/TechnicalChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/TechnicalChoice.h b/src/private/mx/core/elements/TechnicalChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TechnicalChoice.h rename to src/private/mx/core/elements/TechnicalChoice.h diff --git a/Sourcecode/private/mx/core/elements/Tenths.cpp b/src/private/mx/core/elements/Tenths.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Tenths.cpp rename to src/private/mx/core/elements/Tenths.cpp diff --git a/Sourcecode/private/mx/core/elements/Tenths.h b/src/private/mx/core/elements/Tenths.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Tenths.h rename to src/private/mx/core/elements/Tenths.h diff --git a/Sourcecode/private/mx/core/elements/Tenuto.cpp b/src/private/mx/core/elements/Tenuto.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Tenuto.cpp rename to src/private/mx/core/elements/Tenuto.cpp diff --git a/Sourcecode/private/mx/core/elements/Tenuto.h b/src/private/mx/core/elements/Tenuto.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Tenuto.h rename to src/private/mx/core/elements/Tenuto.h diff --git a/Sourcecode/private/mx/core/elements/Text.cpp b/src/private/mx/core/elements/Text.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Text.cpp rename to src/private/mx/core/elements/Text.cpp diff --git a/Sourcecode/private/mx/core/elements/Text.h b/src/private/mx/core/elements/Text.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Text.h rename to src/private/mx/core/elements/Text.h diff --git a/Sourcecode/private/mx/core/elements/TextAttributes.cpp b/src/private/mx/core/elements/TextAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TextAttributes.cpp rename to src/private/mx/core/elements/TextAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TextAttributes.h b/src/private/mx/core/elements/TextAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TextAttributes.h rename to src/private/mx/core/elements/TextAttributes.h diff --git a/Sourcecode/private/mx/core/elements/ThumbPosition.cpp b/src/private/mx/core/elements/ThumbPosition.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ThumbPosition.cpp rename to src/private/mx/core/elements/ThumbPosition.cpp diff --git a/Sourcecode/private/mx/core/elements/ThumbPosition.h b/src/private/mx/core/elements/ThumbPosition.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ThumbPosition.h rename to src/private/mx/core/elements/ThumbPosition.h diff --git a/Sourcecode/private/mx/core/elements/Tie.cpp b/src/private/mx/core/elements/Tie.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Tie.cpp rename to src/private/mx/core/elements/Tie.cpp diff --git a/Sourcecode/private/mx/core/elements/Tie.h b/src/private/mx/core/elements/Tie.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Tie.h rename to src/private/mx/core/elements/Tie.h diff --git a/Sourcecode/private/mx/core/elements/TieAttributes.cpp b/src/private/mx/core/elements/TieAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TieAttributes.cpp rename to src/private/mx/core/elements/TieAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TieAttributes.h b/src/private/mx/core/elements/TieAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TieAttributes.h rename to src/private/mx/core/elements/TieAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Tied.cpp b/src/private/mx/core/elements/Tied.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Tied.cpp rename to src/private/mx/core/elements/Tied.cpp diff --git a/Sourcecode/private/mx/core/elements/Tied.h b/src/private/mx/core/elements/Tied.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Tied.h rename to src/private/mx/core/elements/Tied.h diff --git a/Sourcecode/private/mx/core/elements/TiedAttributes.cpp b/src/private/mx/core/elements/TiedAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TiedAttributes.cpp rename to src/private/mx/core/elements/TiedAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TiedAttributes.h b/src/private/mx/core/elements/TiedAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TiedAttributes.h rename to src/private/mx/core/elements/TiedAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Time.cpp b/src/private/mx/core/elements/Time.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Time.cpp rename to src/private/mx/core/elements/Time.cpp diff --git a/Sourcecode/private/mx/core/elements/Time.h b/src/private/mx/core/elements/Time.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Time.h rename to src/private/mx/core/elements/Time.h diff --git a/Sourcecode/private/mx/core/elements/TimeAttributes.cpp b/src/private/mx/core/elements/TimeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeAttributes.cpp rename to src/private/mx/core/elements/TimeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TimeAttributes.h b/src/private/mx/core/elements/TimeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeAttributes.h rename to src/private/mx/core/elements/TimeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/TimeChoice.cpp b/src/private/mx/core/elements/TimeChoice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeChoice.cpp rename to src/private/mx/core/elements/TimeChoice.cpp diff --git a/Sourcecode/private/mx/core/elements/TimeChoice.h b/src/private/mx/core/elements/TimeChoice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeChoice.h rename to src/private/mx/core/elements/TimeChoice.h diff --git a/Sourcecode/private/mx/core/elements/TimeModification.cpp b/src/private/mx/core/elements/TimeModification.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeModification.cpp rename to src/private/mx/core/elements/TimeModification.cpp diff --git a/Sourcecode/private/mx/core/elements/TimeModification.h b/src/private/mx/core/elements/TimeModification.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeModification.h rename to src/private/mx/core/elements/TimeModification.h diff --git a/Sourcecode/private/mx/core/elements/TimeModificationNormalTypeNormalDot.cpp b/src/private/mx/core/elements/TimeModificationNormalTypeNormalDot.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeModificationNormalTypeNormalDot.cpp rename to src/private/mx/core/elements/TimeModificationNormalTypeNormalDot.cpp diff --git a/Sourcecode/private/mx/core/elements/TimeModificationNormalTypeNormalDot.h b/src/private/mx/core/elements/TimeModificationNormalTypeNormalDot.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeModificationNormalTypeNormalDot.h rename to src/private/mx/core/elements/TimeModificationNormalTypeNormalDot.h diff --git a/Sourcecode/private/mx/core/elements/TimeRelation.cpp b/src/private/mx/core/elements/TimeRelation.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeRelation.cpp rename to src/private/mx/core/elements/TimeRelation.cpp diff --git a/Sourcecode/private/mx/core/elements/TimeRelation.h b/src/private/mx/core/elements/TimeRelation.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeRelation.h rename to src/private/mx/core/elements/TimeRelation.h diff --git a/Sourcecode/private/mx/core/elements/TimeSignatureGroup.cpp b/src/private/mx/core/elements/TimeSignatureGroup.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeSignatureGroup.cpp rename to src/private/mx/core/elements/TimeSignatureGroup.cpp diff --git a/Sourcecode/private/mx/core/elements/TimeSignatureGroup.h b/src/private/mx/core/elements/TimeSignatureGroup.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TimeSignatureGroup.h rename to src/private/mx/core/elements/TimeSignatureGroup.h diff --git a/Sourcecode/private/mx/core/elements/TimewiseMeasure.cpp b/src/private/mx/core/elements/TimewiseMeasure.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TimewiseMeasure.cpp rename to src/private/mx/core/elements/TimewiseMeasure.cpp diff --git a/Sourcecode/private/mx/core/elements/TimewiseMeasure.h b/src/private/mx/core/elements/TimewiseMeasure.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TimewiseMeasure.h rename to src/private/mx/core/elements/TimewiseMeasure.h diff --git a/Sourcecode/private/mx/core/elements/TimewisePart.cpp b/src/private/mx/core/elements/TimewisePart.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TimewisePart.cpp rename to src/private/mx/core/elements/TimewisePart.cpp diff --git a/Sourcecode/private/mx/core/elements/TimewisePart.h b/src/private/mx/core/elements/TimewisePart.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TimewisePart.h rename to src/private/mx/core/elements/TimewisePart.h diff --git a/Sourcecode/private/mx/core/elements/Timpani.cpp b/src/private/mx/core/elements/Timpani.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Timpani.cpp rename to src/private/mx/core/elements/Timpani.cpp diff --git a/Sourcecode/private/mx/core/elements/Timpani.h b/src/private/mx/core/elements/Timpani.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Timpani.h rename to src/private/mx/core/elements/Timpani.h diff --git a/Sourcecode/private/mx/core/elements/Toe.cpp b/src/private/mx/core/elements/Toe.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Toe.cpp rename to src/private/mx/core/elements/Toe.cpp diff --git a/Sourcecode/private/mx/core/elements/Toe.h b/src/private/mx/core/elements/Toe.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Toe.h rename to src/private/mx/core/elements/Toe.h diff --git a/Sourcecode/private/mx/core/elements/ToeAttributes.cpp b/src/private/mx/core/elements/ToeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/ToeAttributes.cpp rename to src/private/mx/core/elements/ToeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/ToeAttributes.h b/src/private/mx/core/elements/ToeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/ToeAttributes.h rename to src/private/mx/core/elements/ToeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/TopMargin.cpp b/src/private/mx/core/elements/TopMargin.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TopMargin.cpp rename to src/private/mx/core/elements/TopMargin.cpp diff --git a/Sourcecode/private/mx/core/elements/TopMargin.h b/src/private/mx/core/elements/TopMargin.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TopMargin.h rename to src/private/mx/core/elements/TopMargin.h diff --git a/Sourcecode/private/mx/core/elements/TopSystemDistance.cpp b/src/private/mx/core/elements/TopSystemDistance.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TopSystemDistance.cpp rename to src/private/mx/core/elements/TopSystemDistance.cpp diff --git a/Sourcecode/private/mx/core/elements/TopSystemDistance.h b/src/private/mx/core/elements/TopSystemDistance.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TopSystemDistance.h rename to src/private/mx/core/elements/TopSystemDistance.h diff --git a/Sourcecode/private/mx/core/elements/TouchingPitch.cpp b/src/private/mx/core/elements/TouchingPitch.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TouchingPitch.cpp rename to src/private/mx/core/elements/TouchingPitch.cpp diff --git a/Sourcecode/private/mx/core/elements/TouchingPitch.h b/src/private/mx/core/elements/TouchingPitch.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TouchingPitch.h rename to src/private/mx/core/elements/TouchingPitch.h diff --git a/Sourcecode/private/mx/core/elements/TraditionalKey.cpp b/src/private/mx/core/elements/TraditionalKey.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TraditionalKey.cpp rename to src/private/mx/core/elements/TraditionalKey.cpp diff --git a/Sourcecode/private/mx/core/elements/TraditionalKey.h b/src/private/mx/core/elements/TraditionalKey.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TraditionalKey.h rename to src/private/mx/core/elements/TraditionalKey.h diff --git a/Sourcecode/private/mx/core/elements/Transpose.cpp b/src/private/mx/core/elements/Transpose.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Transpose.cpp rename to src/private/mx/core/elements/Transpose.cpp diff --git a/Sourcecode/private/mx/core/elements/Transpose.h b/src/private/mx/core/elements/Transpose.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Transpose.h rename to src/private/mx/core/elements/Transpose.h diff --git a/Sourcecode/private/mx/core/elements/TransposeAttributes.cpp b/src/private/mx/core/elements/TransposeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TransposeAttributes.cpp rename to src/private/mx/core/elements/TransposeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TransposeAttributes.h b/src/private/mx/core/elements/TransposeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TransposeAttributes.h rename to src/private/mx/core/elements/TransposeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Tremolo.cpp b/src/private/mx/core/elements/Tremolo.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Tremolo.cpp rename to src/private/mx/core/elements/Tremolo.cpp diff --git a/Sourcecode/private/mx/core/elements/Tremolo.h b/src/private/mx/core/elements/Tremolo.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Tremolo.h rename to src/private/mx/core/elements/Tremolo.h diff --git a/Sourcecode/private/mx/core/elements/TremoloAttributes.cpp b/src/private/mx/core/elements/TremoloAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TremoloAttributes.cpp rename to src/private/mx/core/elements/TremoloAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TremoloAttributes.h b/src/private/mx/core/elements/TremoloAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TremoloAttributes.h rename to src/private/mx/core/elements/TremoloAttributes.h diff --git a/Sourcecode/private/mx/core/elements/TrillMark.cpp b/src/private/mx/core/elements/TrillMark.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TrillMark.cpp rename to src/private/mx/core/elements/TrillMark.cpp diff --git a/Sourcecode/private/mx/core/elements/TrillMark.h b/src/private/mx/core/elements/TrillMark.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TrillMark.h rename to src/private/mx/core/elements/TrillMark.h diff --git a/Sourcecode/private/mx/core/elements/TripleTongue.cpp b/src/private/mx/core/elements/TripleTongue.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TripleTongue.cpp rename to src/private/mx/core/elements/TripleTongue.cpp diff --git a/Sourcecode/private/mx/core/elements/TripleTongue.h b/src/private/mx/core/elements/TripleTongue.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TripleTongue.h rename to src/private/mx/core/elements/TripleTongue.h diff --git a/Sourcecode/private/mx/core/elements/TuningAlter.cpp b/src/private/mx/core/elements/TuningAlter.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TuningAlter.cpp rename to src/private/mx/core/elements/TuningAlter.cpp diff --git a/Sourcecode/private/mx/core/elements/TuningAlter.h b/src/private/mx/core/elements/TuningAlter.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TuningAlter.h rename to src/private/mx/core/elements/TuningAlter.h diff --git a/Sourcecode/private/mx/core/elements/TuningOctave.cpp b/src/private/mx/core/elements/TuningOctave.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TuningOctave.cpp rename to src/private/mx/core/elements/TuningOctave.cpp diff --git a/Sourcecode/private/mx/core/elements/TuningOctave.h b/src/private/mx/core/elements/TuningOctave.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TuningOctave.h rename to src/private/mx/core/elements/TuningOctave.h diff --git a/Sourcecode/private/mx/core/elements/TuningStep.cpp b/src/private/mx/core/elements/TuningStep.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TuningStep.cpp rename to src/private/mx/core/elements/TuningStep.cpp diff --git a/Sourcecode/private/mx/core/elements/TuningStep.h b/src/private/mx/core/elements/TuningStep.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TuningStep.h rename to src/private/mx/core/elements/TuningStep.h diff --git a/Sourcecode/private/mx/core/elements/Tuplet.cpp b/src/private/mx/core/elements/Tuplet.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Tuplet.cpp rename to src/private/mx/core/elements/Tuplet.cpp diff --git a/Sourcecode/private/mx/core/elements/Tuplet.h b/src/private/mx/core/elements/Tuplet.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Tuplet.h rename to src/private/mx/core/elements/Tuplet.h diff --git a/Sourcecode/private/mx/core/elements/TupletActual.cpp b/src/private/mx/core/elements/TupletActual.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletActual.cpp rename to src/private/mx/core/elements/TupletActual.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletActual.h b/src/private/mx/core/elements/TupletActual.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletActual.h rename to src/private/mx/core/elements/TupletActual.h diff --git a/Sourcecode/private/mx/core/elements/TupletAttributes.cpp b/src/private/mx/core/elements/TupletAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletAttributes.cpp rename to src/private/mx/core/elements/TupletAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletAttributes.h b/src/private/mx/core/elements/TupletAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletAttributes.h rename to src/private/mx/core/elements/TupletAttributes.h diff --git a/Sourcecode/private/mx/core/elements/TupletDot.cpp b/src/private/mx/core/elements/TupletDot.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletDot.cpp rename to src/private/mx/core/elements/TupletDot.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletDot.h b/src/private/mx/core/elements/TupletDot.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletDot.h rename to src/private/mx/core/elements/TupletDot.h diff --git a/Sourcecode/private/mx/core/elements/TupletDotAttributes.cpp b/src/private/mx/core/elements/TupletDotAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletDotAttributes.cpp rename to src/private/mx/core/elements/TupletDotAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletDotAttributes.h b/src/private/mx/core/elements/TupletDotAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletDotAttributes.h rename to src/private/mx/core/elements/TupletDotAttributes.h diff --git a/Sourcecode/private/mx/core/elements/TupletNormal.cpp b/src/private/mx/core/elements/TupletNormal.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletNormal.cpp rename to src/private/mx/core/elements/TupletNormal.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletNormal.h b/src/private/mx/core/elements/TupletNormal.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletNormal.h rename to src/private/mx/core/elements/TupletNormal.h diff --git a/Sourcecode/private/mx/core/elements/TupletNumber.cpp b/src/private/mx/core/elements/TupletNumber.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletNumber.cpp rename to src/private/mx/core/elements/TupletNumber.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletNumber.h b/src/private/mx/core/elements/TupletNumber.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletNumber.h rename to src/private/mx/core/elements/TupletNumber.h diff --git a/Sourcecode/private/mx/core/elements/TupletNumberAttributes.cpp b/src/private/mx/core/elements/TupletNumberAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletNumberAttributes.cpp rename to src/private/mx/core/elements/TupletNumberAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletNumberAttributes.h b/src/private/mx/core/elements/TupletNumberAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletNumberAttributes.h rename to src/private/mx/core/elements/TupletNumberAttributes.h diff --git a/Sourcecode/private/mx/core/elements/TupletReader.h b/src/private/mx/core/elements/TupletReader.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletReader.h rename to src/private/mx/core/elements/TupletReader.h diff --git a/Sourcecode/private/mx/core/elements/TupletType.cpp b/src/private/mx/core/elements/TupletType.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletType.cpp rename to src/private/mx/core/elements/TupletType.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletType.h b/src/private/mx/core/elements/TupletType.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletType.h rename to src/private/mx/core/elements/TupletType.h diff --git a/Sourcecode/private/mx/core/elements/TupletTypeAttributes.cpp b/src/private/mx/core/elements/TupletTypeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletTypeAttributes.cpp rename to src/private/mx/core/elements/TupletTypeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TupletTypeAttributes.h b/src/private/mx/core/elements/TupletTypeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TupletTypeAttributes.h rename to src/private/mx/core/elements/TupletTypeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Turn.cpp b/src/private/mx/core/elements/Turn.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Turn.cpp rename to src/private/mx/core/elements/Turn.cpp diff --git a/Sourcecode/private/mx/core/elements/Turn.h b/src/private/mx/core/elements/Turn.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Turn.h rename to src/private/mx/core/elements/Turn.h diff --git a/Sourcecode/private/mx/core/elements/TurnAttributes.cpp b/src/private/mx/core/elements/TurnAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TurnAttributes.cpp rename to src/private/mx/core/elements/TurnAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TurnAttributes.h b/src/private/mx/core/elements/TurnAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TurnAttributes.h rename to src/private/mx/core/elements/TurnAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Type.cpp b/src/private/mx/core/elements/Type.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Type.cpp rename to src/private/mx/core/elements/Type.cpp diff --git a/Sourcecode/private/mx/core/elements/Type.h b/src/private/mx/core/elements/Type.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Type.h rename to src/private/mx/core/elements/Type.h diff --git a/Sourcecode/private/mx/core/elements/TypeAttributes.cpp b/src/private/mx/core/elements/TypeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/TypeAttributes.cpp rename to src/private/mx/core/elements/TypeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/TypeAttributes.h b/src/private/mx/core/elements/TypeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/TypeAttributes.h rename to src/private/mx/core/elements/TypeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Unpitched.cpp b/src/private/mx/core/elements/Unpitched.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Unpitched.cpp rename to src/private/mx/core/elements/Unpitched.cpp diff --git a/Sourcecode/private/mx/core/elements/Unpitched.h b/src/private/mx/core/elements/Unpitched.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Unpitched.h rename to src/private/mx/core/elements/Unpitched.h diff --git a/Sourcecode/private/mx/core/elements/Unstress.cpp b/src/private/mx/core/elements/Unstress.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Unstress.cpp rename to src/private/mx/core/elements/Unstress.cpp diff --git a/Sourcecode/private/mx/core/elements/Unstress.h b/src/private/mx/core/elements/Unstress.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Unstress.h rename to src/private/mx/core/elements/Unstress.h diff --git a/Sourcecode/private/mx/core/elements/UpBow.cpp b/src/private/mx/core/elements/UpBow.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/UpBow.cpp rename to src/private/mx/core/elements/UpBow.cpp diff --git a/Sourcecode/private/mx/core/elements/UpBow.h b/src/private/mx/core/elements/UpBow.h similarity index 100% rename from Sourcecode/private/mx/core/elements/UpBow.h rename to src/private/mx/core/elements/UpBow.h diff --git a/Sourcecode/private/mx/core/elements/VerticalTurn.cpp b/src/private/mx/core/elements/VerticalTurn.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/VerticalTurn.cpp rename to src/private/mx/core/elements/VerticalTurn.cpp diff --git a/Sourcecode/private/mx/core/elements/VerticalTurn.h b/src/private/mx/core/elements/VerticalTurn.h similarity index 100% rename from Sourcecode/private/mx/core/elements/VerticalTurn.h rename to src/private/mx/core/elements/VerticalTurn.h diff --git a/Sourcecode/private/mx/core/elements/VirtualInstrument.cpp b/src/private/mx/core/elements/VirtualInstrument.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/VirtualInstrument.cpp rename to src/private/mx/core/elements/VirtualInstrument.cpp diff --git a/Sourcecode/private/mx/core/elements/VirtualInstrument.h b/src/private/mx/core/elements/VirtualInstrument.h similarity index 100% rename from Sourcecode/private/mx/core/elements/VirtualInstrument.h rename to src/private/mx/core/elements/VirtualInstrument.h diff --git a/Sourcecode/private/mx/core/elements/VirtualLibrary.cpp b/src/private/mx/core/elements/VirtualLibrary.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/VirtualLibrary.cpp rename to src/private/mx/core/elements/VirtualLibrary.cpp diff --git a/Sourcecode/private/mx/core/elements/VirtualLibrary.h b/src/private/mx/core/elements/VirtualLibrary.h similarity index 100% rename from Sourcecode/private/mx/core/elements/VirtualLibrary.h rename to src/private/mx/core/elements/VirtualLibrary.h diff --git a/Sourcecode/private/mx/core/elements/VirtualName.cpp b/src/private/mx/core/elements/VirtualName.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/VirtualName.cpp rename to src/private/mx/core/elements/VirtualName.cpp diff --git a/Sourcecode/private/mx/core/elements/VirtualName.h b/src/private/mx/core/elements/VirtualName.h similarity index 100% rename from Sourcecode/private/mx/core/elements/VirtualName.h rename to src/private/mx/core/elements/VirtualName.h diff --git a/Sourcecode/private/mx/core/elements/Voice.cpp b/src/private/mx/core/elements/Voice.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Voice.cpp rename to src/private/mx/core/elements/Voice.cpp diff --git a/Sourcecode/private/mx/core/elements/Voice.h b/src/private/mx/core/elements/Voice.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Voice.h rename to src/private/mx/core/elements/Voice.h diff --git a/Sourcecode/private/mx/core/elements/Volume.cpp b/src/private/mx/core/elements/Volume.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Volume.cpp rename to src/private/mx/core/elements/Volume.cpp diff --git a/Sourcecode/private/mx/core/elements/Volume.h b/src/private/mx/core/elements/Volume.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Volume.h rename to src/private/mx/core/elements/Volume.h diff --git a/Sourcecode/private/mx/core/elements/WavyLine.cpp b/src/private/mx/core/elements/WavyLine.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WavyLine.cpp rename to src/private/mx/core/elements/WavyLine.cpp diff --git a/Sourcecode/private/mx/core/elements/WavyLine.h b/src/private/mx/core/elements/WavyLine.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WavyLine.h rename to src/private/mx/core/elements/WavyLine.h diff --git a/Sourcecode/private/mx/core/elements/WavyLineAttributes.cpp b/src/private/mx/core/elements/WavyLineAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WavyLineAttributes.cpp rename to src/private/mx/core/elements/WavyLineAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/WavyLineAttributes.h b/src/private/mx/core/elements/WavyLineAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WavyLineAttributes.h rename to src/private/mx/core/elements/WavyLineAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Wedge.cpp b/src/private/mx/core/elements/Wedge.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Wedge.cpp rename to src/private/mx/core/elements/Wedge.cpp diff --git a/Sourcecode/private/mx/core/elements/Wedge.h b/src/private/mx/core/elements/Wedge.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Wedge.h rename to src/private/mx/core/elements/Wedge.h diff --git a/Sourcecode/private/mx/core/elements/WedgeAttributes.cpp b/src/private/mx/core/elements/WedgeAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WedgeAttributes.cpp rename to src/private/mx/core/elements/WedgeAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/WedgeAttributes.h b/src/private/mx/core/elements/WedgeAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WedgeAttributes.h rename to src/private/mx/core/elements/WedgeAttributes.h diff --git a/Sourcecode/private/mx/core/elements/WithBar.cpp b/src/private/mx/core/elements/WithBar.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WithBar.cpp rename to src/private/mx/core/elements/WithBar.cpp diff --git a/Sourcecode/private/mx/core/elements/WithBar.h b/src/private/mx/core/elements/WithBar.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WithBar.h rename to src/private/mx/core/elements/WithBar.h diff --git a/Sourcecode/private/mx/core/elements/WithBarAttributes.cpp b/src/private/mx/core/elements/WithBarAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WithBarAttributes.cpp rename to src/private/mx/core/elements/WithBarAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/WithBarAttributes.h b/src/private/mx/core/elements/WithBarAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WithBarAttributes.h rename to src/private/mx/core/elements/WithBarAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Wood.cpp b/src/private/mx/core/elements/Wood.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Wood.cpp rename to src/private/mx/core/elements/Wood.cpp diff --git a/Sourcecode/private/mx/core/elements/Wood.h b/src/private/mx/core/elements/Wood.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Wood.h rename to src/private/mx/core/elements/Wood.h diff --git a/Sourcecode/private/mx/core/elements/WordFont.cpp b/src/private/mx/core/elements/WordFont.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WordFont.cpp rename to src/private/mx/core/elements/WordFont.cpp diff --git a/Sourcecode/private/mx/core/elements/WordFont.h b/src/private/mx/core/elements/WordFont.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WordFont.h rename to src/private/mx/core/elements/WordFont.h diff --git a/Sourcecode/private/mx/core/elements/Words.cpp b/src/private/mx/core/elements/Words.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Words.cpp rename to src/private/mx/core/elements/Words.cpp diff --git a/Sourcecode/private/mx/core/elements/Words.h b/src/private/mx/core/elements/Words.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Words.h rename to src/private/mx/core/elements/Words.h diff --git a/Sourcecode/private/mx/core/elements/WordsAttributes.cpp b/src/private/mx/core/elements/WordsAttributes.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WordsAttributes.cpp rename to src/private/mx/core/elements/WordsAttributes.cpp diff --git a/Sourcecode/private/mx/core/elements/WordsAttributes.h b/src/private/mx/core/elements/WordsAttributes.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WordsAttributes.h rename to src/private/mx/core/elements/WordsAttributes.h diff --git a/Sourcecode/private/mx/core/elements/Work.cpp b/src/private/mx/core/elements/Work.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/Work.cpp rename to src/private/mx/core/elements/Work.cpp diff --git a/Sourcecode/private/mx/core/elements/Work.h b/src/private/mx/core/elements/Work.h similarity index 100% rename from Sourcecode/private/mx/core/elements/Work.h rename to src/private/mx/core/elements/Work.h diff --git a/Sourcecode/private/mx/core/elements/WorkNumber.cpp b/src/private/mx/core/elements/WorkNumber.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WorkNumber.cpp rename to src/private/mx/core/elements/WorkNumber.cpp diff --git a/Sourcecode/private/mx/core/elements/WorkNumber.h b/src/private/mx/core/elements/WorkNumber.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WorkNumber.h rename to src/private/mx/core/elements/WorkNumber.h diff --git a/Sourcecode/private/mx/core/elements/WorkTitle.cpp b/src/private/mx/core/elements/WorkTitle.cpp similarity index 100% rename from Sourcecode/private/mx/core/elements/WorkTitle.cpp rename to src/private/mx/core/elements/WorkTitle.cpp diff --git a/Sourcecode/private/mx/core/elements/WorkTitle.h b/src/private/mx/core/elements/WorkTitle.h similarity index 100% rename from Sourcecode/private/mx/core/elements/WorkTitle.h rename to src/private/mx/core/elements/WorkTitle.h diff --git a/Sourcecode/private/mx/examples/Hide.cpp b/src/private/mx/examples/Hide.cpp similarity index 100% rename from Sourcecode/private/mx/examples/Hide.cpp rename to src/private/mx/examples/Hide.cpp diff --git a/Sourcecode/private/mx/examples/Read.cpp b/src/private/mx/examples/Read.cpp similarity index 100% rename from Sourcecode/private/mx/examples/Read.cpp rename to src/private/mx/examples/Read.cpp diff --git a/Sourcecode/private/mx/examples/Write.cpp b/src/private/mx/examples/Write.cpp similarity index 100% rename from Sourcecode/private/mx/examples/Write.cpp rename to src/private/mx/examples/Write.cpp diff --git a/Sourcecode/private/mx/ezxml/.gitattributes b/src/private/mx/ezxml/.gitattributes similarity index 100% rename from Sourcecode/private/mx/ezxml/.gitattributes rename to src/private/mx/ezxml/.gitattributes diff --git a/Sourcecode/private/mx/ezxml/license.txt b/src/private/mx/ezxml/license.txt similarity index 100% rename from Sourcecode/private/mx/ezxml/license.txt rename to src/private/mx/ezxml/license.txt diff --git a/Sourcecode/private/mx/ezxml/other/ezxml.sublime-project b/src/private/mx/ezxml/other/ezxml.sublime-project similarity index 100% rename from Sourcecode/private/mx/ezxml/other/ezxml.sublime-project rename to src/private/mx/ezxml/other/ezxml.sublime-project diff --git a/Sourcecode/private/mx/ezxml/other/ezxml.sublime-workspace.example copy b/src/private/mx/ezxml/other/ezxml.sublime-workspace.example copy similarity index 100% rename from Sourcecode/private/mx/ezxml/other/ezxml.sublime-workspace.example copy rename to src/private/mx/ezxml/other/ezxml.sublime-workspace.example copy diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XAttribute.h b/src/private/mx/ezxml/src/include/ezxml/XAttribute.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XAttribute.h rename to src/private/mx/ezxml/src/include/ezxml/XAttribute.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XAttributeIterImpl.h b/src/private/mx/ezxml/src/include/ezxml/XAttributeIterImpl.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XAttributeIterImpl.h rename to src/private/mx/ezxml/src/include/ezxml/XAttributeIterImpl.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XAttributeIterator.h b/src/private/mx/ezxml/src/include/ezxml/XAttributeIterator.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XAttributeIterator.h rename to src/private/mx/ezxml/src/include/ezxml/XAttributeIterator.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XDoc.h b/src/private/mx/ezxml/src/include/ezxml/XDoc.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XDoc.h rename to src/private/mx/ezxml/src/include/ezxml/XDoc.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XDocSpec.h b/src/private/mx/ezxml/src/include/ezxml/XDocSpec.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XDocSpec.h rename to src/private/mx/ezxml/src/include/ezxml/XDocSpec.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XElement.h b/src/private/mx/ezxml/src/include/ezxml/XElement.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XElement.h rename to src/private/mx/ezxml/src/include/ezxml/XElement.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h b/src/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h rename to src/private/mx/ezxml/src/include/ezxml/XElementIterImpl.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterator.h b/src/private/mx/ezxml/src/include/ezxml/XElementIterator.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XElementIterator.h rename to src/private/mx/ezxml/src/include/ezxml/XElementIterator.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XFactory.h b/src/private/mx/ezxml/src/include/ezxml/XFactory.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XFactory.h rename to src/private/mx/ezxml/src/include/ezxml/XFactory.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/XForwardDeclare.h b/src/private/mx/ezxml/src/include/ezxml/XForwardDeclare.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/XForwardDeclare.h rename to src/private/mx/ezxml/src/include/ezxml/XForwardDeclare.h diff --git a/Sourcecode/private/mx/ezxml/src/include/ezxml/ezxml.h b/src/private/mx/ezxml/src/include/ezxml/ezxml.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/include/ezxml/ezxml.h rename to src/private/mx/ezxml/src/include/ezxml/ezxml.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/Parse.h b/src/private/mx/ezxml/src/private/private/Parse.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/Parse.h rename to src/private/mx/ezxml/src/private/private/Parse.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiAttribute.cpp b/src/private/mx/ezxml/src/private/private/PugiAttribute.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiAttribute.cpp rename to src/private/mx/ezxml/src/private/private/PugiAttribute.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiAttribute.h b/src/private/mx/ezxml/src/private/private/PugiAttribute.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiAttribute.h rename to src/private/mx/ezxml/src/private/private/PugiAttribute.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.cpp b/src/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.cpp rename to src/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.h b/src/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.h rename to src/private/mx/ezxml/src/private/private/PugiAttributeIterImpl.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiDoc.cpp b/src/private/mx/ezxml/src/private/private/PugiDoc.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiDoc.cpp rename to src/private/mx/ezxml/src/private/private/PugiDoc.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiDoc.h b/src/private/mx/ezxml/src/private/private/PugiDoc.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiDoc.h rename to src/private/mx/ezxml/src/private/private/PugiDoc.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiElement.cpp b/src/private/mx/ezxml/src/private/private/PugiElement.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiElement.cpp rename to src/private/mx/ezxml/src/private/private/PugiElement.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiElement.h b/src/private/mx/ezxml/src/private/private/PugiElement.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiElement.h rename to src/private/mx/ezxml/src/private/private/PugiElement.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiElementIterImpl.cpp b/src/private/mx/ezxml/src/private/private/PugiElementIterImpl.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiElementIterImpl.cpp rename to src/private/mx/ezxml/src/private/private/PugiElementIterImpl.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/PugiElementIterImpl.h b/src/private/mx/ezxml/src/private/private/PugiElementIterImpl.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/PugiElementIterImpl.h rename to src/private/mx/ezxml/src/private/private/PugiElementIterImpl.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/Throw.h b/src/private/mx/ezxml/src/private/private/Throw.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/Throw.h rename to src/private/mx/ezxml/src/private/private/Throw.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/XAttributeIterator.cpp b/src/private/mx/ezxml/src/private/private/XAttributeIterator.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/XAttributeIterator.cpp rename to src/private/mx/ezxml/src/private/private/XAttributeIterator.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/XElementIterator.cpp b/src/private/mx/ezxml/src/private/private/XElementIterator.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/XElementIterator.cpp rename to src/private/mx/ezxml/src/private/private/XElementIterator.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/XFactory.cpp b/src/private/mx/ezxml/src/private/private/XFactory.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/XFactory.cpp rename to src/private/mx/ezxml/src/private/private/XFactory.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/XThrow.h b/src/private/mx/ezxml/src/private/private/XThrow.h similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/XThrow.h rename to src/private/mx/ezxml/src/private/private/XThrow.h diff --git a/Sourcecode/private/mx/ezxml/src/private/private/pugiconfig.hpp b/src/private/mx/ezxml/src/private/private/pugiconfig.hpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/pugiconfig.hpp rename to src/private/mx/ezxml/src/private/private/pugiconfig.hpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/pugilicense.txt b/src/private/mx/ezxml/src/private/private/pugilicense.txt similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/pugilicense.txt rename to src/private/mx/ezxml/src/private/private/pugilicense.txt diff --git a/Sourcecode/private/mx/ezxml/src/private/private/pugixml.cpp b/src/private/mx/ezxml/src/private/private/pugixml.cpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/pugixml.cpp rename to src/private/mx/ezxml/src/private/private/pugixml.cpp diff --git a/Sourcecode/private/mx/ezxml/src/private/private/pugixml.hpp b/src/private/mx/ezxml/src/private/private/pugixml.hpp similarity index 100% rename from Sourcecode/private/mx/ezxml/src/private/private/pugixml.hpp rename to src/private/mx/ezxml/src/private/private/pugixml.hpp diff --git a/Sourcecode/private/mx/impl/AccidentalMarkFunctions.cpp b/src/private/mx/impl/AccidentalMarkFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/AccidentalMarkFunctions.cpp rename to src/private/mx/impl/AccidentalMarkFunctions.cpp diff --git a/Sourcecode/private/mx/impl/AccidentalMarkFunctions.h b/src/private/mx/impl/AccidentalMarkFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/AccidentalMarkFunctions.h rename to src/private/mx/impl/AccidentalMarkFunctions.h diff --git a/Sourcecode/private/mx/impl/ArpeggiateFunctions.cpp b/src/private/mx/impl/ArpeggiateFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/ArpeggiateFunctions.cpp rename to src/private/mx/impl/ArpeggiateFunctions.cpp diff --git a/Sourcecode/private/mx/impl/ArpeggiateFunctions.h b/src/private/mx/impl/ArpeggiateFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/ArpeggiateFunctions.h rename to src/private/mx/impl/ArpeggiateFunctions.h diff --git a/Sourcecode/private/mx/impl/ArticulationsFunctions.cpp b/src/private/mx/impl/ArticulationsFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/ArticulationsFunctions.cpp rename to src/private/mx/impl/ArticulationsFunctions.cpp diff --git a/Sourcecode/private/mx/impl/ArticulationsFunctions.h b/src/private/mx/impl/ArticulationsFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/ArticulationsFunctions.h rename to src/private/mx/impl/ArticulationsFunctions.h diff --git a/Sourcecode/private/mx/impl/Converter.cpp b/src/private/mx/impl/Converter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/Converter.cpp rename to src/private/mx/impl/Converter.cpp diff --git a/Sourcecode/private/mx/impl/Converter.h b/src/private/mx/impl/Converter.h similarity index 100% rename from Sourcecode/private/mx/impl/Converter.h rename to src/private/mx/impl/Converter.h diff --git a/Sourcecode/private/mx/impl/Cursor.cpp b/src/private/mx/impl/Cursor.cpp similarity index 100% rename from Sourcecode/private/mx/impl/Cursor.cpp rename to src/private/mx/impl/Cursor.cpp diff --git a/Sourcecode/private/mx/impl/Cursor.h b/src/private/mx/impl/Cursor.h similarity index 100% rename from Sourcecode/private/mx/impl/Cursor.h rename to src/private/mx/impl/Cursor.h diff --git a/Sourcecode/private/mx/impl/CurveFunctions.h b/src/private/mx/impl/CurveFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/CurveFunctions.h rename to src/private/mx/impl/CurveFunctions.h diff --git a/Sourcecode/private/mx/impl/DirectionReader.cpp b/src/private/mx/impl/DirectionReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/DirectionReader.cpp rename to src/private/mx/impl/DirectionReader.cpp diff --git a/Sourcecode/private/mx/impl/DirectionReader.h b/src/private/mx/impl/DirectionReader.h similarity index 100% rename from Sourcecode/private/mx/impl/DirectionReader.h rename to src/private/mx/impl/DirectionReader.h diff --git a/Sourcecode/private/mx/impl/DirectionWriter.cpp b/src/private/mx/impl/DirectionWriter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/DirectionWriter.cpp rename to src/private/mx/impl/DirectionWriter.cpp diff --git a/Sourcecode/private/mx/impl/DirectionWriter.h b/src/private/mx/impl/DirectionWriter.h similarity index 100% rename from Sourcecode/private/mx/impl/DirectionWriter.h rename to src/private/mx/impl/DirectionWriter.h diff --git a/Sourcecode/private/mx/impl/DynamicsReader.cpp b/src/private/mx/impl/DynamicsReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/DynamicsReader.cpp rename to src/private/mx/impl/DynamicsReader.cpp diff --git a/Sourcecode/private/mx/impl/DynamicsReader.h b/src/private/mx/impl/DynamicsReader.h similarity index 100% rename from Sourcecode/private/mx/impl/DynamicsReader.h rename to src/private/mx/impl/DynamicsReader.h diff --git a/Sourcecode/private/mx/impl/DynamicsWriter.cpp b/src/private/mx/impl/DynamicsWriter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/DynamicsWriter.cpp rename to src/private/mx/impl/DynamicsWriter.cpp diff --git a/Sourcecode/private/mx/impl/DynamicsWriter.h b/src/private/mx/impl/DynamicsWriter.h similarity index 100% rename from Sourcecode/private/mx/impl/DynamicsWriter.h rename to src/private/mx/impl/DynamicsWriter.h diff --git a/Sourcecode/private/mx/impl/EncodingFunctions.cpp b/src/private/mx/impl/EncodingFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/EncodingFunctions.cpp rename to src/private/mx/impl/EncodingFunctions.cpp diff --git a/Sourcecode/private/mx/impl/EncodingFunctions.h b/src/private/mx/impl/EncodingFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/EncodingFunctions.h rename to src/private/mx/impl/EncodingFunctions.h diff --git a/Sourcecode/private/mx/impl/FermataFunctions.cpp b/src/private/mx/impl/FermataFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/FermataFunctions.cpp rename to src/private/mx/impl/FermataFunctions.cpp diff --git a/Sourcecode/private/mx/impl/FermataFunctions.h b/src/private/mx/impl/FermataFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/FermataFunctions.h rename to src/private/mx/impl/FermataFunctions.h diff --git a/Sourcecode/private/mx/impl/FontFunctions.h b/src/private/mx/impl/FontFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/FontFunctions.h rename to src/private/mx/impl/FontFunctions.h diff --git a/Sourcecode/private/mx/impl/LayoutFunctions.cpp b/src/private/mx/impl/LayoutFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/LayoutFunctions.cpp rename to src/private/mx/impl/LayoutFunctions.cpp diff --git a/Sourcecode/private/mx/impl/LayoutFunctions.h b/src/private/mx/impl/LayoutFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/LayoutFunctions.h rename to src/private/mx/impl/LayoutFunctions.h diff --git a/Sourcecode/private/mx/impl/LcmGcd.cpp b/src/private/mx/impl/LcmGcd.cpp similarity index 100% rename from Sourcecode/private/mx/impl/LcmGcd.cpp rename to src/private/mx/impl/LcmGcd.cpp diff --git a/Sourcecode/private/mx/impl/LcmGcd.h b/src/private/mx/impl/LcmGcd.h similarity index 100% rename from Sourcecode/private/mx/impl/LcmGcd.h rename to src/private/mx/impl/LcmGcd.h diff --git a/Sourcecode/private/mx/impl/LineFunctions.h b/src/private/mx/impl/LineFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/LineFunctions.h rename to src/private/mx/impl/LineFunctions.h diff --git a/Sourcecode/private/mx/impl/LyricType.cpp b/src/private/mx/impl/LyricType.cpp similarity index 100% rename from Sourcecode/private/mx/impl/LyricType.cpp rename to src/private/mx/impl/LyricType.cpp diff --git a/Sourcecode/private/mx/impl/LyricType.h b/src/private/mx/impl/LyricType.h similarity index 100% rename from Sourcecode/private/mx/impl/LyricType.h rename to src/private/mx/impl/LyricType.h diff --git a/Sourcecode/private/mx/impl/MarkDataFunctions.h b/src/private/mx/impl/MarkDataFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/MarkDataFunctions.h rename to src/private/mx/impl/MarkDataFunctions.h diff --git a/Sourcecode/private/mx/impl/MeasureCursor.h b/src/private/mx/impl/MeasureCursor.h similarity index 100% rename from Sourcecode/private/mx/impl/MeasureCursor.h rename to src/private/mx/impl/MeasureCursor.h diff --git a/Sourcecode/private/mx/impl/MeasureReader.cpp b/src/private/mx/impl/MeasureReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/MeasureReader.cpp rename to src/private/mx/impl/MeasureReader.cpp diff --git a/Sourcecode/private/mx/impl/MeasureReader.h b/src/private/mx/impl/MeasureReader.h similarity index 100% rename from Sourcecode/private/mx/impl/MeasureReader.h rename to src/private/mx/impl/MeasureReader.h diff --git a/Sourcecode/private/mx/impl/MeasureWriter.cpp b/src/private/mx/impl/MeasureWriter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/MeasureWriter.cpp rename to src/private/mx/impl/MeasureWriter.cpp diff --git a/Sourcecode/private/mx/impl/MeasureWriter.h b/src/private/mx/impl/MeasureWriter.h similarity index 100% rename from Sourcecode/private/mx/impl/MeasureWriter.h rename to src/private/mx/impl/MeasureWriter.h diff --git a/Sourcecode/private/mx/impl/MetronomeReader.cpp b/src/private/mx/impl/MetronomeReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/MetronomeReader.cpp rename to src/private/mx/impl/MetronomeReader.cpp diff --git a/Sourcecode/private/mx/impl/MetronomeReader.h b/src/private/mx/impl/MetronomeReader.h similarity index 100% rename from Sourcecode/private/mx/impl/MetronomeReader.h rename to src/private/mx/impl/MetronomeReader.h diff --git a/Sourcecode/private/mx/impl/MxVersionDefines.h b/src/private/mx/impl/MxVersionDefines.h similarity index 100% rename from Sourcecode/private/mx/impl/MxVersionDefines.h rename to src/private/mx/impl/MxVersionDefines.h diff --git a/Sourcecode/private/mx/impl/NonArpeggiateFunctions.cpp b/src/private/mx/impl/NonArpeggiateFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/NonArpeggiateFunctions.cpp rename to src/private/mx/impl/NonArpeggiateFunctions.cpp diff --git a/Sourcecode/private/mx/impl/NonArpeggiateFunctions.h b/src/private/mx/impl/NonArpeggiateFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/NonArpeggiateFunctions.h rename to src/private/mx/impl/NonArpeggiateFunctions.h diff --git a/Sourcecode/private/mx/impl/NotationsWriter.cpp b/src/private/mx/impl/NotationsWriter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/NotationsWriter.cpp rename to src/private/mx/impl/NotationsWriter.cpp diff --git a/Sourcecode/private/mx/impl/NotationsWriter.h b/src/private/mx/impl/NotationsWriter.h similarity index 100% rename from Sourcecode/private/mx/impl/NotationsWriter.h rename to src/private/mx/impl/NotationsWriter.h diff --git a/Sourcecode/private/mx/impl/NoteFunctions.cpp b/src/private/mx/impl/NoteFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/NoteFunctions.cpp rename to src/private/mx/impl/NoteFunctions.cpp diff --git a/Sourcecode/private/mx/impl/NoteFunctions.h b/src/private/mx/impl/NoteFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/NoteFunctions.h rename to src/private/mx/impl/NoteFunctions.h diff --git a/Sourcecode/private/mx/impl/NoteReader.cpp b/src/private/mx/impl/NoteReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/NoteReader.cpp rename to src/private/mx/impl/NoteReader.cpp diff --git a/Sourcecode/private/mx/impl/NoteReader.h b/src/private/mx/impl/NoteReader.h similarity index 100% rename from Sourcecode/private/mx/impl/NoteReader.h rename to src/private/mx/impl/NoteReader.h diff --git a/Sourcecode/private/mx/impl/NoteWriter.cpp b/src/private/mx/impl/NoteWriter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/NoteWriter.cpp rename to src/private/mx/impl/NoteWriter.cpp diff --git a/Sourcecode/private/mx/impl/NoteWriter.h b/src/private/mx/impl/NoteWriter.h similarity index 100% rename from Sourcecode/private/mx/impl/NoteWriter.h rename to src/private/mx/impl/NoteWriter.h diff --git a/Sourcecode/private/mx/impl/OrnamentsFunctions.cpp b/src/private/mx/impl/OrnamentsFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/OrnamentsFunctions.cpp rename to src/private/mx/impl/OrnamentsFunctions.cpp diff --git a/Sourcecode/private/mx/impl/OrnamentsFunctions.h b/src/private/mx/impl/OrnamentsFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/OrnamentsFunctions.h rename to src/private/mx/impl/OrnamentsFunctions.h diff --git a/Sourcecode/private/mx/impl/PageTextFunctions.cpp b/src/private/mx/impl/PageTextFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/PageTextFunctions.cpp rename to src/private/mx/impl/PageTextFunctions.cpp diff --git a/Sourcecode/private/mx/impl/PageTextFunctions.h b/src/private/mx/impl/PageTextFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/PageTextFunctions.h rename to src/private/mx/impl/PageTextFunctions.h diff --git a/Sourcecode/private/mx/impl/PartReader.cpp b/src/private/mx/impl/PartReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/PartReader.cpp rename to src/private/mx/impl/PartReader.cpp diff --git a/Sourcecode/private/mx/impl/PartReader.h b/src/private/mx/impl/PartReader.h similarity index 100% rename from Sourcecode/private/mx/impl/PartReader.h rename to src/private/mx/impl/PartReader.h diff --git a/Sourcecode/private/mx/impl/PartWriter.cpp b/src/private/mx/impl/PartWriter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/PartWriter.cpp rename to src/private/mx/impl/PartWriter.cpp diff --git a/Sourcecode/private/mx/impl/PartWriter.h b/src/private/mx/impl/PartWriter.h similarity index 100% rename from Sourcecode/private/mx/impl/PartWriter.h rename to src/private/mx/impl/PartWriter.h diff --git a/Sourcecode/private/mx/impl/PositionFunctions.h b/src/private/mx/impl/PositionFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/PositionFunctions.h rename to src/private/mx/impl/PositionFunctions.h diff --git a/Sourcecode/private/mx/impl/PrintFunctions.h b/src/private/mx/impl/PrintFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/PrintFunctions.h rename to src/private/mx/impl/PrintFunctions.h diff --git a/Sourcecode/private/mx/impl/PropertiesWriter.cpp b/src/private/mx/impl/PropertiesWriter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/PropertiesWriter.cpp rename to src/private/mx/impl/PropertiesWriter.cpp diff --git a/Sourcecode/private/mx/impl/PropertiesWriter.h b/src/private/mx/impl/PropertiesWriter.h similarity index 100% rename from Sourcecode/private/mx/impl/PropertiesWriter.h rename to src/private/mx/impl/PropertiesWriter.h diff --git a/Sourcecode/private/mx/impl/ScoreReader.cpp b/src/private/mx/impl/ScoreReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/ScoreReader.cpp rename to src/private/mx/impl/ScoreReader.cpp diff --git a/Sourcecode/private/mx/impl/ScoreReader.h b/src/private/mx/impl/ScoreReader.h similarity index 100% rename from Sourcecode/private/mx/impl/ScoreReader.h rename to src/private/mx/impl/ScoreReader.h diff --git a/Sourcecode/private/mx/impl/ScoreWriter.cpp b/src/private/mx/impl/ScoreWriter.cpp similarity index 100% rename from Sourcecode/private/mx/impl/ScoreWriter.cpp rename to src/private/mx/impl/ScoreWriter.cpp diff --git a/Sourcecode/private/mx/impl/ScoreWriter.h b/src/private/mx/impl/ScoreWriter.h similarity index 100% rename from Sourcecode/private/mx/impl/ScoreWriter.h rename to src/private/mx/impl/ScoreWriter.h diff --git a/Sourcecode/private/mx/impl/SlideFunctions.cpp b/src/private/mx/impl/SlideFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/SlideFunctions.cpp rename to src/private/mx/impl/SlideFunctions.cpp diff --git a/Sourcecode/private/mx/impl/SlideFunctions.h b/src/private/mx/impl/SlideFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/SlideFunctions.h rename to src/private/mx/impl/SlideFunctions.h diff --git a/Sourcecode/private/mx/impl/SpannerFunctions.h b/src/private/mx/impl/SpannerFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/SpannerFunctions.h rename to src/private/mx/impl/SpannerFunctions.h diff --git a/Sourcecode/private/mx/impl/StaffFunctions.cpp b/src/private/mx/impl/StaffFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/StaffFunctions.cpp rename to src/private/mx/impl/StaffFunctions.cpp diff --git a/Sourcecode/private/mx/impl/StaffFunctions.h b/src/private/mx/impl/StaffFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/StaffFunctions.h rename to src/private/mx/impl/StaffFunctions.h diff --git a/Sourcecode/private/mx/impl/TechnicalFunctions.cpp b/src/private/mx/impl/TechnicalFunctions.cpp similarity index 100% rename from Sourcecode/private/mx/impl/TechnicalFunctions.cpp rename to src/private/mx/impl/TechnicalFunctions.cpp diff --git a/Sourcecode/private/mx/impl/TechnicalFunctions.h b/src/private/mx/impl/TechnicalFunctions.h similarity index 100% rename from Sourcecode/private/mx/impl/TechnicalFunctions.h rename to src/private/mx/impl/TechnicalFunctions.h diff --git a/Sourcecode/private/mx/impl/TimeReader.cpp b/src/private/mx/impl/TimeReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/TimeReader.cpp rename to src/private/mx/impl/TimeReader.cpp diff --git a/Sourcecode/private/mx/impl/TimeReader.h b/src/private/mx/impl/TimeReader.h similarity index 100% rename from Sourcecode/private/mx/impl/TimeReader.h rename to src/private/mx/impl/TimeReader.h diff --git a/Sourcecode/private/mx/impl/TupletReader.cpp b/src/private/mx/impl/TupletReader.cpp similarity index 100% rename from Sourcecode/private/mx/impl/TupletReader.cpp rename to src/private/mx/impl/TupletReader.cpp diff --git a/Sourcecode/private/mx/impl/TupletReader.h b/src/private/mx/impl/TupletReader.h similarity index 100% rename from Sourcecode/private/mx/impl/TupletReader.h rename to src/private/mx/impl/TupletReader.h diff --git a/Sourcecode/private/mx/utility/Enum.h b/src/private/mx/utility/Enum.h similarity index 100% rename from Sourcecode/private/mx/utility/Enum.h rename to src/private/mx/utility/Enum.h diff --git a/Sourcecode/private/mx/utility/EnumWithString.h b/src/private/mx/utility/EnumWithString.h similarity index 100% rename from Sourcecode/private/mx/utility/EnumWithString.h rename to src/private/mx/utility/EnumWithString.h diff --git a/Sourcecode/private/mx/utility/JitAllocate.h b/src/private/mx/utility/JitAllocate.h similarity index 100% rename from Sourcecode/private/mx/utility/JitAllocate.h rename to src/private/mx/utility/JitAllocate.h diff --git a/Sourcecode/private/mx/utility/Lock.h b/src/private/mx/utility/Lock.h similarity index 100% rename from Sourcecode/private/mx/utility/Lock.h rename to src/private/mx/utility/Lock.h diff --git a/Sourcecode/private/mx/utility/OptionalMembers.h b/src/private/mx/utility/OptionalMembers.h similarity index 100% rename from Sourcecode/private/mx/utility/OptionalMembers.h rename to src/private/mx/utility/OptionalMembers.h diff --git a/Sourcecode/private/mx/utility/Parse.h b/src/private/mx/utility/Parse.h similarity index 100% rename from Sourcecode/private/mx/utility/Parse.h rename to src/private/mx/utility/Parse.h diff --git a/Sourcecode/private/mx/utility/Round.h b/src/private/mx/utility/Round.h similarity index 100% rename from Sourcecode/private/mx/utility/Round.h rename to src/private/mx/utility/Round.h diff --git a/Sourcecode/private/mx/utility/StringToInt.h b/src/private/mx/utility/StringToInt.h similarity index 100% rename from Sourcecode/private/mx/utility/StringToInt.h rename to src/private/mx/utility/StringToInt.h diff --git a/Sourcecode/private/mx/utility/Throw.h b/src/private/mx/utility/Throw.h similarity index 100% rename from Sourcecode/private/mx/utility/Throw.h rename to src/private/mx/utility/Throw.h diff --git a/Sourcecode/private/mxtest/api/ApiChordSimpleScoreData.h b/src/private/mxtest/api/ApiChordSimpleScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiChordSimpleScoreData.h rename to src/private/mxtest/api/ApiChordSimpleScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiChordSimpleTest.cpp b/src/private/mxtest/api/ApiChordSimpleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiChordSimpleTest.cpp rename to src/private/mxtest/api/ApiChordSimpleTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiK007aScoreData.h b/src/private/mxtest/api/ApiK007aScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK007aScoreData.h rename to src/private/mxtest/api/ApiK007aScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiK007aTest.cpp b/src/private/mxtest/api/ApiK007aTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK007aTest.cpp rename to src/private/mxtest/api/ApiK007aTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiK007cScoreData.h b/src/private/mxtest/api/ApiK007cScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK007cScoreData.h rename to src/private/mxtest/api/ApiK007cScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiK007cTest.cpp b/src/private/mxtest/api/ApiK007cTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK007cTest.cpp rename to src/private/mxtest/api/ApiK007cTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiK009bSlurScoreData.h b/src/private/mxtest/api/ApiK009bSlurScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK009bSlurScoreData.h rename to src/private/mxtest/api/ApiK009bSlurScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiK009bSlurTest.cpp b/src/private/mxtest/api/ApiK009bSlurTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK009bSlurTest.cpp rename to src/private/mxtest/api/ApiK009bSlurTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiK014aFermatasScoreData.h b/src/private/mxtest/api/ApiK014aFermatasScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK014aFermatasScoreData.h rename to src/private/mxtest/api/ApiK014aFermatasScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiK014aFermatasTest.cpp b/src/private/mxtest/api/ApiK014aFermatasTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK014aFermatasTest.cpp rename to src/private/mxtest/api/ApiK014aFermatasTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiK015aLayoutScoreData.h b/src/private/mxtest/api/ApiK015aLayoutScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK015aLayoutScoreData.h rename to src/private/mxtest/api/ApiK015aLayoutScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiK015aLayoutTest.cpp b/src/private/mxtest/api/ApiK015aLayoutTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK015aLayoutTest.cpp rename to src/private/mxtest/api/ApiK015aLayoutTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiK016aMiscScoreData.h b/src/private/mxtest/api/ApiK016aMiscScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK016aMiscScoreData.h rename to src/private/mxtest/api/ApiK016aMiscScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiK016aMiscTest.cpp b/src/private/mxtest/api/ApiK016aMiscTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiK016aMiscTest.cpp rename to src/private/mxtest/api/ApiK016aMiscTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiLoadSurvivalTest.cpp b/src/private/mxtest/api/ApiLoadSurvivalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiLoadSurvivalTest.cpp rename to src/private/mxtest/api/ApiLoadSurvivalTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiLy43eScoreData.h b/src/private/mxtest/api/ApiLy43eScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiLy43eScoreData.h rename to src/private/mxtest/api/ApiLy43eScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiLy43eTest.cpp b/src/private/mxtest/api/ApiLy43eTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiLy43eTest.cpp rename to src/private/mxtest/api/ApiLy43eTest.cpp diff --git a/Sourcecode/private/mxtest/api/ApiMuAccidentals1ScoreData.h b/src/private/mxtest/api/ApiMuAccidentals1ScoreData.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiMuAccidentals1ScoreData.h rename to src/private/mxtest/api/ApiMuAccidentals1ScoreData.h diff --git a/Sourcecode/private/mxtest/api/ApiMuAccidentals1Test.cpp b/src/private/mxtest/api/ApiMuAccidentals1Test.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiMuAccidentals1Test.cpp rename to src/private/mxtest/api/ApiMuAccidentals1Test.cpp diff --git a/Sourcecode/private/mxtest/api/ApiTester.cpp b/src/private/mxtest/api/ApiTester.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ApiTester.cpp rename to src/private/mxtest/api/ApiTester.cpp diff --git a/Sourcecode/private/mxtest/api/ApiTester.h b/src/private/mxtest/api/ApiTester.h similarity index 100% rename from Sourcecode/private/mxtest/api/ApiTester.h rename to src/private/mxtest/api/ApiTester.h diff --git a/Sourcecode/private/mxtest/api/BombeTest.cpp b/src/private/mxtest/api/BombeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/BombeTest.cpp rename to src/private/mxtest/api/BombeTest.cpp diff --git a/Sourcecode/private/mxtest/api/ChordApiTest.cpp b/src/private/mxtest/api/ChordApiTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ChordApiTest.cpp rename to src/private/mxtest/api/ChordApiTest.cpp diff --git a/Sourcecode/private/mxtest/api/ChordDataSaveAndLoadTest.cpp b/src/private/mxtest/api/ChordDataSaveAndLoadTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ChordDataSaveAndLoadTest.cpp rename to src/private/mxtest/api/ChordDataSaveAndLoadTest.cpp diff --git a/Sourcecode/private/mxtest/api/ChordTimeTest.cpp b/src/private/mxtest/api/ChordTimeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/ChordTimeTest.cpp rename to src/private/mxtest/api/ChordTimeTest.cpp diff --git a/Sourcecode/private/mxtest/api/DirectionDataTest.cpp b/src/private/mxtest/api/DirectionDataTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/DirectionDataTest.cpp rename to src/private/mxtest/api/DirectionDataTest.cpp diff --git a/Sourcecode/private/mxtest/api/DocumentManagerTest.cpp b/src/private/mxtest/api/DocumentManagerTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/DocumentManagerTest.cpp rename to src/private/mxtest/api/DocumentManagerTest.cpp diff --git a/Sourcecode/private/mxtest/api/FreezingRoundTrip.cpp b/src/private/mxtest/api/FreezingRoundTrip.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/FreezingRoundTrip.cpp rename to src/private/mxtest/api/FreezingRoundTrip.cpp diff --git a/Sourcecode/private/mxtest/api/FreezingTest.cpp b/src/private/mxtest/api/FreezingTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/FreezingTest.cpp rename to src/private/mxtest/api/FreezingTest.cpp diff --git a/Sourcecode/private/mxtest/api/KeyDataTest.cpp b/src/private/mxtest/api/KeyDataTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/KeyDataTest.cpp rename to src/private/mxtest/api/KeyDataTest.cpp diff --git a/Sourcecode/private/mxtest/api/MeasureDataTest.cpp b/src/private/mxtest/api/MeasureDataTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/MeasureDataTest.cpp rename to src/private/mxtest/api/MeasureDataTest.cpp diff --git a/Sourcecode/private/mxtest/api/MetronomeApiTest.cpp b/src/private/mxtest/api/MetronomeApiTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/MetronomeApiTest.cpp rename to src/private/mxtest/api/MetronomeApiTest.cpp diff --git a/Sourcecode/private/mxtest/api/MxlTest.cpp b/src/private/mxtest/api/MxlTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/MxlTest.cpp rename to src/private/mxtest/api/MxlTest.cpp diff --git a/Sourcecode/private/mxtest/api/NewSystemTest.cpp b/src/private/mxtest/api/NewSystemTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/NewSystemTest.cpp rename to src/private/mxtest/api/NewSystemTest.cpp diff --git a/Sourcecode/private/mxtest/api/NoteDataTest.cpp b/src/private/mxtest/api/NoteDataTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/NoteDataTest.cpp rename to src/private/mxtest/api/NoteDataTest.cpp diff --git a/Sourcecode/private/mxtest/api/PageDataTest.cpp b/src/private/mxtest/api/PageDataTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/PageDataTest.cpp rename to src/private/mxtest/api/PageDataTest.cpp diff --git a/Sourcecode/private/mxtest/api/PitchDataTest.cpp b/src/private/mxtest/api/PitchDataTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/PitchDataTest.cpp rename to src/private/mxtest/api/PitchDataTest.cpp diff --git a/Sourcecode/private/mxtest/api/RoundTrip.h b/src/private/mxtest/api/RoundTrip.h similarity index 100% rename from Sourcecode/private/mxtest/api/RoundTrip.h rename to src/private/mxtest/api/RoundTrip.h diff --git a/Sourcecode/private/mxtest/api/ScoreDataCreator.h b/src/private/mxtest/api/ScoreDataCreator.h similarity index 100% rename from Sourcecode/private/mxtest/api/ScoreDataCreator.h rename to src/private/mxtest/api/ScoreDataCreator.h diff --git a/Sourcecode/private/mxtest/api/SlurTest.cpp b/src/private/mxtest/api/SlurTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/SlurTest.cpp rename to src/private/mxtest/api/SlurTest.cpp diff --git a/Sourcecode/private/mxtest/api/TestHelpers.h b/src/private/mxtest/api/TestHelpers.h similarity index 100% rename from Sourcecode/private/mxtest/api/TestHelpers.h rename to src/private/mxtest/api/TestHelpers.h diff --git a/Sourcecode/private/mxtest/api/TimeSignatureApiTest.cpp b/src/private/mxtest/api/TimeSignatureApiTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/TimeSignatureApiTest.cpp rename to src/private/mxtest/api/TimeSignatureApiTest.cpp diff --git a/Sourcecode/private/mxtest/api/TranspositionTest.cpp b/src/private/mxtest/api/TranspositionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/api/TranspositionTest.cpp rename to src/private/mxtest/api/TranspositionTest.cpp diff --git a/Sourcecode/private/mxtest/control/CompileControl.h b/src/private/mxtest/control/CompileControl.h similarity index 100% rename from Sourcecode/private/mxtest/control/CompileControl.h rename to src/private/mxtest/control/CompileControl.h diff --git a/Sourcecode/private/mxtest/core/AccentTest.cpp b/src/private/mxtest/core/AccentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccentTest.cpp rename to src/private/mxtest/core/AccentTest.cpp diff --git a/Sourcecode/private/mxtest/core/AccidentalMarkTest.cpp b/src/private/mxtest/core/AccidentalMarkTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccidentalMarkTest.cpp rename to src/private/mxtest/core/AccidentalMarkTest.cpp diff --git a/Sourcecode/private/mxtest/core/AccidentalTest.cpp b/src/private/mxtest/core/AccidentalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccidentalTest.cpp rename to src/private/mxtest/core/AccidentalTest.cpp diff --git a/Sourcecode/private/mxtest/core/AccidentalTextTest.cpp b/src/private/mxtest/core/AccidentalTextTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccidentalTextTest.cpp rename to src/private/mxtest/core/AccidentalTextTest.cpp diff --git a/Sourcecode/private/mxtest/core/AccordTest.cpp b/src/private/mxtest/core/AccordTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccordTest.cpp rename to src/private/mxtest/core/AccordTest.cpp diff --git a/Sourcecode/private/mxtest/core/AccordTest.h b/src/private/mxtest/core/AccordTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/AccordTest.h rename to src/private/mxtest/core/AccordTest.h diff --git a/Sourcecode/private/mxtest/core/AccordionHighTest.cpp b/src/private/mxtest/core/AccordionHighTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccordionHighTest.cpp rename to src/private/mxtest/core/AccordionHighTest.cpp diff --git a/Sourcecode/private/mxtest/core/AccordionLowTest.cpp b/src/private/mxtest/core/AccordionLowTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccordionLowTest.cpp rename to src/private/mxtest/core/AccordionLowTest.cpp diff --git a/Sourcecode/private/mxtest/core/AccordionMiddleTest.cpp b/src/private/mxtest/core/AccordionMiddleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccordionMiddleTest.cpp rename to src/private/mxtest/core/AccordionMiddleTest.cpp diff --git a/Sourcecode/private/mxtest/core/AccordionRegistrationTest.cpp b/src/private/mxtest/core/AccordionRegistrationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AccordionRegistrationTest.cpp rename to src/private/mxtest/core/AccordionRegistrationTest.cpp diff --git a/Sourcecode/private/mxtest/core/ActualNotesTest.cpp b/src/private/mxtest/core/ActualNotesTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ActualNotesTest.cpp rename to src/private/mxtest/core/ActualNotesTest.cpp diff --git a/Sourcecode/private/mxtest/core/AlterTest.cpp b/src/private/mxtest/core/AlterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AlterTest.cpp rename to src/private/mxtest/core/AlterTest.cpp diff --git a/Sourcecode/private/mxtest/core/AppearanceTest.cpp b/src/private/mxtest/core/AppearanceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/AppearanceTest.cpp rename to src/private/mxtest/core/AppearanceTest.cpp diff --git a/Sourcecode/private/mxtest/core/AppearanceTest.h b/src/private/mxtest/core/AppearanceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/AppearanceTest.h rename to src/private/mxtest/core/AppearanceTest.h diff --git a/Sourcecode/private/mxtest/core/ArpeggiateTest.cpp b/src/private/mxtest/core/ArpeggiateTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ArpeggiateTest.cpp rename to src/private/mxtest/core/ArpeggiateTest.cpp diff --git a/Sourcecode/private/mxtest/core/ArrowDirectionTest.cpp b/src/private/mxtest/core/ArrowDirectionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ArrowDirectionTest.cpp rename to src/private/mxtest/core/ArrowDirectionTest.cpp diff --git a/Sourcecode/private/mxtest/core/ArrowStyleTest.cpp b/src/private/mxtest/core/ArrowStyleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ArrowStyleTest.cpp rename to src/private/mxtest/core/ArrowStyleTest.cpp diff --git a/Sourcecode/private/mxtest/core/ArrowTest.cpp b/src/private/mxtest/core/ArrowTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ArrowTest.cpp rename to src/private/mxtest/core/ArrowTest.cpp diff --git a/Sourcecode/private/mxtest/core/ArrowTest.h b/src/private/mxtest/core/ArrowTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ArrowTest.h rename to src/private/mxtest/core/ArrowTest.h diff --git a/Sourcecode/private/mxtest/core/ArticulationsTest.cpp b/src/private/mxtest/core/ArticulationsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ArticulationsTest.cpp rename to src/private/mxtest/core/ArticulationsTest.cpp diff --git a/Sourcecode/private/mxtest/core/ArticulationsTest.h b/src/private/mxtest/core/ArticulationsTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ArticulationsTest.h rename to src/private/mxtest/core/ArticulationsTest.h diff --git a/Sourcecode/private/mxtest/core/ArtificialTest.cpp b/src/private/mxtest/core/ArtificialTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ArtificialTest.cpp rename to src/private/mxtest/core/ArtificialTest.cpp diff --git a/Sourcecode/private/mxtest/core/BackupTest.cpp b/src/private/mxtest/core/BackupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BackupTest.cpp rename to src/private/mxtest/core/BackupTest.cpp diff --git a/Sourcecode/private/mxtest/core/BackupTest.h b/src/private/mxtest/core/BackupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/BackupTest.h rename to src/private/mxtest/core/BackupTest.h diff --git a/Sourcecode/private/mxtest/core/BarStyleTest.cpp b/src/private/mxtest/core/BarStyleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BarStyleTest.cpp rename to src/private/mxtest/core/BarStyleTest.cpp diff --git a/Sourcecode/private/mxtest/core/BarlineTest.cpp b/src/private/mxtest/core/BarlineTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BarlineTest.cpp rename to src/private/mxtest/core/BarlineTest.cpp diff --git a/Sourcecode/private/mxtest/core/BarlineTest.h b/src/private/mxtest/core/BarlineTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/BarlineTest.h rename to src/private/mxtest/core/BarlineTest.h diff --git a/Sourcecode/private/mxtest/core/BarreTest.cpp b/src/private/mxtest/core/BarreTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BarreTest.cpp rename to src/private/mxtest/core/BarreTest.cpp diff --git a/Sourcecode/private/mxtest/core/BasePitchTest.cpp b/src/private/mxtest/core/BasePitchTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BasePitchTest.cpp rename to src/private/mxtest/core/BasePitchTest.cpp diff --git a/Sourcecode/private/mxtest/core/BassAlterTest.cpp b/src/private/mxtest/core/BassAlterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BassAlterTest.cpp rename to src/private/mxtest/core/BassAlterTest.cpp diff --git a/Sourcecode/private/mxtest/core/BassStepTest.cpp b/src/private/mxtest/core/BassStepTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BassStepTest.cpp rename to src/private/mxtest/core/BassStepTest.cpp diff --git a/Sourcecode/private/mxtest/core/BassTest.cpp b/src/private/mxtest/core/BassTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BassTest.cpp rename to src/private/mxtest/core/BassTest.cpp diff --git a/Sourcecode/private/mxtest/core/BassTest.h b/src/private/mxtest/core/BassTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/BassTest.h rename to src/private/mxtest/core/BassTest.h diff --git a/Sourcecode/private/mxtest/core/BeamTest.cpp b/src/private/mxtest/core/BeamTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BeamTest.cpp rename to src/private/mxtest/core/BeamTest.cpp diff --git a/Sourcecode/private/mxtest/core/BeatRepeatTest.cpp b/src/private/mxtest/core/BeatRepeatTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BeatRepeatTest.cpp rename to src/private/mxtest/core/BeatRepeatTest.cpp diff --git a/Sourcecode/private/mxtest/core/BeatTypeTest.cpp b/src/private/mxtest/core/BeatTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BeatTypeTest.cpp rename to src/private/mxtest/core/BeatTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/BeatUnitDotTest.cpp b/src/private/mxtest/core/BeatUnitDotTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BeatUnitDotTest.cpp rename to src/private/mxtest/core/BeatUnitDotTest.cpp diff --git a/Sourcecode/private/mxtest/core/BeatUnitTest.cpp b/src/private/mxtest/core/BeatUnitTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BeatUnitTest.cpp rename to src/private/mxtest/core/BeatUnitTest.cpp diff --git a/Sourcecode/private/mxtest/core/BeaterTest.cpp b/src/private/mxtest/core/BeaterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BeaterTest.cpp rename to src/private/mxtest/core/BeaterTest.cpp diff --git a/Sourcecode/private/mxtest/core/BeatsTest.cpp b/src/private/mxtest/core/BeatsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BeatsTest.cpp rename to src/private/mxtest/core/BeatsTest.cpp diff --git a/Sourcecode/private/mxtest/core/BendAlterTest.cpp b/src/private/mxtest/core/BendAlterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BendAlterTest.cpp rename to src/private/mxtest/core/BendAlterTest.cpp diff --git a/Sourcecode/private/mxtest/core/BendChoiceTest.cpp b/src/private/mxtest/core/BendChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BendChoiceTest.cpp rename to src/private/mxtest/core/BendChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/BendChoiceTest.h b/src/private/mxtest/core/BendChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/BendChoiceTest.h rename to src/private/mxtest/core/BendChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/BendTest.cpp b/src/private/mxtest/core/BendTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BendTest.cpp rename to src/private/mxtest/core/BendTest.cpp diff --git a/Sourcecode/private/mxtest/core/BendTest.h b/src/private/mxtest/core/BendTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/BendTest.h rename to src/private/mxtest/core/BendTest.h diff --git a/Sourcecode/private/mxtest/core/BookmarkTest.cpp b/src/private/mxtest/core/BookmarkTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BookmarkTest.cpp rename to src/private/mxtest/core/BookmarkTest.cpp diff --git a/Sourcecode/private/mxtest/core/BottomMarginTest.cpp b/src/private/mxtest/core/BottomMarginTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BottomMarginTest.cpp rename to src/private/mxtest/core/BottomMarginTest.cpp diff --git a/Sourcecode/private/mxtest/core/BracketTest.cpp b/src/private/mxtest/core/BracketTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BracketTest.cpp rename to src/private/mxtest/core/BracketTest.cpp diff --git a/Sourcecode/private/mxtest/core/BreathMarkTest.cpp b/src/private/mxtest/core/BreathMarkTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/BreathMarkTest.cpp rename to src/private/mxtest/core/BreathMarkTest.cpp diff --git a/Sourcecode/private/mxtest/core/CaesuraTest.cpp b/src/private/mxtest/core/CaesuraTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CaesuraTest.cpp rename to src/private/mxtest/core/CaesuraTest.cpp diff --git a/Sourcecode/private/mxtest/core/CancelTest.cpp b/src/private/mxtest/core/CancelTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CancelTest.cpp rename to src/private/mxtest/core/CancelTest.cpp diff --git a/Sourcecode/private/mxtest/core/CapoTest.cpp b/src/private/mxtest/core/CapoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CapoTest.cpp rename to src/private/mxtest/core/CapoTest.cpp diff --git a/Sourcecode/private/mxtest/core/ChordTest.cpp b/src/private/mxtest/core/ChordTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ChordTest.cpp rename to src/private/mxtest/core/ChordTest.cpp diff --git a/Sourcecode/private/mxtest/core/ChromaticTest.cpp b/src/private/mxtest/core/ChromaticTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ChromaticTest.cpp rename to src/private/mxtest/core/ChromaticTest.cpp diff --git a/Sourcecode/private/mxtest/core/CircularArrowTest.cpp b/src/private/mxtest/core/CircularArrowTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CircularArrowTest.cpp rename to src/private/mxtest/core/CircularArrowTest.cpp diff --git a/Sourcecode/private/mxtest/core/ClefOctaveChangeTest.cpp b/src/private/mxtest/core/ClefOctaveChangeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ClefOctaveChangeTest.cpp rename to src/private/mxtest/core/ClefOctaveChangeTest.cpp diff --git a/Sourcecode/private/mxtest/core/ClefTest.cpp b/src/private/mxtest/core/ClefTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ClefTest.cpp rename to src/private/mxtest/core/ClefTest.cpp diff --git a/Sourcecode/private/mxtest/core/CodaTest.cpp b/src/private/mxtest/core/CodaTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CodaTest.cpp rename to src/private/mxtest/core/CodaTest.cpp diff --git a/Sourcecode/private/mxtest/core/ColorTest.cpp b/src/private/mxtest/core/ColorTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ColorTest.cpp rename to src/private/mxtest/core/ColorTest.cpp diff --git a/Sourcecode/private/mxtest/core/CreatorTest.cpp b/src/private/mxtest/core/CreatorTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CreatorTest.cpp rename to src/private/mxtest/core/CreatorTest.cpp diff --git a/Sourcecode/private/mxtest/core/CreditChoiceTest.cpp b/src/private/mxtest/core/CreditChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CreditChoiceTest.cpp rename to src/private/mxtest/core/CreditChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/CreditChoiceTest.h b/src/private/mxtest/core/CreditChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/CreditChoiceTest.h rename to src/private/mxtest/core/CreditChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/CreditImageTest.cpp b/src/private/mxtest/core/CreditImageTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CreditImageTest.cpp rename to src/private/mxtest/core/CreditImageTest.cpp diff --git a/Sourcecode/private/mxtest/core/CreditTest.cpp b/src/private/mxtest/core/CreditTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CreditTest.cpp rename to src/private/mxtest/core/CreditTest.cpp diff --git a/Sourcecode/private/mxtest/core/CreditTest.h b/src/private/mxtest/core/CreditTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/CreditTest.h rename to src/private/mxtest/core/CreditTest.h diff --git a/Sourcecode/private/mxtest/core/CreditTypeTest.cpp b/src/private/mxtest/core/CreditTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CreditTypeTest.cpp rename to src/private/mxtest/core/CreditTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/CreditWordsGroupTest.cpp b/src/private/mxtest/core/CreditWordsGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CreditWordsGroupTest.cpp rename to src/private/mxtest/core/CreditWordsGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/CreditWordsGroupTest.h b/src/private/mxtest/core/CreditWordsGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/CreditWordsGroupTest.h rename to src/private/mxtest/core/CreditWordsGroupTest.h diff --git a/Sourcecode/private/mxtest/core/CreditWordsTest.cpp b/src/private/mxtest/core/CreditWordsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CreditWordsTest.cpp rename to src/private/mxtest/core/CreditWordsTest.cpp diff --git a/Sourcecode/private/mxtest/core/CueNoteGroupTest.cpp b/src/private/mxtest/core/CueNoteGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CueNoteGroupTest.cpp rename to src/private/mxtest/core/CueNoteGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/CueNoteGroupTest.h b/src/private/mxtest/core/CueNoteGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/CueNoteGroupTest.h rename to src/private/mxtest/core/CueNoteGroupTest.h diff --git a/Sourcecode/private/mxtest/core/CueTest.cpp b/src/private/mxtest/core/CueTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/CueTest.cpp rename to src/private/mxtest/core/CueTest.cpp diff --git a/Sourcecode/private/mxtest/core/DampAllTest.cpp b/src/private/mxtest/core/DampAllTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DampAllTest.cpp rename to src/private/mxtest/core/DampAllTest.cpp diff --git a/Sourcecode/private/mxtest/core/DampTest.cpp b/src/private/mxtest/core/DampTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DampTest.cpp rename to src/private/mxtest/core/DampTest.cpp diff --git a/Sourcecode/private/mxtest/core/DashesTest.cpp b/src/private/mxtest/core/DashesTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DashesTest.cpp rename to src/private/mxtest/core/DashesTest.cpp diff --git a/Sourcecode/private/mxtest/core/DateTest.cpp b/src/private/mxtest/core/DateTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DateTest.cpp rename to src/private/mxtest/core/DateTest.cpp diff --git a/Sourcecode/private/mxtest/core/DecimalsTest.cpp b/src/private/mxtest/core/DecimalsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DecimalsTest.cpp rename to src/private/mxtest/core/DecimalsTest.cpp diff --git a/Sourcecode/private/mxtest/core/DefaultsTest.cpp b/src/private/mxtest/core/DefaultsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DefaultsTest.cpp rename to src/private/mxtest/core/DefaultsTest.cpp diff --git a/Sourcecode/private/mxtest/core/DefaultsTest.h b/src/private/mxtest/core/DefaultsTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/DefaultsTest.h rename to src/private/mxtest/core/DefaultsTest.h diff --git a/Sourcecode/private/mxtest/core/DegreeAlterTest.cpp b/src/private/mxtest/core/DegreeAlterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DegreeAlterTest.cpp rename to src/private/mxtest/core/DegreeAlterTest.cpp diff --git a/Sourcecode/private/mxtest/core/DegreeTest.cpp b/src/private/mxtest/core/DegreeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DegreeTest.cpp rename to src/private/mxtest/core/DegreeTest.cpp diff --git a/Sourcecode/private/mxtest/core/DegreeTest.h b/src/private/mxtest/core/DegreeTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/DegreeTest.h rename to src/private/mxtest/core/DegreeTest.h diff --git a/Sourcecode/private/mxtest/core/DegreeTypeTest.cpp b/src/private/mxtest/core/DegreeTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DegreeTypeTest.cpp rename to src/private/mxtest/core/DegreeTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/DegreeValueTest.cpp b/src/private/mxtest/core/DegreeValueTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DegreeValueTest.cpp rename to src/private/mxtest/core/DegreeValueTest.cpp diff --git a/Sourcecode/private/mxtest/core/DelayedInvertedTurnTest.cpp b/src/private/mxtest/core/DelayedInvertedTurnTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DelayedInvertedTurnTest.cpp rename to src/private/mxtest/core/DelayedInvertedTurnTest.cpp diff --git a/Sourcecode/private/mxtest/core/DelayedTurnTest.cpp b/src/private/mxtest/core/DelayedTurnTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DelayedTurnTest.cpp rename to src/private/mxtest/core/DelayedTurnTest.cpp diff --git a/Sourcecode/private/mxtest/core/DetachedLegatoTest.cpp b/src/private/mxtest/core/DetachedLegatoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DetachedLegatoTest.cpp rename to src/private/mxtest/core/DetachedLegatoTest.cpp diff --git a/Sourcecode/private/mxtest/core/DiatonicTest.cpp b/src/private/mxtest/core/DiatonicTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DiatonicTest.cpp rename to src/private/mxtest/core/DiatonicTest.cpp diff --git a/Sourcecode/private/mxtest/core/DirectionTest.cpp b/src/private/mxtest/core/DirectionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DirectionTest.cpp rename to src/private/mxtest/core/DirectionTest.cpp diff --git a/Sourcecode/private/mxtest/core/DirectionTest.h b/src/private/mxtest/core/DirectionTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/DirectionTest.h rename to src/private/mxtest/core/DirectionTest.h diff --git a/Sourcecode/private/mxtest/core/DirectionTypeTest.cpp b/src/private/mxtest/core/DirectionTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DirectionTypeTest.cpp rename to src/private/mxtest/core/DirectionTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/DirectionTypeTest.h b/src/private/mxtest/core/DirectionTypeTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/DirectionTypeTest.h rename to src/private/mxtest/core/DirectionTypeTest.h diff --git a/Sourcecode/private/mxtest/core/DirectiveTest.cpp b/src/private/mxtest/core/DirectiveTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DirectiveTest.cpp rename to src/private/mxtest/core/DirectiveTest.cpp diff --git a/Sourcecode/private/mxtest/core/DisplayOctaveTest.cpp b/src/private/mxtest/core/DisplayOctaveTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DisplayOctaveTest.cpp rename to src/private/mxtest/core/DisplayOctaveTest.cpp diff --git a/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.cpp b/src/private/mxtest/core/DisplayStepOctaveGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.cpp rename to src/private/mxtest/core/DisplayStepOctaveGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.h b/src/private/mxtest/core/DisplayStepOctaveGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/DisplayStepOctaveGroupTest.h rename to src/private/mxtest/core/DisplayStepOctaveGroupTest.h diff --git a/Sourcecode/private/mxtest/core/DisplayStepTest.cpp b/src/private/mxtest/core/DisplayStepTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DisplayStepTest.cpp rename to src/private/mxtest/core/DisplayStepTest.cpp diff --git a/Sourcecode/private/mxtest/core/DisplayTextTest.cpp b/src/private/mxtest/core/DisplayTextTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DisplayTextTest.cpp rename to src/private/mxtest/core/DisplayTextTest.cpp diff --git a/Sourcecode/private/mxtest/core/DistanceTest.cpp b/src/private/mxtest/core/DistanceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DistanceTest.cpp rename to src/private/mxtest/core/DistanceTest.cpp diff --git a/Sourcecode/private/mxtest/core/DivisionsTest.cpp b/src/private/mxtest/core/DivisionsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DivisionsTest.cpp rename to src/private/mxtest/core/DivisionsTest.cpp diff --git a/Sourcecode/private/mxtest/core/DocumentHeaderTest.cpp b/src/private/mxtest/core/DocumentHeaderTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentHeaderTest.cpp rename to src/private/mxtest/core/DocumentHeaderTest.cpp diff --git a/Sourcecode/private/mxtest/core/DocumentHeaderTest.h b/src/private/mxtest/core/DocumentHeaderTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentHeaderTest.h rename to src/private/mxtest/core/DocumentHeaderTest.h diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseConvertTest.cpp b/src/private/mxtest/core/DocumentPartwiseConvertTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentPartwiseConvertTest.cpp rename to src/private/mxtest/core/DocumentPartwiseConvertTest.cpp diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.cpp b/src/private/mxtest/core/DocumentPartwiseCreate.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentPartwiseCreate.cpp rename to src/private/mxtest/core/DocumentPartwiseCreate.cpp diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseCreate.h b/src/private/mxtest/core/DocumentPartwiseCreate.h similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentPartwiseCreate.h rename to src/private/mxtest/core/DocumentPartwiseCreate.h diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseTest.cpp b/src/private/mxtest/core/DocumentPartwiseTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentPartwiseTest.cpp rename to src/private/mxtest/core/DocumentPartwiseTest.cpp diff --git a/Sourcecode/private/mxtest/core/DocumentPartwiseTest.h b/src/private/mxtest/core/DocumentPartwiseTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentPartwiseTest.h rename to src/private/mxtest/core/DocumentPartwiseTest.h diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseConvertTest.cpp b/src/private/mxtest/core/DocumentTimewiseConvertTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentTimewiseConvertTest.cpp rename to src/private/mxtest/core/DocumentTimewiseConvertTest.cpp diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.cpp b/src/private/mxtest/core/DocumentTimewiseCreate.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentTimewiseCreate.cpp rename to src/private/mxtest/core/DocumentTimewiseCreate.cpp diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseCreate.h b/src/private/mxtest/core/DocumentTimewiseCreate.h similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentTimewiseCreate.h rename to src/private/mxtest/core/DocumentTimewiseCreate.h diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseTest.cpp b/src/private/mxtest/core/DocumentTimewiseTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentTimewiseTest.cpp rename to src/private/mxtest/core/DocumentTimewiseTest.cpp diff --git a/Sourcecode/private/mxtest/core/DocumentTimewiseTest.h b/src/private/mxtest/core/DocumentTimewiseTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/DocumentTimewiseTest.h rename to src/private/mxtest/core/DocumentTimewiseTest.h diff --git a/Sourcecode/private/mxtest/core/DoitTest.cpp b/src/private/mxtest/core/DoitTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DoitTest.cpp rename to src/private/mxtest/core/DoitTest.cpp diff --git a/Sourcecode/private/mxtest/core/DotTest.cpp b/src/private/mxtest/core/DotTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DotTest.cpp rename to src/private/mxtest/core/DotTest.cpp diff --git a/Sourcecode/private/mxtest/core/DoubleTest.cpp b/src/private/mxtest/core/DoubleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DoubleTest.cpp rename to src/private/mxtest/core/DoubleTest.cpp diff --git a/Sourcecode/private/mxtest/core/DoubleTongueTest.cpp b/src/private/mxtest/core/DoubleTongueTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DoubleTongueTest.cpp rename to src/private/mxtest/core/DoubleTongueTest.cpp diff --git a/Sourcecode/private/mxtest/core/DownBowTest.cpp b/src/private/mxtest/core/DownBowTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DownBowTest.cpp rename to src/private/mxtest/core/DownBowTest.cpp diff --git a/Sourcecode/private/mxtest/core/DurationTest.cpp b/src/private/mxtest/core/DurationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DurationTest.cpp rename to src/private/mxtest/core/DurationTest.cpp diff --git a/Sourcecode/private/mxtest/core/DynamicsTest.cpp b/src/private/mxtest/core/DynamicsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/DynamicsTest.cpp rename to src/private/mxtest/core/DynamicsTest.cpp diff --git a/Sourcecode/private/mxtest/core/EditorialGroupTest.cpp b/src/private/mxtest/core/EditorialGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EditorialGroupTest.cpp rename to src/private/mxtest/core/EditorialGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/EditorialGroupTest.h b/src/private/mxtest/core/EditorialGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/EditorialGroupTest.h rename to src/private/mxtest/core/EditorialGroupTest.h diff --git a/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.cpp b/src/private/mxtest/core/EditorialVoiceGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.cpp rename to src/private/mxtest/core/EditorialVoiceGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.h b/src/private/mxtest/core/EditorialVoiceGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/EditorialVoiceGroupTest.h rename to src/private/mxtest/core/EditorialVoiceGroupTest.h diff --git a/Sourcecode/private/mxtest/core/EffectTest.cpp b/src/private/mxtest/core/EffectTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EffectTest.cpp rename to src/private/mxtest/core/EffectTest.cpp diff --git a/Sourcecode/private/mxtest/core/ElevationTest.cpp b/src/private/mxtest/core/ElevationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ElevationTest.cpp rename to src/private/mxtest/core/ElevationTest.cpp diff --git a/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.cpp b/src/private/mxtest/core/ElisionSyllabicGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.cpp rename to src/private/mxtest/core/ElisionSyllabicGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.h b/src/private/mxtest/core/ElisionSyllabicGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ElisionSyllabicGroupTest.h rename to src/private/mxtest/core/ElisionSyllabicGroupTest.h diff --git a/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp b/src/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp rename to src/private/mxtest/core/ElisionSyllabicTextGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.h b/src/private/mxtest/core/ElisionSyllabicTextGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ElisionSyllabicTextGroupTest.h rename to src/private/mxtest/core/ElisionSyllabicTextGroupTest.h diff --git a/Sourcecode/private/mxtest/core/ElisionTest.cpp b/src/private/mxtest/core/ElisionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ElisionTest.cpp rename to src/private/mxtest/core/ElisionTest.cpp diff --git a/Sourcecode/private/mxtest/core/EncoderTest.cpp b/src/private/mxtest/core/EncoderTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EncoderTest.cpp rename to src/private/mxtest/core/EncoderTest.cpp diff --git a/Sourcecode/private/mxtest/core/EncodingDateTest.cpp b/src/private/mxtest/core/EncodingDateTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EncodingDateTest.cpp rename to src/private/mxtest/core/EncodingDateTest.cpp diff --git a/Sourcecode/private/mxtest/core/EncodingDescriptionTest.cpp b/src/private/mxtest/core/EncodingDescriptionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EncodingDescriptionTest.cpp rename to src/private/mxtest/core/EncodingDescriptionTest.cpp diff --git a/Sourcecode/private/mxtest/core/EncodingTest.cpp b/src/private/mxtest/core/EncodingTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EncodingTest.cpp rename to src/private/mxtest/core/EncodingTest.cpp diff --git a/Sourcecode/private/mxtest/core/EncodingTest.h b/src/private/mxtest/core/EncodingTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/EncodingTest.h rename to src/private/mxtest/core/EncodingTest.h diff --git a/Sourcecode/private/mxtest/core/EndLineTest.cpp b/src/private/mxtest/core/EndLineTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EndLineTest.cpp rename to src/private/mxtest/core/EndLineTest.cpp diff --git a/Sourcecode/private/mxtest/core/EndParagraphTest.cpp b/src/private/mxtest/core/EndParagraphTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EndParagraphTest.cpp rename to src/private/mxtest/core/EndParagraphTest.cpp diff --git a/Sourcecode/private/mxtest/core/EndingTest.cpp b/src/private/mxtest/core/EndingTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EndingTest.cpp rename to src/private/mxtest/core/EndingTest.cpp diff --git a/Sourcecode/private/mxtest/core/EnsembleTest.cpp b/src/private/mxtest/core/EnsembleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EnsembleTest.cpp rename to src/private/mxtest/core/EnsembleTest.cpp diff --git a/Sourcecode/private/mxtest/core/EnumsTest.cpp b/src/private/mxtest/core/EnumsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EnumsTest.cpp rename to src/private/mxtest/core/EnumsTest.cpp diff --git a/Sourcecode/private/mxtest/core/ExtendTest.cpp b/src/private/mxtest/core/ExtendTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ExtendTest.cpp rename to src/private/mxtest/core/ExtendTest.cpp diff --git a/Sourcecode/private/mxtest/core/EyeglassesTest.cpp b/src/private/mxtest/core/EyeglassesTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/EyeglassesTest.cpp rename to src/private/mxtest/core/EyeglassesTest.cpp diff --git a/Sourcecode/private/mxtest/core/FalloffTest.cpp b/src/private/mxtest/core/FalloffTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FalloffTest.cpp rename to src/private/mxtest/core/FalloffTest.cpp diff --git a/Sourcecode/private/mxtest/core/FeatureTest.cpp b/src/private/mxtest/core/FeatureTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FeatureTest.cpp rename to src/private/mxtest/core/FeatureTest.cpp diff --git a/Sourcecode/private/mxtest/core/FermataTest.cpp b/src/private/mxtest/core/FermataTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FermataTest.cpp rename to src/private/mxtest/core/FermataTest.cpp diff --git a/Sourcecode/private/mxtest/core/FifthsTest.cpp b/src/private/mxtest/core/FifthsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FifthsTest.cpp rename to src/private/mxtest/core/FifthsTest.cpp diff --git a/Sourcecode/private/mxtest/core/FigureNumberTest.cpp b/src/private/mxtest/core/FigureNumberTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FigureNumberTest.cpp rename to src/private/mxtest/core/FigureNumberTest.cpp diff --git a/Sourcecode/private/mxtest/core/FigureTest.cpp b/src/private/mxtest/core/FigureTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FigureTest.cpp rename to src/private/mxtest/core/FigureTest.cpp diff --git a/Sourcecode/private/mxtest/core/FigureTest.h b/src/private/mxtest/core/FigureTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/FigureTest.h rename to src/private/mxtest/core/FigureTest.h diff --git a/Sourcecode/private/mxtest/core/FiguredBassTest.cpp b/src/private/mxtest/core/FiguredBassTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FiguredBassTest.cpp rename to src/private/mxtest/core/FiguredBassTest.cpp diff --git a/Sourcecode/private/mxtest/core/FiguredBassTest.h b/src/private/mxtest/core/FiguredBassTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/FiguredBassTest.h rename to src/private/mxtest/core/FiguredBassTest.h diff --git a/Sourcecode/private/mxtest/core/FingeringTest.cpp b/src/private/mxtest/core/FingeringTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FingeringTest.cpp rename to src/private/mxtest/core/FingeringTest.cpp diff --git a/Sourcecode/private/mxtest/core/FingernailsTest.cpp b/src/private/mxtest/core/FingernailsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FingernailsTest.cpp rename to src/private/mxtest/core/FingernailsTest.cpp diff --git a/Sourcecode/private/mxtest/core/FirstFretTest.cpp b/src/private/mxtest/core/FirstFretTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FirstFretTest.cpp rename to src/private/mxtest/core/FirstFretTest.cpp diff --git a/Sourcecode/private/mxtest/core/FontSizeTest.cpp b/src/private/mxtest/core/FontSizeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FontSizeTest.cpp rename to src/private/mxtest/core/FontSizeTest.cpp diff --git a/Sourcecode/private/mxtest/core/FootnoteTest.cpp b/src/private/mxtest/core/FootnoteTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FootnoteTest.cpp rename to src/private/mxtest/core/FootnoteTest.cpp diff --git a/Sourcecode/private/mxtest/core/ForwardTest.cpp b/src/private/mxtest/core/ForwardTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ForwardTest.cpp rename to src/private/mxtest/core/ForwardTest.cpp diff --git a/Sourcecode/private/mxtest/core/ForwardTest.h b/src/private/mxtest/core/ForwardTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ForwardTest.h rename to src/private/mxtest/core/ForwardTest.h diff --git a/Sourcecode/private/mxtest/core/FrameFretsTest.cpp b/src/private/mxtest/core/FrameFretsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FrameFretsTest.cpp rename to src/private/mxtest/core/FrameFretsTest.cpp diff --git a/Sourcecode/private/mxtest/core/FrameNoteTest.cpp b/src/private/mxtest/core/FrameNoteTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FrameNoteTest.cpp rename to src/private/mxtest/core/FrameNoteTest.cpp diff --git a/Sourcecode/private/mxtest/core/FrameStringsTest.cpp b/src/private/mxtest/core/FrameStringsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FrameStringsTest.cpp rename to src/private/mxtest/core/FrameStringsTest.cpp diff --git a/Sourcecode/private/mxtest/core/FrameTest.cpp b/src/private/mxtest/core/FrameTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FrameTest.cpp rename to src/private/mxtest/core/FrameTest.cpp diff --git a/Sourcecode/private/mxtest/core/FretTest.cpp b/src/private/mxtest/core/FretTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FretTest.cpp rename to src/private/mxtest/core/FretTest.cpp diff --git a/Sourcecode/private/mxtest/core/FullNoteGroupTest.cpp b/src/private/mxtest/core/FullNoteGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FullNoteGroupTest.cpp rename to src/private/mxtest/core/FullNoteGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/FullNoteGroupTest.h b/src/private/mxtest/core/FullNoteGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/FullNoteGroupTest.h rename to src/private/mxtest/core/FullNoteGroupTest.h diff --git a/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.cpp b/src/private/mxtest/core/FullNoteTypeChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.cpp rename to src/private/mxtest/core/FullNoteTypeChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.h b/src/private/mxtest/core/FullNoteTypeChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/FullNoteTypeChoiceTest.h rename to src/private/mxtest/core/FullNoteTypeChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/FunctionTest.cpp b/src/private/mxtest/core/FunctionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/FunctionTest.cpp rename to src/private/mxtest/core/FunctionTest.cpp diff --git a/Sourcecode/private/mxtest/core/GlassTest.cpp b/src/private/mxtest/core/GlassTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GlassTest.cpp rename to src/private/mxtest/core/GlassTest.cpp diff --git a/Sourcecode/private/mxtest/core/GlissandoTest.cpp b/src/private/mxtest/core/GlissandoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GlissandoTest.cpp rename to src/private/mxtest/core/GlissandoTest.cpp diff --git a/Sourcecode/private/mxtest/core/GraceNoteGroupTest.cpp b/src/private/mxtest/core/GraceNoteGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GraceNoteGroupTest.cpp rename to src/private/mxtest/core/GraceNoteGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/GraceNoteGroupTest.h b/src/private/mxtest/core/GraceNoteGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/GraceNoteGroupTest.h rename to src/private/mxtest/core/GraceNoteGroupTest.h diff --git a/Sourcecode/private/mxtest/core/GraceTest.cpp b/src/private/mxtest/core/GraceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GraceTest.cpp rename to src/private/mxtest/core/GraceTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.cpp b/src/private/mxtest/core/GroupAbbreviationDisplayTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.cpp rename to src/private/mxtest/core/GroupAbbreviationDisplayTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.h b/src/private/mxtest/core/GroupAbbreviationDisplayTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/GroupAbbreviationDisplayTest.h rename to src/private/mxtest/core/GroupAbbreviationDisplayTest.h diff --git a/Sourcecode/private/mxtest/core/GroupAbbreviationTest.cpp b/src/private/mxtest/core/GroupAbbreviationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupAbbreviationTest.cpp rename to src/private/mxtest/core/GroupAbbreviationTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupBarlineTest.cpp b/src/private/mxtest/core/GroupBarlineTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupBarlineTest.cpp rename to src/private/mxtest/core/GroupBarlineTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupNameDisplayTest.cpp b/src/private/mxtest/core/GroupNameDisplayTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupNameDisplayTest.cpp rename to src/private/mxtest/core/GroupNameDisplayTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupNameDisplayTest.h b/src/private/mxtest/core/GroupNameDisplayTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/GroupNameDisplayTest.h rename to src/private/mxtest/core/GroupNameDisplayTest.h diff --git a/Sourcecode/private/mxtest/core/GroupNameTest.cpp b/src/private/mxtest/core/GroupNameTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupNameTest.cpp rename to src/private/mxtest/core/GroupNameTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupSymbolTest.cpp b/src/private/mxtest/core/GroupSymbolTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupSymbolTest.cpp rename to src/private/mxtest/core/GroupSymbolTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupTest.cpp b/src/private/mxtest/core/GroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupTest.cpp rename to src/private/mxtest/core/GroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupTimeTest.cpp b/src/private/mxtest/core/GroupTimeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupTimeTest.cpp rename to src/private/mxtest/core/GroupTimeTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupingTest.cpp b/src/private/mxtest/core/GroupingTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/GroupingTest.cpp rename to src/private/mxtest/core/GroupingTest.cpp diff --git a/Sourcecode/private/mxtest/core/GroupingTest.h b/src/private/mxtest/core/GroupingTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/GroupingTest.h rename to src/private/mxtest/core/GroupingTest.h diff --git a/Sourcecode/private/mxtest/core/HammerOnTest.cpp b/src/private/mxtest/core/HammerOnTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HammerOnTest.cpp rename to src/private/mxtest/core/HammerOnTest.cpp diff --git a/Sourcecode/private/mxtest/core/HandbellTest.cpp b/src/private/mxtest/core/HandbellTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HandbellTest.cpp rename to src/private/mxtest/core/HandbellTest.cpp diff --git a/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.cpp b/src/private/mxtest/core/HarmonicInfoChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.cpp rename to src/private/mxtest/core/HarmonicInfoChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.h b/src/private/mxtest/core/HarmonicInfoChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonicInfoChoiceTest.h rename to src/private/mxtest/core/HarmonicInfoChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/HarmonicTest.cpp b/src/private/mxtest/core/HarmonicTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonicTest.cpp rename to src/private/mxtest/core/HarmonicTest.cpp diff --git a/Sourcecode/private/mxtest/core/HarmonicTest.h b/src/private/mxtest/core/HarmonicTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonicTest.h rename to src/private/mxtest/core/HarmonicTest.h diff --git a/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.cpp b/src/private/mxtest/core/HarmonicTypeChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.cpp rename to src/private/mxtest/core/HarmonicTypeChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.h b/src/private/mxtest/core/HarmonicTypeChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonicTypeChoiceTest.h rename to src/private/mxtest/core/HarmonicTypeChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.cpp b/src/private/mxtest/core/HarmonyChordGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonyChordGroupTest.cpp rename to src/private/mxtest/core/HarmonyChordGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/HarmonyChordGroupTest.h b/src/private/mxtest/core/HarmonyChordGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonyChordGroupTest.h rename to src/private/mxtest/core/HarmonyChordGroupTest.h diff --git a/Sourcecode/private/mxtest/core/HarmonyTest.cpp b/src/private/mxtest/core/HarmonyTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonyTest.cpp rename to src/private/mxtest/core/HarmonyTest.cpp diff --git a/Sourcecode/private/mxtest/core/HarmonyTest.h b/src/private/mxtest/core/HarmonyTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/HarmonyTest.h rename to src/private/mxtest/core/HarmonyTest.h diff --git a/Sourcecode/private/mxtest/core/HarpPedalsTest.cpp b/src/private/mxtest/core/HarpPedalsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HarpPedalsTest.cpp rename to src/private/mxtest/core/HarpPedalsTest.cpp diff --git a/Sourcecode/private/mxtest/core/HeelTest.cpp b/src/private/mxtest/core/HeelTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HeelTest.cpp rename to src/private/mxtest/core/HeelTest.cpp diff --git a/Sourcecode/private/mxtest/core/HeelTest.h b/src/private/mxtest/core/HeelTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/HeelTest.h rename to src/private/mxtest/core/HeelTest.h diff --git a/Sourcecode/private/mxtest/core/HelloWorldExpected.h b/src/private/mxtest/core/HelloWorldExpected.h similarity index 100% rename from Sourcecode/private/mxtest/core/HelloWorldExpected.h rename to src/private/mxtest/core/HelloWorldExpected.h diff --git a/Sourcecode/private/mxtest/core/HelloWorldTest.cpp b/src/private/mxtest/core/HelloWorldTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HelloWorldTest.cpp rename to src/private/mxtest/core/HelloWorldTest.cpp diff --git a/Sourcecode/private/mxtest/core/HelloWorldTest.h b/src/private/mxtest/core/HelloWorldTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/HelloWorldTest.h rename to src/private/mxtest/core/HelloWorldTest.h diff --git a/Sourcecode/private/mxtest/core/HelperFunctions.h b/src/private/mxtest/core/HelperFunctions.h similarity index 100% rename from Sourcecode/private/mxtest/core/HelperFunctions.h rename to src/private/mxtest/core/HelperFunctions.h diff --git a/Sourcecode/private/mxtest/core/HoleClosedTest.cpp b/src/private/mxtest/core/HoleClosedTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HoleClosedTest.cpp rename to src/private/mxtest/core/HoleClosedTest.cpp diff --git a/Sourcecode/private/mxtest/core/HoleShapeTest.cpp b/src/private/mxtest/core/HoleShapeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HoleShapeTest.cpp rename to src/private/mxtest/core/HoleShapeTest.cpp diff --git a/Sourcecode/private/mxtest/core/HoleTest.cpp b/src/private/mxtest/core/HoleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HoleTest.cpp rename to src/private/mxtest/core/HoleTest.cpp diff --git a/Sourcecode/private/mxtest/core/HoleTest.h b/src/private/mxtest/core/HoleTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/HoleTest.h rename to src/private/mxtest/core/HoleTest.h diff --git a/Sourcecode/private/mxtest/core/HoleTypeTest.cpp b/src/private/mxtest/core/HoleTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HoleTypeTest.cpp rename to src/private/mxtest/core/HoleTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/HummingTest.cpp b/src/private/mxtest/core/HummingTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/HummingTest.cpp rename to src/private/mxtest/core/HummingTest.cpp diff --git a/Sourcecode/private/mxtest/core/IdentificationTest.cpp b/src/private/mxtest/core/IdentificationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/IdentificationTest.cpp rename to src/private/mxtest/core/IdentificationTest.cpp diff --git a/Sourcecode/private/mxtest/core/IdentificationTest.h b/src/private/mxtest/core/IdentificationTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/IdentificationTest.h rename to src/private/mxtest/core/IdentificationTest.h diff --git a/Sourcecode/private/mxtest/core/ImageTest.cpp b/src/private/mxtest/core/ImageTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ImageTest.cpp rename to src/private/mxtest/core/ImageTest.cpp diff --git a/Sourcecode/private/mxtest/core/InstrumentAbbreviationTest.cpp b/src/private/mxtest/core/InstrumentAbbreviationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InstrumentAbbreviationTest.cpp rename to src/private/mxtest/core/InstrumentAbbreviationTest.cpp diff --git a/Sourcecode/private/mxtest/core/InstrumentNameTest.cpp b/src/private/mxtest/core/InstrumentNameTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InstrumentNameTest.cpp rename to src/private/mxtest/core/InstrumentNameTest.cpp diff --git a/Sourcecode/private/mxtest/core/InstrumentSoundTest.cpp b/src/private/mxtest/core/InstrumentSoundTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InstrumentSoundTest.cpp rename to src/private/mxtest/core/InstrumentSoundTest.cpp diff --git a/Sourcecode/private/mxtest/core/InstrumentTest.cpp b/src/private/mxtest/core/InstrumentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InstrumentTest.cpp rename to src/private/mxtest/core/InstrumentTest.cpp diff --git a/Sourcecode/private/mxtest/core/InstrumentsTest.cpp b/src/private/mxtest/core/InstrumentsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InstrumentsTest.cpp rename to src/private/mxtest/core/InstrumentsTest.cpp diff --git a/Sourcecode/private/mxtest/core/IntegersTest.cpp b/src/private/mxtest/core/IntegersTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/IntegersTest.cpp rename to src/private/mxtest/core/IntegersTest.cpp diff --git a/Sourcecode/private/mxtest/core/InterchangeableTest.cpp b/src/private/mxtest/core/InterchangeableTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InterchangeableTest.cpp rename to src/private/mxtest/core/InterchangeableTest.cpp diff --git a/Sourcecode/private/mxtest/core/InversionTest.cpp b/src/private/mxtest/core/InversionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InversionTest.cpp rename to src/private/mxtest/core/InversionTest.cpp diff --git a/Sourcecode/private/mxtest/core/InvertedMordentTest.cpp b/src/private/mxtest/core/InvertedMordentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InvertedMordentTest.cpp rename to src/private/mxtest/core/InvertedMordentTest.cpp diff --git a/Sourcecode/private/mxtest/core/InvertedMordentTest.h b/src/private/mxtest/core/InvertedMordentTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/InvertedMordentTest.h rename to src/private/mxtest/core/InvertedMordentTest.h diff --git a/Sourcecode/private/mxtest/core/InvertedTurnTest.cpp b/src/private/mxtest/core/InvertedTurnTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/InvertedTurnTest.cpp rename to src/private/mxtest/core/InvertedTurnTest.cpp diff --git a/Sourcecode/private/mxtest/core/IpaTest.cpp b/src/private/mxtest/core/IpaTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/IpaTest.cpp rename to src/private/mxtest/core/IpaTest.cpp diff --git a/Sourcecode/private/mxtest/core/KeyAccidentalTest.cpp b/src/private/mxtest/core/KeyAccidentalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/KeyAccidentalTest.cpp rename to src/private/mxtest/core/KeyAccidentalTest.cpp diff --git a/Sourcecode/private/mxtest/core/KeyAlterTest.cpp b/src/private/mxtest/core/KeyAlterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/KeyAlterTest.cpp rename to src/private/mxtest/core/KeyAlterTest.cpp diff --git a/Sourcecode/private/mxtest/core/KeyOctaveTest.cpp b/src/private/mxtest/core/KeyOctaveTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/KeyOctaveTest.cpp rename to src/private/mxtest/core/KeyOctaveTest.cpp diff --git a/Sourcecode/private/mxtest/core/KeyStepTest.cpp b/src/private/mxtest/core/KeyStepTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/KeyStepTest.cpp rename to src/private/mxtest/core/KeyStepTest.cpp diff --git a/Sourcecode/private/mxtest/core/KeyTest.cpp b/src/private/mxtest/core/KeyTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/KeyTest.cpp rename to src/private/mxtest/core/KeyTest.cpp diff --git a/Sourcecode/private/mxtest/core/KindTest.cpp b/src/private/mxtest/core/KindTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/KindTest.cpp rename to src/private/mxtest/core/KindTest.cpp diff --git a/Sourcecode/private/mxtest/core/LaughingTest.cpp b/src/private/mxtest/core/LaughingTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LaughingTest.cpp rename to src/private/mxtest/core/LaughingTest.cpp diff --git a/Sourcecode/private/mxtest/core/LayoutGroupTest.cpp b/src/private/mxtest/core/LayoutGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LayoutGroupTest.cpp rename to src/private/mxtest/core/LayoutGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/LayoutGroupTest.h b/src/private/mxtest/core/LayoutGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/LayoutGroupTest.h rename to src/private/mxtest/core/LayoutGroupTest.h diff --git a/Sourcecode/private/mxtest/core/LeftDividerTest.cpp b/src/private/mxtest/core/LeftDividerTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LeftDividerTest.cpp rename to src/private/mxtest/core/LeftDividerTest.cpp diff --git a/Sourcecode/private/mxtest/core/LeftMarginTest.cpp b/src/private/mxtest/core/LeftMarginTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LeftMarginTest.cpp rename to src/private/mxtest/core/LeftMarginTest.cpp diff --git a/Sourcecode/private/mxtest/core/LevelTest.cpp b/src/private/mxtest/core/LevelTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LevelTest.cpp rename to src/private/mxtest/core/LevelTest.cpp diff --git a/Sourcecode/private/mxtest/core/LineTest.cpp b/src/private/mxtest/core/LineTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LineTest.cpp rename to src/private/mxtest/core/LineTest.cpp diff --git a/Sourcecode/private/mxtest/core/LineWidthTest.cpp b/src/private/mxtest/core/LineWidthTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LineWidthTest.cpp rename to src/private/mxtest/core/LineWidthTest.cpp diff --git a/Sourcecode/private/mxtest/core/LinkTest.cpp b/src/private/mxtest/core/LinkTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LinkTest.cpp rename to src/private/mxtest/core/LinkTest.cpp diff --git a/Sourcecode/private/mxtest/core/LyricFontTest.cpp b/src/private/mxtest/core/LyricFontTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LyricFontTest.cpp rename to src/private/mxtest/core/LyricFontTest.cpp diff --git a/Sourcecode/private/mxtest/core/LyricLanguageTest.cpp b/src/private/mxtest/core/LyricLanguageTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LyricLanguageTest.cpp rename to src/private/mxtest/core/LyricLanguageTest.cpp diff --git a/Sourcecode/private/mxtest/core/LyricTest.cpp b/src/private/mxtest/core/LyricTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LyricTest.cpp rename to src/private/mxtest/core/LyricTest.cpp diff --git a/Sourcecode/private/mxtest/core/LyricTest.h b/src/private/mxtest/core/LyricTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/LyricTest.h rename to src/private/mxtest/core/LyricTest.h diff --git a/Sourcecode/private/mxtest/core/LyricTextChoiceTest.h b/src/private/mxtest/core/LyricTextChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/LyricTextChoiceTest.h rename to src/private/mxtest/core/LyricTextChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/LyricTextCoiceTest.cpp b/src/private/mxtest/core/LyricTextCoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/LyricTextCoiceTest.cpp rename to src/private/mxtest/core/LyricTextCoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/MakeFunctionsTest.cpp b/src/private/mxtest/core/MakeFunctionsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MakeFunctionsTest.cpp rename to src/private/mxtest/core/MakeFunctionsTest.cpp diff --git a/Sourcecode/private/mxtest/core/MeasureDistanceTest.cpp b/src/private/mxtest/core/MeasureDistanceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MeasureDistanceTest.cpp rename to src/private/mxtest/core/MeasureDistanceTest.cpp diff --git a/Sourcecode/private/mxtest/core/MeasureLayoutTest.cpp b/src/private/mxtest/core/MeasureLayoutTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MeasureLayoutTest.cpp rename to src/private/mxtest/core/MeasureLayoutTest.cpp diff --git a/Sourcecode/private/mxtest/core/MeasureLayoutTest.h b/src/private/mxtest/core/MeasureLayoutTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/MeasureLayoutTest.h rename to src/private/mxtest/core/MeasureLayoutTest.h diff --git a/Sourcecode/private/mxtest/core/MeasureNumberingTest.cpp b/src/private/mxtest/core/MeasureNumberingTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MeasureNumberingTest.cpp rename to src/private/mxtest/core/MeasureNumberingTest.cpp diff --git a/Sourcecode/private/mxtest/core/MeasureRepeatTest.cpp b/src/private/mxtest/core/MeasureRepeatTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MeasureRepeatTest.cpp rename to src/private/mxtest/core/MeasureRepeatTest.cpp diff --git a/Sourcecode/private/mxtest/core/MeasureStyleTest.cpp b/src/private/mxtest/core/MeasureStyleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MeasureStyleTest.cpp rename to src/private/mxtest/core/MeasureStyleTest.cpp diff --git a/Sourcecode/private/mxtest/core/MembraneTest.cpp b/src/private/mxtest/core/MembraneTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MembraneTest.cpp rename to src/private/mxtest/core/MembraneTest.cpp diff --git a/Sourcecode/private/mxtest/core/MetalTest.cpp b/src/private/mxtest/core/MetalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MetalTest.cpp rename to src/private/mxtest/core/MetalTest.cpp diff --git a/Sourcecode/private/mxtest/core/MetronomeBeamTest.cpp b/src/private/mxtest/core/MetronomeBeamTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MetronomeBeamTest.cpp rename to src/private/mxtest/core/MetronomeBeamTest.cpp diff --git a/Sourcecode/private/mxtest/core/MetronomeDotTest.cpp b/src/private/mxtest/core/MetronomeDotTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MetronomeDotTest.cpp rename to src/private/mxtest/core/MetronomeDotTest.cpp diff --git a/Sourcecode/private/mxtest/core/MetronomeNoteTest.cpp b/src/private/mxtest/core/MetronomeNoteTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MetronomeNoteTest.cpp rename to src/private/mxtest/core/MetronomeNoteTest.cpp diff --git a/Sourcecode/private/mxtest/core/MetronomeRelationTest.cpp b/src/private/mxtest/core/MetronomeRelationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MetronomeRelationTest.cpp rename to src/private/mxtest/core/MetronomeRelationTest.cpp diff --git a/Sourcecode/private/mxtest/core/MetronomeTest.cpp b/src/private/mxtest/core/MetronomeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MetronomeTest.cpp rename to src/private/mxtest/core/MetronomeTest.cpp diff --git a/Sourcecode/private/mxtest/core/MetronomeTest.h b/src/private/mxtest/core/MetronomeTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/MetronomeTest.h rename to src/private/mxtest/core/MetronomeTest.h diff --git a/Sourcecode/private/mxtest/core/MetronomeTupletTest.cpp b/src/private/mxtest/core/MetronomeTupletTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MetronomeTupletTest.cpp rename to src/private/mxtest/core/MetronomeTupletTest.cpp diff --git a/Sourcecode/private/mxtest/core/MetronomeTypeTest.cpp b/src/private/mxtest/core/MetronomeTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MetronomeTypeTest.cpp rename to src/private/mxtest/core/MetronomeTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/MidiBankTest.cpp b/src/private/mxtest/core/MidiBankTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MidiBankTest.cpp rename to src/private/mxtest/core/MidiBankTest.cpp diff --git a/Sourcecode/private/mxtest/core/MidiChannelTest.cpp b/src/private/mxtest/core/MidiChannelTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MidiChannelTest.cpp rename to src/private/mxtest/core/MidiChannelTest.cpp diff --git a/Sourcecode/private/mxtest/core/MidiDeviceTest.cpp b/src/private/mxtest/core/MidiDeviceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MidiDeviceTest.cpp rename to src/private/mxtest/core/MidiDeviceTest.cpp diff --git a/Sourcecode/private/mxtest/core/MidiInstrumentTest.cpp b/src/private/mxtest/core/MidiInstrumentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MidiInstrumentTest.cpp rename to src/private/mxtest/core/MidiInstrumentTest.cpp diff --git a/Sourcecode/private/mxtest/core/MidiInstrumentTest.h b/src/private/mxtest/core/MidiInstrumentTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/MidiInstrumentTest.h rename to src/private/mxtest/core/MidiInstrumentTest.h diff --git a/Sourcecode/private/mxtest/core/MidiNameTest.cpp b/src/private/mxtest/core/MidiNameTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MidiNameTest.cpp rename to src/private/mxtest/core/MidiNameTest.cpp diff --git a/Sourcecode/private/mxtest/core/MidiProgramTest.cpp b/src/private/mxtest/core/MidiProgramTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MidiProgramTest.cpp rename to src/private/mxtest/core/MidiProgramTest.cpp diff --git a/Sourcecode/private/mxtest/core/MidiUnpitchedTest.cpp b/src/private/mxtest/core/MidiUnpitchedTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MidiUnpitchedTest.cpp rename to src/private/mxtest/core/MidiUnpitchedTest.cpp diff --git a/Sourcecode/private/mxtest/core/MillimetersTest.cpp b/src/private/mxtest/core/MillimetersTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MillimetersTest.cpp rename to src/private/mxtest/core/MillimetersTest.cpp diff --git a/Sourcecode/private/mxtest/core/MiscellaneousFieldTest.cpp b/src/private/mxtest/core/MiscellaneousFieldTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MiscellaneousFieldTest.cpp rename to src/private/mxtest/core/MiscellaneousFieldTest.cpp diff --git a/Sourcecode/private/mxtest/core/MiscellaneousTest.cpp b/src/private/mxtest/core/MiscellaneousTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MiscellaneousTest.cpp rename to src/private/mxtest/core/MiscellaneousTest.cpp diff --git a/Sourcecode/private/mxtest/core/MiscellaneousTest.h b/src/private/mxtest/core/MiscellaneousTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/MiscellaneousTest.h rename to src/private/mxtest/core/MiscellaneousTest.h diff --git a/Sourcecode/private/mxtest/core/ModeTest.cpp b/src/private/mxtest/core/ModeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ModeTest.cpp rename to src/private/mxtest/core/ModeTest.cpp diff --git a/Sourcecode/private/mxtest/core/MordentTest.cpp b/src/private/mxtest/core/MordentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MordentTest.cpp rename to src/private/mxtest/core/MordentTest.cpp diff --git a/Sourcecode/private/mxtest/core/MordentTest.h b/src/private/mxtest/core/MordentTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/MordentTest.h rename to src/private/mxtest/core/MordentTest.h diff --git a/Sourcecode/private/mxtest/core/MovementNumberTest.cpp b/src/private/mxtest/core/MovementNumberTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MovementNumberTest.cpp rename to src/private/mxtest/core/MovementNumberTest.cpp diff --git a/Sourcecode/private/mxtest/core/MovementTitleTest.cpp b/src/private/mxtest/core/MovementTitleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MovementTitleTest.cpp rename to src/private/mxtest/core/MovementTitleTest.cpp diff --git a/Sourcecode/private/mxtest/core/MultipleRestTest.cpp b/src/private/mxtest/core/MultipleRestTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MultipleRestTest.cpp rename to src/private/mxtest/core/MultipleRestTest.cpp diff --git a/Sourcecode/private/mxtest/core/MusicDataChoiceTest.cpp b/src/private/mxtest/core/MusicDataChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MusicDataChoiceTest.cpp rename to src/private/mxtest/core/MusicDataChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/MusicDataChoiceTest.h b/src/private/mxtest/core/MusicDataChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/MusicDataChoiceTest.h rename to src/private/mxtest/core/MusicDataChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/MusicDataGroupTest.cpp b/src/private/mxtest/core/MusicDataGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MusicDataGroupTest.cpp rename to src/private/mxtest/core/MusicDataGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/MusicDataGroupTest.h b/src/private/mxtest/core/MusicDataGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/MusicDataGroupTest.h rename to src/private/mxtest/core/MusicDataGroupTest.h diff --git a/Sourcecode/private/mxtest/core/MusicFontTest.cpp b/src/private/mxtest/core/MusicFontTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MusicFontTest.cpp rename to src/private/mxtest/core/MusicFontTest.cpp diff --git a/Sourcecode/private/mxtest/core/MuteTest.cpp b/src/private/mxtest/core/MuteTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/MuteTest.cpp rename to src/private/mxtest/core/MuteTest.cpp diff --git a/Sourcecode/private/mxtest/core/NaturalTest.cpp b/src/private/mxtest/core/NaturalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NaturalTest.cpp rename to src/private/mxtest/core/NaturalTest.cpp diff --git a/Sourcecode/private/mxtest/core/NonArpeggiateTest.cpp b/src/private/mxtest/core/NonArpeggiateTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NonArpeggiateTest.cpp rename to src/private/mxtest/core/NonArpeggiateTest.cpp diff --git a/Sourcecode/private/mxtest/core/NormalDotTest.cpp b/src/private/mxtest/core/NormalDotTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NormalDotTest.cpp rename to src/private/mxtest/core/NormalDotTest.cpp diff --git a/Sourcecode/private/mxtest/core/NormalNoteGroupTest.cpp b/src/private/mxtest/core/NormalNoteGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NormalNoteGroupTest.cpp rename to src/private/mxtest/core/NormalNoteGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/NormalNoteGroupTest.h b/src/private/mxtest/core/NormalNoteGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/NormalNoteGroupTest.h rename to src/private/mxtest/core/NormalNoteGroupTest.h diff --git a/Sourcecode/private/mxtest/core/NormalNotesTest.cpp b/src/private/mxtest/core/NormalNotesTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NormalNotesTest.cpp rename to src/private/mxtest/core/NormalNotesTest.cpp diff --git a/Sourcecode/private/mxtest/core/NormalTypeTest.cpp b/src/private/mxtest/core/NormalTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NormalTypeTest.cpp rename to src/private/mxtest/core/NormalTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/NotationsChoiceTest.cpp b/src/private/mxtest/core/NotationsChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NotationsChoiceTest.cpp rename to src/private/mxtest/core/NotationsChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/NotationsChoiceTest.h b/src/private/mxtest/core/NotationsChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/NotationsChoiceTest.h rename to src/private/mxtest/core/NotationsChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/NotationsTest.cpp b/src/private/mxtest/core/NotationsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NotationsTest.cpp rename to src/private/mxtest/core/NotationsTest.cpp diff --git a/Sourcecode/private/mxtest/core/NotationsTest.h b/src/private/mxtest/core/NotationsTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/NotationsTest.h rename to src/private/mxtest/core/NotationsTest.h diff --git a/Sourcecode/private/mxtest/core/NoteChoiceTest.cpp b/src/private/mxtest/core/NoteChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NoteChoiceTest.cpp rename to src/private/mxtest/core/NoteChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/NoteChoiceTest.h b/src/private/mxtest/core/NoteChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/NoteChoiceTest.h rename to src/private/mxtest/core/NoteChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/NoteSizeTest.cpp b/src/private/mxtest/core/NoteSizeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NoteSizeTest.cpp rename to src/private/mxtest/core/NoteSizeTest.cpp diff --git a/Sourcecode/private/mxtest/core/NoteTest.cpp b/src/private/mxtest/core/NoteTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NoteTest.cpp rename to src/private/mxtest/core/NoteTest.cpp diff --git a/Sourcecode/private/mxtest/core/NoteTest.h b/src/private/mxtest/core/NoteTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/NoteTest.h rename to src/private/mxtest/core/NoteTest.h diff --git a/Sourcecode/private/mxtest/core/NoteheadTest.cpp b/src/private/mxtest/core/NoteheadTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NoteheadTest.cpp rename to src/private/mxtest/core/NoteheadTest.cpp diff --git a/Sourcecode/private/mxtest/core/NoteheadTextTest.cpp b/src/private/mxtest/core/NoteheadTextTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NoteheadTextTest.cpp rename to src/private/mxtest/core/NoteheadTextTest.cpp diff --git a/Sourcecode/private/mxtest/core/NoteheadTextTest.h b/src/private/mxtest/core/NoteheadTextTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/NoteheadTextTest.h rename to src/private/mxtest/core/NoteheadTextTest.h diff --git a/Sourcecode/private/mxtest/core/NumberOrNormal.cpp b/src/private/mxtest/core/NumberOrNormal.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/NumberOrNormal.cpp rename to src/private/mxtest/core/NumberOrNormal.cpp diff --git a/Sourcecode/private/mxtest/core/OctaveChangeTest.cpp b/src/private/mxtest/core/OctaveChangeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OctaveChangeTest.cpp rename to src/private/mxtest/core/OctaveChangeTest.cpp diff --git a/Sourcecode/private/mxtest/core/OctaveShiftTest.cpp b/src/private/mxtest/core/OctaveShiftTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OctaveShiftTest.cpp rename to src/private/mxtest/core/OctaveShiftTest.cpp diff --git a/Sourcecode/private/mxtest/core/OctaveTest.cpp b/src/private/mxtest/core/OctaveTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OctaveTest.cpp rename to src/private/mxtest/core/OctaveTest.cpp diff --git a/Sourcecode/private/mxtest/core/OffsetTest.cpp b/src/private/mxtest/core/OffsetTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OffsetTest.cpp rename to src/private/mxtest/core/OffsetTest.cpp diff --git a/Sourcecode/private/mxtest/core/OpenStringTest.cpp b/src/private/mxtest/core/OpenStringTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OpenStringTest.cpp rename to src/private/mxtest/core/OpenStringTest.cpp diff --git a/Sourcecode/private/mxtest/core/OpusTest.cpp b/src/private/mxtest/core/OpusTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OpusTest.cpp rename to src/private/mxtest/core/OpusTest.cpp diff --git a/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.cpp b/src/private/mxtest/core/OrnamentsChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OrnamentsChoiceTest.cpp rename to src/private/mxtest/core/OrnamentsChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/OrnamentsChoiceTest.h b/src/private/mxtest/core/OrnamentsChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/OrnamentsChoiceTest.h rename to src/private/mxtest/core/OrnamentsChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/OrnamentsTest.cpp b/src/private/mxtest/core/OrnamentsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OrnamentsTest.cpp rename to src/private/mxtest/core/OrnamentsTest.cpp diff --git a/Sourcecode/private/mxtest/core/OrnamentsTest.h b/src/private/mxtest/core/OrnamentsTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/OrnamentsTest.h rename to src/private/mxtest/core/OrnamentsTest.h diff --git a/Sourcecode/private/mxtest/core/OtherAppearanceTest.cpp b/src/private/mxtest/core/OtherAppearanceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OtherAppearanceTest.cpp rename to src/private/mxtest/core/OtherAppearanceTest.cpp diff --git a/Sourcecode/private/mxtest/core/OtherArticulationTest.cpp b/src/private/mxtest/core/OtherArticulationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OtherArticulationTest.cpp rename to src/private/mxtest/core/OtherArticulationTest.cpp diff --git a/Sourcecode/private/mxtest/core/OtherDirectionTest.cpp b/src/private/mxtest/core/OtherDirectionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OtherDirectionTest.cpp rename to src/private/mxtest/core/OtherDirectionTest.cpp diff --git a/Sourcecode/private/mxtest/core/OtherNotationTest.cpp b/src/private/mxtest/core/OtherNotationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OtherNotationTest.cpp rename to src/private/mxtest/core/OtherNotationTest.cpp diff --git a/Sourcecode/private/mxtest/core/OtherOrnamentTest.cpp b/src/private/mxtest/core/OtherOrnamentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OtherOrnamentTest.cpp rename to src/private/mxtest/core/OtherOrnamentTest.cpp diff --git a/Sourcecode/private/mxtest/core/OtherPercussionTest.cpp b/src/private/mxtest/core/OtherPercussionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OtherPercussionTest.cpp rename to src/private/mxtest/core/OtherPercussionTest.cpp diff --git a/Sourcecode/private/mxtest/core/OtherPlayTest.cpp b/src/private/mxtest/core/OtherPlayTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OtherPlayTest.cpp rename to src/private/mxtest/core/OtherPlayTest.cpp diff --git a/Sourcecode/private/mxtest/core/OtherTechnicalTest.cpp b/src/private/mxtest/core/OtherTechnicalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/OtherTechnicalTest.cpp rename to src/private/mxtest/core/OtherTechnicalTest.cpp diff --git a/Sourcecode/private/mxtest/core/PageHeightTest.cpp b/src/private/mxtest/core/PageHeightTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PageHeightTest.cpp rename to src/private/mxtest/core/PageHeightTest.cpp diff --git a/Sourcecode/private/mxtest/core/PageLayoutTest.cpp b/src/private/mxtest/core/PageLayoutTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PageLayoutTest.cpp rename to src/private/mxtest/core/PageLayoutTest.cpp diff --git a/Sourcecode/private/mxtest/core/PageLayoutTest.h b/src/private/mxtest/core/PageLayoutTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PageLayoutTest.h rename to src/private/mxtest/core/PageLayoutTest.h diff --git a/Sourcecode/private/mxtest/core/PageMarginsTest.cpp b/src/private/mxtest/core/PageMarginsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PageMarginsTest.cpp rename to src/private/mxtest/core/PageMarginsTest.cpp diff --git a/Sourcecode/private/mxtest/core/PageMarginsTest.h b/src/private/mxtest/core/PageMarginsTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PageMarginsTest.h rename to src/private/mxtest/core/PageMarginsTest.h diff --git a/Sourcecode/private/mxtest/core/PageWidthTest.cpp b/src/private/mxtest/core/PageWidthTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PageWidthTest.cpp rename to src/private/mxtest/core/PageWidthTest.cpp diff --git a/Sourcecode/private/mxtest/core/PanTest.cpp b/src/private/mxtest/core/PanTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PanTest.cpp rename to src/private/mxtest/core/PanTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.cpp b/src/private/mxtest/core/PartAbbreviationDisplayTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.cpp rename to src/private/mxtest/core/PartAbbreviationDisplayTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.h b/src/private/mxtest/core/PartAbbreviationDisplayTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PartAbbreviationDisplayTest.h rename to src/private/mxtest/core/PartAbbreviationDisplayTest.h diff --git a/Sourcecode/private/mxtest/core/PartAbbreviationTest.cpp b/src/private/mxtest/core/PartAbbreviationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartAbbreviationTest.cpp rename to src/private/mxtest/core/PartAbbreviationTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.cpp b/src/private/mxtest/core/PartGroupOrScorePartTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.cpp rename to src/private/mxtest/core/PartGroupOrScorePartTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.h b/src/private/mxtest/core/PartGroupOrScorePartTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PartGroupOrScorePartTest.h rename to src/private/mxtest/core/PartGroupOrScorePartTest.h diff --git a/Sourcecode/private/mxtest/core/PartGroupTest.cpp b/src/private/mxtest/core/PartGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartGroupTest.cpp rename to src/private/mxtest/core/PartGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartGroupTest.h b/src/private/mxtest/core/PartGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PartGroupTest.h rename to src/private/mxtest/core/PartGroupTest.h diff --git a/Sourcecode/private/mxtest/core/PartListTest.cpp b/src/private/mxtest/core/PartListTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartListTest.cpp rename to src/private/mxtest/core/PartListTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartListTest.h b/src/private/mxtest/core/PartListTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PartListTest.h rename to src/private/mxtest/core/PartListTest.h diff --git a/Sourcecode/private/mxtest/core/PartNameDisplayTest.cpp b/src/private/mxtest/core/PartNameDisplayTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartNameDisplayTest.cpp rename to src/private/mxtest/core/PartNameDisplayTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartNameDisplayTest.h b/src/private/mxtest/core/PartNameDisplayTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PartNameDisplayTest.h rename to src/private/mxtest/core/PartNameDisplayTest.h diff --git a/Sourcecode/private/mxtest/core/PartNameTest.cpp b/src/private/mxtest/core/PartNameTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartNameTest.cpp rename to src/private/mxtest/core/PartNameTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartSymbolTest.cpp b/src/private/mxtest/core/PartSymbolTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartSymbolTest.cpp rename to src/private/mxtest/core/PartSymbolTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartwiseMeasureTest.cpp b/src/private/mxtest/core/PartwiseMeasureTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartwiseMeasureTest.cpp rename to src/private/mxtest/core/PartwiseMeasureTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartwiseMeasureTest.h b/src/private/mxtest/core/PartwiseMeasureTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PartwiseMeasureTest.h rename to src/private/mxtest/core/PartwiseMeasureTest.h diff --git a/Sourcecode/private/mxtest/core/PartwisePartTest.cpp b/src/private/mxtest/core/PartwisePartTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PartwisePartTest.cpp rename to src/private/mxtest/core/PartwisePartTest.cpp diff --git a/Sourcecode/private/mxtest/core/PartwisePartTest.h b/src/private/mxtest/core/PartwisePartTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PartwisePartTest.h rename to src/private/mxtest/core/PartwisePartTest.h diff --git a/Sourcecode/private/mxtest/core/PedalAlterTest.cpp b/src/private/mxtest/core/PedalAlterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PedalAlterTest.cpp rename to src/private/mxtest/core/PedalAlterTest.cpp diff --git a/Sourcecode/private/mxtest/core/PedalStepTest.cpp b/src/private/mxtest/core/PedalStepTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PedalStepTest.cpp rename to src/private/mxtest/core/PedalStepTest.cpp diff --git a/Sourcecode/private/mxtest/core/PedalTest.cpp b/src/private/mxtest/core/PedalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PedalTest.cpp rename to src/private/mxtest/core/PedalTest.cpp diff --git a/Sourcecode/private/mxtest/core/PedalTuningTest.cpp b/src/private/mxtest/core/PedalTuningTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PedalTuningTest.cpp rename to src/private/mxtest/core/PedalTuningTest.cpp diff --git a/Sourcecode/private/mxtest/core/PerMinuteTest.cpp b/src/private/mxtest/core/PerMinuteTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PerMinuteTest.cpp rename to src/private/mxtest/core/PerMinuteTest.cpp diff --git a/Sourcecode/private/mxtest/core/PercussionTest.cpp b/src/private/mxtest/core/PercussionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PercussionTest.cpp rename to src/private/mxtest/core/PercussionTest.cpp diff --git a/Sourcecode/private/mxtest/core/PercussionTest.h b/src/private/mxtest/core/PercussionTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PercussionTest.h rename to src/private/mxtest/core/PercussionTest.h diff --git a/Sourcecode/private/mxtest/core/PitchTest.cpp b/src/private/mxtest/core/PitchTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PitchTest.cpp rename to src/private/mxtest/core/PitchTest.cpp diff --git a/Sourcecode/private/mxtest/core/PitchTest.h b/src/private/mxtest/core/PitchTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PitchTest.h rename to src/private/mxtest/core/PitchTest.h diff --git a/Sourcecode/private/mxtest/core/PitchedTest.cpp b/src/private/mxtest/core/PitchedTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PitchedTest.cpp rename to src/private/mxtest/core/PitchedTest.cpp diff --git a/Sourcecode/private/mxtest/core/PlayTest.cpp b/src/private/mxtest/core/PlayTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PlayTest.cpp rename to src/private/mxtest/core/PlayTest.cpp diff --git a/Sourcecode/private/mxtest/core/PlayTest.h b/src/private/mxtest/core/PlayTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PlayTest.h rename to src/private/mxtest/core/PlayTest.h diff --git a/Sourcecode/private/mxtest/core/PlopTest.cpp b/src/private/mxtest/core/PlopTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PlopTest.cpp rename to src/private/mxtest/core/PlopTest.cpp diff --git a/Sourcecode/private/mxtest/core/PluckTest.cpp b/src/private/mxtest/core/PluckTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PluckTest.cpp rename to src/private/mxtest/core/PluckTest.cpp diff --git a/Sourcecode/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp b/src/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp rename to src/private/mxtest/core/PositiveIntegerOrEmptyTest.cpp diff --git a/Sourcecode/private/mxtest/core/PreBendTest.cpp b/src/private/mxtest/core/PreBendTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PreBendTest.cpp rename to src/private/mxtest/core/PreBendTest.cpp diff --git a/Sourcecode/private/mxtest/core/PreciseDecimalTest.cpp b/src/private/mxtest/core/PreciseDecimalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PreciseDecimalTest.cpp rename to src/private/mxtest/core/PreciseDecimalTest.cpp diff --git a/Sourcecode/private/mxtest/core/PrefixTest.cpp b/src/private/mxtest/core/PrefixTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PrefixTest.cpp rename to src/private/mxtest/core/PrefixTest.cpp diff --git a/Sourcecode/private/mxtest/core/PrincipalVoiceTest.cpp b/src/private/mxtest/core/PrincipalVoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PrincipalVoiceTest.cpp rename to src/private/mxtest/core/PrincipalVoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/PrintTest.cpp b/src/private/mxtest/core/PrintTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PrintTest.cpp rename to src/private/mxtest/core/PrintTest.cpp diff --git a/Sourcecode/private/mxtest/core/PrintTest.h b/src/private/mxtest/core/PrintTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PrintTest.h rename to src/private/mxtest/core/PrintTest.h diff --git a/Sourcecode/private/mxtest/core/PropertiesTest.cpp b/src/private/mxtest/core/PropertiesTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PropertiesTest.cpp rename to src/private/mxtest/core/PropertiesTest.cpp diff --git a/Sourcecode/private/mxtest/core/PropertiesTest.h b/src/private/mxtest/core/PropertiesTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/PropertiesTest.h rename to src/private/mxtest/core/PropertiesTest.h diff --git a/Sourcecode/private/mxtest/core/PullOffTest.cpp b/src/private/mxtest/core/PullOffTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/PullOffTest.cpp rename to src/private/mxtest/core/PullOffTest.cpp diff --git a/Sourcecode/private/mxtest/core/RehearsalTest.cpp b/src/private/mxtest/core/RehearsalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RehearsalTest.cpp rename to src/private/mxtest/core/RehearsalTest.cpp diff --git a/Sourcecode/private/mxtest/core/RelationTest.cpp b/src/private/mxtest/core/RelationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RelationTest.cpp rename to src/private/mxtest/core/RelationTest.cpp diff --git a/Sourcecode/private/mxtest/core/ReleaseTest.cpp b/src/private/mxtest/core/ReleaseTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ReleaseTest.cpp rename to src/private/mxtest/core/ReleaseTest.cpp diff --git a/Sourcecode/private/mxtest/core/RepeatTest.cpp b/src/private/mxtest/core/RepeatTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RepeatTest.cpp rename to src/private/mxtest/core/RepeatTest.cpp diff --git a/Sourcecode/private/mxtest/core/RestTest.cpp b/src/private/mxtest/core/RestTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RestTest.cpp rename to src/private/mxtest/core/RestTest.cpp diff --git a/Sourcecode/private/mxtest/core/RestTest.h b/src/private/mxtest/core/RestTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/RestTest.h rename to src/private/mxtest/core/RestTest.h diff --git a/Sourcecode/private/mxtest/core/RightDividerTest.cpp b/src/private/mxtest/core/RightDividerTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RightDividerTest.cpp rename to src/private/mxtest/core/RightDividerTest.cpp diff --git a/Sourcecode/private/mxtest/core/RightMarginTest.cpp b/src/private/mxtest/core/RightMarginTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RightMarginTest.cpp rename to src/private/mxtest/core/RightMarginTest.cpp diff --git a/Sourcecode/private/mxtest/core/RightsTest.cpp b/src/private/mxtest/core/RightsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RightsTest.cpp rename to src/private/mxtest/core/RightsTest.cpp diff --git a/Sourcecode/private/mxtest/core/RootAlterTest.cpp b/src/private/mxtest/core/RootAlterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RootAlterTest.cpp rename to src/private/mxtest/core/RootAlterTest.cpp diff --git a/Sourcecode/private/mxtest/core/RootStepTest.cpp b/src/private/mxtest/core/RootStepTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RootStepTest.cpp rename to src/private/mxtest/core/RootStepTest.cpp diff --git a/Sourcecode/private/mxtest/core/RootTest.cpp b/src/private/mxtest/core/RootTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/RootTest.cpp rename to src/private/mxtest/core/RootTest.cpp diff --git a/Sourcecode/private/mxtest/core/RootTest.h b/src/private/mxtest/core/RootTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/RootTest.h rename to src/private/mxtest/core/RootTest.h diff --git a/Sourcecode/private/mxtest/core/ScalingTest.cpp b/src/private/mxtest/core/ScalingTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ScalingTest.cpp rename to src/private/mxtest/core/ScalingTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScalingTest.h b/src/private/mxtest/core/ScalingTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ScalingTest.h rename to src/private/mxtest/core/ScalingTest.h diff --git a/Sourcecode/private/mxtest/core/SchleiferTest.cpp b/src/private/mxtest/core/SchleiferTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SchleiferTest.cpp rename to src/private/mxtest/core/SchleiferTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScoopTest.cpp b/src/private/mxtest/core/ScoopTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ScoopTest.cpp rename to src/private/mxtest/core/ScoopTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScordaturaTest.cpp b/src/private/mxtest/core/ScordaturaTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ScordaturaTest.cpp rename to src/private/mxtest/core/ScordaturaTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScordaturaTest.h b/src/private/mxtest/core/ScordaturaTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ScordaturaTest.h rename to src/private/mxtest/core/ScordaturaTest.h diff --git a/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.cpp b/src/private/mxtest/core/ScoreHeaderGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.cpp rename to src/private/mxtest/core/ScoreHeaderGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.h b/src/private/mxtest/core/ScoreHeaderGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ScoreHeaderGroupTest.h rename to src/private/mxtest/core/ScoreHeaderGroupTest.h diff --git a/Sourcecode/private/mxtest/core/ScoreInstrumentTest.cpp b/src/private/mxtest/core/ScoreInstrumentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ScoreInstrumentTest.cpp rename to src/private/mxtest/core/ScoreInstrumentTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScoreInstrumentTest.h b/src/private/mxtest/core/ScoreInstrumentTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ScoreInstrumentTest.h rename to src/private/mxtest/core/ScoreInstrumentTest.h diff --git a/Sourcecode/private/mxtest/core/ScorePartTest.cpp b/src/private/mxtest/core/ScorePartTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ScorePartTest.cpp rename to src/private/mxtest/core/ScorePartTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScorePartTest.h b/src/private/mxtest/core/ScorePartTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ScorePartTest.h rename to src/private/mxtest/core/ScorePartTest.h diff --git a/Sourcecode/private/mxtest/core/ScorePartwiseTest.cpp b/src/private/mxtest/core/ScorePartwiseTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ScorePartwiseTest.cpp rename to src/private/mxtest/core/ScorePartwiseTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScorePartwiseTest.h b/src/private/mxtest/core/ScorePartwiseTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ScorePartwiseTest.h rename to src/private/mxtest/core/ScorePartwiseTest.h diff --git a/Sourcecode/private/mxtest/core/ScoreTimewiseTest.cpp b/src/private/mxtest/core/ScoreTimewiseTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ScoreTimewiseTest.cpp rename to src/private/mxtest/core/ScoreTimewiseTest.cpp diff --git a/Sourcecode/private/mxtest/core/ScoreTimewiseTest.h b/src/private/mxtest/core/ScoreTimewiseTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ScoreTimewiseTest.h rename to src/private/mxtest/core/ScoreTimewiseTest.h diff --git a/Sourcecode/private/mxtest/core/SegnoTest.cpp b/src/private/mxtest/core/SegnoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SegnoTest.cpp rename to src/private/mxtest/core/SegnoTest.cpp diff --git a/Sourcecode/private/mxtest/core/SemiPitchedTest.cpp b/src/private/mxtest/core/SemiPitchedTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SemiPitchedTest.cpp rename to src/private/mxtest/core/SemiPitchedTest.cpp diff --git a/Sourcecode/private/mxtest/core/SenzaMisuraTest.cpp b/src/private/mxtest/core/SenzaMisuraTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SenzaMisuraTest.cpp rename to src/private/mxtest/core/SenzaMisuraTest.cpp diff --git a/Sourcecode/private/mxtest/core/ShakeTest.cpp b/src/private/mxtest/core/ShakeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ShakeTest.cpp rename to src/private/mxtest/core/ShakeTest.cpp diff --git a/Sourcecode/private/mxtest/core/SignTest.cpp b/src/private/mxtest/core/SignTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SignTest.cpp rename to src/private/mxtest/core/SignTest.cpp diff --git a/Sourcecode/private/mxtest/core/SlashDotTest.cpp b/src/private/mxtest/core/SlashDotTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SlashDotTest.cpp rename to src/private/mxtest/core/SlashDotTest.cpp diff --git a/Sourcecode/private/mxtest/core/SlashTest.cpp b/src/private/mxtest/core/SlashTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SlashTest.cpp rename to src/private/mxtest/core/SlashTest.cpp diff --git a/Sourcecode/private/mxtest/core/SlashTypeTest.cpp b/src/private/mxtest/core/SlashTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SlashTypeTest.cpp rename to src/private/mxtest/core/SlashTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/SlideTest.cpp b/src/private/mxtest/core/SlideTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SlideTest.cpp rename to src/private/mxtest/core/SlideTest.cpp diff --git a/Sourcecode/private/mxtest/core/SlurTest.cpp b/src/private/mxtest/core/SlurTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SlurTest.cpp rename to src/private/mxtest/core/SlurTest.cpp diff --git a/Sourcecode/private/mxtest/core/SnapPizzicatoTest.cpp b/src/private/mxtest/core/SnapPizzicatoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SnapPizzicatoTest.cpp rename to src/private/mxtest/core/SnapPizzicatoTest.cpp diff --git a/Sourcecode/private/mxtest/core/SoftwareTest.cpp b/src/private/mxtest/core/SoftwareTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SoftwareTest.cpp rename to src/private/mxtest/core/SoftwareTest.cpp diff --git a/Sourcecode/private/mxtest/core/SoloTest.cpp b/src/private/mxtest/core/SoloTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SoloTest.cpp rename to src/private/mxtest/core/SoloTest.cpp diff --git a/Sourcecode/private/mxtest/core/SoundTest.cpp b/src/private/mxtest/core/SoundTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SoundTest.cpp rename to src/private/mxtest/core/SoundTest.cpp diff --git a/Sourcecode/private/mxtest/core/SoundTest.h b/src/private/mxtest/core/SoundTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/SoundTest.h rename to src/private/mxtest/core/SoundTest.h diff --git a/Sourcecode/private/mxtest/core/SoundingPitchTest.cpp b/src/private/mxtest/core/SoundingPitchTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SoundingPitchTest.cpp rename to src/private/mxtest/core/SoundingPitchTest.cpp diff --git a/Sourcecode/private/mxtest/core/SourceTest.cpp b/src/private/mxtest/core/SourceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SourceTest.cpp rename to src/private/mxtest/core/SourceTest.cpp diff --git a/Sourcecode/private/mxtest/core/SpiccatoTest.cpp b/src/private/mxtest/core/SpiccatoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SpiccatoTest.cpp rename to src/private/mxtest/core/SpiccatoTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaccatissimoTest.cpp b/src/private/mxtest/core/StaccatissimoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaccatissimoTest.cpp rename to src/private/mxtest/core/StaccatissimoTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaccatoTest.cpp b/src/private/mxtest/core/StaccatoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaccatoTest.cpp rename to src/private/mxtest/core/StaccatoTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaffDetailsTest.cpp b/src/private/mxtest/core/StaffDetailsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaffDetailsTest.cpp rename to src/private/mxtest/core/StaffDetailsTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaffDistanceTest.cpp b/src/private/mxtest/core/StaffDistanceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaffDistanceTest.cpp rename to src/private/mxtest/core/StaffDistanceTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaffLayoutTest.cpp b/src/private/mxtest/core/StaffLayoutTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaffLayoutTest.cpp rename to src/private/mxtest/core/StaffLayoutTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaffLayoutTest.h b/src/private/mxtest/core/StaffLayoutTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/StaffLayoutTest.h rename to src/private/mxtest/core/StaffLayoutTest.h diff --git a/Sourcecode/private/mxtest/core/StaffLinesTest.cpp b/src/private/mxtest/core/StaffLinesTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaffLinesTest.cpp rename to src/private/mxtest/core/StaffLinesTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaffSizeTest.cpp b/src/private/mxtest/core/StaffSizeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaffSizeTest.cpp rename to src/private/mxtest/core/StaffSizeTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaffTest.cpp b/src/private/mxtest/core/StaffTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaffTest.cpp rename to src/private/mxtest/core/StaffTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaffTuningTest.cpp b/src/private/mxtest/core/StaffTuningTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaffTuningTest.cpp rename to src/private/mxtest/core/StaffTuningTest.cpp diff --git a/Sourcecode/private/mxtest/core/StaffTypeTest.cpp b/src/private/mxtest/core/StaffTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StaffTypeTest.cpp rename to src/private/mxtest/core/StaffTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/StavesTest.cpp b/src/private/mxtest/core/StavesTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StavesTest.cpp rename to src/private/mxtest/core/StavesTest.cpp diff --git a/Sourcecode/private/mxtest/core/StemTest.cpp b/src/private/mxtest/core/StemTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StemTest.cpp rename to src/private/mxtest/core/StemTest.cpp diff --git a/Sourcecode/private/mxtest/core/StepTest.cpp b/src/private/mxtest/core/StepTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StepTest.cpp rename to src/private/mxtest/core/StepTest.cpp diff --git a/Sourcecode/private/mxtest/core/StickLocationTest.cpp b/src/private/mxtest/core/StickLocationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StickLocationTest.cpp rename to src/private/mxtest/core/StickLocationTest.cpp diff --git a/Sourcecode/private/mxtest/core/StickMaterialTest.cpp b/src/private/mxtest/core/StickMaterialTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StickMaterialTest.cpp rename to src/private/mxtest/core/StickMaterialTest.cpp diff --git a/Sourcecode/private/mxtest/core/StickTest.cpp b/src/private/mxtest/core/StickTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StickTest.cpp rename to src/private/mxtest/core/StickTest.cpp diff --git a/Sourcecode/private/mxtest/core/StickTest.h b/src/private/mxtest/core/StickTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/StickTest.h rename to src/private/mxtest/core/StickTest.h diff --git a/Sourcecode/private/mxtest/core/StickTypeTest.cpp b/src/private/mxtest/core/StickTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StickTypeTest.cpp rename to src/private/mxtest/core/StickTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/StoppedTest.cpp b/src/private/mxtest/core/StoppedTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StoppedTest.cpp rename to src/private/mxtest/core/StoppedTest.cpp diff --git a/Sourcecode/private/mxtest/core/StressTest.cpp b/src/private/mxtest/core/StressTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StressTest.cpp rename to src/private/mxtest/core/StressTest.cpp diff --git a/Sourcecode/private/mxtest/core/StringMuteTest.cpp b/src/private/mxtest/core/StringMuteTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StringMuteTest.cpp rename to src/private/mxtest/core/StringMuteTest.cpp diff --git a/Sourcecode/private/mxtest/core/StringTest.cpp b/src/private/mxtest/core/StringTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StringTest.cpp rename to src/private/mxtest/core/StringTest.cpp diff --git a/Sourcecode/private/mxtest/core/StringsTest.cpp b/src/private/mxtest/core/StringsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StringsTest.cpp rename to src/private/mxtest/core/StringsTest.cpp diff --git a/Sourcecode/private/mxtest/core/StrongAccentTest.cpp b/src/private/mxtest/core/StrongAccentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/StrongAccentTest.cpp rename to src/private/mxtest/core/StrongAccentTest.cpp diff --git a/Sourcecode/private/mxtest/core/StrongAccentTest.h b/src/private/mxtest/core/StrongAccentTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/StrongAccentTest.h rename to src/private/mxtest/core/StrongAccentTest.h diff --git a/Sourcecode/private/mxtest/core/SuffixTest.cpp b/src/private/mxtest/core/SuffixTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SuffixTest.cpp rename to src/private/mxtest/core/SuffixTest.cpp diff --git a/Sourcecode/private/mxtest/core/SupportsTest.cpp b/src/private/mxtest/core/SupportsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SupportsTest.cpp rename to src/private/mxtest/core/SupportsTest.cpp diff --git a/Sourcecode/private/mxtest/core/SyllabicTest.cpp b/src/private/mxtest/core/SyllabicTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SyllabicTest.cpp rename to src/private/mxtest/core/SyllabicTest.cpp diff --git a/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.cpp b/src/private/mxtest/core/SyllabicTextGroupTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SyllabicTextGroupTest.cpp rename to src/private/mxtest/core/SyllabicTextGroupTest.cpp diff --git a/Sourcecode/private/mxtest/core/SyllabicTextGroupTest.h b/src/private/mxtest/core/SyllabicTextGroupTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/SyllabicTextGroupTest.h rename to src/private/mxtest/core/SyllabicTextGroupTest.h diff --git a/Sourcecode/private/mxtest/core/SystemDistanceTest.cpp b/src/private/mxtest/core/SystemDistanceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SystemDistanceTest.cpp rename to src/private/mxtest/core/SystemDistanceTest.cpp diff --git a/Sourcecode/private/mxtest/core/SystemDividersTest.cpp b/src/private/mxtest/core/SystemDividersTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SystemDividersTest.cpp rename to src/private/mxtest/core/SystemDividersTest.cpp diff --git a/Sourcecode/private/mxtest/core/SystemDividersTest.h b/src/private/mxtest/core/SystemDividersTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/SystemDividersTest.h rename to src/private/mxtest/core/SystemDividersTest.h diff --git a/Sourcecode/private/mxtest/core/SystemLayoutTest.cpp b/src/private/mxtest/core/SystemLayoutTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SystemLayoutTest.cpp rename to src/private/mxtest/core/SystemLayoutTest.cpp diff --git a/Sourcecode/private/mxtest/core/SystemLayoutTest.h b/src/private/mxtest/core/SystemLayoutTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/SystemLayoutTest.h rename to src/private/mxtest/core/SystemLayoutTest.h diff --git a/Sourcecode/private/mxtest/core/SystemMarginsTest.cpp b/src/private/mxtest/core/SystemMarginsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/SystemMarginsTest.cpp rename to src/private/mxtest/core/SystemMarginsTest.cpp diff --git a/Sourcecode/private/mxtest/core/SystemMarginsTest.h b/src/private/mxtest/core/SystemMarginsTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/SystemMarginsTest.h rename to src/private/mxtest/core/SystemMarginsTest.h diff --git a/Sourcecode/private/mxtest/core/TapTest.cpp b/src/private/mxtest/core/TapTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TapTest.cpp rename to src/private/mxtest/core/TapTest.cpp diff --git a/Sourcecode/private/mxtest/core/TechnicalChoiceTest.cpp b/src/private/mxtest/core/TechnicalChoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TechnicalChoiceTest.cpp rename to src/private/mxtest/core/TechnicalChoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/TechnicalChoiceTest.h b/src/private/mxtest/core/TechnicalChoiceTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/TechnicalChoiceTest.h rename to src/private/mxtest/core/TechnicalChoiceTest.h diff --git a/Sourcecode/private/mxtest/core/TechnicalTest.cpp b/src/private/mxtest/core/TechnicalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TechnicalTest.cpp rename to src/private/mxtest/core/TechnicalTest.cpp diff --git a/Sourcecode/private/mxtest/core/TechnicalTest.h b/src/private/mxtest/core/TechnicalTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/TechnicalTest.h rename to src/private/mxtest/core/TechnicalTest.h diff --git a/Sourcecode/private/mxtest/core/TenthsTest.cpp b/src/private/mxtest/core/TenthsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TenthsTest.cpp rename to src/private/mxtest/core/TenthsTest.cpp diff --git a/Sourcecode/private/mxtest/core/TenutoTest.cpp b/src/private/mxtest/core/TenutoTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TenutoTest.cpp rename to src/private/mxtest/core/TenutoTest.cpp diff --git a/Sourcecode/private/mxtest/core/TextTest.cpp b/src/private/mxtest/core/TextTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TextTest.cpp rename to src/private/mxtest/core/TextTest.cpp diff --git a/Sourcecode/private/mxtest/core/ThumbPositionTest.cpp b/src/private/mxtest/core/ThumbPositionTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ThumbPositionTest.cpp rename to src/private/mxtest/core/ThumbPositionTest.cpp diff --git a/Sourcecode/private/mxtest/core/TieTest.cpp b/src/private/mxtest/core/TieTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TieTest.cpp rename to src/private/mxtest/core/TieTest.cpp diff --git a/Sourcecode/private/mxtest/core/TiedTest.cpp b/src/private/mxtest/core/TiedTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TiedTest.cpp rename to src/private/mxtest/core/TiedTest.cpp diff --git a/Sourcecode/private/mxtest/core/TimeModificationTest.cpp b/src/private/mxtest/core/TimeModificationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TimeModificationTest.cpp rename to src/private/mxtest/core/TimeModificationTest.cpp diff --git a/Sourcecode/private/mxtest/core/TimeModificationTest.h b/src/private/mxtest/core/TimeModificationTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/TimeModificationTest.h rename to src/private/mxtest/core/TimeModificationTest.h diff --git a/Sourcecode/private/mxtest/core/TimeRelationTest.cpp b/src/private/mxtest/core/TimeRelationTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TimeRelationTest.cpp rename to src/private/mxtest/core/TimeRelationTest.cpp diff --git a/Sourcecode/private/mxtest/core/TimeTest.cpp b/src/private/mxtest/core/TimeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TimeTest.cpp rename to src/private/mxtest/core/TimeTest.cpp diff --git a/Sourcecode/private/mxtest/core/TimewiseMeasureTest.cpp b/src/private/mxtest/core/TimewiseMeasureTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TimewiseMeasureTest.cpp rename to src/private/mxtest/core/TimewiseMeasureTest.cpp diff --git a/Sourcecode/private/mxtest/core/TimewiseMeasureTest.h b/src/private/mxtest/core/TimewiseMeasureTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/TimewiseMeasureTest.h rename to src/private/mxtest/core/TimewiseMeasureTest.h diff --git a/Sourcecode/private/mxtest/core/TimewisePartTest.cpp b/src/private/mxtest/core/TimewisePartTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TimewisePartTest.cpp rename to src/private/mxtest/core/TimewisePartTest.cpp diff --git a/Sourcecode/private/mxtest/core/TimewisePartTest.h b/src/private/mxtest/core/TimewisePartTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/TimewisePartTest.h rename to src/private/mxtest/core/TimewisePartTest.h diff --git a/Sourcecode/private/mxtest/core/TimpaniTest.cpp b/src/private/mxtest/core/TimpaniTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TimpaniTest.cpp rename to src/private/mxtest/core/TimpaniTest.cpp diff --git a/Sourcecode/private/mxtest/core/ToeTest.cpp b/src/private/mxtest/core/ToeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/ToeTest.cpp rename to src/private/mxtest/core/ToeTest.cpp diff --git a/Sourcecode/private/mxtest/core/ToeTest.h b/src/private/mxtest/core/ToeTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/ToeTest.h rename to src/private/mxtest/core/ToeTest.h diff --git a/Sourcecode/private/mxtest/core/TopMarginTest.cpp b/src/private/mxtest/core/TopMarginTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TopMarginTest.cpp rename to src/private/mxtest/core/TopMarginTest.cpp diff --git a/Sourcecode/private/mxtest/core/TopSystemDistanceTest.cpp b/src/private/mxtest/core/TopSystemDistanceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TopSystemDistanceTest.cpp rename to src/private/mxtest/core/TopSystemDistanceTest.cpp diff --git a/Sourcecode/private/mxtest/core/TouchingPitchTest.cpp b/src/private/mxtest/core/TouchingPitchTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TouchingPitchTest.cpp rename to src/private/mxtest/core/TouchingPitchTest.cpp diff --git a/Sourcecode/private/mxtest/core/TransposeTest.cpp b/src/private/mxtest/core/TransposeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TransposeTest.cpp rename to src/private/mxtest/core/TransposeTest.cpp diff --git a/Sourcecode/private/mxtest/core/TremoloTest.cpp b/src/private/mxtest/core/TremoloTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TremoloTest.cpp rename to src/private/mxtest/core/TremoloTest.cpp diff --git a/Sourcecode/private/mxtest/core/TrillMarkTest.cpp b/src/private/mxtest/core/TrillMarkTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TrillMarkTest.cpp rename to src/private/mxtest/core/TrillMarkTest.cpp diff --git a/Sourcecode/private/mxtest/core/TripleTongueTest.cpp b/src/private/mxtest/core/TripleTongueTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TripleTongueTest.cpp rename to src/private/mxtest/core/TripleTongueTest.cpp diff --git a/Sourcecode/private/mxtest/core/TuningAlterTest.cpp b/src/private/mxtest/core/TuningAlterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TuningAlterTest.cpp rename to src/private/mxtest/core/TuningAlterTest.cpp diff --git a/Sourcecode/private/mxtest/core/TuningOctaveTest.cpp b/src/private/mxtest/core/TuningOctaveTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TuningOctaveTest.cpp rename to src/private/mxtest/core/TuningOctaveTest.cpp diff --git a/Sourcecode/private/mxtest/core/TuningStepTest.cpp b/src/private/mxtest/core/TuningStepTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TuningStepTest.cpp rename to src/private/mxtest/core/TuningStepTest.cpp diff --git a/Sourcecode/private/mxtest/core/TupletActualTest.cpp b/src/private/mxtest/core/TupletActualTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TupletActualTest.cpp rename to src/private/mxtest/core/TupletActualTest.cpp diff --git a/Sourcecode/private/mxtest/core/TupletActualTest.h b/src/private/mxtest/core/TupletActualTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/TupletActualTest.h rename to src/private/mxtest/core/TupletActualTest.h diff --git a/Sourcecode/private/mxtest/core/TupletDotTest.cpp b/src/private/mxtest/core/TupletDotTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TupletDotTest.cpp rename to src/private/mxtest/core/TupletDotTest.cpp diff --git a/Sourcecode/private/mxtest/core/TupletNormalTest.cpp b/src/private/mxtest/core/TupletNormalTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TupletNormalTest.cpp rename to src/private/mxtest/core/TupletNormalTest.cpp diff --git a/Sourcecode/private/mxtest/core/TupletNormalTest.h b/src/private/mxtest/core/TupletNormalTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/TupletNormalTest.h rename to src/private/mxtest/core/TupletNormalTest.h diff --git a/Sourcecode/private/mxtest/core/TupletTest.cpp b/src/private/mxtest/core/TupletTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TupletTest.cpp rename to src/private/mxtest/core/TupletTest.cpp diff --git a/Sourcecode/private/mxtest/core/TupletTest.h b/src/private/mxtest/core/TupletTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/TupletTest.h rename to src/private/mxtest/core/TupletTest.h diff --git a/Sourcecode/private/mxtest/core/TupletTypeTest.cpp b/src/private/mxtest/core/TupletTypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TupletTypeTest.cpp rename to src/private/mxtest/core/TupletTypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/TurnTest.cpp b/src/private/mxtest/core/TurnTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TurnTest.cpp rename to src/private/mxtest/core/TurnTest.cpp diff --git a/Sourcecode/private/mxtest/core/TypeTest.cpp b/src/private/mxtest/core/TypeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/TypeTest.cpp rename to src/private/mxtest/core/TypeTest.cpp diff --git a/Sourcecode/private/mxtest/core/UnpitchedTest.cpp b/src/private/mxtest/core/UnpitchedTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/UnpitchedTest.cpp rename to src/private/mxtest/core/UnpitchedTest.cpp diff --git a/Sourcecode/private/mxtest/core/UnpitchedTest.h b/src/private/mxtest/core/UnpitchedTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/UnpitchedTest.h rename to src/private/mxtest/core/UnpitchedTest.h diff --git a/Sourcecode/private/mxtest/core/UnstressTest.cpp b/src/private/mxtest/core/UnstressTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/UnstressTest.cpp rename to src/private/mxtest/core/UnstressTest.cpp diff --git a/Sourcecode/private/mxtest/core/UpBowTest.cpp b/src/private/mxtest/core/UpBowTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/UpBowTest.cpp rename to src/private/mxtest/core/UpBowTest.cpp diff --git a/Sourcecode/private/mxtest/core/VerticalTurnTest.cpp b/src/private/mxtest/core/VerticalTurnTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/VerticalTurnTest.cpp rename to src/private/mxtest/core/VerticalTurnTest.cpp diff --git a/Sourcecode/private/mxtest/core/VirtualInstrumentTest.cpp b/src/private/mxtest/core/VirtualInstrumentTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/VirtualInstrumentTest.cpp rename to src/private/mxtest/core/VirtualInstrumentTest.cpp diff --git a/Sourcecode/private/mxtest/core/VirtualInstrumentTest.h b/src/private/mxtest/core/VirtualInstrumentTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/VirtualInstrumentTest.h rename to src/private/mxtest/core/VirtualInstrumentTest.h diff --git a/Sourcecode/private/mxtest/core/VirtualLibraryTest.cpp b/src/private/mxtest/core/VirtualLibraryTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/VirtualLibraryTest.cpp rename to src/private/mxtest/core/VirtualLibraryTest.cpp diff --git a/Sourcecode/private/mxtest/core/VirtualNameTest.cpp b/src/private/mxtest/core/VirtualNameTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/VirtualNameTest.cpp rename to src/private/mxtest/core/VirtualNameTest.cpp diff --git a/Sourcecode/private/mxtest/core/VoiceTest.cpp b/src/private/mxtest/core/VoiceTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/VoiceTest.cpp rename to src/private/mxtest/core/VoiceTest.cpp diff --git a/Sourcecode/private/mxtest/core/VolumeTest.cpp b/src/private/mxtest/core/VolumeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/VolumeTest.cpp rename to src/private/mxtest/core/VolumeTest.cpp diff --git a/Sourcecode/private/mxtest/core/WavyLineTest.cpp b/src/private/mxtest/core/WavyLineTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WavyLineTest.cpp rename to src/private/mxtest/core/WavyLineTest.cpp diff --git a/Sourcecode/private/mxtest/core/WedgeTest.cpp b/src/private/mxtest/core/WedgeTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WedgeTest.cpp rename to src/private/mxtest/core/WedgeTest.cpp diff --git a/Sourcecode/private/mxtest/core/WithBarTest.cpp b/src/private/mxtest/core/WithBarTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WithBarTest.cpp rename to src/private/mxtest/core/WithBarTest.cpp diff --git a/Sourcecode/private/mxtest/core/WoodTest.cpp b/src/private/mxtest/core/WoodTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WoodTest.cpp rename to src/private/mxtest/core/WoodTest.cpp diff --git a/Sourcecode/private/mxtest/core/WordFontTest.cpp b/src/private/mxtest/core/WordFontTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WordFontTest.cpp rename to src/private/mxtest/core/WordFontTest.cpp diff --git a/Sourcecode/private/mxtest/core/WordsTest.cpp b/src/private/mxtest/core/WordsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WordsTest.cpp rename to src/private/mxtest/core/WordsTest.cpp diff --git a/Sourcecode/private/mxtest/core/WorkNumberTest.cpp b/src/private/mxtest/core/WorkNumberTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WorkNumberTest.cpp rename to src/private/mxtest/core/WorkNumberTest.cpp diff --git a/Sourcecode/private/mxtest/core/WorkTest.cpp b/src/private/mxtest/core/WorkTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WorkTest.cpp rename to src/private/mxtest/core/WorkTest.cpp diff --git a/Sourcecode/private/mxtest/core/WorkTest.h b/src/private/mxtest/core/WorkTest.h similarity index 100% rename from Sourcecode/private/mxtest/core/WorkTest.h rename to src/private/mxtest/core/WorkTest.h diff --git a/Sourcecode/private/mxtest/core/WorkTitleTest.cpp b/src/private/mxtest/core/WorkTitleTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/WorkTitleTest.cpp rename to src/private/mxtest/core/WorkTitleTest.cpp diff --git a/Sourcecode/private/mxtest/core/YesNoNumberTest.cpp b/src/private/mxtest/core/YesNoNumberTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/core/YesNoNumberTest.cpp rename to src/private/mxtest/core/YesNoNumberTest.cpp diff --git a/Sourcecode/private/mxtest/file/MxFile.h b/src/private/mxtest/file/MxFile.h similarity index 100% rename from Sourcecode/private/mxtest/file/MxFile.h rename to src/private/mxtest/file/MxFile.h diff --git a/Sourcecode/private/mxtest/file/MxFileRepository.h b/src/private/mxtest/file/MxFileRepository.h similarity index 100% rename from Sourcecode/private/mxtest/file/MxFileRepository.h rename to src/private/mxtest/file/MxFileRepository.h diff --git a/Sourcecode/private/mxtest/file/MxFileRepositoy.cpp b/src/private/mxtest/file/MxFileRepositoy.cpp similarity index 100% rename from Sourcecode/private/mxtest/file/MxFileRepositoy.cpp rename to src/private/mxtest/file/MxFileRepositoy.cpp diff --git a/Sourcecode/private/mxtest/file/MxFileTest.cpp b/src/private/mxtest/file/MxFileTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/file/MxFileTest.cpp rename to src/private/mxtest/file/MxFileTest.cpp diff --git a/Sourcecode/private/mxtest/file/MxFileTest.h b/src/private/mxtest/file/MxFileTest.h similarity index 100% rename from Sourcecode/private/mxtest/file/MxFileTest.h rename to src/private/mxtest/file/MxFileTest.h diff --git a/Sourcecode/private/mxtest/file/MxFileTestGroup.cpp b/src/private/mxtest/file/MxFileTestGroup.cpp similarity index 100% rename from Sourcecode/private/mxtest/file/MxFileTestGroup.cpp rename to src/private/mxtest/file/MxFileTestGroup.cpp diff --git a/Sourcecode/private/mxtest/file/MxFileTestGroup.h b/src/private/mxtest/file/MxFileTestGroup.h similarity index 100% rename from Sourcecode/private/mxtest/file/MxFileTestGroup.h rename to src/private/mxtest/file/MxFileTestGroup.h diff --git a/Sourcecode/private/mxtest/file/Path.h b/src/private/mxtest/file/Path.h similarity index 100% rename from Sourcecode/private/mxtest/file/Path.h rename to src/private/mxtest/file/Path.h diff --git a/Sourcecode/private/mxtest/file/StupidFileFunctions.cpp b/src/private/mxtest/file/StupidFileFunctions.cpp similarity index 100% rename from Sourcecode/private/mxtest/file/StupidFileFunctions.cpp rename to src/private/mxtest/file/StupidFileFunctions.cpp diff --git a/Sourcecode/private/mxtest/file/StupidFileFunctions.h b/src/private/mxtest/file/StupidFileFunctions.h similarity index 100% rename from Sourcecode/private/mxtest/file/StupidFileFunctions.h rename to src/private/mxtest/file/StupidFileFunctions.h diff --git a/Sourcecode/private/mxtest/impl/CurveFunctionsTest.cpp b/src/private/mxtest/impl/CurveFunctionsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/impl/CurveFunctionsTest.cpp rename to src/private/mxtest/impl/CurveFunctionsTest.cpp diff --git a/Sourcecode/private/mxtest/impl/DirectionReaderTest.cpp b/src/private/mxtest/impl/DirectionReaderTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/impl/DirectionReaderTest.cpp rename to src/private/mxtest/impl/DirectionReaderTest.cpp diff --git a/Sourcecode/private/mxtest/impl/DirectionWriterTest.cpp b/src/private/mxtest/impl/DirectionWriterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/impl/DirectionWriterTest.cpp rename to src/private/mxtest/impl/DirectionWriterTest.cpp diff --git a/Sourcecode/private/mxtest/impl/MagicTemplatesTest.cpp b/src/private/mxtest/impl/MagicTemplatesTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/impl/MagicTemplatesTest.cpp rename to src/private/mxtest/impl/MagicTemplatesTest.cpp diff --git a/Sourcecode/private/mxtest/impl/MeasureWriterTest.cpp b/src/private/mxtest/impl/MeasureWriterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/impl/MeasureWriterTest.cpp rename to src/private/mxtest/impl/MeasureWriterTest.cpp diff --git a/Sourcecode/private/mxtest/impl/PositionFunctionsTest.cpp b/src/private/mxtest/impl/PositionFunctionsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/impl/PositionFunctionsTest.cpp rename to src/private/mxtest/impl/PositionFunctionsTest.cpp diff --git a/Sourcecode/private/mxtest/impl/PrintFunctionsTest.cpp b/src/private/mxtest/impl/PrintFunctionsTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/impl/PrintFunctionsTest.cpp rename to src/private/mxtest/impl/PrintFunctionsTest.cpp diff --git a/Sourcecode/private/mxtest/impl/ScoreWriterTest.cpp b/src/private/mxtest/impl/ScoreWriterTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/impl/ScoreWriterTest.cpp rename to src/private/mxtest/impl/ScoreWriterTest.cpp diff --git a/Sourcecode/private/mxtest/import/ChangeValues.cpp b/src/private/mxtest/import/ChangeValues.cpp similarity index 100% rename from Sourcecode/private/mxtest/import/ChangeValues.cpp rename to src/private/mxtest/import/ChangeValues.cpp diff --git a/Sourcecode/private/mxtest/import/ChangeValues.h b/src/private/mxtest/import/ChangeValues.h similarity index 100% rename from Sourcecode/private/mxtest/import/ChangeValues.h rename to src/private/mxtest/import/ChangeValues.h diff --git a/Sourcecode/private/mxtest/import/DecimalFields.h b/src/private/mxtest/import/DecimalFields.h similarity index 100% rename from Sourcecode/private/mxtest/import/DecimalFields.h rename to src/private/mxtest/import/DecimalFields.h diff --git a/Sourcecode/private/mxtest/import/ExpectedFiles.cpp b/src/private/mxtest/import/ExpectedFiles.cpp similarity index 100% rename from Sourcecode/private/mxtest/import/ExpectedFiles.cpp rename to src/private/mxtest/import/ExpectedFiles.cpp diff --git a/Sourcecode/private/mxtest/import/ExpectedFiles.h b/src/private/mxtest/import/ExpectedFiles.h similarity index 100% rename from Sourcecode/private/mxtest/import/ExpectedFiles.h rename to src/private/mxtest/import/ExpectedFiles.h diff --git a/Sourcecode/private/mxtest/import/ImportTest.cpp b/src/private/mxtest/import/ImportTest.cpp similarity index 100% rename from Sourcecode/private/mxtest/import/ImportTest.cpp rename to src/private/mxtest/import/ImportTest.cpp diff --git a/Sourcecode/private/mxtest/import/ImportTestImpl.cpp b/src/private/mxtest/import/ImportTestImpl.cpp similarity index 100% rename from Sourcecode/private/mxtest/import/ImportTestImpl.cpp rename to src/private/mxtest/import/ImportTestImpl.cpp diff --git a/Sourcecode/private/mxtest/import/ImportTestImpl.h b/src/private/mxtest/import/ImportTestImpl.h similarity index 100% rename from Sourcecode/private/mxtest/import/ImportTestImpl.h rename to src/private/mxtest/import/ImportTestImpl.h diff --git a/Sourcecode/private/mxtest/import/SortAttributes.cpp b/src/private/mxtest/import/SortAttributes.cpp similarity index 100% rename from Sourcecode/private/mxtest/import/SortAttributes.cpp rename to src/private/mxtest/import/SortAttributes.cpp diff --git a/Sourcecode/private/mxtest/import/SortAttributes.h b/src/private/mxtest/import/SortAttributes.h similarity index 100% rename from Sourcecode/private/mxtest/import/SortAttributes.h rename to src/private/mxtest/import/SortAttributes.h From 9c22dcad19af098633ce25b1910dd036b4636b1f Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:49:52 +0200 Subject: [PATCH 29/34] rename Xcode -> xcode Update path references in DevScripts/build-for-apple.sh, mxdeploy.rb, mxdeploy-v01.rb, mxdeploy-v02.rb, and mxdeploy. --- DevScripts/build-for-apple.sh | 2 +- DevScripts/mxdeploy | 4 ++-- DevScripts/mxdeploy-v01.rb | 4 ++-- DevScripts/mxdeploy-v02.rb | 4 ++-- DevScripts/mxdeploy.rb | 8 ++++---- {Xcode => xcode}/Mx.xcodeproj/project.pbxproj | 0 .../project.xcworkspace/contents.xcworkspacedata | 0 .../Mx.xcodeproj/xcshareddata/xcschemes/Mx.xcscheme | 0 .../Mx.xcodeproj/xcshareddata/xcschemes/MxiOS.xcscheme | 0 .../Mx.xcodeproj/xcshareddata/xcschemes/MxmacOS.xcscheme | 0 .../xcshareddata/xcschemes/dylib-iOS.xcscheme | 0 .../xcshareddata/xcschemes/dylib-macOS.xcscheme | 0 {Xcode => xcode}/MxiOS/Info.plist | 0 {Xcode => xcode}/MxiOS/Info.plist~HEAD | 0 {Xcode => xcode}/MxiOS/Info.plist~develop | 0 {Xcode => xcode}/MxiOS/MxiOS.h | 0 {Xcode => xcode}/MxmacOS/Info.plist | 0 {Xcode => xcode}/MxmacOS/MxmacOS.h | 0 {Xcode => xcode}/build_xcframework.sh | 0 {Xcode => xcode}/mx.xcworkspace/contents.xcworkspacedata | 0 .../mx.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | 0 21 files changed, 11 insertions(+), 11 deletions(-) rename {Xcode => xcode}/Mx.xcodeproj/project.pbxproj (100%) rename {Xcode => xcode}/Mx.xcodeproj/project.xcworkspace/contents.xcworkspacedata (100%) rename {Xcode => xcode}/Mx.xcodeproj/xcshareddata/xcschemes/Mx.xcscheme (100%) rename {Xcode => xcode}/Mx.xcodeproj/xcshareddata/xcschemes/MxiOS.xcscheme (100%) rename {Xcode => xcode}/Mx.xcodeproj/xcshareddata/xcschemes/MxmacOS.xcscheme (100%) rename {Xcode => xcode}/Mx.xcodeproj/xcshareddata/xcschemes/dylib-iOS.xcscheme (100%) rename {Xcode => xcode}/Mx.xcodeproj/xcshareddata/xcschemes/dylib-macOS.xcscheme (100%) rename {Xcode => xcode}/MxiOS/Info.plist (100%) rename {Xcode => xcode}/MxiOS/Info.plist~HEAD (100%) rename {Xcode => xcode}/MxiOS/Info.plist~develop (100%) rename {Xcode => xcode}/MxiOS/MxiOS.h (100%) rename {Xcode => xcode}/MxmacOS/Info.plist (100%) rename {Xcode => xcode}/MxmacOS/MxmacOS.h (100%) rename {Xcode => xcode}/build_xcframework.sh (100%) rename {Xcode => xcode}/mx.xcworkspace/contents.xcworkspacedata (100%) rename {Xcode => xcode}/mx.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) diff --git a/DevScripts/build-for-apple.sh b/DevScripts/build-for-apple.sh index 0852c133d..20193bc1b 100755 --- a/DevScripts/build-for-apple.sh +++ b/DevScripts/build-for-apple.sh @@ -111,7 +111,7 @@ set_variables() { # directories this_script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" mx_dir="${this_script_dir}/.." - xcworkspace="${mx_dir}/Xcode/mx.xcworkspace" + xcworkspace="${mx_dir}/xcode/mx.xcworkspace" # artifact names ios_name="MxiOS" diff --git a/DevScripts/mxdeploy b/DevScripts/mxdeploy index eafea0315..024bbcd88 100755 --- a/DevScripts/mxdeploy +++ b/DevScripts/mxdeploy @@ -3,7 +3,7 @@ rm -rf /Users/mjb/MxBin/Build/Products/ # build iOS xcodebuild \ - -workspace ~/Dropbox/Programming/MxRepo/Xcode/mx.xcworkspace \ + -workspace ~/Dropbox/Programming/MxRepo/xcode/mx.xcworkspace \ -scheme dylib-iOS \ build \ -derivedDataPath ~/MxBin \ @@ -23,7 +23,7 @@ rm -rf /Users/mjb/MxBin/Build/Products/Debug-iphonesimulator # build macOS xcodebuild \ - -workspace ~/Dropbox/Programming/MxRepo/Xcode/mx.xcworkspace \ + -workspace ~/Dropbox/Programming/MxRepo/xcode/mx.xcworkspace \ -scheme dylib-macOS \ build \ -derivedDataPath ~/MxBin \ diff --git a/DevScripts/mxdeploy-v01.rb b/DevScripts/mxdeploy-v01.rb index 816c5fdd8..cfd4bed67 100644 --- a/DevScripts/mxdeploy-v01.rb +++ b/DevScripts/mxdeploy-v01.rb @@ -64,7 +64,7 @@ puts "building version #{version}" build_ios = "xcodebuild \ - -workspace #{mx_repo_root}/Xcode/mx.xcworkspace \ + -workspace #{mx_repo_root}/xcode/mx.xcworkspace \ -scheme Mx-iOS \ build \ -derivedDataPath #{build_root} \ @@ -79,7 +79,7 @@ end build_mac = "xcodebuild \ - -workspace #{mx_repo_root}/Xcode/mx.xcworkspace \ + -workspace #{mx_repo_root}/xcode/mx.xcworkspace \ -scheme Mx-macOS \ build \ -derivedDataPath #{build_root} \ diff --git a/DevScripts/mxdeploy-v02.rb b/DevScripts/mxdeploy-v02.rb index ae6eae524..924f2c09d 100644 --- a/DevScripts/mxdeploy-v02.rb +++ b/DevScripts/mxdeploy-v02.rb @@ -9,7 +9,7 @@ name_mx_pkg = "mx-src-pkg" name_mx_src = "src" -name_mx_proj = "Xcode" +name_mx_proj = "xcode" dir_this_ruby_script = File.dirname(File.realpath(__FILE__)) dir_mx_root = "#{dir_this_ruby_script}/.." @@ -67,7 +67,7 @@ ########################################################################### # -# Copy sourcecode and Xcode projects to a temporary directory, then zip the +# Copy sourcecode and xcode projects to a temporary directory, then zip the # the temporary directory and delete the unzipped version. # ########################################################################### diff --git a/DevScripts/mxdeploy.rb b/DevScripts/mxdeploy.rb index 1d1ca5c10..507839fe7 100644 --- a/DevScripts/mxdeploy.rb +++ b/DevScripts/mxdeploy.rb @@ -11,7 +11,7 @@ name_mx_pkg = "mx-version" name_mx_src = "src" -name_mx_proj = "Xcode" +name_mx_proj = "xcode" name_versioning_file = "current.txt" name_ios_target = "MxiOS" name_osx_target = "MxmacOS" @@ -23,7 +23,7 @@ dir_build = "/Users/mjb/mx-temp" dir_this_ruby_script = File.dirname(File.realpath(__FILE__)) dir_mx_root = File.expand_path("#{dir_this_ruby_script}/..") -file_mx_xcode_workspace = "#{dir_mx_root}/Xcode/mx.xcworkspace" +file_mx_xcode_workspace = "#{dir_mx_root}/xcode/mx.xcworkspace" file_mx_version_defines_h = "#{dir_mx_root}/src/mx/impl/MxVersionDefines.h" dir_komp_root = "/Users/mjb/repos/komp" @@ -222,8 +222,8 @@ file_zipped_source = "#{dir_build}/#{name_zipped_filename}" FileUtils.mkdir_p "#{dir_code_copy_before_zipping}/src" FileUtils.cp_r "#{dir_mx_root}/src", "#{dir_code_copy_before_zipping}/src" -FileUtils.mkdir_p "#{dir_code_copy_before_zipping}/Xcode" -FileUtils.cp_r "#{dir_mx_root}/Xcode", "#{dir_code_copy_before_zipping}/Xcode" +FileUtils.mkdir_p "#{dir_code_copy_before_zipping}/xcode" +FileUtils.cp_r "#{dir_mx_root}/xcode", "#{dir_code_copy_before_zipping}/xcode" system( "cd \"#{dir_build}\" && tar -zcvf \"#{name_zipped_filename}\" \"#{name_mx_pkg}\"" ) FileUtils.cp "#{file_zipped_source}", "#{dir_komp_mx_src}" FileUtils.rm_rf(dir_code_copy_before_zipping) diff --git a/Xcode/Mx.xcodeproj/project.pbxproj b/xcode/Mx.xcodeproj/project.pbxproj similarity index 100% rename from Xcode/Mx.xcodeproj/project.pbxproj rename to xcode/Mx.xcodeproj/project.pbxproj diff --git a/Xcode/Mx.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/xcode/Mx.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Xcode/Mx.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to xcode/Mx.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Xcode/Mx.xcodeproj/xcshareddata/xcschemes/Mx.xcscheme b/xcode/Mx.xcodeproj/xcshareddata/xcschemes/Mx.xcscheme similarity index 100% rename from Xcode/Mx.xcodeproj/xcshareddata/xcschemes/Mx.xcscheme rename to xcode/Mx.xcodeproj/xcshareddata/xcschemes/Mx.xcscheme diff --git a/Xcode/Mx.xcodeproj/xcshareddata/xcschemes/MxiOS.xcscheme b/xcode/Mx.xcodeproj/xcshareddata/xcschemes/MxiOS.xcscheme similarity index 100% rename from Xcode/Mx.xcodeproj/xcshareddata/xcschemes/MxiOS.xcscheme rename to xcode/Mx.xcodeproj/xcshareddata/xcschemes/MxiOS.xcscheme diff --git a/Xcode/Mx.xcodeproj/xcshareddata/xcschemes/MxmacOS.xcscheme b/xcode/Mx.xcodeproj/xcshareddata/xcschemes/MxmacOS.xcscheme similarity index 100% rename from Xcode/Mx.xcodeproj/xcshareddata/xcschemes/MxmacOS.xcscheme rename to xcode/Mx.xcodeproj/xcshareddata/xcschemes/MxmacOS.xcscheme diff --git a/Xcode/Mx.xcodeproj/xcshareddata/xcschemes/dylib-iOS.xcscheme b/xcode/Mx.xcodeproj/xcshareddata/xcschemes/dylib-iOS.xcscheme similarity index 100% rename from Xcode/Mx.xcodeproj/xcshareddata/xcschemes/dylib-iOS.xcscheme rename to xcode/Mx.xcodeproj/xcshareddata/xcschemes/dylib-iOS.xcscheme diff --git a/Xcode/Mx.xcodeproj/xcshareddata/xcschemes/dylib-macOS.xcscheme b/xcode/Mx.xcodeproj/xcshareddata/xcschemes/dylib-macOS.xcscheme similarity index 100% rename from Xcode/Mx.xcodeproj/xcshareddata/xcschemes/dylib-macOS.xcscheme rename to xcode/Mx.xcodeproj/xcshareddata/xcschemes/dylib-macOS.xcscheme diff --git a/Xcode/MxiOS/Info.plist b/xcode/MxiOS/Info.plist similarity index 100% rename from Xcode/MxiOS/Info.plist rename to xcode/MxiOS/Info.plist diff --git a/Xcode/MxiOS/Info.plist~HEAD b/xcode/MxiOS/Info.plist~HEAD similarity index 100% rename from Xcode/MxiOS/Info.plist~HEAD rename to xcode/MxiOS/Info.plist~HEAD diff --git a/Xcode/MxiOS/Info.plist~develop b/xcode/MxiOS/Info.plist~develop similarity index 100% rename from Xcode/MxiOS/Info.plist~develop rename to xcode/MxiOS/Info.plist~develop diff --git a/Xcode/MxiOS/MxiOS.h b/xcode/MxiOS/MxiOS.h similarity index 100% rename from Xcode/MxiOS/MxiOS.h rename to xcode/MxiOS/MxiOS.h diff --git a/Xcode/MxmacOS/Info.plist b/xcode/MxmacOS/Info.plist similarity index 100% rename from Xcode/MxmacOS/Info.plist rename to xcode/MxmacOS/Info.plist diff --git a/Xcode/MxmacOS/MxmacOS.h b/xcode/MxmacOS/MxmacOS.h similarity index 100% rename from Xcode/MxmacOS/MxmacOS.h rename to xcode/MxmacOS/MxmacOS.h diff --git a/Xcode/build_xcframework.sh b/xcode/build_xcframework.sh similarity index 100% rename from Xcode/build_xcframework.sh rename to xcode/build_xcframework.sh diff --git a/Xcode/mx.xcworkspace/contents.xcworkspacedata b/xcode/mx.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Xcode/mx.xcworkspace/contents.xcworkspacedata rename to xcode/mx.xcworkspace/contents.xcworkspacedata diff --git a/Xcode/mx.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/xcode/mx.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Xcode/mx.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to xcode/mx.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist From f45b355bd2b5e94d909dff5259c6fa3f290d5c45 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:50:56 +0200 Subject: [PATCH 30/34] rename DevScripts -> gen/version-a Update AGENTS.md. Adjust all relative paths in scripts from one level up (../X) to two levels up (../../X) now that they live inside gen/version-a/ rather than at the repo root. --- AGENTS.md | 4 ++-- .../version-a}/ElementsOrder.xlsx | Bin {DevScripts => gen/version-a}/addStubs.rb | 0 .../version-a}/adjustElementsCpp.rb | 4 ++-- .../version-a}/adjustElementsH.rb | 4 ++-- {DevScripts => gen/version-a}/arrowGroup.rb | 0 {DevScripts => gen/version-a}/attributes.rb | 8 ++++---- .../version-a}/attributesLoop.rb | 2 +- .../version-a}/beatUnitGroup.rb | 0 .../version-a}/build-for-apple.sh | 2 +- {DevScripts => gen/version-a}/choices.rb | 0 .../version-a}/creditWordsGroup.rb | 0 {DevScripts => gen/version-a}/cueNoteGroup.rb | 0 .../version-a}/displayStepOctaveGroup.rb | 0 .../version-a}/editorialGroup.rb | 0 .../editorialVoiceDirectionGroup.rb | 0 .../version-a}/editorialVoiceGroup.rb | 0 .../version-a}/elementsHUsingFile.rb | 2 +- .../version-a}/elisionSyllabicGroup.rb | 0 .../version-a}/elisionSyllabicTextGroup.rb | 0 .../version-a}/findFilesWithBadCopyright.rb | 18 +++++++++--------- {DevScripts => gen/version-a}/fromXElement.rb | 8 ++++---- .../version-a}/fullNoteGroup.rb | 0 .../version-a}/graceNoteGroup.rb | 0 {DevScripts => gen/version-a}/groupCode.rb | 0 {DevScripts => gen/version-a}/includeAlot.rb | 2 +- .../version-a}/includeAttributesIfNeeded.rb | 0 .../version-a}/includeEnumsIfNeeded.rb | 0 .../version-a}/includeIfNeeded.rb | 0 .../version-a}/includeStandaloneIfNeeded.rb | 0 .../version-a}/isSymbolFound.rb | 0 {DevScripts => gen/version-a}/layoutGroup.rb | 0 .../version-a}/lineInstructionsH.rb | 2 +- .../version-a}/listAttributeClasses.rb | 0 .../version-a}/listClassesInEnumsH.rb | 2 +- {DevScripts => gen/version-a}/listDecimals.rb | 2 +- .../version-a}/listElementClasses.rb | 0 {DevScripts => gen/version-a}/listEnums.rb | 2 +- {DevScripts => gen/version-a}/listIntegers.rb | 2 +- .../version-a}/listSpecialClasses.rb | 0 {DevScripts => gen/version-a}/listStrings.rb | 2 +- .../version-a}/midiDeviceInstrumentGroup.rb | 0 {DevScripts => gen/version-a}/mxdeploy | 0 {DevScripts => gen/version-a}/mxdeploy-v01.rb | 0 {DevScripts => gen/version-a}/mxdeploy-v02.rb | 2 +- {DevScripts => gen/version-a}/mxdeploy.rb | 2 +- {DevScripts => gen/version-a}/note.rb | 0 .../version-a}/parseElementsCpp.rb | 2 +- .../version-a}/parseElementsH.rb | 2 +- .../version-a}/parseElementsHOrder.rb | 4 ++-- {DevScripts => gen/version-a}/parseXsd.rb | 2 +- {DevScripts => gen/version-a}/smuflHeader.rb | 4 ++-- {DevScripts => gen/version-a}/todo.txt | 0 {DevScripts => gen/version-a}/version.rb | 2 +- .../version-a}/writeElementsCppFiles.rb | 6 +++--- {DevScripts => gen/version-a}/writeHFiles.rb | 4 ++-- 56 files changed, 48 insertions(+), 48 deletions(-) rename {DevScripts => gen/version-a}/ElementsOrder.xlsx (100%) rename {DevScripts => gen/version-a}/addStubs.rb (100%) rename {DevScripts => gen/version-a}/adjustElementsCpp.rb (65%) rename {DevScripts => gen/version-a}/adjustElementsH.rb (80%) rename {DevScripts => gen/version-a}/arrowGroup.rb (100%) rename {DevScripts => gen/version-a}/attributes.rb (96%) rename {DevScripts => gen/version-a}/attributesLoop.rb (87%) rename {DevScripts => gen/version-a}/beatUnitGroup.rb (100%) rename {DevScripts => gen/version-a}/build-for-apple.sh (99%) rename {DevScripts => gen/version-a}/choices.rb (100%) rename {DevScripts => gen/version-a}/creditWordsGroup.rb (100%) rename {DevScripts => gen/version-a}/cueNoteGroup.rb (100%) rename {DevScripts => gen/version-a}/displayStepOctaveGroup.rb (100%) rename {DevScripts => gen/version-a}/editorialGroup.rb (100%) rename {DevScripts => gen/version-a}/editorialVoiceDirectionGroup.rb (100%) rename {DevScripts => gen/version-a}/editorialVoiceGroup.rb (100%) rename {DevScripts => gen/version-a}/elementsHUsingFile.rb (94%) rename {DevScripts => gen/version-a}/elisionSyllabicGroup.rb (100%) rename {DevScripts => gen/version-a}/elisionSyllabicTextGroup.rb (100%) rename {DevScripts => gen/version-a}/findFilesWithBadCopyright.rb (90%) rename {DevScripts => gen/version-a}/fromXElement.rb (96%) rename {DevScripts => gen/version-a}/fullNoteGroup.rb (100%) rename {DevScripts => gen/version-a}/graceNoteGroup.rb (100%) rename {DevScripts => gen/version-a}/groupCode.rb (100%) rename {DevScripts => gen/version-a}/includeAlot.rb (78%) rename {DevScripts => gen/version-a}/includeAttributesIfNeeded.rb (100%) rename {DevScripts => gen/version-a}/includeEnumsIfNeeded.rb (100%) rename {DevScripts => gen/version-a}/includeIfNeeded.rb (100%) rename {DevScripts => gen/version-a}/includeStandaloneIfNeeded.rb (100%) rename {DevScripts => gen/version-a}/isSymbolFound.rb (100%) rename {DevScripts => gen/version-a}/layoutGroup.rb (100%) rename {DevScripts => gen/version-a}/lineInstructionsH.rb (98%) rename {DevScripts => gen/version-a}/listAttributeClasses.rb (100%) rename {DevScripts => gen/version-a}/listClassesInEnumsH.rb (88%) rename {DevScripts => gen/version-a}/listDecimals.rb (93%) rename {DevScripts => gen/version-a}/listElementClasses.rb (100%) rename {DevScripts => gen/version-a}/listEnums.rb (88%) rename {DevScripts => gen/version-a}/listIntegers.rb (93%) rename {DevScripts => gen/version-a}/listSpecialClasses.rb (100%) rename {DevScripts => gen/version-a}/listStrings.rb (93%) rename {DevScripts => gen/version-a}/midiDeviceInstrumentGroup.rb (100%) rename {DevScripts => gen/version-a}/mxdeploy (100%) rename {DevScripts => gen/version-a}/mxdeploy-v01.rb (100%) rename {DevScripts => gen/version-a}/mxdeploy-v02.rb (98%) rename {DevScripts => gen/version-a}/mxdeploy.rb (99%) rename {DevScripts => gen/version-a}/note.rb (100%) rename {DevScripts => gen/version-a}/parseElementsCpp.rb (97%) rename {DevScripts => gen/version-a}/parseElementsH.rb (98%) rename {DevScripts => gen/version-a}/parseElementsHOrder.rb (83%) rename {DevScripts => gen/version-a}/parseXsd.rb (71%) rename {DevScripts => gen/version-a}/smuflHeader.rb (91%) rename {DevScripts => gen/version-a}/todo.txt (100%) rename {DevScripts => gen/version-a}/version.rb (84%) rename {DevScripts => gen/version-a}/writeElementsCppFiles.rb (93%) rename {DevScripts => gen/version-a}/writeHFiles.rb (97%) diff --git a/AGENTS.md b/AGENTS.md index 9ee0ed93b..ced77832a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,7 +22,7 @@ Key paths in this repository: - `gen/version-b/src/` — Generator source: XSD parsing, model, and C++ emission - `data/` — MusicXML input files and expected-output suites for round-trip tests - `docs/` — MusicXML XSD specifications and developer notes -- `DevScripts/` — Ruby and shell scripts for one-off code maintenance +- `gen/version-a/` — Ruby and shell scripts for one-off code maintenance - `CMakeLists.txt` — CMake build configuration - `Makefile` — Primary build-and-test entry point (wraps CMake; `make help` lists targets) - `README.md` — Project overview, build instructions, and usage examples @@ -31,7 +31,7 @@ Key paths in this repository: ## Historical Context `src/private/mx/core/` and `src/private/mx/core/elements/` was originally -"hand-generated" by human brute-force using Ruby scripts which can still be found in `./DevScripts`. +"hand-generated" by human brute-force using Ruby scripts which can still be found in `./gen/version-a`. This was never a one-shot solution to generating the code from the XSD spec. Rather, it was an iterative process, solving problems encountered one-at-a-time until the XSD spec was entirely covered. As such, it is not viable for re-use at this time, but can be used to understand the diff --git a/DevScripts/ElementsOrder.xlsx b/gen/version-a/ElementsOrder.xlsx similarity index 100% rename from DevScripts/ElementsOrder.xlsx rename to gen/version-a/ElementsOrder.xlsx diff --git a/DevScripts/addStubs.rb b/gen/version-a/addStubs.rb similarity index 100% rename from DevScripts/addStubs.rb rename to gen/version-a/addStubs.rb diff --git a/DevScripts/adjustElementsCpp.rb b/gen/version-a/adjustElementsCpp.rb similarity index 65% rename from DevScripts/adjustElementsCpp.rb rename to gen/version-a/adjustElementsCpp.rb index b96857fa4..aee394e62 100755 --- a/DevScripts/adjustElementsCpp.rb +++ b/gen/version-a/adjustElementsCpp.rb @@ -1,12 +1,12 @@ lines = [] -File.open("../src/mx/core/Elements.cpp", "r") do |input_file| +File.open("../../src/mx/core/Elements.cpp", "r") do |input_file| input_file.each_line do |line| lines << line end end -File.open("../src/mx/core/Elements.cpp.replace", "w") do |f| +File.open("../../src/mx/core/Elements.cpp.replace", "w") do |f| write_line = true lines.each do |line| diff --git a/DevScripts/adjustElementsH.rb b/gen/version-a/adjustElementsH.rb similarity index 80% rename from DevScripts/adjustElementsH.rb rename to gen/version-a/adjustElementsH.rb index 1605432b6..bf7c89dcb 100755 --- a/DevScripts/adjustElementsH.rb +++ b/gen/version-a/adjustElementsH.rb @@ -1,12 +1,12 @@ lines = [] -File.open("../src/mx/core/Elements.h", "r") do |input_file| +File.open("../../src/mx/core/Elements.h", "r") do |input_file| input_file.each_line do |line| lines << line end end -File.open("../src/mx/core/Elements.h.replace", "w") do |f| +File.open("../../src/mx/core/Elements.h.replace", "w") do |f| write_line = true lines.each do |line| diff --git a/DevScripts/arrowGroup.rb b/gen/version-a/arrowGroup.rb similarity index 100% rename from DevScripts/arrowGroup.rb rename to gen/version-a/arrowGroup.rb diff --git a/DevScripts/attributes.rb b/gen/version-a/attributes.rb similarity index 96% rename from DevScripts/attributes.rb rename to gen/version-a/attributes.rb index 17fef1a4a..089e37e19 100755 --- a/DevScripts/attributes.rb +++ b/gen/version-a/attributes.rb @@ -138,7 +138,7 @@ def implementAttributeImport class_name cline_first_include = -1 cline_last_function_close = -1 - File.open("../src/mx/core/elements/#{class_name}.cpp", "r") do |f| + File.open("../../src/mx/core/elements/#{class_name}.cpp", "r") do |f| is_first_include_found = false rx_first_include = /\#include/ rx_function_close = / \}/ @@ -163,7 +163,7 @@ def implementAttributeImport class_name hintermediates = [] - File.open("../src/mx/core/elements/#{class_name}.h", "r") do |f| + File.open("../../src/mx/core/elements/#{class_name}.h", "r") do |f| #puts caller.first rx_public = / public\:/ is_member_list = false @@ -276,7 +276,7 @@ def implementAttributeImport class_name - File.open("../src/mx/core/elements/#{class_name}.h", "w") do |f| + File.open("../../src/mx/core/elements/#{class_name}.h", "w") do |f| hlines.each_with_index do |line, index| if( index == hlines_last_member ) f << "\n" @@ -287,7 +287,7 @@ def implementAttributeImport class_name end - File.open("../src/mx/core/elements/#{class_name}.cpp", "w") do |f| + File.open("../../src/mx/core/elements/#{class_name}.cpp", "w") do |f| clines.each_with_index do |line, index| if( index == cline_first_include ) f << line diff --git a/DevScripts/attributesLoop.rb b/gen/version-a/attributesLoop.rb similarity index 87% rename from DevScripts/attributesLoop.rb rename to gen/version-a/attributesLoop.rb index 66229567a..bf4766c13 100755 --- a/DevScripts/attributesLoop.rb +++ b/gen/version-a/attributesLoop.rb @@ -1,6 +1,6 @@ require_relative 'attributes.rb' require 'pathname' -paths = Dir["../src/mx/core/elements/*.h"] +paths = Dir["../../src/mx/core/elements/*.h"] names = [] diff --git a/DevScripts/beatUnitGroup.rb b/gen/version-a/beatUnitGroup.rb similarity index 100% rename from DevScripts/beatUnitGroup.rb rename to gen/version-a/beatUnitGroup.rb diff --git a/DevScripts/build-for-apple.sh b/gen/version-a/build-for-apple.sh similarity index 99% rename from DevScripts/build-for-apple.sh rename to gen/version-a/build-for-apple.sh index 20193bc1b..f64ba8929 100755 --- a/DevScripts/build-for-apple.sh +++ b/gen/version-a/build-for-apple.sh @@ -110,7 +110,7 @@ delete_build_dir() { set_variables() { # directories this_script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - mx_dir="${this_script_dir}/.." + mx_dir="${this_script_dir}/../.." xcworkspace="${mx_dir}/xcode/mx.xcworkspace" # artifact names diff --git a/DevScripts/choices.rb b/gen/version-a/choices.rb similarity index 100% rename from DevScripts/choices.rb rename to gen/version-a/choices.rb diff --git a/DevScripts/creditWordsGroup.rb b/gen/version-a/creditWordsGroup.rb similarity index 100% rename from DevScripts/creditWordsGroup.rb rename to gen/version-a/creditWordsGroup.rb diff --git a/DevScripts/cueNoteGroup.rb b/gen/version-a/cueNoteGroup.rb similarity index 100% rename from DevScripts/cueNoteGroup.rb rename to gen/version-a/cueNoteGroup.rb diff --git a/DevScripts/displayStepOctaveGroup.rb b/gen/version-a/displayStepOctaveGroup.rb similarity index 100% rename from DevScripts/displayStepOctaveGroup.rb rename to gen/version-a/displayStepOctaveGroup.rb diff --git a/DevScripts/editorialGroup.rb b/gen/version-a/editorialGroup.rb similarity index 100% rename from DevScripts/editorialGroup.rb rename to gen/version-a/editorialGroup.rb diff --git a/DevScripts/editorialVoiceDirectionGroup.rb b/gen/version-a/editorialVoiceDirectionGroup.rb similarity index 100% rename from DevScripts/editorialVoiceDirectionGroup.rb rename to gen/version-a/editorialVoiceDirectionGroup.rb diff --git a/DevScripts/editorialVoiceGroup.rb b/gen/version-a/editorialVoiceGroup.rb similarity index 100% rename from DevScripts/editorialVoiceGroup.rb rename to gen/version-a/editorialVoiceGroup.rb diff --git a/DevScripts/elementsHUsingFile.rb b/gen/version-a/elementsHUsingFile.rb similarity index 94% rename from DevScripts/elementsHUsingFile.rb rename to gen/version-a/elementsHUsingFile.rb index 6a752f320..693c7566b 100755 --- a/DevScripts/elementsHUsingFile.rb +++ b/gen/version-a/elementsHUsingFile.rb @@ -2,7 +2,7 @@ def elementsHUsingFile( alias_symbol, actual_symbol ) # one off stupid files for using statements - File.open("../src/mx/core/elements/#{alias_symbol}.h", "w") do |stupid_one_off_file| + File.open("../../src/mx/core/elements/#{alias_symbol}.h", "w") do |stupid_one_off_file| stupid_one_off_file << "// MusicXML Class Library v0.1.1" << "\n" stupid_one_off_file << "// Copyright (c) 2015 - 2016 by Matthew James Briggs" << "\n" stupid_one_off_file << "" << "\n" diff --git a/DevScripts/elisionSyllabicGroup.rb b/gen/version-a/elisionSyllabicGroup.rb similarity index 100% rename from DevScripts/elisionSyllabicGroup.rb rename to gen/version-a/elisionSyllabicGroup.rb diff --git a/DevScripts/elisionSyllabicTextGroup.rb b/gen/version-a/elisionSyllabicTextGroup.rb similarity index 100% rename from DevScripts/elisionSyllabicTextGroup.rb rename to gen/version-a/elisionSyllabicTextGroup.rb diff --git a/DevScripts/findFilesWithBadCopyright.rb b/gen/version-a/findFilesWithBadCopyright.rb similarity index 90% rename from DevScripts/findFilesWithBadCopyright.rb rename to gen/version-a/findFilesWithBadCopyright.rb index 833845ab3..ea7bee13b 100755 --- a/DevScripts/findFilesWithBadCopyright.rb +++ b/gen/version-a/findFilesWithBadCopyright.rb @@ -18,15 +18,15 @@ def regexify input_string regexify expected_copyright directories = [ - "../src/mx/core", - "../src/mx/core/elements", - "../src/mx/xml", - "../src/mx/utility", - "../src/mxtest/utility", - "../src/mxtest/core", - "../src/mxtest/xml", - "../src/mxtest/control", - "../src/mxtest/import" + "../../src/mx/core", + "../../src/mx/core/elements", + "../../src/mx/xml", + "../../src/mx/utility", + "../../src/mxtest/utility", + "../../src/mxtest/core", + "../../src/mxtest/xml", + "../../src/mxtest/control", + "../../src/mxtest/import" ] bad_files = [] diff --git a/DevScripts/fromXElement.rb b/gen/version-a/fromXElement.rb similarity index 96% rename from DevScripts/fromXElement.rb rename to gen/version-a/fromXElement.rb index bf33b6810..ea51cc8ae 100755 --- a/DevScripts/fromXElement.rb +++ b/gen/version-a/fromXElement.rb @@ -18,7 +18,7 @@ def to_s end end -File.open("../src/mx/core/elements/#{class_name}.h", "r") do |f| +File.open("../../src/mx/core/elements/#{class_name}.h", "r") do |f| rx_private = / private\:/ f.each_with_index do |line, index| @@ -261,7 +261,7 @@ def guts_value_without_attributes io, members io << " return true;\n" end -File.open("../src/mx/core/elements/#{class_name}.cpp", "r") do |f| +File.open("../../src/mx/core/elements/#{class_name}.cpp", "r") do |f| is_first_include_found = false rx_first_include = /\#include/ rx_function_close = / \}/ @@ -283,7 +283,7 @@ def guts_value_without_attributes io, members end -File.open("../src/mx/core/elements/#{class_name}.h", "w") do |f| +File.open("../../src/mx/core/elements/#{class_name}.h", "w") do |f| hlines.each_with_index do |line, index| if( index == hline_private ) f << " bool fromXElement( std::ostream& message, xml::XElement& xelement );" << "\n" @@ -294,7 +294,7 @@ def guts_value_without_attributes io, members end -File.open("../src/mx/core/elements/#{class_name}.cpp", "w") do |f| +File.open("../../src/mx/core/elements/#{class_name}.cpp", "w") do |f| clines.each_with_index do |line, index| if( index == cline_first_include ) f << line diff --git a/DevScripts/fullNoteGroup.rb b/gen/version-a/fullNoteGroup.rb similarity index 100% rename from DevScripts/fullNoteGroup.rb rename to gen/version-a/fullNoteGroup.rb diff --git a/DevScripts/graceNoteGroup.rb b/gen/version-a/graceNoteGroup.rb similarity index 100% rename from DevScripts/graceNoteGroup.rb rename to gen/version-a/graceNoteGroup.rb diff --git a/DevScripts/groupCode.rb b/gen/version-a/groupCode.rb similarity index 100% rename from DevScripts/groupCode.rb rename to gen/version-a/groupCode.rb diff --git a/DevScripts/includeAlot.rb b/gen/version-a/includeAlot.rb similarity index 78% rename from DevScripts/includeAlot.rb rename to gen/version-a/includeAlot.rb index c9b3a7252..95ae53250 100755 --- a/DevScripts/includeAlot.rb +++ b/gen/version-a/includeAlot.rb @@ -1,6 +1,6 @@ require 'pathname' -filepaths = Dir["../src/mx/core/elements/*"] +filepaths = Dir["../../src/mx/core/elements/*"] filepaths.each do |fp| filename = Pathname.new(fp).basename diff --git a/DevScripts/includeAttributesIfNeeded.rb b/gen/version-a/includeAttributesIfNeeded.rb similarity index 100% rename from DevScripts/includeAttributesIfNeeded.rb rename to gen/version-a/includeAttributesIfNeeded.rb diff --git a/DevScripts/includeEnumsIfNeeded.rb b/gen/version-a/includeEnumsIfNeeded.rb similarity index 100% rename from DevScripts/includeEnumsIfNeeded.rb rename to gen/version-a/includeEnumsIfNeeded.rb diff --git a/DevScripts/includeIfNeeded.rb b/gen/version-a/includeIfNeeded.rb similarity index 100% rename from DevScripts/includeIfNeeded.rb rename to gen/version-a/includeIfNeeded.rb diff --git a/DevScripts/includeStandaloneIfNeeded.rb b/gen/version-a/includeStandaloneIfNeeded.rb similarity index 100% rename from DevScripts/includeStandaloneIfNeeded.rb rename to gen/version-a/includeStandaloneIfNeeded.rb diff --git a/DevScripts/isSymbolFound.rb b/gen/version-a/isSymbolFound.rb similarity index 100% rename from DevScripts/isSymbolFound.rb rename to gen/version-a/isSymbolFound.rb diff --git a/DevScripts/layoutGroup.rb b/gen/version-a/layoutGroup.rb similarity index 100% rename from DevScripts/layoutGroup.rb rename to gen/version-a/layoutGroup.rb diff --git a/DevScripts/lineInstructionsH.rb b/gen/version-a/lineInstructionsH.rb similarity index 98% rename from DevScripts/lineInstructionsH.rb rename to gen/version-a/lineInstructionsH.rb index 6cc27f6e0..34d97024b 100755 --- a/DevScripts/lineInstructionsH.rb +++ b/gen/version-a/lineInstructionsH.rb @@ -63,7 +63,7 @@ def lineInstructionsH lines = [] - File.open("../src/mx/core/Elements.h", "r") do |f| + File.open("../../src/mx/core/Elements.h", "r") do |f| f.each_line do |line| lines << line end diff --git a/DevScripts/listAttributeClasses.rb b/gen/version-a/listAttributeClasses.rb similarity index 100% rename from DevScripts/listAttributeClasses.rb rename to gen/version-a/listAttributeClasses.rb diff --git a/DevScripts/listClassesInEnumsH.rb b/gen/version-a/listClassesInEnumsH.rb similarity index 88% rename from DevScripts/listClassesInEnumsH.rb rename to gen/version-a/listClassesInEnumsH.rb index f28f498b1..f78e9c584 100755 --- a/DevScripts/listClassesInEnumsH.rb +++ b/gen/version-a/listClassesInEnumsH.rb @@ -4,7 +4,7 @@ def listClassesInEnumsH enum_list = SortedSet.new - File.open("../src/mx/core/Enums.h", "r") do |f| + File.open("../../src/mx/core/Enums.h", "r") do |f| f.each_line do |line| rx = /^\s+class\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/listDecimals.rb b/gen/version-a/listDecimals.rb similarity index 93% rename from DevScripts/listDecimals.rb rename to gen/version-a/listDecimals.rb index f9eb59e3c..b19f6407b 100755 --- a/DevScripts/listDecimals.rb +++ b/gen/version-a/listDecimals.rb @@ -4,7 +4,7 @@ def listDecimals item_list = SortedSet.new - File.open("../src/mx/core/Decimals.h", "r") do |f| + File.open("../../src/mx/core/Decimals.h", "r") do |f| f.each_line do |line| rx = /^\s+class\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/listElementClasses.rb b/gen/version-a/listElementClasses.rb similarity index 100% rename from DevScripts/listElementClasses.rb rename to gen/version-a/listElementClasses.rb diff --git a/DevScripts/listEnums.rb b/gen/version-a/listEnums.rb similarity index 88% rename from DevScripts/listEnums.rb rename to gen/version-a/listEnums.rb index 2494b3c4a..7bcebf0b4 100755 --- a/DevScripts/listEnums.rb +++ b/gen/version-a/listEnums.rb @@ -4,7 +4,7 @@ def listEnums enum_list = SortedSet.new - File.open("../src/mx/core/Enums.h", "r") do |f| + File.open("../../src/mx/core/Enums.h", "r") do |f| f.each_line do |line| rx = /^\s+enum\sclass\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/listIntegers.rb b/gen/version-a/listIntegers.rb similarity index 93% rename from DevScripts/listIntegers.rb rename to gen/version-a/listIntegers.rb index 68b686c67..90e44a5fd 100755 --- a/DevScripts/listIntegers.rb +++ b/gen/version-a/listIntegers.rb @@ -4,7 +4,7 @@ def listIntegers item_list = SortedSet.new - File.open("../src/mx/core/Integers.h", "r") do |f| + File.open("../../src/mx/core/Integers.h", "r") do |f| f.each_line do |line| rx = /^\s+class\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/listSpecialClasses.rb b/gen/version-a/listSpecialClasses.rb similarity index 100% rename from DevScripts/listSpecialClasses.rb rename to gen/version-a/listSpecialClasses.rb diff --git a/DevScripts/listStrings.rb b/gen/version-a/listStrings.rb similarity index 93% rename from DevScripts/listStrings.rb rename to gen/version-a/listStrings.rb index 1ec57a46f..fa2334f3e 100755 --- a/DevScripts/listStrings.rb +++ b/gen/version-a/listStrings.rb @@ -4,7 +4,7 @@ def listStrings item_list = SortedSet.new - File.open("../src/mx/core/Strings.h", "r") do |f| + File.open("../../src/mx/core/Strings.h", "r") do |f| f.each_line do |line| rx = /^\s+class\s([a-zA-Z0-9]+)/ matches = line.match(rx) diff --git a/DevScripts/midiDeviceInstrumentGroup.rb b/gen/version-a/midiDeviceInstrumentGroup.rb similarity index 100% rename from DevScripts/midiDeviceInstrumentGroup.rb rename to gen/version-a/midiDeviceInstrumentGroup.rb diff --git a/DevScripts/mxdeploy b/gen/version-a/mxdeploy similarity index 100% rename from DevScripts/mxdeploy rename to gen/version-a/mxdeploy diff --git a/DevScripts/mxdeploy-v01.rb b/gen/version-a/mxdeploy-v01.rb similarity index 100% rename from DevScripts/mxdeploy-v01.rb rename to gen/version-a/mxdeploy-v01.rb diff --git a/DevScripts/mxdeploy-v02.rb b/gen/version-a/mxdeploy-v02.rb similarity index 98% rename from DevScripts/mxdeploy-v02.rb rename to gen/version-a/mxdeploy-v02.rb index 924f2c09d..ee700c217 100644 --- a/DevScripts/mxdeploy-v02.rb +++ b/gen/version-a/mxdeploy-v02.rb @@ -12,7 +12,7 @@ name_mx_proj = "xcode" dir_this_ruby_script = File.dirname(File.realpath(__FILE__)) -dir_mx_root = "#{dir_this_ruby_script}/.." +dir_mx_root = "#{dir_this_ruby_script}/../.." dir_mx_src = "#{dir_mx_root}/#{name_mx_src}" dir_mx_proj = "#{dir_mx_root}/#{name_mx_proj}" dir_komp_root = "/Users/mjb/komp" diff --git a/DevScripts/mxdeploy.rb b/gen/version-a/mxdeploy.rb similarity index 99% rename from DevScripts/mxdeploy.rb rename to gen/version-a/mxdeploy.rb index 507839fe7..91ef3c9d9 100644 --- a/DevScripts/mxdeploy.rb +++ b/gen/version-a/mxdeploy.rb @@ -22,7 +22,7 @@ dir_build = "/Users/mjb/mx-temp" dir_this_ruby_script = File.dirname(File.realpath(__FILE__)) -dir_mx_root = File.expand_path("#{dir_this_ruby_script}/..") +dir_mx_root = File.expand_path("#{dir_this_ruby_script}/../..") file_mx_xcode_workspace = "#{dir_mx_root}/xcode/mx.xcworkspace" file_mx_version_defines_h = "#{dir_mx_root}/src/mx/impl/MxVersionDefines.h" diff --git a/DevScripts/note.rb b/gen/version-a/note.rb similarity index 100% rename from DevScripts/note.rb rename to gen/version-a/note.rb diff --git a/DevScripts/parseElementsCpp.rb b/gen/version-a/parseElementsCpp.rb similarity index 97% rename from DevScripts/parseElementsCpp.rb rename to gen/version-a/parseElementsCpp.rb index f8ff7e144..ce6af74eb 100755 --- a/DevScripts/parseElementsCpp.rb +++ b/gen/version-a/parseElementsCpp.rb @@ -29,7 +29,7 @@ def parseElementsCpp cpp_functions = [] - File.open("../src/mx/core/Elements.cpp", "r") do |f| + File.open("../../src/mx/core/Elements.cpp", "r") do |f| f.each_with_index do |line, index| rx_scope_operator = /([a-zA-Z0-9]+)\:\:([a-zA-Z0-9]+)/ diff --git a/DevScripts/parseElementsH.rb b/gen/version-a/parseElementsH.rb similarity index 98% rename from DevScripts/parseElementsH.rb rename to gen/version-a/parseElementsH.rb index 6dc8c4dfe..e14a60324 100755 --- a/DevScripts/parseElementsH.rb +++ b/gen/version-a/parseElementsH.rb @@ -21,7 +21,7 @@ def to_s def parseElementsH declarations_found = [] - File.open("../src/mx/core/Elements.h", "r") do |f| + File.open("../../src/mx/core/Elements.h", "r") do |f| f.each_with_index do |line, index| rx = /^\s*class\s[^\s\;]+/ is_class = ( line =~ rx ) != nil diff --git a/DevScripts/parseElementsHOrder.rb b/gen/version-a/parseElementsHOrder.rb similarity index 83% rename from DevScripts/parseElementsHOrder.rb rename to gen/version-a/parseElementsHOrder.rb index 23fa14b88..e45cb81b7 100755 --- a/DevScripts/parseElementsHOrder.rb +++ b/gen/version-a/parseElementsHOrder.rb @@ -1,13 +1,13 @@ lines = [] -File.open("../src/mx/core/Elements.h", "r") do |input_file| +File.open("../../src/mx/core/Elements.h", "r") do |input_file| input_file.each_line do |line| lines << line end end i = 1 -#File.open("../src/mx/core/Elements.h.order.csv", "w") do |f| +#File.open("../../src/mx/core/Elements.h.order.csv", "w") do |f| write_line = true lines.each do |line| diff --git a/DevScripts/parseXsd.rb b/gen/version-a/parseXsd.rb similarity index 71% rename from DevScripts/parseXsd.rb rename to gen/version-a/parseXsd.rb index 9f54dce84..913d34f09 100644 --- a/DevScripts/parseXsd.rb +++ b/gen/version-a/parseXsd.rb @@ -1,6 +1,6 @@ require 'rexml/document' require 'rexml/xpath' -doc = REXML::Document.new(File.new('../docs/musicxml.xsd')) +doc = REXML::Document.new(File.new('../../docs/musicxml.xsd')) stuff = doc.elements.to_a diff --git a/DevScripts/smuflHeader.rb b/gen/version-a/smuflHeader.rb similarity index 91% rename from DevScripts/smuflHeader.rb rename to gen/version-a/smuflHeader.rb index ba53f3e69..7f6c716bd 100644 --- a/DevScripts/smuflHeader.rb +++ b/gen/version-a/smuflHeader.rb @@ -1,7 +1,7 @@ require 'json' require 'stringio' -j = JSON.parse( IO.read("../data/smufl/glyphnames.json")) +j = JSON.parse( IO.read("../../data/smufl/glyphnames.json")) content = StringIO.new @@ -43,7 +43,7 @@ content << "}\n" begin - file = File.open("../src/mx/impl/S-M-U-F-LGlyphMap.h", "w") + file = File.open("../../src/mx/impl/S-M-U-F-LGlyphMap.h", "w") file.write(content.string) rescue IOError => e #some error occur, dir not writable etc. diff --git a/DevScripts/todo.txt b/gen/version-a/todo.txt similarity index 100% rename from DevScripts/todo.txt rename to gen/version-a/todo.txt diff --git a/DevScripts/version.rb b/gen/version-a/version.rb similarity index 84% rename from DevScripts/version.rb rename to gen/version-a/version.rb index 68b8172da..dc4259371 100755 --- a/DevScripts/version.rb +++ b/gen/version-a/version.rb @@ -1,6 +1,6 @@ lines = [] -File.open("../src/mx/core/AttributesInterface.h", "r") do |input_file| +File.open("../../src/mx/core/AttributesInterface.h", "r") do |input_file| input_file.each_line do |line| lines << line end diff --git a/DevScripts/writeElementsCppFiles.rb b/gen/version-a/writeElementsCppFiles.rb similarity index 93% rename from DevScripts/writeElementsCppFiles.rb rename to gen/version-a/writeElementsCppFiles.rb index e1a9ec26f..fcf199ae1 100755 --- a/DevScripts/writeElementsCppFiles.rb +++ b/gen/version-a/writeElementsCppFiles.rb @@ -15,7 +15,7 @@ def doIncludes io_object, line_info_object element_classes = listElementClasses lines = [] - File.open("../src/mx/core/Elements.h", "r") do |f| + File.open("../../src/mx/core/Elements.h", "r") do |f| f.each_line do |line| lines << line end @@ -73,7 +73,7 @@ def writeCppFile class_name, original_file_lines, function_objects line_info = line_info_selected[0] - File.open("../src/mx/core/elements/#{class_name}.cpp", "w") do |f| + File.open("../../src/mx/core/elements/#{class_name}.cpp", "w") do |f| copywrite f emptyLine f includeH( f, class_name ) @@ -98,7 +98,7 @@ def writeCppFile class_name, original_file_lines, function_objects lines = [] -File.open("../src/mx/core/Elements.cpp", "r") do |f| +File.open("../../src/mx/core/Elements.cpp", "r") do |f| f.each_line do |line| lines << line end diff --git a/DevScripts/writeHFiles.rb b/gen/version-a/writeHFiles.rb similarity index 97% rename from DevScripts/writeHFiles.rb rename to gen/version-a/writeHFiles.rb index 5c9bbb322..f88435b62 100755 --- a/DevScripts/writeHFiles.rb +++ b/gen/version-a/writeHFiles.rb @@ -73,7 +73,7 @@ def getCodeAsString line_instruction, h_file_code_lines lines = [] -File.open("../src/mx/core/Elements.h", "r") do |f| +File.open("../../src/mx/core/Elements.h", "r") do |f| f.each_line do |line| lines << line end @@ -83,7 +83,7 @@ def getCodeAsString line_instruction, h_file_code_lines lineInstructionsH.each do |li| - File.open("../src/mx/core/elements/#{li.name}.h", "w") do |f| + File.open("../../src/mx/core/elements/#{li.name}.h", "w") do |f| f << "// MusicXML Class Library v0.1.1" << "\n" f << "// Copyright (c) 2015 - 2016 by Matthew James Briggs" << "\n" f << "" << "\n" From 51a88573d043fa066a70ee80b063cb53cab51023 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 12:52:48 +0200 Subject: [PATCH 31/34] scrub remaining stale paths after directory renames - AGENTS.md: fix Xcode/ -> xcode/ in project index - src/private/mxtest/file/Path.h: update Resources -> data - gen/version-b/src/generate/paths.rs: update Sourcecode -> src, Documents -> docs; add second p.pop() since the crate is now two levels deep under gen/version-b/ instead of one level under CodeGen/ - gen/version-a/mxdeploy: update hardcoded absolute path Sourcecode -> src - .github/workflows/ccpp.yml.archived: update old paths --- .github/workflows/ccpp.yml.archived | 6 +++--- AGENTS.md | 2 +- gen/version-a/mxdeploy | 2 +- gen/version-b/src/generate/paths.rs | 7 ++++--- src/private/mxtest/file/Path.h | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ccpp.yml.archived b/.github/workflows/ccpp.yml.archived index 83da0c90d..43598cc57 100644 --- a/.github/workflows/ccpp.yml.archived +++ b/.github/workflows/ccpp.yml.archived @@ -93,14 +93,14 @@ jobs: cache-name: cargo-home with: path: ./xcode-build - key: ${{ hashFiles('.github/cache-bust') }}-${{ hashFiles('Xcode/mx.xcworkspace', 'Xcode/Mx.xcodeproj', 'Xcode/MxTest.xcodeproj') }}-${{ hashFiles('Sourcecode/*') }} + key: ${{ hashFiles('.github/cache-bust') }}-${{ hashFiles('xcode/mx.xcworkspace', 'xcode/Mx.xcodeproj', 'xcode/MxTest.xcodeproj') }}-${{ hashFiles('src/*') }} restore-keys: | - ${{ hashFiles('.github/cache-bust') }}-${{ hashFiles('Xcode/mx.xcworkspace', 'Xcode/Mx.xcodeproj', 'Xcode/MxTest.xcodeproj') }}- + ${{ hashFiles('.github/cache-bust') }}-${{ hashFiles('xcode/mx.xcworkspace', 'xcode/Mx.xcodeproj', 'xcode/MxTest.xcodeproj') }}- ${{ hashFiles('.github/cache-bust') }}- - name: Build run: | - DevScripts/build-for-apple.sh \ + gen/version-a/build-for-apple.sh \ --outdir ./xcode-out \ --build-dir ./xcode-build \ --test false \ diff --git a/AGENTS.md b/AGENTS.md index ced77832a..f15535d6f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ Key paths in this repository: - `CMakeLists.txt` — CMake build configuration - `Makefile` — Primary build-and-test entry point (wraps CMake; `make help` lists targets) - `README.md` — Project overview, build instructions, and usage examples -- `Xcode/` — Xcode project and workspace files for macOS/iOS builds +- `xcode/` — Xcode project and workspace files for macOS/iOS builds ## Historical Context diff --git a/gen/version-a/mxdeploy b/gen/version-a/mxdeploy index 024bbcd88..894977b00 100755 --- a/gen/version-a/mxdeploy +++ b/gen/version-a/mxdeploy @@ -38,4 +38,4 @@ rm -rf /Users/mjb/komp/Frameworks/mx/headers/ mkdir /Users/mjb/komp/Frameworks/mx/headers mkdir /Users/mjb/komp/Frameworks/mx/headers/mx mkdir /Users/mjb/komp/Frameworks/mx/headers/mx/api -cp /Users/mjb/Dropbox/Programming/MxRepo/Sourcecode/mx/api/*.h /Users/mjb/komp/Frameworks/mx/headers/mx/api +cp /Users/mjb/Dropbox/Programming/MxRepo/src/mx/api/*.h /Users/mjb/komp/Frameworks/mx/headers/mx/api diff --git a/gen/version-b/src/generate/paths.rs b/gen/version-b/src/generate/paths.rs index f34a3659a..0c8160df9 100644 --- a/gen/version-b/src/generate/paths.rs +++ b/gen/version-b/src/generate/paths.rs @@ -4,6 +4,7 @@ use std::path::{Path, PathBuf}; pub fn repo() -> PathBuf { let mut p = PathBuf::from(env!("CARGO_MANIFEST_DIR")); p.pop(); + p.pop(); p.canonicalize().unwrap() } @@ -24,7 +25,7 @@ pub struct Paths { impl Default for Paths { fn default() -> Self { let r = repo(); - let core = r.join("Sourcecode").join("private").join("mx").join("core"); + let core = r.join("src").join("private").join("mx").join("core"); Self { repo: r, core: core.clone(), @@ -34,8 +35,8 @@ impl Default for Paths { integers_cpp: core.join("Integers.cpp"), decimals_h: core.join("Decimals.h"), decimals_cpp: core.join("Decimals.cpp"), - xsd_3_0: repo().join("Documents").join("musicxml.xsd"), - xsd_3_1: repo().join("Documents").join("musicxml-3.1.xsd"), + xsd_3_0: repo().join("docs").join("musicxml.xsd"), + xsd_3_1: repo().join("docs").join("musicxml-3.1.xsd"), } } } diff --git a/src/private/mxtest/file/Path.h b/src/private/mxtest/file/Path.h index 3a3ecb556..c75384382 100644 --- a/src/private/mxtest/file/Path.h +++ b/src/private/mxtest/file/Path.h @@ -20,7 +20,7 @@ inline const std::string getResourcesDirectoryPath() { std::stringstream ss; ss << MX_REPO_ROOT_PATH << FILE_PATH_SEPARATOR; - ss << "Resources" << FILE_PATH_SEPARATOR; + ss << "data" << FILE_PATH_SEPARATOR; return ss.str(); } From 697c7ea2b4d8085b06fcc1a2716169de8fcf95cd Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 13:19:48 +0200 Subject: [PATCH 32/34] changes --- AGENTS.md | 93 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index f15535d6f..bcea149fa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,49 +1,59 @@ # mx -A library for serializing and deserializing MusicXML in C++. The ./README.md file is useful. +@./README.md ## Project Index -Key paths in this repository: - -- `src/` — Main C++ source tree (public API, core elements, implementation, tests) -- `src/include/mx/api/` — Public API headers: `*Data` structs and `DocumentManager` entry - point -- `src/private/mx/api/` — Public API implementation backing the `include/mx/api` headers -- `src/private/mx/core/` — Strongly-typed MusicXML element classes (mostly code-generated) -- `src/private/mx/core/elements/` — Generated element classes, one pair per MusicXML element - (1182 files) -- `src/private/mx/impl/` — Conversion layer mapping the core DOM to the public API -- `src/private/mx/ezxml/` — Embedded lightweight XML reader/writer used by the core -- `src/private/mx/utility/` — Shared helpers (string, parsing, file system utilities) -- `src/private/mxtest/` — Test suite (api, core, file, import, impl, control) -- `src/private/cpul/` — Catch-based unit-test harness and test runner main -- `gen/version-b/` — Rust tool that generates the core element classes from the MusicXML XSD -- `gen/version-b/src/` — Generator source: XSD parsing, model, and C++ emission -- `data/` — MusicXML input files and expected-output suites for round-trip tests -- `docs/` — MusicXML XSD specifications and developer notes -- `gen/version-a/` — Ruby and shell scripts for one-off code maintenance -- `CMakeLists.txt` — CMake build configuration -- `Makefile` — Primary build-and-test entry point (wraps CMake; `make help` lists targets) -- `README.md` — Project overview, build instructions, and usage examples -- `xcode/` — Xcode project and workspace files for macOS/iOS builds - -## Historical Context - -`src/private/mx/core/` and `src/private/mx/core/elements/` was originally -"hand-generated" by human brute-force using Ruby scripts which can still be found in `./gen/version-a`. -This was never a one-shot solution to generating the code from the XSD spec. Rather, it was an -iterative process, solving problems encountered one-at-a-time until the XSD spec was entirely -covered. As such, it is not viable for re-use at this time, but can be used to understand the -historical nature of how the types were first generated. - -## The Problem +Keep this section as a Markdown table. When updating entries, maintain the table format. + +| Path | Description | +|---------------------------------|-----------------------------------------------------------------------------| +| `src/` | Main C++ source tree (public API, core elements, implementation, tests) | +| `src/include/mx/api/` | Public API headers: `*Data` structs and `DocumentManager` entry point | +| `src/private/mx/api/` | Implementation backing the public API headers | +| `src/private/mx/core/` | Strongly-typed MusicXML element classes (mostly code-generated) | +| `src/private/mx/core/elements/` | Generated element classes, one pair per MusicXML element (1182 files) | +| `src/private/mx/impl/` | Conversion layer mapping the core DOM to the public API | +| `src/private/mx/ezxml/` | Embedded lightweight XML reader/writer used by the core | +| `src/private/mx/utility/` | Shared helpers (string, parsing, file system utilities) | +| `src/private/mxtest/` | Test suite (api, core, file, import, impl, control) | +| `src/private/cpul/` | Catch-based unit-test harness and test runner main | +| `gen/version-a/` | Historical Ruby/shell scripts from the original brute-force code gen | +| `gen/version-b/` | Active Rust code generator for reproducing MusicXML 4.0 element classes | +| `data/` | MusicXML test files and expected-output suites for round-trip tests | +| `docs/musicxml.xsd` | MusicXML specification (reference) | +| `docs/ai/project/` | AI-assisted project planning and codegen design documents | +| `Makefile` | Primary build-and-test entry point (wraps CMake; `make help` lists targets) | +| `CMakeLists.txt` | CMake build configuration | + +## Code Generation - Historical Context + +`src/private/mx/core/` and `src/private/mx/core/elements/` was originally "hand-generated" by human +brute-force using Ruby scripts which can still be found in `./gen/version-a`. This was never a +one-shot solution to generating the code from the XSD spec. Rather, it was an iterative process, +solving problems encountered one-at-a-time until the XSD spec was entirely covered. As such, it is +not viable for re-use at this time, but can be used to understand the historical nature of how the +types were first generated. + +At some point, I tried to create a Rust based codegenerator in order to be able to regenerate +`mx/core`. However, this devolved and failed. It is kept in `gen/version-b` for historical +curiosity, but it never worked. + +### The Problem We are stuck somewhere around MusicXML 3.1 (or maybe 3.0) because we cannot reliably re-generate the types from a newer version of the specification. MusicxML 4.0 has been out for a long time, and we want to support it. But we need to write new code-gen tooling to reproduce the emission of the core types and then expose the new features in `src/include/mx/api/`. +Furthermore, many decisions in the original gen process were taken by hand. Using a hand-rolled +type, for example, instead of what would have strictly implemented the spec. There are human choices +throughout `mx/core` that will need to be preserved with future code generating efforts. + +Code generation was never, and should not in the future, be designed to generate any valid XSD +specification. Rather, the goal of code generation is bespoke, to produce what is needed for the +`mx` library from the MusicXML specification. + ## Quality Gates When modifying any file under `src/`, run: @@ -52,19 +62,16 @@ When modifying any file under `src/`, run: make fmt && make check && make test ``` -before considering the change complete. If the changes include anything under -`src/private/mx/core/`, use `make test-all` instead of `make test`. +If the changes include anything under `src/private/mx/core/`, use `make test-all` instead of +`make test`. -`make fmt` and `make check` run inside Docker (requires Docker on the host). No other tool -installation is needed. `make check` enforces formatting (clang-format) and zero compiler warnings -using a pinned toolchain. (clang-tidy is deferred future work, scoped to `mx/api` only - see the -design doc.) +`make fmt` and `make check` run inside Docker (requires Docker on the host). On `make check` failure, run `make fmt` to fix formatting, then address any remaining warnings manually. -See `docs/ai/project/build-and-ci-design.md` for full details on the CI pipeline and quality -gate design. +See `docs/ai/project/build-and-ci-design.md` for full details on the CI pipeline and quality gate +design. ## The Project From 7bb0da640c8824707dc039cd59afd652130f90c0 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 13:21:59 +0200 Subject: [PATCH 33/34] fix stale info in docs and README - Remove CircleCI badge (project uses GitHub Actions) - Correct make target: test-core -> test-all - Correct LICENSE filename (no .txt extension) - Fix linux-core CI description: both jobs use GCC; difference is test scope, not compiler - Correct element file count: ~590 .cpp (not ~1131) --- README.md | 6 ++---- docs/ai/project/build-and-ci-design.md | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0df51be2a..e3ffbed40 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,6 @@ * * * -[![CircleCI](https://circleci.com/gh/webern/mx.svg?style=svg)](https://circleci.com/gh/webern/mx) - ## Introduction This project is a C++ library for working with MusicXML. @@ -46,7 +44,7 @@ The `core` tests take a long time to compile. You only need them if you make cha `mx::core` namespace. Run targets build the needed mode first, then run binaries: `make test` (runs `mxtest`), -`make test-core` (full `mxtest`), `make examples-run` (runs the examples), and `make all` (full +`make test-all` (full `mxtest`), `make examples-run` (runs the examples), and `make all` (full build, examples, and full `mxtest`). `make clean` removes the build tree. Each mode builds into `build//` with its own cache and incremental state, so @@ -93,7 +91,7 @@ git clone https://github.com/webern/mx.git mxtemp mkdir mx mv mxtemp/src mx/src mv mxtemp/.gitignore mx/.gitignore -mv mxtemp/LICENSE.txt mx/LICENSE.txt +mv mxtemp/LICENSE mx/LICENSE mv mxtemp/CMakeLists.txt mx/CMakeLists.txt # we don't need the test code, either rm -rf mx/src/private/mxtest diff --git a/docs/ai/project/build-and-ci-design.md b/docs/ai/project/build-and-ci-design.md index c1b5f02aa..08b22dba8 100644 --- a/docs/ai/project/build-and-ci-design.md +++ b/docs/ai/project/build-and-ci-design.md @@ -219,8 +219,8 @@ Runner: `ubuntu-latest` | Full test suite | `make test-all` | Builds and runs the complete test suite including the slow `mx::core` tests using GCC (the system -compiler). This provides GCC compilation coverage that the Docker gate job (which uses clang) does -not. +compiler). The Docker gate job runs `make test` (no core tests); this job runs `make test-all` and +provides full test-suite coverage. #### macos (required - build + tests) @@ -301,8 +301,8 @@ other tool installation is needed for quality gates. clang-tidy is not currently a quality gate. It was evaluated and removed because running it across the whole tree is not viable: -- `src/private/mx/core/` holds ~1131 generated element `.cpp` files. clang-tidy over all of - them measured at roughly 8 s/file (~2.6 hours total). +- `src/private/mx/core/` holds ~590 generated element `.cpp` files (1182 total including headers). + clang-tidy over all of them measured at roughly 8 s/file (~1.3 hours total). - With a `src/.*` header filter, clang-tidy re-parses shared headers once per translation unit and reports millions of duplicated diagnostics. - The generated `mx/core` code is slated for replacement by a future codegen rewrite, so linting it From 681f75babcfe28145c64444c7f5b12b3067ae35c Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 17 May 2026 13:23:55 +0200 Subject: [PATCH 34/34] update changelog for recent repo changes --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 006eb7649..41595da5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,13 @@ tags. `g++-14` build, reproducible regardless of the floating CI runner images. [#145] - Replace the single workflow with a five-job GitHub Actions pipeline (Linux quality gate, Linux GCC full suite, macOS, Windows, advisory Xcode); archive the old workflow. [#145] +- Rename repository directories to lowercase conventional names: `Sourcecode` -> `src`, + `Documents` -> `docs`, `Resources` -> `data`, `CodeGen` -> `gen/version-b`, + `DevScripts` -> `gen/version-a`, `Xcode` -> `xcode`. +- Rename `LICENSE.txt` to `LICENSE`. +- Fix stale information in `README.md` and `docs/ai/project/build-and-ci-design.md`: remove + CircleCI badge, correct `make test-core` to `make test-all`, correct `LICENSE.txt` reference, + fix incorrect compiler attribution in CI job description, fix element file count. - Add Apple `XCFramework` build support. [#124] - Update the Catch2 test library to v3.2.1. [#135] - Remove the CircleCI configuration. [#136]